Skip to content

Commit

Permalink
chore: expose token metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
vladimirvolek committed Jun 10, 2024
1 parent c2da28f commit 24b2412
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/utils/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,11 @@ export const transformAsset = (
return {
...token,
fingerprint: parseAsset(token.unit).fingerprint,
...tokenRegistryMetadata?.metadata,
decimals,
};
};

export const getAssetBalance = (
asset: string,
sent: Responses['account_addresses_total']['sent_sum'],
received: Responses['account_addresses_total']['received_sum'],
) => {
const receivedAsset = received.find(r => r.unit === asset)?.quantity ?? '0';
const sentAsset = sent.find(r => r.unit === asset)?.quantity ?? '0';

return new BigNumber(receivedAsset).minus(sentAsset);
};

export const sumAssetBalances = (list: { amount: Pick<AssetBalance, 'quantity' | 'unit'>[] }[]) => {
const balances: Pick<AssetBalance, 'quantity' | 'unit'>[] = [];

Expand Down

0 comments on commit 24b2412

Please sign in to comment.