@wormhole-foundation/wormhole-connect 2.1.0-beta.2-development → 2.1.0-beta.3-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.
Files changed (128) hide show
  1. package/README.md +1 -0
  2. package/dist/main.js +105 -105
  3. package/dist/src/config/constants.d.ts.map +1 -1
  4. package/dist/src/config/mainnet/chains.d.ts.map +1 -1
  5. package/dist/src/config/mainnet/rpcs.d.ts.map +1 -1
  6. package/dist/src/config/mainnet/tokens.d.ts.map +1 -1
  7. package/dist/src/config/tokens.d.ts +1 -1
  8. package/dist/src/config/tokens.d.ts.map +1 -1
  9. package/dist/src/config/types.d.ts +1 -1
  10. package/dist/src/config/types.d.ts.map +1 -1
  11. package/dist/src/hooks/useTransactionHistoryMayan.d.ts.map +1 -1
  12. package/dist/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
  13. package/dist/src/icons/ChainIcons.d.ts.map +1 -1
  14. package/dist/src/icons/Chains/BERA.d.ts +4 -0
  15. package/dist/src/icons/Chains/BERA.d.ts.map +1 -0
  16. package/dist/src/icons/Tokens/BERA.d.ts +4 -0
  17. package/dist/src/icons/Tokens/BERA.d.ts.map +1 -0
  18. package/dist/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
  19. package/dist/src/store/transferInput.d.ts +1 -1
  20. package/dist/src/store/transferInput.d.ts.map +1 -1
  21. package/dist/src/utils/coingecko.d.ts.map +1 -1
  22. package/dist/src/views/v2/Bridge/ReviewTransaction/index.d.ts.map +1 -1
  23. package/dist/src/views/v2/Bridge/Routes/SingleRoute.d.ts +1 -2
  24. package/dist/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  25. package/dist/src/views/v2/Bridge/Routes/index.d.ts.map +1 -1
  26. package/lib/{aptos-Ckopfy7I.mjs → aptos-BzWhIYlr.mjs} +5 -5
  27. package/lib/{aptos-CYxRBLR_.js → aptos-BzXZvGaH.js} +1 -1
  28. package/lib/{aptos-7G9wZkGW.js → aptos-D3_AGWR7.js} +2 -2
  29. package/lib/{aptos-BlOWGpyT.mjs → aptos-UPRxA7V-.mjs} +2 -2
  30. package/lib/{base64-CFR5QWTY.js → base64-DRH1vfG7.js} +1 -1
  31. package/lib/{base64-HSuzVIKw.mjs → base64-DVjW5Kcf.mjs} +1 -1
  32. package/lib/{ccip-CVUhxB0q.js → ccip-BB23_sIM.js} +1 -1
  33. package/lib/{ccip-Bntg_vPp.mjs → ccip-wLlfyIvk.mjs} +1 -1
  34. package/lib/{chunk-IMTC3J2M-ByR5Yjf4.js → chunk-IMTC3J2M-CBauIJwr.js} +1 -1
  35. package/lib/{chunk-IMTC3J2M-BADDWO3l.mjs → chunk-IMTC3J2M-DNVBjBib.mjs} +3 -3
  36. package/lib/{events-jATx_JnD.js → events-CKwRCNdA.js} +1 -1
  37. package/lib/{events-lD3LhLH0.mjs → events-IHlp1dj4.mjs} +1 -1
  38. package/lib/{evm-BW0CHBCG.mjs → evm-BabY832Q.mjs} +5 -5
  39. package/lib/{evm-z5yFHxM9.js → evm-C2f5n9qH.js} +3 -3
  40. package/lib/{evm-ColKfWEz.mjs → evm-CogaB9FQ.mjs} +5 -5
  41. package/lib/{evm-Bh1Y4eUx.js → evm-CyaMnZnL.js} +1 -1
  42. package/lib/{index-DZvLy2Dr.js → index-5VUxPYxW.js} +115 -115
  43. package/lib/{index-lHA40g0z.mjs → index-B2wyWEm0.mjs} +2 -2
  44. package/lib/{index-CAUvtNGE.mjs → index-B5jfHVNH.mjs} +3 -3
  45. package/lib/{index-2fBRXVP8.mjs → index-B60oaJsI.mjs} +2 -2
  46. package/lib/{index-gd_dleYk.mjs → index-B9LgOPw7.mjs} +1 -1
  47. package/lib/{index-DB_r424l.mjs → index-BG8PXjVw.mjs} +1 -1
  48. package/lib/{index-rFhS51F6.js → index-BM78yUJC.js} +1 -1
  49. package/lib/{index-InC6In6o.mjs → index-BQ9dR-yJ.mjs} +2 -2
  50. package/lib/{index-DjkMeATf.js → index-BZETHtjN.js} +1 -1
  51. package/lib/{index-oPxOJfPK.mjs → index-BhivGLAi.mjs} +2 -2
  52. package/lib/{index-WLqZ1uO7.js → index-Bk1zihOK.js} +1 -1
  53. package/lib/{index-BcdbCktu.js → index-Bket7LZZ.js} +1 -1
  54. package/lib/{index-CfnNi3Zd.mjs → index-Bn72ykZ2.mjs} +3 -3
  55. package/lib/{index-BhexWYVn.js → index-BtaC2yLu.js} +1 -1
  56. package/lib/{index-CCUy1jes.js → index-BvuTcXfv.js} +1 -1
  57. package/lib/{index-Cl6LSKsg.mjs → index-BxevXfo4.mjs} +1 -1
  58. package/lib/{index-BZ0W_BZS.mjs → index-C1sV2FAp.mjs} +2 -2
  59. package/lib/{index-D7IcLxQc.js → index-C407bW0H.js} +1 -1
  60. package/lib/{index-C-OIv0gT.js → index-CBlNoKKQ.js} +1 -1
  61. package/lib/{index-lEBTHIqm.mjs → index-CNvVpBBa.mjs} +2 -2
  62. package/lib/{index-DIAuhm70.mjs → index-CTm08KJA.mjs} +5 -5
  63. package/lib/{index-DUXnbpVg.js → index-CV8YMcz4.js} +1 -1
  64. package/lib/{index-B9GU1bLs.mjs → index-Cs0blatJ.mjs} +1 -1
  65. package/lib/{index-BXkdaYu_.mjs → index-CzwViHJ0.mjs} +1 -1
  66. package/lib/{index-D0XcjaUl.mjs → index-D19sSkOu.mjs} +2 -2
  67. package/lib/{index-8JCep4IW.js → index-D6VdydhT.js} +1 -1
  68. package/lib/{index-DleO04Ea.js → index-DIVxdT0X.js} +1 -1
  69. package/lib/{index-DAzDpd7U.js → index-DT-Qo8X9.js} +1 -1
  70. package/lib/{index-CcFpkXPM.mjs → index-DUGSEVtX.mjs} +2 -2
  71. package/lib/{index-DQVQrflZ.js → index-Dfo6fMQc.js} +1 -1
  72. package/lib/{index-V7kxzAZX.js → index-DhpLGCAx.js} +1 -1
  73. package/lib/{index-8-70GvMi.js → index-DiEuvJoC.js} +1 -1
  74. package/lib/{index-C6WDEDwO.js → index-DqlsWTi0.js} +1 -1
  75. package/lib/{index-y_DeeCWD.mjs → index-DrO4MMc6.mjs} +4 -4
  76. package/lib/{index-DECw2aR6.mjs → index-FVwpVvZ7.mjs} +1 -1
  77. package/lib/{index-DGgQSMuG.js → index-ImA899Nn.js} +1 -1
  78. package/lib/{index-DOXMkFA4.js → index-ItME4Ygf.js} +1 -1
  79. package/lib/{index-Cxw9PIcl.js → index-M6UZ-4MJ.js} +1 -1
  80. package/lib/{index-CxQ-swIQ.mjs → index-or7CYt4J.mjs} +1 -1
  81. package/lib/{index-CYBM2IeY.mjs → index-qAojYF7t.mjs} +15206 -14384
  82. package/lib/{index-CBxgME-2.mjs → index-y5-IYFyD.mjs} +2 -2
  83. package/lib/{index-l0NqjNj9.js → index-zfWv19dx.js} +1 -1
  84. package/lib/{index.es-Doowrf9a.js → index.es-C3FF2T3n.js} +2 -2
  85. package/lib/{index.es-YqKQxHG6.mjs → index.es-dld457ym.mjs} +6 -6
  86. package/lib/index.js +1 -1
  87. package/lib/index.mjs +1 -1
  88. package/lib/{signer-CfU9wW3f.mjs → signer-BBccJJ2M.mjs} +1 -1
  89. package/lib/{signer-eoVHaZz7.js → signer-BpeTLqjx.js} +1 -1
  90. package/lib/solana-4RJ4XeTx.js +1 -0
  91. package/lib/{solana-C_d_AKET.js → solana-BIaWIfzq.js} +1 -1
  92. package/lib/{solana-y-l38J4U.mjs → solana-Ds-NCQtw.mjs} +5 -5
  93. package/lib/{solana-CHUnEnef.mjs → solana-zqUypMcM.mjs} +4 -4
  94. package/lib/{solanaEmbed.esm-B4tNQ7S7.js → solanaEmbed.esm-BxikN_Mz.js} +1 -1
  95. package/lib/{solanaEmbed.esm-DVOHg5WI.mjs → solanaEmbed.esm-DRkknJ2o.mjs} +2 -2
  96. package/lib/src/config/constants.d.ts.map +1 -1
  97. package/lib/src/config/mainnet/chains.d.ts.map +1 -1
  98. package/lib/src/config/mainnet/rpcs.d.ts.map +1 -1
  99. package/lib/src/config/mainnet/tokens.d.ts.map +1 -1
  100. package/lib/src/config/tokens.d.ts +1 -1
  101. package/lib/src/config/tokens.d.ts.map +1 -1
  102. package/lib/src/config/types.d.ts +1 -1
  103. package/lib/src/config/types.d.ts.map +1 -1
  104. package/lib/src/hooks/useTransactionHistoryMayan.d.ts.map +1 -1
  105. package/lib/src/hooks/useTransactionHistoryWHScan.d.ts.map +1 -1
  106. package/lib/src/icons/ChainIcons.d.ts.map +1 -1
  107. package/lib/src/icons/Chains/BERA.d.ts +4 -0
  108. package/lib/src/icons/Chains/BERA.d.ts.map +1 -0
  109. package/lib/src/icons/Tokens/BERA.d.ts +4 -0
  110. package/lib/src/icons/Tokens/BERA.d.ts.map +1 -0
  111. package/lib/src/sdklegacy/config/MAINNET.d.ts.map +1 -1
  112. package/lib/src/store/transferInput.d.ts +1 -1
  113. package/lib/src/store/transferInput.d.ts.map +1 -1
  114. package/lib/src/utils/coingecko.d.ts.map +1 -1
  115. package/lib/src/views/v2/Bridge/ReviewTransaction/index.d.ts.map +1 -1
  116. package/lib/src/views/v2/Bridge/Routes/SingleRoute.d.ts +1 -2
  117. package/lib/src/views/v2/Bridge/Routes/SingleRoute.d.ts.map +1 -1
  118. package/lib/src/views/v2/Bridge/Routes/index.d.ts.map +1 -1
  119. package/lib/{sui-D9frS9ki.mjs → sui-5OP1jpsj.mjs} +1 -1
  120. package/lib/{sui-BN1m6APK.js → sui-710wCQpP.js} +1 -1
  121. package/lib/{sui-K20aVxqE.js → sui-8bnax2uU.js} +2 -2
  122. package/lib/{sui-1fbLRIUL.mjs → sui-n-MTTZiA.mjs} +5 -5
  123. package/package.json +18 -18
  124. package/dist/src/config/routes.d.ts +0 -10
  125. package/dist/src/config/routes.d.ts.map +0 -1
  126. package/lib/solana-SFHXHGL2.js +0 -1
  127. package/lib/src/config/routes.d.ts +0 -10
  128. package/lib/src/config/routes.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";var Tr=Object.defineProperty;var vr=(e,t,r)=>t in e?Tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var F=(e,t,r)=>vr(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("./index-DZvLy2Dr.js"),ke=require("./sui-K20aVxqE.js"),Er=require("./unsignedTransaction-DzSLsK-p.js");class xr extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...a}=t,{path:o}=t,u=o.length===0?i:`At path: ${o.join(".")} -- ${i}`;super(s??u),s!=null&&(this.cause=u),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function jr(e){return z(e)&&typeof e[Symbol.iterator]=="function"}function z(e){return typeof e=="object"&&e!=null}function V(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function Ir(e){const{done:t,value:r}=e.next();return t?void 0:r}function Or(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:a}=r,{refinement:o,message:u=`Expected a value of type \`${a}\`${o?` with refinement \`${o}\``:""}, but received: \`${V(n)}\``}=e;return{value:n,type:a,refinement:o,key:i[i.length-1],path:i,branch:s,...e,message:u}}function*Nt(e,t,r,n){jr(e)||(e=[e]);for(const i of e){const s=Or(i,t,r,n);s&&(yield s)}}function*at(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:a=!1}=r,o={path:n,branch:i};if(s&&(e=t.coercer(e,o),a&&t.type!=="type"&&z(t.schema)&&z(e)&&!Array.isArray(e)))for(const d in e)t.schema[d]===void 0&&delete e[d];let u="valid";for(const d of t.validator(e,o))d.explanation=r.message,u="not_valid",yield[d,void 0];for(let[d,l,g]of t.entries(e,o)){const m=at(l,g,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,l],coerce:s,mask:a,message:r.message});for(const p of m)p[0]?(u=p[0].refinement!=null?"not_refined":"not_valid",yield[p[0],void 0]):s&&(l=p[1],d===void 0?e=l:e instanceof Map?e.set(d,l):e instanceof Set?e.add(l):z(e)&&(l!==void 0||d in e)&&(e[d]=l))}if(u!=="not_valid")for(const d of t.refiner(e,o))d.explanation=r.message,u="not_refined",yield[d,void 0];u==="valid"&&(yield[void 0,e])}class Y{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:a=u=>u,entries:o=function*(){}}=t;this.type=r,this.schema=n,this.entries=o,this.coercer=a,i?this.validator=(u,d)=>{const l=i(u,d);return Nt(l,d,this,u)}:this.validator=()=>[],s?this.refiner=(u,d)=>{const l=s(u,d);return Nt(l,d,this,u)}:this.refiner=()=>[]}assert(t,r){return Qe(t,this,r)}create(t,r){return Gt(t,this,r)}is(t){return N(t,this)}mask(t,r){return Ft(t,this,r)}validate(t,r={}){return xe(t,this,r)}}function Qe(e,t,r){const n=xe(e,t,{message:r});if(n[0])throw n[0]}function Gt(e,t,r){const n=xe(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Ft(e,t,r){const n=xe(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function N(e,t){return!xe(e,t)[0]}function xe(e,t,r={}){const n=at(e,t,r),i=Ir(n);return i[0]?[new xr(i[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,i[1]]}function be(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?kr(n):h(n)}function P(e,t){return new Y({type:e,schema:null,validator:t})}function et(){return P("any",()=>!0)}function v(e){return new Y({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${V(t)}`}})}function Ar(){return P("bigint",e=>typeof e=="bigint")}function U(){return P("boolean",e=>typeof e=="boolean")}function Z(){return P("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${V(e)}`)}function b(e){const t=V(e),r=typeof e;return new Y({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${V(n)}`}})}function Lt(){return P("never",()=>!1)}function O(e){return new Y({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function de(){return P("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${V(e)}`)}function h(e){const t=e?Object.keys(e):[],r=Lt();return new Y({type:"object",schema:e||null,*entries(n){if(e&&z(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return z(n)||`Expected an object, but received: ${V(n)}`},coercer(n){return z(n)?{...n}:n}})}function w(e){return new Y({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function X(e,t){return new Y({type:"record",schema:null,*entries(r){if(z(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return z(r)||`Expected an object, but received: ${V(r)}`}})}function f(){return P("string",e=>typeof e=="string"||`Expected a string, but received: ${V(e)}`)}function Kt(e){const t=Lt();return new Y({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${V(r)}`}})}function kr(e){const t=Object.keys(e);return new Y({type:"type",schema:e,*entries(r){if(z(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return z(r)||`Expected an object, but received: ${V(r)}`},coercer(r){return z(r)?{...r}:r}})}function k(e){const t=e.map(r=>r.type).join(" | ");return new Y({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...a]=at(r,s,n),[o]=a;if(o[0])for(const[u]of a)u&&i.push(u);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${V(r)}`,...i]}})}function Wt(){return P("unknown",()=>!0)}const ot=k([h({AddressOwner:f()}),h({ObjectOwner:f()}),h({Shared:h({initial_shared_version:O(f())})}),b("Immutable")]);P("SuiJsonValue",()=>!0);const _r=k([h({u32:f()}),h({u64:f()}),h({f64:f()})]);h({attributes:X(f(),O(_r)),featureFlags:X(f(),U()),maxSupportedProtocolVersion:f(),minSupportedProtocolVersion:f(),protocolVersion:f()});k([f(),b("package")]);const ae=h({digest:f(),objectId:f(),version:k([de(),f(),Ar()])});h({owner:ot,reference:ae});h({objectId:f(),sequenceNumber:f()});h({payment:v(ae),owner:f(),price:f(),budget:f()});const Cr=be(ae,h({type:f(),owner:ot,previousTransaction:f()})),$r=X(f(),et()),Mr=X(f(),Wt()),Ur=h({type:f(),fields:$r,hasPublicTransfer:U()}),Br=h({disassembled:Mr}),Rr=k([be(Ur,h({dataType:b("moveObject")})),be(Br,h({dataType:b("package")}))]),Nr=h({type:f(),hasPublicTransfer:U(),version:f(),bcsBytes:f()}),Pr=h({id:f(),moduleMap:X(f(),f())}),Dr=k([be(Nr,h({dataType:b("moveObject")})),be(Pr,h({dataType:b("package")}))]);BigInt(1e9);const Jt=h({code:f(),error:w(f()),object_id:w(f()),parent_object_id:w(f()),version:w(f()),digest:w(f())}),zr=h({data:O(w(X(f(),f()))),error:O(w(Jt))}),Vr=k([zr,w(X(f(),f()))]),Ht=h({objectId:f(),version:f(),digest:f(),type:O(w(f())),content:O(w(Rr)),bcs:O(w(Dr)),owner:O(w(ot)),previousTransaction:O(w(f())),storageRebate:O(w(f())),display:O(w(Vr))});h({showType:O(w(U())),showContent:O(w(U())),showBcs:O(w(U())),showOwner:O(w(U())),showPreviousTransaction:O(w(U())),showStorageRebate:O(w(U())),showDisplay:O(w(U()))});k([b("Exists"),b("notExists"),b("Deleted")]);v(Cr);const Gr=h({data:O(w(Ht)),error:O(w(Jt))});function Fr(e){return e.data}function Lr(e){if(e.error&&"object_id"in e.error&&"version"in e.error&&"digest"in e.error){const t=e.error;return{objectId:t.object_id,version:t.version,digest:t.digest}}}function Pt(e){if("reference"in e)return e.reference;const t=Fr(e);return t?{objectId:t.objectId,version:t.version,digest:t.digest}:Lr(e)}h({objectId:f(),atCheckpoint:w(de())});h({data:v(Gr),nextCursor:w(O(f())),hasNextPage:U()});k([h({details:Ht,status:b("VersionFound")}),h({details:f(),status:b("ObjectNotExists")}),h({details:ae,status:b("ObjectDeleted")}),h({details:Kt([f(),de()]),status:b("VersionNotFound")}),h({details:h({asked_version:de(),latest_version:de(),object_id:f()}),status:b("VersionTooHigh")})]);const Kr=k([f(),h({Object:f()})]);v(Kr);const Wr=h({address:f(),name:f()}),Jr=k([b("Private"),b("Public"),b("Friend")]),ct=h({abilities:v(f())}),Hr=h({constraints:ct,isPhantom:U()}),Xr=h({TypeParameter:de()}),Ke=Kt([h({module:f(),package:f(),function:f()}),f()]);h({rank3Days:v(Ke),rank7Days:v(Ke),rank30Days:v(Ke)});function Xt(e){if(!e)return!1;if(typeof e=="string"||N(e,Xr)||qt(e))return!0;if(typeof e!="object")return!1;const t=e;return!!(N(t.Reference,he)||N(t.MutableReference,he)||N(t.Vector,he))}const he=P("SuiMoveNormalizedType",Xt);function qt(e){if(!e||typeof e!="object")return!1;const t=e;if(!t.Struct||typeof t.Struct!="object")return!1;const r=t.Struct;return!(typeof r.address!="string"||typeof r.module!="string"||typeof r.name!="string"||!Array.isArray(r.typeArguments)||!r.typeArguments.every(n=>Xt(n)))}P("SuiMoveNormalizedStructType",qt);const qr=h({visibility:Jr,isEntry:U(),typeParameters:v(ct),parameters:v(he),return:v(he)}),Zr=h({name:f(),type:he}),Yr=h({abilities:ct,typeParameters:v(Hr),fields:v(Zr)}),Qr=h({fileFormatVersion:de(),address:f(),name:f(),friends:v(Wr),structs:X(f(),Yr),exposedFunctions:X(f(),qr)});X(f(),Qr);function tt(e){return typeof e=="object"&&"MutableReference"in e?e.MutableReference:void 0}function Zt(e){return typeof e=="object"&&"Reference"in e?e.Reference:void 0}function ut(e){if(typeof e=="object"&&"Struct"in e)return e;const t=Zt(e),r=tt(e);if(typeof t=="object"&&"Struct"in t)return t;if(typeof r=="object"&&"Struct"in r)return r}function en(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),s=i.charCodeAt(0);if(t[s]!==255)throw new TypeError(i+" is ambiguous");t[s]=n}var a=e.length,o=e.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function l(p){if(p instanceof Uint8Array||(ArrayBuffer.isView(p)?p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):Array.isArray(p)&&(p=Uint8Array.from(p))),!(p instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(p.length===0)return"";for(var y=0,S=0,E=0,A=p.length;E!==A&&p[E]===0;)E++,y++;for(var _=(A-E)*d+1>>>0,D=new Uint8Array(_);E!==A;){for(var q=p[E],ie=0,G=_-1;(q!==0||ie<S)&&G!==-1;G--,ie++)q+=256*D[G]>>>0,D[G]=q%a>>>0,q=q/a>>>0;if(q!==0)throw new Error("Non-zero carry");S=ie,E++}for(var Q=_-S;Q!==_&&D[Q]===0;)Q++;for(var Ae=o.repeat(y);Q<_;++Q)Ae+=e.charAt(D[Q]);return Ae}function g(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return new Uint8Array;for(var y=0,S=0,E=0;p[y]===o;)S++,y++;for(var A=(p.length-y)*u+1>>>0,_=new Uint8Array(A);p[y];){var D=t[p.charCodeAt(y)];if(D===255)return;for(var q=0,ie=A-1;(D!==0||q<E)&&ie!==-1;ie--,q++)D+=a*_[ie]>>>0,_[ie]=D%256>>>0,D=D/256>>>0;if(D!==0)throw new Error("Non-zero carry");E=q,y++}for(var G=A-E;G!==A&&_[G]===0;)G++;for(var Q=new Uint8Array(S+(A-G)),Ae=S;G!==A;)Q[Ae++]=_[G++];return Q}function m(p){var y=g(p);if(y)return y;throw new Error("Non-base"+a+" character")}return{encode:l,decodeUnsafe:g,decode:m}}var tn=en;const rn=tn,nn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var sn=rn(nn);const Yt=K.getDefaultExportFromCjs(sn),je=e=>Yt.encode(e),dt=e=>Yt.decode(e);function oe(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}const We=8192;function Ie(e){if(e.length<We)return btoa(String.fromCharCode(...e));let t="";for(var r=0;r<e.length;r+=We){const n=e.slice(r,r+We);t+=String.fromCharCode(...n)}return btoa(t)}function Fe(e){var i;const t=e.startsWith("0x")?e.slice(2):e,n=((i=(t.length%2===0?t:`0${t}}`).match(/.{2}/g))==null?void 0:i.map(s=>parseInt(s,16)))??[];return Uint8Array.from(n)}function Oe(e){return e.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}function ft(e){let t=[],r=0;if(e===0)return[0];for(;e>0;)t[r]=e&127,(e>>=7)&&(t[r]|=128),r+=1;return t}function an(e){let t=0,r=0,n=0;for(;;){let i=e[n];if(n+=1,t|=(i&127)<<r,!(i&128))break;r+=7}return{value:t,length:n}}class Qt{constructor(t){this.bytePosition=0,this.dataView=new DataView(t.buffer)}shift(t){return this.bytePosition+=t,this}read8(){let t=this.dataView.getUint8(this.bytePosition);return this.shift(1),t}read16(){let t=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),t}read32(){let t=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),t}read64(){let t=this.read32(),n=this.read32().toString(16)+t.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){let t=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+t.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}read256(){let t=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+t.toString(16).padStart(32,"0");return BigInt("0x"+n).toString(10)}readBytes(t){let r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,t);return this.shift(t),n}readULEB(){let t=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,t),{value:n,length:i}=an(r);return this.shift(i),n}readVec(t){let r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(t(this,i,r));return n}}function on(e,t){switch(t){case"base58":return je(e);case"base64":return Ie(e);case"hex":return Oe(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function cn(e,t){switch(t){case"base58":return dt(e);case"base64":return oe(e);case"hex":return Fe(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function er(e,t=["<",">"]){const[r,n]=t,i=[];let s="",a=0;for(let o=0;o<e.length;o++){const u=e[o];if(u===r&&a++,u===n&&a--,a===0&&u===","){i.push(s.trim()),s="";continue}s+=u}return i.push(s.trim()),i}class tr{constructor({size:t=1024,maxSize:r,allocateSize:n=1024}={}){this.bytePosition=0,this.size=t,this.maxSize=r||t,this.allocateSize=n,this.dataView=new DataView(new ArrayBuffer(t))}ensureSizeOrGrow(t){const r=this.bytePosition+t;if(r>this.size){const n=Math.min(this.maxSize,this.size+this.allocateSize);if(r>n)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${r}`);this.size=n;const i=new ArrayBuffer(this.size);new Uint8Array(i).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(i)}}shift(t){return this.bytePosition+=t,this}write8(t){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(t)),this.shift(1)}write16(t){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(t),!0),this.shift(2)}write32(t){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(t),!0),this.shift(4)}write64(t){return Je(BigInt(t),8).forEach(r=>this.write8(r)),this}write128(t){return Je(BigInt(t),16).forEach(r=>this.write8(r)),this}write256(t){return Je(BigInt(t),32).forEach(r=>this.write8(r)),this}writeULEB(t){return ft(t).forEach(r=>this.write8(r)),this}writeVec(t,r){return this.writeULEB(t.length),Array.from(t).forEach((n,i)=>r(this,n,i,t.length)),this}*[Symbol.iterator](){for(let t=0;t<this.bytePosition;t++)yield this.dataView.getUint8(t);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(t){return on(this.toBytes(),t)}}function Je(e,t){let r=new Uint8Array(t),n=0;for(;e>0;)r[n]=Number(e%BigInt(256)),e=e/BigInt(256),n+=1;return r}var rr=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},W=(e,t,r)=>(rr(e,t,"read from private field"),r?r.call(e):t.get(e)),Ne=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Pe=(e,t,r,n)=>(rr(e,t,"write to private field"),t.set(e,r),r),le,pe,Me,se;const nr=class{constructor(e){Ne(this,le,void 0),Ne(this,pe,void 0),this.name=e.name,this.read=e.read,this.serializedSize=e.serializedSize??(()=>null),Pe(this,le,e.write),Pe(this,pe,e.serialize??((t,r)=>{const n=new tr({size:this.serializedSize(t)??void 0,...r});return W(this,le).call(this,t,n),n.toBytes()})),this.validate=e.validate??(()=>{})}write(e,t){this.validate(e),W(this,le).call(this,e,t)}serialize(e,t){return this.validate(e),new un(this,W(this,pe).call(this,e,t))}parse(e){const t=new Qt(e);return this.read(t)}transform({name:e,input:t,output:r}){return new nr({name:e??this.name,read:n=>r(this.read(n)),write:(n,i)=>W(this,le).call(this,t(n),i),serializedSize:n=>this.serializedSize(t(n)),serialize:(n,i)=>W(this,pe).call(this,t(n),i),validate:n=>this.validate(t(n))})}};let J=nr;le=new WeakMap;pe=new WeakMap;const ir=Symbol.for("@mysten/serialized-bcs");function lt(e){return!!e&&typeof e=="object"&&e[ir]===!0}class un{constructor(t,r){Ne(this,Me,void 0),Ne(this,se,void 0),Pe(this,Me,t),Pe(this,se,r)}get[ir](){return!0}toBytes(){return W(this,se)}toHex(){return Oe(W(this,se))}toBase64(){return Ie(W(this,se))}toBase58(){return je(W(this,se))}parse(){return W(this,Me).parse(W(this,se))}}Me=new WeakMap;se=new WeakMap;function De({size:e,...t}){return new J({...t,serializedSize:()=>e})}function He({readMethod:e,writeMethod:t,...r}){return De({...r,read:n=>n[e](),write:(n,i)=>i[t](n),validate:n=>{var i;if(n<0||n>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${n}. Expected value in range 0-${r.maxValue}`);(i=r.validate)==null||i.call(r,n)}})}function Xe({readMethod:e,writeMethod:t,...r}){return De({...r,read:n=>n[e](),write:(n,i)=>i[t](BigInt(n)),validate:n=>{var s;const i=BigInt(n);if(i<0||i>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${i}. Expected value in range 0-${r.maxValue}`);(s=r.validate)==null||s.call(r,i)}})}function dn({serialize:e,...t}){const r=new J({...t,serialize:e,write:(n,i)=>{for(const s of r.serialize(n).toBytes())i.write8(s)}});return r}function fn({toBytes:e,fromBytes:t,...r}){return new J({...r,read:n=>{const i=n.readULEB(),s=n.readBytes(i);return t(s)},write:(n,i)=>{const s=e(n);i.writeULEB(s.length);for(let a=0;a<s.length;a++)i.write8(s[a])},serialize:n=>{const i=e(n),s=ft(i.length),a=new Uint8Array(s.length+i.length);return a.set(s,0),a.set(i,s.length),a},validate:n=>{var i;if(typeof n!="string")throw new TypeError(`Invalid ${r.name} value: ${n}. Expected string`);(i=r.validate)==null||i.call(r,n)}})}function ln(e){let t=null;function r(){return t||(t=e()),t}return new J({name:"lazy",read:n=>r().read(n),serializedSize:n=>r().serializedSize(n),write:(n,i)=>r().write(n,i),serialize:(n,i)=>r().serialize(n,i).toBytes()})}const c={u8(e){return He({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e})},u16(e){return He({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e})},u32(e){return He({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e})},u64(e){return Xe({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e})},u128(e){return Xe({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e})},u256(e){return Xe({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e})},bool(e){return De({name:"bool",size:1,read:t=>t.read8()===1,write:(t,r)=>r.write8(t?1:0),...e,validate:t=>{var r;if((r=e==null?void 0:e.validate)==null||r.call(e,t),typeof t!="boolean")throw new TypeError(`Expected boolean, found ${typeof t}`)}})},uleb128(e){return dn({name:"uleb128",read:t=>t.readULEB(),serialize:t=>Uint8Array.from(ft(t)),...e})},bytes(e,t){return De({name:`bytes[${e}]`,size:e,read:r=>r.readBytes(e),write:(r,n)=>{for(let i=0;i<e;i++)n.write8(r[i]??0)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e)throw new TypeError(`Expected array of length ${e}, found ${r.length}`)}})},string(e){return fn({name:"string",toBytes:t=>new TextEncoder().encode(t),fromBytes:t=>new TextDecoder().decode(t),...e})},fixedArray(e,t,r){return new J({name:`${t.name}[${e}]`,read:n=>{const i=new Array(e);for(let s=0;s<e;s++)i[s]=t.read(n);return i},write:(n,i)=>{for(const s of n)t.write(s,i)},...r,validate:n=>{var i;if((i=r==null?void 0:r.validate)==null||i.call(r,n),!("length"in n))throw new TypeError(`Expected array, found ${typeof n}`);if(n.length!==e)throw new TypeError(`Expected array of length ${e}, found ${n.length}`)}})},option(e){return c.enum(`Option<${e.name}>`,{None:null,Some:e}).transform({input:t=>t==null?{None:!0}:{Some:t},output:t=>"Some"in t?t.Some:null})},vector(e,t){return new J({name:`vector<${e.name}>`,read:r=>{const n=r.readULEB(),i=new Array(n);for(let s=0;s<n;s++)i[s]=e.read(r);return i},write:(r,n)=>{n.writeULEB(r.length);for(const i of r)e.write(i,n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`)}})},tuple(e,t){return new J({name:`(${e.map(r=>r.name).join(", ")})`,serializedSize:r=>{let n=0;for(let i=0;i<e.length;i++){const s=e[i].serializedSize(r[i]);if(s==null)return null;n+=s}return n},read:r=>{const n=[];for(const i of e)n.push(i.read(r));return n},write:(r,n)=>{for(let i=0;i<e.length;i++)e[i].write(r[i],n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e.length)throw new TypeError(`Expected array of length ${e.length}, found ${r.length}`)}})},struct(e,t,r){const n=Object.entries(t);return new J({name:e,serializedSize:i=>{let s=0;for(const[a,o]of n){const u=o.serializedSize(i[a]);if(u==null)return null;s+=u}return s},read:i=>{const s={};for(const[a,o]of n)s[a]=o.read(i);return s},write:(i,s)=>{for(const[a,o]of n)o.write(i[a],s)},...r,validate:i=>{var s;if((s=r==null?void 0:r.validate)==null||s.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`)}})},enum(e,t,r){const n=Object.entries(t);return new J({name:e,read:i=>{const s=i.readULEB(),[a,o]=n[s];return{[a]:(o==null?void 0:o.read(i))??!0}},write:(i,s)=>{const[a,o]=Object.entries(i)[0];for(let u=0;u<n.length;u++){const[d,l]=n[u];if(d===a){s.writeULEB(u),l==null||l.write(o,s);return}}},...r,validate:i=>{var o;if((o=r==null?void 0:r.validate)==null||o.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`);const s=Object.keys(i);if(s.length!==1)throw new TypeError(`Expected object with one key, found ${s.length}`);const[a]=s;if(!Object.hasOwn(t,a))throw new TypeError(`Invalid enum variant ${a}`)}})},map(e,t){return c.vector(c.tuple([e,t])).transform({name:`Map<${e.name}, ${t.name}>`,input:r=>[...r.entries()],output:r=>{const n=new Map;for(const[i,s]of r)n.set(i,s);return n}})},generic(e,t){return(...r)=>t(...r).transform({name:`${t.name}<${r.map(n=>n.name).join(", ")}>`,input:n=>n,output:n=>n})},lazy(e){return ln(e)}},hn=32,me=class{constructor(e){if(this.types=new Map,this.counter=0,e instanceof me){this.schema=e.schema,this.types=new Map(e.types);return}if(this.schema=e,this.registerAddressType(me.ADDRESS,e.addressLength,e.addressEncoding),this.registerVectorType(e.vectorType),e.types&&e.types.structs)for(let t of Object.keys(e.types.structs))this.registerStructType(t,e.types.structs[t]);if(e.types&&e.types.enums)for(let t of Object.keys(e.types.enums))this.registerEnumType(t,e.types.enums[t]);if(e.types&&e.types.aliases)for(let t of Object.keys(e.types.aliases))this.registerAlias(t,e.types.aliases[t]);e.withPrimitives!==!1&&gn(this)}tempKey(){return`bcs-struct-${++this.counter}`}ser(e,t,r){if(typeof e=="string"||Array.isArray(e)){const{name:n,params:i}=this.parseTypeName(e);return this.getTypeInterface(n).encode(this,t,r,i)}if(typeof e=="object"){const n=this.tempKey();return new me(this).registerStructType(n,e).ser(n,t,r)}throw new Error(`Incorrect type passed into the '.ser()' function.
1
+ "use strict";var Tr=Object.defineProperty;var vr=(e,t,r)=>t in e?Tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var F=(e,t,r)=>vr(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const K=require("./index-5VUxPYxW.js"),ke=require("./sui-8bnax2uU.js"),Er=require("./unsignedTransaction-DzSLsK-p.js");class xr extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...a}=t,{path:o}=t,u=o.length===0?i:`At path: ${o.join(".")} -- ${i}`;super(s??u),s!=null&&(this.cause=u),Object.assign(this,a),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function jr(e){return z(e)&&typeof e[Symbol.iterator]=="function"}function z(e){return typeof e=="object"&&e!=null}function V(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function Ir(e){const{done:t,value:r}=e.next();return t?void 0:r}function Or(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:a}=r,{refinement:o,message:u=`Expected a value of type \`${a}\`${o?` with refinement \`${o}\``:""}, but received: \`${V(n)}\``}=e;return{value:n,type:a,refinement:o,key:i[i.length-1],path:i,branch:s,...e,message:u}}function*Nt(e,t,r,n){jr(e)||(e=[e]);for(const i of e){const s=Or(i,t,r,n);s&&(yield s)}}function*at(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:a=!1}=r,o={path:n,branch:i};if(s&&(e=t.coercer(e,o),a&&t.type!=="type"&&z(t.schema)&&z(e)&&!Array.isArray(e)))for(const d in e)t.schema[d]===void 0&&delete e[d];let u="valid";for(const d of t.validator(e,o))d.explanation=r.message,u="not_valid",yield[d,void 0];for(let[d,l,g]of t.entries(e,o)){const m=at(l,g,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,l],coerce:s,mask:a,message:r.message});for(const p of m)p[0]?(u=p[0].refinement!=null?"not_refined":"not_valid",yield[p[0],void 0]):s&&(l=p[1],d===void 0?e=l:e instanceof Map?e.set(d,l):e instanceof Set?e.add(l):z(e)&&(l!==void 0||d in e)&&(e[d]=l))}if(u!=="not_valid")for(const d of t.refiner(e,o))d.explanation=r.message,u="not_refined",yield[d,void 0];u==="valid"&&(yield[void 0,e])}class Y{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:a=u=>u,entries:o=function*(){}}=t;this.type=r,this.schema=n,this.entries=o,this.coercer=a,i?this.validator=(u,d)=>{const l=i(u,d);return Nt(l,d,this,u)}:this.validator=()=>[],s?this.refiner=(u,d)=>{const l=s(u,d);return Nt(l,d,this,u)}:this.refiner=()=>[]}assert(t,r){return Qe(t,this,r)}create(t,r){return Gt(t,this,r)}is(t){return N(t,this)}mask(t,r){return Ft(t,this,r)}validate(t,r={}){return xe(t,this,r)}}function Qe(e,t,r){const n=xe(e,t,{message:r});if(n[0])throw n[0]}function Gt(e,t,r){const n=xe(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Ft(e,t,r){const n=xe(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function N(e,t){return!xe(e,t)[0]}function xe(e,t,r={}){const n=at(e,t,r),i=Ir(n);return i[0]?[new xr(i[0],function*(){for(const a of n)a[0]&&(yield a[0])}),void 0]:[void 0,i[1]]}function be(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?kr(n):h(n)}function P(e,t){return new Y({type:e,schema:null,validator:t})}function et(){return P("any",()=>!0)}function v(e){return new Y({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer(t){return Array.isArray(t)?t.slice():t},validator(t){return Array.isArray(t)||`Expected an array value, but received: ${V(t)}`}})}function Ar(){return P("bigint",e=>typeof e=="bigint")}function U(){return P("boolean",e=>typeof e=="boolean")}function Z(){return P("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${V(e)}`)}function b(e){const t=V(e),r=typeof e;return new Y({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${V(n)}`}})}function Lt(){return P("never",()=>!1)}function O(e){return new Y({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function de(){return P("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${V(e)}`)}function h(e){const t=e?Object.keys(e):[],r=Lt();return new Y({type:"object",schema:e||null,*entries(n){if(e&&z(n)){const i=new Set(Object.keys(n));for(const s of t)i.delete(s),yield[s,n[s],e[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return z(n)||`Expected an object, but received: ${V(n)}`},coercer(n){return z(n)?{...n}:n}})}function w(e){return new Y({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function X(e,t){return new Y({type:"record",schema:null,*entries(r){if(z(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return z(r)||`Expected an object, but received: ${V(r)}`}})}function f(){return P("string",e=>typeof e=="string"||`Expected a string, but received: ${V(e)}`)}function Kt(e){const t=Lt();return new Y({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${V(r)}`}})}function kr(e){const t=Object.keys(e);return new Y({type:"type",schema:e,*entries(r){if(z(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return z(r)||`Expected an object, but received: ${V(r)}`},coercer(r){return z(r)?{...r}:r}})}function k(e){const t=e.map(r=>r.type).join(" | ");return new Y({type:"union",schema:null,coercer(r){for(const n of e){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of e){const[...a]=at(r,s,n),[o]=a;if(o[0])for(const[u]of a)u&&i.push(u);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${V(r)}`,...i]}})}function Wt(){return P("unknown",()=>!0)}const ot=k([h({AddressOwner:f()}),h({ObjectOwner:f()}),h({Shared:h({initial_shared_version:O(f())})}),b("Immutable")]);P("SuiJsonValue",()=>!0);const _r=k([h({u32:f()}),h({u64:f()}),h({f64:f()})]);h({attributes:X(f(),O(_r)),featureFlags:X(f(),U()),maxSupportedProtocolVersion:f(),minSupportedProtocolVersion:f(),protocolVersion:f()});k([f(),b("package")]);const ae=h({digest:f(),objectId:f(),version:k([de(),f(),Ar()])});h({owner:ot,reference:ae});h({objectId:f(),sequenceNumber:f()});h({payment:v(ae),owner:f(),price:f(),budget:f()});const Cr=be(ae,h({type:f(),owner:ot,previousTransaction:f()})),$r=X(f(),et()),Mr=X(f(),Wt()),Ur=h({type:f(),fields:$r,hasPublicTransfer:U()}),Br=h({disassembled:Mr}),Rr=k([be(Ur,h({dataType:b("moveObject")})),be(Br,h({dataType:b("package")}))]),Nr=h({type:f(),hasPublicTransfer:U(),version:f(),bcsBytes:f()}),Pr=h({id:f(),moduleMap:X(f(),f())}),Dr=k([be(Nr,h({dataType:b("moveObject")})),be(Pr,h({dataType:b("package")}))]);BigInt(1e9);const Jt=h({code:f(),error:w(f()),object_id:w(f()),parent_object_id:w(f()),version:w(f()),digest:w(f())}),zr=h({data:O(w(X(f(),f()))),error:O(w(Jt))}),Vr=k([zr,w(X(f(),f()))]),Ht=h({objectId:f(),version:f(),digest:f(),type:O(w(f())),content:O(w(Rr)),bcs:O(w(Dr)),owner:O(w(ot)),previousTransaction:O(w(f())),storageRebate:O(w(f())),display:O(w(Vr))});h({showType:O(w(U())),showContent:O(w(U())),showBcs:O(w(U())),showOwner:O(w(U())),showPreviousTransaction:O(w(U())),showStorageRebate:O(w(U())),showDisplay:O(w(U()))});k([b("Exists"),b("notExists"),b("Deleted")]);v(Cr);const Gr=h({data:O(w(Ht)),error:O(w(Jt))});function Fr(e){return e.data}function Lr(e){if(e.error&&"object_id"in e.error&&"version"in e.error&&"digest"in e.error){const t=e.error;return{objectId:t.object_id,version:t.version,digest:t.digest}}}function Pt(e){if("reference"in e)return e.reference;const t=Fr(e);return t?{objectId:t.objectId,version:t.version,digest:t.digest}:Lr(e)}h({objectId:f(),atCheckpoint:w(de())});h({data:v(Gr),nextCursor:w(O(f())),hasNextPage:U()});k([h({details:Ht,status:b("VersionFound")}),h({details:f(),status:b("ObjectNotExists")}),h({details:ae,status:b("ObjectDeleted")}),h({details:Kt([f(),de()]),status:b("VersionNotFound")}),h({details:h({asked_version:de(),latest_version:de(),object_id:f()}),status:b("VersionTooHigh")})]);const Kr=k([f(),h({Object:f()})]);v(Kr);const Wr=h({address:f(),name:f()}),Jr=k([b("Private"),b("Public"),b("Friend")]),ct=h({abilities:v(f())}),Hr=h({constraints:ct,isPhantom:U()}),Xr=h({TypeParameter:de()}),Ke=Kt([h({module:f(),package:f(),function:f()}),f()]);h({rank3Days:v(Ke),rank7Days:v(Ke),rank30Days:v(Ke)});function Xt(e){if(!e)return!1;if(typeof e=="string"||N(e,Xr)||qt(e))return!0;if(typeof e!="object")return!1;const t=e;return!!(N(t.Reference,he)||N(t.MutableReference,he)||N(t.Vector,he))}const he=P("SuiMoveNormalizedType",Xt);function qt(e){if(!e||typeof e!="object")return!1;const t=e;if(!t.Struct||typeof t.Struct!="object")return!1;const r=t.Struct;return!(typeof r.address!="string"||typeof r.module!="string"||typeof r.name!="string"||!Array.isArray(r.typeArguments)||!r.typeArguments.every(n=>Xt(n)))}P("SuiMoveNormalizedStructType",qt);const qr=h({visibility:Jr,isEntry:U(),typeParameters:v(ct),parameters:v(he),return:v(he)}),Zr=h({name:f(),type:he}),Yr=h({abilities:ct,typeParameters:v(Hr),fields:v(Zr)}),Qr=h({fileFormatVersion:de(),address:f(),name:f(),friends:v(Wr),structs:X(f(),Yr),exposedFunctions:X(f(),qr)});X(f(),Qr);function tt(e){return typeof e=="object"&&"MutableReference"in e?e.MutableReference:void 0}function Zt(e){return typeof e=="object"&&"Reference"in e?e.Reference:void 0}function ut(e){if(typeof e=="object"&&"Struct"in e)return e;const t=Zt(e),r=tt(e);if(typeof t=="object"&&"Struct"in t)return t;if(typeof r=="object"&&"Struct"in r)return r}function en(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),s=i.charCodeAt(0);if(t[s]!==255)throw new TypeError(i+" is ambiguous");t[s]=n}var a=e.length,o=e.charAt(0),u=Math.log(a)/Math.log(256),d=Math.log(256)/Math.log(a);function l(p){if(p instanceof Uint8Array||(ArrayBuffer.isView(p)?p=new Uint8Array(p.buffer,p.byteOffset,p.byteLength):Array.isArray(p)&&(p=Uint8Array.from(p))),!(p instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(p.length===0)return"";for(var y=0,S=0,E=0,A=p.length;E!==A&&p[E]===0;)E++,y++;for(var _=(A-E)*d+1>>>0,D=new Uint8Array(_);E!==A;){for(var q=p[E],ie=0,G=_-1;(q!==0||ie<S)&&G!==-1;G--,ie++)q+=256*D[G]>>>0,D[G]=q%a>>>0,q=q/a>>>0;if(q!==0)throw new Error("Non-zero carry");S=ie,E++}for(var Q=_-S;Q!==_&&D[Q]===0;)Q++;for(var Ae=o.repeat(y);Q<_;++Q)Ae+=e.charAt(D[Q]);return Ae}function g(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return new Uint8Array;for(var y=0,S=0,E=0;p[y]===o;)S++,y++;for(var A=(p.length-y)*u+1>>>0,_=new Uint8Array(A);p[y];){var D=t[p.charCodeAt(y)];if(D===255)return;for(var q=0,ie=A-1;(D!==0||q<E)&&ie!==-1;ie--,q++)D+=a*_[ie]>>>0,_[ie]=D%256>>>0,D=D/256>>>0;if(D!==0)throw new Error("Non-zero carry");E=q,y++}for(var G=A-E;G!==A&&_[G]===0;)G++;for(var Q=new Uint8Array(S+(A-G)),Ae=S;G!==A;)Q[Ae++]=_[G++];return Q}function m(p){var y=g(p);if(y)return y;throw new Error("Non-base"+a+" character")}return{encode:l,decodeUnsafe:g,decode:m}}var tn=en;const rn=tn,nn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var sn=rn(nn);const Yt=K.getDefaultExportFromCjs(sn),je=e=>Yt.encode(e),dt=e=>Yt.decode(e);function oe(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}const We=8192;function Ie(e){if(e.length<We)return btoa(String.fromCharCode(...e));let t="";for(var r=0;r<e.length;r+=We){const n=e.slice(r,r+We);t+=String.fromCharCode(...n)}return btoa(t)}function Fe(e){var i;const t=e.startsWith("0x")?e.slice(2):e,n=((i=(t.length%2===0?t:`0${t}}`).match(/.{2}/g))==null?void 0:i.map(s=>parseInt(s,16)))??[];return Uint8Array.from(n)}function Oe(e){return e.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}function ft(e){let t=[],r=0;if(e===0)return[0];for(;e>0;)t[r]=e&127,(e>>=7)&&(t[r]|=128),r+=1;return t}function an(e){let t=0,r=0,n=0;for(;;){let i=e[n];if(n+=1,t|=(i&127)<<r,!(i&128))break;r+=7}return{value:t,length:n}}class Qt{constructor(t){this.bytePosition=0,this.dataView=new DataView(t.buffer)}shift(t){return this.bytePosition+=t,this}read8(){let t=this.dataView.getUint8(this.bytePosition);return this.shift(1),t}read16(){let t=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),t}read32(){let t=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),t}read64(){let t=this.read32(),n=this.read32().toString(16)+t.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){let t=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+t.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}read256(){let t=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+t.toString(16).padStart(32,"0");return BigInt("0x"+n).toString(10)}readBytes(t){let r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,t);return this.shift(t),n}readULEB(){let t=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,t),{value:n,length:i}=an(r);return this.shift(i),n}readVec(t){let r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(t(this,i,r));return n}}function on(e,t){switch(t){case"base58":return je(e);case"base64":return Ie(e);case"hex":return Oe(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function cn(e,t){switch(t){case"base58":return dt(e);case"base64":return oe(e);case"hex":return Fe(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function er(e,t=["<",">"]){const[r,n]=t,i=[];let s="",a=0;for(let o=0;o<e.length;o++){const u=e[o];if(u===r&&a++,u===n&&a--,a===0&&u===","){i.push(s.trim()),s="";continue}s+=u}return i.push(s.trim()),i}class tr{constructor({size:t=1024,maxSize:r,allocateSize:n=1024}={}){this.bytePosition=0,this.size=t,this.maxSize=r||t,this.allocateSize=n,this.dataView=new DataView(new ArrayBuffer(t))}ensureSizeOrGrow(t){const r=this.bytePosition+t;if(r>this.size){const n=Math.min(this.maxSize,this.size+this.allocateSize);if(r>n)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${r}`);this.size=n;const i=new ArrayBuffer(this.size);new Uint8Array(i).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(i)}}shift(t){return this.bytePosition+=t,this}write8(t){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(t)),this.shift(1)}write16(t){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(t),!0),this.shift(2)}write32(t){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(t),!0),this.shift(4)}write64(t){return Je(BigInt(t),8).forEach(r=>this.write8(r)),this}write128(t){return Je(BigInt(t),16).forEach(r=>this.write8(r)),this}write256(t){return Je(BigInt(t),32).forEach(r=>this.write8(r)),this}writeULEB(t){return ft(t).forEach(r=>this.write8(r)),this}writeVec(t,r){return this.writeULEB(t.length),Array.from(t).forEach((n,i)=>r(this,n,i,t.length)),this}*[Symbol.iterator](){for(let t=0;t<this.bytePosition;t++)yield this.dataView.getUint8(t);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(t){return on(this.toBytes(),t)}}function Je(e,t){let r=new Uint8Array(t),n=0;for(;e>0;)r[n]=Number(e%BigInt(256)),e=e/BigInt(256),n+=1;return r}var rr=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},W=(e,t,r)=>(rr(e,t,"read from private field"),r?r.call(e):t.get(e)),Ne=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Pe=(e,t,r,n)=>(rr(e,t,"write to private field"),t.set(e,r),r),le,pe,Me,se;const nr=class{constructor(e){Ne(this,le,void 0),Ne(this,pe,void 0),this.name=e.name,this.read=e.read,this.serializedSize=e.serializedSize??(()=>null),Pe(this,le,e.write),Pe(this,pe,e.serialize??((t,r)=>{const n=new tr({size:this.serializedSize(t)??void 0,...r});return W(this,le).call(this,t,n),n.toBytes()})),this.validate=e.validate??(()=>{})}write(e,t){this.validate(e),W(this,le).call(this,e,t)}serialize(e,t){return this.validate(e),new un(this,W(this,pe).call(this,e,t))}parse(e){const t=new Qt(e);return this.read(t)}transform({name:e,input:t,output:r}){return new nr({name:e??this.name,read:n=>r(this.read(n)),write:(n,i)=>W(this,le).call(this,t(n),i),serializedSize:n=>this.serializedSize(t(n)),serialize:(n,i)=>W(this,pe).call(this,t(n),i),validate:n=>this.validate(t(n))})}};let J=nr;le=new WeakMap;pe=new WeakMap;const ir=Symbol.for("@mysten/serialized-bcs");function lt(e){return!!e&&typeof e=="object"&&e[ir]===!0}class un{constructor(t,r){Ne(this,Me,void 0),Ne(this,se,void 0),Pe(this,Me,t),Pe(this,se,r)}get[ir](){return!0}toBytes(){return W(this,se)}toHex(){return Oe(W(this,se))}toBase64(){return Ie(W(this,se))}toBase58(){return je(W(this,se))}parse(){return W(this,Me).parse(W(this,se))}}Me=new WeakMap;se=new WeakMap;function De({size:e,...t}){return new J({...t,serializedSize:()=>e})}function He({readMethod:e,writeMethod:t,...r}){return De({...r,read:n=>n[e](),write:(n,i)=>i[t](n),validate:n=>{var i;if(n<0||n>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${n}. Expected value in range 0-${r.maxValue}`);(i=r.validate)==null||i.call(r,n)}})}function Xe({readMethod:e,writeMethod:t,...r}){return De({...r,read:n=>n[e](),write:(n,i)=>i[t](BigInt(n)),validate:n=>{var s;const i=BigInt(n);if(i<0||i>r.maxValue)throw new TypeError(`Invalid ${r.name} value: ${i}. Expected value in range 0-${r.maxValue}`);(s=r.validate)==null||s.call(r,i)}})}function dn({serialize:e,...t}){const r=new J({...t,serialize:e,write:(n,i)=>{for(const s of r.serialize(n).toBytes())i.write8(s)}});return r}function fn({toBytes:e,fromBytes:t,...r}){return new J({...r,read:n=>{const i=n.readULEB(),s=n.readBytes(i);return t(s)},write:(n,i)=>{const s=e(n);i.writeULEB(s.length);for(let a=0;a<s.length;a++)i.write8(s[a])},serialize:n=>{const i=e(n),s=ft(i.length),a=new Uint8Array(s.length+i.length);return a.set(s,0),a.set(i,s.length),a},validate:n=>{var i;if(typeof n!="string")throw new TypeError(`Invalid ${r.name} value: ${n}. Expected string`);(i=r.validate)==null||i.call(r,n)}})}function ln(e){let t=null;function r(){return t||(t=e()),t}return new J({name:"lazy",read:n=>r().read(n),serializedSize:n=>r().serializedSize(n),write:(n,i)=>r().write(n,i),serialize:(n,i)=>r().serialize(n,i).toBytes()})}const c={u8(e){return He({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e})},u16(e){return He({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e})},u32(e){return He({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e})},u64(e){return Xe({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e})},u128(e){return Xe({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e})},u256(e){return Xe({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e})},bool(e){return De({name:"bool",size:1,read:t=>t.read8()===1,write:(t,r)=>r.write8(t?1:0),...e,validate:t=>{var r;if((r=e==null?void 0:e.validate)==null||r.call(e,t),typeof t!="boolean")throw new TypeError(`Expected boolean, found ${typeof t}`)}})},uleb128(e){return dn({name:"uleb128",read:t=>t.readULEB(),serialize:t=>Uint8Array.from(ft(t)),...e})},bytes(e,t){return De({name:`bytes[${e}]`,size:e,read:r=>r.readBytes(e),write:(r,n)=>{for(let i=0;i<e;i++)n.write8(r[i]??0)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e)throw new TypeError(`Expected array of length ${e}, found ${r.length}`)}})},string(e){return fn({name:"string",toBytes:t=>new TextEncoder().encode(t),fromBytes:t=>new TextDecoder().decode(t),...e})},fixedArray(e,t,r){return new J({name:`${t.name}[${e}]`,read:n=>{const i=new Array(e);for(let s=0;s<e;s++)i[s]=t.read(n);return i},write:(n,i)=>{for(const s of n)t.write(s,i)},...r,validate:n=>{var i;if((i=r==null?void 0:r.validate)==null||i.call(r,n),!("length"in n))throw new TypeError(`Expected array, found ${typeof n}`);if(n.length!==e)throw new TypeError(`Expected array of length ${e}, found ${n.length}`)}})},option(e){return c.enum(`Option<${e.name}>`,{None:null,Some:e}).transform({input:t=>t==null?{None:!0}:{Some:t},output:t=>"Some"in t?t.Some:null})},vector(e,t){return new J({name:`vector<${e.name}>`,read:r=>{const n=r.readULEB(),i=new Array(n);for(let s=0;s<n;s++)i[s]=e.read(r);return i},write:(r,n)=>{n.writeULEB(r.length);for(const i of r)e.write(i,n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`)}})},tuple(e,t){return new J({name:`(${e.map(r=>r.name).join(", ")})`,serializedSize:r=>{let n=0;for(let i=0;i<e.length;i++){const s=e[i].serializedSize(r[i]);if(s==null)return null;n+=s}return n},read:r=>{const n=[];for(const i of e)n.push(i.read(r));return n},write:(r,n)=>{for(let i=0;i<e.length;i++)e[i].write(r[i],n)},...t,validate:r=>{var n;if((n=t==null?void 0:t.validate)==null||n.call(t,r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==e.length)throw new TypeError(`Expected array of length ${e.length}, found ${r.length}`)}})},struct(e,t,r){const n=Object.entries(t);return new J({name:e,serializedSize:i=>{let s=0;for(const[a,o]of n){const u=o.serializedSize(i[a]);if(u==null)return null;s+=u}return s},read:i=>{const s={};for(const[a,o]of n)s[a]=o.read(i);return s},write:(i,s)=>{for(const[a,o]of n)o.write(i[a],s)},...r,validate:i=>{var s;if((s=r==null?void 0:r.validate)==null||s.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`)}})},enum(e,t,r){const n=Object.entries(t);return new J({name:e,read:i=>{const s=i.readULEB(),[a,o]=n[s];return{[a]:(o==null?void 0:o.read(i))??!0}},write:(i,s)=>{const[a,o]=Object.entries(i)[0];for(let u=0;u<n.length;u++){const[d,l]=n[u];if(d===a){s.writeULEB(u),l==null||l.write(o,s);return}}},...r,validate:i=>{var o;if((o=r==null?void 0:r.validate)==null||o.call(r,i),typeof i!="object"||i==null)throw new TypeError(`Expected object, found ${typeof i}`);const s=Object.keys(i);if(s.length!==1)throw new TypeError(`Expected object with one key, found ${s.length}`);const[a]=s;if(!Object.hasOwn(t,a))throw new TypeError(`Invalid enum variant ${a}`)}})},map(e,t){return c.vector(c.tuple([e,t])).transform({name:`Map<${e.name}, ${t.name}>`,input:r=>[...r.entries()],output:r=>{const n=new Map;for(const[i,s]of r)n.set(i,s);return n}})},generic(e,t){return(...r)=>t(...r).transform({name:`${t.name}<${r.map(n=>n.name).join(", ")}>`,input:n=>n,output:n=>n})},lazy(e){return ln(e)}},hn=32,me=class{constructor(e){if(this.types=new Map,this.counter=0,e instanceof me){this.schema=e.schema,this.types=new Map(e.types);return}if(this.schema=e,this.registerAddressType(me.ADDRESS,e.addressLength,e.addressEncoding),this.registerVectorType(e.vectorType),e.types&&e.types.structs)for(let t of Object.keys(e.types.structs))this.registerStructType(t,e.types.structs[t]);if(e.types&&e.types.enums)for(let t of Object.keys(e.types.enums))this.registerEnumType(t,e.types.enums[t]);if(e.types&&e.types.aliases)for(let t of Object.keys(e.types.aliases))this.registerAlias(t,e.types.aliases[t]);e.withPrimitives!==!1&&gn(this)}tempKey(){return`bcs-struct-${++this.counter}`}ser(e,t,r){if(typeof e=="string"||Array.isArray(e)){const{name:n,params:i}=this.parseTypeName(e);return this.getTypeInterface(n).encode(this,t,r,i)}if(typeof e=="object"){const n=this.tempKey();return new me(this).registerStructType(n,e).ser(n,t,r)}throw new Error(`Incorrect type passed into the '.ser()' function.
2
2
  ${JSON.stringify(e)}`)}de(e,t,r){if(typeof t=="string")if(r)t=cn(t,r);else throw new Error("To pass a string to `bcs.de`, specify encoding");if(typeof e=="string"||Array.isArray(e)){const{name:n,params:i}=this.parseTypeName(e);return this.getTypeInterface(n).decode(this,t,i)}if(typeof e=="object"){const n=new me(this),i=this.tempKey();return n.registerStructType(i,e).de(i,t,r)}throw new Error(`Incorrect type passed into the '.de()' function.
3
3
  ${JSON.stringify(e)}`)}hasType(e){return this.types.has(e)}registerAlias(e,t){return this.types.set(e,t),this}registerType(e,t,r,n=()=>!0){const{name:i,params:s}=this.parseTypeName(e);return this.types.set(i,{encode(a,o,u,d){const l=s.reduce((g,m,p)=>Object.assign(g,{[m]:d[p]}),{});return this._encodeRaw.call(a,new tr(u),o,d,l)},decode(a,o,u){const d=s.reduce((l,g,m)=>Object.assign(l,{[g]:u[m]}),{});return this._decodeRaw.call(a,new Qt(o),u,d)},_encodeRaw(a,o,u,d){if(n(o))return t.call(this,a,o,u,d);throw new Error(`Validation failed for type ${i}, data: ${o}`)},_decodeRaw(a,o,u){return r.call(this,a,o,u)}}),this}registerBcsType(e,t){return this.registerType(e,(r,n,i)=>{const s=i.map(a=>new J({name:String(a),write:(o,u)=>{const{name:d,params:l}=this.parseTypeName(a),g=this.getTypeInterface(d),m=l.reduce((p,y,S)=>Object.assign(p,{[y]:i[S]}),{});return g._encodeRaw.call(this,u,o,l,m)},read:()=>{throw new Error("Not implemented")}}));return t(...s).write(n,r),r},(r,n)=>{const i=n.map(s=>new J({name:String(s),write:(a,o)=>{throw new Error("Not implemented")},read:a=>{const{name:o,params:u}=this.parseTypeName(s),d=this.getTypeInterface(o),l=u.reduce((g,m,p)=>Object.assign(g,{[m]:n[p]}),{});return d._decodeRaw.call(this,a,u,l)}}));return t(...i).read(r)}),this}registerAddressType(e,t,r="hex"){switch(r){case"base64":return this.registerType(e,function(i,s){return oe(s).reduce((a,o)=>a.write8(o),i)},function(i){return Ie(i.readBytes(t))});case"hex":return this.registerType(e,function(i,s){return Fe(s).reduce((a,o)=>a.write8(o),i)},function(i){return Oe(i.readBytes(t))});default:throw new Error("Unsupported encoding! Use either hex or base64")}}registerVectorType(e){let{name:t,params:r}=this.parseTypeName(e);if(r.length>1)throw new Error("Vector can have only one type parameter; got "+t);return this.registerType(e,function(i,s,a,o){return i.writeVec(s,(u,d)=>{let l=a[0];if(!l)throw new Error(`Incorrect number of type parameters passed a to vector '${e}'`);let{name:g,params:m}=this.parseTypeName(l);if(this.hasType(g))return this.getTypeInterface(g)._encodeRaw.call(this,u,d,m,o);if(!(g in o))throw new Error(`Unable to find a matching type definition for ${g} in vector; make sure you passed a generic`);let{name:p,params:y}=this.parseTypeName(o[g]);return this.getTypeInterface(p)._encodeRaw.call(this,u,d,y,o)})},function(i,s,a){return i.readVec(o=>{let u=s[0];if(!u)throw new Error(`Incorrect number of type parameters passed to a vector '${e}'`);let{name:d,params:l}=this.parseTypeName(u);if(this.hasType(d))return this.getTypeInterface(d)._decodeRaw.call(this,o,l,a);if(!(d in a))throw new Error(`Unable to find a matching type definition for ${d} in vector; make sure you passed a generic`);let{name:g,params:m}=this.parseTypeName(a[d]);return this.getTypeInterface(g)._decodeRaw.call(this,o,m,a)})})}registerStructType(e,t){for(let a in t){let o=this.tempKey(),u=t[a];!Array.isArray(u)&&typeof u!="string"&&(t[a]=o,this.registerStructType(o,u))}let r=Object.freeze(t),n=Object.keys(r),{name:i,params:s}=this.parseTypeName(e);return this.registerType(e,function(o,u,d,l){if(!u||u.constructor!==Object)throw new Error(`Expected ${i} to be an Object, got: ${u}`);if(d.length!==s.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${s.length}, got: ${d.length}`);for(let g of n){if(!(g in u))throw new Error(`Struct ${i} requires field ${g}:${r[g]}`);const{name:m,params:p}=this.parseTypeName(r[g]);if(!s.includes(m))this.getTypeInterface(m)._encodeRaw.call(this,o,u[g],p,l);else{const y=s.indexOf(m);let{name:S,params:E}=this.parseTypeName(d[y]);if(this.hasType(S)){this.getTypeInterface(S)._encodeRaw.call(this,o,u[g],E,l);continue}if(!(S in l))throw new Error(`Unable to find a matching type definition for ${S} in ${i}; make sure you passed a generic`);let{name:A,params:_}=this.parseTypeName(l[S]);this.getTypeInterface(A)._encodeRaw.call(this,o,u[g],_,l)}}return o},function(o,u,d){if(u.length!==s.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${s.length}, got: ${u.length}`);let l={};for(let g of n){const{name:m,params:p}=this.parseTypeName(r[g]);if(!s.includes(m))l[g]=this.getTypeInterface(m)._decodeRaw.call(this,o,p,d);else{const y=s.indexOf(m);let{name:S,params:E}=this.parseTypeName(u[y]);if(this.hasType(S)){l[g]=this.getTypeInterface(S)._decodeRaw.call(this,o,E,d);continue}if(!(S in d))throw new Error(`Unable to find a matching type definition for ${S} in ${i}; make sure you passed a generic`);let{name:A,params:_}=this.parseTypeName(d[S]);l[g]=this.getTypeInterface(A)._decodeRaw.call(this,o,_,d)}}return l})}registerEnumType(e,t){for(let a in t){let o=this.tempKey(),u=t[a];u!==null&&!Array.isArray(u)&&typeof u!="string"&&(t[a]=o,this.registerStructType(o,u))}let r=Object.freeze(t),n=Object.keys(r),{name:i,params:s}=this.parseTypeName(e);return this.registerType(e,function(o,u,d,l){if(!u)throw new Error(`Unable to write enum "${i}", missing data.
4
4
  Received: "${u}"`);if(typeof u!="object")throw new Error(`Incorrect data passed into enum "${i}", expected object with properties: "${n.join(" | ")}".
@@ -1,9 +1,9 @@
1
1
  var Zr = Object.defineProperty;
2
2
  var Yr = (t, e, r) => e in t ? Zr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
3
  var M = (t, e, r) => Yr(t, typeof e != "symbol" ? e + "" : e, r);
4
- import { X as Qr, y as en, ck as ft, I as tn, cl as hr, cm as ke, b8 as rn, bA as nt, bB as nr, bd as nn, b6 as ce, K as ge, m as oe, ba as sn, bG as ir, bD as an, cn as on, be as ht, H as cn, r as De, c9 as un, bR as sr, co as dn, J as ar, bj as gr } from "./index-CYBM2IeY.mjs";
5
- import { g as tt, a as gt, i as Ve, S as Q, b as H, p as ln, c as fn, d as it, u as ze, e as pr, f as hn, h as He, j as gn, k as pn } from "./sui-1fbLRIUL.mjs";
6
- import "./index-lHA40g0z.mjs";
4
+ import { X as Qr, y as en, ck as ft, I as tn, cl as hr, cm as ke, b8 as rn, bA as nt, bB as nr, bd as nn, b6 as ce, K as ge, m as oe, ba as sn, bG as ir, bD as an, cn as on, be as ht, H as cn, r as De, c9 as un, bR as sr, co as dn, J as ar, bj as gr } from "./index-qAojYF7t.mjs";
5
+ import { g as tt, a as gt, i as Ve, S as Q, b as H, p as ln, c as fn, d as it, u as ze, e as pr, f as hn, h as He, j as gn, k as pn } from "./sui-n-MTTZiA.mjs";
6
+ import "./index-B2wyWEm0.mjs";
7
7
  import { S as yr } from "./unsignedTransaction-BD81leu1.mjs";
8
8
  class yn extends TypeError {
9
9
  constructor(e, r) {
@@ -1 +1 @@
1
- "use strict";var v=Object.defineProperty;var y=(b,e,t)=>e in b?v(b,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):b[e]=t;var i=(b,e,t)=>y(b,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./chunk-IMTC3J2M-ByR5Yjf4.js"),c=require("./index-DZvLy2Dr.js"),k=require("./aptos-7G9wZkGW.js"),M=require("./unsignedTransaction-C1YeEl4G.js"),x=[["Mainnet",{depositForBurn:"0xa11ceb0b0700000a0701000802080e031614042a04052e30075e870108e5014000000001000201030004000001050701000100060b0001070304010801020805060108010309080900010002010205060c030e05050208000b010108020108020105010b0101090003060c0b01010900030108000004060c08000e0501030e66756e6769626c655f6173736574066f626a656374167072696d6172795f66756e6769626c655f73746f72650f746f6b656e5f6d657373656e6765720d46756e6769626c654173736574064f626a656374084d6574616461746111616464726573735f746f5f6f626a656374087769746864726177106465706f7369745f666f725f6275726e00000000000000000000000000000000000000000000000000000000000000019bce6734f7b63e835108e3bd8c36743d4709fe435f44791918801d0989640a9d0000010f0b0438000c060a000b060b0138010c050b000b050b020b0311020102",handleReceiveMessage:"0xa11ceb0b0700000a0601000402040403080c051416072a53087d40000001010002000000030203000101040304000103060c0a020a020003060c060a02060a020108000101136d6573736167655f7472616e736d69747465720f746f6b656e5f6d657373656e67657207526563656970740f726563656976655f6d6573736167651668616e646c655f726563656976655f6d657373616765177e17751820e4b4371873ca8c30279be63bdea63b88ed0f2239c2eea10f17729bce6734f7b63e835108e3bd8c36743d4709fe435f44791918801d0989640a9d000001070b000e010e02110011010102"}],["Testnet",{depositForBurn:"0xa11ceb0b0700000a0701000802080e031614042a04052e30075e870108e5014000000001000201030004000001050701000100060b0001070304010801020805060108010309080900010002010205060c030e05050208000b010108020108020105010b0101090003060c0b01010900030108000004060c08000e0501030e66756e6769626c655f6173736574066f626a656374167072696d6172795f66756e6769626c655f73746f72650f746f6b656e5f6d657373656e6765720d46756e6769626c654173736574064f626a656374084d6574616461746111616464726573735f746f5f6f626a656374087769746864726177106465706f7369745f666f725f6275726e00000000000000000000000000000000000000000000000000000000000000015f9b937419dda90aa06c1836b7847f65bbbe3f1217567758dc2488be31a477b90000010f0b0438000c060a000b060b0138010c050b000b050b020b0311020102",handleReceiveMessage:"0xa11ceb0b0700000a0601000402040403080c051416072a53087d40000001010002000000030203000101040304000103060c0a020a020003060c060a02060a020108000101136d6573736167655f7472616e736d69747465720f746f6b656e5f6d657373656e67657207526563656970740f726563656976655f6d6573736167651668616e646c655f726563656976655f6d657373616765081e86cebf457a0c6004f35bd648a2794698f52e0dde09a48619dcd3d4cc23d95f9b937419dda90aa06c1836b7847f65bbbe3f1217567758dc2488be31a477b9000001070b000e010e02110011010102"}]],u=c.constMap(x,[0,1]);class h{constructor(e,t,n,s){i(this,"network");i(this,"chain");i(this,"provider");i(this,"contracts");i(this,"usdcId");i(this,"tokenMessengerId");i(this,"messageTransmitterId");i(this,"moveScripts");var a,f,o;if(this.network=e,this.chain=t,this.provider=n,this.contracts=s,e==="Devnet")throw new Error("CircleBridge not supported on Devnet");const r=c.usdcContract.get(this.network,this.chain);if(!r)throw new Error(`No USDC contract configured for network=${this.network} chain=${this.chain}`);if(!((a=s.cctp)!=null&&a.tokenMessenger))throw new Error(`Circle Token Messenger contract for domain ${t} not found`);if(!((f=s.cctp)!=null&&f.messageTransmitter))throw new Error(`Circle Message Transmitter contract for domain ${t} not found`);if(!u.has(e))throw new Error("No Aptos CCTP move scripts found");this.usdcId=r,this.tokenMessengerId=(o=s.cctp)==null?void 0:o.tokenMessenger,this.messageTransmitterId=s.cctp.messageTransmitter,this.moveScripts=u.get(e)}async*transfer(e,t,n){const s=new d.y$2(c.circleChainId.get(this.network,t.chain)),r=d.l.from(this.usdcId),a=d.l.from(t.address.toUniversalAddress().toUint8Array()),f=[new d.m$1(n),s,a,r],o={bytecode:this.moveScripts.depositForBurn,functionArguments:f};yield this.createUnsignedTx(o,"Aptos.CircleBridge.Transfer")}async isTransferCompleted(e){const t=new d.y$2(e.sourceDomain).bcsToBytes(),n=new d.m$1(e.nonce).bcsToBytes(),s=c.keccak_256(new Uint8Array([...t,45,...n])),r=c.hex.encode(s);return(await this.provider.view({payload:{function:`${this.messageTransmitterId}::message_transmitter::is_nonce_used`,functionArguments:[r]}}))[0]}async*redeem(e,t,n){const s=[d.t$4.U8(c.CircleBridge.serialize(t)),d.t$4.U8(c.hex.decode(n))],r={bytecode:this.moveScripts.handleReceiveMessage,functionArguments:s};yield this.createUnsignedTx(r,"Aptos.CircleBridge.Redeem")}async parseTransactionDetails(e){var g;const t=await this.provider.getTransactionByHash({transactionHash:e}),n=this.messageTransmitterId.replace(/^0x0+/,"0x"),s=(g=t.events)==null?void 0:g.find(C=>C.type===`${n}::message_transmitter::MessageSent`);if(!s)throw new Error("No MessageSent event found");const r=c.hex.decode(s.data.message),[a,f]=c.CircleBridge.deserialize(r),{payload:o}=a,p=o.messageSender,l=o.mintRecipient,m=c.toCircleChain(this.network,a.sourceDomain),w=c.toCircleChain(this.network,a.destinationDomain),T={chain:m,address:o.burnToken};return{from:{chain:m,address:p},to:{chain:w,address:l},token:T,amount:o.amount,message:a,id:{hash:f}}}static async fromRpc(e,t){const[n,s]=await k.AptosPlatform.chainFromRpc(e),r=t[s];if(r.network!==n)throw new Error(`Network mismatch: ${r.network} != ${n}`);return new h(n,s,e,r.contracts)}createUnsignedTx(e,t,n=!1){return new M.AptosUnsignedTransaction(e,this.network,this.chain,t,n)}}c.registerProtocol("Aptos","CircleBridge",h);exports.AptosCircleBridge=h;
1
+ "use strict";var v=Object.defineProperty;var y=(b,e,t)=>e in b?v(b,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):b[e]=t;var i=(b,e,t)=>y(b,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./chunk-IMTC3J2M-CBauIJwr.js"),c=require("./index-5VUxPYxW.js"),k=require("./aptos-D3_AGWR7.js"),M=require("./unsignedTransaction-C1YeEl4G.js"),x=[["Mainnet",{depositForBurn:"0xa11ceb0b0700000a0701000802080e031614042a04052e30075e870108e5014000000001000201030004000001050701000100060b0001070304010801020805060108010309080900010002010205060c030e05050208000b010108020108020105010b0101090003060c0b01010900030108000004060c08000e0501030e66756e6769626c655f6173736574066f626a656374167072696d6172795f66756e6769626c655f73746f72650f746f6b656e5f6d657373656e6765720d46756e6769626c654173736574064f626a656374084d6574616461746111616464726573735f746f5f6f626a656374087769746864726177106465706f7369745f666f725f6275726e00000000000000000000000000000000000000000000000000000000000000019bce6734f7b63e835108e3bd8c36743d4709fe435f44791918801d0989640a9d0000010f0b0438000c060a000b060b0138010c050b000b050b020b0311020102",handleReceiveMessage:"0xa11ceb0b0700000a0601000402040403080c051416072a53087d40000001010002000000030203000101040304000103060c0a020a020003060c060a02060a020108000101136d6573736167655f7472616e736d69747465720f746f6b656e5f6d657373656e67657207526563656970740f726563656976655f6d6573736167651668616e646c655f726563656976655f6d657373616765177e17751820e4b4371873ca8c30279be63bdea63b88ed0f2239c2eea10f17729bce6734f7b63e835108e3bd8c36743d4709fe435f44791918801d0989640a9d000001070b000e010e02110011010102"}],["Testnet",{depositForBurn:"0xa11ceb0b0700000a0701000802080e031614042a04052e30075e870108e5014000000001000201030004000001050701000100060b0001070304010801020805060108010309080900010002010205060c030e05050208000b010108020108020105010b0101090003060c0b01010900030108000004060c08000e0501030e66756e6769626c655f6173736574066f626a656374167072696d6172795f66756e6769626c655f73746f72650f746f6b656e5f6d657373656e6765720d46756e6769626c654173736574064f626a656374084d6574616461746111616464726573735f746f5f6f626a656374087769746864726177106465706f7369745f666f725f6275726e00000000000000000000000000000000000000000000000000000000000000015f9b937419dda90aa06c1836b7847f65bbbe3f1217567758dc2488be31a477b90000010f0b0438000c060a000b060b0138010c050b000b050b020b0311020102",handleReceiveMessage:"0xa11ceb0b0700000a0601000402040403080c051416072a53087d40000001010002000000030203000101040304000103060c0a020a020003060c060a02060a020108000101136d6573736167655f7472616e736d69747465720f746f6b656e5f6d657373656e67657207526563656970740f726563656976655f6d6573736167651668616e646c655f726563656976655f6d657373616765081e86cebf457a0c6004f35bd648a2794698f52e0dde09a48619dcd3d4cc23d95f9b937419dda90aa06c1836b7847f65bbbe3f1217567758dc2488be31a477b9000001070b000e010e02110011010102"}]],u=c.constMap(x,[0,1]);class h{constructor(e,t,n,s){i(this,"network");i(this,"chain");i(this,"provider");i(this,"contracts");i(this,"usdcId");i(this,"tokenMessengerId");i(this,"messageTransmitterId");i(this,"moveScripts");var a,f,o;if(this.network=e,this.chain=t,this.provider=n,this.contracts=s,e==="Devnet")throw new Error("CircleBridge not supported on Devnet");const r=c.usdcContract.get(this.network,this.chain);if(!r)throw new Error(`No USDC contract configured for network=${this.network} chain=${this.chain}`);if(!((a=s.cctp)!=null&&a.tokenMessenger))throw new Error(`Circle Token Messenger contract for domain ${t} not found`);if(!((f=s.cctp)!=null&&f.messageTransmitter))throw new Error(`Circle Message Transmitter contract for domain ${t} not found`);if(!u.has(e))throw new Error("No Aptos CCTP move scripts found");this.usdcId=r,this.tokenMessengerId=(o=s.cctp)==null?void 0:o.tokenMessenger,this.messageTransmitterId=s.cctp.messageTransmitter,this.moveScripts=u.get(e)}async*transfer(e,t,n){const s=new d.y$2(c.circleChainId.get(this.network,t.chain)),r=d.l.from(this.usdcId),a=d.l.from(t.address.toUniversalAddress().toUint8Array()),f=[new d.m$1(n),s,a,r],o={bytecode:this.moveScripts.depositForBurn,functionArguments:f};yield this.createUnsignedTx(o,"Aptos.CircleBridge.Transfer")}async isTransferCompleted(e){const t=new d.y$2(e.sourceDomain).bcsToBytes(),n=new d.m$1(e.nonce).bcsToBytes(),s=c.keccak_256(new Uint8Array([...t,45,...n])),r=c.hex.encode(s);return(await this.provider.view({payload:{function:`${this.messageTransmitterId}::message_transmitter::is_nonce_used`,functionArguments:[r]}}))[0]}async*redeem(e,t,n){const s=[d.t$4.U8(c.CircleBridge.serialize(t)),d.t$4.U8(c.hex.decode(n))],r={bytecode:this.moveScripts.handleReceiveMessage,functionArguments:s};yield this.createUnsignedTx(r,"Aptos.CircleBridge.Redeem")}async parseTransactionDetails(e){var g;const t=await this.provider.getTransactionByHash({transactionHash:e}),n=this.messageTransmitterId.replace(/^0x0+/,"0x"),s=(g=t.events)==null?void 0:g.find(C=>C.type===`${n}::message_transmitter::MessageSent`);if(!s)throw new Error("No MessageSent event found");const r=c.hex.decode(s.data.message),[a,f]=c.CircleBridge.deserialize(r),{payload:o}=a,p=o.messageSender,l=o.mintRecipient,m=c.toCircleChain(this.network,a.sourceDomain),w=c.toCircleChain(this.network,a.destinationDomain),T={chain:m,address:o.burnToken};return{from:{chain:m,address:p},to:{chain:w,address:l},token:T,amount:o.amount,message:a,id:{hash:f}}}static async fromRpc(e,t){const[n,s]=await k.AptosPlatform.chainFromRpc(e),r=t[s];if(r.network!==n)throw new Error(`Network mismatch: ${r.network} != ${n}`);return new h(n,s,e,r.contracts)}createUnsignedTx(e,t,n=!1){return new M.AptosUnsignedTransaction(e,this.network,this.chain,t,n)}}c.registerProtocol("Aptos","CircleBridge",h);exports.AptosCircleBridge=h;
@@ -1 +1 @@
1
- "use strict";var h=Object.defineProperty;var m=(a,e,r)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var o=(a,e,r)=>m(a,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-DZvLy2Dr.js"),u=require("./sui-K20aVxqE.js");class d{constructor(e,r,t,n){o(this,"network");o(this,"chain");o(this,"provider");o(this,"contracts");o(this,"chainId");o(this,"coreBridgePackageId");this.network=e,this.chain=r,this.provider=t,this.contracts=n,this.chainId=c.toChainId(r);const s=n.coreBridge;if(!s)throw new Error(`CoreBridge contract Address for chain ${r} not found`);this.coreBridgePackageId=s}getGuardianSet(e){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,r){const[t,n]=await u.SuiPlatform.chainFromRpc(e),s=r[n];if(s.network!==t)throw new Error(`Network mismatch: ${s.network} !== ${t}`);return new d(t,n,e,s.contracts)}async*verifyMessage(e,r){throw new Error("Method not implemented.")}async*publishMessage(e,r){throw new Error("Method not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(t=>({emitter:t.emitterAddress,sequence:t.sequence,chain:this.chain}))}async getGuardianSetIndex(){throw new Error("Method not implemented.")}async parseMessages(e){var n;const t=(n=(await this.provider.getTransactionBlock({digest:e,options:{showEvents:!0,showEffects:!0,showInput:!0}})).events)==null?void 0:n.filter(s=>s.type.endsWith("WormholeMessage"));if(!t||t.length==0)throw new Error("WormholeMessage not found");return t.map(s=>{const i=s.parsedJson;return c.createVAA("Uint8Array",{emitterChain:this.chain,emitterAddress:new c.SuiAddress(i.sender).toUniversalAddress(),sequence:BigInt(i.sequence),guardianSet:0,timestamp:Number(i.timestamp),consistencyLevel:i.consistency_level,nonce:i.nonce,signatures:[],payload:new Uint8Array(i.payload)})})}}c.registerProtocol("Sui","WormholeCore",d);exports.SuiWormholeCore=d;
1
+ "use strict";var h=Object.defineProperty;var m=(a,e,r)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[e]=r;var o=(a,e,r)=>m(a,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-5VUxPYxW.js"),u=require("./sui-8bnax2uU.js");class d{constructor(e,r,t,n){o(this,"network");o(this,"chain");o(this,"provider");o(this,"contracts");o(this,"chainId");o(this,"coreBridgePackageId");this.network=e,this.chain=r,this.provider=t,this.contracts=n,this.chainId=c.toChainId(r);const s=n.coreBridge;if(!s)throw new Error(`CoreBridge contract Address for chain ${r} not found`);this.coreBridgePackageId=s}getGuardianSet(e){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,r){const[t,n]=await u.SuiPlatform.chainFromRpc(e),s=r[n];if(s.network!==t)throw new Error(`Network mismatch: ${s.network} !== ${t}`);return new d(t,n,e,s.contracts)}async*verifyMessage(e,r){throw new Error("Method not implemented.")}async*publishMessage(e,r){throw new Error("Method not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(t=>({emitter:t.emitterAddress,sequence:t.sequence,chain:this.chain}))}async getGuardianSetIndex(){throw new Error("Method not implemented.")}async parseMessages(e){var n;const t=(n=(await this.provider.getTransactionBlock({digest:e,options:{showEvents:!0,showEffects:!0,showInput:!0}})).events)==null?void 0:n.filter(s=>s.type.endsWith("WormholeMessage"));if(!t||t.length==0)throw new Error("WormholeMessage not found");return t.map(s=>{const i=s.parsedJson;return c.createVAA("Uint8Array",{emitterChain:this.chain,emitterAddress:new c.SuiAddress(i.sender).toUniversalAddress(),sequence:BigInt(i.sequence),guardianSet:0,timestamp:Number(i.timestamp),consistencyLevel:i.consistency_level,nonce:i.nonce,signatures:[],payload:new Uint8Array(i.payload)})})}}c.registerProtocol("Sui","WormholeCore",d);exports.SuiWormholeCore=d;
@@ -1,4 +1,4 @@
1
- import { c5 as J, cv as Z } from "./index-CYBM2IeY.mjs";
1
+ import { c5 as J, cv as Z } from "./index-qAojYF7t.mjs";
2
2
  const j = "logger/5.7.0";
3
3
  let F = !1, k = !1;
4
4
  const U = { debug: 1, default: 2, info: 2, warning: 3, error: 4, off: 5 };
@@ -1,6 +1,6 @@
1
- import { s as ce, T as N, o as ot, n as _t, R as Do, t as H, y as gt, a as C, p as K } from "./index-DECw2aR6.mjs";
1
+ import { s as ce, T as N, o as ot, n as _t, R as Do, t as H, y as gt, a as C, p as K } from "./index-FVwpVvZ7.mjs";
2
2
  import { d as Uo } from "./dijkstra-BZM-8g-B.mjs";
3
- import { V as Wo } from "./index-CYBM2IeY.mjs";
3
+ import { V as Wo } from "./index-qAojYF7t.mjs";
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2019 Google LLC
@@ -1 +1 @@
1
- "use strict";var h=Object.defineProperty;var m=(a,e,t)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var s=(a,e,t)=>m(a,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-DZvLy2Dr.js"),w=require("./aptos-7G9wZkGW.js");class c{constructor(e,t,r,o){s(this,"network");s(this,"chain");s(this,"connection");s(this,"contracts");s(this,"chainId");s(this,"coreBridge");this.network=e,this.chain=t,this.connection=r,this.contracts=o,this.chainId=i.toChainId(t);const n=o.coreBridge;if(!n)throw new Error(`CoreBridge contract Address for chain ${t} not found`);this.coreBridge=n}getGuardianSet(e){throw new Error("Method not implemented.")}getGuardianSetIndex(){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,t){const[r,o]=await w.AptosPlatform.chainFromRpc(e),n=t[o];if(n.network!==r)throw new Error(`Network mismatch: ${n.network} !== ${r}`);return new c(r,o,e,n.contracts)}async*publishMessage(e,t){throw new Error("Method not implemented.")}async*verifyMessage(e,t){throw new Error("Not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(r=>({chain:r.emitterChain,emitter:r.emitterAddress,sequence:r.sequence}))}async parseMessages(e){const t=await this.connection.getTransactionByHash({transactionHash:e});if(t.type!=="user_transaction")throw new Error(`${e} is not a user_transaction`);const r=t.events.filter(o=>o.type.endsWith("WormholeMessage"));if(!r||r.length===0)throw new Error(`WormholeMessage not found for ${e}`);return r.map(o=>{const n=o.data,d=new i.UniversalAddress(BigInt(n.sender).toString(16).padStart(64,"0"));return i.createVAA("Uint8Array",{guardianSet:0,emitterChain:this.chain,emitterAddress:d,sequence:BigInt(n.sequence),timestamp:Number(n.timestamp),consistencyLevel:n.consistency_level,nonce:Number(n.nonce),signatures:[],payload:i.hex.decode(n.payload)})})}}i.registerProtocol("Aptos","WormholeCore",c);exports.AptosWormholeCore=c;
1
+ "use strict";var h=Object.defineProperty;var m=(a,e,t)=>e in a?h(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var s=(a,e,t)=>m(a,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-5VUxPYxW.js"),w=require("./aptos-D3_AGWR7.js");class c{constructor(e,t,r,o){s(this,"network");s(this,"chain");s(this,"connection");s(this,"contracts");s(this,"chainId");s(this,"coreBridge");this.network=e,this.chain=t,this.connection=r,this.contracts=o,this.chainId=i.toChainId(t);const n=o.coreBridge;if(!n)throw new Error(`CoreBridge contract Address for chain ${t} not found`);this.coreBridge=n}getGuardianSet(e){throw new Error("Method not implemented.")}getGuardianSetIndex(){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,t){const[r,o]=await w.AptosPlatform.chainFromRpc(e),n=t[o];if(n.network!==r)throw new Error(`Network mismatch: ${n.network} !== ${r}`);return new c(r,o,e,n.contracts)}async*publishMessage(e,t){throw new Error("Method not implemented.")}async*verifyMessage(e,t){throw new Error("Not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(r=>({chain:r.emitterChain,emitter:r.emitterAddress,sequence:r.sequence}))}async parseMessages(e){const t=await this.connection.getTransactionByHash({transactionHash:e});if(t.type!=="user_transaction")throw new Error(`${e} is not a user_transaction`);const r=t.events.filter(o=>o.type.endsWith("WormholeMessage"));if(!r||r.length===0)throw new Error(`WormholeMessage not found for ${e}`);return r.map(o=>{const n=o.data,d=new i.UniversalAddress(BigInt(n.sender).toString(16).padStart(64,"0"));return i.createVAA("Uint8Array",{guardianSet:0,emitterChain:this.chain,emitterAddress:d,sequence:BigInt(n.sequence),timestamp:Number(n.timestamp),consistencyLevel:n.consistency_level,nonce:Number(n.nonce),signatures:[],payload:i.hex.decode(n.payload)})})}}i.registerProtocol("Aptos","WormholeCore",c);exports.AptosWormholeCore=c;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DZvLy2Dr.js");class o extends Error{constructor(r){super(r)}}class s extends o{constructor(){super(...arguments),this.name="TokenOwnerOffCurveError"}}const n=e.struct([e.u32("mintAuthorityOption"),e.publicKey("mintAuthority"),e.u64("supply"),e.u8("decimals"),e.bool("isInitialized"),e.u32("freezeAuthorityOption"),e.publicKey("freezeAuthority")]);n.span;async function c(t,r,u=!1,i=e.TOKEN_PROGRAM_ID,O=e.ASSOCIATED_TOKEN_PROGRAM_ID){if(!u&&!e.PublicKey.isOnCurve(r.toBuffer()))throw new s;const[A]=await e.PublicKey.findProgramAddress([r.toBuffer(),i.toBuffer(),t.toBuffer()],O);return A}exports.ASSOCIATED_TOKEN_PROGRAM_ID=e.ASSOCIATED_TOKEN_PROGRAM_ID;exports.TOKEN_2022_PROGRAM_ID=e.TOKEN_2022_PROGRAM_ID;exports.TOKEN_PROGRAM_ID=e.TOKEN_PROGRAM_ID;exports.MintLayout=n;exports.TokenError=o;exports.TokenOwnerOffCurveError=s;exports.getAssociatedTokenAddress=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-5VUxPYxW.js");class o extends Error{constructor(r){super(r)}}class s extends o{constructor(){super(...arguments),this.name="TokenOwnerOffCurveError"}}const n=e.struct([e.u32("mintAuthorityOption"),e.publicKey("mintAuthority"),e.u64("supply"),e.u8("decimals"),e.bool("isInitialized"),e.u32("freezeAuthorityOption"),e.publicKey("freezeAuthority")]);n.span;async function c(t,r,u=!1,i=e.TOKEN_PROGRAM_ID,O=e.ASSOCIATED_TOKEN_PROGRAM_ID){if(!u&&!e.PublicKey.isOnCurve(r.toBuffer()))throw new s;const[A]=await e.PublicKey.findProgramAddress([r.toBuffer(),i.toBuffer(),t.toBuffer()],O);return A}exports.ASSOCIATED_TOKEN_PROGRAM_ID=e.ASSOCIATED_TOKEN_PROGRAM_ID;exports.TOKEN_2022_PROGRAM_ID=e.TOKEN_2022_PROGRAM_ID;exports.TOKEN_PROGRAM_ID=e.TOKEN_PROGRAM_ID;exports.MintLayout=n;exports.TokenError=o;exports.TokenOwnerOffCurveError=s;exports.getAssociatedTokenAddress=c;
@@ -1,8 +1,8 @@
1
1
  var Er = Object.defineProperty;
2
2
  var xr = (e, t, r) => t in e ? Er(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var F = (e, t, r) => xr(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { X as jr, y as Ir, cj as Or, bw as Ar, bu as kr, bv as Bt, r as _r, bx as Rt, bj as Cr } from "./index-CYBM2IeY.mjs";
5
- import { S as Nt, u as Pt } from "./sui-1fbLRIUL.mjs";
4
+ import { X as jr, y as Ir, cj as Or, bw as Ar, bu as kr, bv as Bt, r as _r, bx as Rt, bj as Cr } from "./index-qAojYF7t.mjs";
5
+ import { S as Nt, u as Pt } from "./sui-n-MTTZiA.mjs";
6
6
  import { S as $r } from "./unsignedTransaction-BD81leu1.mjs";
7
7
  class Mr extends TypeError {
8
8
  constructor(t, r) {
@@ -1,9 +1,9 @@
1
- import { ct as Wl, V as R, cr as sa, aD as Hl, X as oa, c5 as L, ae as Jl, ai as Gl } from "./index-CYBM2IeY.mjs";
1
+ import { ct as Wl, V as R, cr as sa, aD as Hl, X as oa, c5 as L, ae as Jl, ai as Gl } from "./index-qAojYF7t.mjs";
2
2
  import { d as Yl } from "./dijkstra-BZM-8g-B.mjs";
3
- import { e as He, s as aa } from "./events-lD3LhLH0.mjs";
4
- import { c as I, a as Ye } from "./index-CxQ-swIQ.mjs";
5
- import { r as Ql, a as It, g as xt, i as qe, b as ni, I as Rt, f as Ce, t as fe, w as Hi, c as Si, C as Xl, d as Zl, e as ns, h as eu, j as tu, k as vn, p as ru, l as wn, A as iu, E as pe, m as nu, y as be, P as ss, Q as su, n as ou, T as ca, o as _n, q as bn, s as Qe, _ as au, u as vt } from "./index-oPxOJfPK.mjs";
6
- import { s as la, a as Re, h as ua, L as cu, d as nr, l as lu, e as Ii, g as uu, i as os, k as hu } from "./index-Cl6LSKsg.mjs";
3
+ import { e as He, s as aa } from "./events-IHlp1dj4.mjs";
4
+ import { c as I, a as Ye } from "./index-or7CYt4J.mjs";
5
+ import { r as Ql, a as It, g as xt, i as qe, b as ni, I as Rt, f as Ce, t as fe, w as Hi, c as Si, C as Xl, d as Zl, e as ns, h as eu, j as tu, k as vn, p as ru, l as wn, A as iu, E as pe, m as nu, y as be, P as ss, Q as su, n as ou, T as ca, o as _n, q as bn, s as Qe, _ as au, u as vt } from "./index-BhivGLAi.mjs";
6
+ import { s as la, a as Re, h as ua, L as cu, d as nr, l as lu, e as Ii, g as uu, i as os, k as hu } from "./index-BxevXfo4.mjs";
7
7
  let du = class extends Ql {
8
8
  constructor(e) {
9
9
  super(e), this.events = new He.EventEmitter(), this.hasRegisteredEventListeners = !1, this.connection = this.setConnection(e), this.connection.connected && this.registerEventListeners();
@@ -1 +1 @@
1
- "use strict";const W=require("./index-DZvLy2Dr.js"),j="logger/5.7.0";let F=!1,k=!1;const U={debug:1,default:2,info:2,warning:3,error:4,off:5};let G=U.default,O=null;function Q(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const L=Q();var D;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(D||(D={}));var E;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(E||(E={}));const B="0123456789abcdef";class o{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();U[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(G>U[n])&&console.log.apply(console,e)}debug(...t){this._log(o.levels.DEBUG,t)}info(...t){this._log(o.levels.INFO,t)}warn(...t){this._log(o.levels.WARNING,t)}makeError(t,e,n){if(k)return this.makeError("censored error",e,{});e||(e=o.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(g=>{const p=n[g];try{if(p instanceof Uint8Array){let S="";for(let I=0;I<p.length;I++)S+=B[p[I]>>4],S+=B[p[I]&15];i.push(g+"=Uint8Array(0x"+S+")")}else i.push(g+"="+JSON.stringify(p))}catch{i.push(g+"="+JSON.stringify(n[g].toString()))}}),i.push(`code=${e}`),i.push(`version=${this.version}`);const N=t;let m="";switch(e){case E.NUMERIC_FAULT:{m="NUMERIC_FAULT";const g=t;switch(g){case"overflow":case"underflow":case"division-by-zero":m+="-"+g;break;case"negative-power":case"negative-width":m+="-unsupported";break;case"unbound-bitwise-result":m+="-unbound-result";break}break}case E.CALL_EXCEPTION:case E.INSUFFICIENT_FUNDS:case E.MISSING_NEW:case E.NONCE_EXPIRED:case E.REPLACEMENT_UNDERPRICED:case E.TRANSACTION_REPLACED:case E.UNPREDICTABLE_GAS_LIMIT:m=e;break}m&&(t+=" [ See: https://links.ethers.org/v5-errors-"+m+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const b=new Error(t);return b.reason=N,b.code=e,Object.keys(n).forEach(function(g){b[g]=n[g]}),b}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,o.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,i){t||this.throwError(e,n,i)}assertArgument(t,e,n,i){t||this.throwArgumentError(e,n,i)}checkNormalize(t){L&&this.throwError("platform missing String.prototype.normalize",o.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:L})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,o.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,o.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,o.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,o.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",o.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",o.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",o.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return O||(O=new o(j)),O}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",o.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),F){if(!t)return;this.globalLogger().throwError("error censorship permanent",o.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}k=!!t,F=!!e}static setLogLevel(t){const e=U[t.toLowerCase()];if(e==null){o.globalLogger().warn("invalid log level - "+t);return}G=e}static from(t){return new o(t)}}o.errors=E;o.levels=D;const Y="bytes/5.7.0",f=new o(Y);function V(r){return!!r.toHexString}function y(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return y(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function rr(r){return l(r)&&!(r.length%2)||P(r)}function z(r){return typeof r=="number"&&r==r&&r%1===0}function P(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!z(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!z(e)||e<0||e>=256)return!1}return!0}function A(r,t){if(t||(t={}),typeof r=="number"){f.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),y(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),V(r)&&(r=r.toHexString()),l(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":f.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let i=0;i<e.length;i+=2)n.push(parseInt(e.substring(i,i+2),16));return y(new Uint8Array(n))}return P(r)?y(new Uint8Array(r)):f.throwArgumentError("invalid arrayify value","value",r)}function tr(r){const t=r.map(i=>A(i)),e=t.reduce((i,N)=>i+N.length,0),n=new Uint8Array(e);return t.reduce((i,N)=>(n.set(N,i),i+N.length),0),y(n)}function er(r,t){r=A(r),r.length>t&&f.throwArgumentError("value out of range","value",arguments[0]);const e=new Uint8Array(t);return e.set(r,t-r.length),y(e)}function l(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||t&&r.length!==2+2*t)}const d="0123456789abcdef";function c(r,t){if(t||(t={}),typeof r=="number"){f.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=d[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),V(r))return r.toHexString();if(l(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":f.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(P(r)){let e="0x";for(let n=0;n<r.length;n++){let i=r[n];e+=d[(i&240)>>4]+d[i&15]}return e}return f.throwArgumentError("invalid hexlify value","value",r)}function nr(r){if(typeof r!="string")r=c(r);else if(!l(r)||r.length%2)return null;return(r.length-2)/2}function ir(r,t,e){return typeof r!="string"?r=c(r):(!l(r)||r.length%2)&&f.throwArgumentError("invalid hexData","value",r),t=2+2*t,e!=null?"0x"+r.substring(t,2+2*e):"0x"+r.substring(t)}function sr(r){let t="0x";return r.forEach(e=>{t+=c(e).substring(2)}),t}function _(r,t){for(typeof r!="string"?r=c(r):l(r)||f.throwArgumentError("invalid hex string","value",r),r.length>2*t+2&&f.throwArgumentError("value out of range","value",arguments[1]);r.length<2*t+2;)r="0x0"+r.substring(2);return r}function or(r){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(rr(r)){let e=A(r);e.length===64?(t.v=27+(e[32]>>7),e[32]&=127,t.r=c(e.slice(0,32)),t.s=c(e.slice(32,64))):e.length===65?(t.r=c(e.slice(0,32)),t.s=c(e.slice(32,64)),t.v=e[64]):f.throwArgumentError("invalid signature string","signature",r),t.v<27&&(t.v===0||t.v===1?t.v+=27:f.throwArgumentError("signature invalid v byte","signature",r)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(e[32]|=128),t._vs=c(e.slice(32,64))}else{if(t.r=r.r,t.s=r.s,t.v=r.v,t.recoveryParam=r.recoveryParam,t._vs=r._vs,t._vs!=null){const i=er(A(t._vs),32);t._vs=c(i);const N=i[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=N:t.recoveryParam!==N&&f.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),i[0]&=127;const m=c(i);t.s==null?t.s=m:t.s!==m&&f.throwArgumentError("signature v mismatch _vs","signature",r)}if(t.recoveryParam==null)t.v==null?f.throwArgumentError("signature missing v and recoveryParam","signature",r):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{const i=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==i&&f.throwArgumentError("signature recoveryParam mismatch v","signature",r)}t.r==null||!l(t.r)?f.throwArgumentError("signature missing or invalid r","signature",r):t.r=_(t.r,32),t.s==null||!l(t.s)?f.throwArgumentError("signature missing or invalid s","signature",r):t.s=_(t.s,32);const e=A(t.s);e[0]>=128&&f.throwArgumentError("signature s out of range","signature",r),t.recoveryParam&&(e[0]|=128);const n=c(e);t._vs&&(l(t._vs)||f.throwArgumentError("signature invalid _vs","signature",r),t._vs=_(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&f.throwArgumentError("signature _vs mismatch v and s","signature",r)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}const fr="bignumber/5.7.0";var T=W.BN.BN;const w=new o(fr),C={},ur=9007199254740991;let $=!1;class h{constructor(t,e){t!==C&&w.throwError("cannot call constructor directly; use BigNumber.from",o.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return u(s(this).fromTwos(t))}toTwos(t){return u(s(this).toTwos(t))}abs(){return this._hex[0]==="-"?h.from(this._hex.substring(1)):this}add(t){return u(s(this).add(s(t)))}sub(t){return u(s(this).sub(s(t)))}div(t){return h.from(t).isZero()&&a("division-by-zero","div"),u(s(this).div(s(t)))}mul(t){return u(s(this).mul(s(t)))}mod(t){const e=s(t);return e.isNeg()&&a("division-by-zero","mod"),u(s(this).umod(e))}pow(t){const e=s(t);return e.isNeg()&&a("negative-power","pow"),u(s(this).pow(e))}and(t){const e=s(t);return(this.isNegative()||e.isNeg())&&a("unbound-bitwise-result","and"),u(s(this).and(e))}or(t){const e=s(t);return(this.isNegative()||e.isNeg())&&a("unbound-bitwise-result","or"),u(s(this).or(e))}xor(t){const e=s(t);return(this.isNegative()||e.isNeg())&&a("unbound-bitwise-result","xor"),u(s(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&a("negative-width","mask"),u(s(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&a("negative-width","shl"),u(s(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&a("negative-width","shr"),u(s(this).shrn(t))}eq(t){return s(this).eq(s(t))}lt(t){return s(this).lt(s(t))}lte(t){return s(this).lte(s(t))}gt(t){return s(this).gt(s(t))}gte(t){return s(this).gte(s(t))}isNegative(){return this._hex[0]==="-"}isZero(){return s(this).isZero()}toNumber(){try{return s(this).toNumber()}catch{a("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return w.throwError("this platform does not support BigInt",o.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?$||($=!0,w.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?w.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",o.errors.UNEXPECTED_ARGUMENT,{}):w.throwError("BigNumber.toString does not accept parameters",o.errors.UNEXPECTED_ARGUMENT,{})),s(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof h)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new h(C,R(t)):t.match(/^-?[0-9]+$/)?new h(C,R(new T(t))):w.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&a("underflow","BigNumber.from",t),(t>=ur||t<=-9007199254740991)&&a("overflow","BigNumber.from",t),h.from(String(t));const e=t;if(typeof e=="bigint")return h.from(e.toString());if(P(e))return h.from(c(e));if(e)if(e.toHexString){const n=e.toHexString();if(typeof n=="string")return h.from(n)}else{let n=e._hex;if(n==null&&e.type==="BigNumber"&&(n=e.hex),typeof n=="string"&&(l(n)||n[0]==="-"&&l(n.substring(1))))return h.from(n)}return w.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function R(r){if(typeof r!="string")return R(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&w.throwArgumentError("invalid hex","value",r),r=R(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function u(r){return h.from(R(r))}function s(r){const t=h.from(r).toHexString();return t[0]==="-"?new T("-"+t.substring(3),16):new T(t.substring(2),16)}function a(r,t,e){const n={fault:r,operation:t};return e!=null&&(n.value=e),w.throwError(r,o.errors.NUMERIC_FAULT,n)}function hr(r){return new T(r,36).toString(16)}const cr="properties/5.7.0",K=new o(cr);function J(r,t,e){Object.defineProperty(r,t,{enumerable:!0,value:e,writable:!1})}function lr(r,t){for(let e=0;e<32;e++){if(r[t])return r[t];if(!r.prototype||typeof r.prototype!="object")break;r=Object.getPrototypeOf(r.prototype).constructor}return null}const ar={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Z(r){if(r==null||ar[typeof r])return!0;if(Array.isArray(r)||typeof r=="object"){if(!Object.isFrozen(r))return!1;const t=Object.keys(r);for(let e=0;e<t.length;e++){let n=null;try{n=r[t[e]]}catch{continue}if(!Z(n))return!1}return!0}return K.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function gr(r){if(Z(r))return r;if(Array.isArray(r))return Object.freeze(r.map(t=>M(t)));if(typeof r=="object"){const t={};for(const e in r){const n=r[e];n!==void 0&&J(t,e,M(n))}return t}return K.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function M(r){return gr(r)}class Er{constructor(t){for(const e in t)this[e]=M(t[e])}}function q(r){return"0x"+W.sha3.keccak_256(A(r))}const mr="address/5.7.0",x=new o(mr);function H(r){l(r,20)||x.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const t=r.substring(2).split(""),e=new Uint8Array(40);for(let i=0;i<40;i++)e[i]=t[i].charCodeAt(0);const n=A(q(e));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(n[i>>1]&15)>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}const Nr=9007199254740991;function wr(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const v={};for(let r=0;r<10;r++)v[String(r)]=String(r);for(let r=0;r<26;r++)v[String.fromCharCode(65+r)]=String(10+r);const X=Math.floor(wr(Nr));function Ar(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let t=r.split("").map(n=>v[n]).join("");for(;t.length>=X;){let n=t.substring(0,X);t=parseInt(n,10)%97+t.substring(n.length)}let e=String(98-parseInt(t,10)%97);for(;e.length<2;)e="0"+e;return e}function yr(r){let t=null;if(typeof r!="string"&&x.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),t=H(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==r&&x.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==Ar(r)&&x.throwArgumentError("bad icap checksum","address",r),t=hr(r.substring(4));t.length<40;)t="0"+t;t=H("0x"+t)}else x.throwArgumentError("invalid address","address",r);return t}exports.BigNumber=h;exports.Description=Er;exports.Logger=o;exports.arrayify=A;exports.concat=tr;exports.defineReadOnly=J;exports.getAddress=yr;exports.getStatic=lr;exports.hexConcat=sr;exports.hexDataLength=nr;exports.hexDataSlice=ir;exports.hexZeroPad=_;exports.hexlify=c;exports.isHexString=l;exports.keccak256=q;exports.splitSignature=or;
1
+ "use strict";const W=require("./index-5VUxPYxW.js"),j="logger/5.7.0";let F=!1,k=!1;const U={debug:1,default:2,info:2,warning:3,error:4,off:5};let G=U.default,O=null;function Q(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test".normalize(t)!=="test")throw new Error("bad normalize")}catch{r.push(t)}}),r.length)throw new Error("missing "+r.join(", "));if("é".normalize("NFD")!=="é")throw new Error("broken implementation")}catch(r){return r.message}return null}const L=Q();var D;(function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"})(D||(D={}));var E;(function(r){r.UNKNOWN_ERROR="UNKNOWN_ERROR",r.NOT_IMPLEMENTED="NOT_IMPLEMENTED",r.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",r.NETWORK_ERROR="NETWORK_ERROR",r.SERVER_ERROR="SERVER_ERROR",r.TIMEOUT="TIMEOUT",r.BUFFER_OVERRUN="BUFFER_OVERRUN",r.NUMERIC_FAULT="NUMERIC_FAULT",r.MISSING_NEW="MISSING_NEW",r.INVALID_ARGUMENT="INVALID_ARGUMENT",r.MISSING_ARGUMENT="MISSING_ARGUMENT",r.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",r.CALL_EXCEPTION="CALL_EXCEPTION",r.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",r.NONCE_EXPIRED="NONCE_EXPIRED",r.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",r.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",r.TRANSACTION_REPLACED="TRANSACTION_REPLACED",r.ACTION_REJECTED="ACTION_REJECTED"})(E||(E={}));const B="0123456789abcdef";class o{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){const n=t.toLowerCase();U[n]==null&&this.throwArgumentError("invalid log level name","logLevel",t),!(G>U[n])&&console.log.apply(console,e)}debug(...t){this._log(o.levels.DEBUG,t)}info(...t){this._log(o.levels.INFO,t)}warn(...t){this._log(o.levels.WARNING,t)}makeError(t,e,n){if(k)return this.makeError("censored error",e,{});e||(e=o.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach(g=>{const p=n[g];try{if(p instanceof Uint8Array){let S="";for(let I=0;I<p.length;I++)S+=B[p[I]>>4],S+=B[p[I]&15];i.push(g+"=Uint8Array(0x"+S+")")}else i.push(g+"="+JSON.stringify(p))}catch{i.push(g+"="+JSON.stringify(n[g].toString()))}}),i.push(`code=${e}`),i.push(`version=${this.version}`);const N=t;let m="";switch(e){case E.NUMERIC_FAULT:{m="NUMERIC_FAULT";const g=t;switch(g){case"overflow":case"underflow":case"division-by-zero":m+="-"+g;break;case"negative-power":case"negative-width":m+="-unsupported";break;case"unbound-bitwise-result":m+="-unbound-result";break}break}case E.CALL_EXCEPTION:case E.INSUFFICIENT_FUNDS:case E.MISSING_NEW:case E.NONCE_EXPIRED:case E.REPLACEMENT_UNDERPRICED:case E.TRANSACTION_REPLACED:case E.UNPREDICTABLE_GAS_LIMIT:m=e;break}m&&(t+=" [ See: https://links.ethers.org/v5-errors-"+m+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const b=new Error(t);return b.reason=N,b.code=e,Object.keys(n).forEach(function(g){b[g]=n[g]}),b}throwError(t,e,n){throw this.makeError(t,e,n)}throwArgumentError(t,e,n){return this.throwError(t,o.errors.INVALID_ARGUMENT,{argument:e,value:n})}assert(t,e,n,i){t||this.throwError(e,n,i)}assertArgument(t,e,n,i){t||this.throwArgumentError(e,n,i)}checkNormalize(t){L&&this.throwError("platform missing String.prototype.normalize",o.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:L})}checkSafeUint53(t,e){typeof t=="number"&&(e==null&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,o.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,o.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,n){n?n=": "+n:n="",t<e&&this.throwError("missing argument"+n,o.errors.MISSING_ARGUMENT,{count:t,expectedCount:e}),t>e&&this.throwError("too many arguments"+n,o.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||t==null)&&this.throwError("missing new",o.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",o.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||t==null)&&this.throwError("missing new",o.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return O||(O=new o(j)),O}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",o.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),F){if(!t)return;this.globalLogger().throwError("error censorship permanent",o.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}k=!!t,F=!!e}static setLogLevel(t){const e=U[t.toLowerCase()];if(e==null){o.globalLogger().warn("invalid log level - "+t);return}G=e}static from(t){return new o(t)}}o.errors=E;o.levels=D;const Y="bytes/5.7.0",f=new o(Y);function V(r){return!!r.toHexString}function y(r){return r.slice||(r.slice=function(){const t=Array.prototype.slice.call(arguments);return y(new Uint8Array(Array.prototype.slice.apply(r,t)))}),r}function rr(r){return l(r)&&!(r.length%2)||P(r)}function z(r){return typeof r=="number"&&r==r&&r%1===0}function P(r){if(r==null)return!1;if(r.constructor===Uint8Array)return!0;if(typeof r=="string"||!z(r.length)||r.length<0)return!1;for(let t=0;t<r.length;t++){const e=r[t];if(!z(e)||e<0||e>=256)return!1}return!0}function A(r,t){if(t||(t={}),typeof r=="number"){f.checkSafeUint53(r,"invalid arrayify value");const e=[];for(;r;)e.unshift(r&255),r=parseInt(String(r/256));return e.length===0&&e.push(0),y(new Uint8Array(e))}if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),V(r)&&(r=r.toHexString()),l(r)){let e=r.substring(2);e.length%2&&(t.hexPad==="left"?e="0"+e:t.hexPad==="right"?e+="0":f.throwArgumentError("hex data is odd-length","value",r));const n=[];for(let i=0;i<e.length;i+=2)n.push(parseInt(e.substring(i,i+2),16));return y(new Uint8Array(n))}return P(r)?y(new Uint8Array(r)):f.throwArgumentError("invalid arrayify value","value",r)}function tr(r){const t=r.map(i=>A(i)),e=t.reduce((i,N)=>i+N.length,0),n=new Uint8Array(e);return t.reduce((i,N)=>(n.set(N,i),i+N.length),0),y(n)}function er(r,t){r=A(r),r.length>t&&f.throwArgumentError("value out of range","value",arguments[0]);const e=new Uint8Array(t);return e.set(r,t-r.length),y(e)}function l(r,t){return!(typeof r!="string"||!r.match(/^0x[0-9A-Fa-f]*$/)||t&&r.length!==2+2*t)}const d="0123456789abcdef";function c(r,t){if(t||(t={}),typeof r=="number"){f.checkSafeUint53(r,"invalid hexlify value");let e="";for(;r;)e=d[r&15]+e,r=Math.floor(r/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if(typeof r=="bigint")return r=r.toString(16),r.length%2?"0x0"+r:"0x"+r;if(t.allowMissingPrefix&&typeof r=="string"&&r.substring(0,2)!=="0x"&&(r="0x"+r),V(r))return r.toHexString();if(l(r))return r.length%2&&(t.hexPad==="left"?r="0x0"+r.substring(2):t.hexPad==="right"?r+="0":f.throwArgumentError("hex data is odd-length","value",r)),r.toLowerCase();if(P(r)){let e="0x";for(let n=0;n<r.length;n++){let i=r[n];e+=d[(i&240)>>4]+d[i&15]}return e}return f.throwArgumentError("invalid hexlify value","value",r)}function nr(r){if(typeof r!="string")r=c(r);else if(!l(r)||r.length%2)return null;return(r.length-2)/2}function ir(r,t,e){return typeof r!="string"?r=c(r):(!l(r)||r.length%2)&&f.throwArgumentError("invalid hexData","value",r),t=2+2*t,e!=null?"0x"+r.substring(t,2+2*e):"0x"+r.substring(t)}function sr(r){let t="0x";return r.forEach(e=>{t+=c(e).substring(2)}),t}function _(r,t){for(typeof r!="string"?r=c(r):l(r)||f.throwArgumentError("invalid hex string","value",r),r.length>2*t+2&&f.throwArgumentError("value out of range","value",arguments[1]);r.length<2*t+2;)r="0x0"+r.substring(2);return r}function or(r){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(rr(r)){let e=A(r);e.length===64?(t.v=27+(e[32]>>7),e[32]&=127,t.r=c(e.slice(0,32)),t.s=c(e.slice(32,64))):e.length===65?(t.r=c(e.slice(0,32)),t.s=c(e.slice(32,64)),t.v=e[64]):f.throwArgumentError("invalid signature string","signature",r),t.v<27&&(t.v===0||t.v===1?t.v+=27:f.throwArgumentError("signature invalid v byte","signature",r)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(e[32]|=128),t._vs=c(e.slice(32,64))}else{if(t.r=r.r,t.s=r.s,t.v=r.v,t.recoveryParam=r.recoveryParam,t._vs=r._vs,t._vs!=null){const i=er(A(t._vs),32);t._vs=c(i);const N=i[0]>=128?1:0;t.recoveryParam==null?t.recoveryParam=N:t.recoveryParam!==N&&f.throwArgumentError("signature recoveryParam mismatch _vs","signature",r),i[0]&=127;const m=c(i);t.s==null?t.s=m:t.s!==m&&f.throwArgumentError("signature v mismatch _vs","signature",r)}if(t.recoveryParam==null)t.v==null?f.throwArgumentError("signature missing v and recoveryParam","signature",r):t.v===0||t.v===1?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(t.v==null)t.v=27+t.recoveryParam;else{const i=t.v===0||t.v===1?t.v:1-t.v%2;t.recoveryParam!==i&&f.throwArgumentError("signature recoveryParam mismatch v","signature",r)}t.r==null||!l(t.r)?f.throwArgumentError("signature missing or invalid r","signature",r):t.r=_(t.r,32),t.s==null||!l(t.s)?f.throwArgumentError("signature missing or invalid s","signature",r):t.s=_(t.s,32);const e=A(t.s);e[0]>=128&&f.throwArgumentError("signature s out of range","signature",r),t.recoveryParam&&(e[0]|=128);const n=c(e);t._vs&&(l(t._vs)||f.throwArgumentError("signature invalid _vs","signature",r),t._vs=_(t._vs,32)),t._vs==null?t._vs=n:t._vs!==n&&f.throwArgumentError("signature _vs mismatch v and s","signature",r)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}const fr="bignumber/5.7.0";var T=W.BN.BN;const w=new o(fr),C={},ur=9007199254740991;let $=!1;class h{constructor(t,e){t!==C&&w.throwError("cannot call constructor directly; use BigNumber.from",o.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return u(s(this).fromTwos(t))}toTwos(t){return u(s(this).toTwos(t))}abs(){return this._hex[0]==="-"?h.from(this._hex.substring(1)):this}add(t){return u(s(this).add(s(t)))}sub(t){return u(s(this).sub(s(t)))}div(t){return h.from(t).isZero()&&a("division-by-zero","div"),u(s(this).div(s(t)))}mul(t){return u(s(this).mul(s(t)))}mod(t){const e=s(t);return e.isNeg()&&a("division-by-zero","mod"),u(s(this).umod(e))}pow(t){const e=s(t);return e.isNeg()&&a("negative-power","pow"),u(s(this).pow(e))}and(t){const e=s(t);return(this.isNegative()||e.isNeg())&&a("unbound-bitwise-result","and"),u(s(this).and(e))}or(t){const e=s(t);return(this.isNegative()||e.isNeg())&&a("unbound-bitwise-result","or"),u(s(this).or(e))}xor(t){const e=s(t);return(this.isNegative()||e.isNeg())&&a("unbound-bitwise-result","xor"),u(s(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&a("negative-width","mask"),u(s(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&a("negative-width","shl"),u(s(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&a("negative-width","shr"),u(s(this).shrn(t))}eq(t){return s(this).eq(s(t))}lt(t){return s(this).lt(s(t))}lte(t){return s(this).lte(s(t))}gt(t){return s(this).gt(s(t))}gte(t){return s(this).gte(s(t))}isNegative(){return this._hex[0]==="-"}isZero(){return s(this).isZero()}toNumber(){try{return s(this).toNumber()}catch{a("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return w.throwError("this platform does not support BigInt",o.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?$||($=!0,w.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?w.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",o.errors.UNEXPECTED_ARGUMENT,{}):w.throwError("BigNumber.toString does not accept parameters",o.errors.UNEXPECTED_ARGUMENT,{})),s(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof h)return t;if(typeof t=="string")return t.match(/^-?0x[0-9a-f]+$/i)?new h(C,R(t)):t.match(/^-?[0-9]+$/)?new h(C,R(new T(t))):w.throwArgumentError("invalid BigNumber string","value",t);if(typeof t=="number")return t%1&&a("underflow","BigNumber.from",t),(t>=ur||t<=-9007199254740991)&&a("overflow","BigNumber.from",t),h.from(String(t));const e=t;if(typeof e=="bigint")return h.from(e.toString());if(P(e))return h.from(c(e));if(e)if(e.toHexString){const n=e.toHexString();if(typeof n=="string")return h.from(n)}else{let n=e._hex;if(n==null&&e.type==="BigNumber"&&(n=e.hex),typeof n=="string"&&(l(n)||n[0]==="-"&&l(n.substring(1))))return h.from(n)}return w.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function R(r){if(typeof r!="string")return R(r.toString(16));if(r[0]==="-")return r=r.substring(1),r[0]==="-"&&w.throwArgumentError("invalid hex","value",r),r=R(r),r==="0x00"?r:"-"+r;if(r.substring(0,2)!=="0x"&&(r="0x"+r),r==="0x")return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&r.substring(0,4)==="0x00";)r="0x"+r.substring(4);return r}function u(r){return h.from(R(r))}function s(r){const t=h.from(r).toHexString();return t[0]==="-"?new T("-"+t.substring(3),16):new T(t.substring(2),16)}function a(r,t,e){const n={fault:r,operation:t};return e!=null&&(n.value=e),w.throwError(r,o.errors.NUMERIC_FAULT,n)}function hr(r){return new T(r,36).toString(16)}const cr="properties/5.7.0",K=new o(cr);function J(r,t,e){Object.defineProperty(r,t,{enumerable:!0,value:e,writable:!1})}function lr(r,t){for(let e=0;e<32;e++){if(r[t])return r[t];if(!r.prototype||typeof r.prototype!="object")break;r=Object.getPrototypeOf(r.prototype).constructor}return null}const ar={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Z(r){if(r==null||ar[typeof r])return!0;if(Array.isArray(r)||typeof r=="object"){if(!Object.isFrozen(r))return!1;const t=Object.keys(r);for(let e=0;e<t.length;e++){let n=null;try{n=r[t[e]]}catch{continue}if(!Z(n))return!1}return!0}return K.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function gr(r){if(Z(r))return r;if(Array.isArray(r))return Object.freeze(r.map(t=>M(t)));if(typeof r=="object"){const t={};for(const e in r){const n=r[e];n!==void 0&&J(t,e,M(n))}return t}return K.throwArgumentError(`Cannot deepCopy ${typeof r}`,"object",r)}function M(r){return gr(r)}class Er{constructor(t){for(const e in t)this[e]=M(t[e])}}function q(r){return"0x"+W.sha3.keccak_256(A(r))}const mr="address/5.7.0",x=new o(mr);function H(r){l(r,20)||x.throwArgumentError("invalid address","address",r),r=r.toLowerCase();const t=r.substring(2).split(""),e=new Uint8Array(40);for(let i=0;i<40;i++)e[i]=t[i].charCodeAt(0);const n=A(q(e));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(n[i>>1]&15)>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}const Nr=9007199254740991;function wr(r){return Math.log10?Math.log10(r):Math.log(r)/Math.LN10}const v={};for(let r=0;r<10;r++)v[String(r)]=String(r);for(let r=0;r<26;r++)v[String.fromCharCode(65+r)]=String(10+r);const X=Math.floor(wr(Nr));function Ar(r){r=r.toUpperCase(),r=r.substring(4)+r.substring(0,2)+"00";let t=r.split("").map(n=>v[n]).join("");for(;t.length>=X;){let n=t.substring(0,X);t=parseInt(n,10)%97+t.substring(n.length)}let e=String(98-parseInt(t,10)%97);for(;e.length<2;)e="0"+e;return e}function yr(r){let t=null;if(typeof r!="string"&&x.throwArgumentError("invalid address","address",r),r.match(/^(0x)?[0-9a-fA-F]{40}$/))r.substring(0,2)!=="0x"&&(r="0x"+r),t=H(r),r.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==r&&x.throwArgumentError("bad address checksum","address",r);else if(r.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(r.substring(2,4)!==Ar(r)&&x.throwArgumentError("bad icap checksum","address",r),t=hr(r.substring(4));t.length<40;)t="0"+t;t=H("0x"+t)}else x.throwArgumentError("invalid address","address",r);return t}exports.BigNumber=h;exports.Description=Er;exports.Logger=o;exports.arrayify=A;exports.concat=tr;exports.defineReadOnly=J;exports.getAddress=yr;exports.getStatic=lr;exports.hexConcat=sr;exports.hexDataLength=nr;exports.hexDataSlice=ir;exports.hexZeroPad=_;exports.hexlify=c;exports.isHexString=l;exports.keccak256=q;exports.splitSignature=or;
@@ -1,7 +1,7 @@
1
1
  var Pt = Object.defineProperty;
2
2
  var _t = (e, t, r) => t in e ? Pt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
3
  var f = (e, t, r) => _t(e, typeof t != "symbol" ? t + "" : t, r);
4
- import { ae as c, V as l, a_ as A, bH as le, b2 as z, b1 as U, b3 as G, b0 as S, a$ as V, bI as Ge, bJ as Ze, bK as Wt, bL as It, bM as Ut, bN as Nt, bO as O, bP as E, b6 as y, bQ as T, bR as Ft, bS as ye, bB as dt, bT as xt, bU as lt, bV as zt, bW as Ot, bX as Q, bY as Lt, bZ as Z, b_ as H, b$ as Dt, c0 as qt, c1 as Kt, c2 as Vt, c3 as Se, c4 as Gt, c5 as v, c6 as Zt, e as oe, f as k, bA as Ce, bd as Ht, m as $, bG as Be, c7 as Yt, c8 as Qt, at as ae, ai as L, c9 as Xt, ca as ft, bj as mt, g as gt } from "./index-CYBM2IeY.mjs";
4
+ import { ae as c, V as l, a_ as A, bH as le, b2 as z, b1 as U, b3 as G, b0 as S, a$ as V, bI as Ge, bJ as Ze, bK as Wt, bL as It, bM as Ut, bN as Nt, bO as O, bP as E, b6 as y, bQ as T, bR as Ft, bS as ye, bB as dt, bT as xt, bU as lt, bV as zt, bW as Ot, bX as Q, bY as Lt, bZ as Z, b_ as H, b$ as Dt, c0 as qt, c1 as Kt, c2 as Vt, c3 as Se, c4 as Gt, c5 as v, c6 as Zt, e as oe, f as k, bA as Ce, bd as Ht, m as $, bG as Be, c7 as Yt, c8 as Qt, at as ae, ai as L, c9 as Xt, ca as ft, bj as mt, g as gt } from "./index-qAojYF7t.mjs";
5
5
  const M = new c("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
6
6
  new c("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
7
7
  const Ae = new c("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"), D = new c("So11111111111111111111111111111111111111112");
@@ -1,4 +1,4 @@
1
- import { aJ as L, aU as g, aV as F, aW as k, aX as I, O as P, Q as T } from "./index-CYBM2IeY.mjs";
1
+ import { aJ as L, aU as g, aV as F, aW as k, aX as I, O as P, Q as T } from "./index-qAojYF7t.mjs";
2
2
  function D(n, t, e, s) {
3
3
  g(n);
4
4
  const i = F({ dkLen: 32, asyncTick: 10 }, s), { c: u, dkLen: a, asyncTick: o } = i;
@@ -1,8 +1,8 @@
1
1
  var d = Object.defineProperty;
2
2
  var h = (a, e, t) => e in a ? d(a, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[e] = t;
3
3
  var o = (a, e, t) => h(a, typeof e != "symbol" ? e + "" : e, t);
4
- import { b6 as m, bB as w, cc as g, r as p, bj as u } from "./index-CYBM2IeY.mjs";
5
- import { A as l } from "./aptos-Ckopfy7I.mjs";
4
+ import { b6 as m, bB as w, cc as g, r as p, bj as u } from "./index-qAojYF7t.mjs";
5
+ import { A as l } from "./aptos-BzWhIYlr.mjs";
6
6
  class i {
7
7
  constructor(e, t, r, s) {
8
8
  o(this, "network");