@wormhole-foundation/wormhole-connect 0.3.17-beta.0-development → 0.3.17-beta.1-development

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) hide show
  1. package/dist/assets/{ccip-9_vi9EG2.js → ccip-DR0sV4Gg.js} +1 -1
  2. package/dist/assets/cosmos-CKUC0334.js +37 -0
  3. package/dist/assets/{cosmwasm-BRgXJAEm.js → cosmwasm-D6dc3HhR.js} +3 -3
  4. package/dist/assets/{ens-validation.es6-CEldkK56.js → ens-validation.es6-JeiZhPFM.js} +1 -1
  5. package/dist/assets/{evm-v7LSoQ0I.js → evm-Dfoif9rW.js} +4 -4
  6. package/dist/assets/{index-DE5qHejQ.js → index-BOBMlReD.js} +1 -1
  7. package/dist/assets/{index-BUfxN-fw.js → index-CYsDCGyL.js} +1 -1
  8. package/dist/assets/{index-2haya2pd.js → index-CfFB0O_w.js} +1 -1
  9. package/dist/assets/index-DTubKMVE.js +3 -0
  10. package/dist/assets/{index-BSZP2fsz.js → index-DdlsdoUO.js} +1 -1
  11. package/dist/assets/{index-C-wyBac8.js → index-tlA_SzXI.js} +2 -2
  12. package/dist/assets/{index.es-CoJEfOGV.js → index.es-yNDXO1Ts.js} +2 -2
  13. package/dist/assets/{solana-ClUmAbQX.js → solana-DJERwdo1.js} +2 -2
  14. package/dist/assets/{solanaEmbed.esm-BpCHncZo.js → solanaEmbed.esm-CYzxDEiX.js} +1 -1
  15. package/dist/assets/{unsignedTransaction-C5QlrOSq.js → unsignedTransaction-Bbs3hbtB.js} +1 -1
  16. package/dist/main.js +9 -9
  17. package/dist/src/utils/wallet/index.d.ts.map +1 -1
  18. package/lib/{algorand-bS35msci.mjs → algorand-BPtE9-nd.mjs} +4 -4
  19. package/lib/{algorand-ch-kzV_x.js → algorand-CT9IzowX.js} +1 -1
  20. package/lib/{aptos-BDzxxGIR.mjs → aptos-C_p2pwJV.mjs} +4 -4
  21. package/lib/{aptos-DWg8Rn-k.js → aptos-CcKr32r1.js} +1 -1
  22. package/lib/{aptos-DUucnsXv.mjs → aptos-DyoV4KSe.mjs} +1 -1
  23. package/lib/{aptos-DnM3WRjp.js → aptos-vNnkKdrU.js} +2 -2
  24. package/lib/{browser-BI5djQU6.js → browser-BEgrG8Dj.js} +1 -1
  25. package/lib/{browser-g0PYUF9T.mjs → browser-QgbjwerP.mjs} +2 -2
  26. package/lib/{ccip-BTfWcVrD.mjs → ccip-8IvG2nQB.mjs} +1 -1
  27. package/lib/{ccip-DcsLq06d.js → ccip-C2nJUeTV.js} +1 -1
  28. package/lib/{chain-CqE6elWK.mjs → chain-CC9n7dMB.mjs} +1 -1
  29. package/lib/{chain-Don0E4S-.js → chain-j1F1mBU9.js} +1 -1
  30. package/lib/cosmos-B3nwGfan.js +37 -0
  31. package/lib/{cosmos-DOJELD1K.mjs → cosmos-CH08pCqb.mjs} +6 -6
  32. package/lib/{cosmwasm-DAnkbnkz.js → cosmwasm-D5Jgmftm.js} +2 -2
  33. package/lib/{cosmwasm-BKmi5ZCw.mjs → cosmwasm-DNQv_pY0.mjs} +6 -6
  34. package/lib/{create-BdkkvVm8.mjs → create-Ba-vkqIS.mjs} +1 -1
  35. package/lib/{create-uzzwCMF6.js → create-CiLAQlGO.js} +1 -1
  36. package/lib/{ens-validation.es6-nPaaFYuz.js → ens-validation.es6-BKazRxKI.js} +1 -1
  37. package/lib/{ens-validation.es6-BhcALgLC.mjs → ens-validation.es6-Chl_xq9x.mjs} +2 -2
  38. package/lib/{evm-C8LOnGdt.mjs → evm-BNWJNFdL.mjs} +6 -6
  39. package/lib/{evm-NLcFQVzI.js → evm-CHLviY4T.js} +4 -4
  40. package/lib/{evm-DBInTNei.js → evm-CMUUWzxN.js} +2 -2
  41. package/lib/{evm-COQh1jZO.mjs → evm-ImN7TwqI.mjs} +6 -6
  42. package/lib/index-55Adm4pS.js +3 -0
  43. package/lib/{index-D-EnExUU.js → index-6ITI8l_n.js} +1 -1
  44. package/lib/{index-CWJvFytR.js → index-6wTLnL9X.js} +1 -1
  45. package/lib/{index-1hVb2x71.mjs → index-7BQZXfWl.mjs} +90 -86
  46. package/lib/{index-Y1cPvgna.js → index-91nDC5Uy.js} +1 -1
  47. package/lib/{index-D1soY6Bs.js → index-AWXaMk_V.js} +1 -1
  48. package/lib/{index-dV3CWaTB.mjs → index-B0buWmUZ.mjs} +72 -72
  49. package/lib/{index-BoSliQiL.mjs → index-B3nKeY7i.mjs} +4 -4
  50. package/lib/{index-9ZYwanM_.js → index-B734e-Zb.js} +1 -1
  51. package/lib/{index-BcrCrkNB.js → index-B9N5DIHp.js} +1 -1
  52. package/lib/{index-HwLcOkRj.mjs → index-BA18_3G6.mjs} +4 -4
  53. package/lib/{index-BWOI9Npj.js → index-BEylzlT7.js} +1 -1
  54. package/lib/{index-BJkzohZL.mjs → index-BJCthuOT.mjs} +5 -5
  55. package/lib/{index-CKHcY1Q3.mjs → index-BSzCyPEA.mjs} +3 -3
  56. package/lib/{index-Bq519cyk.mjs → index-BdRagW8t.mjs} +2 -2
  57. package/lib/{index-CiaCcEoi.mjs → index-BhW4ej8D.mjs} +4 -4
  58. package/lib/{index-DKsSIHhH.js → index-Br0F6utM.js} +1 -1
  59. package/lib/{index-C2z4vb4U.js → index-BrMPzzY-.js} +1 -1
  60. package/lib/{index-B0kmC0mn.mjs → index-BvOaMsax.mjs} +4 -4
  61. package/lib/{index-D8bkRipC.mjs → index-Bx1WY-AO.mjs} +4 -4
  62. package/lib/{index-BSkK4CHt.mjs → index-C-XVUExZ.mjs} +4 -4
  63. package/lib/{index-1EWeKE64.js → index-CDWIVNpZ.js} +1 -1
  64. package/lib/{index-Dbmtm12A.mjs → index-CRPzHB8-.mjs} +4 -4
  65. package/lib/{index-8i4Ho100.js → index-CS1WBa4N.js} +1 -1
  66. package/lib/{index-BNGMOq5B.js → index-CT5Snq8o.js} +1 -1
  67. package/lib/{index-je0hhmpN.mjs → index-CTxrRw8G.mjs} +4 -4
  68. package/lib/{index-B_cn_R-N.mjs → index-CXD37eeM.mjs} +5 -5
  69. package/lib/{index-B_vHPzmd.js → index-Cbtr0vIa.js} +1 -1
  70. package/lib/{index-B3HQQxr0.mjs → index-CcaZuATX.mjs} +1 -1
  71. package/lib/{index-BwKzYxA6.js → index-Cd59NVnR.js} +1 -1
  72. package/lib/{index-DNY0O-cL.mjs → index-CdEOzLdf.mjs} +2 -2
  73. package/lib/{index-CSzdqXmh.mjs → index-CigeXatZ.mjs} +4 -4
  74. package/lib/{index-Cg1wReFR.js → index-CmfSYre_.js} +1 -1
  75. package/lib/{index-DVZHJF07.js → index-D64s1-dG.js} +1 -1
  76. package/lib/{index-BUIiYLlH.mjs → index-D6m1fO15.mjs} +3 -3
  77. package/lib/{index-81Mcguum.js → index-DS2ZHd80.js} +8 -8
  78. package/lib/{index-2dPpzWcU.mjs → index-DUkWrti6.mjs} +3 -3
  79. package/lib/{index-BODyoUQW.js → index-D_q-W2ed.js} +1 -1
  80. package/lib/{index-D1EC5Fyw.mjs → index-DbBnUPGn.mjs} +5 -5
  81. package/lib/{index-AcgMG85v.js → index-Dmps0tPB.js} +1 -1
  82. package/lib/{index-lGQ2xH1S.js → index-DtX4ZfIw.js} +1 -1
  83. package/lib/{index-BT6Zn4Ib.js → index-VB_yaBQV.js} +1 -1
  84. package/lib/{index-CfdZx0OC.mjs → index-XHRIAH0_.mjs} +4 -4
  85. package/lib/{index-BNvI_y7j.mjs → index-Xwni1Chl.mjs} +6 -6
  86. package/lib/{index-BIfxqemx.mjs → index-cJBVdcGM.mjs} +2 -2
  87. package/lib/{index-BOHMEM35.js → index-eoE2y8W1.js} +1 -1
  88. package/lib/{index.es-aWTBhLBF.mjs → index.es-7SJGhkwJ.mjs} +4 -4
  89. package/lib/{index.es-DWMBdN3F.js → index.es-YWUQ6X17.js} +2 -2
  90. package/lib/index.js +1 -1
  91. package/lib/index.mjs +1 -1
  92. package/lib/{libsodium-wrappers-CRC9G0d4.js → libsodium-wrappers-BCDnjtN5.js} +1 -1
  93. package/lib/{libsodium-wrappers-BkfLfmmR.mjs → libsodium-wrappers-CfWZgzAB.mjs} +1 -1
  94. package/lib/{sei-HxbUKCwZ.mjs → sei-DhZ1wI-M.mjs} +2 -2
  95. package/lib/{sei-CSScRVqS.js → sei-aztOsSV_.js} +1 -1
  96. package/lib/{solana-DSLvSFqw.mjs → solana-BBZFE9PS.mjs} +3 -3
  97. package/lib/{solana-eSg-Jj5x.js → solana-BRXjarV7.js} +2 -2
  98. package/lib/{solana-B0L0mJP2.mjs → solana-DyvfTNdQ.mjs} +6 -6
  99. package/lib/{solana-DhaCvfC-.js → solana-g5LtR4oW.js} +1 -1
  100. package/lib/{solanaEmbed.esm-uuLzKO4T.mjs → solanaEmbed.esm-DZThG-FN.mjs} +2 -2
  101. package/lib/{solanaEmbed.esm-B6UqU5pj.js → solanaEmbed.esm-H4M7qCQq.js} +1 -1
  102. package/lib/src/utils/wallet/index.d.ts.map +1 -1
  103. package/lib/{sui-BD7ynhss.mjs → sui-C56stkgt.mjs} +1 -1
  104. package/lib/{sui-CsbRQbNt.js → sui-DVTcuAR1.js} +2 -2
  105. package/lib/{sui-CJb4CAqp.js → sui-VFUQmBgM.js} +1 -1
  106. package/lib/{sui-C1f7JrE1.mjs → sui-nWHHJ2B3.mjs} +4 -4
  107. package/lib/{unsignedTransaction-D_Tn7zm9.js → unsignedTransaction-CEpQCkFV.js} +1 -1
  108. package/lib/{unsignedTransaction-DWIoF80U.mjs → unsignedTransaction-D3jWTIyu.mjs} +2 -2
  109. package/package.json +1 -1
  110. package/dist/assets/cosmos-CZk6ggNU.js +0 -37
  111. package/dist/assets/index-CoAwWRVw.js +0 -3
  112. package/lib/cosmos-DZ53tCUv.js +0 -37
  113. package/lib/index-BFHIC-vL.js +0 -3
@@ -1,4 +1,4 @@
1
- "use strict";var Ir=Object.defineProperty;var xr=(e,t,r)=>t in e?Ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var V=(e,t,r)=>(xr(e,typeof t!="symbol"?t+"":t,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index-81Mcguum.js"),S=require("./sui-CsbRQbNt.js");require("./index-CWJvFytR.js");const Ar=require("./chain-Don0E4S-.js");class _r{constructor(t,r,n,i,s=!1){V(this,"transaction");V(this,"network");V(this,"chain");V(this,"description");V(this,"parallelizable");this.transaction=t,this.network=r,this.chain=n,this.description=i,this.parallelizable=s}}class Cr extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...o}=t,{path:a}=t,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function Br(e){return K(e)&&typeof e[Symbol.iterator]=="function"}function K(e){return typeof e=="object"&&e!=null}function J(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function $r(e){const{done:t,value:r}=e.next();return t?void 0:r}function Ur(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${J(n)}\``}=e;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...e,message:c}}function*Vt(e,t,r,n){Br(e)||(e=[e]);for(const i of e){const s=Ur(i,t,r,n);s&&(yield s)}}function*ut(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(e=t.coercer(e,a),o&&t.type!=="type"&&K(t.schema)&&K(e)&&!Array.isArray(e)))for(const d in e)t.schema[d]===void 0&&delete e[d];let c="valid";for(const d of t.validator(e,a))d.explanation=r.message,c="not_valid",yield[d,void 0];for(let[d,l,g]of t.entries(e,a)){const m=ut(l,g,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,l],coerce:s,mask:o,message:r.message});for(const y of m)y[0]?(c=y[0].refinement!=null?"not_refined":"not_valid",yield[y[0],void 0]):s&&(l=y[1],d===void 0?e=l:e instanceof Map?e.set(d,l):e instanceof Set?e.add(l):K(e)&&(l!==void 0||d in e)&&(e[d]=l))}if(c!=="not_valid")for(const d of t.refiner(e,a))d.explanation=r.message,c="not_refined",yield[d,void 0];c==="valid"&&(yield[void 0,e])}class te{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(c,d)=>{const l=i(c,d);return Vt(l,d,this,c)}:this.validator=()=>[],s?this.refiner=(c,d)=>{const l=s(c,d);return Vt(l,d,this,c)}:this.refiner=()=>[]}assert(t,r){return tt(t,this,r)}create(t,r){return Kt(t,this,r)}is(t){return L(t,this)}mask(t,r){return Jt(t,this,r)}validate(t,r={}){return Ie(t,this,r)}}function tt(e,t,r){const n=Ie(e,t,{message:r});if(n[0])throw n[0]}function Kt(e,t,r){const n=Ie(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Jt(e,t,r){const n=Ie(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function L(e,t){return!Ie(e,t)[0]}function Ie(e,t,r={}){const n=ut(e,t,r),i=$r(n);return i[0]?[new Cr(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function je(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?Rr(n):p(n)}function W(e,t){return new te({type:e,schema:null,validator:t})}function rt(){return W("any",()=>!0)}function E(e){return new te({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: ${J(t)}`}})}function Mr(){return W("bigint",e=>typeof e=="bigint")}function z(){return W("boolean",e=>typeof e=="boolean")}function ee(){return W("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${J(e)}`)}function v(e){const t=J(e),r=typeof e;return new te({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${J(n)}`}})}function qt(){return W("never",()=>!1)}function $(e){return new te({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function le(){return W("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${J(e)}`)}function p(e){const t=e?Object.keys(e):[],r=qt();return new te({type:"object",schema:e||null,*entries(n){if(e&&K(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 K(n)||`Expected an object, but received: ${J(n)}`},coercer(n){return K(n)?{...n}:n}})}function T(e){return new te({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function Q(e,t){return new te({type:"record",schema:null,*entries(r){if(K(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`}})}function h(){return W("string",e=>typeof e=="string"||`Expected a string, but received: ${J(e)}`)}function Ht(e){const t=qt();return new te({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: ${J(r)}`}})}function Rr(e){const t=Object.keys(e);return new te({type:"type",schema:e,*entries(r){if(K(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`},coercer(r){return K(r)?{...r}:r}})}function U(e){const t=e.map(r=>r.type).join(" | ");return new te({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[...o]=ut(r,s,n),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${J(r)}`,...i]}})}function Xt(){return W("unknown",()=>!0)}const dt=U([p({AddressOwner:h()}),p({ObjectOwner:h()}),p({Shared:p({initial_shared_version:$(h())})}),v("Immutable")]);W("SuiJsonValue",()=>!0);const Pr=U([p({u32:h()}),p({u64:h()}),p({f64:h()})]);p({attributes:Q(h(),$(Pr)),featureFlags:Q(h(),z()),maxSupportedProtocolVersion:h(),minSupportedProtocolVersion:h(),protocolVersion:h()});U([h(),v("package")]);const oe=p({digest:h(),objectId:h(),version:U([le(),h(),Mr()])});p({owner:dt,reference:oe});p({objectId:h(),sequenceNumber:h()});p({payment:E(oe),owner:h(),price:h(),budget:h()});const Nr=je(oe,p({type:h(),owner:dt,previousTransaction:h()})),Dr=Q(h(),rt()),zr=Q(h(),Xt()),Vr=p({type:h(),fields:Dr,hasPublicTransfer:z()}),Fr=p({disassembled:zr}),Gr=U([je(Vr,p({dataType:v("moveObject")})),je(Fr,p({dataType:v("package")}))]),Lr=p({type:h(),hasPublicTransfer:z(),version:h(),bcsBytes:h()}),Wr=p({id:h(),moduleMap:Q(h(),h())}),Kr=U([je(Lr,p({dataType:v("moveObject")})),je(Wr,p({dataType:v("package")}))]);BigInt(1e9);const Zt=p({code:h(),error:T(h()),object_id:T(h()),parent_object_id:T(h()),version:T(h()),digest:T(h())}),Jr=p({data:$(T(Q(h(),h()))),error:$(T(Zt))}),qr=U([Jr,T(Q(h(),h()))]),Yt=p({objectId:h(),version:h(),digest:h(),type:$(T(h())),content:$(T(Gr)),bcs:$(T(Kr)),owner:$(T(dt)),previousTransaction:$(T(h())),storageRebate:$(T(h())),display:$(T(qr))});p({showType:$(T(z())),showContent:$(T(z())),showBcs:$(T(z())),showOwner:$(T(z())),showPreviousTransaction:$(T(z())),showStorageRebate:$(T(z())),showDisplay:$(T(z()))});U([v("Exists"),v("notExists"),v("Deleted")]);E(Nr);const Hr=p({data:$(T(Yt)),error:$(T(Zt))});function Xr(e){return e.data}function Zr(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 Ft(e){if("reference"in e)return e.reference;const t=Xr(e);return t?{objectId:t.objectId,version:t.version,digest:t.digest}:Zr(e)}p({objectId:h(),atCheckpoint:T(le())});p({data:E(Hr),nextCursor:T($(h())),hasNextPage:z()});U([p({details:Yt,status:v("VersionFound")}),p({details:h(),status:v("ObjectNotExists")}),p({details:oe,status:v("ObjectDeleted")}),p({details:Ht([h(),le()]),status:v("VersionNotFound")}),p({details:p({asked_version:le(),latest_version:le(),object_id:h()}),status:v("VersionTooHigh")})]);const Yr=U([h(),p({Object:h()})]);E(Yr);const Qr=p({address:h(),name:h()}),en=U([v("Private"),v("Public"),v("Friend")]),lt=p({abilities:E(h())}),tn=p({constraints:lt,isPhantom:z()}),rn=p({TypeParameter:le()}),qe=Ht([p({module:h(),package:h(),function:h()}),h()]);p({rank3Days:E(qe),rank7Days:E(qe),rank30Days:E(qe)});function Qt(e){if(!e)return!1;if(typeof e=="string"||L(e,rn)||er(e))return!0;if(typeof e!="object")return!1;const t=e;return!!(L(t.Reference,pe)||L(t.MutableReference,pe)||L(t.Vector,pe))}const pe=W("SuiMoveNormalizedType",Qt);function er(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=>Qt(n)))}W("SuiMoveNormalizedStructType",er);const nn=p({visibility:en,isEntry:z(),typeParameters:E(lt),parameters:E(pe),return:E(pe)}),sn=p({name:h(),type:pe}),an=p({abilities:lt,typeParameters:E(tn),fields:E(sn)}),on=p({fileFormatVersion:le(),address:h(),name:h(),friends:E(Qr),structs:Q(h(),an),exposedFunctions:Q(h(),nn)});Q(h(),on);function nt(e){return typeof e=="object"&&"MutableReference"in e?e.MutableReference:void 0}function tr(e){return typeof e=="object"&&"Reference"in e?e.Reference:void 0}function ft(e){if(typeof e=="object"&&"Struct"in e)return e;const t=tr(e),r=nt(e);if(typeof t=="object"&&"Struct"in t)return t;if(typeof r=="object"&&"Struct"in r)return r}function cn(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 o=e.length,a=e.charAt(0),c=Math.log(o)/Math.log(256),d=Math.log(256)/Math.log(o);function l(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";for(var w=0,b=0,f=0,x=y.length;f!==x&&y[f]===0;)f++,w++;for(var C=(x-f)*d+1>>>0,P=new Uint8Array(C);f!==x;){for(var A=y[f],k=0,N=C-1;(A!==0||k<b)&&N!==-1;N--,k++)A+=256*P[N]>>>0,P[N]=A%o>>>0,A=A/o>>>0;if(A!==0)throw new Error("Non-zero carry");b=k,f++}for(var q=C-b;q!==C&&P[q]===0;)q++;for(var he=a.repeat(w);q<C;++q)he+=e.charAt(P[q]);return he}function g(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;for(var w=0,b=0,f=0;y[w]===a;)b++,w++;for(var x=(y.length-w)*c+1>>>0,C=new Uint8Array(x);y[w];){var P=t[y.charCodeAt(w)];if(P===255)return;for(var A=0,k=x-1;(P!==0||A<f)&&k!==-1;k--,A++)P+=o*C[k]>>>0,C[k]=P%256>>>0,P=P/256>>>0;if(P!==0)throw new Error("Non-zero carry");f=A,w++}for(var N=x-f;N!==x&&C[N]===0;)N++;for(var q=new Uint8Array(b+(x-N)),he=b;N!==x;)q[he++]=C[N++];return q}function m(y){var w=g(y);if(w)return w;throw new Error("Non-base"+o+" character")}return{encode:l,decodeUnsafe:g,decode:m}}var un=cn;const dn=un,ln="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var fn=dn(ln);const rr=B.getDefaultExportFromCjs(fn),xe=e=>rr.encode(e),ht=e=>rr.decode(e);function ce(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}const He=8192;function Ae(e){if(e.length<He)return btoa(String.fromCharCode(...e));let t="";for(var r=0;r<e.length;r+=He){const n=e.slice(r,r+He);t+=String.fromCharCode(...n)}return btoa(t)}function Ke(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 _e(e){return e.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}function gt(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 hn(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 nr{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}=hn(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 gn(e,t){switch(t){case"base58":return xe(e);case"base64":return Ae(e);case"hex":return _e(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function pn(e,t){switch(t){case"base58":return ht(e);case"base64":return ce(e);case"hex":return Ke(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function ir(e,t=["<",">"]){const[r,n]=t,i=[];let s="",o=0;for(let a=0;a<e.length;a++){const c=e[a];if(c===r&&o++,c===n&&o--,o===0&&c===","){i.push(s.trim()),s="";continue}s+=c}return i.push(s.trim()),i}class sr{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 Xe(BigInt(t),8).forEach(r=>this.write8(r)),this}write128(t){return Xe(BigInt(t),16).forEach(r=>this.write8(r)),this}write256(t){return Xe(BigInt(t),32).forEach(r=>this.write8(r)),this}writeULEB(t){return gt(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 gn(this.toBytes(),t)}}function Xe(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 ar=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},X=(e,t,r)=>(ar(e,t,"read from private field"),r?r.call(e):t.get(e)),ze=(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)},Ve=(e,t,r,n)=>(ar(e,t,"write to private field"),t.set(e,r),r),ge,be,Me,ae;const or=class{constructor(e){ze(this,ge,void 0),ze(this,be,void 0),this.name=e.name,this.read=e.read,this.serializedSize=e.serializedSize??(()=>null),Ve(this,ge,e.write),Ve(this,be,e.serialize??((t,r)=>{const n=new sr({size:this.serializedSize(t)??void 0,...r});return X(this,ge).call(this,t,n),n.toBytes()})),this.validate=e.validate??(()=>{})}write(e,t){this.validate(e),X(this,ge).call(this,e,t)}serialize(e,t){return this.validate(e),new yn(this,X(this,be).call(this,e,t))}parse(e){const t=new nr(e);return this.read(t)}transform({name:e,input:t,output:r}){return new or({name:e??this.name,read:n=>r(this.read(n)),write:(n,i)=>X(this,ge).call(this,t(n),i),serializedSize:n=>this.serializedSize(t(n)),serialize:(n,i)=>X(this,be).call(this,t(n),i),validate:n=>this.validate(t(n))})}};let Z=or;ge=new WeakMap;be=new WeakMap;const cr=Symbol.for("@mysten/serialized-bcs");function pt(e){return!!e&&typeof e=="object"&&e[cr]===!0}class yn{constructor(t,r){ze(this,Me,void 0),ze(this,ae,void 0),Ve(this,Me,t),Ve(this,ae,r)}get[cr](){return!0}toBytes(){return X(this,ae)}toHex(){return _e(X(this,ae))}toBase64(){return Ae(X(this,ae))}toBase58(){return xe(X(this,ae))}parse(){return X(this,Me).parse(X(this,ae))}}Me=new WeakMap;ae=new WeakMap;function Fe({size:e,...t}){return new Z({...t,serializedSize:()=>e})}function Ze({readMethod:e,writeMethod:t,...r}){return Fe({...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 Ye({readMethod:e,writeMethod:t,...r}){return Fe({...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 mn({serialize:e,...t}){const r=new Z({...t,serialize:e,write:(n,i)=>{for(const s of r.serialize(n).toBytes())i.write8(s)}});return r}function wn({toBytes:e,fromBytes:t,...r}){return new Z({...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 o=0;o<s.length;o++)i.write8(s[o])},serialize:n=>{const i=e(n),s=gt(i.length),o=new Uint8Array(s.length+i.length);return o.set(s,0),o.set(i,s.length),o},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 bn(e){let t=null;function r(){return t||(t=e()),t}return new Z({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 u={u8(e){return Ze({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e})},u16(e){return Ze({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e})},u32(e){return Ze({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e})},u64(e){return Ye({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e})},u128(e){return Ye({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e})},u256(e){return Ye({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e})},bool(e){return Fe({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 mn({name:"uleb128",read:t=>t.readULEB(),serialize:t=>Uint8Array.from(gt(t)),...e})},bytes(e,t){return Fe({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 wn({name:"string",toBytes:t=>new TextEncoder().encode(t),fromBytes:t=>new TextDecoder().decode(t),...e})},fixedArray(e,t,r){return new Z({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 u.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 Z({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 Z({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 Z({name:e,serializedSize:i=>{let s=0;for(const[o,a]of n){const c=a.serializedSize(i[o]);if(c==null)return null;s+=c}return s},read:i=>{const s={};for(const[o,a]of n)s[o]=a.read(i);return s},write:(i,s)=>{for(const[o,a]of n)a.write(i[o],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 Z({name:e,read:i=>{const s=i.readULEB(),[o,a]=n[s];return{[o]:(a==null?void 0:a.read(i))??!0}},write:(i,s)=>{const[o,a]=Object.entries(i)[0];for(let c=0;c<n.length;c++){const[d,l]=n[c];if(d===o){s.writeULEB(c),l==null||l.write(a,s);return}}},...r,validate:i=>{var a;if((a=r==null?void 0:r.validate)==null||a.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[o]=s;if(!Object.hasOwn(t,o))throw new TypeError(`Invalid enum variant ${o}`)}})},map(e,t){return u.vector(u.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 bn(e)}},Sn=32,Se=class{constructor(e){if(this.types=new Map,this.counter=0,e instanceof Se){this.schema=e.schema,this.types=new Map(e.types);return}if(this.schema=e,this.registerAddressType(Se.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&&Tn(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 Se(this).registerStructType(n,e).ser(n,t,r)}throw new Error(`Incorrect type passed into the '.ser()' function.
1
+ "use strict";var Ir=Object.defineProperty;var xr=(e,t,r)=>t in e?Ir(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var V=(e,t,r)=>(xr(e,typeof t!="symbol"?t+"":t,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const B=require("./index-DS2ZHd80.js"),S=require("./sui-DVTcuAR1.js");require("./index-6wTLnL9X.js");const Ar=require("./chain-j1F1mBU9.js");class _r{constructor(t,r,n,i,s=!1){V(this,"transaction");V(this,"network");V(this,"chain");V(this,"description");V(this,"parallelizable");this.transaction=t,this.network=r,this.chain=n,this.description=i,this.parallelizable=s}}class Cr extends TypeError{constructor(t,r){let n;const{message:i,explanation:s,...o}=t,{path:a}=t,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[t,...r()])}}function Br(e){return K(e)&&typeof e[Symbol.iterator]=="function"}function K(e){return typeof e=="object"&&e!=null}function J(e){return typeof e=="symbol"?e.toString():typeof e=="string"?JSON.stringify(e):`${e}`}function $r(e){const{done:t,value:r}=e.next();return t?void 0:r}function Ur(e,t,r,n){if(e===!0)return;e===!1?e={}:typeof e=="string"&&(e={message:e});const{path:i,branch:s}=t,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${J(n)}\``}=e;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...e,message:c}}function*Vt(e,t,r,n){Br(e)||(e=[e]);for(const i of e){const s=Ur(i,t,r,n);s&&(yield s)}}function*ut(e,t,r={}){const{path:n=[],branch:i=[e],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(e=t.coercer(e,a),o&&t.type!=="type"&&K(t.schema)&&K(e)&&!Array.isArray(e)))for(const d in e)t.schema[d]===void 0&&delete e[d];let c="valid";for(const d of t.validator(e,a))d.explanation=r.message,c="not_valid",yield[d,void 0];for(let[d,l,g]of t.entries(e,a)){const m=ut(l,g,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,l],coerce:s,mask:o,message:r.message});for(const y of m)y[0]?(c=y[0].refinement!=null?"not_refined":"not_valid",yield[y[0],void 0]):s&&(l=y[1],d===void 0?e=l:e instanceof Map?e.set(d,l):e instanceof Set?e.add(l):K(e)&&(l!==void 0||d in e)&&(e[d]=l))}if(c!=="not_valid")for(const d of t.refiner(e,a))d.explanation=r.message,c="not_refined",yield[d,void 0];c==="valid"&&(yield[void 0,e])}class te{constructor(t){const{type:r,schema:n,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=t;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(c,d)=>{const l=i(c,d);return Vt(l,d,this,c)}:this.validator=()=>[],s?this.refiner=(c,d)=>{const l=s(c,d);return Vt(l,d,this,c)}:this.refiner=()=>[]}assert(t,r){return tt(t,this,r)}create(t,r){return Kt(t,this,r)}is(t){return L(t,this)}mask(t,r){return Jt(t,this,r)}validate(t,r={}){return Ie(t,this,r)}}function tt(e,t,r){const n=Ie(e,t,{message:r});if(n[0])throw n[0]}function Kt(e,t,r){const n=Ie(e,t,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Jt(e,t,r){const n=Ie(e,t,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function L(e,t){return!Ie(e,t)[0]}function Ie(e,t,r={}){const n=ut(e,t,r),i=$r(n);return i[0]?[new Cr(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function je(...e){const t=e[0].type==="type",r=e.map(i=>i.schema),n=Object.assign({},...r);return t?Rr(n):p(n)}function W(e,t){return new te({type:e,schema:null,validator:t})}function rt(){return W("any",()=>!0)}function E(e){return new te({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: ${J(t)}`}})}function Mr(){return W("bigint",e=>typeof e=="bigint")}function z(){return W("boolean",e=>typeof e=="boolean")}function ee(){return W("integer",e=>typeof e=="number"&&!isNaN(e)&&Number.isInteger(e)||`Expected an integer, but received: ${J(e)}`)}function v(e){const t=J(e),r=typeof e;return new te({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?e:null,validator(n){return n===e||`Expected the literal \`${t}\`, but received: ${J(n)}`}})}function qt(){return W("never",()=>!1)}function $(e){return new te({...e,validator:(t,r)=>t===null||e.validator(t,r),refiner:(t,r)=>t===null||e.refiner(t,r)})}function le(){return W("number",e=>typeof e=="number"&&!isNaN(e)||`Expected a number, but received: ${J(e)}`)}function p(e){const t=e?Object.keys(e):[],r=qt();return new te({type:"object",schema:e||null,*entries(n){if(e&&K(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 K(n)||`Expected an object, but received: ${J(n)}`},coercer(n){return K(n)?{...n}:n}})}function T(e){return new te({...e,validator:(t,r)=>t===void 0||e.validator(t,r),refiner:(t,r)=>t===void 0||e.refiner(t,r)})}function Q(e,t){return new te({type:"record",schema:null,*entries(r){if(K(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`}})}function h(){return W("string",e=>typeof e=="string"||`Expected a string, but received: ${J(e)}`)}function Ht(e){const t=qt();return new te({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: ${J(r)}`}})}function Rr(e){const t=Object.keys(e);return new te({type:"type",schema:e,*entries(r){if(K(r))for(const n of t)yield[n,r[n],e[n]]},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`},coercer(r){return K(r)?{...r}:r}})}function U(e){const t=e.map(r=>r.type).join(" | ");return new te({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[...o]=ut(r,s,n),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${t}\`, but received: ${J(r)}`,...i]}})}function Xt(){return W("unknown",()=>!0)}const dt=U([p({AddressOwner:h()}),p({ObjectOwner:h()}),p({Shared:p({initial_shared_version:$(h())})}),v("Immutable")]);W("SuiJsonValue",()=>!0);const Pr=U([p({u32:h()}),p({u64:h()}),p({f64:h()})]);p({attributes:Q(h(),$(Pr)),featureFlags:Q(h(),z()),maxSupportedProtocolVersion:h(),minSupportedProtocolVersion:h(),protocolVersion:h()});U([h(),v("package")]);const oe=p({digest:h(),objectId:h(),version:U([le(),h(),Mr()])});p({owner:dt,reference:oe});p({objectId:h(),sequenceNumber:h()});p({payment:E(oe),owner:h(),price:h(),budget:h()});const Nr=je(oe,p({type:h(),owner:dt,previousTransaction:h()})),Dr=Q(h(),rt()),zr=Q(h(),Xt()),Vr=p({type:h(),fields:Dr,hasPublicTransfer:z()}),Fr=p({disassembled:zr}),Gr=U([je(Vr,p({dataType:v("moveObject")})),je(Fr,p({dataType:v("package")}))]),Lr=p({type:h(),hasPublicTransfer:z(),version:h(),bcsBytes:h()}),Wr=p({id:h(),moduleMap:Q(h(),h())}),Kr=U([je(Lr,p({dataType:v("moveObject")})),je(Wr,p({dataType:v("package")}))]);BigInt(1e9);const Zt=p({code:h(),error:T(h()),object_id:T(h()),parent_object_id:T(h()),version:T(h()),digest:T(h())}),Jr=p({data:$(T(Q(h(),h()))),error:$(T(Zt))}),qr=U([Jr,T(Q(h(),h()))]),Yt=p({objectId:h(),version:h(),digest:h(),type:$(T(h())),content:$(T(Gr)),bcs:$(T(Kr)),owner:$(T(dt)),previousTransaction:$(T(h())),storageRebate:$(T(h())),display:$(T(qr))});p({showType:$(T(z())),showContent:$(T(z())),showBcs:$(T(z())),showOwner:$(T(z())),showPreviousTransaction:$(T(z())),showStorageRebate:$(T(z())),showDisplay:$(T(z()))});U([v("Exists"),v("notExists"),v("Deleted")]);E(Nr);const Hr=p({data:$(T(Yt)),error:$(T(Zt))});function Xr(e){return e.data}function Zr(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 Ft(e){if("reference"in e)return e.reference;const t=Xr(e);return t?{objectId:t.objectId,version:t.version,digest:t.digest}:Zr(e)}p({objectId:h(),atCheckpoint:T(le())});p({data:E(Hr),nextCursor:T($(h())),hasNextPage:z()});U([p({details:Yt,status:v("VersionFound")}),p({details:h(),status:v("ObjectNotExists")}),p({details:oe,status:v("ObjectDeleted")}),p({details:Ht([h(),le()]),status:v("VersionNotFound")}),p({details:p({asked_version:le(),latest_version:le(),object_id:h()}),status:v("VersionTooHigh")})]);const Yr=U([h(),p({Object:h()})]);E(Yr);const Qr=p({address:h(),name:h()}),en=U([v("Private"),v("Public"),v("Friend")]),lt=p({abilities:E(h())}),tn=p({constraints:lt,isPhantom:z()}),rn=p({TypeParameter:le()}),qe=Ht([p({module:h(),package:h(),function:h()}),h()]);p({rank3Days:E(qe),rank7Days:E(qe),rank30Days:E(qe)});function Qt(e){if(!e)return!1;if(typeof e=="string"||L(e,rn)||er(e))return!0;if(typeof e!="object")return!1;const t=e;return!!(L(t.Reference,pe)||L(t.MutableReference,pe)||L(t.Vector,pe))}const pe=W("SuiMoveNormalizedType",Qt);function er(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=>Qt(n)))}W("SuiMoveNormalizedStructType",er);const nn=p({visibility:en,isEntry:z(),typeParameters:E(lt),parameters:E(pe),return:E(pe)}),sn=p({name:h(),type:pe}),an=p({abilities:lt,typeParameters:E(tn),fields:E(sn)}),on=p({fileFormatVersion:le(),address:h(),name:h(),friends:E(Qr),structs:Q(h(),an),exposedFunctions:Q(h(),nn)});Q(h(),on);function nt(e){return typeof e=="object"&&"MutableReference"in e?e.MutableReference:void 0}function tr(e){return typeof e=="object"&&"Reference"in e?e.Reference:void 0}function ft(e){if(typeof e=="object"&&"Struct"in e)return e;const t=tr(e),r=nt(e);if(typeof t=="object"&&"Struct"in t)return t;if(typeof r=="object"&&"Struct"in r)return r}function cn(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 o=e.length,a=e.charAt(0),c=Math.log(o)/Math.log(256),d=Math.log(256)/Math.log(o);function l(y){if(y instanceof Uint8Array||(ArrayBuffer.isView(y)?y=new Uint8Array(y.buffer,y.byteOffset,y.byteLength):Array.isArray(y)&&(y=Uint8Array.from(y))),!(y instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(y.length===0)return"";for(var w=0,b=0,f=0,x=y.length;f!==x&&y[f]===0;)f++,w++;for(var C=(x-f)*d+1>>>0,P=new Uint8Array(C);f!==x;){for(var A=y[f],k=0,N=C-1;(A!==0||k<b)&&N!==-1;N--,k++)A+=256*P[N]>>>0,P[N]=A%o>>>0,A=A/o>>>0;if(A!==0)throw new Error("Non-zero carry");b=k,f++}for(var q=C-b;q!==C&&P[q]===0;)q++;for(var he=a.repeat(w);q<C;++q)he+=e.charAt(P[q]);return he}function g(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;for(var w=0,b=0,f=0;y[w]===a;)b++,w++;for(var x=(y.length-w)*c+1>>>0,C=new Uint8Array(x);y[w];){var P=t[y.charCodeAt(w)];if(P===255)return;for(var A=0,k=x-1;(P!==0||A<f)&&k!==-1;k--,A++)P+=o*C[k]>>>0,C[k]=P%256>>>0,P=P/256>>>0;if(P!==0)throw new Error("Non-zero carry");f=A,w++}for(var N=x-f;N!==x&&C[N]===0;)N++;for(var q=new Uint8Array(b+(x-N)),he=b;N!==x;)q[he++]=C[N++];return q}function m(y){var w=g(y);if(w)return w;throw new Error("Non-base"+o+" character")}return{encode:l,decodeUnsafe:g,decode:m}}var un=cn;const dn=un,ln="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var fn=dn(ln);const rr=B.getDefaultExportFromCjs(fn),xe=e=>rr.encode(e),ht=e=>rr.decode(e);function ce(e){return Uint8Array.from(atob(e),t=>t.charCodeAt(0))}const He=8192;function Ae(e){if(e.length<He)return btoa(String.fromCharCode(...e));let t="";for(var r=0;r<e.length;r+=He){const n=e.slice(r,r+He);t+=String.fromCharCode(...n)}return btoa(t)}function Ke(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 _e(e){return e.reduce((t,r)=>t+r.toString(16).padStart(2,"0"),"")}function gt(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 hn(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 nr{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}=hn(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 gn(e,t){switch(t){case"base58":return xe(e);case"base64":return Ae(e);case"hex":return _e(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function pn(e,t){switch(t){case"base58":return ht(e);case"base64":return ce(e);case"hex":return Ke(e);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function ir(e,t=["<",">"]){const[r,n]=t,i=[];let s="",o=0;for(let a=0;a<e.length;a++){const c=e[a];if(c===r&&o++,c===n&&o--,o===0&&c===","){i.push(s.trim()),s="";continue}s+=c}return i.push(s.trim()),i}class sr{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 Xe(BigInt(t),8).forEach(r=>this.write8(r)),this}write128(t){return Xe(BigInt(t),16).forEach(r=>this.write8(r)),this}write256(t){return Xe(BigInt(t),32).forEach(r=>this.write8(r)),this}writeULEB(t){return gt(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 gn(this.toBytes(),t)}}function Xe(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 ar=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},X=(e,t,r)=>(ar(e,t,"read from private field"),r?r.call(e):t.get(e)),ze=(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)},Ve=(e,t,r,n)=>(ar(e,t,"write to private field"),t.set(e,r),r),ge,be,Me,ae;const or=class{constructor(e){ze(this,ge,void 0),ze(this,be,void 0),this.name=e.name,this.read=e.read,this.serializedSize=e.serializedSize??(()=>null),Ve(this,ge,e.write),Ve(this,be,e.serialize??((t,r)=>{const n=new sr({size:this.serializedSize(t)??void 0,...r});return X(this,ge).call(this,t,n),n.toBytes()})),this.validate=e.validate??(()=>{})}write(e,t){this.validate(e),X(this,ge).call(this,e,t)}serialize(e,t){return this.validate(e),new yn(this,X(this,be).call(this,e,t))}parse(e){const t=new nr(e);return this.read(t)}transform({name:e,input:t,output:r}){return new or({name:e??this.name,read:n=>r(this.read(n)),write:(n,i)=>X(this,ge).call(this,t(n),i),serializedSize:n=>this.serializedSize(t(n)),serialize:(n,i)=>X(this,be).call(this,t(n),i),validate:n=>this.validate(t(n))})}};let Z=or;ge=new WeakMap;be=new WeakMap;const cr=Symbol.for("@mysten/serialized-bcs");function pt(e){return!!e&&typeof e=="object"&&e[cr]===!0}class yn{constructor(t,r){ze(this,Me,void 0),ze(this,ae,void 0),Ve(this,Me,t),Ve(this,ae,r)}get[cr](){return!0}toBytes(){return X(this,ae)}toHex(){return _e(X(this,ae))}toBase64(){return Ae(X(this,ae))}toBase58(){return xe(X(this,ae))}parse(){return X(this,Me).parse(X(this,ae))}}Me=new WeakMap;ae=new WeakMap;function Fe({size:e,...t}){return new Z({...t,serializedSize:()=>e})}function Ze({readMethod:e,writeMethod:t,...r}){return Fe({...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 Ye({readMethod:e,writeMethod:t,...r}){return Fe({...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 mn({serialize:e,...t}){const r=new Z({...t,serialize:e,write:(n,i)=>{for(const s of r.serialize(n).toBytes())i.write8(s)}});return r}function wn({toBytes:e,fromBytes:t,...r}){return new Z({...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 o=0;o<s.length;o++)i.write8(s[o])},serialize:n=>{const i=e(n),s=gt(i.length),o=new Uint8Array(s.length+i.length);return o.set(s,0),o.set(i,s.length),o},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 bn(e){let t=null;function r(){return t||(t=e()),t}return new Z({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 u={u8(e){return Ze({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e})},u16(e){return Ze({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e})},u32(e){return Ze({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e})},u64(e){return Ye({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e})},u128(e){return Ye({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e})},u256(e){return Ye({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e})},bool(e){return Fe({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 mn({name:"uleb128",read:t=>t.readULEB(),serialize:t=>Uint8Array.from(gt(t)),...e})},bytes(e,t){return Fe({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 wn({name:"string",toBytes:t=>new TextEncoder().encode(t),fromBytes:t=>new TextDecoder().decode(t),...e})},fixedArray(e,t,r){return new Z({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 u.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 Z({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 Z({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 Z({name:e,serializedSize:i=>{let s=0;for(const[o,a]of n){const c=a.serializedSize(i[o]);if(c==null)return null;s+=c}return s},read:i=>{const s={};for(const[o,a]of n)s[o]=a.read(i);return s},write:(i,s)=>{for(const[o,a]of n)a.write(i[o],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 Z({name:e,read:i=>{const s=i.readULEB(),[o,a]=n[s];return{[o]:(a==null?void 0:a.read(i))??!0}},write:(i,s)=>{const[o,a]=Object.entries(i)[0];for(let c=0;c<n.length;c++){const[d,l]=n[c];if(d===o){s.writeULEB(c),l==null||l.write(a,s);return}}},...r,validate:i=>{var a;if((a=r==null?void 0:r.validate)==null||a.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[o]=s;if(!Object.hasOwn(t,o))throw new TypeError(`Invalid enum variant ${o}`)}})},map(e,t){return u.vector(u.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 bn(e)}},Sn=32,Se=class{constructor(e){if(this.types=new Map,this.counter=0,e instanceof Se){this.schema=e.schema,this.types=new Map(e.types);return}if(this.schema=e,this.registerAddressType(Se.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&&Tn(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 Se(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=pn(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 Se(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(o,a,c,d){const l=s.reduce((g,m,y)=>Object.assign(g,{[m]:d[y]}),{});return this._encodeRaw.call(o,new sr(c),a,d,l)},decode(o,a,c){const d=s.reduce((l,g,m)=>Object.assign(l,{[g]:c[m]}),{});return this._decodeRaw.call(o,new nr(a),c,d)},_encodeRaw(o,a,c,d){if(n(a))return t.call(this,o,a,c,d);throw new Error(`Validation failed for type ${i}, data: ${a}`)},_decodeRaw(o,a,c){return r.call(this,o,a,c)}}),this}registerBcsType(e,t){return this.registerType(e,(r,n,i)=>{const s=i.map(o=>new Z({name:String(o),write:(a,c)=>{const{name:d,params:l}=this.parseTypeName(o),g=this.getTypeInterface(d),m=l.reduce((y,w,b)=>Object.assign(y,{[w]:i[b]}),{});return g._encodeRaw.call(this,c,a,l,m)},read:()=>{throw new Error("Not implemented")}}));return t(...s).write(n,r),r},(r,n)=>{const i=n.map(s=>new Z({name:String(s),write:(o,a)=>{throw new Error("Not implemented")},read:o=>{const{name:a,params:c}=this.parseTypeName(s),d=this.getTypeInterface(a),l=c.reduce((g,m,y)=>Object.assign(g,{[m]:n[y]}),{});return d._decodeRaw.call(this,o,c,l)}}));return t(...i).read(r)}),this}registerAddressType(e,t,r="hex"){switch(r){case"base64":return this.registerType(e,function(i,s){return ce(s).reduce((o,a)=>o.write8(a),i)},function(i){return Ae(i.readBytes(t))});case"hex":return this.registerType(e,function(i,s){return Ke(s).reduce((o,a)=>o.write8(a),i)},function(i){return _e(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,o,a){return i.writeVec(s,(c,d)=>{let l=o[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,c,d,m,a);if(!(g in a))throw new Error(`Unable to find a matching type definition for ${g} in vector; make sure you passed a generic`);let{name:y,params:w}=this.parseTypeName(a[g]);return this.getTypeInterface(y)._encodeRaw.call(this,c,d,w,a)})},function(i,s,o){return i.readVec(a=>{let c=s[0];if(!c)throw new Error(`Incorrect number of type parameters passed to a vector '${e}'`);let{name:d,params:l}=this.parseTypeName(c);if(this.hasType(d))return this.getTypeInterface(d)._decodeRaw.call(this,a,l,o);if(!(d in o))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(o[d]);return this.getTypeInterface(g)._decodeRaw.call(this,a,m,o)})})}registerStructType(e,t){for(let o in t){let a=this.tempKey(),c=t[o];!Array.isArray(c)&&typeof c!="string"&&(t[o]=a,this.registerStructType(a,c))}let r=Object.freeze(t),n=Object.keys(r),{name:i,params:s}=this.parseTypeName(e);return this.registerType(e,function(a,c,d,l){if(!c||c.constructor!==Object)throw new Error(`Expected ${i} to be an Object, got: ${c}`);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 c))throw new Error(`Struct ${i} requires field ${g}:${r[g]}`);const{name:m,params:y}=this.parseTypeName(r[g]);if(!s.includes(m))this.getTypeInterface(m)._encodeRaw.call(this,a,c[g],y,l);else{const w=s.indexOf(m);let{name:b,params:f}=this.parseTypeName(d[w]);if(this.hasType(b)){this.getTypeInterface(b)._encodeRaw.call(this,a,c[g],f,l);continue}if(!(b in l))throw new Error(`Unable to find a matching type definition for ${b} in ${i}; make sure you passed a generic`);let{name:x,params:C}=this.parseTypeName(l[b]);this.getTypeInterface(x)._encodeRaw.call(this,a,c[g],C,l)}}return a},function(a,c,d){if(c.length!==s.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${s.length}, got: ${c.length}`);let l={};for(let g of n){const{name:m,params:y}=this.parseTypeName(r[g]);if(!s.includes(m))l[g]=this.getTypeInterface(m)._decodeRaw.call(this,a,y,d);else{const w=s.indexOf(m);let{name:b,params:f}=this.parseTypeName(c[w]);if(this.hasType(b)){l[g]=this.getTypeInterface(b)._decodeRaw.call(this,a,f,d);continue}if(!(b in d))throw new Error(`Unable to find a matching type definition for ${b} in ${i}; make sure you passed a generic`);let{name:x,params:C}=this.parseTypeName(d[b]);l[g]=this.getTypeInterface(x)._decodeRaw.call(this,a,C,d)}}return l})}registerEnumType(e,t){for(let o in t){let a=this.tempKey(),c=t[o];c!==null&&!Array.isArray(c)&&typeof c!="string"&&(t[o]=a,this.registerStructType(a,c))}let r=Object.freeze(t),n=Object.keys(r),{name:i,params:s}=this.parseTypeName(e);return this.registerType(e,function(a,c,d,l){if(!c)throw new Error(`Unable to write enum "${i}", missing data.
4
4
  Received: "${c}"`);if(typeof c!="object")throw new Error(`Incorrect data passed into enum "${i}", expected object with properties: "${n.join(" | ")}".
@@ -1,4 +1,4 @@
1
- import { o as P, d as Z, q as Ye, bV as Ze, as as it } from "./index-1hVb2x71.mjs";
1
+ import { o as P, q as Ye, d as Z, bV as Ze, as as it } from "./index-7BQZXfWl.mjs";
2
2
  var Je = {}, Qe = { exports: {} }, je = {};
3
3
  (function(o) {
4
4
  o.fetch = n(P.fetch) && n(P.ReadableStream), o.writableStream = n(P.WritableStream), o.abortController = n(P.AbortController);
@@ -33,13 +33,13 @@ var Je = {}, Qe = { exports: {} }, je = {};
33
33
  }
34
34
  r = null;
35
35
  })(je);
36
- var qe = {}, We = je, ft = Ye, et = Ze, Ae = qe.readyStates = {
36
+ var xe = {}, We = je, ft = Ye(), et = Ze, Ae = xe.readyStates = {
37
37
  UNSENT: 0,
38
38
  OPENED: 1,
39
39
  HEADERS_RECEIVED: 2,
40
40
  LOADING: 3,
41
41
  DONE: 4
42
- }, $e = qe.IncomingMessage = function(o, r, h, f) {
42
+ }, $e = xe.IncomingMessage = function(o, r, h, f) {
43
43
  var n = this;
44
44
  if (et.Readable.call(n), n._mode = h, n.headers = {}, n.rawHeaders = [], n.trailers = {}, n.rawTrailers = [], n.on("end", function() {
45
45
  Z.process.nextTick(function() {
@@ -147,11 +147,11 @@ $e.prototype._onXHRProgress = function(o) {
147
147
  }
148
148
  r._xhr.readyState === Ae.DONE && r._mode !== "ms-stream" && (o(!0), r.push(null));
149
149
  };
150
- var he = je, ht = Ye, tt = qe, ke = Ze, ut = tt.IncomingMessage, Ke = tt.readyStates;
150
+ var he = je, ht = Ye(), tt = xe, ke = Ze, ut = tt.IncomingMessage, Ke = tt.readyStates;
151
151
  function ct(o, r) {
152
152
  return he.fetch && r ? "fetch" : he.mozchunkedarraybuffer ? "moz-chunked-arraybuffer" : he.msstream ? "ms-stream" : he.arraybuffer && o ? "arraybuffer" : "text";
153
153
  }
154
- var S = Qe.exports = function(o) {
154
+ var I = Qe.exports = function(o) {
155
155
  var r = this;
156
156
  ke.Writable.call(r), r._opts = o, r._body = [], r._headers = {}, o.auth && r.setHeader("Authorization", "Basic " + Z.Buffer.from(o.auth).toString("base64")), Object.keys(o.headers).forEach(function(n) {
157
157
  r.setHeader(n, o.headers[n]);
@@ -171,23 +171,23 @@ var S = Qe.exports = function(o) {
171
171
  r._onFinish();
172
172
  });
173
173
  };
174
- ht(S, ke.Writable);
175
- S.prototype.setHeader = function(o, r) {
174
+ ht(I, ke.Writable);
175
+ I.prototype.setHeader = function(o, r) {
176
176
  var h = this, f = o.toLowerCase();
177
177
  pt.indexOf(f) === -1 && (h._headers[f] = {
178
178
  name: o,
179
179
  value: r
180
180
  });
181
181
  };
182
- S.prototype.getHeader = function(o) {
182
+ I.prototype.getHeader = function(o) {
183
183
  var r = this._headers[o.toLowerCase()];
184
184
  return r ? r.value : null;
185
185
  };
186
- S.prototype.removeHeader = function(o) {
186
+ I.prototype.removeHeader = function(o) {
187
187
  var r = this;
188
188
  delete r._headers[o.toLowerCase()];
189
189
  };
190
- S.prototype._onFinish = function() {
190
+ I.prototype._onFinish = function() {
191
191
  var o = this;
192
192
  if (!o._destroyed) {
193
193
  var r = o._opts;
@@ -267,43 +267,43 @@ function lt(o) {
267
267
  return !1;
268
268
  }
269
269
  }
270
- S.prototype._onXHRProgress = function() {
270
+ I.prototype._onXHRProgress = function() {
271
271
  var o = this;
272
272
  o._resetTimers(!1), !(!lt(o._xhr) || o._destroyed) && (o._response || o._connect(), o._response._onXHRProgress(o._resetTimers.bind(o)));
273
273
  };
274
- S.prototype._connect = function() {
274
+ I.prototype._connect = function() {
275
275
  var o = this;
276
276
  o._destroyed || (o._response = new ut(o._xhr, o._fetchResponse, o._mode, o._resetTimers.bind(o)), o._response.on("error", function(r) {
277
277
  o.emit("error", r);
278
278
  }), o.emit("response", o._response));
279
279
  };
280
- S.prototype._write = function(o, r, h) {
280
+ I.prototype._write = function(o, r, h) {
281
281
  var f = this;
282
282
  f._body.push(o), h();
283
283
  };
284
- S.prototype._resetTimers = function(o) {
284
+ I.prototype._resetTimers = function(o) {
285
285
  var r = this;
286
286
  P.clearTimeout(r._socketTimer), r._socketTimer = null, o ? (P.clearTimeout(r._fetchTimer), r._fetchTimer = null) : r._socketTimeout && (r._socketTimer = P.setTimeout(function() {
287
287
  r.emit("timeout");
288
288
  }, r._socketTimeout));
289
289
  };
290
- S.prototype.abort = S.prototype.destroy = function(o) {
290
+ I.prototype.abort = I.prototype.destroy = function(o) {
291
291
  var r = this;
292
292
  r._destroyed = !0, r._resetTimers(!0), r._response && (r._response._destroyed = !0), r._xhr ? r._xhr.abort() : r._fetchAbortController && r._fetchAbortController.abort(), o && r.emit("error", o);
293
293
  };
294
- S.prototype.end = function(o, r, h) {
294
+ I.prototype.end = function(o, r, h) {
295
295
  var f = this;
296
296
  typeof o == "function" && (h = o, o = void 0), ke.Writable.prototype.end.call(f, o, r, h);
297
297
  };
298
- S.prototype.setTimeout = function(o, r) {
298
+ I.prototype.setTimeout = function(o, r) {
299
299
  var h = this;
300
300
  r && h.once("timeout", r), h._socketTimeout = o, h._resetTimers(!1);
301
301
  };
302
- S.prototype.flushHeaders = function() {
302
+ I.prototype.flushHeaders = function() {
303
303
  };
304
- S.prototype.setNoDelay = function() {
304
+ I.prototype.setNoDelay = function() {
305
305
  };
306
- S.prototype.setSocketKeepAlive = function() {
306
+ I.prototype.setSocketKeepAlive = function() {
307
307
  };
308
308
  var pt = [
309
309
  "accept-charset",
@@ -398,14 +398,14 @@ var gt = {
398
398
  509: "Bandwidth Limit Exceeded",
399
399
  510: "Not Extended",
400
400
  511: "Network Authentication Required"
401
- }, He = { exports: {} }, xe = { exports: {} };
401
+ }, He = { exports: {} }, qe = { exports: {} };
402
402
  /*! https://mths.be/punycode v1.4.1 by @mathias */
403
- xe.exports;
403
+ qe.exports;
404
404
  (function(o, r) {
405
405
  (function(h) {
406
406
  var f = r && !r.nodeType && r, n = o && !o.nodeType && o, g = typeof P == "object" && P;
407
407
  (g.global === g || g.window === g || g.self === g) && (h = g);
408
- var u, a = 2147483647, v = 36, T = 1, C = 26, m = 38, A = 700, te = 72, ae = 128, I = "-", Oe = /^xn--/, Ee = /[^\x20-\x7E]/, Ue = /[\x2E\u3002\uFF0E\uFF61]/g, Le = {
408
+ var u, a = 2147483647, v = 36, T = 1, C = 26, m = 38, A = 700, te = 72, ae = 128, S = "-", Oe = /^xn--/, Ee = /[^\x20-\x7E]/, Ue = /[\x2E\u3002\uFF0E\uFF61]/g, Le = {
409
409
  overflow: "Overflow: input needs wider integers to process",
410
410
  "not-basic": "Illegal input >= 0x80 (not a basic code point)",
411
411
  "invalid-input": "Invalid input"
@@ -448,25 +448,25 @@ xe.exports;
448
448
  return M(b + (pe + 1) * i / (i + m));
449
449
  }
450
450
  function we(i) {
451
- var p = [], y = i.length, b, w = 0, U = ae, x = te, R, N, B, G, L, H, k, V, Q;
452
- for (R = i.lastIndexOf(I), R < 0 && (R = 0), N = 0; N < R; ++N)
451
+ var p = [], y = i.length, b, w = 0, U = ae, q = te, R, N, B, G, L, H, k, V, Q;
452
+ for (R = i.lastIndexOf(S), R < 0 && (R = 0), N = 0; N < R; ++N)
453
453
  i.charCodeAt(N) >= 128 && J("not-basic"), p.push(i.charCodeAt(N));
454
454
  for (B = R > 0 ? R + 1 : 0; B < y; ) {
455
- for (G = w, L = 1, H = v; B >= y && J("invalid-input"), k = oe(i.charCodeAt(B++)), (k >= v || k > M((a - w) / L)) && J("overflow"), w += k * L, V = H <= x ? T : H >= x + C ? C : H - x, !(k < V); H += v)
455
+ for (G = w, L = 1, H = v; B >= y && J("invalid-input"), k = oe(i.charCodeAt(B++)), (k >= v || k > M((a - w) / L)) && J("overflow"), w += k * L, V = H <= q ? T : H >= q + C ? C : H - q, !(k < V); H += v)
456
456
  Q = v - V, L > M(a / Q) && J("overflow"), L *= Q;
457
- b = p.length + 1, x = ne(w - G, b, G == 0), M(w / b) > a - U && J("overflow"), U += M(w / b), w %= b, p.splice(w++, 0, U);
457
+ b = p.length + 1, q = ne(w - G, b, G == 0), M(w / b) > a - U && J("overflow"), U += M(w / b), w %= b, p.splice(w++, 0, U);
458
458
  }
459
459
  return ue(p);
460
460
  }
461
461
  function Re(i) {
462
- var p, y, b, w, U, x, R, N, B, G, L, H = [], k, V, Q, me;
463
- for (i = Te(i), k = i.length, p = ae, y = 0, U = te, x = 0; x < k; ++x)
464
- L = i[x], L < 128 && H.push(re(L));
465
- for (b = w = H.length, w && H.push(I); b < k; ) {
466
- for (R = a, x = 0; x < k; ++x)
467
- L = i[x], L >= p && L < R && (R = L);
468
- for (V = b + 1, R - p > M((a - y) / V) && J("overflow"), y += (R - p) * V, p = R, x = 0; x < k; ++x)
469
- if (L = i[x], L < p && ++y > a && J("overflow"), L == p) {
462
+ var p, y, b, w, U, q, R, N, B, G, L, H = [], k, V, Q, me;
463
+ for (i = Te(i), k = i.length, p = ae, y = 0, U = te, q = 0; q < k; ++q)
464
+ L = i[q], L < 128 && H.push(re(L));
465
+ for (b = w = H.length, w && H.push(S); b < k; ) {
466
+ for (R = a, q = 0; q < k; ++q)
467
+ L = i[q], L >= p && L < R && (R = L);
468
+ for (V = b + 1, R - p > M((a - y) / V) && J("overflow"), y += (R - p) * V, p = R, q = 0; q < k; ++q)
469
+ if (L = i[q], L < p && ++y > a && J("overflow"), L == p) {
470
470
  for (N = y, B = v; G = B <= U ? T : B >= U + C ? C : B - U, !(N < G); B += v)
471
471
  me = N - G, Q = v - G, H.push(
472
472
  re(ce(G + me % Q, 0))
@@ -482,7 +482,7 @@ xe.exports;
482
482
  return Oe.test(p) ? we(p.slice(4).toLowerCase()) : p;
483
483
  });
484
484
  }
485
- function Se(i) {
485
+ function Ie(i) {
486
486
  return be(i, function(p) {
487
487
  return Ee.test(p) ? "xn--" + Re(p) : p;
488
488
  });
@@ -507,7 +507,7 @@ xe.exports;
507
507
  },
508
508
  decode: we,
509
509
  encode: Re,
510
- toASCII: Se,
510
+ toASCII: Ie,
511
511
  toUnicode: Pe
512
512
  }, f && n)
513
513
  if (o.exports == f)
@@ -518,8 +518,8 @@ xe.exports;
518
518
  else
519
519
  h.punycode = u;
520
520
  })(P);
521
- })(xe, xe.exports);
522
- var _t = xe.exports;
521
+ })(qe, qe.exports);
522
+ var _t = qe.exports;
523
523
  (function(o, r) {
524
524
  Object.defineProperty(r, "__esModule", { value: !0 });
525
525
  var h = _t, f = it;
@@ -539,8 +539,8 @@ var _t = xe.exports;
539
539
  isNullOrUndefined: function(e) {
540
540
  return e == null;
541
541
  }
542
- }, v = g.default, T = a, C = ne, m = Re, A = Pe, te = we, ae = I;
543
- function I() {
542
+ }, v = g.default, T = a, C = ne, m = Re, A = Pe, te = we, ae = S;
543
+ function S() {
544
544
  this.protocol = null, this.slashes = null, this.auth = null, this.host = null, this.port = null, this.hostname = null, this.hash = null, this.search = null, this.query = null, this.pathname = null, this.path = null, this.href = null;
545
545
  }
546
546
  var Oe = /^([a-z0-9.+-]+:)/i, Ee = /:[0-9]*$/, Ue = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/, Le = ["<", ">", '"', "`", " ", "\r", `
@@ -563,12 +563,12 @@ var _t = xe.exports;
563
563
  "file:": !0
564
564
  }, ce = u.default;
565
565
  function ne(e, s, t) {
566
- if (e && T.isObject(e) && e instanceof I)
566
+ if (e && T.isObject(e) && e instanceof S)
567
567
  return e;
568
- var l = new I();
568
+ var l = new S();
569
569
  return l.parse(e, s, t), l;
570
570
  }
571
- I.prototype.parse = function(e, s, t) {
571
+ S.prototype.parse = function(e, s, t) {
572
572
  if (!T.isString(e))
573
573
  throw new TypeError("Parameter 'url' must be a string, not " + typeof e);
574
574
  var l = e.indexOf("?"), _ = l !== -1 && l < e.indexOf("#") ? "?" : "#", D = e.split(_), j = /\\/g;
@@ -579,17 +579,17 @@ var _t = xe.exports;
579
579
  if (W)
580
580
  return this.path = c, this.href = c, this.pathname = W[1], W[2] ? (this.search = W[2], s ? this.query = ce.parse(this.search.substr(1)) : this.query = this.search.substr(1)) : s && (this.search = "", this.query = {}), this;
581
581
  }
582
- var q = Oe.exec(c);
583
- if (q) {
584
- q = q[0];
585
- var fe = q.toLowerCase();
586
- this.protocol = fe, c = c.substr(q.length);
582
+ var x = Oe.exec(c);
583
+ if (x) {
584
+ x = x[0];
585
+ var fe = x.toLowerCase();
586
+ this.protocol = fe, c = c.substr(x.length);
587
587
  }
588
- if (t || q || c.match(/^\/\/[^@\/]+@[^@\/]+/)) {
588
+ if (t || x || c.match(/^\/\/[^@\/]+@[^@\/]+/)) {
589
589
  var ve = c.substr(0, 2) === "//";
590
- ve && !(q && ue[q]) && (c = c.substr(2), this.slashes = !0);
590
+ ve && !(x && ue[x]) && (c = c.substr(2), this.slashes = !0);
591
591
  }
592
- if (!ue[q] && (ve || q && !oe[q])) {
592
+ if (!ue[x] && (ve || x && !oe[x])) {
593
593
  for (var F = -1, O = 0; O < ie.length; O++) {
594
594
  var ee = c.indexOf(ie[O]);
595
595
  ee !== -1 && (F === -1 || ee < F) && (F = ee);
@@ -606,7 +606,7 @@ var _t = xe.exports;
606
606
  for (var d = this.hostname.split(/\./), O = 0, E = d.length; O < E; O++) {
607
607
  var K = d[O];
608
608
  if (K && !K.match(de)) {
609
- for (var z = "", X = 0, Ie = K.length; X < Ie; X++)
609
+ for (var z = "", X = 0, Se = K.length; X < Se; X++)
610
610
  K.charCodeAt(X) > 127 ? z += "x" : z += K[X];
611
611
  if (!z.match(de)) {
612
612
  var se = d.slice(0, O), Y = d.slice(O + 1), le = K.match(be);
@@ -637,9 +637,9 @@ var _t = xe.exports;
637
637
  return this.href = this.format(), this;
638
638
  };
639
639
  function we(e) {
640
- return T.isString(e) && (e = ne(e)), e instanceof I ? e.format() : I.prototype.format.call(e);
640
+ return T.isString(e) && (e = ne(e)), e instanceof S ? e.format() : S.prototype.format.call(e);
641
641
  }
642
- I.prototype.format = function() {
642
+ S.prototype.format = function() {
643
643
  var e = this.auth || "";
644
644
  e && (e = encodeURIComponent(e), e = e.replace(/%3A/i, ":"), e += "@");
645
645
  var s = this.protocol || "", t = this.pathname || "", l = this.hash || "", _ = !1, D = "";
@@ -652,18 +652,18 @@ var _t = xe.exports;
652
652
  function Re(e, s) {
653
653
  return ne(e, !1, !0).resolve(s);
654
654
  }
655
- I.prototype.resolve = function(e) {
655
+ S.prototype.resolve = function(e) {
656
656
  return this.resolveObject(ne(e, !1, !0)).format();
657
657
  };
658
658
  function Pe(e, s) {
659
659
  return e ? ne(e, !1, !0).resolveObject(s) : s;
660
660
  }
661
- I.prototype.resolveObject = function(e) {
661
+ S.prototype.resolveObject = function(e) {
662
662
  if (T.isString(e)) {
663
- var s = new I();
663
+ var s = new S();
664
664
  s.parse(e, !1, !0), e = s;
665
665
  }
666
- for (var t = new I(), l = Object.keys(this), _ = 0; _ < l.length; _++) {
666
+ for (var t = new S(), l = Object.keys(this), _ = 0; _ < l.length; _++) {
667
667
  var D = l[_];
668
668
  t[D] = this[D];
669
669
  }
@@ -678,8 +678,8 @@ var _t = xe.exports;
678
678
  }
679
679
  if (e.protocol && e.protocol !== t.protocol) {
680
680
  if (!oe[e.protocol]) {
681
- for (var q = Object.keys(e), fe = 0; fe < q.length; fe++) {
682
- var ve = q[fe];
681
+ for (var x = Object.keys(e), fe = 0; fe < x.length; fe++) {
682
+ var ve = x[fe];
683
683
  t[ve] = e[ve];
684
684
  }
685
685
  return t.href = t.format(), t;
@@ -711,12 +711,12 @@ var _t = xe.exports;
711
711
  }
712
712
  if (!d.length)
713
713
  return t.pathname = null, t.search ? t.path = "/" + t.search : t.path = null, t.href = t.format(), t;
714
- for (var X = d.slice(-1)[0], Ie = (t.host || e.host || d.length > 1) && (X === "." || X === "..") || X === "", se = 0, Y = d.length; Y >= 0; Y--)
714
+ for (var X = d.slice(-1)[0], Se = (t.host || e.host || d.length > 1) && (X === "." || X === "..") || X === "", se = 0, Y = d.length; Y >= 0; Y--)
715
715
  X = d[Y], X === "." ? d.splice(Y, 1) : X === ".." ? (d.splice(Y, 1), se++) : se && (d.splice(Y, 1), se--);
716
716
  if (!$ && !ge)
717
717
  for (; se--; se)
718
718
  d.unshift("..");
719
- $ && d[0] !== "" && (!d[0] || d[0].charAt(0) !== "/") && d.unshift(""), Ie && d.join("/").substr(-1) !== "/" && d.push("");
719
+ $ && d[0] !== "" && (!d[0] || d[0].charAt(0) !== "/") && d.unshift(""), Se && d.join("/").substr(-1) !== "/" && d.push("");
720
720
  var le = d[0] === "" || d[0] && d[0].charAt(0) === "/";
721
721
  if (K) {
722
722
  t.hostname = t.host = le ? "" : d.length ? d.shift() : "";
@@ -724,11 +724,11 @@ var _t = xe.exports;
724
724
  z && (t.auth = z.shift(), t.host = t.hostname = z.shift());
725
725
  }
726
726
  return $ = $ || t.host && d.length, $ && !le && d.unshift(""), d.length ? t.pathname = d.join("/") : (t.pathname = null, t.path = null), (!T.isNull(t.pathname) || !T.isNull(t.search)) && (t.path = (t.pathname ? t.pathname : "") + (t.search ? t.search : "")), t.auth = e.auth || t.auth, t.slashes = t.slashes || e.slashes, t.href = t.format(), t;
727
- }, I.prototype.parseHost = function() {
727
+ }, S.prototype.parseHost = function() {
728
728
  var e = this.host, s = Ee.exec(e);
729
729
  s && (s = s[0], s !== ":" && (this.port = s.substr(1)), e = e.substr(0, e.length - s.length)), e && (this.hostname = e);
730
730
  };
731
- function Se(e, s) {
731
+ function Ie(e, s) {
732
732
  for (var t = 0, l = e.length - 1; l >= 0; l--) {
733
733
  var _ = e[l];
734
734
  _ === "." ? e.splice(l, 1) : _ === ".." ? (e.splice(l, 1), t++) : t && (e.splice(l, 1), t--);
@@ -747,7 +747,7 @@ var _t = xe.exports;
747
747
  continue;
748
748
  e = l + "/" + e, s = l.charAt(0) === "/";
749
749
  }
750
- return e = Se(p(e.split("/"), function(_) {
750
+ return e = Ie(p(e.split("/"), function(_) {
751
751
  return !!_;
752
752
  }), !s).join("/"), (s ? "/" : "") + e || ".";
753
753
  }
@@ -782,7 +782,7 @@ var _t = xe.exports;
782
782
  ), U = (
783
783
  /** @type {resolveImport}*/
784
784
  m
785
- ), x = (
785
+ ), q = (
786
786
  /** @type {UrlImport}*/
787
787
  ae
788
788
  ), R = y.URL, N = y.URLSearchParams, B = /%/g, G = /\\/g, L = /\n/g, H = /\r/g, k = /\t/g, V = 47;
@@ -859,15 +859,15 @@ var _t = xe.exports;
859
859
  return b(s);
860
860
  if (typeof t != "object" || t === null)
861
861
  throw new TypeError('The "options" argument must be of type object.');
862
- var j = (l = t.auth) != null ? l : !0, c = (_ = t.fragment) != null ? _ : !0, W = (D = t.search) != null ? D : !0, q = new R(s.toString());
863
- return j || (q.username = "", q.password = ""), c || (q.hash = ""), W || (q.search = ""), q.toString();
862
+ var j = (l = t.auth) != null ? l : !0, c = (_ = t.fragment) != null ? _ : !0, W = (D = t.search) != null ? D : !0, x = new R(s.toString());
863
+ return j || (x.username = "", x.password = ""), c || (x.hash = ""), W || (x.search = ""), x.toString();
864
864
  }
865
865
  ), Ve = {
866
866
  format: Xe,
867
867
  parse: w,
868
868
  resolve: U,
869
869
  resolveObject: A,
870
- Url: x,
870
+ Url: q,
871
871
  URL: R,
872
872
  URLSearchParams: N,
873
873
  domainToASCII: De,
@@ -875,11 +875,11 @@ var _t = xe.exports;
875
875
  pathToFileURL: Ge,
876
876
  fileURLToPath: ze
877
877
  };
878
- r.URL = R, r.URLSearchParams = N, r.Url = x, r.default = Ve, r.domainToASCII = De, r.domainToUnicode = Be, r.fileURLToPath = ze, r.format = Xe, r.parse = w, r.pathToFileURL = Ge, r.resolve = U, r.resolveObject = A, r = o.exports = Ve;
878
+ r.URL = R, r.URLSearchParams = N, r.Url = q, r.default = Ve, r.domainToASCII = De, r.domainToUnicode = Be, r.fileURLToPath = ze, r.format = Xe, r.parse = w, r.pathToFileURL = Ge, r.resolve = U, r.resolveObject = A, r = o.exports = Ve;
879
879
  })(He, He.exports);
880
880
  var rt = He.exports;
881
881
  (function(o) {
882
- var r = dt, h = qe, f = mt, n = gt, g = rt, u = o;
882
+ var r = dt, h = xe, f = mt, n = gt, g = rt, u = o;
883
883
  u.request = function(a, v) {
884
884
  typeof a == "string" ? a = g.parse(a) : a = f(a);
885
885
  var T = P.location.protocol.search(/^https?:$/) === -1 ? "http:" : "", C = a.protocol || T, m = a.hostname || a.host, A = a.port, te = a.path || "/";
@@ -1,10 +1,10 @@
1
1
  var V = Object.defineProperty;
2
2
  var Q = (O, s, t) => s in O ? V(O, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : O[s] = t;
3
3
  var d = (O, s, t) => (Q(O, typeof s != "symbol" ? s + "" : s, t), t);
4
- import { A as S, S as g, a as X } from "./index-B0kmC0mn.mjs";
5
- import { cG as Y, b5 as C, bp as $, cv as q, cH as _, cy as D, c6 as Z, aC as b, au as tt, bO as z, cz as y, cA as k, cD as W, b_ as L, az as et, bG as H, cI as st, cJ as K, cK as ot } from "./index-1hVb2x71.mjs";
6
- import { a as nt, A as l, s as u, _ as rt } from "./algorand-bS35msci.mjs";
7
- import { r as at } from "./chain-CqE6elWK.mjs";
4
+ import { A as S, S as g, a as X } from "./index-BvOaMsax.mjs";
5
+ import { cG as Y, b5 as C, bp as $, cv as q, cH as _, cy as D, c6 as Z, aC as b, au as tt, bO as z, cz as y, cA as k, cD as W, b_ as L, az as et, bG as H, cI as st, cJ as K, cK as ot } from "./index-7BQZXfWl.mjs";
6
+ import { a as nt, A as l, s as u, _ as rt } from "./algorand-BPtE9-nd.mjs";
7
+ import { r as at } from "./chain-CC9n7dMB.mjs";
8
8
  const G = Y.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
9
9
  constructor(s, t, n, o) {
10
10
  d(this, "network");
@@ -1 +1 @@
1
- "use strict";var u=Object.defineProperty;var w=(i,e,r)=>e in i?u(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r;var c=(i,e,r)=>(w(i,typeof e!="symbol"?e+"":e,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./cosmwasm-DAnkbnkz.js"),l=require("./create-uzzwCMF6.js"),h=require("./index-81Mcguum.js"),g=require("./chain-Don0E4S-.js");class o{constructor(e,r,s,t){c(this,"network");c(this,"chain");c(this,"rpc");c(this,"contracts");c(this,"coreAddress");this.network=e,this.chain=r,this.rpc=s,this.contracts=t;const n=this.contracts.coreBridge;if(!n)throw new Error(`Wormhole Token Bridge contract for domain ${r} not found`);this.coreAddress=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,r){const[s,t]=await m.CosmwasmPlatform.chainFromRpc(e),n=r[t];if(n.network!==s)throw new Error(`Network mismatch: ${n.network} != ${s}`);return new o(s,t,e,n.contracts)}async*publishMessage(e,r,s,t){throw new Error("Method not implemented.")}async*verifyMessage(e,r){throw new Error("Not implemented.")}async parseTransaction(e){const r=await this.rpc.getTx(e);if(!r)throw new Error("No transaction found for txid: "+e);return[o.parseWormholeMessageId(this.chain,this.coreAddress,r)]}async parseMessages(e){const r=await this.rpc.getTx(e);if(!r)throw new Error("No transaction found for txid: "+e);return[o.parseWormholeMessage(this.chain,this.coreAddress,r)]}static parseWormholeMessage(e,r,s){const t=s.events.filter(a=>a.type==="wasm"&&a.attributes[0].key==="_contract_address"&&a.attributes[0].value===r);if(t.length===0)throw new Error("No wormhole message found in tx");t.length>1&&console.error(`Expected single message, found ${t.length}`);const[n]=t,d=Object.fromEntries(n.attributes.map(a=>[a.key.split(".")[1],a.value]));return l.createVAA("Uint8Array",{emitterChain:e,emitterAddress:new h.UniversalAddress(h.hex.decode(d.sender)),sequence:BigInt(d.sequence),guardianSet:0,timestamp:Number(d.block_time),consistencyLevel:0,nonce:Number(d.nonce),signatures:[],payload:h.hex.decode(d.message)})}static parseWormholeMessageId(e,r,s){const t=o.parseWormholeMessage(e,r,s);return{chain:t.emitterChain,emitter:t.emitterAddress,sequence:t.sequence}}}g.registerProtocol(m._platform,"WormholeCore",o);exports.CosmwasmWormholeCore=o;
1
+ "use strict";var u=Object.defineProperty;var w=(i,e,r)=>e in i?u(i,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):i[e]=r;var c=(i,e,r)=>(w(i,typeof e!="symbol"?e+"":e,r),r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./cosmwasm-D5Jgmftm.js"),l=require("./create-CiLAQlGO.js"),h=require("./index-DS2ZHd80.js"),g=require("./chain-j1F1mBU9.js");class o{constructor(e,r,s,t){c(this,"network");c(this,"chain");c(this,"rpc");c(this,"contracts");c(this,"coreAddress");this.network=e,this.chain=r,this.rpc=s,this.contracts=t;const n=this.contracts.coreBridge;if(!n)throw new Error(`Wormhole Token Bridge contract for domain ${r} not found`);this.coreAddress=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,r){const[s,t]=await m.CosmwasmPlatform.chainFromRpc(e),n=r[t];if(n.network!==s)throw new Error(`Network mismatch: ${n.network} != ${s}`);return new o(s,t,e,n.contracts)}async*publishMessage(e,r,s,t){throw new Error("Method not implemented.")}async*verifyMessage(e,r){throw new Error("Not implemented.")}async parseTransaction(e){const r=await this.rpc.getTx(e);if(!r)throw new Error("No transaction found for txid: "+e);return[o.parseWormholeMessageId(this.chain,this.coreAddress,r)]}async parseMessages(e){const r=await this.rpc.getTx(e);if(!r)throw new Error("No transaction found for txid: "+e);return[o.parseWormholeMessage(this.chain,this.coreAddress,r)]}static parseWormholeMessage(e,r,s){const t=s.events.filter(a=>a.type==="wasm"&&a.attributes[0].key==="_contract_address"&&a.attributes[0].value===r);if(t.length===0)throw new Error("No wormhole message found in tx");t.length>1&&console.error(`Expected single message, found ${t.length}`);const[n]=t,d=Object.fromEntries(n.attributes.map(a=>[a.key.split(".")[1],a.value]));return l.createVAA("Uint8Array",{emitterChain:e,emitterAddress:new h.UniversalAddress(h.hex.decode(d.sender)),sequence:BigInt(d.sequence),guardianSet:0,timestamp:Number(d.block_time),consistencyLevel:0,nonce:Number(d.nonce),signatures:[],payload:h.hex.decode(d.message)})}static parseWormholeMessageId(e,r,s){const t=o.parseWormholeMessage(e,r,s);return{chain:t.emitterChain,emitter:t.emitterAddress,sequence:t.sequence}}}g.registerProtocol(m._platform,"WormholeCore",o);exports.CosmwasmWormholeCore=o;