UNPKG

@aeternity/aepp-sdk

Version:
1 lines 634 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Ae=e():t.Ae=e()}(window,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=257)}([function(t,e,r){t.exports=r(167)},function(t,e){function r(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}t.exports=function(t){return function(){var e=this,n=arguments;return new Promise(function(i,o){var a=t.apply(e,n);function s(t){r(a,i,o,s,u,"next",t)}function u(t){r(a,i,o,s,u,"throw",t)}s(void 0)})}}},function(t,e){t.exports=function(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},function(t,e,r){"use strict";r.d(e,"r",function(){return v}),r.d(e,"h",function(){return y}),r.d(e,"f",function(){return _}),r.d(e,"p",function(){return x}),r.d(e,"j",function(){return T}),r.d(e,"g",function(){return j}),r.d(e,"d",function(){return M}),r.d(e,"c",function(){return C}),r.d(e,"m",function(){return I}),r.d(e,"n",function(){return P}),r.d(e,"i",function(){return R}),r.d(e,"e",function(){return B}),r.d(e,"q",function(){return U}),r.d(e,"o",function(){return jt}),r.d(e,"l",function(){return Mt}),r.d(e,"k",function(){return Vt}),r.d(e,"b",function(){return Wt}),r.d(e,"a",function(){return Kt});var n,i,o,a,s,u,c,l,f=r(2),h=r.n(f),p=r(7),d=r.n(p),m=r(10),g=r.n(m),v=1,y=11,b=function(t,e,r){return[t,e,r]},w=function(t,e){return[t,e]},_=1e9,x={account:"account",signed:"signedTx",spend:"spendTx",nameClaim:"nameClaimTx",namePreClaim:"namePreClaimTx",nameUpdate:"nameUpdateTx",nameRevoke:"nameRevokeTx",nameTransfer:"nameTransfer",contract:"contract",contractCreate:"contractCreateTx",contractCall:"contractCallTx",contractCallResult:"contractCallResult",oracleRegister:"oracleRegister",oracleExtend:"oracleExtend",oracleQuery:"oracleQuery",oracleResponse:"oracleResponse",channelCreate:"channelCreate",channelCloseMutual:"channelCloseMutual",channelCloseSolo:"channelCloseSolo",channelSlash:"channelSlash",channelDeposit:"channelDeposit",channelWithdraw:"channelWithdraw",channelSettle:"channelSettle",channelOffChain:"channelOffChain",channel:"channel",channelSnapshotSolo:"channelSnapshotSolo",channelOffChainUpdateTransfer:"channelOffChainUpdateTransfer",channelOffChainUpdateDeposit:"channelOffChainUpdateDeposit",channelOffChainUpdateWithdrawal:"channelOffChainUpdateWithdrawal",channelOffChainCreateContract:"channelOffChainCreateContract",channelOffChainCallContract:"channelOffChainCallContract",proofOfInclusion:"proofOfInclusion",stateTrees:"stateTrees",merklePatriciaTree:"merklePatriciaTree",merklePatriciaTreeValue:"merklePatriciaTreeValue",contractsTree:"contractsTree",contractCallsTree:"contractCallsTree",channelsTree:"channelsTree",nameserviceTree:"nameserviceTree",oraclesTree:"oraclesTree",accountsTree:"accountsTree"},k=1,E=3,A=4,S=0,O=1,T={1:(n={},h()(n,x.contractCreate,{vmVersion:[k],abiVersion:[O]}),h()(n,x.contractCall,{vmVersion:[k],abiVersion:[O]}),h()(n,x.oracleRegister,{vmVersion:[k],abiVersion:[S,O]}),n),2:(i={},h()(i,x.contractCreate,{vmVersion:[E],abiVersion:[O]}),h()(i,x.contractCall,{vmVersion:[E,k],abiVersion:[O]}),h()(i,x.oracleRegister,{vmVersion:[E],abiVersion:[S,O]}),i),3:(o={},h()(o,x.contractCreate,{vmVersion:[A],abiVersion:[O]}),h()(o,x.contractCall,{vmVersion:[A,k,E],abiVersion:[O]}),h()(o,x.oracleRegister,{vmVersion:[],abiVersion:[S,O]}),o)},j=(a={},h()(a,10,x.account),h()(a,y,x.signed),h()(a,12,x.spend),h()(a,32,x.nameClaim),h()(a,33,x.namePreClaim),h()(a,34,x.nameUpdate),h()(a,35,x.nameRevoke),h()(a,36,x.nameTransfer),h()(a,40,x.contract),h()(a,42,x.contractCreate),h()(a,43,x.contractCall),h()(a,41,x.contractCallResult),h()(a,22,x.oracleRegister),h()(a,25,x.oracleExtend),h()(a,23,x.oracleQuery),h()(a,24,x.oracleResponse),h()(a,50,x.channelCreate),h()(a,53,x.channelCloseMutual),h()(a,54,x.channelCloseSolo),h()(a,55,x.channelSlash),h()(a,51,x.channelDeposit),h()(a,52,x.channelWithdraw),h()(a,56,x.channelSettle),h()(a,57,x.channelOffChain),h()(a,58,x.channel),h()(a,59,x.channelSnapshotSolo),h()(a,570,x.channelOffChainUpdateTransfer),h()(a,571,x.channelOffChainUpdateDeposit),h()(a,572,x.channelOffChainUpdateWithdrawal),h()(a,573,x.channelOffChainCreateContract),h()(a,574,x.channelOffChainCallContract),h()(a,60,x.proofOfInclusion),h()(a,62,x.stateTrees),h()(a,63,x.merklePatriciaTree),h()(a,64,x.merklePatriciaTreeValue),h()(a,621,x.contractsTree),h()(a,622,x.contractCallsTree),h()(a,623,x.channelsTree),h()(a,624,x.nameserviceTree),h()(a,625,x.oraclesTree),h()(a,626,x.accountsTree),a),M={int:"int",id:"id",ids:"ids",string:"string",binary:"binary",rlpBinary:"rlpBinary",rlpBinaries:"rlpBinaries",rawBinary:"rawBinary",bool:"bool",hex:"hex",signatures:"signatures",pointers:"pointers",offChainUpdates:"offChainUpdates",callStack:"callStack",proofOfInclusion:"proofOfInclusion",mptree:"mptree",callReturnType:"callReturnType",ctVersion:"ctVersion",payload:"payload"},C=2e4,I=function(t){switch(t){case x.contractCreate:return g()(75e3);case x.contractCall:return g()(45e4);default:return g()(15e3)}},P=function(t){return function(e){var r=e.txSize,n=e.relativeTtl;switch(t){case x.oracleRegister:case x.oracleExtend:case x.oracleQuery:case x.oracleResponse:return g()(r).times(20).plus(Math.ceil(32e3*n/Math.floor(175200)));default:return g()(r).times(20)}}},R={ak:1,nm:2,cm:3,ok:4,ct:5,ch:6},B=(l=R,Object.entries(l).reduce(function(t,e){var r=d()(e,2),n=r[0];return(t[r[1]]=n)&&t},{})),N=function(t){return t},U=(s={},h()(s,M.int,function(t){var e=t.value,r=t.isMinusValue;return N("".concat(e,r?" must be >= 0":" is not of type Number or BigNumber"))}),h()(s,M.id,function(t){var e=t.value,r=t.prefix;return N("'".concat(e,"' prefix doesn't match expected prefix '").concat(r,"' or ID_TAG for prefix not found"))}),h()(s,M.binary,function(t){var e=t.prefix,r=t.value;return N("'".concat(r,"' prefix doesn't match expected prefix '").concat(e,"'"))}),h()(s,M.string,function(t){t.value;return N("Not a string")}),h()(s,M.pointers,function(t){t.value;return N('Value must be of type Array and contains only object\'s like \'{key: "account_pubkey", id: "ak_lkamsflkalsdalksdlasdlasdlamd"}\'')}),h()(s,M.ctVersion,function(t){t.value;return N('Value must be an object with "vmVersion" and "abiVersion" fields')}),s),L=[b("tag",M.int),b("VSN",M.int)],D=[].concat(L,[b("nonce",M.int),b("balance",M.int)]),q=[].concat(L,[b("flags",M.int),b("nonce",M.int),b("balance",M.int),b("gaContract",M.id,"ct"),b("gaAuthFun",M.binary,"cb")]),F=[].concat(L,[b("senderId",M.id,"ak"),b("recipientId",M.id,"ak"),b("amount",M.int),b("fee",M.int),b("ttl",M.int),b("nonce",M.int),b("payload",M.payload)]),z=[].concat(L,[b("signatures",M.signatures),b("encodedTx",M.rlpBinary)]),V=[].concat(L,[b("accountId",M.id,"ak"),b("nonce",M.int),b("commitmentId",M.id,"cm"),b("fee",M.int),b("ttl",M.int)]),W=[].concat(L,[b("accountId",M.id,"ak"),b("nonce",M.int),b("name",M.binary,"nm"),b("nameSalt",M.int),b("fee",M.int),b("ttl",M.int)]),K=[].concat(L,[b("accountId",M.id,"ak"),b("nonce",M.int),b("nameId",M.id,"nm"),b("nameTtl",M.int),b("pointers",M.pointers),b("clientTtl",M.int),b("fee",M.int),b("ttl",M.int)]),H=[].concat(L,[b("accountId",M.id,"ak"),b("nonce",M.int),b("nameId",M.id,"nm"),b("recipientId",M.id,"ak"),b("fee",M.int),b("ttl",M.int)]),Y=[].concat(L,[b("accountId",M.id,"ak"),b("nonce",M.int),b("nameId",M.id,"nm"),b("fee",M.int),b("ttl",M.int)]),$=[].concat(L,[b("owner",M.id,"ak"),b("ctVersion",M.int),b("code",M.binary,"cb"),b("log",M.binary,"cb"),b("active",M.bool),b("referers",M.ids,"ak"),b("deposit",M.int)]),J=[].concat(L,[b("ownerId",M.id,"ak"),b("nonce",M.int),b("code",M.binary,"cb"),b("ctVersion",M.ctVersion),b("fee",M.int),b("ttl",M.int),b("deposit",M.int),b("amount",M.int),b("gas",M.int),b("gasPrice",M.int),b("callData",M.binary,"cb")]),Q=[].concat(L,[b("callerId",M.id,"ak"),b("nonce",M.int),b("contractId",M.id,"ct"),b("abiVersion",M.int),b("fee",M.int),b("ttl",M.int),b("amount",M.int),b("gas",M.int),b("gasPrice",M.int),b("callData",M.binary,"cb")]),Z=[].concat(L,[b("callerId",M.id,"ak"),b("callerNonce",M.int),b("height",M.int),b("contractId",M.id,"ct"),b("gasPrice",M.int),b("gasUsed",M.int),b("returnValue",M.binary,"cb"),b("returnType",M.callReturnType),b("log",M.rawBinary)]),G=[].concat(L,[b("accountId",M.id,"ak"),b("nonce",M.int),b("queryFormat",M.string),b("responseFormat",M.string),b("queryFee",M.int),b("oracleTtlType",M.int),b("oracleTtlValue",M.int),b("fee",M.int),b("ttl",M.int),b("abiVersion",M.int)]),X=[].concat(L,[b("oracleId",M.id,"ok"),b("nonce",M.int),b("oracleTtlType",M.int),b("oracleTtlValue",M.int),b("fee",M.int),b("ttl",M.int)]),tt=[].concat(L,[b("senderId",M.id,"ak"),b("nonce",M.int),b("oracleId",M.id,"ok"),b("query",M.string),b("queryFee",M.int),b("queryTtlType",M.int),b("queryTtlValue",M.int),b("responseTtlType",M.int),b("responseTtlValue",M.int),b("fee",M.int),b("ttl",M.int)]),et=[].concat(L,[b("oracleId",M.id,"ok"),b("nonce",M.int),b("queryId",M.binary,"oq"),b("response",M.string),b("responseTtlType",M.int),b("responseTtlValue",M.int),b("fee",M.int),b("ttl",M.int)]),rt=[].concat(L,[b("initiator",M.id,"ak"),b("initiatorAmount",M.int),b("responder",M.id,"ak"),b("responderAmount",M.int),b("channelReserve",M.int),b("lockPeriod",M.int),b("ttl",M.int),b("fee",M.int),b("delegateIds",M.string),b("stateHash",M.binary,"st"),b("nonce",M.int)]),nt=[].concat(L,[b("channelId",M.id,"ch"),b("fromId",M.id,"ak"),b("amount",M.int),b("ttl",M.int),b("fee",M.int),b("stateHash",M.binary,"st"),b("round",M.int),b("nonce",M.int)]),it=[].concat(L,[b("channelId",M.id,"ch"),b("toId",M.id,"ak"),b("amount",M.int),b("ttl",M.int),b("fee",M.int),b("stateHash",M.binary,"st"),b("round",M.int),b("nonce",M.int)]),ot=[].concat(L,[b("channelId",M.id,"ch"),b("fromId",M.id,"ak"),b("initiatorAmountFinal",M.int),b("responderAmountFinal",M.int),b("ttl",M.int),b("fee",M.int),b("nonce",M.int)]),at=[].concat(L,[b("channelId",M.id,"ch"),b("fromId",M.id,"ak"),b("payload",M.binary,"tx"),b("poi",M.binary,"pi"),b("ttl",M.int),b("fee",M.int),b("nonce",M.int)]),st=[].concat(L,[b("channelId",M.id,"ch"),b("fromId",M.id,"ak"),b("payload",M.binary,"tx"),b("poi",M.binary,"pi"),b("ttl",M.int),b("fee",M.int),b("nonce",M.int)]),ut=[].concat(L,[b("channelId",M.id,"ch"),b("fromId",M.id,"ak"),b("initiatorAmountFinal",M.int),b("responderAmountFinal",M.int),b("ttl",M.int),b("fee",M.int),b("nonce",M.int)]),ct=[].concat(L,[b("channelId",M.id,"ch"),b("round",M.int),b("updates",M.offChainUpdates),b("stateHash",M.binary,"st")]),lt=[].concat(L,[b("channelId",M.id,"ch"),b("round",M.int),b("stateHash",M.binary,"st")]),ft=[].concat(L,[b("initiator",M.id,"ak"),b("responder",M.id,"ak"),b("channelAmount",M.int),b("initiatorAmount",M.int),b("responderAmount",M.int),b("channelReserve",M.int),b("delegateIds",M.ids),b("stateHash",M.hex),b("round",M.int),b("soloRound",M.int),b("lockPeriod",M.int),b("lockedUntil",M.int)]),ht=[].concat(L,[b("initiator",M.id,"ak"),b("responder",M.id,"ak"),b("channelAmount",M.int),b("initiatorAmount",M.int),b("responderAmount",M.int),b("channelReserve",M.int),b("delegateIds",M.ids),b("stateHash",M.hex),b("round",M.int),b("soloRound",M.int),b("lockPeriod",M.int),b("lockedUntil",M.int),b("initiatorAuth",M.binary,"cb"),b("responderAuth",M.binary,"cb")]),pt=[].concat(L,[b("channelId",M.id,"ch"),b("fromId",M.id,"ak"),b("payload",M.binary,"tx"),b("ttl",M.int),b("fee",M.int),b("nonce",M.int)]),dt=[].concat(L,[b("owner",M.id,"ak"),b("ctVersion",M.int),b("code",M.binary,"cb"),b("deposit",M.int),b("callData",M.binary,"cb")]),mt=[].concat(L,[b("caller",M.id,"ak"),b("contract",M.id,"ct"),b("abiVersion",M.int),b("amount",M.int),b("callData",M.binary,"cb"),b("callStack",M.callStack),b("gasPrice",M.int),b("gasLimit",M.int)]),gt=[].concat(L,[b("from",M.id,"ak"),b("to",M.id,"ak"),b("amount",M.int)]),vt=[].concat(L,[b("from",M.id,"ak"),b("amount",M.int)]),yt=[].concat(L,[b("from",M.id,"ak"),b("amount",M.int)]),bt=[].concat(L,[b("accounts",M.mptrees),b("calls",M.mptrees),b("channels",M.mptrees),b("contracts",M.mptrees),b("ns",M.mptrees),b("oracles",M.mptrees)]),wt=[].concat(L,[b("contracts",M.rlpBinary),b("calls",M.rlpBinary),b("channels",M.rlpBinary),b("ns",M.rlpBinary),b("oracles",M.rlpBinary),b("accounts",M.rlpBinary)]),_t=[].concat(L,[b("values",M.rlpBinaries)]),xt=[].concat(L,[b("key",M.hex),b("value",M.rawBinary)]),kt=[].concat(L,[b("contracts",M.rlpBinary)]),Et=[].concat(L,[b("calls",M.rlpBinary)]),At=[].concat(L,[b("channels",M.rlpBinary)]),St=[].concat(L,[b("mtree",M.rlpBinary)]),Ot=[].concat(L,[b("otree",M.rlpBinary)]),Tt=[].concat(L,[b("accounts",M.rlpBinary)]),jt=(u={},h()(u,x.account,{1:w(D,10),2:w(q,10)}),h()(u,x.signed,{1:w(z,y)}),h()(u,x.spend,{1:w(F,12)}),h()(u,x.namePreClaim,{1:w(V,33)}),h()(u,x.nameClaim,{1:w(W,32)}),h()(u,x.nameUpdate,{1:w(K,34)}),h()(u,x.nameTransfer,{1:w(H,36)}),h()(u,x.nameRevoke,{1:w(Y,35)}),h()(u,x.contract,{1:w($,40)}),h()(u,x.contractCreate,{1:w(J,42)}),h()(u,x.contractCall,{1:w(Q,43)}),h()(u,x.contractCallResult,{1:w(Z,41)}),h()(u,x.oracleRegister,{1:w(G,22)}),h()(u,x.oracleExtend,{1:w(X,25)}),h()(u,x.oracleQuery,{1:w(tt,23)}),h()(u,x.oracleResponse,{1:w(et,24)}),h()(u,x.channelCreate,{1:w(rt,50)}),h()(u,x.channelCloseMutual,{1:w(ot,53)}),h()(u,x.channelCloseSolo,{1:w(at,54)}),h()(u,x.channelSlash,{1:w(st,55)}),h()(u,x.channelDeposit,{1:w(nt,51)}),h()(u,x.channelWithdraw,{1:w(it,52)}),h()(u,x.channelSettle,{1:w(ut,56)}),h()(u,x.channelOffChain,{1:w(ct,57),2:w(lt,57)}),h()(u,x.channel,{1:w(ft,58),2:w(ht,58)}),h()(u,x.channelSnapshotSolo,{1:w(pt,59)}),h()(u,x.channelOffChainUpdateTransfer,{1:w(gt,570)}),h()(u,x.channelOffChainUpdateDeposit,{1:w(vt,571)}),h()(u,x.channelOffChainUpdateWithdrawal,{1:w(yt,572)}),h()(u,x.channelOffChainCreateContract,{1:w(dt,573)}),h()(u,x.channelOffChainCallContract,{1:w(mt,574)}),h()(u,x.proofOfInclusion,{1:w(bt,60)}),h()(u,x.stateTrees,{1:w(wt,62)}),h()(u,x.merklePatriciaTree,{1:w(_t,63)}),h()(u,x.merklePatriciaTreeValue,{1:w(xt,64)}),h()(u,x.contractsTree,{1:w(kt,621)}),h()(u,x.contractCallsTree,{1:w(Et,622)}),h()(u,x.channelsTree,{1:w(At,623)}),h()(u,x.nameserviceTree,{1:w(St,624)}),h()(u,x.oraclesTree,{1:w(Ot,625)}),h()(u,x.accountsTree,{1:w(Tt,626)}),u),Mt=(c={},h()(c,10,{1:w(D,10),2:w(q,10)}),h()(c,y,{1:w(z,y)}),h()(c,12,{1:w(F,12)}),h()(c,33,{1:w(V,33)}),h()(c,32,{1:w(W,32)}),h()(c,34,{1:w(K,34)}),h()(c,36,{1:w(H,36)}),h()(c,35,{1:w(Y,35)}),h()(c,40,{1:w($,40)}),h()(c,42,{1:w(J,42)}),h()(c,43,{1:w(Q,43)}),h()(c,41,{1:w(Z,41)}),h()(c,22,{1:w(G,22)}),h()(c,25,{1:w(X,25)}),h()(c,23,{1:w(tt,23)}),h()(c,24,{1:w(et,24)}),h()(c,50,{1:w(rt,50)}),h()(c,53,{1:w(ot,53)}),h()(c,54,{1:w(at,54)}),h()(c,55,{1:w(st,55)}),h()(c,51,{1:w(nt,51)}),h()(c,52,{1:w(it,52)}),h()(c,56,{1:w(ut,56)}),h()(c,57,{1:w(ct,57),2:w(lt,57)}),h()(c,58,{1:w(ft,58),2:w(ht,58)}),h()(c,59,{1:w(pt,59)}),h()(c,570,{1:w(gt,570)}),h()(c,571,{1:w(vt,571)}),h()(c,572,{1:w(yt,572)}),h()(c,573,{1:w(dt,573)}),h()(c,574,{1:w(mt,574)}),h()(c,60,{1:w(bt,60)}),h()(c,62,{1:w(wt,62)}),h()(c,63,{1:w(_t,63)}),h()(c,64,{1:w(xt,64)}),h()(c,621,{1:w(kt,621)}),h()(c,622,{1:w(Et,622)}),h()(c,623,{1:w(At,623)}),h()(c,624,{1:w(St,624)}),h()(c,625,{1:w(Ot,625)}),h()(c,626,{1:w(Tt,626)}),c),Ct="error",It="warning",Pt=function(t,e,r){return[t,e,r]},Rt="insufficientFee",Bt="expiredTTL",Nt="insufficientBalanceForAmountFee",Ut="insufficientBalanceForAmount",Lt="nonceUsed",Dt="nonceHigh",qt="minGasPrice",Ft="vmAndAbiVersion",zt={invalidSignature:{key:"InvalidSignature",type:Ct,txKey:"signature"},insufficientFee:{key:"InsufficientFee",type:Ct,txKey:"fee"},expiredTTL:{key:"ExpiredTTL",type:Ct,txKey:"ttl"},insufficientBalanceForAmountFee:{key:"InsufficientBalanceForAmountFee",type:It,txKey:"fee"},insufficientBalanceForAmount:{key:"InsufficientBalanceForAmount",type:It,txKey:"amount"},nonceUsed:{key:"NonceUsed",type:Ct,txKey:"nonce"},nonceHigh:{key:"NonceHigh",type:It,txKey:"nonce"},minGasPrice:{key:"minGasPrice",type:Ct,txKey:"gasPrice"},vmAndAbiVersion:{key:"vmAndAbiVersion",type:Ct,txKey:"ctVersion"}},Vt=[Pt(function(){return"The signature cannot be verified, please verify that you used the correct network id and the correct private key for the sender address"},"signature",zt.invalidSignature)],Wt=[Pt(function(t){t.ctVersion;var e=t.consensusProtocolVersion,r=t.txType;return"Wrong abi/vm version, Supported is: ".concat(T[e]?JSON.stringify(T[e][r]):" None for this protocol "+e)},Ft,zt.vmAndAbiVersion),Pt(function(){return"The gasPrice must be bigger then ".concat(_)},qt,zt.minGasPrice)],Kt=[Pt(function(t){var e=t.minFee;return"The fee for the transaction is too low, the minimum fee for this transaction is ".concat(e)},Rt,zt.insufficientFee),Pt(function(t){var e=t.height;return"The TTL is already expired, the current height is ".concat(e)},Bt,zt.expiredTTL),Pt(function(t){var e=t.balance;return"The account balance ".concat(e," is not enough to execute the transaction")},Nt,zt.insufficientBalanceForAmountFee),Pt(function(t){var e=t.balance;return"The account balance ".concat(e," is not enough to execute the transaction")},Ut,zt.insufficientBalanceForAmount),Pt(function(t){var e=t.accountNonce;return"The nonce is invalid(already used). Next valid nonce is ".concat(e+1,")")},Lt,zt.nonceUsed),Pt(function(t){var e=t.accountNonce;return"The nonce is technically valid but will not be processed immediately by the node (next valid nonce is ".concat(e+1,")")},Dt,zt.nonceHigh)]},function(t,e,r){var n=r(120),i=r(11)(function(t,e){return n({},t,e)});t.exports=i},function(t,e,r){var n=r(2);t.exports=function(t){for(var e=1;e<arguments.length;e++)if(e%2){var r=null!=arguments[e]?arguments[e]:{},i=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(r).filter(function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),i.forEach(function(e){n(t,e,r[e])})}else Object.defineProperties(t,Object.getOwnPropertyDescriptors(arguments[e]));return t}},function(t,e,r){"use strict";r.r(e),function(t){r.d(e,"isBase64",function(){return y}),r.d(e,"ADDRESS_FORMAT",function(){return b}),r.d(e,"formatAddress",function(){return w}),r.d(e,"isAddressValid",function(){return _}),r.d(e,"addressToHex",function(){return x}),r.d(e,"addressFromDecimal",function(){return k}),r.d(e,"hash",function(){return E}),r.d(e,"nameId",function(){return A}),r.d(e,"sha256hash",function(){return S}),r.d(e,"salt",function(){return O}),r.d(e,"encodeBase64Check",function(){return T}),r.d(e,"checkSumFn",function(){return j}),r.d(e,"decodeBase64Check",function(){return M}),r.d(e,"encodeBase58Check",function(){return C}),r.d(e,"decodeBase58Check",function(){return I}),r.d(e,"hexStringToByte",function(){return P}),r.d(e,"encodeUnsigned",function(){return R}),r.d(e,"encodeContractAddress",function(){return B}),r.d(e,"generateKeyPairFromSecret",function(){return N}),r.d(e,"generateKeyPair",function(){return U}),r.d(e,"encryptPublicKey",function(){return L}),r.d(e,"encryptPrivateKey",function(){return D}),r.d(e,"encryptKey",function(){return q}),r.d(e,"decryptKey",function(){return F}),r.d(e,"sign",function(){return z}),r.d(e,"verify",function(){return V}),r.d(e,"prepareTx",function(){return W}),r.d(e,"personalMessageToBinary",function(){return K}),r.d(e,"signPersonalMessage",function(){return H}),r.d(e,"verifyPersonalMessage",function(){return Y}),r.d(e,"aeEncodeKey",function(){return $}),r.d(e,"generateSaveWallet",function(){return J}),r.d(e,"decryptPrivateKey",function(){return Q}),r.d(e,"decryptPubKey",function(){return Z}),r.d(e,"assertedType",function(){return G}),r.d(e,"decodeTx",function(){return X}),r.d(e,"encodeTx",function(){return tt}),r.d(e,"isValidKeypair",function(){return et}),r.d(e,"envKeypair",function(){return rt}),r.d(e,"decode",function(){return nt}),r.d(e,"encode",function(){return it}),r.d(e,"rlp",function(){return ot}),r.d(e,"deserialize",function(){return pt});var n=r(7),i=r.n(n),o=r(91),a=r.n(o),s=r(54),u=r(144),c=r(39),l=r.n(c),f=r(145),h=r.n(f),p=r(21),d=r(68),m=r.n(d),g=r(12),v=h.a.ModeOfOperation.ecb;function y(t){var e;return!(t.length%4>0||t.match(/[^0-9a-z+\/=]/i))&&!(-1!==(e=t.indexOf("="))&&!t.slice(e).match(/={1,2}/))}var b={sophia:1,api:2,raw:3};function w(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b.api,e=arguments.length>1?arguments[1]:void 0;switch(t){case b.api:return e;case b.sophia:return"0x".concat(Object(g.decode)(e,"ak").toString("hex"))}}function _(t){var e;try{e=32===I(G(t,"ak")).length}catch(t){e=!1}return e}function x(t){return"0x".concat(I(G(t,"ak")).toString("hex"))}function k(t){return $(Object(p.c)(t,!0))}function E(e){return t.from(Object(u.blake2b)(e,null,32))}function A(e){var r=t.allocUnsafe(32).fill(0);if(e){for(var n=e.split("."),i=0;i<n.length;i++)r=E(t.concat([r,E(n[i])]));return r}return r}function S(t){return m()("sha256").update(t).digest()}function O(){return Math.floor(Math.random()*Math.floor(Number.MAX_SAFE_INTEGER))}function T(e){var r=t.from(e),n=j(e);return t.concat([r,n],r.length+4).toString("base64")}function j(t){return S(S(t)).slice(0,4)}function M(e){var r=function(t){var e=t.slice(0,-4),r=t.slice(-4),n=j(e);if(r.equals(n))return e}(t.from(e,"base64"));if(!r)throw new Error("Invalid checksum");return t.from(r)}function C(e){return a.a.encode(t.from(e))}function I(t){return a.a.decode(t)}function P(t){if(!t)return new Uint8Array;for(var e=[],r=0,n=t.length;r<n;r+=2)e.push(parseInt(t.substr(r,2),16));return new Uint8Array(e)}function R(e){var r=t.allocUnsafe(4);return r.writeUInt32BE(e),r.slice(r.findIndex(function(t){return 0!==t}))}function B(e,r){var n=I(G(e,"ak")),i=t.concat([n,R(r)]);return"ct_".concat(C(E(i)))}function N(t){return l.a.sign.keyPair.fromSecretKey(t)}function U(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=l.a.sign.keyPair(),n=t.from(r.publicKey),i=t.from(r.secretKey);return e?{publicKey:n,secretKey:i}:{publicKey:"ak_".concat(C(n)),secretKey:i.toString("hex")}}function L(t,e){return q(t,Object(p.b)(32,e))}function D(t,e){return q(t,Object(p.a)(64,e))}function q(t,e){var r=S(t);return new v(r).encrypt(e)}function F(e,r){var n=t.from(r),i=S(e),o=new v(i);return t.from(o.decrypt(n))}function z(e,r){return l.a.sign.detached(t.from(e),t.from(r))}function V(t,e,r){return l.a.sign.detached.verify(new Uint8Array(t),e,r)}function W(e,r){return[t.from([11]),t.from([1]),[t.from(e)],r]}function K(e){var r=t.from("æternity Signed Message:\n","utf8"),n=t.from(e,"utf8");if(n.length>=253)throw new Error("message too long");return t.concat([t.from([r.length]),r,t.from([n.length]),n])}function H(t,e){return z(K(t),e)}function Y(t,e,r){return V(K(t),e,r)}function $(e){var r=C(t.from(e,"hex"));return"ak_".concat(r)}function J(t){var e=U(!0);return{publicKey:L(t,e.publicKey),secretKey:D(t,e.secretKey)}}function Q(t,e){return F(t,e)}function Z(t,e){return F(t,e).slice(0,65)}function G(t,e){if(RegExp("^".concat(e,"_.+$")).test(t))return t.split("_")[1];throw Error("Data doesn't match expected type ".concat(e))}function X(e){return s.decode(t.from(M(G(e,"tx"))))}function tt(t){var e=T(s.encode(t));return"tx_".concat(e)}function et(t,e){return V("TheMessage",z("TheMessage",t),e)}function rt(t){var e={secretKey:t.WALLET_PRIV,publicKey:t.WALLET_PUB};if(e.publicKey&&e.secretKey)return e;throw Error("Environment variables WALLET_PRIV and WALLET_PUB need to be set")}var nt=s.decode,it=s.encode,ot=s,at={SIGNED_TX:11,CHANNEL_CREATE_TX:50,CHANNEL_CLOSE_MUTUAL_TX:53,CHANNEL_OFFCHAIN_TX:57,CHANNEL_OFFCHAIN_UPDATE_TRANSFER:570};function st(t,e){if(e){var r=Object.entries(at).find(function(e){var r=i()(e,2),n=(r[0],r[1]);return t===n});return r?r[0]:t}return t}function ut(t){return t.readIntBE(0,t.length)}function ct(t){var e={1:"ak",2:"nm",3:"cm",4:"ok",5:"ct",6:"ch"}[t.readUIntBE(0,1)],r=C(t.slice(1,t.length));return"".concat(e,"_").concat(r)}function lt(t){for(var e=[],r=0;r<t.length;r++)e.push(C(t[r]));return e}function ft(t,e){var r=ut(t[0]),n={tag:st(r,e.prettyTags),version:ut(t[1])};switch(r){case at.CHANNEL_OFFCHAIN_UPDATE_TRANSFER:return Object.assign(n,{from:ct(t[2]),to:ct(t[3]),amount:ut(t[4])})}return n}function ht(t,e){for(var r=[],n=0;n<t.length;n++)r.push(ft(nt(t[n]),e));return r}function pt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{prettyTags:!1},r=ut(t[0]),n={tag:st(r,e.prettyTags),version:ut(t[1])};switch(r){case at.SIGNED_TX:return Object.assign(n,{signatures:lt(t[2]),tx:pt(nt(t[3]),e)});case at.CHANNEL_CREATE_TX:return Object.assign(n,{initiator:ct(t[2]),initiatorAmount:ut(t[3]),responder:ct(t[4]),responderAmount:ut(t[5]),channelReserve:ut(t[6]),lockPeriod:ut(t[7]),ttl:ut(t[8]),fee:ut(t[9])});case at.CHANNEL_CLOSE_MUTUAL_TX:return Object.assign(n,{channelId:ct(t[2]),initiatorAmount:ut(t[3]),responderAmount:ut(t[4]),ttl:ut(t[5]),fee:ut(t[6]),nonce:ut(t[7])});case at.CHANNEL_OFFCHAIN_TX:return Object.assign(n,{channelId:ct(t[2]),round:ut(t[3]),updates:ht(t[4],e),state:C(t[5])})}}}.call(this,r(17).Buffer)},function(t,e,r){var n=r(105),i=r(172),o=r(106);t.exports=function(t,e){return n(t)||i(t,e)||o()}},function(t,e,r){var n=r(121)(0);t.exports=n},function(t,e,r){var n=r(79),i=r(81),o=r(55);function a(t){"use strict";var e=this&&this.compose?this:s,r=e.compose.deepConfiguration&&e.compose.deepConfiguration.Required,o=i({},n(r,t).compose);return e.compose({deepConfiguration:{Required:o}})}var s=n({initializers:[function(t,e){var r=e.stamp.compose;!function(t,e){if(t&&e)for(var r=Object.keys(e),n=0;n<r.length;n++){var i=r[n],u=e[i];if(o(u))for(var c=Object.keys(u),l=0;l<c.length;l++){var f=c[l],h=u[f];if(!(h!==s&&h!==a||t[i]&&void 0!==t[i][f]))throw new Error("Required: There must be "+f+" in this stamp "+i)}}}(r,r.deepConfiguration&&r.deepConfiguration.Required)}],staticProperties:{required:a}});Object.freeze(a),Object.freeze(s),t.exports=s},function(t,e,r){var n;!function(i){"use strict";var o,a=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,s=Math.ceil,u=Math.floor,c="[BigNumber Error] ",l=c+"Number primitive has more than 15 significant digits: ",f=1e14,h=14,p=9007199254740991,d=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],m=1e7,g=1e9;function v(t){var e=0|t;return t>0||t===e?e:e-1}function y(t){for(var e,r,n=1,i=t.length,o=t[0]+"";n<i;){for(e=t[n++]+"",r=h-e.length;r--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function b(t,e){var r,n,i=t.c,o=e.c,a=t.s,s=e.s,u=t.e,c=e.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=u==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return u>c^r?1:-1;for(s=(u=i.length)<(c=o.length)?u:c,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return u==c?0:u>c^r?1:-1}function w(t,e,r,n){if(t<e||t>r||t!==u(t))throw Error(c+(n||"Argument")+("number"==typeof t?t<e||t>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(t))}function _(t){var e=t.c.length-1;return v(t.e/h)==e&&t.c[e]%2!=0}function x(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(e<0?"e":"e+")+e}function k(t,e,r){var n,i;if(e<0){for(i=r+".";++e;i+=r);t=i+t}else if(++e>(n=t.length)){for(i=r,e-=n;--e;i+=r);t+=i}else e<n&&(t=t.slice(0,e)+"."+t.slice(e));return t}(o=function t(e){var r,n,i,o,E,A,S,O,T,j=z.prototype={constructor:z,toString:null,valueOf:null},M=new z(1),C=20,I=4,P=-7,R=21,B=-1e7,N=1e7,U=!1,L=1,D=0,q={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},F="0123456789abcdefghijklmnopqrstuvwxyz";function z(t,e){var r,o,s,c,f,d,m,g,v=this;if(!(v instanceof z))return new z(t,e);if(null==e){if(t&&!0===t._isBigNumber)return v.s=t.s,void(!t.c||t.e>N?v.c=v.e=null:t.e<B?v.c=[v.e=0]:(v.e=t.e,v.c=t.c.slice()));if((d="number"==typeof t)&&0*t==0){if(v.s=1/t<0?(t=-t,-1):1,t===~~t){for(c=0,f=t;f>=10;f/=10,c++);return void(c>N?v.c=v.e=null:(v.e=c,v.c=[t]))}g=String(t)}else{if(!a.test(g=String(t)))return i(v,g,d);v.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(c=g.indexOf("."))>-1&&(g=g.replace(".","")),(f=g.search(/e/i))>0?(c<0&&(c=f),c+=+g.slice(f+1),g=g.substring(0,f)):c<0&&(c=g.length)}else{if(w(e,2,F.length,"Base"),10==e)return H(v=new z(t),C+v.e+1,I);if(g=String(t),d="number"==typeof t){if(0*t!=0)return i(v,g,d,e);if(v.s=1/t<0?(g=g.slice(1),-1):1,z.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(l+t)}else v.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=F.slice(0,e),c=f=0,m=g.length;f<m;f++)if(r.indexOf(o=g.charAt(f))<0){if("."==o){if(f>c){c=m;continue}}else if(!s&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){s=!0,f=-1,c=0;continue}return i(v,String(t),d,e)}d=!1,(c=(g=n(g,e,10,v.s)).indexOf("."))>-1?g=g.replace(".",""):c=g.length}for(f=0;48===g.charCodeAt(f);f++);for(m=g.length;48===g.charCodeAt(--m););if(g=g.slice(f,++m)){if(m-=f,d&&z.DEBUG&&m>15&&(t>p||t!==u(t)))throw Error(l+v.s*t);if((c=c-f-1)>N)v.c=v.e=null;else if(c<B)v.c=[v.e=0];else{if(v.e=c,v.c=[],f=(c+1)%h,c<0&&(f+=h),f<m){for(f&&v.c.push(+g.slice(0,f)),m-=h;f<m;)v.c.push(+g.slice(f,f+=h));f=h-(g=g.slice(f)).length}else f-=m;for(;f--;g+="0");v.c.push(+g)}}else v.c=[v.e=0]}function V(t,e,r,n){var i,o,a,s,u;if(null==r?r=I:w(r,0,8),!t.c)return t.toString();if(i=t.c[0],a=t.e,null==e)u=y(t.c),u=1==n||2==n&&(a<=P||a>=R)?x(u,a):k(u,a,"0");else if(o=(t=H(new z(t),e,r)).e,s=(u=y(t.c)).length,1==n||2==n&&(e<=o||o<=P)){for(;s<e;u+="0",s++);u=x(u,o)}else if(e-=a,u=k(u,o,"0"),o+1>s){if(--e>0)for(u+=".";e--;u+="0");}else if((e+=o-s)>0)for(o+1==s&&(u+=".");e--;u+="0");return t.s<0&&i?"-"+u:u}function W(t,e){for(var r,n=1,i=new z(t[0]);n<t.length;n++){if(!(r=new z(t[n])).s){i=r;break}e.call(i,r)&&(i=r)}return i}function K(t,e,r){for(var n=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,n++);return(r=n+r*h-1)>N?t.c=t.e=null:r<B?t.c=[t.e=0]:(t.e=r,t.c=e),t}function H(t,e,r,n){var i,o,a,c,l,p,m,g=t.c,v=d;if(g){t:{for(i=1,c=g[0];c>=10;c/=10,i++);if((o=e-i)<0)o+=h,a=e,m=(l=g[p=0])/v[i-a-1]%10|0;else if((p=s((o+1)/h))>=g.length){if(!n)break t;for(;g.length<=p;g.push(0));l=m=0,i=1,a=(o%=h)-h+1}else{for(l=c=g[p],i=1;c>=10;c/=10,i++);m=(a=(o%=h)-h+i)<0?0:l/v[i-a-1]%10|0}if(n=n||e<0||null!=g[p+1]||(a<0?l:l%v[i-a-1]),n=r<4?(m||n)&&(0==r||r==(t.s<0?3:2)):m>5||5==m&&(4==r||n||6==r&&(o>0?a>0?l/v[i-a]:0:g[p-1])%10&1||r==(t.s<0?8:7)),e<1||!g[0])return g.length=0,n?(e-=t.e+1,g[0]=v[(h-e%h)%h],t.e=-e||0):g[0]=t.e=0,t;if(0==o?(g.length=p,c=1,p--):(g.length=p+1,c=v[h-o],g[p]=a>0?u(l/v[i-a]%v[a])*c:0),n)for(;;){if(0==p){for(o=1,a=g[0];a>=10;a/=10,o++);for(a=g[0]+=c,c=1;a>=10;a/=10,c++);o!=c&&(t.e++,g[0]==f&&(g[0]=1));break}if(g[p]+=c,g[p]!=f)break;g[p--]=0,c=1}for(o=g.length;0===g[--o];g.pop());}t.e>N?t.c=t.e=null:t.e<B&&(t.c=[t.e=0])}return t}function Y(t){var e,r=t.e;return null===r?t.toString():(e=y(t.c),e=r<=P||r>=R?x(e,r):k(e,r,"0"),t.s<0?"-"+e:e)}return z.clone=t,z.ROUND_UP=0,z.ROUND_DOWN=1,z.ROUND_CEIL=2,z.ROUND_FLOOR=3,z.ROUND_HALF_UP=4,z.ROUND_HALF_DOWN=5,z.ROUND_HALF_EVEN=6,z.ROUND_HALF_CEIL=7,z.ROUND_HALF_FLOOR=8,z.EUCLID=9,z.config=z.set=function(t){var e,r;if(null!=t){if("object"!=typeof t)throw Error(c+"Object expected: "+t);if(t.hasOwnProperty(e="DECIMAL_PLACES")&&(w(r=t[e],0,g,e),C=r),t.hasOwnProperty(e="ROUNDING_MODE")&&(w(r=t[e],0,8,e),I=r),t.hasOwnProperty(e="EXPONENTIAL_AT")&&((r=t[e])&&r.pop?(w(r[0],-g,0,e),w(r[1],0,g,e),P=r[0],R=r[1]):(w(r,-g,g,e),P=-(R=r<0?-r:r))),t.hasOwnProperty(e="RANGE"))if((r=t[e])&&r.pop)w(r[0],-g,-1,e),w(r[1],1,g,e),B=r[0],N=r[1];else{if(w(r,-g,g,e),!r)throw Error(c+e+" cannot be zero: "+r);B=-(N=r<0?-r:r)}if(t.hasOwnProperty(e="CRYPTO")){if((r=t[e])!==!!r)throw Error(c+e+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw U=!r,Error(c+"crypto unavailable");U=r}else U=r}if(t.hasOwnProperty(e="MODULO_MODE")&&(w(r=t[e],0,9,e),L=r),t.hasOwnProperty(e="POW_PRECISION")&&(w(r=t[e],0,g,e),D=r),t.hasOwnProperty(e="FORMAT")){if("object"!=typeof(r=t[e]))throw Error(c+e+" not an object: "+r);q=r}if(t.hasOwnProperty(e="ALPHABET")){if("string"!=typeof(r=t[e])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(c+e+" invalid: "+r);F=r}}return{DECIMAL_PLACES:C,ROUNDING_MODE:I,EXPONENTIAL_AT:[P,R],RANGE:[B,N],CRYPTO:U,MODULO_MODE:L,POW_PRECISION:D,FORMAT:q,ALPHABET:F}},z.isBigNumber=function(t){if(!t||!0!==t._isBigNumber)return!1;if(!z.DEBUG)return!0;var e,r,n=t.c,i=t.e,o=t.s;t:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-g&&i<=g&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break t}if((e=(i+1)%h)<1&&(e+=h),String(n[0]).length==e){for(e=0;e<n.length;e++)if((r=n[e])<0||r>=f||r!==u(r))break t;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(c+"Invalid BigNumber: "+t)},z.maximum=z.max=function(){return W(arguments,j.lt)},z.minimum=z.min=function(){return W(arguments,j.gt)},z.random=(o=9007199254740992*Math.random()&2097151?function(){return u(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(t){var e,r,n,i,a,l=0,f=[],p=new z(M);if(null==t?t=C:w(t,0,g),i=s(t/h),U)if(crypto.getRandomValues){for(e=crypto.getRandomValues(new Uint32Array(i*=2));l<i;)(a=131072*e[l]+(e[l+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),e[l]=r[0],e[l+1]=r[1]):(f.push(a%1e14),l+=2);l=i/2}else{if(!crypto.randomBytes)throw U=!1,Error(c+"crypto unavailable");for(e=crypto.randomBytes(i*=7);l<i;)(a=281474976710656*(31&e[l])+1099511627776*e[l+1]+4294967296*e[l+2]+16777216*e[l+3]+(e[l+4]<<16)+(e[l+5]<<8)+e[l+6])>=9e15?crypto.randomBytes(7).copy(e,l):(f.push(a%1e14),l+=7);l=i/7}if(!U)for(;l<i;)(a=o())<9e15&&(f[l++]=a%1e14);for(i=f[--l],t%=h,i&&t&&(a=d[h-t],f[l]=u(i/a)*a);0===f[l];f.pop(),l--);if(l<0)f=[n=0];else{for(n=-1;0===f[0];f.splice(0,1),n-=h);for(l=1,a=f[0];a>=10;a/=10,l++);l<h&&(n-=h-l)}return p.e=n,p.c=f,p}),z.sum=function(){for(var t=1,e=arguments,r=new z(e[0]);t<e.length;)r=r.plus(e[t++]);return r},n=function(){function t(t,e,r,n){for(var i,o,a=[0],s=0,u=t.length;s<u;){for(o=a.length;o--;a[o]*=e);for(a[0]+=n.indexOf(t.charAt(s++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(e,n,i,o,a){var s,u,c,l,f,h,p,d,m=e.indexOf("."),g=C,v=I;for(m>=0&&(l=D,D=0,e=e.replace(".",""),h=(d=new z(n)).pow(e.length-m),D=l,d.c=t(k(y(h.c),h.e,"0"),10,i,"0123456789"),d.e=d.c.length),c=l=(p=t(e,n,i,a?(s=F,"0123456789"):(s="0123456789",F))).length;0==p[--l];p.pop());if(!p[0])return s.charAt(0);if(m<0?--c:(h.c=p,h.e=c,h.s=o,p=(h=r(h,d,g,v,i)).c,f=h.r,c=h.e),m=p[u=c+g+1],l=i/2,f=f||u<0||null!=p[u+1],f=v<4?(null!=m||f)&&(0==v||v==(h.s<0?3:2)):m>l||m==l&&(4==v||f||6==v&&1&p[u-1]||v==(h.s<0?8:7)),u<1||!p[0])e=f?k(s.charAt(1),-g,s.charAt(0)):s.charAt(0);else{if(p.length=u,f)for(--i;++p[--u]>i;)p[u]=0,u||(++c,p=[1].concat(p));for(l=p.length;!p[--l];);for(m=0,e="";m<=l;e+=s.charAt(p[m++]));e=k(e,c,s.charAt(0))}return e}}(),r=function(){function t(t,e,r){var n,i,o,a,s=0,u=t.length,c=e%m,l=e/m|0;for(t=t.slice();u--;)s=((i=c*(o=t[u]%m)+(n=l*o+(a=t[u]/m|0)*c)%m*m+s)/r|0)+(n/m|0)+l*a,t[u]=i%r;return s&&(t=[s].concat(t)),t}function e(t,e,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function r(t,e,r,n){for(var i=0;r--;)t[r]-=i,i=t[r]<e[r]?1:0,t[r]=i*n+t[r]-e[r];for(;!t[0]&&t.length>1;t.splice(0,1));}return function(n,i,o,a,s){var c,l,p,d,m,g,y,b,w,_,x,k,E,A,S,O,T,j=n.s==i.s?1:-1,M=n.c,C=i.c;if(!(M&&M[0]&&C&&C[0]))return new z(n.s&&i.s&&(M?!C||M[0]!=C[0]:C)?M&&0==M[0]||!C?0*j:j/0:NaN);for(w=(b=new z(j)).c=[],j=o+(l=n.e-i.e)+1,s||(s=f,l=v(n.e/h)-v(i.e/h),j=j/h|0),p=0;C[p]==(M[p]||0);p++);if(C[p]>(M[p]||0)&&l--,j<0)w.push(1),d=!0;else{for(A=M.length,O=C.length,p=0,j+=2,(m=u(s/(C[0]+1)))>1&&(C=t(C,m,s),M=t(M,m,s),O=C.length,A=M.length),E=O,x=(_=M.slice(0,O)).length;x<O;_[x++]=0);T=C.slice(),T=[0].concat(T),S=C[0],C[1]>=s/2&&S++;do{if(m=0,(c=e(C,_,O,x))<0){if(k=_[0],O!=x&&(k=k*s+(_[1]||0)),(m=u(k/S))>1)for(m>=s&&(m=s-1),y=(g=t(C,m,s)).length,x=_.length;1==e(g,_,y,x);)m--,r(g,O<y?T:C,y,s),y=g.length,c=1;else 0==m&&(c=m=1),y=(g=C.slice()).length;if(y<x&&(g=[0].concat(g)),r(_,g,x,s),x=_.length,-1==c)for(;e(C,_,O,x)<1;)m++,r(_,O<x?T:C,x,s),x=_.length}else 0===c&&(m++,_=[0]);w[p++]=m,_[0]?_[x++]=M[E]||0:(_=[M[E]],x=1)}while((E++<A||null!=_[0])&&j--);d=null!=_[0],w[0]||w.splice(0,1)}if(s==f){for(p=1,j=w[0];j>=10;j/=10,p++);H(b,o+(b.e=p+l*h-1)+1,a,d)}else b.e=l,b.r=+d;return b}}(),E=/^(-?)0([xbo])(?=\w[\w.]*$)/i,A=/^([^.]+)\.$/,S=/^\.([^.]+)$/,O=/^-?(Infinity|NaN)$/,T=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(t,e,r,n){var i,o=r?e:e.replace(T,"");if(O.test(o))t.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(E,function(t,e,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?t:e}),n&&(i=n,o=o.replace(A,"$1").replace(S,"0.$1")),e!=o))return new z(o,i);if(z.DEBUG)throw Error(c+"Not a"+(n?" base "+n:"")+" number: "+e);t.s=null}t.c=t.e=null},j.absoluteValue=j.abs=function(){var t=new z(this);return t.s<0&&(t.s=1),t},j.comparedTo=function(t,e){return b(this,new z(t,e))},j.decimalPlaces=j.dp=function(t,e){var r,n,i,o=this;if(null!=t)return w(t,0,g),null==e?e=I:w(e,0,8),H(new z(o),t+o.e+1,e);if(!(r=o.c))return null;if(n=((i=r.length-1)-v(this.e/h))*h,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},j.dividedBy=j.div=function(t,e){return r(this,new z(t,e),C,I)},j.dividedToIntegerBy=j.idiv=function(t,e){return r(this,new z(t,e),0,1)},j.exponentiatedBy=j.pow=function(t,e){var r,n,i,o,a,l,f,p,d=this;if((t=new z(t)).c&&!t.isInteger())throw Error(c+"Exponent not an integer: "+Y(t));if(null!=e&&(e=new z(e)),a=t.e>14,!d.c||!d.c[0]||1==d.c[0]&&!d.e&&1==d.c.length||!t.c||!t.c[0])return p=new z(Math.pow(+Y(d),a?2-_(t):+Y(t))),e?p.mod(e):p;if(l=t.s<0,e){if(e.c?!e.c[0]:!e.s)return new z(NaN);(n=!l&&d.isInteger()&&e.isInteger())&&(d=d.mod(e))}else{if(t.e>9&&(d.e>0||d.e<-1||(0==d.e?d.c[0]>1||a&&d.c[1]>=24e7:d.c[0]<8e13||a&&d.c[0]<=9999975e7)))return o=d.s<0&&_(t)?-0:0,d.e>-1&&(o=1/o),new z(l?1/o:o);D&&(o=s(D/h+2))}for(a?(r=new z(.5),l&&(t.s=1),f=_(t)):f=(i=Math.abs(+Y(t)))%2,p=new z(M);;){if(f){if(!(p=p.times(d)).c)break;o?p.c.length>o&&(p.c.length=o):n&&(p=p.mod(e))}if(i){if(0===(i=u(i/2)))break;f=i%2}else if(H(t=t.times(r),t.e+1,1),t.e>14)f=_(t);else{if(0==(i=+Y(t)))break;f=i%2}d=d.times(d),o?d.c&&d.c.length>o&&(d.c.length=o):n&&(d=d.mod(e))}return n?p:(l&&(p=M.div(p)),e?p.mod(e):o?H(p,D,I,void 0):p)},j.integerValue=function(t){var e=new z(this);return null==t?t=I:w(t,0,8),H(e,e.e+1,t)},j.isEqualTo=j.eq=function(t,e){return 0===b(this,new z(t,e))},j.isFinite=function(){return!!this.c},j.isGreaterThan=j.gt=function(t,e){return b(this,new z(t,e))>0},j.isGreaterThanOrEqualTo=j.gte=function(t,e){return 1===(e=b(this,new z(t,e)))||0===e},j.isInteger=function(){return!!this.c&&v(this.e/h)>this.c.length-2},j.isLessThan=j.lt=function(t,e){return b(this,new z(t,e))<0},j.isLessThanOrEqualTo=j.lte=function(t,e){return-1===(e=b(this,new z(t,e)))||0===e},j.isNaN=function(){return!this.s},j.isNegative=function(){return this.s<0},j.isPositive=function(){return this.s>0},j.isZero=function(){return!!this.c&&0==this.c[0]},j.minus=function(t,e){var r,n,i,o,a=this,s=a.s;if(e=(t=new z(t,e)).s,!s||!e)return new z(NaN);if(s!=e)return t.s=-e,a.plus(t);var u=a.e/h,c=t.e/h,l=a.c,p=t.c;if(!u||!c){if(!l||!p)return l?(t.s=-e,t):new z(p?a:NaN);if(!l[0]||!p[0])return p[0]?(t.s=-e,t):new z(l[0]?a:3==I?-0:0)}if(u=v(u),c=v(c),l=l.slice(),s=u-c){for((o=s<0)?(s=-s,i=l):(c=u,i=p),i.reverse(),e=s;e--;i.push(0));i.reverse()}else for(n=(o=(s=l.length)<(e=p.length))?s:e,s=e=0;e<n;e++)if(l[e]!=p[e]){o=l[e]<p[e];break}if(o&&(i=l,l=p,p=i,t.s=-t.s),(e=(n=p.length)-(r=l.length))>0)for(;e--;l[r++]=0);for(e=f-1;n>s;){if(l[--n]<p[n]){for(r=n;r&&!l[--r];l[r]=e);--l[r],l[n]+=f}l[n]-=p[n]}for(;0==l[0];l.splice(0,1),--c);return l[0]?K(t,l,c):(t.s=3==I?-1:1,t.c=[t.e=0],t)},j.modulo=j.mod=function(t,e){var n,i,o=this;return t=new z(t,e),!o.c||!t.s||t.c&&!t.c[0]?new z(NaN):!t.c||o.c&&!o.c[0]?new z(o):(9==L?(i=t.s,t.s=1,n=r(o,t,0,3),t.s=i,n.s*=i):n=r(o,t,0,L),(t=o.minus(n.times(t))).c[0]||1!=L||(t.s=o.s),t)},j.multipliedBy=j.times=function(t,e){var r,n,i,o,a,s,u,c,l,p,d,g,y,b,w,_=this,x=_.c,k=(t=new z(t,e)).c;if(!(x&&k&&x[0]&&k[0]))return!_.s||!t.s||x&&!x[0]&&!k||k&&!k[0]&&!x?t.c=t.e=t.s=null:(t.s*=_.s,x&&k?(t.c=[0],t.e=0):t.c=t.e=null),t;for(n=v(_.e/h)+v(t.e/h),t.s*=_.s,(u=x.length)<(p=k.length)&&(y=x,x=k,k=y,i=u,u=p,p=i),i=u+p,y=[];i--;y.push(0));for(b=f,w=m,i=p;--i>=0;){for(r=0,d=k[i]%w,g=k[i]/w|0,o=i+(a=u);o>i;)r=((c=d*(c=x[--a]%w)+(s=g*c+(l=x[a]/w|0)*d)%w*w+y[o]+r)/b|0)+(s/w|0)+g*l,y[o--]=c%b;y[o]=r}return r?++n:y.splice(0,1),K(t,y,n)},j.negated=function(){var t=new z(this);return t.s=-t.s||null,t},j.plus=function(t,e){var r,n=this,i=n.s;if(e=(t=new z(t,e)).s,!i||!e)return new z(NaN);if(i!=e)return t.s=-e,n.minus(t);var o=n.e/h,a=t.e/h,s=n.c,u=t.c;if(!o||!a){if(!s||!u)return new z(i/0);if(!s[0]||!u[0])return u[0]?t:new z(s[0]?n:0*i)}if(o=v(o),a=v(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=u):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(e=u.length)<0&&(r=u,u=s,s=r,e=i),i=0;e;)i=(s[--e]=s[e]+u[e]+i)/f|0,s[e]=f===s[e]?0:s[e]%f;return i&&(s=[i].concat(s),++a),K(t,s,a)},j.precision=j.sd=function(t,e){var r,n,i,o=this;if(null!=t&&t!==!!t)return w(t,1,g),null==e?e=I:w(e,0,8),H(new z(o),t,e);if(!(r=o.c))return null;if(n=(i=r.length-1)*h+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return t&&o.e+1>n&&(n=o.e+1),n},j.shiftedBy=function(t){return w(t,-p,p),this.times("1e"+t)},j.squareRoot=j.sqrt=function(){var t,e,n,i,o,a=this,s=a.c,u=a.s,c=a.e,l=C+4,f=new z("0.5");if(1!==u||!s||!s[0])return new z(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(u=Math.sqrt(+Y(a)))||u==1/0?(((e=y(s)).length+c)%2==0&&(e+="0"),u=Math.sqrt(+e),c=v((c+1)/2)-(c<0||c%2),n=new z(e=u==1/0?"1e"+c:(e=u.toExponential()).slice(0,e.indexOf("e")+1)+c)):n=new z(u+""),n.c[0])for((u=(c=n.e)+l)<3&&(u=0);;)if(o=n,n=f.times(o.plus(r(a,o,l,1))),y(o.c).slice(0,u)===(e=y(n.c)).slice(0,u)){if(n.e<c&&--u,"9999"!=(e=e.slice(u-3,u+1))&&(i||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(H(n,n.e+C+2,1),t=!n.times(n).eq(a));break}if(!i&&(H(o,o.e+C+2,0),o.times(o).eq(a))){n=o;break}l+=4,u+=4,i=1}return H(n,n.e+C+1,I,t)},j.toExponential=function(t,e){return null!=t&&(w(t,0,g),t++),V(this,t,e,1)},j.toFixed=function(t,e){return null!=t&&(w(t,0,g),t=t+this.e+1),V(this,t,e)},j.toFormat=function(t,e,r){var n,i=this;if(null==r)null!=t&&e&&"object"==typeof e?(r=e,e=null):t&&"object"==typeof t?(r=t,t=e=null):r=q;else if("object"!=typeof r)throw Error(c+"Argument not an object: "+r);if(n=i.toFixed(t,e),i.c){var o,a=n.split("."),s=+r.groupSize,u=+r.secondaryGroupSize,l=r.groupSeparator||"",f=a[0],h=a[1],p=i.s<0,d=p?f.slice(1):f,m=d.length;if(u&&(o=s,s=u,u=o,m-=o),s>0&&m>0){for(o=m%s||s,f=d.substr(0,o);o<m;o+=s)f+=l+d.substr(o,s);u>0&&(f+=l+d.slice(o)),p&&(f="-"+f)}n=h?f+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):f}return(r.prefix||"")+n+(r.suffix||"")},j.toFraction=function(t){var e,n,i,o,a,s,u,l,f,p,m,g,v=this,b=v.c;if(null!=t&&(!(u=new z(t)).isInteger()&&(u.c||1!==u.s)||u.lt(M)))throw Error(c+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+Y(u));if(!b)return new z(v);for(e=new z(M),f=n=new z(M),i=l=new z(M),g=y(b),a=e.e=g.length-v.e-1,e.c[0]=d[(s=a%h)<0?h+s:s],t=!t||u.comparedTo(e)>0?a>0?e:f:u,s=N,N=1/0,u=new z(g),l.c[0]=0;p=r(u,e,0,1),1!=(o=n.plus(p.times(i))).comparedTo(t);)n=i,i=o,f=l.plus(p.times(o=f)),l=o,e=u.minus(p.times(o=e)),u=o;return o=r(t.minus(n),i,0,1),l=l.plus(o.times(f)),n=n.plus(o.times(i)),l.s=f.s=v.s,m=r(f,i,a*=2,I).minus(v).abs().comparedTo(r(l,n,a,I).minus(v).abs())<1?[f,i]:[l,n],N=s,m},j.toNumber=function(){return+Y(this)},j.toPrecision=function(t,e){return null!=t&&w(t,1,g),V(this,t,e,2)},j.toString=function(t){var e,r=this,i=r.s,o=r.e;return null===o?i?(e="Infinity",i<0&&(e="-"+e)):e="NaN":(null==t?e=o<=P||o>=R?x(y(r.c),o):k(y(r.c),o,"0"):10===t?e=k(y((r=H(new z(r),C+o+1,I)).c),r.e,"0"):(w(t,2,F.length,"Base"),e=n(k(y(r.c),o,"0"),10,t,i,!0)),i<0&&r.c[0]&&(e="-"+e)),e},j.valueOf=j.toJSON=function(){return Y(this)},j._isBigNumber=!0,null!=e&&z.set(e),z}()).default=o.BigNumber=o,void 0===(n=function(){return o}.call(e,r,e,t))||(t.exports=n)}()},function(t,e,r){var n=r(19),i=r(65);t.exports=function(t){return function e(r,o){switch(arguments.length){case 0:return e;case 1:return i(r)?e:n(function(e){return t(r,e)});default:return i(r)&&i(o)?e:i(r)?n(function(e){return t(e,o)}):i(o)?n(function(e){return t(r,e)}):t(r,o)}}}},function(t,e,r){"use strict";r.r(e),function(t){r.d(e,"createSalt",function(){return m}),r.d(e,"buildContractId",function(){return v}),r.d(e,"oracleQueryId",function(){return y}),r.d(e,"formatSalt",function(){return b}),r.d(e,"commitmentHash",function(){return w}),r.d(e,"decode",function(){return x}),r.d(e,"encode",function(){return k}),r.d(e,"writeId",function(){return E}),r.d(e,"readId",function(){return A}),r.d(e,"writeInt",function(){return S}),r.d(e,"readInt",function(){return O}),r.d(e,"buildPointers",function(){return T}),r.d(e,"readPointers",function(){return j});var n=r(0),i=r.n(n),o=r(7),a=r.n(o),s=r(1),u=r.n(s),c=r(14),l=r.n(c),f=r(6),h=r(21),p=r(3),d=r(10),m=f.salt,g=["tx","st","ss","pi","ov","or","cb","cs","ba"];function v(e,r){var n=t.from([].concat(l()(x(e,"ak")),l()(Object(h.c)(r))));return k(Object(f.hash)(n),"ct")}function y(e,r,n){var i,o;return k(Object(f.hash)(t.from([].concat(l()(x(e,"ak")),l()((i=r,o=Object(h.c)(i,!0),t.concat([t.alloc(32-o.length),o]))),l()(x(n,"ok"))))),"oq")}function b(e){return t.from(e.toString(16).padStart(64,"0"),"hex")}function w(t){return _.apply(this,arguments)}function _(){return(_=u()(i.a.mark(function e(r){var n,o=arguments;return i.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:m(),e.abrupt("return","cm_".concat(Object(f.encodeBase58Check)(Object(f.hash)(t.concat([Object(f.nameId)(r),b(n)])))));case 2:case"end":return e.stop()}},e)}))).apply(this,arguments)}function x(t,e){return e||(e=t.split("_")[0]),g.includes(e)?Object(f.decodeBase64Check)(Object(f.assertedType)(t,e)):Object(f.decodeBase58Check)(Object(f.assertedType)(t,e))}function k(t,e){return"".concat(e,"_").concat(g.includes(e)?Object(f.encodeBase64Check)(t):Object(f.encodeBase58Check)(t))}function E(e){var r=e.slice(0,2),n=p.i[r];if(!n)throw new Error("Id tag for prefix ".concat(r," not found."));return t.from([].concat(l()(Object(h.c)(n)),l()(x(e,r))))}function A(t){var e=t.readUIntBE(0,1),r=p.e[e];if(!r)throw new Error("Prefix for id-tag ".concat(e," not found."));return k(t.slice(1,t.length),r)}function S(t){return Object(h.c)(t,!0)}function O(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.from([]);return Object(d.BigNumber)(e.toString("hex"),16).toString(10)}function T(t){return t.map(function(t){return[Object(h.c)(t.key),E(t.id)]})}function j(t){return t.map(function(t){var e=a()(t,2),r=e[0],n=e[1];return Object.assign({key:r.toString(),id:A(n)})})}e.default={readPointers:j,buildPointers:T,buildContractId:v,readId:A,writeId:E,readInt:O,writeInt:S,encode:k,decode:x,commitmentHash:w,formatSalt:b,oracleQueryId:y,createSalt:m}}.call(this,r(17).Buffer)},function(t,e,r){"use strict";r.r(e),function(t){r.d(e,"calculateMinFee",function(){return _}),r.d(e,"calculateFee",function(){return k}),r.d(e,"validateParams",function(){return E}),r.d(e,"buildRawTx",function(){return A}),r.d(e,"unpackRawTx",function(){return S}),r.d(e,"buildTx",function(){return O}),r.d(e,"unpackTx",function(){return T});var n=r(5),i=r.n(n),o=r(22),a=r.n(o),s=r(2),u=r.n(s),c=r(14),l=r.n(c),f=r(7),h=r.n(f),p=r(10),d=r(6),m=r(3),g=r(12),v=r(21),y=r(92),b={delta:"delta",block:"block"};function w(t){var e=Object.entries(t).find(function(t){var e=h()(t,1)[0];return["oracleTtl","queryTtl","responseTtl"].includes(e)})||["",{}],r=h()(e,2),n=(r[0],r[1].value);return void 0===n?500:n}function _(t,e){var r=e.gas,n=void 0===r?0:r,o=e.params,a=Object(p.BigNumber)(1e9);if(!o)return Object(p.BigNumber)(m.c).times(a).toString(10);for(var s=x(t,{params:i()({},o,{fee:0}),multiplier:a,gas:n}),u=Object(p.BigNumber)(0);!s.eq(u);)u=s=x(t,{params:i()({},o,{fee:s}),multiplier:a,gas:n});return u.toString(10)}function x(t,e){var r=e.params,n=(e.gas,e.multiplier),o=O(i()({},r),t).rlpEncoded.length;return Object(m.m)(t).plus(Object(m.n)(t)({txSize:o,relativeTtl:w(r)})).times(n)}function k(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.gas,i=void 0===n?0:n,o=r.params,a=r.showWarning,s=void 0===a||a;!o&&s&&console.warn("Can't build transaction fee, we will use DEFAULT_FEE(".concat(m.c,")"));var u=_(e,{params:o,gas:i});return t&&Object(p.BigNumber)(u).gt(Object(p.BigNumber)(t))&&s&&console.warn("Transaction fee is lower then min fee! Min fee: ".concat(u)),t||u}function E(t,e,r){var n=r.excludeKeys,i=void 0===n?[]:n;return e.filter(function(t){var e=h()(t,1)[0];return!i.includes(e)&&"payload"!==e}).reduce(function(e,r){var n=h()(r,3),i=n[