@xoxno/sdk-js
Version:
The SDK to interact with the XOXNO Protocol!
2 lines • 935 kB
JavaScript
/*! For license information please see interactor.esm.js.LICENSE.txt */
var __webpack_modules__={2989:(e,t,r)=>{(r=>{if("object"==typeof window){const t={};e.exports?e.exports=r(t,!1):window.bls=r(t,!1)}else r(t,!0)})(((t,n)=>{t.BN254=0,t.BN381_1=1,t.BLS12_381=5,t.ethMode=!1,t.ETH_MODE_DRAFT_05=1,t.ETH_MODE_DRAFT_06=2,t.ETH_MODE_DRAFT_07=3;const i=(e,t)=>{const r=e.mod,n=e.ethMode?4:6,i=10*n+6+(e.ethMode?200:0),a=8*n,o=144*(e.ethMode?1:2),s=144*(e.ethMode?2:1),u=e=>r._blsMalloc(e),c=e=>{r._blsFree(e)};e.toHex=(e,t,r)=>{let n="";for(let i=0;i<r;i++)n+=("0"+e[t+i].toString(16)).slice(-2);return n},e.toHexStr=t=>e.toHex(t,0,t.length),e.fromHexStr=e=>{if(1&e.length)throw new Error("fromHexStr:length must be even "+e.length);const t=e.length/2,r=new Uint8Array(t);for(let n=0;n<t;n++)r[n]=parseInt(e.slice(2*n,2*n+2),16);return r};const l=(e,t)=>{r.HEAP32.set(t,e/4)},d=(e,t=!0)=>(n,i=0)=>{const a=u(3096),o=e(a,3096,n,i);if(o<=0)throw new Error("err gen_str:"+n);let s=null;return s=t?((e,t)=>{let n="";for(let i=0;i<t;i++)n+=String.fromCharCode(r.HEAP8[e+i]);return n})(a,o):new Uint8Array(r.HEAP8.subarray(a,a+o)),c(a),s},f=e=>d(e,!1),p=e=>(t,n)=>{const i=u(n.length);r.HEAP8.set(n,i);const a=e(t,i,n.length);if(c(i),0===a)throw new Error("err _wrapDeserialize",n)},g=(e,t,n=!1)=>function(){const i=[...arguments],a=i[t],o=Object.prototype.toString.apply(a);if(["[object String]","[object Uint8Array]","[object Array]"].indexOf(o)<0)throw new Error(`err bad type:"${o}". Use String or Uint8Array.`);const s=i[t+1],l=u(a.length);"[object String]"===o?((e,t)=>{for(let n=0;n<t.length;n++)r.HEAP8[e+n]=t.charCodeAt(n)})(l,a):r.HEAP8.set(a,l);const d=e(...i.slice(0,t),l,a.length,s);if(c(l),n)return d;if(d)throw new Error("err _wrapInput "+a)},m=(e,t,r,n,i)=>{const a=t._allocAndCopy(),o=i._allocAndCopy(),s=u(r*n.length);for(let e=0;e<n.length;e++)l(s+r*e,n[e].a_);e(a,s,n.length,o),c(s),c(o),t._saveAndFree(a)},y=(e,t,r,n,i)=>{const o=n.length;if(o!=i.length)throw"recover:bad length";const s=t._alloc(),d=u(r*o),f=u(a*o);for(let e=0;e<o;e++)l(d+r*e,n[e].a_),l(f+a*e,i[e].a_);const h=e(s,d,f,o);if(c(f),c(d),t._saveAndFree(s),h)throw"callRecover"};e.blsInit=(t=(e.ethMode?e.BLS12_381:e.BN254))=>{const n=r._blsInit(t,i);if(n)throw"blsInit err "+n},e.getCurveOrder=d(r._blsGetCurveOrder),e.getFieldOrder=d(r._blsGetFieldOrder),e.blsIdSetDecStr=g(r._blsIdSetDecStr,1),e.blsIdSetHexStr=g(r._blsIdSetHexStr,1),e.blsIdGetDecStr=d(r._blsIdGetDecStr),e.blsIdGetHexStr=d(r._blsIdGetHexStr),e.blsIdSerialize=f(r._blsIdSerialize),e.blsSecretKeySerialize=f(r._blsSecretKeySerialize),e.blsPublicKeySerialize=f(r._blsPublicKeySerialize),e.blsSignatureSerialize=f(r._blsSignatureSerialize),e.blsIdDeserialize=p(r._blsIdDeserialize),e.blsSecretKeyDeserialize=p(r._blsSecretKeyDeserialize),e.blsPublicKeyDeserialize=p(r._blsPublicKeyDeserialize),e.blsSignatureDeserialize=p(r._blsSignatureDeserialize),e.blsPublicKeySerializeUncompressed=f(r._blsPublicKeySerializeUncompressed),e.blsSignatureSerializeUncompressed=f(r._blsSignatureSerializeUncompressed),e.blsPublicKeyDeserializeUncompressed=p(r._blsPublicKeyDeserializeUncompressed),e.blsSignatureDeserializeUncompressed=p(r._blsSignatureDeserializeUncompressed),e.blsSecretKeySetLittleEndian=g(r._blsSecretKeySetLittleEndian,1),e.blsSecretKeySetLittleEndianMod=g(r._blsSecretKeySetLittleEndianMod,1),e.blsHashToSecretKey=g(r._blsHashToSecretKey,1),e.blsSign=g(r._blsSign,2),e.blsVerify=g(r._blsVerify,2,!0);class b{constructor(e){this.a_=new Uint32Array(e/4)}deserializeHexStr(t){this.deserialize(e.fromHexStr(t))}serializeToHexStr(){return e.toHexStr(this.serialize())}dump(e=""){console.log(e+this.serializeToHexStr())}clear(){this.a_.fill(0)}_alloc(){return u(4*this.a_.length)}_allocAndCopy(){const e=this._alloc();return r.HEAP32.set(this.a_,e/4),e}_save(e){this.a_.set(r.HEAP32.subarray(e/4,e/4+this.a_.length))}_saveAndFree(e){this._save(e),c(e)}_setter(e,t,r){const n=this._alloc(),i=e(n,t,r);if(this._saveAndFree(n),i)throw new Error("_setter err")}_getter(e,t,r){const n=this._allocAndCopy(),i=e(n,t,r);return c(n),i}_isEqual(e,t){const r=this._allocAndCopy(),n=t._allocAndCopy(),i=e(r,n);return c(n),c(r),1===i}_op1(e){const t=new this.constructor,r=this._allocAndCopy(),n=t._alloc();return e(n,r),t._saveAndFree(n),c(r),t}_op2(e,t,r=null){const n=r?new r:new this.constructor,i=this._allocAndCopy(),a=t._allocAndCopy(),o=n._alloc();return e(o,i,a),n._saveAndFree(o),c(a),c(i),n}_update(e,t){const r=this._allocAndCopy(),n=t._allocAndCopy();e(r,n),c(n),this._saveAndFree(r)}}e.Id=class extends b{constructor(){super(a)}setInt(e){this._setter(r._blsIdSetInt,e)}isEqual(e){return this._isEqual(r._blsIdIsEqual,e)}deserialize(t){this._setter(e.blsIdDeserialize,t)}serialize(){return this._getter(e.blsIdSerialize)}setStr(t,r=10){switch(r){case 10:return void this._setter(e.blsIdSetDecStr,t);case 16:return void this._setter(e.blsIdSetHexStr,t);default:throw"BlsId.setStr:bad base:"+r}}getStr(t=10){switch(t){case 10:return this._getter(e.blsIdGetDecStr);case 16:return this._getter(e.blsIdGetHexStr);default:throw"BlsId.getStr:bad base:"+t}}setLittleEndian(t){this._setter(e.blsSecretKeySetLittleEndian,t)}setLittleEndianMod(t){this._setter(e.blsSecretKeySetLittleEndianMod,t)}setByCSPRNG(){const t=new Uint8Array(a);e.getRandomValues(t),this.setLittleEndian(t)}},e.deserializeHexStrToId=t=>{const r=new e.Id;return r.deserializeHexStr(t),r},e.SecretKey=class extends b{constructor(){super(48)}setInt(e){this._setter(r._blsIdSetInt,e)}isZero(){return 1===this._getter(r._blsSecretKeyIsZero)}isEqual(e){return this._isEqual(r._blsSecretKeyIsEqual,e)}deserialize(t){this._setter(e.blsSecretKeyDeserialize,t)}serialize(){return this._getter(e.blsSecretKeySerialize)}add(e){this._update(r._blsSecretKeyAdd,e)}share(e,t){m(r._blsSecretKeyShare,this,48,e,t)}recover(e,t){y(r._blsSecretKeyRecover,this,48,e,t)}setHashOf(t){this._setter(e.blsHashToSecretKey,t)}setLittleEndian(t){this._setter(e.blsSecretKeySetLittleEndian,t)}setLittleEndianMod(t){this._setter(e.blsSecretKeySetLittleEndianMod,t)}setByCSPRNG(){const t=new Uint8Array(48);e.getRandomValues(t),this.setLittleEndian(t)}getPublicKey(){const t=new e.PublicKey,n=this._allocAndCopy(),i=t._alloc();return r._blsGetPublicKey(i,n),t._saveAndFree(i),c(n),t}sign(t){const r=new e.Signature,n=this._allocAndCopy(),i=r._alloc();return e.blsSign(i,n,t),r._saveAndFree(i),c(n),r}},e.deserializeHexStrToSecretKey=t=>{const r=new e.SecretKey;return r.deserializeHexStr(t),r},e.PublicKey=class extends b{constructor(){super(o)}isZero(){return 1===this._getter(r._blsPublicKeyIsZero)}isEqual(e){return this._isEqual(r._blsPublicKeyIsEqual,e)}deserialize(t){this._setter(e.blsPublicKeyDeserialize,t)}serialize(){return this._getter(e.blsPublicKeySerialize)}deserializeUncompressed(t){this._setter(e.blsPublicKeyDeserializeUncompressed,t)}serializeUncompressed(){return this._getter(e.blsPublicKeySerializeUncompressed)}add(e){this._update(r._blsPublicKeyAdd,e)}share(e,t){m(r._blsPublicKeyShare,this,o,e,t)}recover(e,t){y(r._blsPublicKeyRecover,this,o,e,t)}isValidOrder(){return this._getter(r._blsPublicKeyIsValidOrder)}verify(t,r){const n=this._allocAndCopy(),i=t._allocAndCopy(),a=e.blsVerify(i,n,r);return c(i),c(n),0!=a}},e.deserializeHexStrToPublicKey=t=>{const r=new e.PublicKey;return r.deserializeHexStr(t),r},e.Signature=class extends b{constructor(){super(s)}isZero(){return 1===this._getter(r._blsSignatureIsZero)}isEqual(e){return this._isEqual(r._blsSignatureIsEqual,e)}deserialize(t){this._setter(e.blsSignatureDeserialize,t)}serialize(){return this._getter(e.blsSignatureSerialize)}deserializeUncompressed(t){this._setter(e.blsSignatureDeserializeUncompressed,t)}serializeUncompressed(){return this._getter(e.blsSignatureSerializeUncompressed)}add(e){this._update(r._blsSignatureAdd,e)}recover(e,t){y(r._blsSignatureRecover,this,s,e,t)}isValidOrder(){return this._getter(r._blsSignatureIsValidOrder)}aggregate(e){const t=e.length,n=this._allocAndCopy(),i=u(s*t);for(let n=0;n<t;n++)r.HEAP32.set(e[n].a_,(i+s*n)/4);const a=r._blsAggregateSignature(n,i,t);return c(i),this._saveAndFree(n),1==a}fastAggregateVerify(e,t){const n=e.length,i=t.length,a=this._allocAndCopy(),s=u(o*n),l=u(i);for(let t=0;t<n;t++)r.HEAP32.set(e[t].a_,(s+o*t)/4);r.HEAP8.set(t,l);const d=r._blsFastAggregateVerify(a,s,n,l,i);return c(l),c(s),c(a),1==d}aggregateVerifyNoCheck(e,t){const n=e.length;if(0==n||t.length!=32*n)return!1;const i=this._allocAndCopy(),a=u(o*n),s=u(t.length);for(let t=0;t<n;t++)r.HEAP32.set(e[t].a_,(a+o*t)/4);r.HEAP8.set(t,s);const l=r._blsAggregateVerifyNoCheck(i,a,s,32,n);return c(s),c(a),c(i),1==l}},e.deserializeHexStrToSignature=t=>{const r=new e.Signature;return r.deserializeHexStr(t),r},e.setETHmode=e=>{if(0!=r._blsSetETHmode(e))throw new Error(`bad setETHmode ${e}`)},e.verifySignatureOrder=e=>{r._blsSignatureVerifyOrder(e)},e.verifyPublicKeyOrder=e=>{r._blsPublicKeyVerifyOrder(e)},e.areAllMsgDifferent=(e,t)=>{const r=e.length/t;if(e.length!=r*t)return!1;h={};for(let n=0;n<r;n++){const r=e.subarray(n*t,(n+1)*t);if(r in h)return!1;h[r]=!0}return!0},e.multiVerify=(t,n,i)=>{const a=n.length;if(t.length!=a||i.length!=a)return!1;for(let e=0;e<a;e++)if(32!=i[e].length)return!1;const l=u(s*a),d=u(o*a),f=u(32*a),h=u(8*a);e.getRandomValues(r.HEAP8.subarray(h,h+8*a));for(let e=0;e<a;e++)r.HEAP32.set(n[e].a_,(l+s*e)/4),r.HEAP32.set(t[e].a_,(d+o*e)/4),r.HEAP8.set(i[e],f+32*e);const p=r._blsMultiVerify(l,d,f,32,h,8,a,0);return c(h),c(f),c(d),c(l),1==p},e.blsInit(t),e.ethMode&&e.setETHmode(e.ETH_MODE_DRAFT_07)},a=function(e,r){const n=new Uint8Array(r);t.getRandomValues(n);for(let i=0;i<r;i++)t.mod.HEAP8[e+i]=n[i]};return t.setRandFunc=e=>{t.getRandomValues=e},t.init=(o=t.BN254)=>{t.curveType=o;const s="bls_c";return new Promise((u=>{if(n){const e=r(899);t.getRandomValues=e.randomFillSync;const n=r(4181);r(7867)(`./${s}.js`)({cryptoGetRandomValues:a,locateFile:e=>n.join("/",e)}).then((e=>{t.mod=e,i(t,o),u()}))}else{const n=window.crypto||window.msCrypto;t.getRandomValues=e=>n.getRandomValues(e),fetch(`./${s}.wasm`).then((e=>e.arrayBuffer())).then((e=>new Uint8Array(e))).then((()=>{e.exports?t.mod=r(7683)():t.mod=Module(),t.mod.cryptoGetRandomValues=a,t.mod.onRuntimeInitialized=()=>{i(t,o),u()}}))}}))},t}))},7683:(e,t,r)=>{var n,i=(n=(n="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0)||"/index.js",function(e){e=void 0!==(e=e||{})?e:{};var t,i={};for(t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);var a,o,s,u,c=[];s="object"==typeof window,u="function"==typeof importScripts,a="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,o=!s&&!a&&!u;var l,d,f,h,p="";a?(p=u?r(4181).dirname(p)+"/":"//",l=function(e,t){return f||(f=r(6137)),h||(h=r(4181)),e=h.normalize(e),f.readFileSync(e,t?null:"utf8")},d=function(e){var t=l(e,!0);return t.buffer||(t=new Uint8Array(t)),S(t.buffer),t},process.argv.length>1&&process.argv[1].replace(/\\/g,"/"),c=process.argv.slice(2),e.inspect=function(){return"[Emscripten Module object]"}):o?("undefined"!=typeof read&&(l=function(e){return read(e)}),d=function(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(S("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?c=scriptArgs:void 0!==arguments&&(c=arguments),"undefined"!=typeof print&&("undefined"==typeof console&&(console={}),console.log=print,console.warn=console.error="undefined"!=typeof printErr?printErr:print)):(s||u)&&(u?p=self.location.href:document.currentScript&&(p=document.currentScript.src),n&&(p=n),p=0!==p.indexOf("blob:")?p.substr(0,p.lastIndexOf("/")+1):"",l=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},u&&(d=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}));var g,m,y=e.print||console.log.bind(console),b=e.printErr||console.warn.bind(console);for(t in i)i.hasOwnProperty(t)&&(e[t]=i[t]);i=null,e.arguments&&(c=e.arguments),e.thisProgram&&e.thisProgram,e.quit&&e.quit,e.wasmBinary&&(g=e.wasmBinary),e.noExitRuntime&&e.noExitRuntime,"object"!=typeof WebAssembly&&b("no native wasm support detected");var v,w,_,A=new WebAssembly.Table({initial:197,maximum:197,element:"anyfunc"}),T=!1;function S(e,t){e||R("Assertion failed: "+t)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf8"),"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var E,I=e.INITIAL_MEMORY||16777216;function C(t){for(;t.length>0;){var r=t.shift();if("function"!=typeof r){var n=r.func;"number"==typeof n?void 0===r.arg?e.dynCall_v(n):e.dynCall_vi(n,r.arg):n(void 0===r.arg?null:r.arg)}else r()}}(m=e.wasmMemory?e.wasmMemory:new WebAssembly.Memory({initial:I/65536,maximum:I/65536}))&&(v=m.buffer),I=v.byteLength,v=E=v,e.HEAP8=new Int8Array(E),e.HEAP16=new Int16Array(E),e.HEAP32=_=new Int32Array(E),e.HEAPU8=w=new Uint8Array(E),e.HEAPU16=new Uint16Array(E),e.HEAPU32=new Uint32Array(E),e.HEAPF32=new Float32Array(E),e.HEAPF64=new Float64Array(E),_[19880]=5322560;var k=[],O=[],B=[],x=[],N=0,P=null,D=null;function R(t){throw e.onAbort&&e.onAbort(t),y(t+=""),b(t),T=!0,t="abort("+t+"). Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(t)}e.preloadedImages={},e.preloadedAudios={};var L="data:application/octet-stream;base64,";function U(e){return String.prototype.startsWith?e.startsWith(L):0===e.indexOf(L)}var M,F="bls_c.wasm";function j(){try{if(g)return new Uint8Array(g);if(d)return d(F);throw"both async and sync fetching of the wasm failed"}catch(e){R(e)}}U(F)||(M=F,F=e.locateFile?e.locateFile(M,p):p+M),O.push({func:function(){G()}});var z={a:function(e,t,r){w.copyWithin(e,t,t+r)},b:function(e){return!1},memory:m,table:A},V=function(){var t={a:z};function r(t,r){var n=t.exports;e.asm=n,function(){if(N--,e.monitorRunDependencies&&e.monitorRunDependencies(N),0==N&&(null!==P&&(clearInterval(P),P=null),D)){var t=D;D=null,t()}}()}function n(e){r(e.instance)}function i(e){return(g||!s&&!u||"function"!=typeof fetch?new Promise((function(e,t){e(j())})):fetch(F,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+F+"'";return e.arrayBuffer()})).catch((function(){return j()}))).then((function(e){return WebAssembly.instantiate(e,t)})).then(e,(function(e){b("failed to asynchronously prepare wasm: "+e),R(e)}))}if(N++,e.monitorRunDependencies&&e.monitorRunDependencies(N),e.instantiateWasm)try{return e.instantiateWasm(t,r)}catch(e){return b("Module.instantiateWasm callback failed with error: "+e),!1}return function(){if(g||"function"!=typeof WebAssembly.instantiateStreaming||U(F)||"function"!=typeof fetch)return i(n);fetch(F,{credentials:"same-origin"}).then((function(e){return WebAssembly.instantiateStreaming(e,t).then(n,(function(e){b("wasm streaming compile failed: "+e),b("falling back to ArrayBuffer instantiation"),i(n)}))}))}(),{}}();e.asm=V;var H,G=e.___wasm_call_ctors=function(){return(G=e.___wasm_call_ctors=e.asm.c).apply(null,arguments)};function q(t){function r(){H||(H=!0,e.calledRun=!0,T||(C(O),C(B),e.onRuntimeInitialized&&e.onRuntimeInitialized(),function(){if(e.postRun)for("function"==typeof e.postRun&&(e.postRun=[e.postRun]);e.postRun.length;)t=e.postRun.shift(),x.unshift(t);var t;C(x)}()))}t=t||c,N>0||(function(){if(e.preRun)for("function"==typeof e.preRun&&(e.preRun=[e.preRun]);e.preRun.length;)t=e.preRun.shift(),k.unshift(t);var t;C(k)}(),N>0||(e.setStatus?(e.setStatus("Running..."),setTimeout((function(){setTimeout((function(){e.setStatus("")}),1),r()}),1)):r()))}if(e._blsSetETHmode=function(){return(e._blsSetETHmode=e.asm.d).apply(null,arguments)},e._blsInit=function(){return(e._blsInit=e.asm.e).apply(null,arguments)},e._blsSetETHserialization=function(){return(e._blsSetETHserialization=e.asm.f).apply(null,arguments)},e._blsMalloc=function(){return(e._blsMalloc=e.asm.g).apply(null,arguments)},e._blsFree=function(){return(e._blsFree=e.asm.h).apply(null,arguments)},e._blsIdSetInt=function(){return(e._blsIdSetInt=e.asm.i).apply(null,arguments)},e._blsSecretKeySetLittleEndian=function(){return(e._blsSecretKeySetLittleEndian=e.asm.j).apply(null,arguments)},e._blsSecretKeySetLittleEndianMod=function(){return(e._blsSecretKeySetLittleEndianMod=e.asm.k).apply(null,arguments)},e._blsGetPublicKey=function(){return(e._blsGetPublicKey=e.asm.l).apply(null,arguments)},e._blsHashToSignature=function(){return(e._blsHashToSignature=e.asm.m).apply(null,arguments)},e._blsSign=function(){return(e._blsSign=e.asm.n).apply(null,arguments)},e._blsVerify=function(){return(e._blsVerify=e.asm.o).apply(null,arguments)},e._blsMultiVerify=function(){return(e._blsMultiVerify=e.asm.p).apply(null,arguments)},e._blsAggregateSignature=function(){return(e._blsAggregateSignature=e.asm.q).apply(null,arguments)},e._blsSignatureAdd=function(){return(e._blsSignatureAdd=e.asm.r).apply(null,arguments)},e._blsPublicKeyAdd=function(){return(e._blsPublicKeyAdd=e.asm.s).apply(null,arguments)},e._blsFastAggregateVerify=function(){return(e._blsFastAggregateVerify=e.asm.t).apply(null,arguments)},e._blsAggregateVerifyNoCheck=function(){return(e._blsAggregateVerifyNoCheck=e.asm.u).apply(null,arguments)},e._blsIdSerialize=function(){return(e._blsIdSerialize=e.asm.v).apply(null,arguments)},e._blsSecretKeySerialize=function(){return(e._blsSecretKeySerialize=e.asm.w).apply(null,arguments)},e._blsPublicKeySerialize=function(){return(e._blsPublicKeySerialize=e.asm.x).apply(null,arguments)},e._blsSignatureSerialize=function(){return(e._blsSignatureSerialize=e.asm.y).apply(null,arguments)},e._blsIdDeserialize=function(){return(e._blsIdDeserialize=e.asm.z).apply(null,arguments)},e._blsSecretKeyDeserialize=function(){return(e._blsSecretKeyDeserialize=e.asm.A).apply(null,arguments)},e._blsPublicKeyDeserialize=function(){return(e._blsPublicKeyDeserialize=e.asm.B).apply(null,arguments)},e._blsSignatureDeserialize=function(){return(e._blsSignatureDeserialize=e.asm.C).apply(null,arguments)},e._blsIdIsEqual=function(){return(e._blsIdIsEqual=e.asm.D).apply(null,arguments)},e._blsSecretKeyIsEqual=function(){return(e._blsSecretKeyIsEqual=e.asm.E).apply(null,arguments)},e._blsPublicKeyIsEqual=function(){return(e._blsPublicKeyIsEqual=e.asm.F).apply(null,arguments)},e._blsSignatureIsEqual=function(){return(e._blsSignatureIsEqual=e.asm.G).apply(null,arguments)},e._blsIdIsZero=function(){return(e._blsIdIsZero=e.asm.H).apply(null,arguments)},e._blsSecretKeyIsZero=function(){return(e._blsSecretKeyIsZero=e.asm.I).apply(null,arguments)},e._blsPublicKeyIsZero=function(){return(e._blsPublicKeyIsZero=e.asm.J).apply(null,arguments)},e._blsSignatureIsZero=function(){return(e._blsSignatureIsZero=e.asm.K).apply(null,arguments)},e._blsSecretKeyShare=function(){return(e._blsSecretKeyShare=e.asm.L).apply(null,arguments)},e._blsPublicKeyShare=function(){return(e._blsPublicKeyShare=e.asm.M).apply(null,arguments)},e._blsSecretKeyRecover=function(){return(e._blsSecretKeyRecover=e.asm.N).apply(null,arguments)},e._blsPublicKeyRecover=function(){return(e._blsPublicKeyRecover=e.asm.O).apply(null,arguments)},e._blsSignatureRecover=function(){return(e._blsSignatureRecover=e.asm.P).apply(null,arguments)},e._blsSecretKeyAdd=function(){return(e._blsSecretKeyAdd=e.asm.Q).apply(null,arguments)},e._blsSignatureVerifyOrder=function(){return(e._blsSignatureVerifyOrder=e.asm.R).apply(null,arguments)},e._blsPublicKeyVerifyOrder=function(){return(e._blsPublicKeyVerifyOrder=e.asm.S).apply(null,arguments)},e._blsSignatureIsValidOrder=function(){return(e._blsSignatureIsValidOrder=e.asm.T).apply(null,arguments)},e._blsPublicKeyIsValidOrder=function(){return(e._blsPublicKeyIsValidOrder=e.asm.U).apply(null,arguments)},e._blsVerifyAggregatedHashes=function(){return(e._blsVerifyAggregatedHashes=e.asm.V).apply(null,arguments)},e._blsSignHash=function(){return(e._blsSignHash=e.asm.W).apply(null,arguments)},e._blsPublicKeySerializeUncompressed=function(){return(e._blsPublicKeySerializeUncompressed=e.asm.X).apply(null,arguments)},e._blsSignatureSerializeUncompressed=function(){return(e._blsSignatureSerializeUncompressed=e.asm.Y).apply(null,arguments)},e._blsPublicKeyDeserializeUncompressed=function(){return(e._blsPublicKeyDeserializeUncompressed=e.asm.Z).apply(null,arguments)},e._blsSignatureDeserializeUncompressed=function(){return(e._blsSignatureDeserializeUncompressed=e.asm._).apply(null,arguments)},e._blsVerifyPairing=function(){return(e._blsVerifyPairing=e.asm.$).apply(null,arguments)},e._blsVerifyHash=function(){return(e._blsVerifyHash=e.asm.aa).apply(null,arguments)},e._blsSecretKeySub=function(){return(e._blsSecretKeySub=e.asm.ba).apply(null,arguments)},e._blsPublicKeySub=function(){return(e._blsPublicKeySub=e.asm.ca).apply(null,arguments)},e._blsSignatureSub=function(){return(e._blsSignatureSub=e.asm.da).apply(null,arguments)},e._blsGetOpUnitSize=function(){return(e._blsGetOpUnitSize=e.asm.ea).apply(null,arguments)},e._blsGetCurveOrder=function(){return(e._blsGetCurveOrder=e.asm.fa).apply(null,arguments)},e._blsGetFieldOrder=function(){return(e._blsGetFieldOrder=e.asm.ga).apply(null,arguments)},e._blsGetSerializedSecretKeyByteSize=function(){return(e._blsGetSerializedSecretKeyByteSize=e.asm.ha).apply(null,arguments)},e._blsGetFrByteSize=function(){return(e._blsGetFrByteSize=e.asm.ia).apply(null,arguments)},e._blsGetSerializedPublicKeyByteSize=function(){return(e._blsGetSerializedPublicKeyByteSize=e.asm.ja).apply(null,arguments)},e._blsGetG1ByteSize=function(){return(e._blsGetG1ByteSize=e.asm.ka).apply(null,arguments)},e._blsGetSerializedSignatureByteSize=function(){return(e._blsGetSerializedSignatureByteSize=e.asm.la).apply(null,arguments)},e._blsGetGeneratorOfPublicKey=function(){return(e._blsGetGeneratorOfPublicKey=e.asm.ma).apply(null,arguments)},e._blsIdSetDecStr=function(){return(e._blsIdSetDecStr=e.asm.na).apply(null,arguments)},e._blsIdSetHexStr=function(){return(e._blsIdSetHexStr=e.asm.oa).apply(null,arguments)},e._blsIdSetLittleEndian=function(){return(e._blsIdSetLittleEndian=e.asm.pa).apply(null,arguments)},e._blsIdGetDecStr=function(){return(e._blsIdGetDecStr=e.asm.qa).apply(null,arguments)},e._blsIdGetHexStr=function(){return(e._blsIdGetHexStr=e.asm.ra).apply(null,arguments)},e._blsHashToSecretKey=function(){return(e._blsHashToSecretKey=e.asm.sa).apply(null,arguments)},e._blsGetPop=function(){return(e._blsGetPop=e.asm.ta).apply(null,arguments)},e._blsVerifyPop=function(){return(e._blsVerifyPop=e.asm.ua).apply(null,arguments)},e._blsIdGetLittleEndian=function(){return(e._blsIdGetLittleEndian=e.asm.va).apply(null,arguments)},e._blsSecretKeySetDecStr=function(){return(e._blsSecretKeySetDecStr=e.asm.wa).apply(null,arguments)},e._blsSecretKeySetHexStr=function(){return(e._blsSecretKeySetHexStr=e.asm.xa).apply(null,arguments)},e._blsSecretKeyGetLittleEndian=function(){return(e._blsSecretKeyGetLittleEndian=e.asm.ya).apply(null,arguments)},e._blsSecretKeyGetDecStr=function(){return(e._blsSecretKeyGetDecStr=e.asm.za).apply(null,arguments)},e._blsSecretKeyGetHexStr=function(){return(e._blsSecretKeyGetHexStr=e.asm.Aa).apply(null,arguments)},e._blsPublicKeySetHexStr=function(){return(e._blsPublicKeySetHexStr=e.asm.Ba).apply(null,arguments)},e._blsPublicKeyGetHexStr=function(){return(e._blsPublicKeyGetHexStr=e.asm.Ca).apply(null,arguments)},e._blsSignatureSetHexStr=function(){return(e._blsSignatureSetHexStr=e.asm.Da).apply(null,arguments)},e._blsSignatureGetHexStr=function(){return(e._blsSignatureGetHexStr=e.asm.Ea).apply(null,arguments)},e._blsDHKeyExchange=function(){return(e._blsDHKeyExchange=e.asm.Fa).apply(null,arguments)},e._blsMultiAggregateSignature=function(){return(e._blsMultiAggregateSignature=e.asm.Ga).apply(null,arguments)},e._blsMultiAggregatePublicKey=function(){return(e._blsMultiAggregatePublicKey=e.asm.Ha).apply(null,arguments)},e.dynCall_vi=function(){return(e.dynCall_vi=e.asm.Ia).apply(null,arguments)},e.asm=V,e.then=function(t){if(H)t(e);else{var r=e.onRuntimeInitialized;e.onRuntimeInitialized=function(){r&&r(),t(e)}}return e},D=function e(){H||q(),H||(D=e)},e.run=q,e.preInit)for("function"==typeof e.preInit&&(e.preInit=[e.preInit]);e.preInit.length>0;)e.preInit.pop()();return q(),e});e.exports=i},7867:(e,t,r)=>{var n={"./bls.js":2989,"./bls_c.js":7683};function i(e){var t=a(e);return r(t)}function a(e){if(!r.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}i.keys=function(){return Object.keys(n)},i.resolve=a,e.exports=i,i.id=7867},8095:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeFormula=void 0,t.TypeFormula=class{constructor(e,t,r){this.name=e,this.typeParameters=t,this.metadata=r}toString(){const e=this.typeParameters.length>0?`<${this.typeParameters.map((e=>e.toString())).join(", ")}>`:"",t=`${this.name}${e}`;return void 0!==this.metadata?`${t}*${this.metadata}*`:t}}},9132:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeFormulaParser=void 0;const n=r(8095);class i{parseExpression(e){e=e.trim();const t=this.tokenizeExpression(e).filter((e=>e!==i.COMMA)),r=[];for(const e of t)if(this.isPunctuation(e))if(this.isEndOfTypeParameters(e)){const e=this.acquireTypeWithParameters(r);r.push(e)}else{if(!this.isBeginningOfTypeParameters(e))throw new Error(`Unexpected token (punctuation): ${e}`);r.push(e)}else r.push(e);if(1!==r.length)throw new Error(`Unexpected stack length at end of parsing: ${r.length}`);if(i.PUNCTUATION.includes(r[0]))throw new Error("Unexpected root element.");const a=r[0];if(a instanceof n.TypeFormula)return a;if("string"==typeof a)return new n.TypeFormula(a,[]);throw new Error(`Unexpected item on stack: ${a}`)}tokenizeExpression(e){const t=[];let r="";for(const n of e)this.isPunctuation(n)?(r&&(t.push(r.trim()),r=""),t.push(n)):r+=n;return r&&t.push(r.trim()),t}acquireTypeWithParameters(e){const t=this.acquireTypeParameters(e),r=e.pop();if("ManagedDecimal"===r||"ManagedDecimalSigned"===r){const e=t[0].name;return new n.TypeFormula(r,[],e)}return new n.TypeFormula(r,t.reverse())}acquireTypeParameters(e){const t=[];for(;;){const r=e.pop();if(void 0===r)throw new Error("Badly specified type parameters");if(this.isBeginningOfTypeParameters(r))break;if(r instanceof n.TypeFormula)t.push(r);else{if("string"!=typeof r)throw new Error(`Unexpected type parameter object in stack: ${r}`);t.push(new n.TypeFormula(r,[]))}}return t}isPunctuation(e){return i.PUNCTUATION.includes(e)}isEndOfTypeParameters(e){return e===i.END_TYPE_PARAMETERS}isBeginningOfTypeParameters(e){return e===i.BEGIN_TYPE_PARAMETERS}}t.TypeFormulaParser=i,i.BEGIN_TYPE_PARAMETERS="<",i.END_TYPE_PARAMETERS=">",i.COMMA=",",i.PUNCTUATION=[i.COMMA,i.BEGIN_TYPE_PARAMETERS,i.END_TYPE_PARAMETERS]},1703:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;const n=r(236);t.Account=class{constructor(e){this.address=n.Address.empty(),this.nonce=0,this.balance="0",this.address=e}update(e){this.nonce=e.nonce,this.balance=e.balance}incrementNonce(){this.nonce=this.nonce.valueOf()+1}getNonceThenIncrement(){let e=this.nonce;return this.nonce=this.nonce.valueOf()+1,e}toJSON(){return{address:this.address.bech32(),nonce:this.nonce.valueOf(),balance:this.balance.toString()}}}},2969:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(620),t)},620:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.QueryRunnerAdapter=void 0;const n=r(236),i=r(3647);t.QueryRunnerAdapter=class{constructor(e){this.networkProvider=e.networkProvider}async runQuery(e){const t={address:n.Address.fromBech32(e.contract),caller:e.caller?n.Address.fromBech32(e.caller):void 0,func:e.function,value:e.value,getEncodedArguments:()=>e.arguments.map((e=>Buffer.from(e).toString("hex")))},r=await this.networkProvider.queryContract(t);return new i.SmartContractQueryResponse({function:e.function,returnCode:r.returnCode.toString(),returnMessage:r.returnMessage,returnDataParts:r.getReturnDataParts()})}}},236:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.AddressComputer=t.Address=void 0;const s=a(r(9674)),u=o(r(1594)),c=r(6424),l=r(7353),d=a(r(2581)),f=r(8390),h=r(5508),p="0".repeat(16);class g{constructor(e,t){if(!e)return this.publicKey=Buffer.from([]),void(this.hrp=t||c.LibraryConfig.DefaultAddressHrp);if(ArrayBuffer.isView(e)){if(32!=e.length)throw new d.ErrAddressCannotCreate(e);return this.publicKey=Buffer.from(e),void(this.hrp=t||c.LibraryConfig.DefaultAddressHrp)}if(e instanceof g){if(t)throw new d.ErrInvalidArgument("this variant of the Address constructor does not accept the 'hrp' argument");return this.publicKey=e.publicKey,void(this.hrp=e.hrp)}if("string"==typeof e){if(g.isValidHex(e))return this.publicKey=Buffer.from(e,"hex"),void(this.hrp=t||c.LibraryConfig.DefaultAddressHrp);if(t)throw new d.ErrInvalidArgument("this variant of the Address constructor does not accept the 'hrp' argument");const{hrp:r,pubkey:n}=m({value:e,allowCustomHrp:!1});return this.publicKey=n,void(this.hrp=r)}throw new d.ErrAddressCannotCreate(e)}static newFromBech32(e){const{hrp:t,pubkey:r}=m({value:e,allowCustomHrp:!0});return new g(r,t)}static fromBech32(e){const{hrp:t,pubkey:r}=m({value:e,allowCustomHrp:!1});return new g(r,t)}static newFromHex(e,t){if(!g.isValidHex(e))throw new d.ErrAddressCannotCreate(e);return new g(Buffer.from(e,"hex"),t)}static fromHex(e,t){return g.newFromHex(e,t)}static fromAddress(e){return new g(e)}static fromBuffer(e,t){return new g(e,t)}static fromString(e,t){return new g(e,t)}static isValidHex(e){return 32==Buffer.from(e,"hex").length}static empty(){return new g("")}static isValid(e){const t=s.decodeUnsafe(e),r=t?.prefix,n=t?Buffer.from(s.fromWords(t.words)):void 0;return r===c.LibraryConfig.DefaultAddressHrp&&32===n?.length}hex(){return this.toHex()}toHex(){return this.isEmpty()?"":this.publicKey.toString("hex")}bech32(){return this.toBech32()}toBech32(){if(this.isEmpty())return"";let e=s.toWords(this.pubkey());return s.encode(this.hrp,e)}pubkey(){return this.getPublicKey()}getPublicKey(){return this.publicKey}getHrp(){return this.hrp}isEmpty(){return 0==this.publicKey.length}equals(e){return!!e&&this.publicKey.toString()==e.publicKey.toString()}toString(){return this.toBech32()}toJSON(){return{bech32:this.toBech32(),pubkey:this.toHex()}}static Zero(){return new g("0".repeat(64))}isContractAddress(){return this.isSmartContract()}isSmartContract(){return this.toHex().startsWith(p)}}function m(e){const t=e.value,r=e.allowCustomHrp;let n,i;try{const e=s.decode(t);n=e.prefix,i=Buffer.from(s.fromWords(e.words))}catch(e){throw new d.ErrAddressCannotCreate(t,e)}if(!r&&n!=c.LibraryConfig.DefaultAddressHrp)throw new d.ErrAddressBadHrp(c.LibraryConfig.DefaultAddressHrp,n);return{hrp:n,pubkey:i}}t.Address=g,t.AddressComputer=class{constructor(e){this.numberOfShardsWithoutMeta=e||l.CURRENT_NUMBER_OF_SHARDS_WITHOUT_META}computeContractAddress(e,t){const r=Buffer.alloc(8,0),n=e.getPublicKey(),i=n.slice(30),a=Buffer.alloc(8),o=new u.default(t.toString()),s=f.bigIntToBuffer(o);a.write(s.reverse().toString("hex"),"hex");const c=Buffer.concat([n,a]),d=h("keccak256").update(c).digest(),p=Buffer.from(l.WasmVirtualMachine,"hex"),m=Buffer.concat([r,p,d.slice(10,30),i]);return new g(m)}getShardOfAddress(e){return this.getShardOfPubkey(e.getPublicKey(),this.numberOfShardsWithoutMeta)}getShardOfPubkey(e,t){const r=parseInt("11",2),n=parseInt("01",2),i=e[31];if(this.isPubkeyOfMetachain(e))return l.METACHAIN_ID;let a=i&r;return a>t-1&&(a=i&n),a}isPubkeyOfMetachain(e){const t=Buffer.from([0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),r=Buffer.from(e).slice(0,t.length);return!!t.equals(r)||!!Buffer.alloc(32).equals(Buffer.from(e))}}},5519:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.AsyncTimer=void 0;const o=a(r(2581)),s=r(2581),u=r(6458);t.AsyncTimer=class{constructor(e){this.timeoutHandle=null,this.rejectionFunc=null,this.name=e,this.correlationTag=0}start(e){if(this.timeoutHandle)throw new o.ErrAsyncTimerAlreadyRunning;return this.correlationTag++,u.Logger.trace(`AsyncTimer[${this.name}'${this.correlationTag}].start()`),new Promise(((t,r)=>{this.rejectionFunc=r,this.timeoutHandle=setTimeout((()=>{this.rejectionFunc=null,this.stop(),t()}),e)}))}abort(){u.Logger.trace(`AsyncTimer[${this.name}'${this.correlationTag}].abort()`),this.rejectionFunc&&(this.rejectionFunc(new s.ErrAsyncTimerAborted),this.rejectionFunc=null),this.stop()}stop(){this.isStopped()||(u.Logger.trace(`AsyncTimer[${this.name}'${this.correlationTag}].stop()`),this.timeoutHandle&&(clearTimeout(this.timeoutHandle),this.timeoutHandle=null))}isStopped(){return!this.timeoutHandle}}},1220:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Compatibility=void 0;const n=r(236);t.Compatibility=class{static guardAddressIsSetAndNonZero(e,t,r){e&&""!=e.bech32()?e.bech32()==n.Address.Zero().bech32()&&console.warn(`${t}: address should not be the 'zero' address (also known as the 'contracts deployment address'); ${r}. In the future, this will throw an exception instead of emitting a WARN.`):console.warn(`${t}: address should be set; ${r}. In the future, this will throw an exception instead of emitting a WARN.`)}}},6424:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LibraryConfig=void 0;class r{}t.LibraryConfig=r,r.DefaultAddressHrp="erd"},7353:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ESDT_CONTRACT_ADDRESS=t.DELEGATION_MANAGER_SC_ADDRESS=t.CONTRACT_DEPLOY_ADDRESS=t.BECH32_ADDRESS_LENGTH=t.DEFAULT_HRP=t.EGLD_IDENTIFIER_FOR_MULTI_ESDTNFT_TRANSFER=t.UNKNOWN_SIGNER=t.SDK_JS_SIGNER=t.METACHAIN_ID=t.WasmVirtualMachine=t.CURRENT_NUMBER_OF_SHARDS_WITHOUT_META=t.HEX_TRANSACTION_HASH_LENGTH=t.MESSAGE_PREFIX=t.DEFAULT_MESSAGE_VERSION=t.ESDT_CONTRACT_ADDRESS_HEX=t.DELEGATION_MANAGER_SC_ADDRESS_HEX=t.CONTRACT_DEPLOY_ADDRESS_HEX=t.VM_TYPE_WASM_VM=t.ARGUMENTS_SEPARATOR=t.ESDT_TRANSFER_VALUE=t.MULTI_ESDTNFT_TRANSFER_FUNCTION_NAME=t.ESDTNFT_TRANSFER_FUNCTION_NAME=t.ESDT_TRANSFER_FUNCTION_NAME=t.ESDT_TRANSFER_GAS_LIMIT=t.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS=t.TRANSACTION_VERSION_DEFAULT=t.TRANSACTION_OPTIONS_TX_GUARDED=t.TRANSACTION_OPTIONS_TX_HASH_SIGN=t.TRANSACTION_OPTIONS_DEFAULT=t.TRANSACTION_MIN_GAS_PRICE=void 0,t.TRANSACTION_MIN_GAS_PRICE=1e9,t.TRANSACTION_OPTIONS_DEFAULT=0,t.TRANSACTION_OPTIONS_TX_HASH_SIGN=1,t.TRANSACTION_OPTIONS_TX_GUARDED=2,t.TRANSACTION_VERSION_DEFAULT=2,t.MIN_TRANSACTION_VERSION_THAT_SUPPORTS_OPTIONS=2,t.ESDT_TRANSFER_GAS_LIMIT=5e5,t.ESDT_TRANSFER_FUNCTION_NAME="ESDTTransfer",t.ESDTNFT_TRANSFER_FUNCTION_NAME="ESDTNFTTransfer",t.MULTI_ESDTNFT_TRANSFER_FUNCTION_NAME="MultiESDTNFTTransfer",t.ESDT_TRANSFER_VALUE="0",t.ARGUMENTS_SEPARATOR="@",t.VM_TYPE_WASM_VM=new Uint8Array([5,0]),t.CONTRACT_DEPLOY_ADDRESS_HEX="0000000000000000000000000000000000000000000000000000000000000000",t.DELEGATION_MANAGER_SC_ADDRESS_HEX="000000000000000000010000000000000000000000000000000000000004ffff",t.ESDT_CONTRACT_ADDRESS_HEX="000000000000000000010000000000000000000000000000000000000002ffff",t.DEFAULT_MESSAGE_VERSION=1,t.MESSAGE_PREFIX="Elrond Signed Message:\n",t.HEX_TRANSACTION_HASH_LENGTH=64,t.CURRENT_NUMBER_OF_SHARDS_WITHOUT_META=3,t.WasmVirtualMachine="0500",t.METACHAIN_ID=4294967295,t.SDK_JS_SIGNER="sdk-js",t.UNKNOWN_SIGNER="unknown",t.EGLD_IDENTIFIER_FOR_MULTI_ESDTNFT_TRANSFER="EGLD-000000",t.DEFAULT_HRP="erd",t.BECH32_ADDRESS_LENGTH=62,t.CONTRACT_DEPLOY_ADDRESS="erd1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq6gq4hu",t.DELEGATION_MANAGER_SC_ADDRESS="erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqylllslmq6y6",t.ESDT_CONTRACT_ADDRESS="erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqzllls8a5w6u"},4408:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6659),t)},6659:(e,t,r)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TransactionsConverter=void 0;const n=r(236),i=r(661),a=r(476),o=r(3217);t.TransactionsConverter=class{transactionToPlainObject(e){return{nonce:Number(e.nonce),value:e.value.toString(),receiver:e.receiver,sender:e.sender,senderUsername:this.toBase64OrUndefined(e.senderUsername),receiverUsername:this.toBase64OrUndefined(e.receiverUsername),gasPrice:Number(e.gasPrice),gasLimit:Number(e.gasLimit),data:this.toBase64OrUndefined(e.data),chainID:e.chainID.valueOf(),version:e.version,options:0==e.options?void 0:e.options,relayer:e.relayer.isEmpty()?void 0:e.relayer.toBech32(),guardian:e.guardian?e.guardian:void 0,signature:this.toHexOrUndefined(e.signature),guardianSignature:this.toHexOrUndefined(e.guardianSignature),relayerSignature:this.toHexOrUndefined(e.relayerSignature)}}toBase64OrUndefined(e){return e&&e.length?Buffer.from(e).toString("base64"):void 0}toHexOrUndefined(e){return e&&e.length?Buffer.from(e).toString("hex"):void 0}plainObjectToTransaction(e){return new a.Transaction({nonce:BigInt(e.nonce),value:BigInt(e.value||""),receiver:e.receiver,relayer:e.relayer?n.Address.newFromBech32(e.relayer):n.Address.empty(),receiverUsername:this.bufferFromBase64(e.receiverUsername).toString(),sender:e.sender,senderUsername:this.bufferFromBase64(e.senderUsername).toString(),guardian:e.guardian,gasPrice:BigInt(e.gasPrice),gasLimit:BigInt(e.gasLimit),data:this.bufferFromBase64(e.data),chainID:String(e.chainID),version:Number(e.version),options:Number(e.options),signature:this.bufferFromHex(e.signature),guardianSignature:this.bufferFromHex(e.guardianSignature),relayerSignature:this.bufferFromHex(e.relayerSignature)})}bufferFromBase64(e){return Buffer.from(e||"","base64")}bufferFromHex(e){return Buffer.from(e||"","hex")}transactionOnNetworkToOutcome(e){const t=(new i.ResultsParser).parseUntypedOutcome(e),r=new o.SmartContractCallOutcome({function:e.function,returnCode:t.returnCode.toString(),returnMessage:t.returnMessage,returnDataParts:t.values}),n=e.contractResults.items.map((e=>this.smartContractResultOnNetworkToSmartContractResult(e))),a=new o.TransactionLogs({address:e.logs.address.bech32(),events:e.logs.events.map((e=>this.eventOnNetworkToEvent(e)))});return new o.TransactionOutcome({logs:a,smartContractResults:n,directSmartContractCallOutcome:r})}smartContractResultOnNetworkToSmartContractResult(e){return new o.SmartContractResult({sender:e.sender.bech32(),receiver:e.receiver.bech32(),data:Buffer.from(e.data),logs:new o.TransactionLogs({address:e.logs.address.bech32(),events:e.logs.events.map((e=>this.eventOnNetworkToEvent(e)))})})}eventOnNetworkToEvent(e){const t=e.dataPayload?.valueOf()||Buffer.from(e.data||""),r=e.additionalData?.map((e=>Buffer.from(e.valueOf())))||[];return 0===r.length&&t.length&&r.push(Buffer.from(t)),new o.TransactionEvent({address:e.address.bech32(),identifier:e.identifier,topics:e.topics.map((e=>Buffer.from(e.hex(),"hex"))),dataItems:r})}}},2581:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ErrContractQuery=t.ErrNetworkProvider=t.ErrBadAddress=t.ErrSignerCannotSign=t.ErrBadPEM=t.ErrBadMnemonicEntropy=t.ErrWrongMnemonic=t.ErrSmartContractQuery=t.ErrParseTransactionOutcome=t.ErrInvalidInnerTransaction=t.ErrBadUsage=t.ErrInvalidTokenIdentifier=t.ErrIsCompletedFieldIsMissingOnTransaction=t.ErrGasLimitShouldBe0ForInnerTransaction=t.ErrInvalidRelayedV2BuilderArguments=t.ErrInvalidRelayedV1BuilderArguments=t.ErrNotImplemented=t.ErrContractInteraction=t.ErrCodec=t.ErrCannotParseTransactionOutcome=t.ErrCannotParseContractResults=t.ErrMissingFieldOnEnum=t.ErrMissingFieldOnStruct=t.ErrTypingSystem=t.ErrMock=t.ErrContractHasNoAddress=t.ErrContract=t.ErrExpectedTransactionEventsNotFound=t.ErrExpectedTransactionStatusNotReached=t.ErrTransactionWatcherTimeout=t.ErrAsyncTimerAborted=t.ErrAsyncTimerAlreadyRunning=t.ErrInvalidFunctionName=t.ErrSignatureCannotCreate=t.ErrTransactionOptionsInvalid=t.ErrTransactionVersionInvalid=t.ErrNonceInvalid=t.ErrNotEnoughGas=t.ErrAddressEmpty=t.ErrAddressBadHrp=t.ErrAddressCannotCreate=t.ErrUnexpectedCondition=t.ErrInvariantFailed=t.ErrBadType=t.ErrUnsupportedOperation=t.ErrInvalidArgument=t.Err=void 0;class r extends Error{constructor(e,t){super(e),this.inner=void 0,this.inner=t}summary(){const e=[];e.push({name:this.name,message:this.message});let t=this.inner;for(;t;)e.push({name:t.name,message:t.message}),t=t.inner;return e}}t.Err=r,t.ErrInvalidArgument=class extends r{constructor(e,t){super(`Invalid argument: ${e}`,t)}},t.ErrUnsupportedOperation=class extends r{constructor(e,t="not specified"){super(`Operation "${e}" not supported. Reason: ${t}`)}},t.ErrBadType=class extends r{constructor(e,t,r){super(`Bad type of "${e}": ${r}. Expected type: ${t}`)}},t.ErrInvariantFailed=class extends r{constructor(e){super(`Invariant failed: [${e}]`)}},t.ErrUnexpectedCondition=class extends r{constructor(e){super(`Unexpected condition: [${e}]`)}},t.ErrAddressCannotCreate=class extends r{constructor(e,t){super(`Cannot create address from: ${e}`,t)}},t.ErrAddressBadHrp=class extends r{constructor(e,t){super(`Wrong address HRP. Expected: ${e}, got ${t}`)}},t.ErrAddressEmpty=class extends r{constructor(){super("Address is empty")}},t.ErrNotEnoughGas=class extends r{constructor(e){super(`Not enough gas provided: ${e}`)}},t.ErrNonceInvalid=class extends r{constructor(e){super(`Invalid nonce: ${e}`)}},t.ErrTransactionVersionInvalid=class extends r{constructor(e){super(`Invalid transaction version: ${e}`)}},t.ErrTransactionOptionsInvalid=class extends r{constructor(e){super(`Invalid transaction options: ${e}`)}},t.ErrSignatureCannotCreate=class extends r{constructor(e,t){super(`Cannot create signature from: ${e}`,t)}},t.ErrInvalidFunctionName=class extends r{constructor(){super("Invalid function name")}},t.ErrAsyncTimerAlreadyRunning=class extends r{constructor(){super("Async timer already running")}},t.ErrAsyncTimerAborted=class extends r{constructor(){super("Async timer aborted")}},t.ErrTransactionWatcherTimeout=class extends r{constructor(){super("TransactionWatcher has timed out")}},t.ErrExpectedTransactionStatusNotReached=class extends r{constructor(){super("Expected transaction status not reached")}},t.ErrExpectedTransactionEventsNotFound=class extends r{constructor(){super("Expected transaction events not found")}};class n extends r{constructor(e){super(e)}}t.ErrContract=n,t.ErrContractHasNoAddress=class extends n{constructor(){super("\nThe smart contract has no address set. Make sure you provide the address in the constructor, or call setAddress() appropriately.\nIf you need to recompute the address of the contract, make use of SmartContract.computeAddress() (static method). \n")}},t.ErrMock=class extends r{constructor(e){super(e)}},t.ErrTypingSystem=class extends r{constructor(e){super(e)}},t.ErrMissingFieldOnStruct=class extends r{constructor(e,t){super(`field ${e} does not exist on struct ${t}`)}},t.ErrMissingFieldOnEnum=class extends r{constructor(e,t){super(`field ${e} does not exist on enum ${t}`)}},t.ErrCannotParseContractResults=class extends r{constructor(e){super(`cannot parse contract results: ${e}`)}},t.ErrCannotParseTransactionOutcome=class extends r{constructor(e,t){super(`cannot parse outcome of transaction ${e}: ${t}`)}},t.ErrCodec=class extends r{constructor(e){super(e)}},t.ErrContractInteraction=class extends r{constructor(e){super(e)}},t.ErrNotImplemented=class extends r{constructor(){super("Method not yet implemented")}},t.ErrInvalidRelayedV1BuilderArguments=class extends r{constructor(){super("invalid arguments for relayed v1 builder")}},t.ErrInvalidRelayedV2BuilderArguments=class extends r{constructor(){super("invalid arguments for relayed v2 builder")}},t.ErrGasLimitShouldBe0ForInnerTransaction=class extends r{constructor(){super("gas limit must be 0 for the inner transaction for relayed v2")}},t.ErrIsCompletedFieldIsMissingOnTransaction=class extends r{constructor(){super("The transaction watcher requires the `isCompleted` property to be defined on the transaction object. Perhaps you've used the sdk-network-provider's `ProxyNetworkProvider.getTransaction()` and in that case you should also pass `withProcessStatus=true`.")}},t.ErrInvalidTokenIdentifier=class extends r{constructor(e){super(e)}},t.ErrBadUsage=class extends r{constructor(e){super(e)}},t.ErrInvalidInnerTransaction=class extends r{constructor(e){super(e)}},t.ErrParseTransactionOutcome=class extends r{constructor(e){super(e)}},t.ErrSmartContractQuery=class extends r{constructor(e,t){super(t),this.returnCode=e}},t.ErrWrongMnemonic=class extends r{constructor(){super("Wrong mnemonic format")}},t.ErrBadMnemonicEntropy=class extends r{constructor(e){super("Bad mnemonic entropy",e)}},t.ErrBadPEM=class extends r{constructor(e){super(e?`Bad PEM: ${e}`:"Bad PEM")}},t.ErrSignerCannotSign=class extends r{constructor(e){super("Cannot sign",e)}},t.ErrBadAddress=class extends r{constructor(e,t){super(`Bad address: ${e}`,t)}},t.ErrNetworkProvider=class extends r{constructor(e,t,r){super(`Request error on url [${e}]: [${t}]`,r)}},t.ErrContractQuery=class extends r{constructor(e){super(e.message.replace("executeQuery:",""))}}},523:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.GasEstimator=t.DefaultGasConfiguration=void 0,t.DefaultGasConfiguration={minGasLimit:5e4,gasPerDataByte:1500,gasCostESDTTransfer:2e5,gasCostESDTNFTTransfer:2e5,gasCostESDTNFTMultiTransfer:2e5};const r=8e5;t.GasEstimator=class{constructor(e){this.gasConfiguration=e||t.DefaultGasConfiguration}forEGLDTransfer(e){return this.gasConfiguration.minGasLimit+this.gasConfiguration.gasPerDataByte*e}forESDTTransfer(e){return this.gasConfiguration.minGasLimit+this.gasConfiguration.gasCostESDTTransfer+this.gasConfiguration.gasPerDataByte*e+1e5}forESDTNFTTransfer(e){return this.gasConfiguration.minGasLimit+this.gasConfiguration.gasCostESDTNFTTransfer+this.gasConfiguration.gasPerDataByte*e+r}forMultiESDTNFTTransfer(e,t){return this.gasConfiguration.minGasLimit+(this.gasConfiguration.gasCostESDTNFTMultiTransfer+r)*t+this.gasConfiguration.gasPerDataByte*e}}},1944:(e,t,r)=>{r.g.Buffer||(r.g.Buffer=r(8287).Buffer)},9342:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=void 0;const o=a(r(2581));class s{constructor(e){if(e)if(e instanceof Buffer)this.hash=e;else{if("string"!=typeof e)throw new o.ErrBadType("hash","buffer | string",e);this.hash=Buffer.from(e,"hex")}else this.hash=Buffer.from([])}static empty(){return new s(Buffer.from([]))}isEmpty(){return 0==this.hash.length}toString(){return this.hex()}hex(){return this.hash.toString("hex")}valueOf(){return this.hash}}t.Hash=s},4820:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),r(1944),i(r(1703),t),i(r(2969),t),i(r(236),t),i(r(5519),t),i(r(6424),t),i(r(4408),t),i(r(2581),t),i(r(523),t),i(r(8979),t),i(r(8622),t),i(r(6458),t),i(r(1212),t),i(r(3500),t),i(r(7376),t),i(r(207),t),i(r(3508),t),i(r(5003),t),i(r(661),t),i(r(3856),t),i(r(5132),t),i(r(476),t),i(r(9825),t),i(r(3548),t),i(r(4650),t),i(r(3102),t),i(r(4476),t),i(r(1069),t),i(r(737),t),i(r(4160),t)},8979:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},8622:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},6458:(e,t)=>{var r;Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=t.LogLevel=void 0,function(e){e[e.Trace=0]="Trace",e[e.Debug=1]="Debug",e[e.Info=2]="Info",e[e.Warn=3]="Warn",e[e.Error=4]="Error",e[e.None=5]="None"}(r=t.LogLevel||(t.LogLevel={}));class n{static setLevel(e){n.logLevel=e}static trace(e,...t){n.logLevel>=r.Debug||console.debug(e,t)}static debug(e,...t){n.logLevel>=r.Debug||console.debug(e,t)}static info(e,...