@wormhole-foundation/wormhole-connect 2.2.0-beta.0-development → 2.2.0-beta.1-development
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +3 -3
- package/dist/src/hooks/useFetchSupportedRoutes.d.ts.map +1 -1
- package/lib/{aptos-S7qfk4eF.js → aptos-31PA2rFX.js} +2 -2
- package/lib/{aptos-DCqU4gTT.js → aptos-B8jsnVoS.js} +1 -1
- package/lib/{aptos-C2ziOmGF.mjs → aptos-CCgGvZjs.mjs} +5 -5
- package/lib/{aptos-CWV_-hYv.mjs → aptos-DVYbmFJJ.mjs} +2 -2
- package/lib/{base64-0sjqFKVy.js → base64-5kcPH2Ry.js} +1 -1
- package/lib/{base64-BQzK72Or.mjs → base64-CL9tkFGP.mjs} +1 -1
- package/lib/{ccip-izvu-uQb.js → ccip--zj9SMHN.js} +1 -1
- package/lib/{ccip-CinZc0eB.mjs → ccip-javMNNCd.mjs} +1 -1
- package/lib/{chunk-IMTC3J2M-B9Gs0lA6.js → chunk-IMTC3J2M-BcLXY1O4.js} +1 -1
- package/lib/{chunk-IMTC3J2M-DLSLeYCs.mjs → chunk-IMTC3J2M-DeAwWSAu.mjs} +3 -3
- package/lib/{events-CHPwOTnS.mjs → events-BIr0rmUF.mjs} +1 -1
- package/lib/{events-1FQ3eltE.js → events-ZTJJzzwL.js} +1 -1
- package/lib/{evm-ChjeT84k.mjs → evm-BdJvPk3J.mjs} +5 -5
- package/lib/{evm-Ct70o4qq.js → evm-BmG93aNU.js} +3 -3
- package/lib/{evm-DM3ptAm5.mjs → evm-CYdShX9n.mjs} +5 -5
- package/lib/{evm-CufYMX4l.js → evm-DWNU26Tx.js} +1 -1
- package/lib/{index-kq3hfwzK.mjs → index-B39ftYxK.mjs} +4 -4
- package/lib/{index-DycMfdxo.mjs → index-BUHmIbm1.mjs} +2 -2
- package/lib/{index-qLtfrTA8.js → index-BbiyKg6p.js} +1 -1
- package/lib/{index-VyhZwUqP.mjs → index-BhqFkgz5.mjs} +2 -2
- package/lib/{index-DIb3pG-F.mjs → index-Bn7RXnWl.mjs} +2 -2
- package/lib/{index-B8ce-3i8.js → index-C0yUUgWL.js} +1 -1
- package/lib/{index-BjNWK8dQ.js → index-C89319ht.js} +1 -1
- package/lib/{index-DZUvAczP.js → index-CGCa-j7o.js} +1 -1
- package/lib/{index-B01sYhft.js → index-CGW6Ztd2.js} +1 -1
- package/lib/{index-DI-HM1Ot.mjs → index-CLGrfUbL.mjs} +2 -2
- package/lib/{index-BmJv4bHO.js → index-CMzehyQ8.js} +1 -1
- package/lib/{index-BbOEOMF9.mjs → index-CNRoD0cV.mjs} +90 -68
- package/lib/{index-eb1ZkXTw.mjs → index-Ck1M3TS1.mjs} +2 -2
- package/lib/{index-CoJbWKE6.mjs → index-Co3Xxu9O.mjs} +2 -2
- package/lib/{index-BrmHiqtc.mjs → index-CtfLRYM0.mjs} +2 -2
- package/lib/{index-tNClJ60p.js → index-CvDrTlD5.js} +1 -1
- package/lib/{index-CkX5tNYL.js → index-D0onBS9d.js} +1 -1
- package/lib/{index-BwQVNtKZ.mjs → index-DCC8GaVH.mjs} +2 -2
- package/lib/{index-wAvhmkLB.mjs → index-DGB2Fxry.mjs} +2 -2
- package/lib/{index-CFgXIz60.js → index-DOGZjt2S.js} +8 -8
- package/lib/{index-DfB5v4ik.mjs → index-DUaJiMqI.mjs} +3 -3
- package/lib/{index-DVSVBn4-.js → index-DWtG2bDp.js} +1 -1
- package/lib/{index-CAPrmxTu.mjs → index-DYiI6lkY.mjs} +1 -1
- package/lib/{index-f7DJpJiE.js → index-D_2bb1Pv.js} +1 -1
- package/lib/{index-C7CP__nZ.mjs → index-D_elFvDQ.mjs} +1 -1
- package/lib/{index-BmyyJYRn.mjs → index-DdvuhkPU.mjs} +1 -1
- package/lib/{index-xSmtZZwu.js → index-Dg_F5gMq.js} +1 -1
- package/lib/{index-j3KJk58s.mjs → index-Dsfz-oia.mjs} +3 -3
- package/lib/{index-C21geUZs.js → index-DvkkJ_AY.js} +1 -1
- package/lib/{index-BmwpYJH0.mjs → index-SEUn7gSU.mjs} +1 -1
- package/lib/{index-R4BZ1VCa.js → index-Upxa6-Ok.js} +1 -1
- package/lib/{index-Bl_-2Jvy.mjs → index-YTBFGtnw.mjs} +1 -1
- package/lib/{index-BCqJU6-4.js → index-ZSnwMbPW.js} +1 -1
- package/lib/{index-zLAF1Ksq.js → index-ZjwERA88.js} +1 -1
- package/lib/{index-Bm760kIP.mjs → index-cugw_66S.mjs} +1 -1
- package/lib/{index-C6_DBqBu.js → index-gdamBcoQ.js} +1 -1
- package/lib/{index-BEDagXR8.js → index-i9soDbgm.js} +1 -1
- package/lib/{index-GCg7snms.mjs → index-kwKTcApr.mjs} +5 -5
- package/lib/{index-COebbG0T.js → index-rzStwWOM.js} +1 -1
- package/lib/{index-48ExAZK2.mjs → index-x4yUWfDi.mjs} +1 -1
- package/lib/{index-BvZJV-Fm.js → index-xI8bbCGj.js} +1 -1
- package/lib/{index-Cnr4jKbe.js → index-yQD0Xsib.js} +1 -1
- package/lib/{index.es-Cvjdc21H.mjs → index.es-Cw1Vg7NX.mjs} +6 -6
- package/lib/{index.es-BURMeB7M.js → index.es-D1p0ce-Y.js} +2 -2
- package/lib/index.js +1 -1
- package/lib/index.mjs +1 -1
- package/lib/{signer-BclsiSRH.js → signer-C1_tDQTi.js} +1 -1
- package/lib/{signer-Bpst1zw_.mjs → signer-C4Jm9zsl.mjs} +1 -1
- package/lib/{solana-C4YIunl-.mjs → solana--vtCR0-G.mjs} +4 -4
- package/lib/{solana-CD0Aufq1.js → solana-BtM4z8cN.js} +1 -1
- package/lib/solana-LXeQ1tV1.js +1 -0
- package/lib/{solana-CoaPC8s6.mjs → solana-Q8lVR5YD.mjs} +5 -5
- package/lib/{solanaEmbed.esm-DjUFqFpM.mjs → solanaEmbed.esm-BvXjTkVM.mjs} +2 -2
- package/lib/{solanaEmbed.esm-BjNnWnx-.js → solanaEmbed.esm-DsV8Nqbb.js} +1 -1
- package/lib/src/hooks/useFetchSupportedRoutes.d.ts.map +1 -1
- package/lib/{sui-3oNSJVtq.mjs → sui-B6LQdf1S.mjs} +1 -1
- package/lib/{sui-B0C-5XvG.mjs → sui-C9At-twC.mjs} +5 -5
- package/lib/{sui-CT8fFOQ8.js → sui-CdyyFA7x.js} +2 -2
- package/lib/{sui-CHLH8_Fu.js → sui-CsDZcGdt.js} +1 -1
- package/package.json +1 -1
- package/lib/solana-DK8zh1ic.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFetchSupportedRoutes.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFetchSupportedRoutes.ts"],"names":[],"mappings":"AAUA,KAAK,UAAU,GAAG;IAChB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,uBAAuB,QAAO,
|
|
1
|
+
{"version":3,"file":"useFetchSupportedRoutes.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFetchSupportedRoutes.ts"],"names":[],"mappings":"AAUA,KAAK,UAAU,GAAG;IAChB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,UAAU,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,QAAA,MAAM,uBAAuB,QAAO,UAuGnC,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var f=Object.defineProperty;var p=(i,t,n)=>t in i?f(i,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[t]=n;var l=(i,t,n)=>p(i,typeof t!="symbol"?t+"":t,n);const a=require("./index-
|
|
2
|
-
${JSON.stringify(e,null,2)}`)})),this._rpc.signAndSubmitTransaction({signer:this._account,transaction:t}).then(n=>this._rpc.waitForTransaction({transactionHash:n.hash}))}}const _={Address:a.AptosAddress,Platform:d,getSigner:m,protocols:{WormholeCore:()=>Promise.resolve().then(()=>require("./index-
|
|
1
|
+
"use strict";var f=Object.defineProperty;var p=(i,t,n)=>t in i?f(i,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):i[t]=n;var l=(i,t,n)=>p(i,typeof t!="symbol"?t+"":t,n);const a=require("./index-DOGZjt2S.js"),u=require("./chunk-IMTC3J2M-BcLXY1O4.js");class g extends a.ChainContext{}const h=class h extends a.PlatformContext{constructor(t,n){super(t,n??a.networkPlatformConfigs(t,h._platform))}getRpc(t){if(t in this.config){const n=this.network==="Mainnet"?u.e.MAINNET:u.e.TESTNET,e=new u.s({fullnode:this.config[t].rpc,network:n});return new u.t(e)}throw new Error("No configuration available for chain: "+t)}getChain(t,n){if(t in this.config)return new g(t,this);throw new Error("No configuration available for chain: "+t)}static nativeTokenId(t,n){if(!this.isSupportedChain(n))throw new Error(`invalid chain: ${n}`);return a.Wormhole.tokenId(n,a.APTOS_COIN)}static isNativeTokenId(t,n,e){return!this.isSupportedChain(n)||e.chain!==n?!1:this.nativeTokenId(t,n)==e}static isSupportedChain(t){return a.chainToPlatform(t)===h._platform}static async getDecimals(t,n,e){if(a.isNative(e)||e===a.APTOS_COIN)return a.nativeDecimals(h._platform);const s=e.toString();return(await n.getFungibleAssetMetadataByAssetType({assetType:s})).decimals}static async getBalance(t,n,e,s){var r;const c=a.isNative(s)?a.APTOS_COIN:s.toString();try{return((r=(await n.getCurrentFungibleAssetBalances({options:{where:{owner_address:{_eq:e},asset_type:{_eq:c}}}}))[0])==null?void 0:r.amount)??null}catch(o){if(o.status===404)return null;throw o}}static async getBalances(t,n,e,s){return(await Promise.all(s.map(async r=>{const o=await this.getBalance(t,n,e,r);return{[a.isNative(r)?"native":new a.AptosAddress(r).toString()]:o}}))).reduce((r,o)=>Object.assign(r,o),{})}static async sendWait(t,n,e){const s=[];for(const c of e){const r=await n.transaction.submit.simple(c.transaction),o=await n.waitForTransaction({transactionHash:r.hash});s.push(o.hash)}return s}static async getLatestBlock(t){const n=await t.getLedgerInfo();return Number(n.block_height)}static async getLatestFinalizedBlock(t){const n=await t.getLedgerInfo();return Number(n.block_height)}static chainFromChainId(t){const n=a.platformNativeChainIdToNetworkChain(h._platform,BigInt(t));if(!n)throw new Error(`No matching chainId to determine network and chain: ${t}`);const[e,s]=n;return[e,s]}static async chainFromRpc(t){const n=await t.getLedgerInfo();return this.chainFromChainId(n.chain_id.toString())}};l(h,"_platform",a._platform$2);let d=h;async function m(i,t){const[n,e]=await d.chainFromRpc(i),s=u.o.fromPrivateKey({privateKey:new u.z(a.hex.decode(t))});return new w(e,s,i)}class w{constructor(t,n,e,s){l(this,"_chain");l(this,"_account");l(this,"_rpc");l(this,"_debug");this._chain=t,this._account=n,this._rpc=e,this._debug=s}chain(){return this._chain}address(){return this._account.accountAddress.toString()}async signAndSend(t){const n=[];for(const e of t){const{description:s,transaction:c}=e;this._debug&&console.log(`Signing: ${s} for ${this.address()}`);const r=await this._rpc.transaction.build.simple({sender:this._account.accountAddress,data:c}),{hash:o}=await this._simSignSend(r);n.push(o)}return n}async _simSignSend(t){return await this._rpc.transaction.simulate.simple({signerPublicKey:this._account.publicKey,transaction:t}).then(n=>n.forEach(e=>{if(!e.success)throw new Error(`Transaction failed: ${e.vm_status}
|
|
2
|
+
${JSON.stringify(e,null,2)}`)})),this._rpc.signAndSubmitTransaction({signer:this._account,transaction:t}).then(n=>this._rpc.waitForTransaction({transactionHash:n.hash}))}}const _={Address:a.AptosAddress,Platform:d,getSigner:m,protocols:{WormholeCore:()=>Promise.resolve().then(()=>require("./index-Dg_F5gMq.js")),TokenBridge:()=>Promise.resolve().then(()=>require("./index-xI8bbCGj.js")),CircleBridge:()=>Promise.resolve().then(()=>require("./index-CMzehyQ8.js"))},getChain:(i,t,n)=>new g(t,new d(i,a.applyChainsConfigConfigOverrides(i,a._platform$2,{[t]:n})))},y=Object.freeze(Object.defineProperty({__proto__:null,default:_},Symbol.toStringTag,{value:"Module"}));exports.AptosPlatform=d;exports.aptos=y;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Xh=Object.defineProperty;var Jh=(t,e,n)=>e in t?Xh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Qn=(t,e,n)=>Jh(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const me=require("./index-
|
|
1
|
+
"use strict";var Xh=Object.defineProperty;var Jh=(t,e,n)=>e in t?Xh(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Qn=(t,e,n)=>Jh(t,typeof e!="symbol"?e+"":e,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const me=require("./index-DOGZjt2S.js"),U=require("./chunk-IMTC3J2M-BcLXY1O4.js"),$h=require("./wallets-5qGJd8Hk.js");var ef=function(t,e,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!r:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(t):r?r.value:e.get(t)},tf=function(t,e,n,r,s){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?s.call(t,n):s?s.value=n:e.set(t,n),n},Es;function nf(t){const e=({register:n})=>n(t);try{window.dispatchEvent(new rf(e))}catch(n){console.error(`wallet-standard:register-wallet event could not be dispatched
|
|
2
2
|
`,n)}try{window.addEventListener("wallet-standard:app-ready",({detail:n})=>e(n))}catch(n){console.error(`wallet-standard:app-ready event listener could not be added
|
|
3
3
|
`,n)}}class rf extends Event{get detail(){return ef(this,Es,"f")}get type(){return"wallet-standard:register-wallet"}constructor(e){super("wallet-standard:register-wallet",{bubbles:!1,cancelable:!1,composed:!1}),Es.set(this,void 0),tf(this,Es,e,"f")}preventDefault(){throw new Error("preventDefault cannot be called")}stopImmediatePropagation(){throw new Error("stopImmediatePropagation cannot be called")}stopPropagation(){throw new Error("stopPropagation cannot be called")}}Es=new WeakMap;function zn(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function sf(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}function Do(t,...e){if(!sf(t))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function Xc(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");zn(t.outputLen),zn(t.blockLen)}function rr(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function Jc(t,e){Do(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const of=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4));function $c(t){return t instanceof Uint8Array||t!=null&&typeof t=="object"&&t.constructor.name==="Uint8Array"}const bs=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Rt=(t,e)=>t<<32-e|t>>>e,af=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!af)throw new Error("Non little-endian hardware is not supported");const cf=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function eu(t){if(!$c(t))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=cf[t[n]];return e}const Jt={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function Ia(t){if(t>=Jt._0&&t<=Jt._9)return t-Jt._0;if(t>=Jt._A&&t<=Jt._F)return t-(Jt._A-10);if(t>=Jt._a&&t<=Jt._f)return t-(Jt._a-10)}function tu(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length,n=e/2;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let s=0,o=0;s<n;s++,o+=2){const c=Ia(t.charCodeAt(o)),l=Ia(t.charCodeAt(o+1));if(c===void 0||l===void 0){const f=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+f+'" at index '+o)}r[s]=c*16+l}return r}function uf(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function sr(t){if(typeof t=="string"&&(t=uf(t)),!$c(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}class Uo{clone(){return this._cloneInto()}}const lf={}.toString;function df(t,e){if(e!==void 0&&lf.call(e)!=="[object Object]")throw new Error("Options should be object or undefined");return Object.assign(t,e)}function Co(t){const e=r=>t().update(sr(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}class nu extends Uo{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,Xc(e);const r=sr(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,o=new Uint8Array(s);o.set(r.length>s?e.create().update(r).digest():r);for(let c=0;c<o.length;c++)o[c]^=54;this.iHash.update(o),this.oHash=e.create();for(let c=0;c<o.length;c++)o[c]^=106;this.oHash.update(o),o.fill(0)}update(e){return rr(this),this.iHash.update(e),this}digestInto(e){rr(this),Do(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:s,destroyed:o,blockLen:c,outputLen:l}=this;return e=e,e.finished=s,e.destroyed=o,e.blockLen=c,e.outputLen=l,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Js=(t,e,n)=>new nu(t,e).update(n).digest();Js.create=(t,e)=>new nu(t,e);function hf(t,e,n,r){Xc(t);const s=df({dkLen:32,asyncTick:10},r),{c:o,dkLen:c,asyncTick:l}=s;if(zn(o),zn(c),zn(l),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const f=sr(e),p=sr(n),y=new Uint8Array(c),w=Js.create(t,f),b=w._cloneInto().update(p);return{c:o,dkLen:c,asyncTick:l,DK:y,PRF:w,PRFSalt:b}}function ff(t,e,n,r,s){return t.destroy(),e.destroy(),r&&r.destroy(),s.fill(0),n}function pf(t,e,n,r){const{c:s,dkLen:o,DK:c,PRF:l,PRFSalt:f}=hf(t,e,n,r);let p;const y=new Uint8Array(4),w=bs(y),b=new Uint8Array(l.outputLen);for(let S=1,I=0;I<o;S++,I+=l.outputLen){const k=c.subarray(I,I+l.outputLen);w.setInt32(0,S,!1),(p=f._cloneInto(p)).update(y).digestInto(b),k.set(b.subarray(0,k.length));for(let x=1;x<s;x++){l._cloneInto(p).update(b).digestInto(b);for(let q=0;q<k.length;q++)k[q]^=b[q]}}return ff(l,f,c,p,b)}function gf(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const s=BigInt(32),o=BigInt(4294967295),c=Number(n>>s&o),l=Number(n&o),f=r?4:0,p=r?0:4;t.setUint32(e+f,c,r),t.setUint32(e+p,l,r)}class ru extends Uo{constructor(e,n,r,s){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=s,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=bs(this.buffer)}update(e){rr(this);const{view:n,buffer:r,blockLen:s}=this;e=sr(e);const o=e.length;for(let c=0;c<o;){const l=Math.min(s-this.pos,o-c);if(l===s){const f=bs(e);for(;s<=o-c;c+=s)this.process(f,c);continue}r.set(e.subarray(c,c+l),this.pos),this.pos+=l,c+=l,this.pos===s&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){rr(this),Jc(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:s,isLE:o}=this;let{pos:c}=this;n[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>s-c&&(this.process(r,0),c=0);for(let w=c;w<s;w++)n[w]=0;gf(r,s-8,BigInt(this.length*8),o),this.process(r,0);const l=bs(e),f=this.outputLen;if(f%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const p=f/4,y=this.get();if(p>y.length)throw new Error("_sha2: outputLen bigger than state");for(let w=0;w<p;w++)l.setUint32(4*w,y[w],o)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:s,finished:o,destroyed:c,pos:l}=this;return e.length=s,e.pos=l,e.finished=o,e.destroyed=c,s%n&&e.buffer.set(r),e}}const yf=(t,e,n)=>t&e^~t&n,wf=(t,e,n)=>t&e^t&n^e&n,Af=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),sn=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),on=new Uint32Array(64);class mf extends ru{constructor(){super(64,32,8,!1),this.A=sn[0]|0,this.B=sn[1]|0,this.C=sn[2]|0,this.D=sn[3]|0,this.E=sn[4]|0,this.F=sn[5]|0,this.G=sn[6]|0,this.H=sn[7]|0}get(){const{A:e,B:n,C:r,D:s,E:o,F:c,G:l,H:f}=this;return[e,n,r,s,o,c,l,f]}set(e,n,r,s,o,c,l,f){this.A=e|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=o|0,this.F=c|0,this.G=l|0,this.H=f|0}process(e,n){for(let w=0;w<16;w++,n+=4)on[w]=e.getUint32(n,!1);for(let w=16;w<64;w++){const b=on[w-15],S=on[w-2],I=Rt(b,7)^Rt(b,18)^b>>>3,k=Rt(S,17)^Rt(S,19)^S>>>10;on[w]=k+on[w-7]+I+on[w-16]|0}let{A:r,B:s,C:o,D:c,E:l,F:f,G:p,H:y}=this;for(let w=0;w<64;w++){const b=Rt(l,6)^Rt(l,11)^Rt(l,25),S=y+b+yf(l,f,p)+Af[w]+on[w]|0,k=(Rt(r,2)^Rt(r,13)^Rt(r,22))+wf(r,s,o)|0;y=p,p=f,f=l,l=c+S|0,c=o,o=s,s=r,r=S+k|0}r=r+this.A|0,s=s+this.B|0,o=o+this.C|0,c=c+this.D|0,l=l+this.E|0,f=f+this.F|0,p=p+this.G|0,y=y+this.H|0,this.set(r,s,o,c,l,f,p,y)}roundClean(){on.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const vf=Co(()=>new mf),ps=BigInt(2**32-1),Xi=BigInt(32);function su(t,e=!1){return e?{h:Number(t&ps),l:Number(t>>Xi&ps)}:{h:Number(t>>Xi&ps)|0,l:Number(t&ps)|0}}function iu(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let s=0;s<t.length;s++){const{h:o,l:c}=su(t[s],e);[n[s],r[s]]=[o,c]}return[n,r]}const Ef=(t,e)=>BigInt(t>>>0)<<Xi|BigInt(e>>>0),bf=(t,e,n)=>t>>>n,Tf=(t,e,n)=>t<<32-n|e>>>n,If=(t,e,n)=>t>>>n|e<<32-n,Mf=(t,e,n)=>t<<32-n|e>>>n,Nf=(t,e,n)=>t<<64-n|e>>>n-32,Sf=(t,e,n)=>t>>>n-32|e<<64-n,xf=(t,e)=>e,Df=(t,e)=>t,ou=(t,e,n)=>t<<n|e>>>32-n,au=(t,e,n)=>e<<n|t>>>32-n,cu=(t,e,n)=>e<<n-32|t>>>64-n,uu=(t,e,n)=>t<<n-32|e>>>64-n;function Uf(t,e,n,r){const s=(e>>>0)+(r>>>0);return{h:t+n+(s/2**32|0)|0,l:s|0}}const Cf=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),zf=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,kf=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),Of=(t,e,n,r,s)=>e+n+r+s+(t/2**32|0)|0,Lf=(t,e,n,r,s)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(s>>>0),jf=(t,e,n,r,s,o)=>e+n+r+s+o+(t/2**32|0)|0,Ue={fromBig:su,split:iu,toBig:Ef,shrSH:bf,shrSL:Tf,rotrSH:If,rotrSL:Mf,rotrBH:Nf,rotrBL:Sf,rotr32H:xf,rotr32L:Df,rotlSH:ou,rotlSL:au,rotlBH:cu,rotlBL:uu,add:Uf,add3L:Cf,add3H:zf,add4L:kf,add4H:Of,add5H:jf,add5L:Lf},[Pf,_f]=Ue.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),an=new Uint32Array(80),cn=new Uint32Array(80);class Bf extends ru{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:r,Bl:s,Ch:o,Cl:c,Dh:l,Dl:f,Eh:p,El:y,Fh:w,Fl:b,Gh:S,Gl:I,Hh:k,Hl:x}=this;return[e,n,r,s,o,c,l,f,p,y,w,b,S,I,k,x]}set(e,n,r,s,o,c,l,f,p,y,w,b,S,I,k,x){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=s|0,this.Ch=o|0,this.Cl=c|0,this.Dh=l|0,this.Dl=f|0,this.Eh=p|0,this.El=y|0,this.Fh=w|0,this.Fl=b|0,this.Gh=S|0,this.Gl=I|0,this.Hh=k|0,this.Hl=x|0}process(e,n){for(let j=0;j<16;j++,n+=4)an[j]=e.getUint32(n),cn[j]=e.getUint32(n+=4);for(let j=16;j<80;j++){const be=an[j-15]|0,we=cn[j-15]|0,Ce=Ue.rotrSH(be,we,1)^Ue.rotrSH(be,we,8)^Ue.shrSH(be,we,7),We=Ue.rotrSL(be,we,1)^Ue.rotrSL(be,we,8)^Ue.shrSL(be,we,7),Pe=an[j-2]|0,$e=cn[j-2]|0,ce=Ue.rotrSH(Pe,$e,19)^Ue.rotrBH(Pe,$e,61)^Ue.shrSH(Pe,$e,6),ue=Ue.rotrSL(Pe,$e,19)^Ue.rotrBL(Pe,$e,61)^Ue.shrSL(Pe,$e,6),G=Ue.add4L(We,ue,cn[j-7],cn[j-16]),H=Ue.add4H(G,Ce,ce,an[j-7],an[j-16]);an[j]=H|0,cn[j]=G|0}let{Ah:r,Al:s,Bh:o,Bl:c,Ch:l,Cl:f,Dh:p,Dl:y,Eh:w,El:b,Fh:S,Fl:I,Gh:k,Gl:x,Hh:q,Hl:de}=this;for(let j=0;j<80;j++){const be=Ue.rotrSH(w,b,14)^Ue.rotrSH(w,b,18)^Ue.rotrBH(w,b,41),we=Ue.rotrSL(w,b,14)^Ue.rotrSL(w,b,18)^Ue.rotrBL(w,b,41),Ce=w&S^~w&k,We=b&I^~b&x,Pe=Ue.add5L(de,we,We,_f[j],cn[j]),$e=Ue.add5H(Pe,q,be,Ce,Pf[j],an[j]),ce=Pe|0,ue=Ue.rotrSH(r,s,28)^Ue.rotrBH(r,s,34)^Ue.rotrBH(r,s,39),G=Ue.rotrSL(r,s,28)^Ue.rotrBL(r,s,34)^Ue.rotrBL(r,s,39),H=r&o^r&l^o&l,Oe=s&c^s&f^c&f;q=k|0,de=x|0,k=S|0,x=I|0,S=w|0,I=b|0,{h:w,l:b}=Ue.add(p|0,y|0,$e|0,ce|0),p=l|0,y=f|0,l=o|0,f=c|0,o=r|0,c=s|0;const Te=Ue.add3L(ce,G,Oe);r=Ue.add3H(Te,$e,ue,H),s=Te|0}({h:r,l:s}=Ue.add(this.Ah|0,this.Al|0,r|0,s|0)),{h:o,l:c}=Ue.add(this.Bh|0,this.Bl|0,o|0,c|0),{h:l,l:f}=Ue.add(this.Ch|0,this.Cl|0,l|0,f|0),{h:p,l:y}=Ue.add(this.Dh|0,this.Dl|0,p|0,y|0),{h:w,l:b}=Ue.add(this.Eh|0,this.El|0,w|0,b|0),{h:S,l:I}=Ue.add(this.Fh|0,this.Fl|0,S|0,I|0),{h:k,l:x}=Ue.add(this.Gh|0,this.Gl|0,k|0,x|0),{h:q,l:de}=Ue.add(this.Hh|0,this.Hl|0,q|0,de|0),this.set(r,s,o,c,l,f,p,y,w,b,S,I,k,x,q,de)}roundClean(){an.fill(0),cn.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const zo=Co(()=>new Bf);function lu(t){if(typeof t!="string")throw new TypeError(`Invalid mnemonic type: ${typeof t}`);return t.normalize("NFKD")}function Rf(t){const e=lu(t),n=e.split(" ");if(![12,15,18,21,24].includes(n.length))throw new Error("Invalid mnemonic");return{nfkd:e,words:n}}const Ff=t=>lu(`mnemonic${t}`);function Wf(t,e=""){return pf(zo,Rf(t).nfkd,Ff(e),{c:2048,dkLen:64})}const[du,hu,fu]=[[],[],[]],Qf=BigInt(0),Ur=BigInt(1),Kf=BigInt(2),Hf=BigInt(7),Yf=BigInt(256),Gf=BigInt(113);for(let t=0,e=Ur,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],du.push(2*(5*r+n)),hu.push((t+1)*(t+2)/2%64);let s=Qf;for(let o=0;o<7;o++)e=(e<<Ur^(e>>Hf)*Gf)%Yf,e&Kf&&(s^=Ur<<(Ur<<BigInt(o))-Ur);fu.push(s)}const[Vf,Zf]=iu(fu,!0),Ma=(t,e,n)=>n>32?cu(t,e,n):ou(t,e,n),Na=(t,e,n)=>n>32?uu(t,e,n):au(t,e,n);function qf(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let c=0;c<10;c++)n[c]=t[c]^t[c+10]^t[c+20]^t[c+30]^t[c+40];for(let c=0;c<10;c+=2){const l=(c+8)%10,f=(c+2)%10,p=n[f],y=n[f+1],w=Ma(p,y,1)^n[l],b=Na(p,y,1)^n[l+1];for(let S=0;S<50;S+=10)t[c+S]^=w,t[c+S+1]^=b}let s=t[2],o=t[3];for(let c=0;c<24;c++){const l=hu[c],f=Ma(s,o,l),p=Na(s,o,l),y=du[c];s=t[y],o=t[y+1],t[y]=f,t[y+1]=p}for(let c=0;c<50;c+=10){for(let l=0;l<10;l++)n[l]=t[c+l];for(let l=0;l<10;l++)t[c+l]^=~n[(l+2)%10]&n[(l+4)%10]}t[0]^=Vf[r],t[1]^=Zf[r]}n.fill(0)}class ko extends Uo{constructor(e,n,r,s=!1,o=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=s,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,zn(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=of(this.state)}keccak(){qf(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){rr(this);const{blockLen:n,state:r}=this;e=sr(e);const s=e.length;for(let o=0;o<s;){const c=Math.min(n-this.pos,s-o);for(let l=0;l<c;l++)r[this.pos++]^=e[o++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:s}=this;e[r]^=n,n&128&&r===s-1&&this.keccak(),e[s-1]^=128,this.keccak()}writeInto(e){rr(this,!1),Do(e),this.finish();const n=this.state,{blockLen:r}=this;for(let s=0,o=e.length;s<o;){this.posOut>=r&&this.keccak();const c=Math.min(r-this.posOut,o-s);e.set(n.subarray(this.posOut,this.posOut+c),s),this.posOut+=c,s+=c}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return zn(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Jc(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:s,rounds:o,enableXOF:c}=this;return e||(e=new ko(n,r,s,c,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=s,e.enableXOF=c,e.destroyed=this.destroyed,e}}const Xf=(t,e,n)=>Co(()=>new ko(e,t,n)),ir=Xf(6,136,256/8);async function Jf(t){var e;const{params:n,method:r,url:s,headers:o,body:c,overrides:l}=t,f={headers:o,method:r,url:s,params:n,data:c,withCredentials:(e=l==null?void 0:l.WITH_CREDENTIALS)!=null?e:!0};try{const p=await me.axios(f);return{status:p.status,statusText:p.statusText,data:p.data,headers:p.headers,config:p.config}}catch(p){const y=p;if(y.response)return y.response;throw p}}var pu=Object.defineProperty,$f=Object.getOwnPropertyDescriptor,$s=(t,e)=>{for(var n in e)pu(t,n,{get:e[n],enumerable:!0})},Qe=(t,e,n,r)=>{for(var s=$f(e,n),o=t.length-1,c;o>=0;o--)(c=t[o])&&(s=c(e,n,s)||s);return s&&pu(e,n,s),s},ep=/^m(\/[0-9]+')+$/,gu=t=>t.replace("'",""),tp="ed25519 seed",np=2147483648,rp=t=>{const n=Js.create(zo,tp).update(tu(t)).digest(),r=n.slice(0,32),s=n.slice(32);return{key:r,chainCode:s}},sp=({key:t,chainCode:e},n)=>{const r=new ArrayBuffer(4);new DataView(r).setUint32(0,n);const s=new Uint8Array(r),o=new Uint8Array([0]),c=new Uint8Array([...o,...t,...s]),l=Js.create(zo,e).update(c).digest(),f=l.slice(0,32),p=l.slice(32);return{key:f,chainCode:p}},ip=t=>ep.test(t)?!t.split("/").slice(1).map(gu).some(Number.isNaN):!1,op=(t,e,n=np)=>{if(!ip(t))throw new Error("Invalid derivation path");const{key:r,chainCode:s}=rp(e);return t.split("/").slice(1).map(gu).map(c=>parseInt(c,10)).reduce((c,l)=>sp(c,l+n),{key:r,chainCode:s})},ap="1.21.0";async function cp(t){return new Promise(e=>{setTimeout(e,t)})}var Sa="/v1";function up(t){let e=`${t}`;return e.endsWith("/")&&(e=e.substring(0,e.length-1)),e.endsWith(Sa)||(e=`${e}${Sa}`),e}var yu=2e5,wu=20,lp=20,dp="0x1::aptos_coin::AptosCoin";function ei(t){let e,n,r;return typeof t=="object"?(e=t.hashFunction,n=t.ttlMs,r=t.tags):e=t,(s,o,c)=>{if(c.value!=null)c.value=xa(c.value,e,n,r);else if(c.get!=null)c.get=xa(c.get,e,n,r);else throw new Error("Only put a Memoize() decorator on a method or get accessor.")}}function Au(t,e){return ei({ttlMs:t,hashFunction:e})}var Ts=new Map;function hp(t){const e=new Set;for(const n of t){const r=Ts.get(n);if(r)for(const s of r)e.has(s)||(s.clear(),e.add(s))}return e.size}function xa(t,e,n=0,r){const s=Symbol("__memoized_map__");return function(...o){let c;const l=this;l.hasOwnProperty(s)||Object.defineProperty(l,s,{configurable:!1,enumerable:!1,writable:!1,value:new Map});const f=l[s];if(Array.isArray(r))for(const p of r)Ts.has(p)?Ts.get(p).push(f):Ts.set(p,[f]);if(e||o.length>0||n>0){let p;e===!0?p=o.map(b=>b.toString()).join("!"):e?p=e.apply(l,o):p=o[0];const y=`${p}__timestamp`;let w=!1;if(n>0)if(!f.has(y))w=!0;else{const b=f.get(y);w=Date.now()-b>n}f.has(p)&&!w?c=f.get(p):(c=t.apply(l,o),f.set(p,c),n>0&&f.set(y,Date.now()))}else{const p=l;f.has(p)?c=f.get(p):(c=t.apply(l,o),f.set(p,c))}return c}}var mu=class extends Error{constructor(t,e,n){super(n),this.name="AptosApiError",this.url=e.url,this.status=e.status,this.statusText=e.statusText,this.data=e.data,this.request=t}},fp={400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable"};async function pp(t,e,n,r,s,o){const c={...o==null?void 0:o.HEADERS,"x-aptos-client":`aptos-ts-sdk/${ap}`,"content-type":r??"application/json"};return o!=null&&o.TOKEN&&(c.Authorization=`Bearer ${o==null?void 0:o.TOKEN}`),await Jf({url:t,method:e,body:n,params:s,headers:c,overrides:o})}async function vu(t){const{url:e,endpoint:n,method:r,body:s,contentType:o,params:c,overrides:l}=t,f=`${e}/${n??""}`,p=await pp(f,r,s,o,c,l),y={status:p.status,statusText:p.statusText,data:p.data,headers:p.headers,config:p.config,url:f};if(y.status>=200&&y.status<300)return y;const w=fp[y.status];throw new mu(t,y,w??"Generic Error")}async function mt(t){return await vu({...t,method:"GET"})}async function _r(t){return await vu({...t,method:"POST"})}async function Da(t){const e=[];let n;const r=t.params;for(;;){r.start=n;const s=await mt({url:t.url,endpoint:t.endpoint,params:r,originMethod:t.originMethod,overrides:t.overrides});if(n=s.headers["x-aptos-cursor"],delete s.headers,e.push(...s.data),n==null)break}return e}var gp={mainnet:"https://indexer.mainnet.aptoslabs.com/v1/graphql",testnet:"https://indexer-testnet.staging.gcp.aptosdev.com/v1/graphql",devnet:"https://indexer-devnet.staging.gcp.aptosdev.com/v1/graphql",local:"http://127.0.0.1:8090/v1/graphql"},yp={mainnet:"https://fullnode.mainnet.aptoslabs.com/v1",testnet:"https://fullnode.testnet.aptoslabs.com/v1",devnet:"https://fullnode.devnet.aptoslabs.com/v1",local:"http://127.0.0.1:8080/v1"},Eu=(t=>(t.MAINNET="mainnet",t.TESTNET="testnet",t.DEVNET="devnet",t.LOCAL="local",t))(Eu||{}),Ee=class Is{static fromBuffer(e){return Is.fromUint8Array(e)}static fromUint8Array(e){return new Is(eu(e))}static ensure(e){return typeof e=="string"?new Is(e):e}constructor(e){e.startsWith("0x")?this.hexString=e:this.hexString=`0x${e}`}hex(){return this.hexString}noPrefix(){return this.hexString.slice(2)}toString(){return this.hex()}toShortString(){return`0x${this.hexString.replace(/^0x0*/,"")}`}toUint8Array(){return Uint8Array.from(tu(this.noPrefix()))}},je={};$s(je,{AccountAddress:()=>Ke,AccountAuthenticator:()=>fn,AccountAuthenticatorEd25519:()=>Ou,AccountAuthenticatorMultiEd25519:()=>ju,ArgumentABI:()=>ii,AuthenticationKey:()=>no,ChainId:()=>Ho,ChangeSet:()=>Lp,Ed25519PublicKey:()=>jt,Ed25519Signature:()=>en,EntryFunction:()=>ni,EntryFunctionABI:()=>Vr,FeePayerRawTransaction:()=>Wo,Identifier:()=>ht,Module:()=>Op,ModuleId:()=>Gr,MultiAgentRawTransaction:()=>Fo,MultiEd25519PublicKey:()=>ti,MultiEd25519Signature:()=>Lo,MultiSig:()=>rl,MultiSigTransactionPayload:()=>tl,RawTransaction:()=>fr,RawTransactionWithData:()=>Ro,RotationProofChallenge:()=>Pp,Script:()=>Bo,ScriptABI:()=>oi,SignedTransaction:()=>ri,StructTag:()=>hr,Transaction:()=>Tl,TransactionArgument:()=>Pt,TransactionArgumentAddress:()=>Jo,TransactionArgumentBool:()=>ea,TransactionArgumentU128:()=>qo,TransactionArgumentU16:()=>Go,TransactionArgumentU256:()=>Xo,TransactionArgumentU32:()=>Vo,TransactionArgumentU64:()=>Zo,TransactionArgumentU8:()=>Yo,TransactionArgumentU8Vector:()=>$o,TransactionAuthenticator:()=>cr,TransactionAuthenticatorEd25519:()=>jo,TransactionAuthenticatorFeePayer:()=>zu,TransactionAuthenticatorMultiAgent:()=>Uu,TransactionAuthenticatorMultiEd25519:()=>Po,TransactionPayload:()=>us,TransactionPayloadEntryFunction:()=>Ko,TransactionPayloadMultisig:()=>dl,TransactionPayloadScript:()=>Qo,TransactionScriptABI:()=>ta,TypeArgumentABI:()=>si,TypeTag:()=>ct,TypeTagAddress:()=>On,TypeTagBool:()=>ur,TypeTagParser:()=>cs,TypeTagParserError:()=>Ju,TypeTagSigner:()=>Gu,TypeTagStruct:()=>Ln,TypeTagU128:()=>dr,TypeTagU16:()=>ss,TypeTagU256:()=>os,TypeTagU32:()=>is,TypeTagU64:()=>lr,TypeTagU8:()=>pn,TypeTagVector:()=>as,UserTransaction:()=>Il,WriteSet:()=>jp,objectStructTag:()=>Up,optionStructTag:()=>Dp,stringStructTag:()=>_o});var Bn={};$s(Bn,{Deserializer:()=>Oo,Serializer:()=>Ze,bcsSerializeBool:()=>Np,bcsSerializeBytes:()=>un,bcsSerializeFixedBytes:()=>xp,bcsSerializeStr:()=>Sp,bcsSerializeU128:()=>Ip,bcsSerializeU16:()=>bp,bcsSerializeU256:()=>Mp,bcsSerializeU32:()=>Tp,bcsSerializeU8:()=>Ji,bcsSerializeUint64:()=>Ep,bcsToBytes:()=>nn,deserializeVector:()=>yt,serializeVector:()=>at,serializeVectorWithFunc:()=>vp});var wp=2**8-1,Ap=2**16-1,Yr=2**32-1,bu=BigInt(2**64)-BigInt(1),Tu=BigInt(2**128)-BigInt(1),mp=BigInt(2**256)-BigInt(1),Ze=class{constructor(){this.buffer=new ArrayBuffer(64),this.offset=0}ensureBufferWillHandleSize(t){for(;this.buffer.byteLength<this.offset+t;){const e=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(e).set(new Uint8Array(this.buffer)),this.buffer=e}}serialize(t){this.ensureBufferWillHandleSize(t.length),new Uint8Array(this.buffer,this.offset).set(t),this.offset+=t.length}serializeWithFunction(t,e,n){this.ensureBufferWillHandleSize(e);const r=new DataView(this.buffer,this.offset);t.apply(r,[0,n,!0]),this.offset+=e}serializeStr(t){const e=new TextEncoder;this.serializeBytes(e.encode(t))}serializeBytes(t){this.serializeU32AsUleb128(t.length),this.serialize(t)}serializeFixedBytes(t){this.serialize(t)}serializeBool(t){if(typeof t!="boolean")throw new Error("Value needs to be a boolean");const e=t?1:0;this.serialize(new Uint8Array([e]))}serializeU8(t){this.serialize(new Uint8Array([t]))}serializeU16(t){this.serializeWithFunction(DataView.prototype.setUint16,2,t)}serializeU32(t){this.serializeWithFunction(DataView.prototype.setUint32,4,t)}serializeU64(t){const e=BigInt(t.toString())&BigInt(Yr),n=BigInt(t.toString())>>BigInt(32);this.serializeU32(Number(e)),this.serializeU32(Number(n))}serializeU128(t){const e=BigInt(t.toString())&bu,n=BigInt(t.toString())>>BigInt(64);this.serializeU64(e),this.serializeU64(n)}serializeU256(t){const e=BigInt(t.toString())&Tu,n=BigInt(t.toString())>>BigInt(128);this.serializeU128(e),this.serializeU128(n)}serializeU32AsUleb128(t){let e=t;const n=[];for(;e>>>7;)n.push(e&127|128),e>>>=7;n.push(e),this.serialize(new Uint8Array(n))}getBytes(){return new Uint8Array(this.buffer).slice(0,this.offset)}};Qe([Rn(0,wp)],Ze.prototype,"serializeU8");Qe([Rn(0,Ap)],Ze.prototype,"serializeU16");Qe([Rn(0,Yr)],Ze.prototype,"serializeU32");Qe([Rn(BigInt(0),bu)],Ze.prototype,"serializeU64");Qe([Rn(BigInt(0),Tu)],Ze.prototype,"serializeU128");Qe([Rn(BigInt(0),mp)],Ze.prototype,"serializeU256");Qe([Rn(0,Yr)],Ze.prototype,"serializeU32AsUleb128");function Rn(t,e,n){return(r,s,o)=>{const c=o.value;return o.value=function(f){const p=BigInt(f.toString());if(p>BigInt(e.toString())||p<BigInt(t.toString()))throw new Error("Value is out of range");c.apply(this,[f])},o}}var Oo=class{constructor(t){this.buffer=new ArrayBuffer(t.length),new Uint8Array(this.buffer).set(t,0),this.offset=0}read(t){if(this.offset+t>this.buffer.byteLength)throw new Error("Reached to the end of buffer");const e=this.buffer.slice(this.offset,this.offset+t);return this.offset+=t,e}deserializeStr(){const t=this.deserializeBytes();return new TextDecoder().decode(t)}deserializeBytes(){const t=this.deserializeUleb128AsU32();return new Uint8Array(this.read(t))}deserializeFixedBytes(t){return new Uint8Array(this.read(t))}deserializeBool(){const t=new Uint8Array(this.read(1))[0];if(t!==1&&t!==0)throw new Error("Invalid boolean value");return t===1}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){const t=this.deserializeU32(),e=this.deserializeU32();return BigInt(BigInt(e)<<BigInt(32)|BigInt(t))}deserializeU128(){const t=this.deserializeU64(),e=this.deserializeU64();return BigInt(e<<BigInt(64)|t)}deserializeU256(){const t=this.deserializeU128(),e=this.deserializeU128();return BigInt(e<<BigInt(128)|t)}deserializeUleb128AsU32(){let t=BigInt(0),e=0;for(;t<Yr;){const n=this.deserializeU8();if(t|=BigInt(n&127)<<BigInt(e),!(n&128))break;e+=7}if(t>Yr)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(t)}};function at(t,e){e.serializeU32AsUleb128(t.length),t.forEach(n=>{n.serialize(e)})}function vp(t,e){const n=new Ze;n.serializeU32AsUleb128(t.length);const r=n[e];return t.forEach(s=>{r.call(n,s)}),n.getBytes()}function yt(t,e){const n=t.deserializeUleb128AsU32(),r=[];for(let s=0;s<n;s+=1)r.push(e.deserialize(t));return r}function nn(t){const e=new Ze;return t.serialize(e),e.getBytes()}function Ep(t){const e=new Ze;return e.serializeU64(t),e.getBytes()}function Ji(t){const e=new Ze;return e.serializeU8(t),e.getBytes()}function bp(t){const e=new Ze;return e.serializeU16(t),e.getBytes()}function Tp(t){const e=new Ze;return e.serializeU32(t),e.getBytes()}function Ip(t){const e=new Ze;return e.serializeU128(t),e.getBytes()}function Mp(t){const e=new Ze;return e.serializeU256(t),e.getBytes()}function Np(t){const e=new Ze;return e.serializeBool(t),e.getBytes()}function Sp(t){const e=new Ze;return e.serializeStr(t),e.getBytes()}function un(t){const e=new Ze;return e.serializeBytes(t),e.getBytes()}function xp(t){const e=new Ze;return e.serializeFixedBytes(t),e.getBytes()}var Fs=class Ot{constructor(e){if(e.length!==Ot.LENGTH)throw new Error("Expected address of length 32");this.address=e}static fromHex(e){let n=Ee.ensure(e);n.noPrefix().length%2!==0&&(n=new Ee(`0${n.noPrefix()}`));const r=n.toUint8Array();if(r.length>Ot.LENGTH)throw new Error("Hex string is too long. Address's length is 32 bytes.");if(r.length===Ot.LENGTH)return new Ot(r);const s=new Uint8Array(Ot.LENGTH);return s.set(r,Ot.LENGTH-r.length),new Ot(s)}static isValid(e){if(e==="")return!1;let n=Ee.ensure(e);return n.noPrefix().length%2!==0&&(n=new Ee(`0${n.noPrefix()}`)),n.toUint8Array().length<=Ot.LENGTH}toHexString(){return Ee.fromUint8Array(this.address).hex()}serialize(e){e.serializeFixedBytes(this.address)}static deserialize(e){return new Ot(e.deserializeFixedBytes(Ot.LENGTH))}static standardizeAddress(e){const n=e.toLowerCase();return`0x${(n.startsWith("0x")?n.slice(2):n).padStart(64,"0")}`}};Fs.LENGTH=32;Fs.CORE_CODE_ADDRESS=Fs.fromHex("0x1");var Ke=Fs,Iu=class Ms{constructor(e){if(e.length!==Ms.LENGTH)throw new Error(`Ed25519PublicKey length should be ${Ms.LENGTH}`);this.value=e}toBytes(){return this.value}serialize(e){e.serializeBytes(this.value)}static deserialize(e){const n=e.deserializeBytes();return new Ms(n)}};Iu.LENGTH=32;var jt=Iu,Mu=class Ns{constructor(e){if(this.value=e,e.length!==Ns.LENGTH)throw new Error(`Ed25519Signature length should be ${Ns.LENGTH}`)}serialize(e){e.serializeBytes(this.value)}static deserialize(e){const n=e.deserializeBytes();return new Ns(n)}};Mu.LENGTH=64;var en=Mu,$i=32,ti=class Nu{constructor(e,n){if(this.public_keys=e,this.threshold=n,n>$i)throw new Error(`"threshold" cannot be larger than ${$i}`)}toBytes(){const e=new Uint8Array(this.public_keys.length*jt.LENGTH+1);return this.public_keys.forEach((n,r)=>{e.set(n.value,r*jt.LENGTH)}),e[this.public_keys.length*jt.LENGTH]=this.threshold,e}serialize(e){e.serializeBytes(this.toBytes())}static deserialize(e){const n=e.deserializeBytes(),r=n[n.length-1],s=[];for(let o=0;o<n.length-1;o+=jt.LENGTH){const c=o;s.push(new jt(n.subarray(c,c+jt.LENGTH)))}return new Nu(s,r)}},Su=class Br{constructor(e,n){if(this.signatures=e,this.bitmap=n,n.length!==Br.BITMAP_LEN)throw new Error(`"bitmap" length should be ${Br.BITMAP_LEN}`)}toBytes(){const e=new Uint8Array(this.signatures.length*en.LENGTH+Br.BITMAP_LEN);return this.signatures.forEach((n,r)=>{e.set(n.value,r*en.LENGTH)}),e.set(this.bitmap,this.signatures.length*en.LENGTH),e}static createBitmap(e){const r=new Uint8Array([0,0,0,0]),s=new Set;return e.forEach(o=>{if(o>=$i)throw new Error(`Invalid bit value ${o}.`);if(s.has(o))throw new Error("Duplicated bits detected.");s.add(o);const c=Math.floor(o/8);let l=r[c];l|=128>>o%8,r[c]=l}),r}serialize(e){e.serializeBytes(this.toBytes())}static deserialize(e){const n=e.deserializeBytes(),r=n.subarray(n.length-4),s=[];for(let o=0;o<n.length-r.length;o+=en.LENGTH){const c=o;s.push(new en(n.subarray(c,c+en.LENGTH)))}return new Br(s,r)}};Su.BITMAP_LEN=4;var Lo=Su,cr=class{static deserialize(t){const e=t.deserializeUleb128AsU32();switch(e){case 0:return jo.load(t);case 1:return Po.load(t);case 2:return Uu.load(t);case 3:return zu.load(t);default:throw new Error(`Unknown variant index for TransactionAuthenticator: ${e}`)}}},jo=class xu extends cr{constructor(e,n){super(),this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){const n=jt.deserialize(e),r=en.deserialize(e);return new xu(n,r)}},Po=class Du extends cr{constructor(e,n){super(),this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){const n=ti.deserialize(e),r=Lo.deserialize(e);return new Du(n,r)}},Uu=class Cu extends cr{constructor(e,n,r){super(),this.sender=e,this.secondary_signer_addresses=n,this.secondary_signers=r}serialize(e){e.serializeU32AsUleb128(2),this.sender.serialize(e),at(this.secondary_signer_addresses,e),at(this.secondary_signers,e)}static load(e){const n=fn.deserialize(e),r=yt(e,Ke),s=yt(e,fn);return new Cu(n,r,s)}},zu=class ku extends cr{constructor(e,n,r,s){super(),this.sender=e,this.secondary_signer_addresses=n,this.secondary_signers=r,this.fee_payer=s}serialize(e){e.serializeU32AsUleb128(3),this.sender.serialize(e),at(this.secondary_signer_addresses,e),at(this.secondary_signers,e),this.fee_payer.address.serialize(e),this.fee_payer.authenticator.serialize(e)}static load(e){const n=fn.deserialize(e),r=yt(e,Ke),s=yt(e,fn),o=Ke.deserialize(e),c=fn.deserialize(e),l={address:o,authenticator:c};return new ku(n,r,s,l)}},fn=class{static deserialize(t){const e=t.deserializeUleb128AsU32();switch(e){case 0:return Ou.load(t);case 1:return ju.load(t);default:throw new Error(`Unknown variant index for AccountAuthenticator: ${e}`)}}},Ou=class Lu extends fn{constructor(e,n){super(),this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(0),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){const n=jt.deserialize(e),r=en.deserialize(e);return new Lu(n,r)}},ju=class Pu extends fn{constructor(e,n){super(),this.public_key=e,this.signature=n}serialize(e){e.serializeU32AsUleb128(1),this.public_key.serialize(e),this.signature.serialize(e)}static load(e){const n=ti.deserialize(e),r=Lo.deserialize(e);return new Pu(n,r)}},ht=class _u{constructor(e){this.value=e}serialize(e){e.serializeStr(this.value)}static deserialize(e){const n=e.deserializeStr();return new _u(n)}},ct=class{static deserialize(t){const e=t.deserializeUleb128AsU32();switch(e){case 0:return ur.load(t);case 1:return pn.load(t);case 2:return lr.load(t);case 3:return dr.load(t);case 4:return On.load(t);case 5:return Gu.load(t);case 6:return as.load(t);case 7:return Ln.load(t);case 8:return ss.load(t);case 9:return is.load(t);case 10:return os.load(t);default:throw new Error(`Unknown variant index for TypeTag: ${e}`)}}},ur=class Bu extends ct{serialize(e){e.serializeU32AsUleb128(0)}static load(e){return new Bu}},pn=class Ru extends ct{serialize(e){e.serializeU32AsUleb128(1)}static load(e){return new Ru}},ss=class Fu extends ct{serialize(e){e.serializeU32AsUleb128(8)}static load(e){return new Fu}},is=class Wu extends ct{serialize(e){e.serializeU32AsUleb128(9)}static load(e){return new Wu}},lr=class Qu extends ct{serialize(e){e.serializeU32AsUleb128(2)}static load(e){return new Qu}},dr=class Ku extends ct{serialize(e){e.serializeU32AsUleb128(3)}static load(e){return new Ku}},os=class Hu extends ct{serialize(e){e.serializeU32AsUleb128(10)}static load(e){return new Hu}},On=class Yu extends ct{serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new Yu}},Gu=class Vu extends ct{serialize(e){e.serializeU32AsUleb128(5)}static load(e){return new Vu}},as=class Zu extends ct{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(6),this.value.serialize(e)}static load(e){const n=ct.deserialize(e);return new Zu(n)}},Ln=class qu extends ct{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(7),this.value.serialize(e)}static load(e){const n=hr.deserialize(e);return new qu(n)}isStringTypeTag(){return this.value.module_name.value==="string"&&this.value.name.value==="String"&&this.value.address.toHexString()===Ke.CORE_CODE_ADDRESS.toHexString()}},hr=class eo{constructor(e,n,r,s){this.address=e,this.module_name=n,this.name=r,this.type_args=s}static fromString(e){const n=new cs(e).parseTypeTag();return new eo(n.value.address,n.value.module_name,n.value.name,n.value.type_args)}serialize(e){this.address.serialize(e),this.module_name.serialize(e),this.name.serialize(e),at(this.type_args,e)}static deserialize(e){const n=Ke.deserialize(e),r=ht.deserialize(e),s=ht.deserialize(e),o=yt(e,ct);return new eo(n,r,s,o)}},_o=new hr(Ke.fromHex("0x1"),new ht("string"),new ht("String"),[]);function Dp(t){return new hr(Ke.fromHex("0x1"),new ht("option"),new ht("Option"),[t])}function Up(t){return new hr(Ke.fromHex("0x1"),new ht("object"),new ht("Object"),[t])}function ln(t){throw new Ju(t)}function Ua(t){return!!t.match(/\s/)}function Ca(t){return!!t.match(/[_A-Za-z0-9]/g)}function Cp(t){return!!t.match(/T\d+/g)}function zp(t,e){const n=t[e];if(n===":"){if(t.slice(e,e+2)==="::")return[["COLON","::"],2];ln("Unrecognized token.")}else{if(n==="<")return[["LT","<"],1];if(n===">")return[["GT",">"],1];if(n===",")return[["COMMA",","],1];if(Ua(n)){let r="";for(let s=e;s<t.length;s+=1){const o=t[s];if(Ua(o))r=`${r}${o}`;else break}return[["SPACE",r],r.length]}else if(Ca(n)){let r="";for(let s=e;s<t.length;s+=1){const o=t[s];if(Ca(o))r=`${r}${o}`;else break}return Cp(r)?[["GENERIC",r],r.length]:[["IDENT",r],r.length]}}throw new Error("Unrecognized token.")}function kp(t){let e=0;const n=[];for(;e<t.length;){const[r,s]=zp(t,e);r[0]!=="SPACE"&&n.push(r),e+=s}return n}var cs=class Xu{constructor(e,n){this.typeTags=[],this.tokens=kp(e),this.typeTags=n||[]}consume(e){const n=this.tokens.shift();(!n||n[1]!==e)&&ln("Invalid type tag.")}consumeWholeGeneric(){for(this.consume("<");this.tokens[0][1]!==">";)this.tokens[0][1]==="<"?this.consumeWholeGeneric():this.tokens.shift();this.consume(">")}parseCommaList(e,n){const r=[];for(this.tokens.length<=0&&ln("Invalid type tag.");this.tokens[0][1]!==e&&(r.push(this.parseTypeTag()),!(this.tokens.length>0&&this.tokens[0][1]===e||(this.consume(","),this.tokens.length>0&&this.tokens[0][1]===e&&n)));)this.tokens.length<=0&&ln("Invalid type tag.");return r}parseTypeTag(){this.tokens.length===0&&ln("Invalid type tag.");const[e,n]=this.tokens.shift();if(n==="u8")return new pn;if(n==="u16")return new ss;if(n==="u32")return new is;if(n==="u64")return new lr;if(n==="u128")return new dr;if(n==="u256")return new os;if(n==="bool")return new ur;if(n==="address")return new On;if(n==="vector"){this.consume("<");const r=this.parseTypeTag();return this.consume(">"),new as(r)}if(n==="string")return new Ln(_o);if(e==="IDENT"&&(n.startsWith("0x")||n.startsWith("0X"))){const r=Ke.fromHex(n);this.consume("::");const[s,o]=this.tokens.shift();s!=="IDENT"&&ln("Invalid type tag."),this.consume("::");const[c,l]=this.tokens.shift();if(c!=="IDENT"&&ln("Invalid type tag."),Ke.CORE_CODE_ADDRESS.toHexString()===r.toHexString()&&o==="object"&&l==="Object")return this.consumeWholeGeneric(),new On;let f=[];this.tokens.length>0&&this.tokens[0][1]==="<"&&(this.consume("<"),f=this.parseCommaList(">",!0),this.consume(">"));const p=new hr(r,new ht(o),new ht(l),f);return new Ln(p)}if(e==="GENERIC"){this.typeTags.length===0&&ln("Can't convert generic type since no typeTags were specified.");const r=parseInt(n.substring(1),10);return new Xu(this.typeTags[r]).parseTypeTag()}throw new Error("Invalid type tag.")}},Ju=class extends Error{constructor(t){super(t),this.name="TypeTagParserError"}},fr=class $u{constructor(e,n,r,s,o,c,l){this.sender=e,this.sequence_number=n,this.payload=r,this.max_gas_amount=s,this.gas_unit_price=o,this.expiration_timestamp_secs=c,this.chain_id=l}serialize(e){this.sender.serialize(e),e.serializeU64(this.sequence_number),this.payload.serialize(e),e.serializeU64(this.max_gas_amount),e.serializeU64(this.gas_unit_price),e.serializeU64(this.expiration_timestamp_secs),this.chain_id.serialize(e)}static deserialize(e){const n=Ke.deserialize(e),r=e.deserializeU64(),s=us.deserialize(e),o=e.deserializeU64(),c=e.deserializeU64(),l=e.deserializeU64(),f=Ho.deserialize(e);return new $u(n,r,s,o,c,l,f)}},Bo=class el{constructor(e,n,r){this.code=e,this.ty_args=n,this.args=r}serialize(e){e.serializeBytes(this.code),at(this.ty_args,e),at(this.args,e)}static deserialize(e){const n=e.deserializeBytes(),r=yt(e,ct),s=yt(e,Pt);return new el(n,r,s)}},ni=class Ss{constructor(e,n,r,s){this.module_name=e,this.function_name=n,this.ty_args=r,this.args=s}static natural(e,n,r,s){return new Ss(Gr.fromStr(e),new ht(n),r,s)}static natual(e,n,r,s){return Ss.natural(e,n,r,s)}serialize(e){this.module_name.serialize(e),this.function_name.serialize(e),at(this.ty_args,e),e.serializeU32AsUleb128(this.args.length),this.args.forEach(n=>{e.serializeBytes(n)})}static deserialize(e){const n=Gr.deserialize(e),r=ht.deserialize(e),s=yt(e,ct),o=e.deserializeUleb128AsU32(),c=[];for(let f=0;f<o;f+=1)c.push(e.deserializeBytes());const l=c;return new Ss(n,r,s,l)}},tl=class nl{constructor(e){this.transaction_payload=e}serialize(e){e.serializeU32AsUleb128(0),this.transaction_payload.serialize(e)}static deserialize(e){return e.deserializeUleb128AsU32(),new nl(ni.deserialize(e))}},rl=class sl{constructor(e,n){this.multisig_address=e,this.transaction_payload=n}serialize(e){this.multisig_address.serialize(e),this.transaction_payload===void 0?e.serializeBool(!1):(e.serializeBool(!0),this.transaction_payload.serialize(e))}static deserialize(e){const n=Ke.deserialize(e),r=e.deserializeBool();let s;return r&&(s=tl.deserialize(e)),new sl(n,s)}},Op=class il{constructor(e){this.code=e}serialize(e){e.serializeBytes(this.code)}static deserialize(e){const n=e.deserializeBytes();return new il(n)}},Gr=class to{constructor(e,n){this.address=e,this.name=n}static fromStr(e){const n=e.split("::");if(n.length!==2)throw new Error("Invalid module id.");return new to(Ke.fromHex(new Ee(n[0])),new ht(n[1]))}serialize(e){this.address.serialize(e),this.name.serialize(e)}static deserialize(e){const n=Ke.deserialize(e),r=ht.deserialize(e);return new to(n,r)}},Lp=class{serialize(t){throw new Error("Not implemented.")}static deserialize(t){throw new Error("Not implemented.")}},jp=class{serialize(t){throw new Error("Not implmented.")}static deserialize(t){throw new Error("Not implmented.")}},ri=class ol{constructor(e,n){this.raw_txn=e,this.authenticator=n}serialize(e){this.raw_txn.serialize(e),this.authenticator.serialize(e)}static deserialize(e){const n=fr.deserialize(e),r=cr.deserialize(e);return new ol(n,r)}},Ro=class{static deserialize(t){const e=t.deserializeUleb128AsU32();switch(e){case 0:return Fo.load(t);case 1:return Wo.load(t);default:throw new Error(`Unknown variant index for RawTransactionWithData: ${e}`)}}},Fo=class al extends Ro{constructor(e,n){super(),this.raw_txn=e,this.secondary_signer_addresses=n}serialize(e){e.serializeU32AsUleb128(0),this.raw_txn.serialize(e),at(this.secondary_signer_addresses,e)}static load(e){const n=fr.deserialize(e),r=yt(e,Ke);return new al(n,r)}},Wo=class cl extends Ro{constructor(e,n,r){super(),this.raw_txn=e,this.secondary_signer_addresses=n,this.fee_payer_address=r}serialize(e){e.serializeU32AsUleb128(1),this.raw_txn.serialize(e),at(this.secondary_signer_addresses,e),this.fee_payer_address.serialize(e)}static load(e){const n=fr.deserialize(e),r=yt(e,Ke),s=Ke.deserialize(e);return new cl(n,r,s)}},us=class{static deserialize(t){const e=t.deserializeUleb128AsU32();switch(e){case 0:return Qo.load(t);case 2:return Ko.load(t);case 3:return dl.load(t);default:throw new Error(`Unknown variant index for TransactionPayload: ${e}`)}}},Qo=class ul extends us{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(0),this.value.serialize(e)}static load(e){const n=Bo.deserialize(e);return new ul(n)}},Ko=class ll extends us{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(2),this.value.serialize(e)}static load(e){const n=ni.deserialize(e);return new ll(n)}},dl=class hl extends us{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(3),this.value.serialize(e)}static load(e){const n=rl.deserialize(e);return new hl(n)}},Ho=class fl{constructor(e){this.value=e}serialize(e){e.serializeU8(this.value)}static deserialize(e){const n=e.deserializeU8();return new fl(n)}},Pt=class{static deserialize(t){const e=t.deserializeUleb128AsU32();switch(e){case 0:return Yo.load(t);case 1:return Zo.load(t);case 2:return qo.load(t);case 3:return Jo.load(t);case 4:return $o.load(t);case 5:return ea.load(t);case 6:return Go.load(t);case 7:return Vo.load(t);case 8:return Xo.load(t);default:throw new Error(`Unknown variant index for TransactionArgument: ${e}`)}}},Yo=class pl extends Pt{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(0),e.serializeU8(this.value)}static load(e){const n=e.deserializeU8();return new pl(n)}},Go=class gl extends Pt{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(6),e.serializeU16(this.value)}static load(e){const n=e.deserializeU16();return new gl(n)}},Vo=class yl extends Pt{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(7),e.serializeU32(this.value)}static load(e){const n=e.deserializeU32();return new yl(n)}},Zo=class wl extends Pt{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(1),e.serializeU64(this.value)}static load(e){const n=e.deserializeU64();return new wl(n)}},qo=class Al extends Pt{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(2),e.serializeU128(this.value)}static load(e){const n=e.deserializeU128();return new Al(n)}},Xo=class ml extends Pt{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(8),e.serializeU256(this.value)}static load(e){const n=e.deserializeU256();return new ml(n)}},Jo=class vl extends Pt{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(3),this.value.serialize(e)}static load(e){const n=Ke.deserialize(e);return new vl(n)}},$o=class El extends Pt{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(4),e.serializeBytes(this.value)}static load(e){const n=e.deserializeBytes();return new El(n)}},ea=class bl extends Pt{constructor(e){super(),this.value=e}serialize(e){e.serializeU32AsUleb128(5),e.serializeBool(this.value)}static load(e){const n=e.deserializeBool();return new bl(n)}},Tl=class{getHashSalt(){const t=ir.create();return t.update("APTOS::Transaction"),t.digest()}static deserialize(t){const e=t.deserializeUleb128AsU32();switch(e){case 0:return Il.load(t);default:throw new Error(`Unknown variant index for Transaction: ${e}`)}}},Il=class Ml extends Tl{constructor(e){super(),this.value=e}hash(){const e=ir.create();return e.update(this.getHashSalt()),e.update(nn(this)),e.digest()}serialize(e){e.serializeU32AsUleb128(0),this.value.serialize(e)}static load(e){return new Ml(ri.deserialize(e))}},si=class Nl{constructor(e){this.name=e}serialize(e){e.serializeStr(this.name)}static deserialize(e){const n=e.deserializeStr();return new Nl(n)}},ii=class Sl{constructor(e,n){this.name=e,this.type_tag=n}serialize(e){e.serializeStr(this.name),this.type_tag.serialize(e)}static deserialize(e){const n=e.deserializeStr(),r=ct.deserialize(e);return new Sl(n,r)}},oi=class{static deserialize(t){const e=t.deserializeUleb128AsU32();switch(e){case 0:return ta.load(t);case 1:return Vr.load(t);default:throw new Error(`Unknown variant index for TransactionPayload: ${e}`)}}},ta=class xl extends oi{constructor(e,n,r,s,o){super(),this.name=e,this.doc=n,this.code=r,this.ty_args=s,this.args=o}serialize(e){e.serializeU32AsUleb128(0),e.serializeStr(this.name),e.serializeStr(this.doc),e.serializeBytes(this.code),at(this.ty_args,e),at(this.args,e)}static load(e){const n=e.deserializeStr(),r=e.deserializeStr(),s=e.deserializeBytes(),o=yt(e,si),c=yt(e,ii);return new xl(n,r,s,o,c)}},Vr=class Dl extends oi{constructor(e,n,r,s,o){super(),this.name=e,this.module_name=n,this.doc=r,this.ty_args=s,this.args=o}serialize(e){e.serializeU32AsUleb128(1),e.serializeStr(this.name),this.module_name.serialize(e),e.serializeStr(this.doc),at(this.ty_args,e),at(this.args,e)}static load(e){const n=e.deserializeStr(),r=Gr.deserialize(e),s=e.deserializeStr(),o=yt(e,si),c=yt(e,ii);return new Dl(n,r,s,o,c)}},ls=class Vn{constructor(e){if(e.length!==Vn.LENGTH)throw new Error("Expected a byte array of length 32");this.bytes=e}static fromMultiEd25519PublicKey(e){const n=e.toBytes(),r=new Uint8Array(n.length+1);r.set(n),r.set([Vn.MULTI_ED25519_SCHEME],n.length);const s=ir.create();return s.update(r),new Vn(s.digest())}static fromEd25519PublicKey(e){const n=e.value,r=new Uint8Array(n.length+1);r.set(n),r.set([Vn.ED25519_SCHEME],n.length);const s=ir.create();return s.update(r),new Vn(s.digest())}derivedAddress(){return Ee.fromUint8Array(this.bytes)}};ls.LENGTH=32;ls.MULTI_ED25519_SCHEME=1;ls.ED25519_SCHEME=0;ls.DERIVE_RESOURCE_ACCOUNT_SCHEME=255;var no=ls,Pp=class{constructor(t,e,n,r,s,o,c){this.accountAddress=t,this.moduleName=e,this.structName=n,this.sequenceNumber=r,this.originator=s,this.currentAuthKey=o,this.newPublicKey=c}serialize(t){this.accountAddress.serialize(t),t.serializeStr(this.moduleName),t.serializeStr(this.structName),t.serializeU64(this.sequenceNumber),this.originator.serialize(t),this.currentAuthKey.serialize(t),t.serializeBytes(this.newPublicKey)}},Ul=class xs{static fromAptosAccountObject(e){return new xs(Ee.ensure(e.privateKeyHex).toUint8Array(),e.address)}static isValidPath(e){return/^m\/44'\/637'\/[0-9]+'\/[0-9]+'\/[0-9]+'+$/.test(e)}static fromDerivePath(e,n){if(!xs.isValidPath(e))throw new Error("Invalid derivation path");const r=n.trim().split(/\s+/).map(o=>o.toLowerCase()).join(" "),{key:s}=op(e,eu(Wf(r)));return new xs(s)}constructor(e,n){e?this.signingKey=me.nacl.sign.keyPair.fromSeed(e.slice(0,32)):this.signingKey=me.nacl.sign.keyPair(),this.accountAddress=Ee.ensure(n||this.authKey().hex())}address(){return this.accountAddress}authKey(){const e=new jt(this.signingKey.publicKey);return no.fromEd25519PublicKey(e).derivedAddress()}static getResourceAccountAddress(e,n){const r=nn(Ke.fromHex(e)),s=new Uint8Array([...r,...n,no.DERIVE_RESOURCE_ACCOUNT_SCHEME]),o=ir.create();return o.update(s),Ee.fromUint8Array(o.digest())}static getCollectionID(e,n){const r=new TextEncoder().encode(`${e}::${n}`),s=vf.create();return s.update(r),Ee.fromUint8Array(s.digest())}pubKey(){return Ee.fromUint8Array(this.signingKey.publicKey)}signBuffer(e){const n=me.nacl.sign.detached(e,this.signingKey.secretKey);return Ee.fromUint8Array(n)}signHexString(e){const n=Ee.ensure(e).toUint8Array();return this.signBuffer(n)}verifySignature(e,n){const r=Ee.ensure(e).toUint8Array(),s=Ee.ensure(n).toUint8Array();return me.nacl.sign.detached.verify(r,s,this.signingKey.publicKey)}toPrivateKeyObject(){return{address:this.address().hex(),publicKeyHex:this.pubKey().hex(),privateKeyHex:Ee.fromUint8Array(this.signingKey.secretKey.slice(0,32)).hex()}}};Qe([ei()],Ul.prototype,"authKey");var za=Ul,ds=`
|
|
4
4
|
fragment CurrentTokenOwnershipFields on current_token_ownerships_v2 {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var w = Object.defineProperty;
|
|
2
2
|
var _ = (i, t, n) => t in i ? w(i, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[t] = n;
|
|
3
3
|
var h = (i, t, n) => _(i, typeof t != "symbol" ? t + "" : t, n);
|
|
4
|
-
import { C as y, h as b, i as p, n as C, j as S, k as u, l as T, m as d, o as v, p as f, q as A, r as N, c as I } from "./index-
|
|
5
|
-
import { e as g, s as B, t as k, o as x, z as E } from "./chunk-IMTC3J2M-
|
|
4
|
+
import { C as y, h as b, i as p, n as C, j as S, k as u, l as T, m as d, o as v, p as f, q as A, r as N, c as I } from "./index-CNRoD0cV.mjs";
|
|
5
|
+
import { e as g, s as B, t as k, o as x, z as E } from "./chunk-IMTC3J2M-DeAwWSAu.mjs";
|
|
6
6
|
class m extends y {
|
|
7
7
|
}
|
|
8
8
|
const c = class c extends b {
|
|
@@ -144,9 +144,9 @@ const P = {
|
|
|
144
144
|
Platform: l,
|
|
145
145
|
getSigner: F,
|
|
146
146
|
protocols: {
|
|
147
|
-
WormholeCore: () => import("./index-
|
|
148
|
-
TokenBridge: () => import("./index-
|
|
149
|
-
CircleBridge: () => import("./index-
|
|
147
|
+
WormholeCore: () => import("./index-CtfLRYM0.mjs"),
|
|
148
|
+
TokenBridge: () => import("./index-Ck1M3TS1.mjs"),
|
|
149
|
+
CircleBridge: () => import("./index-Dsfz-oia.mjs")
|
|
150
150
|
},
|
|
151
151
|
getChain: (i, t, n) => new m(t, new l(i, I(i, p, {
|
|
152
152
|
[t]: n
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var Uf = Object.defineProperty;
|
|
2
2
|
var Cf = (t, e, n) => e in t ? Uf(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var Jn = (t, e, n) => Cf(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import { az as zf, R as St, X as Iu, aA as kf, aB as Of, V as Je, aC as ss, aD as kn, Z as Lf, aE as Va, $ as Za, a3 as qa, a8 as jf, aF as Pf, ac as _f } from "./index-
|
|
5
|
-
import { B as Xo, l as $e, f as mn, E as Ke, m as pr, d as Fn, a as as, e as Ye, r as ar, n as Gn, z as ii, b as Mu, c as un, g as on, I as Bf, h as Es, j as Rf, i as oi, k as Ff, p as Nu, q as gr, y as Jo, u as Ai, s as cr, v as xu, w as Wf, L as cs, x as Qf, A as mo, t as is, C as Kf, D as Su, F as Hf, G as Yf, H as Gf, J as Vf, K as Zf, M as qf } from "./chunk-IMTC3J2M-
|
|
4
|
+
import { az as zf, R as St, X as Iu, aA as kf, aB as Of, V as Je, aC as ss, aD as kn, Z as Lf, aE as Va, $ as Za, a3 as qa, a8 as jf, aF as Pf, ac as _f } from "./index-CNRoD0cV.mjs";
|
|
5
|
+
import { B as Xo, l as $e, f as mn, E as Ke, m as pr, d as Fn, a as as, e as Ye, r as ar, n as Gn, z as ii, b as Mu, c as un, g as on, I as Bf, h as Es, j as Rf, i as oi, k as Ff, p as Nu, q as gr, y as Jo, u as Ai, s as cr, v as xu, w as Wf, L as cs, x as Qf, A as mo, t as is, C as Kf, D as Su, F as Hf, G as Yf, H as Gf, J as Vf, K as Zf, M as qf } from "./chunk-IMTC3J2M-DeAwWSAu.mjs";
|
|
6
6
|
import { g as Xf } from "./wallets-B2tqS5lZ.mjs";
|
|
7
7
|
var Jf = function(t, e, n, r) {
|
|
8
8
|
if (n === "a" && !r) throw new TypeError("Private accessor was defined without a getter");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("./index-
|
|
1
|
+
"use strict";const s=require("./index-DOGZjt2S.js"),x=typeof s.dist.Buffer=="function",c=typeof TextDecoder=="function"?new TextDecoder:void 0,h=typeof TextEncoder=="function"?new TextEncoder:void 0,C="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",d=Array.prototype.slice.call(C),u=(t=>{let e={};return t.forEach((o,n)=>e[o]=n),e})(d),m=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,r=String.fromCharCode.bind(String),A=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),_=t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),g=t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),F=t=>{let e,o,n,f,a="";const l=t.length%3;for(let i=0;i<t.length;){if((o=t.charCodeAt(i++))>255||(n=t.charCodeAt(i++))>255||(f=t.charCodeAt(i++))>255)throw new TypeError("invalid character found");e=o<<16|n<<8|f,a+=d[e>>18&63]+d[e>>12&63]+d[e>>6&63]+d[e&63]}return l?a.slice(0,l-3)+"===".substring(l):a},p=typeof btoa=="function"?t=>btoa(t):x?t=>s.dist.Buffer.from(t,"binary").toString("base64"):F,B=x?t=>s.dist.Buffer.from(t).toString("base64"):t=>{let o=[];for(let n=0,f=t.length;n<f;n+=4096)o.push(r.apply(null,t.subarray(n,n+4096)));return p(o.join(""))},D=t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?r(192|e>>>6)+r(128|e&63):r(224|e>>>12&15)+r(128|e>>>6&63)+r(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return r(240|e>>>18&7)+r(128|e>>>12&63)+r(128|e>>>6&63)+r(128|e&63)}},U=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,w=t=>t.replace(U,D),b=x?t=>s.dist.Buffer.from(t,"utf8").toString("base64"):h?t=>B(h.encode(t)):t=>p(w(t)),E=(t,e=!1)=>e?_(b(t)):b(t),S=t=>E(t,!0),T=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,v=t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),o=e-65536;return r((o>>>10)+55296)+r((o&1023)+56320);case 3:return r((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return r((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},z=t=>t.replace(T,v),Z=t=>{if(t=t.replace(/\s+/g,""),!m.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,o="",n,f;for(let a=0;a<t.length;)e=u[t.charAt(a++)]<<18|u[t.charAt(a++)]<<12|(n=u[t.charAt(a++)])<<6|(f=u[t.charAt(a++)]),o+=n===64?r(e>>16&255):f===64?r(e>>16&255,e>>8&255):r(e>>16&255,e>>8&255,e&255);return o},y=typeof atob=="function"?t=>atob(g(t)):x?t=>s.dist.Buffer.from(t,"base64").toString("binary"):Z,I=x?t=>A(s.dist.Buffer.from(t,"base64")):t=>A(y(t).split("").map(e=>e.charCodeAt(0))),R=x?t=>s.dist.Buffer.from(t,"base64").toString("utf8"):c?t=>c.decode(I(t)):t=>z(y(t)),P=t=>g(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),j=t=>R(P(t));exports.decode=j;exports.encodeURI=S;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as x } from "./index-
|
|
1
|
+
import { V as x } from "./index-CNRoD0cV.mjs";
|
|
2
2
|
const s = typeof x.Buffer == "function", h = typeof TextDecoder == "function" ? new TextDecoder() : void 0, c = typeof TextEncoder == "function" ? new TextEncoder() : void 0, C = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", d = Array.prototype.slice.call(C), l = ((t) => {
|
|
3
3
|
let e = {};
|
|
4
4
|
return t.forEach((o, n) => e[o] = n), e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./evm-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./evm-BmG93aNU.js");class y extends e.BaseError{constructor({callbackSelector:r,cause:t,data:c,extraData:i,sender:u,urls:a}){var d;super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],(d=t.metaMessages)!=null&&d.length?"":[],"Offchain Gateway Call:",a&&[" Gateway URL(s):",...a.map(f=>` ${e.getUrl(f)}`)],` Sender: ${u}`,` Data: ${c}`,` Callback selector: ${r}`,` Extra data: ${i}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class w extends e.BaseError{constructor({result:r,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${e.getUrl(t)}`,`Response: ${e.stringify(r)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class b extends e.BaseError{constructor({sender:r,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${r}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}function g(n,r){if(!e.isAddress(n))throw new e.InvalidAddressError({address:n});if(!e.isAddress(r))throw new e.InvalidAddressError({address:r});return n.toLowerCase()===r.toLowerCase()}const k="0x556f1830",p={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function E(n,{blockNumber:r,blockTag:t,data:c,to:i}){const{args:u}=e.decodeErrorResult({data:c,abi:[p]}),[a,d,f,s,o]=u;try{if(!g(i,a))throw new b({sender:a,to:i});const l=await h({data:f,sender:a,urls:d}),{data:m}=await e.call(n,{blockNumber:r,blockTag:t,data:e.concat([s,e.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[l,o])]),to:i});return m}catch(l){throw new y({callbackSelector:s,cause:l,data:c,extraData:o,sender:a,urls:d})}}async function h({data:n,sender:r,urls:t}){var i;let c=new Error("An unknown error occurred.");for(let u=0;u<t.length;u++){const a=t[u],d=a.includes("{data}")?"GET":"POST",f=d==="POST"?{data:n,sender:r}:void 0;try{const s=await fetch(a.replace("{sender}",r).replace("{data}",n),{body:JSON.stringify(f),method:d});let o;if((i=s.headers.get("Content-Type"))!=null&&i.startsWith("application/json")?o=(await s.json()).data:o=await s.text(),!s.ok){c=new e.HttpRequestError({body:f,details:o!=null&&o.error?e.stringify(o.error):s.statusText,headers:s.headers,status:s.status,url:a});continue}if(!e.isHex(o)){c=new w({result:o,url:a});continue}return o}catch(s){c=new e.HttpRequestError({body:f,details:s.message,url:a})}}throw c}exports.ccipFetch=h;exports.offchainLookup=E;exports.offchainLookupAbiItem=p;exports.offchainLookupSignature=k;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B as l, g as w, a as y, i as p, I as h, d as g, b as k, e as O, f as L, h as m, j as E } from "./evm-
|
|
1
|
+
import { B as l, g as w, a as y, i as p, I as h, d as g, b as k, e as O, f as L, h as m, j as E } from "./evm-BdJvPk3J.mjs";
|
|
2
2
|
class x extends l {
|
|
3
3
|
constructor({ callbackSelector: e, cause: a, data: o, extraData: c, sender: d, urls: r }) {
|
|
4
4
|
var i;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const h=require("./index-CFgXIz60.js"),h8=require("./index-BEDagXR8.js"),A8=require("./base64-0sjqFKVy.js"),w8=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),D4=new Uint8Array(new Array(16).fill(0).map((t,e)=>e)),E8=D4.map(t=>(9*t+5)%16);let S3=[D4],T3=[E8];for(let t=0;t<4;t++)for(let e of[S3,T3])e.push(e[t].map(r=>w8[r]));const L4=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>new Uint8Array(t)),y8=S3.map((t,e)=>t.map(r=>L4[e][r])),I8=T3.map((t,e)=>t.map(r=>L4[e][r])),m8=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),C8=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]);function j6(t,e,r,i){return t===0?e^r^i:t===1?e&r|~e&i:t===2?(e|~r)^i:t===3?e&i|r&~i:e^(r|~i)}const X2=new Uint32Array(16);class U8 extends h.HashMD{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:r,h2:i,h3:n,h4:s}=this;return[e,r,i,n,s]}set(e,r,i,n,s){this.h0=e|0,this.h1=r|0,this.h2=i|0,this.h3=n|0,this.h4=s|0}process(e,r){for(let f=0;f<16;f++,r+=4)X2[f]=e.getUint32(r,!0);let i=this.h0|0,n=i,s=this.h1|0,o=s,a=this.h2|0,c=a,u=this.h3|0,d=u,w=this.h4|0,g=w;for(let f=0;f<5;f++){const k=4-f,L=m8[f],M=C8[f],p1=S3[f],M1=T3[f],q1=y8[f],p8=I8[f];for(let U1=0;U1<16;U1++){const Z0=h.rotl(i+j6(f,s,a,u)+X2[p1[U1]]+L,q1[U1])+w|0;i=w,w=u,u=h.rotl(a,10)|0,a=s,s=Z0}for(let U1=0;U1<16;U1++){const Z0=h.rotl(n+j6(k,o,c,d)+X2[M1[U1]]+M,p8[U1])+g|0;n=g,g=d,d=h.rotl(c,10)|0,c=o,o=Z0}}this.set(this.h1+a+d|0,this.h2+u+g|0,this.h3+w+n|0,this.h4+i+o|0,this.h0+s+c|0)}roundClean(){X2.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const b8=h.wrapConstructor(()=>new U8);/*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */const Z2=h.secp256k1.ProjectivePoint,_0=h.createBase58check(h.sha256);function V6(t){h.abytes(t);const e=t.length===0?"0":h.bytesToHex(t);return BigInt("0x"+e)}function B8(t){if(typeof t!="bigint")throw new Error("bigint expected");return h.hexToBytes(t.toString(16).padStart(64,"0"))}const k8=h.utf8ToBytes("Bitcoin seed"),$0={private:76066276,public:76067358},e3=2147483648,K8=t=>b8(h.sha256(t)),D8=t=>h.createView(t).getUint32(0,!1),_2=t=>{if(!Number.isSafeInteger(t)||t<0||t>2**32-1)throw new Error("invalid number, should be from 0 to 2**32-1, got "+t);const e=new Uint8Array(4);return h.createView(e).setUint32(0,t,!1),e};class W1{get fingerprint(){if(!this.pubHash)throw new Error("No publicKey set!");return D8(this.pubHash)}get identifier(){return this.pubHash}get pubKeyHash(){return this.pubHash}get privateKey(){return this.privKeyBytes||null}get publicKey(){return this.pubKey||null}get privateExtendedKey(){const e=this.privateKey;if(!e)throw new Error("No private key");return _0.encode(this.serialize(this.versions.private,h.concatBytes(new Uint8Array([0]),e)))}get publicExtendedKey(){if(!this.pubKey)throw new Error("No public key");return _0.encode(this.serialize(this.versions.public,this.pubKey))}static fromMasterSeed(e,r=$0){if(h.abytes(e),8*e.length<128||8*e.length>512)throw new Error("HDKey: seed length must be between 128 and 512 bits; 256 bits is advised, got "+e.length);const i=h.hmac(h.sha512,k8,e);return new W1({versions:r,chainCode:i.slice(32),privateKey:i.slice(0,32)})}static fromExtendedKey(e,r=$0){const i=_0.decode(e),n=h.createView(i),s=n.getUint32(0,!1),o={versions:r,depth:i[4],parentFingerprint:n.getUint32(5,!1),index:n.getUint32(9,!1),chainCode:i.slice(13,45)},a=i.slice(45),c=a[0]===0;if(s!==r[c?"private":"public"])throw new Error("Version mismatch");return c?new W1({...o,privateKey:a.slice(1)}):new W1({...o,publicKey:a})}static fromJSON(e){return W1.fromExtendedKey(e.xpriv)}constructor(e){if(this.depth=0,this.index=0,this.chainCode=null,this.parentFingerprint=0,!e||typeof e!="object")throw new Error("HDKey.constructor must not be called directly");if(this.versions=e.versions||$0,this.depth=e.depth||0,this.chainCode=e.chainCode||null,this.index=e.index||0,this.parentFingerprint=e.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw new Error("HDKey: zero depth with non-zero index/parent fingerprint");if(e.publicKey&&e.privateKey)throw new Error("HDKey: publicKey and privateKey at same time.");if(e.privateKey){if(!h.secp256k1.utils.isValidPrivateKey(e.privateKey))throw new Error("Invalid private key");this.privKey=typeof e.privateKey=="bigint"?e.privateKey:V6(e.privateKey),this.privKeyBytes=B8(this.privKey),this.pubKey=h.secp256k1.getPublicKey(e.privateKey,!0)}else if(e.publicKey)this.pubKey=Z2.fromHex(e.publicKey).toRawBytes(!0);else throw new Error("HDKey: no public or private key provided");this.pubHash=K8(this.pubKey)}derive(e){if(!/^[mM]'?/.test(e))throw new Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(e))return this;const r=e.replace(/^[mM]'?\//,"").split("/");let i=this;for(const n of r){const s=/^(\d+)('?)$/.exec(n),o=s&&s[1];if(!s||s.length!==3||typeof o!="string")throw new Error("invalid child index: "+n);let a=+o;if(!Number.isSafeInteger(a)||a>=e3)throw new Error("Invalid index");s[2]==="'"&&(a+=e3),i=i.deriveChild(a)}return i}deriveChild(e){if(!this.pubKey||!this.chainCode)throw new Error("No publicKey or chainCode set");let r=_2(e);if(e>=e3){const a=this.privateKey;if(!a)throw new Error("Could not derive hardened child key");r=h.concatBytes(new Uint8Array([0]),a,r)}else r=h.concatBytes(this.pubKey,r);const i=h.hmac(h.sha512,this.chainCode,r),n=V6(i.slice(0,32)),s=i.slice(32);if(!h.secp256k1.utils.isValidPrivateKey(n))throw new Error("Tweak bigger than curve order");const o={versions:this.versions,chainCode:s,depth:this.depth+1,parentFingerprint:this.fingerprint,index:e};try{if(this.privateKey){const a=h.mod(this.privKey+n,h.secp256k1.CURVE.n);if(!h.secp256k1.utils.isValidPrivateKey(a))throw new Error("The tweak was out of range or the resulted private key is invalid");o.privateKey=a}else{const a=Z2.fromHex(this.pubKey).add(Z2.fromPrivateKey(n));if(a.equals(Z2.ZERO))throw new Error("The tweak was equal to negative P, which made the result key invalid");o.publicKey=a.toRawBytes(!0)}return new W1(o)}catch{return this.deriveChild(e+1)}}sign(e){if(!this.privateKey)throw new Error("No privateKey set!");return h.abytes(e,32),h.secp256k1.sign(e,this.privKey).toCompactRawBytes()}verify(e,r){if(h.abytes(e,32),h.abytes(r,64),!this.publicKey)throw new Error("No publicKey set!");let i;try{i=h.secp256k1.Signature.fromCompact(r)}catch{return!1}return h.secp256k1.verify(i,e,this.publicKey)}wipePrivateData(){return this.privKey=void 0,this.privKeyBytes&&(this.privKeyBytes.fill(0),this.privKeyBytes=void 0),this}toJSON(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}}serialize(e,r){if(!this.chainCode)throw new Error("No chainCode set");return h.abytes(r,33),h.concatBytes(_2(e),new Uint8Array([this.depth]),_2(this.parentFingerprint),_2(this.index),this.chainCode,r)}}var s1=class extends Error{constructor(e,r){super(e),this.invalidReason=r}},L8=(t=>(t.TOO_SHORT="too_short",t.INVALID_LENGTH="invalid_length",t.INVALID_HEX_CHARS="invalid_hex_chars",t))(L8||{}),E=class b1{constructor(e){this.data=e}toUint8Array(){return this.data}toStringWithoutPrefix(){return h.bytesToHex(this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromHexString(e){let r=e;if(r.startsWith("0x")&&(r=r.slice(2)),r.length===0)throw new s1("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(r.length%2!==0)throw new s1("Hex string must be an even number of hex characters.","invalid_length");try{return new b1(h.hexToBytes(r))}catch(i){throw new s1(`Hex string contains invalid hex characters: ${i==null?void 0:i.message}`,"invalid_hex_chars")}}static fromHexInput(e){if(e instanceof h.dist.Buffer)return new b1(new Uint8Array(e));if(e instanceof Uint8Array)return new b1(e);if(typeof e=="string")return b1.fromHexString(e);throw new Error(`Invalid hex input type: ${typeof e}`)}static hexInputToUint8Array(e){return e instanceof Uint8Array?e:b1.fromHexString(e).toUint8Array()}static hexInputToString(e){return b1.fromHexInput(e).toString()}static hexInputToStringWithoutPrefix(e){return b1.fromHexInput(e).toStringWithoutPrefix()}static isValid(e){try{return b1.fromHexString(e),{valid:!0}}catch(r){return{valid:!1,invalidReason:r==null?void 0:r.invalidReason,invalidReasonMessage:r==null?void 0:r.message}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((r,i)=>r===e.data[i])}},F8=t=>new TextDecoder().decode(E.fromHexInput(t).toUint8Array()),F4=255,G4=65535,l2=4294967295,D0=18446744073709551615n,x3=340282366920938463463374607431768211455n,H4=115792089237316195423570985008687907853269984665640564039457584007913129639935n,G8=Object.defineProperty,H8=Object.getOwnPropertyDescriptor,l1=(t,e,r,i)=>{for(var n=H8(e,r),s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=o(e,r,n)||n);return n&&G8(e,r,n),n},m=class{bcsToBytes(){let e=new V;return this.serialize(e),e.toUint8Array()}bcsToHex(){let e=this.bcsToBytes();return E.fromHexInput(e)}toStringWithoutPrefix(){return this.bcsToHex().toStringWithoutPrefix()}toString(){return`0x${this.toStringWithoutPrefix()}`}},V=class{constructor(e=64){if(e<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(e),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){let r=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(r).set(new Uint8Array(this.buffer)),this.buffer=r}}appendToBuffer(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,r,i){this.ensureBufferWillHandleSize(r);let n=new DataView(this.buffer,this.offset);e.apply(n,[0,i,!0]),this.offset+=r}serializeStr(e){let r=new TextEncoder;this.serializeBytes(r.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.appendToBuffer(e)}serializeFixedBytes(e){this.appendToBuffer(e)}serializeBool(e){v4(e);let r=e?1:0;this.appendToBuffer(new Uint8Array([r]))}serializeU8(e){this.appendToBuffer(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){let r=BigInt(e)&BigInt(l2),i=BigInt(e)>>BigInt(32);this.serializeU32(Number(r)),this.serializeU32(Number(i))}serializeU128(e){let r=BigInt(e)&D0,i=BigInt(e)>>BigInt(64);this.serializeU64(r),this.serializeU64(i)}serializeU256(e){let r=BigInt(e)&x3,i=BigInt(e)>>BigInt(128);this.serializeU128(r),this.serializeU128(i)}serializeU32AsUleb128(e){let r=e,i=[];for(;r>>>7;)i.push(r&127|128),r>>>=7;i.push(r),this.appendToBuffer(new Uint8Array(i))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(e){e.serialize(this)}serializeVector(e){this.serializeU32AsUleb128(e.length),e.forEach(r=>{r.serialize(this)})}serializeOption(e,r){let i=e!==void 0;this.serializeBool(i),i&&(typeof e=="string"?this.serializeStr(e):e instanceof Uint8Array?r!==void 0?this.serializeFixedBytes(e):this.serializeBytes(e):e.serialize(this))}serializeOptionStr(e){e===void 0?this.serializeU32AsUleb128(0):(this.serializeU32AsUleb128(1),this.serializeStr(e))}};l1([j1(0,F4)],V.prototype,"serializeU8"),l1([j1(0,G4)],V.prototype,"serializeU16"),l1([j1(0,l2)],V.prototype,"serializeU32"),l1([j1(BigInt(0),D0)],V.prototype,"serializeU64"),l1([j1(BigInt(0),x3)],V.prototype,"serializeU128"),l1([j1(BigInt(0),H4)],V.prototype,"serializeU256"),l1([j1(0,l2)],V.prototype,"serializeU32AsUleb128");function v4(t){if(typeof t!="boolean")throw new Error(`${t} is not a boolean value`)}var v8=(t,e,r)=>`${t} is out of range: [${e}, ${r}]`;function t2(t,e,r){let i=BigInt(t);if(i>BigInt(r)||i<BigInt(e))throw new Error(v8(t,e,r))}function j1(t,e){return(r,i,n)=>{let s=n.value;return n.value=function(o){return t2(o,t,e),s.apply(this,[o])},n}}var $=class M4 extends m{constructor(e){super(),this.identifier=e}serialize(e){e.serializeStr(this.identifier)}static deserialize(e){let r=e.deserializeStr();return new M4(r)}},M8=(t=>(t.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",t.INVALID_HEX_CHARS="invalid_hex_chars",t.TOO_SHORT="too_short",t.TOO_LONG="too_long",t.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",t.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",t.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",t.INVALID_PADDING_STRICTNESS="INVALID_PADDING_STRICTNESS",t))(M8||{}),j=class t1 extends m{constructor(e){if(super(),e.length!==t1.LENGTH)throw new s1("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=e}isSpecial(){return this.data.slice(0,this.data.length-1).every(e=>e===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let e=h.bytesToHex(this.data);return this.isSpecial()&&(e=e[e.length-1]),e}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return h.bytesToHex(this.data)}toUint8Array(){return this.data}serialize(e){e.serializeFixedBytes(this.data)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(3),e.serialize(this)}static deserialize(e){let r=e.deserializeFixedBytes(t1.LENGTH);return new t1(r)}static fromStringStrict(e){if(!e.startsWith("0x"))throw new s1("Hex string must start with a leading 0x.","leading_zero_x_required");let r=t1.fromString(e);if(e.length!==t1.LONG_STRING_LENGTH+2)if(r.isSpecial()){if(e.length!==3)throw new s1(`The given hex string ${e} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new s1(`The given hex string ${e} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return r}static fromString(e,{maxMissingChars:r=4}={}){let i=e;if(e.startsWith("0x")&&(i=e.slice(2)),i.length===0)throw new s1("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(i.length>64)throw new s1("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");if(r>63||r<0)throw new s1(`maxMissingChars must be between or equal to 0 and 63. Received ${r}`,"INVALID_PADDING_STRICTNESS");let n;try{n=h.hexToBytes(i.padStart(64,"0"))}catch(o){throw new s1(`Hex characters are invalid: ${o==null?void 0:o.message}`,"invalid_hex_chars")}let s=new t1(n);if(i.length<64-r&&!s.isSpecial())throw new s1(`Hex string is too short, must be ${64-r} to 64 chars long, excluding the leading 0x. You may need to fix
|
|
1
|
+
"use strict";const h=require("./index-DOGZjt2S.js"),h8=require("./index-i9soDbgm.js"),A8=require("./base64-5kcPH2Ry.js"),w8=new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),D4=new Uint8Array(new Array(16).fill(0).map((t,e)=>e)),E8=D4.map(t=>(9*t+5)%16);let S3=[D4],T3=[E8];for(let t=0;t<4;t++)for(let e of[S3,T3])e.push(e[t].map(r=>w8[r]));const L4=[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map(t=>new Uint8Array(t)),y8=S3.map((t,e)=>t.map(r=>L4[e][r])),I8=T3.map((t,e)=>t.map(r=>L4[e][r])),m8=new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),C8=new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]);function j6(t,e,r,i){return t===0?e^r^i:t===1?e&r|~e&i:t===2?(e|~r)^i:t===3?e&i|r&~i:e^(r|~i)}const X2=new Uint32Array(16);class U8 extends h.HashMD{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:e,h1:r,h2:i,h3:n,h4:s}=this;return[e,r,i,n,s]}set(e,r,i,n,s){this.h0=e|0,this.h1=r|0,this.h2=i|0,this.h3=n|0,this.h4=s|0}process(e,r){for(let f=0;f<16;f++,r+=4)X2[f]=e.getUint32(r,!0);let i=this.h0|0,n=i,s=this.h1|0,o=s,a=this.h2|0,c=a,u=this.h3|0,d=u,w=this.h4|0,g=w;for(let f=0;f<5;f++){const k=4-f,L=m8[f],M=C8[f],p1=S3[f],M1=T3[f],q1=y8[f],p8=I8[f];for(let U1=0;U1<16;U1++){const Z0=h.rotl(i+j6(f,s,a,u)+X2[p1[U1]]+L,q1[U1])+w|0;i=w,w=u,u=h.rotl(a,10)|0,a=s,s=Z0}for(let U1=0;U1<16;U1++){const Z0=h.rotl(n+j6(k,o,c,d)+X2[M1[U1]]+M,p8[U1])+g|0;n=g,g=d,d=h.rotl(c,10)|0,c=o,o=Z0}}this.set(this.h1+a+d|0,this.h2+u+g|0,this.h3+w+n|0,this.h4+i+o|0,this.h0+s+c|0)}roundClean(){X2.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const b8=h.wrapConstructor(()=>new U8);/*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) */const Z2=h.secp256k1.ProjectivePoint,_0=h.createBase58check(h.sha256);function V6(t){h.abytes(t);const e=t.length===0?"0":h.bytesToHex(t);return BigInt("0x"+e)}function B8(t){if(typeof t!="bigint")throw new Error("bigint expected");return h.hexToBytes(t.toString(16).padStart(64,"0"))}const k8=h.utf8ToBytes("Bitcoin seed"),$0={private:76066276,public:76067358},e3=2147483648,K8=t=>b8(h.sha256(t)),D8=t=>h.createView(t).getUint32(0,!1),_2=t=>{if(!Number.isSafeInteger(t)||t<0||t>2**32-1)throw new Error("invalid number, should be from 0 to 2**32-1, got "+t);const e=new Uint8Array(4);return h.createView(e).setUint32(0,t,!1),e};class W1{get fingerprint(){if(!this.pubHash)throw new Error("No publicKey set!");return D8(this.pubHash)}get identifier(){return this.pubHash}get pubKeyHash(){return this.pubHash}get privateKey(){return this.privKeyBytes||null}get publicKey(){return this.pubKey||null}get privateExtendedKey(){const e=this.privateKey;if(!e)throw new Error("No private key");return _0.encode(this.serialize(this.versions.private,h.concatBytes(new Uint8Array([0]),e)))}get publicExtendedKey(){if(!this.pubKey)throw new Error("No public key");return _0.encode(this.serialize(this.versions.public,this.pubKey))}static fromMasterSeed(e,r=$0){if(h.abytes(e),8*e.length<128||8*e.length>512)throw new Error("HDKey: seed length must be between 128 and 512 bits; 256 bits is advised, got "+e.length);const i=h.hmac(h.sha512,k8,e);return new W1({versions:r,chainCode:i.slice(32),privateKey:i.slice(0,32)})}static fromExtendedKey(e,r=$0){const i=_0.decode(e),n=h.createView(i),s=n.getUint32(0,!1),o={versions:r,depth:i[4],parentFingerprint:n.getUint32(5,!1),index:n.getUint32(9,!1),chainCode:i.slice(13,45)},a=i.slice(45),c=a[0]===0;if(s!==r[c?"private":"public"])throw new Error("Version mismatch");return c?new W1({...o,privateKey:a.slice(1)}):new W1({...o,publicKey:a})}static fromJSON(e){return W1.fromExtendedKey(e.xpriv)}constructor(e){if(this.depth=0,this.index=0,this.chainCode=null,this.parentFingerprint=0,!e||typeof e!="object")throw new Error("HDKey.constructor must not be called directly");if(this.versions=e.versions||$0,this.depth=e.depth||0,this.chainCode=e.chainCode||null,this.index=e.index||0,this.parentFingerprint=e.parentFingerprint||0,!this.depth&&(this.parentFingerprint||this.index))throw new Error("HDKey: zero depth with non-zero index/parent fingerprint");if(e.publicKey&&e.privateKey)throw new Error("HDKey: publicKey and privateKey at same time.");if(e.privateKey){if(!h.secp256k1.utils.isValidPrivateKey(e.privateKey))throw new Error("Invalid private key");this.privKey=typeof e.privateKey=="bigint"?e.privateKey:V6(e.privateKey),this.privKeyBytes=B8(this.privKey),this.pubKey=h.secp256k1.getPublicKey(e.privateKey,!0)}else if(e.publicKey)this.pubKey=Z2.fromHex(e.publicKey).toRawBytes(!0);else throw new Error("HDKey: no public or private key provided");this.pubHash=K8(this.pubKey)}derive(e){if(!/^[mM]'?/.test(e))throw new Error('Path must start with "m" or "M"');if(/^[mM]'?$/.test(e))return this;const r=e.replace(/^[mM]'?\//,"").split("/");let i=this;for(const n of r){const s=/^(\d+)('?)$/.exec(n),o=s&&s[1];if(!s||s.length!==3||typeof o!="string")throw new Error("invalid child index: "+n);let a=+o;if(!Number.isSafeInteger(a)||a>=e3)throw new Error("Invalid index");s[2]==="'"&&(a+=e3),i=i.deriveChild(a)}return i}deriveChild(e){if(!this.pubKey||!this.chainCode)throw new Error("No publicKey or chainCode set");let r=_2(e);if(e>=e3){const a=this.privateKey;if(!a)throw new Error("Could not derive hardened child key");r=h.concatBytes(new Uint8Array([0]),a,r)}else r=h.concatBytes(this.pubKey,r);const i=h.hmac(h.sha512,this.chainCode,r),n=V6(i.slice(0,32)),s=i.slice(32);if(!h.secp256k1.utils.isValidPrivateKey(n))throw new Error("Tweak bigger than curve order");const o={versions:this.versions,chainCode:s,depth:this.depth+1,parentFingerprint:this.fingerprint,index:e};try{if(this.privateKey){const a=h.mod(this.privKey+n,h.secp256k1.CURVE.n);if(!h.secp256k1.utils.isValidPrivateKey(a))throw new Error("The tweak was out of range or the resulted private key is invalid");o.privateKey=a}else{const a=Z2.fromHex(this.pubKey).add(Z2.fromPrivateKey(n));if(a.equals(Z2.ZERO))throw new Error("The tweak was equal to negative P, which made the result key invalid");o.publicKey=a.toRawBytes(!0)}return new W1(o)}catch{return this.deriveChild(e+1)}}sign(e){if(!this.privateKey)throw new Error("No privateKey set!");return h.abytes(e,32),h.secp256k1.sign(e,this.privKey).toCompactRawBytes()}verify(e,r){if(h.abytes(e,32),h.abytes(r,64),!this.publicKey)throw new Error("No publicKey set!");let i;try{i=h.secp256k1.Signature.fromCompact(r)}catch{return!1}return h.secp256k1.verify(i,e,this.publicKey)}wipePrivateData(){return this.privKey=void 0,this.privKeyBytes&&(this.privKeyBytes.fill(0),this.privKeyBytes=void 0),this}toJSON(){return{xpriv:this.privateExtendedKey,xpub:this.publicExtendedKey}}serialize(e,r){if(!this.chainCode)throw new Error("No chainCode set");return h.abytes(r,33),h.concatBytes(_2(e),new Uint8Array([this.depth]),_2(this.parentFingerprint),_2(this.index),this.chainCode,r)}}var s1=class extends Error{constructor(e,r){super(e),this.invalidReason=r}},L8=(t=>(t.TOO_SHORT="too_short",t.INVALID_LENGTH="invalid_length",t.INVALID_HEX_CHARS="invalid_hex_chars",t))(L8||{}),E=class b1{constructor(e){this.data=e}toUint8Array(){return this.data}toStringWithoutPrefix(){return h.bytesToHex(this.data)}toString(){return`0x${this.toStringWithoutPrefix()}`}static fromHexString(e){let r=e;if(r.startsWith("0x")&&(r=r.slice(2)),r.length===0)throw new s1("Hex string is too short, must be at least 1 char long, excluding the optional leading 0x.","too_short");if(r.length%2!==0)throw new s1("Hex string must be an even number of hex characters.","invalid_length");try{return new b1(h.hexToBytes(r))}catch(i){throw new s1(`Hex string contains invalid hex characters: ${i==null?void 0:i.message}`,"invalid_hex_chars")}}static fromHexInput(e){if(e instanceof h.dist.Buffer)return new b1(new Uint8Array(e));if(e instanceof Uint8Array)return new b1(e);if(typeof e=="string")return b1.fromHexString(e);throw new Error(`Invalid hex input type: ${typeof e}`)}static hexInputToUint8Array(e){return e instanceof Uint8Array?e:b1.fromHexString(e).toUint8Array()}static hexInputToString(e){return b1.fromHexInput(e).toString()}static hexInputToStringWithoutPrefix(e){return b1.fromHexInput(e).toStringWithoutPrefix()}static isValid(e){try{return b1.fromHexString(e),{valid:!0}}catch(r){return{valid:!1,invalidReason:r==null?void 0:r.invalidReason,invalidReasonMessage:r==null?void 0:r.message}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((r,i)=>r===e.data[i])}},F8=t=>new TextDecoder().decode(E.fromHexInput(t).toUint8Array()),F4=255,G4=65535,l2=4294967295,D0=18446744073709551615n,x3=340282366920938463463374607431768211455n,H4=115792089237316195423570985008687907853269984665640564039457584007913129639935n,G8=Object.defineProperty,H8=Object.getOwnPropertyDescriptor,l1=(t,e,r,i)=>{for(var n=H8(e,r),s=t.length-1,o;s>=0;s--)(o=t[s])&&(n=o(e,r,n)||n);return n&&G8(e,r,n),n},m=class{bcsToBytes(){let e=new V;return this.serialize(e),e.toUint8Array()}bcsToHex(){let e=this.bcsToBytes();return E.fromHexInput(e)}toStringWithoutPrefix(){return this.bcsToHex().toStringWithoutPrefix()}toString(){return`0x${this.toStringWithoutPrefix()}`}},V=class{constructor(e=64){if(e<=0)throw new Error("Length needs to be greater than 0");this.buffer=new ArrayBuffer(e),this.offset=0}ensureBufferWillHandleSize(e){for(;this.buffer.byteLength<this.offset+e;){let r=new ArrayBuffer(this.buffer.byteLength*2);new Uint8Array(r).set(new Uint8Array(this.buffer)),this.buffer=r}}appendToBuffer(e){this.ensureBufferWillHandleSize(e.length),new Uint8Array(this.buffer,this.offset).set(e),this.offset+=e.length}serializeWithFunction(e,r,i){this.ensureBufferWillHandleSize(r);let n=new DataView(this.buffer,this.offset);e.apply(n,[0,i,!0]),this.offset+=r}serializeStr(e){let r=new TextEncoder;this.serializeBytes(r.encode(e))}serializeBytes(e){this.serializeU32AsUleb128(e.length),this.appendToBuffer(e)}serializeFixedBytes(e){this.appendToBuffer(e)}serializeBool(e){v4(e);let r=e?1:0;this.appendToBuffer(new Uint8Array([r]))}serializeU8(e){this.appendToBuffer(new Uint8Array([e]))}serializeU16(e){this.serializeWithFunction(DataView.prototype.setUint16,2,e)}serializeU32(e){this.serializeWithFunction(DataView.prototype.setUint32,4,e)}serializeU64(e){let r=BigInt(e)&BigInt(l2),i=BigInt(e)>>BigInt(32);this.serializeU32(Number(r)),this.serializeU32(Number(i))}serializeU128(e){let r=BigInt(e)&D0,i=BigInt(e)>>BigInt(64);this.serializeU64(r),this.serializeU64(i)}serializeU256(e){let r=BigInt(e)&x3,i=BigInt(e)>>BigInt(128);this.serializeU128(r),this.serializeU128(i)}serializeU32AsUleb128(e){let r=e,i=[];for(;r>>>7;)i.push(r&127|128),r>>>=7;i.push(r),this.appendToBuffer(new Uint8Array(i))}toUint8Array(){return new Uint8Array(this.buffer).slice(0,this.offset)}serialize(e){e.serialize(this)}serializeVector(e){this.serializeU32AsUleb128(e.length),e.forEach(r=>{r.serialize(this)})}serializeOption(e,r){let i=e!==void 0;this.serializeBool(i),i&&(typeof e=="string"?this.serializeStr(e):e instanceof Uint8Array?r!==void 0?this.serializeFixedBytes(e):this.serializeBytes(e):e.serialize(this))}serializeOptionStr(e){e===void 0?this.serializeU32AsUleb128(0):(this.serializeU32AsUleb128(1),this.serializeStr(e))}};l1([j1(0,F4)],V.prototype,"serializeU8"),l1([j1(0,G4)],V.prototype,"serializeU16"),l1([j1(0,l2)],V.prototype,"serializeU32"),l1([j1(BigInt(0),D0)],V.prototype,"serializeU64"),l1([j1(BigInt(0),x3)],V.prototype,"serializeU128"),l1([j1(BigInt(0),H4)],V.prototype,"serializeU256"),l1([j1(0,l2)],V.prototype,"serializeU32AsUleb128");function v4(t){if(typeof t!="boolean")throw new Error(`${t} is not a boolean value`)}var v8=(t,e,r)=>`${t} is out of range: [${e}, ${r}]`;function t2(t,e,r){let i=BigInt(t);if(i>BigInt(r)||i<BigInt(e))throw new Error(v8(t,e,r))}function j1(t,e){return(r,i,n)=>{let s=n.value;return n.value=function(o){return t2(o,t,e),s.apply(this,[o])},n}}var $=class M4 extends m{constructor(e){super(),this.identifier=e}serialize(e){e.serializeStr(this.identifier)}static deserialize(e){let r=e.deserializeStr();return new M4(r)}},M8=(t=>(t.INCORRECT_NUMBER_OF_BYTES="incorrect_number_of_bytes",t.INVALID_HEX_CHARS="invalid_hex_chars",t.TOO_SHORT="too_short",t.TOO_LONG="too_long",t.LEADING_ZERO_X_REQUIRED="leading_zero_x_required",t.LONG_FORM_REQUIRED_UNLESS_SPECIAL="long_form_required_unless_special",t.INVALID_PADDING_ZEROES="INVALID_PADDING_ZEROES",t.INVALID_PADDING_STRICTNESS="INVALID_PADDING_STRICTNESS",t))(M8||{}),j=class t1 extends m{constructor(e){if(super(),e.length!==t1.LENGTH)throw new s1("AccountAddress data should be exactly 32 bytes long","incorrect_number_of_bytes");this.data=e}isSpecial(){return this.data.slice(0,this.data.length-1).every(e=>e===0)&&this.data[this.data.length-1]<16}toString(){return`0x${this.toStringWithoutPrefix()}`}toStringWithoutPrefix(){let e=h.bytesToHex(this.data);return this.isSpecial()&&(e=e[e.length-1]),e}toStringLong(){return`0x${this.toStringLongWithoutPrefix()}`}toStringLongWithoutPrefix(){return h.bytesToHex(this.data)}toUint8Array(){return this.data}serialize(e){e.serializeFixedBytes(this.data)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(3),e.serialize(this)}static deserialize(e){let r=e.deserializeFixedBytes(t1.LENGTH);return new t1(r)}static fromStringStrict(e){if(!e.startsWith("0x"))throw new s1("Hex string must start with a leading 0x.","leading_zero_x_required");let r=t1.fromString(e);if(e.length!==t1.LONG_STRING_LENGTH+2)if(r.isSpecial()){if(e.length!==3)throw new s1(`The given hex string ${e} is a special address not in LONG form, it must be 0x0 to 0xf without padding zeroes.`,"INVALID_PADDING_ZEROES")}else throw new s1(`The given hex string ${e} is not a special address, it must be represented as 0x + 64 chars.`,"long_form_required_unless_special");return r}static fromString(e,{maxMissingChars:r=4}={}){let i=e;if(e.startsWith("0x")&&(i=e.slice(2)),i.length===0)throw new s1("Hex string is too short, must be 1 to 64 chars long, excluding the leading 0x.","too_short");if(i.length>64)throw new s1("Hex string is too long, must be 1 to 64 chars long, excluding the leading 0x.","too_long");if(r>63||r<0)throw new s1(`maxMissingChars must be between or equal to 0 and 63. Received ${r}`,"INVALID_PADDING_STRICTNESS");let n;try{n=h.hexToBytes(i.padStart(64,"0"))}catch(o){throw new s1(`Hex characters are invalid: ${o==null?void 0:o.message}`,"invalid_hex_chars")}let s=new t1(n);if(i.length<64-r&&!s.isSpecial())throw new s1(`Hex string is too short, must be ${64-r} to 64 chars long, excluding the leading 0x. You may need to fix
|
|
2
2
|
the addresss by padding it with 0s before passing it to \`fromString\` (e.g. <addressString>.padStart(64, '0')).
|
|
3
3
|
Received ${e}`,"too_short");return s}static from(e,{maxMissingChars:r=4}={}){return typeof e=="string"?t1.fromString(e,{maxMissingChars:r}):e instanceof Uint8Array?new t1(e):e}static fromStrict(e){return typeof e=="string"?t1.fromStringStrict(e):e instanceof Uint8Array?new t1(e):e}static isValid(e){try{return e.strict?t1.fromStrict(e.input):t1.from(e.input),{valid:!0}}catch(r){return{valid:!1,invalidReason:r==null?void 0:r.invalidReason,invalidReasonMessage:r==null?void 0:r.message}}}equals(e){return this.data.length!==e.data.length?!1:this.data.every((r,i)=>r===e.data[i])}};j.LENGTH=32,j.LONG_STRING_LENGTH=64,j.ZERO=j.from("0x0"),j.ONE=j.from("0x1"),j.TWO=j.from("0x2"),j.THREE=j.from("0x3"),j.FOUR=j.from("0x4"),j.A=j.from("0xA");var l=j,J=class J4 extends m{deserialize(e){let r=l.deserialize(e),i=$.deserialize(e),n=$.deserialize(e),s=e.deserializeVector(J4);return new Q2(r,i,n,s)}static deserialize(e){let r=e.deserializeUleb128AsU32();switch(r){case 0:return X.load(e);case 1:return x1.load(e);case 2:return y1.load(e);case 3:return B2.load(e);case 4:return o1.load(e);case 5:return $2.load(e);case 6:return v.load(e);case 7:return I.load(e);case 8:return U2.load(e);case 9:return b2.load(e);case 10:return k2.load(e);case 255:return x.load(e);default:throw new Error(`Unknown variant index for TypeTag: ${r}`)}}isBool(){return this instanceof X}isAddress(){return this instanceof o1}isGeneric(){return this instanceof x}isSigner(){return this instanceof $2}isVector(){return this instanceof v}isStruct(){return this instanceof I}isU8(){return this instanceof x1}isU16(){return this instanceof U2}isU32(){return this instanceof b2}isU64(){return this instanceof y1}isU128(){return this instanceof B2}isU256(){return this instanceof k2}isPrimitive(){return this instanceof $2||this instanceof o1||this instanceof X||this instanceof x1||this instanceof U2||this instanceof b2||this instanceof y1||this instanceof B2||this instanceof k2}},X=class Y4 extends J{toString(){return"bool"}serialize(e){e.serializeU32AsUleb128(0)}static load(e){return new Y4}},x1=class Q4 extends J{toString(){return"u8"}serialize(e){e.serializeU32AsUleb128(1)}static load(e){return new Q4}},U2=class z4 extends J{toString(){return"u16"}serialize(e){e.serializeU32AsUleb128(8)}static load(e){return new z4}},b2=class S4 extends J{toString(){return"u32"}serialize(e){e.serializeU32AsUleb128(9)}static load(e){return new S4}},y1=class T4 extends J{toString(){return"u64"}serialize(e){e.serializeU32AsUleb128(2)}static load(e){return new T4}},B2=class x4 extends J{toString(){return"u128"}serialize(e){e.serializeU32AsUleb128(3)}static load(e){return new x4}},k2=class N4 extends J{toString(){return"u256"}serialize(e){e.serializeU32AsUleb128(10)}static load(e){return new N4}},o1=class O4 extends J{toString(){return"address"}serialize(e){e.serializeU32AsUleb128(4)}static load(e){return new O4}},$2=class P4 extends J{toString(){return"signer"}serialize(e){e.serializeU32AsUleb128(5)}static load(e){return new P4}},J8=class R4 extends J{constructor(e){super(),this.value=e}toString(){return`&${this.value.toString()}`}serialize(e){e.serializeU32AsUleb128(254)}static load(e){let r=J.deserialize(e);return new R4(r)}},x=class q4 extends J{constructor(e){if(super(),this.value=e,e<0)throw new Error("Generic type parameter index cannot be negative")}toString(){return`T${this.value}`}serialize(e){e.serializeU32AsUleb128(255),e.serializeU32(this.value)}static load(e){let r=e.deserializeU32();return new q4(r)}},v=class l3 extends J{constructor(e){super(),this.value=e}toString(){return`vector<${this.value.toString()}>`}static u8(){return new l3(new x1)}serialize(e){e.serializeU32AsUleb128(6),this.value.serialize(e)}static load(e){let r=J.deserialize(e);return new l3(r)}},I=class j4 extends J{constructor(e){super(),this.value=e}toString(){let e="";return this.value.typeArgs.length>0&&(e=`<${this.value.typeArgs.map(r=>r.toString()).join(", ")}>`),`${this.value.address.toString()}::${this.value.moduleName.identifier}::${this.value.name.identifier}${e}`}serialize(e){e.serializeU32AsUleb128(7),this.value.serialize(e)}static load(e){let r=Q2.deserialize(e);return new j4(r)}isTypeTag(e,r,i){return this.value.moduleName.identifier===r&&this.value.name.identifier===i&&this.value.address.equals(e)}isString(){return this.isTypeTag(l.ONE,"string","String")}isOption(){return this.isTypeTag(l.ONE,"option","Option")}isObject(){return this.isTypeTag(l.ONE,"object","Object")}},Q2=class V4 extends m{constructor(e,r,i,n){super(),this.address=e,this.moduleName=r,this.name=i,this.typeArgs=n}serialize(e){e.serialize(this.address),e.serialize(this.moduleName),e.serialize(this.name),e.serializeVector(this.typeArgs)}static deserialize(e){let r=l.deserialize(e),i=$.deserialize(e),n=$.deserialize(e),s=e.deserializeVector(J);return new V4(r,i,n,s)}};function K(){return new Q2(l.ONE,new $("string"),new $("String"),[])}function c1(t){return new Q2(l.ONE,new $("object"),new $("Object"),[t])}function W6(t){return!!t.match(/^[_a-zA-Z0-9]+$/)}function W4(t){return!!t.match(/\s/)}function Y8(t){return!!t.match(/^T[0-9]+$/)}function Q8(t){return!!t.match(/^&.+$/)}function z8(t){switch(t){case"signer":case"address":case"bool":case"u8":case"u16":case"u32":case"u64":case"u128":case"u256":return!0;default:return!1}}function S8(t,e){let r=e;for(;r<t.length;r+=1){let i=t[r];if(!W4(i))break}return r}var T8=(t=>(t.InvalidTypeTag="unknown type",t.UnexpectedGenericType="unexpected generic type",t.UnexpectedTypeArgumentClose="unexpected '>'",t.UnexpectedWhitespaceCharacter="unexpected whitespace character",t.UnexpectedComma="unexpected ','",t.TypeArgumentCountMismatch="type argument count doesn't match expected amount",t.MissingTypeArgumentClose="no matching '>' for '<'",t.MissingTypeArgument="no type argument before ','",t.UnexpectedPrimitiveTypeArguments="primitive types not expected to have type arguments",t.UnexpectedVectorTypeArgumentCount="vector type expected to have exactly one type argument",t.UnexpectedStructFormat="unexpected struct format, must be of the form 0xaddress::module_name::struct_name",t.InvalidModuleNameCharacter="module name must only contain alphanumeric or '_' characters",t.InvalidStructNameCharacter="struct name must only contain alphanumeric or '_' characters",t.InvalidAddress="struct address must be valid",t))(T8||{}),O=class extends Error{constructor(e,r){super(`Failed to parse typeTag '${e}', ${r}`)}};function N1(t,e){let r=(e==null?void 0:e.allowGenerics)??!1,i=[],n=[],s=[],o=0,a="",c=1;for(;o<t.length;){let u=t[o];if(u==="<")i.push({savedExpectedTypes:c,savedStr:a,savedTypes:s}),a="",s=[],c=1;else if(u===">"){if(a!==""){let k=E2(a,n,r);s.push(k)}let d=i.pop();if(d===void 0)throw new O(t,"unexpected '>'");if(c!==s.length)throw new O(t,"type argument count doesn't match expected amount");let{savedStr:w,savedTypes:g,savedExpectedTypes:f}=d;n=s,s=g,a=w,c=f}else if(u===","){if(i.length===0)throw new O(t,"unexpected ','");if(a.length===0)throw new O(t,"no type argument before ','");let d=E2(a,n,r);n=[],s.push(d),a="",c+=1}else if(W4(u)){let d=!1;if(a.length!==0){let g=E2(a,n,r);n=[],s.push(g),a="",d=!0}o=S8(t,o);let w=t[o];if(o<t.length&&d&&w!==","&&w!==">")throw new O(t,"unexpected whitespace character");continue}else a+=u;o+=1}if(i.length>0)throw new O(t,"no matching '>' for '<'");switch(s.length){case 0:return E2(a,n,r);case 1:if(a==="")return s[0];throw new O(t,"unexpected ','");default:throw new O(t,"unexpected whitespace character")}}function E2(t,e,r){let i=t.trim(),n=i.toLowerCase();if(z8(n)&&e.length>0)throw new O(t,"primitive types not expected to have type arguments");switch(i.toLowerCase()){case"signer":return new $2;case"bool":return new X;case"address":return new o1;case"u8":return new x1;case"u16":return new U2;case"u32":return new b2;case"u64":return new y1;case"u128":return new B2;case"u256":return new k2;case"vector":if(e.length!==1)throw new O(t,"vector type expected to have exactly one type argument");return new v(e[0]);default:if(Q8(i)){let a=i.substring(1);return new J8(E2(a,e,r))}if(Y8(i)){if(r)return new x(Number(i.split("T")[1]));throw new O(t,"unexpected generic type")}if(!i.match(/:/))throw new O(t,"unknown type");let s=i.split("::");if(s.length!==3)throw new O(t,"unexpected struct format, must be of the form 0xaddress::module_name::struct_name");let o;try{o=l.fromString(s[0])}catch{throw new O(t,"struct address must be valid")}if(!W6(s[1]))throw new O(t,"module name must only contain alphanumeric or '_' characters");if(!W6(s[2]))throw new O(t,"struct name must only contain alphanumeric or '_' characters");return new I(new Q2(o,new $(s[1]),new $(s[2]),e))}}var A0=class X4 extends m{constructor(e){super(),this.value=E.fromHexInput(e).toUint8Array()}serialize(e){e.serializeFixedBytes(this.value)}serializeForEntryFunction(e){e.serialize(this)}serializeForScriptFunction(e){e.serialize(this)}static deserialize(e,r){let i=e.deserializeFixedBytes(r);return new X4(i)}},N=class Z4 extends m{constructor(e){super(),v4(e),this.value=e}serialize(e){e.serializeBool(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(5),e.serialize(this)}deserialize(e){return new A2(e.deserializeU256())}static deserialize(e){return new Z4(e.deserializeBool())}},F1=class _4 extends m{constructor(e){super(),t2(e,0,F4),this.value=e}serialize(e){e.serializeU8(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(0),e.serialize(this)}static deserialize(e){return new _4(e.deserializeU8())}},z2=class $4 extends m{constructor(e){super(),t2(e,0,G4),this.value=e}serialize(e){e.serializeU16(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(6),e.serialize(this)}static deserialize(e){return new $4(e.deserializeU16())}},h2=class e5 extends m{constructor(e){super(),t2(e,0,l2),this.value=e}serialize(e){e.serializeU32(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(7),e.serialize(this)}static deserialize(e){return new e5(e.deserializeU32())}},I1=class t5 extends m{constructor(e){super(),t2(e,BigInt(0),D0),this.value=BigInt(e)}serialize(e){e.serializeU64(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(1),e.serialize(this)}static deserialize(e){return new t5(e.deserializeU64())}},S2=class r5 extends m{constructor(e){super(),t2(e,BigInt(0),x3),this.value=BigInt(e)}serialize(e){e.serializeU128(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(2),e.serialize(this)}static deserialize(e){return new r5(e.deserializeU128())}},A2=class i5 extends m{constructor(e){super(),t2(e,BigInt(0),H4),this.value=BigInt(e)}serialize(e){e.serializeU256(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){e.serializeU32AsUleb128(8),e.serialize(this)}static deserialize(e){return new i5(e.deserializeU256())}},i1=class n5{constructor(e){this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e,0),this.offset=0}static fromHex(e){let r=E.hexInputToUint8Array(e);return new n5(r)}read(e){if(this.offset+e>this.buffer.byteLength)throw new Error("Reached to the end of buffer");let r=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,r}remaining(){return this.buffer.byteLength-this.offset}deserializeStr(){let e=this.deserializeBytes();return new TextDecoder().decode(e)}deserializeOptionStr(){return this.deserializeOption("string")}deserializeOption(e,r){if(this.deserializeBool()){if(e==="string")return this.deserializeStr();if(e==="bytes")return this.deserializeBytes();if(e==="fixedBytes"){if(r===void 0)throw new Error("Fixed bytes length not provided");return this.deserializeFixedBytes(r)}return this.deserialize(e)}}deserializeBytes(){let e=this.deserializeUleb128AsU32();return new Uint8Array(this.read(e))}deserializeFixedBytes(e){return new Uint8Array(this.read(e))}deserializeBool(){let e=new Uint8Array(this.read(1))[0];if(e!==1&&e!==0)throw new Error("Invalid boolean value");return e===1}deserializeU8(){return new DataView(this.read(1)).getUint8(0)}deserializeU16(){return new DataView(this.read(2)).getUint16(0,!0)}deserializeU32(){return new DataView(this.read(4)).getUint32(0,!0)}deserializeU64(){let e=this.deserializeU32(),r=this.deserializeU32();return BigInt(BigInt(r)<<BigInt(32)|BigInt(e))}deserializeU128(){let e=this.deserializeU64(),r=this.deserializeU64();return BigInt(r<<BigInt(64)|e)}deserializeU256(){let e=this.deserializeU128(),r=this.deserializeU128();return BigInt(r<<BigInt(128)|e)}deserializeUleb128AsU32(){let e=BigInt(0),r=0;for(;e<l2;){let i=this.deserializeU8();if(e|=BigInt(i&127)<<BigInt(r),!(i&128))break;r+=7}if(e>l2)throw new Error("Overflow while parsing uleb128-encoded uint32 value");return Number(e)}deserialize(e){return e.deserialize(this)}deserializeVector(e){let r=this.deserializeUleb128AsU32(),i=new Array;for(let n=0;n<r;n+=1)i.push(this.deserialize(e));return i}},B=class A1 extends m{constructor(e){super(),this.values=e}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){if(this.values[0]!==void 0&&!(this.values[0]instanceof F1)){new s5(this.bcsToBytes()).serializeForScriptFunction(e);return}e.serializeU32AsUleb128(4),e.serialize(this)}static U8(e){let r;if(Array.isArray(e)&&e.length===0)r=[];else if(Array.isArray(e)&&typeof e[0]=="number")r=e;else if(typeof e=="string"){let i=E.fromHexInput(e);r=Array.from(i.toUint8Array())}else if(e instanceof Uint8Array)r=Array.from(e);else throw new Error("Invalid input type, must be an number[], Uint8Array, or hex string");return new A1(r.map(i=>new F1(i)))}static U16(e){return new A1(e.map(r=>new z2(r)))}static U32(e){return new A1(e.map(r=>new h2(r)))}static U64(e){return new A1(e.map(r=>new I1(r)))}static U128(e){return new A1(e.map(r=>new S2(r)))}static U256(e){return new A1(e.map(r=>new A2(r)))}static Bool(e){return new A1(e.map(r=>new N(r)))}static MoveString(e){return new A1(e.map(r=>new F(r)))}serialize(e){e.serializeVector(this.values)}static deserialize(e,r){let i=e.deserializeUleb128AsU32(),n=new Array;for(let s=0;s<i;s+=1)n.push(r.deserialize(e));return new A1(n)}},s5=class o5 extends m{constructor(e){super(),this.value=E.fromHexInput(e).toUint8Array()}serialize(e){e.serializeBytes(this.value)}serializeForEntryFunction(e){this.serialize(e)}serializeForScriptFunction(e){e.serializeU32AsUleb128(9),this.serialize(e)}static deserialize(e){return new o5(e.deserializeBytes())}toMoveVector(e){let r=new i1(this.bcsToBytes());r.deserializeUleb128AsU32();let i=r.deserializeVector(e);return new B(i)}},F=class a5 extends m{constructor(e){super(),this.value=e}serialize(e){e.serializeStr(this.value)}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}serializeForScriptFunction(e){let r=new TextEncoder().encode(this.value);B.U8(r).serializeForScriptFunction(e)}static deserialize(e){return new a5(e.deserializeStr())}},n1=class w1 extends m{constructor(e){super(),typeof e<"u"&&e!==null?this.vec=new B([e]):this.vec=new B([]),[this.value]=this.vec.values}serializeForEntryFunction(e){let r=this.bcsToBytes();e.serializeBytes(r)}unwrap(){if(this.isSome())return this.vec.values[0];throw new Error("Called unwrap on a MoveOption with no value")}isSome(){return this.vec.values.length===1}serialize(e){this.vec.serialize(e)}static U8(e){return new w1(e!=null?new F1(e):void 0)}static U16(e){return new w1(e!=null?new z2(e):void 0)}static U32(e){return new w1(e!=null?new h2(e):void 0)}static U64(e){return new w1(e!=null?new I1(e):void 0)}static U128(e){return new w1(e!=null?new S2(e):void 0)}static U256(e){return new w1(e!=null?new A2(e):void 0)}static Bool(e){return new w1(e!=null?new N(e):void 0)}static MoveString(e){return new w1(e!=null?new F(e):void 0)}static deserialize(e,r){let i=B.deserialize(e,r);return new w1(i.values[0])}};function x8(t){return typeof t=="boolean"}function T1(t){return typeof t=="string"}function N8(t){return typeof t=="number"}function t3(t){if(N8(t))return t;if(T1(t)&&t!=="")return Number.parseInt(t,10)}function r3(t){return typeof t=="number"||typeof t=="bigint"||typeof t=="string"}function O8(t){return t==null}function P8(t){return c5(t)||l5(t)||d5(t)||g5(t)||f5(t)||p5(t)||h5(t)||d3(t)||u5(t)||R8(t)||t instanceof B||t instanceof n1}function c5(t){return t instanceof N}function d3(t){return t instanceof l}function u5(t){return t instanceof F}function R8(t){return t instanceof A0}function l5(t){return t instanceof F1}function d5(t){return t instanceof z2}function g5(t){return t instanceof h2}function f5(t){return t instanceof I1}function p5(t){return t instanceof S2}function h5(t){return t instanceof A2}function q8(t){return"bytecode"in t}function G(t,e){throw new Error(`Type mismatch for argument ${e}, expected '${t}'`)}function j8(t){let e=t.params.findIndex(r=>r!=="signer"&&r!=="&signer");return e<0?t.params.length:e}var V8=`
|
|
4
4
|
fragment TokenActivitiesFields on token_activities_v2 {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { aG as C8, aH as U8, aI as j2, aJ as P3, aK as b8, aL as V2, aM as n2, O as f3, aN as W, Q as p3, aO as B8, aP as k8, N as A0, L as R3, aQ as Q4, V as q3, aC as t2, aR as _2, aS as K8, aT as j3, az as Y4 } from "./index-
|
|
2
|
-
import { m as D8 } from "./index-
|
|
3
|
-
import { d as L8 } from "./base64-
|
|
1
|
+
import { aG as C8, aH as U8, aI as j2, aJ as P3, aK as b8, aL as V2, aM as n2, O as f3, aN as W, Q as p3, aO as B8, aP as k8, N as A0, L as R3, aQ as Q4, V as q3, aC as t2, aR as _2, aS as K8, aT as j3, az as Y4 } from "./index-CNRoD0cV.mjs";
|
|
2
|
+
import { m as D8 } from "./index-DYiI6lkY.mjs";
|
|
3
|
+
import { d as L8 } from "./base64-CL9tkFGP.mjs";
|
|
4
4
|
const F8 = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]), z4 = /* @__PURE__ */ new Uint8Array(new Array(16).fill(0).map((t, e) => e)), G8 = /* @__PURE__ */ z4.map((t) => (9 * t + 5) % 16);
|
|
5
5
|
let V3 = [z4], W3 = [G8];
|
|
6
6
|
for (let t = 0; t < 4; t++)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const s=require("./index-
|
|
1
|
+
"use strict";const s=require("./index-DOGZjt2S.js");var e=s.requireEvents();const t=s.getDefaultExportFromCjs(e);exports.eventsExports=e;exports.ss=t;
|
|
@@ -3,8 +3,8 @@ var wa = (e) => {
|
|
|
3
3
|
};
|
|
4
4
|
var Aa = (e, t, n) => t.has(e) || wa("Cannot " + n);
|
|
5
5
|
var Tr = (e, t, n) => (Aa(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Ia = (e, t, n) => t.has(e) ? wa("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Na = (e, t, n, r) => (Aa(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n);
|
|
6
|
-
import { T as Xo, U as Ea, V as Wr, X as qo, Y as $o, Z as ec, $ as xa, a0 as tc, a1 as $e, a2 as nc, a3 as Kn, a4 as rc, a5 as sc, a6 as ac, a7 as ic, a8 as oc, a9 as cc, aa as lc, ab as uc, ac as tn, ad as hc } from "./index-
|
|
7
|
-
import "./index-
|
|
6
|
+
import { T as Xo, U as Ea, V as Wr, X as qo, Y as $o, Z as ec, $ as xa, a0 as tc, a1 as $e, a2 as nc, a3 as Kn, a4 as rc, a5 as sc, a6 as ac, a7 as ic, a8 as oc, a9 as cc, aa as lc, ab as uc, ac as tn, ad as hc } from "./index-CNRoD0cV.mjs";
|
|
7
|
+
import "./index-YTBFGtnw.mjs";
|
|
8
8
|
import "react";
|
|
9
9
|
var kt;
|
|
10
10
|
class dc extends Xo {
|
|
@@ -4316,7 +4316,7 @@ async function gr(e, t) {
|
|
|
4316
4316
|
});
|
|
4317
4317
|
return C === "0x" ? { data: void 0 } : { data: C };
|
|
4318
4318
|
} catch (N) {
|
|
4319
|
-
const I = Hu(N), { offchainLookup: l, offchainLookupSignature: b } = await import("./ccip-
|
|
4319
|
+
const I = Hu(N), { offchainLookup: l, offchainLookupSignature: b } = await import("./ccip-javMNNCd.mjs");
|
|
4320
4320
|
if ((I == null ? void 0 : I.slice(0, 10)) === b && f)
|
|
4321
4321
|
return { data: await l(e, { data: I, to: f }) };
|
|
4322
4322
|
throw Yu(N, {
|
|
@@ -13979,7 +13979,7 @@ var xd = Object.defineProperty, Dd = function(e, t, n) {
|
|
|
13979
13979
|
case 0:
|
|
13980
13980
|
return !Jt(i, Vt) || a || o ? (h = !((c = i.options) === null || c === void 0) && c.infuraId ? {} : i.chains.reduce(function(f, m) {
|
|
13981
13981
|
return ti(Yn({}, f), vo({}, m.id, m.rpcUrls.default.http[0]));
|
|
13982
|
-
}, {}), [4, import("./index-
|
|
13982
|
+
}, {}), [4, import("./index-B39ftYxK.mjs")]) : [3, 2];
|
|
13983
13983
|
case 1:
|
|
13984
13984
|
d = p.sent().default, Yr(i, Vt, new d(ti(Yn({}, i.options), { chainId: a, rpc: Yn({}, h, (u = i.options) === null || u === void 0 ? void 0 : u.rpc) }))), p.label = 2;
|
|
13985
13985
|
case 2:
|
|
@@ -15579,7 +15579,7 @@ Es = async function() {
|
|
|
15579
15579
|
};
|
|
15580
15580
|
fa = /* @__PURE__ */ new WeakSet();
|
|
15581
15581
|
Vo = async function() {
|
|
15582
|
-
const { EthereumProvider: e } = await import("./index.es-
|
|
15582
|
+
const { EthereumProvider: e } = await import("./index.es-Cw1Vg7NX.mjs"), t = this.chains.map(({ id: n }) => n);
|
|
15583
15583
|
if (t.length) {
|
|
15584
15584
|
const {
|
|
15585
15585
|
projectId: n,
|