Skip to content

Commit

Permalink
chore: actually show v2 tuna amount
Browse files Browse the repository at this point in the history
  • Loading branch information
rvcas committed Sep 26, 2024
1 parent e68d549 commit 2def3bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/components/ConnectButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@
const assetIdV2 = AssetId(V2_TUNA_POLICY_ID + TUNA_ASSET_NAME);
const utxos = await $blaze.provider.getUnspentOutputsWithAsset($userAddress, assetId);
const utxosV2 = await $blaze.provider.getUnspentOutputsWithAsset($userAddress, assetIdV2);
$v1TunaAmount = utxos.reduce((acc, u) => {
return acc + (u.output().amount().multiasset()?.get(assetId) ?? 0n);
}, 0n);
$v2TunaAmount = utxos.reduce((acc, u) => {
$v2TunaAmount = utxosV2.reduce((acc, u) => {
return acc + (u.output().amount().multiasset()?.get(assetIdV2) ?? 0n);
}, 0n);
}
Expand Down

0 comments on commit 2def3bc

Please sign in to comment.