Skip to content

Commit

Permalink
update generated client
Browse files Browse the repository at this point in the history
  • Loading branch information
facoinbase committed Oct 1, 2024
1 parent 5cc5bfe commit 5c0fd7c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 19 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),
asset.fromAtomicAmount(new Decimal(model.amount)),
new Decimal(model.block_height),
model.block_hash,
asset,
Expand Down
1 change: 0 additions & 1 deletion src/examples/solana_list_rewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Address } from "../coinbase/address";
import { NetworkIdentifier } from "../client";

async function listSolanaStakingRewards() {

const startTime = new Date(2024, 5).toISOString();

const rewards = await StakingReward.list(
Expand Down
17 changes: 0 additions & 17 deletions src/tests/historical_balance_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,5 @@ describe("HistoricalBalance", () => {
it("returns a new HistoricalBalance object with the correct asset_id", () => {
expect(historicalBalance.asset.assetId).toBe(Coinbase.assets.Eth);
});

it("returns a new HistoricalBalance object with the correct amount when empty", () => {
const historyModel: HistoricalBalanceModel = {
amount: "",
block_hash: "0x0dadd465fb063ceb78babbb30abbc6bfc0730d0c57a53e8f6dc778dafcea568f",
block_height: "11349306",
asset: {
asset_id: Coinbase.assets.Eth,
network_id: Coinbase.networks.BaseSepolia,
decimals: 18,
contract_address: "0x",
},
};
const historicalBalance = HistoricalBalance.fromModel(historyModel);

expect(historicalBalance.amount).toEqual(new Decimal(0));
});
});
});

0 comments on commit 5c0fd7c

Please sign in to comment.