Skip to content

Commit

Permalink
update generated client
Browse files Browse the repository at this point in the history
  • Loading branch information
facoinbase committed Sep 19, 2024
1 parent 1f6a7c6 commit 06d173d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/coinbase/historical_balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class HistoricalBalance {
public static fromModel(model: HistoricalBalanceModel): HistoricalBalance {
const asset = Asset.fromModel(model.asset);
return new HistoricalBalance(
(model.amount != "") ? asset.fromAtomicAmount(new Decimal(model.amount)) : new Decimal(0),
model.amount != "" ? asset.fromAtomicAmount(new Decimal(model.amount)) : new Decimal(0),
new Decimal(model.block_height),
model.block_hash,
asset,
Expand Down
3 changes: 2 additions & 1 deletion src/examples/solana_list_rewards.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { StakingReward } from "../coinbase/staking_reward";
import { Coinbase } from "../coinbase/coinbase";
import { Address } from "../coinbase/address";
import { NetworkIdentifier } from "../client";

async function printStakingInfo() {
Coinbase.configureFromJson({ filePath: "~/Downloads/cdp_api_key.json" });
Expand All @@ -10,7 +11,7 @@ async function printStakingInfo() {
const rewards = await StakingReward.list("solana-mainnet", Coinbase.assets.Sol, ["beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar"], startTime, new Date().toISOString());
console.log(rewards);

const addr = new Address("solana-mainnet", "beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar");
const addr = new Address(NetworkIdentifier.SolanaMainnet, "beefKGBWeSpHzYBHZXwp5So7wdQGX6mu4ZHCsH3uTar");
const balances = await addr.historicalStakingBalances(Coinbase.assets.Sol, startTime, new Date().toISOString());
console.log(balances);
}
Expand Down

0 comments on commit 06d173d

Please sign in to comment.