@wormhole-foundation/wormhole-connect 2.3.0-beta.1-development → 2.3.0

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 (77) hide show
  1. package/dist/main.js +1 -1
  2. package/lib/{aptos-Cd2RxmTX.mjs → aptos-BxqLqZNX.mjs} +5 -5
  3. package/lib/{aptos-CVrk2e8x.js → aptos-C0fgCR3U.js} +2 -2
  4. package/lib/{aptos-DqQeHeWd.mjs → aptos-Dfr8g3l2.mjs} +2 -2
  5. package/lib/{aptos-D9RWCwaG.js → aptos-b5iDxSTg.js} +1 -1
  6. package/lib/{base64-DOdqKfyo.mjs → base64--OafHktr.mjs} +1 -1
  7. package/lib/{base64-D7N0XEtt.js → base64-ftXBMu_Y.js} +1 -1
  8. package/lib/{ccip-B1d8Cfcc.mjs → ccip-Nyheo-pf.mjs} +1 -1
  9. package/lib/{ccip-C4FhwB7R.js → ccip-bB3Hb3p1.js} +1 -1
  10. package/lib/{chunk-IMTC3J2M-B2ra0Z4c.mjs → chunk-IMTC3J2M-B3JXHl8c.mjs} +3 -3
  11. package/lib/{chunk-IMTC3J2M-DtuxbHq9.js → chunk-IMTC3J2M-CxyrTIXy.js} +1 -1
  12. package/lib/{events-BC1Svub2.js → events-B0EN-_lw.js} +1 -1
  13. package/lib/{events-BrouOFcp.mjs → events-CMAqq7WG.mjs} +1 -1
  14. package/lib/{evm-BXku4GNW.js → evm-2eC8tBb8.js} +3 -3
  15. package/lib/{evm-CfS9xq5t.mjs → evm-BOjE2d7W.mjs} +5 -5
  16. package/lib/{evm-DT_W87u-.js → evm-CKGFrxPp.js} +1 -1
  17. package/lib/{evm-Ccy4JfF6.mjs → evm-mcCNFzAo.mjs} +5 -5
  18. package/lib/{index-CgISt_Up.js → index-B2taYdgD.js} +1 -1
  19. package/lib/{index-vEkD7kom.mjs → index-BFxsrgmC.mjs} +5 -5
  20. package/lib/{index-CdB9Qj-M.js → index-BUPpsD6y.js} +1 -1
  21. package/lib/{index-BuGFh8C7.mjs → index-BYbcUh5K.mjs} +2 -2
  22. package/lib/{index-B58a-RHd.js → index-B_UCj8xo.js} +1 -1
  23. package/lib/{index-DxslawxO.mjs → index-Ba6qW0G9.mjs} +2 -2
  24. package/lib/{index-xeYB5lOA.js → index-BdWdyObb.js} +1 -1
  25. package/lib/{index-B4hbI0dp.mjs → index-BeNF4-bP.mjs} +2 -2
  26. package/lib/{index-Bdopcy73.mjs → index-BfEF0Tek.mjs} +4 -4
  27. package/lib/{index-CnkeKt9s.mjs → index-BgPLmEjh.mjs} +3 -3
  28. package/lib/{index-DihlIPlD.js → index-Bh68ln_H.js} +1 -1
  29. package/lib/{index-C-nWxaLg.js → index-BjZpM_ll.js} +1 -1
  30. package/lib/{index-CUm6qdjR.js → index-BlZ-gXWP.js} +1 -1
  31. package/lib/{index-Y5ArJjKr.mjs → index-BpdpC7bc.mjs} +1 -1
  32. package/lib/{index-RFgTGgbk.js → index-C5v_43HR.js} +2 -2
  33. package/lib/{index-BdodDbVS.mjs → index-CGkpUmfc.mjs} +1 -1
  34. package/lib/{index-DyqHtpmj.js → index-CMgf8btt.js} +1 -1
  35. package/lib/{index-DB5xCELT.js → index-Ckn2JAfC.js} +1 -1
  36. package/lib/{index-CCWEM47k.js → index-ClGDuGAH.js} +1 -1
  37. package/lib/{index-s7S0StCX.mjs → index-CqLCyep2.mjs} +1 -1
  38. package/lib/{index-C0IvEwkt.mjs → index-CqW6CJJD.mjs} +1 -1
  39. package/lib/{index-Dsd09IV6.js → index-D-TPMx4M.js} +1 -1
  40. package/lib/{index-Camctzsh.js → index-D0km6dEP.js} +1 -1
  41. package/lib/{index-BODYDhXF.mjs → index-D1YLa5Y6.mjs} +2 -2
  42. package/lib/{index-CpQ7f1YB.mjs → index-D8L0gOjE.mjs} +1 -1
  43. package/lib/{index-BcJBEeFA.mjs → index-DCXltTRQ.mjs} +1 -1
  44. package/lib/{index-DqO3qLPG.js → index-DGyhcRhy.js} +1 -1
  45. package/lib/{index-s53oBunM.mjs → index-DHYCPrLZ.mjs} +2 -2
  46. package/lib/{index-D5qBrm4q.js → index-DHhwn6Cc.js} +1 -1
  47. package/lib/{index-DSTC1VGB.js → index-DMT1CxRy.js} +1 -1
  48. package/lib/{index-CSKbEqQP.js → index-DPwdAd1Z.js} +1 -1
  49. package/lib/{index-DX-wGKTH.mjs → index-DVX7DsmX.mjs} +2 -2
  50. package/lib/{index-D3Mg9Eh4.js → index-DZWcS0lz.js} +1 -1
  51. package/lib/{index-BFFNnNKW.js → index-DdAYyX9y.js} +1 -1
  52. package/lib/{index-1LP1mA3c.mjs → index-DfJOWZgf.mjs} +1 -1
  53. package/lib/{index-Br4Igv20.js → index-E2SOg6Ah.js} +1 -1
  54. package/lib/{index-Dk29guyA.mjs → index-U0I19HyB.mjs} +3 -3
  55. package/lib/{index-Cmmxyf4Y.mjs → index-ZjG8y1YT.mjs} +2 -2
  56. package/lib/{index-BCjWPjhx.mjs → index-dAUnLH4Z.mjs} +2 -2
  57. package/lib/{index-1EgmRX-a.js → index-eLxBNCA2.js} +1 -1
  58. package/lib/{index--0DQj_F2.mjs → index-m31ry_Y2.mjs} +2 -2
  59. package/lib/{index-CU9KzHgH.mjs → index-r7xhXupc.mjs} +12 -12
  60. package/lib/{index.es-PJjmKf_k.js → index.es-BgHsoUXw.js} +2 -2
  61. package/lib/{index.es-DD7lO_GM.mjs → index.es-C_kwfz5b.mjs} +6 -6
  62. package/lib/index.js +1 -1
  63. package/lib/index.mjs +1 -1
  64. package/lib/{signer-Bs70WVKc.js → signer-BXnEcajC.js} +1 -1
  65. package/lib/{signer-dwfhV60M.mjs → signer-g3raRETb.mjs} +1 -1
  66. package/lib/solana-BzGuWSEw.js +1 -0
  67. package/lib/{solana-DK3yyz37.js → solana-C4lFmDk6.js} +1 -1
  68. package/lib/{solana-BDUnTuLS.mjs → solana-CJTWTUey.mjs} +5 -5
  69. package/lib/{solana-D8IW8eXX.mjs → solana-HjIwzEIV.mjs} +4 -4
  70. package/lib/{solanaEmbed.esm-DlyRzA6N.mjs → solanaEmbed.esm-BSo4Y-GM.mjs} +2 -2
  71. package/lib/{solanaEmbed.esm-DjNz5swk.js → solanaEmbed.esm-BY9140pH.js} +1 -1
  72. package/lib/{sui-CIYeuWco.mjs → sui-BYAvPQcW.mjs} +5 -5
  73. package/lib/{sui-BSr1lx4J.js → sui-D0YPksGW.js} +2 -2
  74. package/lib/{sui-BRZ30Let.js → sui-DSbuDbhr.js} +1 -1
  75. package/lib/{sui-BN9_xkve.mjs → sui-DolA6Isa.mjs} +1 -1
  76. package/package.json +1 -1
  77. package/lib/solana-B1Wsl1Pg.js +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-RFgTGgbk.js"),ke=require("./sui-BSr1lx4J.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-C5v_43HR.js"),ke=require("./sui-D0YPksGW.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,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-BdodDbVS.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-CGkpUmfc.mjs";
2
2
  import { d as Uo } from "./dijkstra-BZM-8g-B.mjs";
3
- import { V as Wo } from "./index-CU9KzHgH.mjs";
3
+ import { V as Wo } from "./index-r7xhXupc.mjs";
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2019 Google LLC