UNPKG

@sofaws/dapp-core

Version:

A library to hold the main logic for a dapp on the Elrond Network

3 lines (2 loc) 787 B
import{a as T}from"./chunk-2PGGQXUN.js";import{a as c}from"./chunk-V4XSYEH7.js";import{m}from"./chunk-HBP5N4FR.js";m();function x({token:t,noValue:n,showLastNonZeroDecimal:i}){var l;let o=!n&&t.value&&t.type!=="NonFungibleESDT",r=t.decimals!=null,e="";t.type==="NonFungibleESDT"&&(e="NFT"),t.type==="SemiFungibleESDT"&&(e="SFT"),t.type==="MetaESDT"&&(e="Meta-ESDT");let a="";o&&r&&(a=r?c({input:t.value,decimals:t.decimals,digits:2,showLastNonZeroDecimal:i}):Number(t.value).toLocaleString("en"));let u=T.nftDetails(String(t.identifier)),p=t.ticker===t.collection&&(l=t.identifier)!=null?l:t.ticker;return{badgeText:e,tokenFormattedAmount:o?a:null,tokenExplorerLink:u,tokenLinkText:p,token:t,noValue:n,showLastNonZeroDecimal:i}}export{x as a}; //# sourceMappingURL=chunk-OGPJ5FKP.js.map