Skip to content

Commit

Permalink
count
Browse files Browse the repository at this point in the history
  • Loading branch information
stjet committed Jan 14, 2024
1 parent 64ca451 commit 921e63f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/routes/explorer/supply/+page.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export async function load({ url, fetch }) {
}

const resp = await (await fetch(`${API_URL}/assets/supply/${supplyHash}`)).json();
if (!resp.success) {
const resp_count = await (await fetch(`${API_URL}/assets/supply/${supplyHash}/assets/count`)).json();
if (!resp.success || !resp_count.success) {
return {
supply_hash: supplyHash,
found: false,
Expand All @@ -29,5 +30,6 @@ export async function load({ url, fetch }) {
supply_hash: supplyHash,
found: true,
info: resp.assets, //just returns a singular supply asset, to be clear
count: resp_count.count,
};
}
2 changes: 1 addition & 1 deletion src/routes/explorer/supply/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
<span class="text-gray-500 text-xs">Max Supply</span>
<p class="text-gray-400 dark:text-gray-300">{ data.info.asset_supply.max_supply === 0 ? "No Limit" : data.info.asset_supply.max_supply }</p>
<span class="text-gray-500 text-xs">Total Minted</span>
<p class="text-gray-400 dark:text-gray-300">{data.info.asset_supply.mint_blocks_count}/{ data.info.asset_supply.max_supply === 0 ? "" : data.info.asset_supply.max_supply }</p>
<p class="text-gray-400 dark:text-gray-300">{data.count}/{ data.info.asset_supply.max_supply === 0 ? "" : data.info.asset_supply.max_supply }</p>
<span class="text-gray-500 text-xs">Protocol Version</span>
<p class="text-gray-400 dark:text-gray-300">{data.info.asset_supply.version.major_version}.{data.info.asset_supply.version.minor_version}.{data.info.asset_supply.version.patch_version}</p>
<span class="text-gray-500 text-xs">External URL</span>
Expand Down

0 comments on commit 921e63f

Please sign in to comment.