@sofaws/dapp-core
Version:
A library to hold the main logic for a dapp on the Elrond Network
3 lines (2 loc) • 1.14 kB
JavaScript
import{a as g}from"./chunk-P6USPB7C.js";import{a as c}from"./chunk-QFTWB3KE.js";import{c as i,d as s,r as o,s as P}from"./chunk-ZR7YL3KO.js";import{m as n}from"./chunk-HBP5N4FR.js";n();P();import{Transaction as G,TransactionPayload as F,TransactionVersion as L,Address as m}from"@elrondnetwork/erdjs";import{TokenPayment as T}from"@elrondnetwork/erdjs";import{NetworkConfig as x}from"@elrondnetwork/erdjs-network-providers";var d={from:"erd12dnfhej64s6c56ka369gkyj3hwv5ms0y5rxgsk2k7hkd2vuk7rvqxkalsa",to:"erd12dnfhej64s6c56ka369gkyj3hwv5ms0y5rxgsk2k7hkd2vuk7rvqxkalsa"};function B({minGasLimit:t=String(i),gasLimit:r,gasPrice:a,data:f,gasPerDataByte:l,gasPriceModifier:k,defaultGasPrice:p=String(s),chainId:u}){let I=f||"",v=c(r)?r:t,y=g(a)?a:p,h=new G({nonce:0,value:T.egldFromAmount("0"),receiver:new m(d.to),sender:new m(d.to),gasPrice:parseInt(y),gasLimit:parseInt(v),data:new F(I.trim()),chainID:u,version:new L(1)}),e=new x;e.MinGasLimit=parseInt(t),e.GasPerDataByte=parseInt(l),e.GasPriceModifier=parseFloat(k);try{return h.computeFee(e).toString(10)}catch(w){return o}}export{B as a};
//# sourceMappingURL=chunk-XDAZWGHX.js.map