UNPKG

@sofaws/dapp-core

Version:

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

3 lines (2 loc) 1.11 kB
import{a as h}from"./chunk-PH57BHSD.js";import{a as S}from"./chunk-UXKRFUDC.js";import{b as f}from"./chunk-V2DQWH6R.js";import{a as u}from"./chunk-44WWQAQY.js";import{a as v}from"./chunk-CTPLNYLR.js";import{a as i}from"./chunk-UB233QTH.js";import{b as g,c as p,d as l,s as k}from"./chunk-ZR7YL3KO.js";import{j as c,k as m,m as d}from"./chunk-HBP5N4FR.js";d();k();import{Address as T}from"@elrondnetwork/erdjs";import L from"bignumber.js";function B(t){let w=new L(p),e=new L(g),n=t?e.times(m.Buffer.from(t).length):0;return w.plus(n).toString(10)}function F(w){return c(this,arguments,function*({transactions:t}){let e=u(i.getState()),n=yield S(e),a=h(n);return t.map(r=>{let{value:I,receiver:o,data:N="",chainID:b,version:A=1,options:P,gasPrice:y=l,gasLimit:R=B(r.data)}=r,s=o;try{s=new T(o).hex()}catch(_){throw"Invalid Receiver address"}let D=f(i.getState()).valueOf().toString(),G=b||D;return v({value:I,receiver:s,data:N,gasPrice:y,gasLimit:Number(R),nonce:Number(a.valueOf().toString()),sender:new T(e).hex(),chainID:G,version:A,options:P})})})}export{F as a}; //# sourceMappingURL=chunk-PW6HH5QT.js.map