UNPKG

@sofaws/dapp-core

Version:

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

3 lines (2 loc) 753 B
import{a as c}from"./chunk-XAPH7V6V.js";import{a as s,b as u}from"./chunk-SAQ2TZS4.js";import{i as f}from"./chunk-7QE2X3X4.js";import{k as n,m as o}from"./chunk-HBP5N4FR.js";o();f();import{Address as g}from"@elrondnetwork/erdjs/out";import i from"bignumber.js";u();var B=(t,d,r)=>{switch(d){case"text":try{return n.Buffer.from(String(t),"hex").toString("utf8")}catch(e){}return t;case"decimal":return new i(t,16).toString(10);case"smart":try{let e=g.fromHex(t).toString();if(c(e))return e}catch(e){}try{let e=n.Buffer.from(String(t),"hex").toString("utf8");return s(e)||r&&[...r.esdts,...r.nfts].some(m=>e.includes(m))?e:new i(t,16).toString(10)}catch(e){}return t;case"raw":default:return t}};export{B as a}; //# sourceMappingURL=chunk-3KAY5IWM.js.map