@wormhole-foundation/wormhole-connect 1.1.3-beta.2-development → 1.1.3-beta.3-development

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/assets/{ccip-CuVLQT8d.js → ccip-DIYM0gy6.js} +1 -1
  2. package/dist/assets/{evm-Dc3QdSOA.js → evm-Y-JIomWz.js} +4 -4
  3. package/dist/assets/{index-EVjhBEXw.js → index--B3_-qch.js} +2 -2
  4. package/dist/assets/{index-BJGeA_ds.js → index-C1YrzzPV.js} +1 -1
  5. package/dist/assets/{index-BIssGeVa.js → index-sR4FP7OJ.js} +1 -1
  6. package/dist/assets/{index.es-BObgTr8H.js → index.es-CRUh0v3x.js} +2 -2
  7. package/dist/main.js +4 -4
  8. package/lib/{algorand-CLoiUadv.mjs → algorand-D_QRI-bg.mjs} +3 -3
  9. package/lib/{algorand-BAFj4ZGa.js → algorand-wRfrbOd6.js} +1 -1
  10. package/lib/{aptos-C45UOjMk.mjs → aptos-39dGPUrb.mjs} +3 -3
  11. package/lib/{aptos-CHkHb9Wn.js → aptos-BYA8pulJ.js} +1 -1
  12. package/lib/{aptos-B0EUzhLn.mjs → aptos-D8si2udZ.mjs} +1 -1
  13. package/lib/{aptos-DLBpR9Uw.js → aptos-j2PEnEen.js} +2 -2
  14. package/lib/{ccip-D6nl66Of.mjs → ccip-CAsSiarY.mjs} +1 -1
  15. package/lib/{ccip-DwcFzOh0.js → ccip-D2DyQ2dl.js} +1 -1
  16. package/lib/{cosmos-BEyKk7pN.js → cosmos--SblITfP.js} +11 -11
  17. package/lib/{cosmos-Bc34YeqV.mjs → cosmos-5QBTeSdf.mjs} +5 -5
  18. package/lib/{cosmwasm-BBIEjp_6.mjs → cosmwasm-BvDytCXd.mjs} +3545 -3545
  19. package/lib/{cosmwasm-DPmjLuio.js → cosmwasm-qpOclFcW.js} +3 -3
  20. package/lib/{events-D9h1HjEa.mjs → events-Cq1VEeNf.mjs} +1 -1
  21. package/lib/{events-B2ZyXE4l.js → events-DSOd4gvB.js} +1 -1
  22. package/lib/{evm--fmrvZiP.js → evm-C-UXATlx.js} +4 -4
  23. package/lib/{evm-sG77B7Ln.mjs → evm-CEwMJ8_A.mjs} +6 -6
  24. package/lib/{evm-D6zAQuRU.js → evm-DG7I4Frq.js} +1 -1
  25. package/lib/{evm-DsRkB-Yc.mjs → evm-DMvzqxcS.mjs} +7 -7
  26. package/lib/{index-DinZIMWa.mjs → index-74c6g32z.mjs} +225 -225
  27. package/lib/{index-DWJ5r15M.mjs → index-7zA9RXv7.mjs} +19853 -19856
  28. package/lib/{index-Cpjj11xV.mjs → index-B8T2NaoX.mjs} +45 -45
  29. package/lib/{index-DPtc-UxP.mjs → index-B8ULFzIF.mjs} +6 -6
  30. package/lib/{index-B7Optu6I.js → index-B9Hz7aqe.js} +1 -1
  31. package/lib/{index-jydTi-hN.mjs → index-BHWO1nl8.mjs} +2 -2
  32. package/lib/{index-ByOoS9NO.js → index-BLp_eTrc.js} +1 -1
  33. package/lib/{index-CvdPwRnL.js → index-BQtbCwXd.js} +1 -1
  34. package/lib/{index-CEovIwuS.js → index-BU_DiszY.js} +92 -92
  35. package/lib/{index-XMIcJZyr.js → index-BbxY_HAX.js} +16 -16
  36. package/lib/{index-CY9fp7fB.mjs → index-Beu3v0JF.mjs} +15 -15
  37. package/lib/{index-D4u8CUKC.mjs → index-BhXfWaSE.mjs} +3 -3
  38. package/lib/{index-B9gBvn5a.mjs → index-BjeY05EL.mjs} +801 -802
  39. package/lib/{index-BT10pzLw.mjs → index-BoUKkFOJ.mjs} +1 -1
  40. package/lib/{index-CVaT6qZW.js → index-C6PC2n3L.js} +1 -1
  41. package/lib/{index-BYnoX4S7.mjs → index-CAqvcaXu.mjs} +15 -15
  42. package/lib/{index-DGq7mQyb.mjs → index-CDHEzcRs.mjs} +10 -10
  43. package/lib/{index-U1A3Ir4_.js → index-CFV9DDDi.js} +1 -1
  44. package/lib/{index-CQY-qyc8.mjs → index-CHNFj7US.mjs} +2 -2
  45. package/lib/{index-DrDopLyp.mjs → index-CIbRMQ53.mjs} +2 -2
  46. package/lib/{index-BFWViYNu.mjs → index-COFRyIUZ.mjs} +7 -7
  47. package/lib/{index-BJ9DGQK7.js → index-CREWpYSc.js} +1 -1
  48. package/lib/{index-CL7evJIB.js → index-CV_U2daN.js} +1 -1
  49. package/lib/{index-CNe0Pean.js → index-CxgmuQ6m.js} +1 -1
  50. package/lib/{index-DugvE6YD.mjs → index-D-p3qNTZ.mjs} +30 -30
  51. package/lib/{index-Cb5M1Ban.mjs → index-D9X9k3PB.mjs} +1 -1
  52. package/lib/{index-IC9ubiMJ.mjs → index-DJghGbqc.mjs} +3 -3
  53. package/lib/{index-Bx7B-3Uk.js → index-DP78DD_7.js} +1 -1
  54. package/lib/{index-OldEBluq.js → index-D_iRGURG.js} +1 -1
  55. package/lib/{index-PcZU5a1K.js → index-DcOE-jqI.js} +1 -1
  56. package/lib/{index-BO1rJrRP.mjs → index-DefP3AL4.mjs} +9 -9
  57. package/lib/{index-C96ibHXm.js → index-DgKzux63.js} +1 -1
  58. package/lib/{index-D_3BlFSH.js → index-DhjRrhjF.js} +1 -1
  59. package/lib/{index-CyPbCf5y.js → index-DhvcbRay.js} +1 -1
  60. package/lib/{index-C010ECjb.js → index-DjAPVIrd.js} +1 -1
  61. package/lib/{index-CaQpF1dj.js → index-Dpwwqt_Y.js} +1 -1
  62. package/lib/{index-Bl8-vKcf.js → index-DqRdsXVl.js} +1 -1
  63. package/lib/{index-jgZQQCfy.mjs → index-DuVadmtW.mjs} +18 -18
  64. package/lib/{index--8OR2IWG.mjs → index-SSdHQ2f1.mjs} +2 -2
  65. package/lib/{index-B_vsKDJm.js → index-X48SyxVx.js} +1 -1
  66. package/lib/{index-DdhKN5Tn.mjs → index-evqr6zVJ.mjs} +2 -2
  67. package/lib/{index-BxxpLnjr.mjs → index-hY0mf_OS.mjs} +26 -26
  68. package/lib/{index-mE3wnazE.js → index-oE-cAvjh.js} +1 -1
  69. package/lib/{index-Ci0O-yiU.js → index-oRg2LZn2.js} +1 -1
  70. package/lib/{index-D0RnzOoN.js → index-pIxA5tC9.js} +1 -1
  71. package/lib/{index-CnElB0dt.mjs → index-vZrnrwrk.mjs} +2 -2
  72. package/lib/{index.es-DbGYkQrs.js → index.es-CwS3KgtR.js} +2 -2
  73. package/lib/{index.es-DV6jIgX3.mjs → index.es-De3BB9Gs.mjs} +5 -5
  74. package/lib/index.js +1 -1
  75. package/lib/index.mjs +1 -1
  76. package/lib/{keccak-BvCC2Kx2.js → keccak-B1lZAzij.js} +1 -1
  77. package/lib/{keccak-C0uJwxei.mjs → keccak-BIkgLtG3.mjs} +1 -1
  78. package/lib/{libsodium-wrappers-BS68glUg.mjs → libsodium-wrappers-BVHsOzCM.mjs} +1 -1
  79. package/lib/{libsodium-wrappers-yq_uVk2-.js → libsodium-wrappers-G-nqImEg.js} +1 -1
  80. package/lib/{pako.esm-DZDXjYQj.js → pako.esm-Bp8XA5UR.js} +1 -1
  81. package/lib/{pako.esm-CWQc3qGc.mjs → pako.esm-CuMQ9lDX.mjs} +2 -2
  82. package/lib/{pbkdf2-DbRuCUvp.js → pbkdf2-DvmY7GlQ.js} +1 -1
  83. package/lib/{pbkdf2-B3V9L7S5.mjs → pbkdf2-QaxjQpDb.mjs} +1 -1
  84. package/lib/{sei-D3Eq9BDV.js → sei-B9drTJKa.js} +1 -1
  85. package/lib/{sei-Bty4vIw4.mjs → sei-DgoF7Bn_.mjs} +3 -3
  86. package/lib/{signer-Dw6nmaHE.js → signer-BEIw02y1.js} +1 -1
  87. package/lib/{signer-zHoIaQqc.mjs → signer-DNX7OGg4.mjs} +1 -1
  88. package/lib/solana-BRb7NfyR.js +1 -0
  89. package/lib/{solana-C-e817Or.mjs → solana-CoAz_ENY.mjs} +4 -4
  90. package/lib/solana-D2xBFYbL.mjs +16 -0
  91. package/lib/{solana-9m57XHRZ.js → solana-iqc7Fvik.js} +1 -1
  92. package/lib/{solanaEmbed.esm-ByzcN6RA.mjs → solanaEmbed.esm-D-2IZyVE.mjs} +3 -3
  93. package/lib/{solanaEmbed.esm-DBOgwSJE.js → solanaEmbed.esm-DjEXAVdT.js} +1 -1
  94. package/lib/{sui-B3dbw4a7.js → sui-CLKF35u2.js} +2 -2
  95. package/lib/{sui-CKgX0Mjn.mjs → sui-C_RZoPbB.mjs} +4 -4
  96. package/lib/{sui-rey0HjGu.mjs → sui-CrvrUATE.mjs} +1 -1
  97. package/lib/{sui-lQcSerf0.js → sui-qNwHoAbu.js} +1 -1
  98. package/lib/{unsignedTransaction-DcJyFS5R.js → unsignedTransaction-CJyRAIyq.js} +1 -1
  99. package/lib/{unsignedTransaction-sTI31PuJ.mjs → unsignedTransaction-XgGjCBSt.mjs} +2 -2
  100. package/package.json +1 -1
  101. package/lib/solana-CV7qftfl.mjs +0 -16
  102. package/lib/solana-GdBZhG_3.js +0 -1
@@ -1,4 +1,4 @@
1
- "use strict";var xr=Object.defineProperty;var Br=(t,e,r)=>e in t?xr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var U=(t,e,r)=>Br(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index-CEovIwuS.js"),b=require("./sui-B3dbw4a7.js");require("./index-CvdPwRnL.js");class qt{constructor(e,r,n,i,s=!1){U(this,"transaction");U(this,"network");U(this,"chain");U(this,"description");U(this,"parallelizable");this.transaction=e,this.network=r,this.chain=n,this.description=i,this.parallelizable=s}}class Cr extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...c}=e,{path:a}=e,o=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??o),s!=null&&(this.cause=o),Object.assign(this,c),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function $r(t){return K(t)&&typeof t[Symbol.iterator]=="function"}function K(t){return typeof t=="object"&&t!=null}function J(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Ur(t){const{done:e,value:r}=t.next();return e?void 0:r}function Pr(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:c}=r,{refinement:a,message:o=`Expected a value of type \`${c}\`${a?` with refinement \`${a}\``:""}, but received: \`${J(n)}\``}=t;return{value:n,type:c,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:o}}function*Lt(t,e,r,n){$r(t)||(t=[t]);for(const i of t){const s=Pr(i,e,r,n);s&&(yield s)}}function*lt(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:c=!1}=r,a={path:n,branch:i};if(s&&(t=e.coercer(t,a),c&&e.type!=="type"&&K(e.schema)&&K(t)&&!Array.isArray(t)))for(const d in t)e.schema[d]===void 0&&delete t[d];let o="valid";for(const d of e.validator(t,a))d.explanation=r.message,o="not_valid",yield[d,void 0];for(let[d,u,g]of e.entries(t,a)){const m=lt(u,g,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,u],coerce:s,mask:c,message:r.message});for(const y of m)y[0]?(o=y[0].refinement!=null?"not_refined":"not_valid",yield[y[0],void 0]):s&&(u=y[1],d===void 0?t=u:t instanceof Map?t.set(d,u):t instanceof Set?t.add(u):K(t)&&(u!==void 0||d in t)&&(t[d]=u))}if(o!=="not_valid")for(const d of e.refiner(t,a))d.explanation=r.message,o="not_refined",yield[d,void 0];o==="valid"&&(yield[void 0,t])}class te{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:c=o=>o,entries:a=function*(){}}=e;this.type=r,this.schema=n,this.entries=a,this.coercer=c,i?this.validator=(o,d)=>{const u=i(o,d);return Lt(u,d,this,o)}:this.validator=()=>[],s?this.refiner=(o,d)=>{const u=s(o,d);return Lt(u,d,this,o)}:this.refiner=()=>[]}assert(e,r){return nt(e,this,r)}create(e,r){return Xt(e,this,r)}is(e){return L(e,this)}mask(e,r){return Zt(e,this,r)}validate(e,r={}){return _e(e,this,r)}}function nt(t,e,r){const n=_e(t,e,{message:r});if(n[0])throw n[0]}function Xt(t,e,r){const n=_e(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Zt(t,e,r){const n=_e(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function L(t,e){return!_e(t,e)[0]}function _e(t,e,r={}){const n=lt(t,e,r),i=Ur(n);return i[0]?[new Cr(i[0],function*(){for(const c of n)c[0]&&(yield c[0])}),void 0]:[void 0,i[1]]}function je(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?Rr(n):p(n)}function W(t,e){return new te({type:t,schema:null,validator:e})}function it(){return W("any",()=>!0)}function E(t){return new te({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${J(e)}`}})}function Mr(){return W("bigint",t=>typeof t=="bigint")}function z(){return W("boolean",t=>typeof t=="boolean")}function ee(){return W("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${J(t)}`)}function k(t){const e=J(t),r=typeof t;return new te({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${J(n)}`}})}function Yt(){return W("never",()=>!1)}function $(t){return new te({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function he(){return W("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${J(t)}`)}function p(t){const e=t?Object.keys(t):[],r=Yt();return new te({type:"object",schema:t||null,*entries(n){if(t&&K(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[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 v(t){return new te({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Q(t,e){return new te({type:"record",schema:null,*entries(r){if(K(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`}})}function h(){return W("string",t=>typeof t=="string"||`Expected a string, but received: ${J(t)}`)}function Qt(t){const e=Yt();return new te({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${J(r)}`}})}function Rr(t){const e=Object.keys(t);return new te({type:"type",schema:t,*entries(r){if(K(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`},coercer(r){return K(r)?{...r}:r}})}function P(t){const e=t.map(r=>r.type).join(" | ");return new te({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...c]=lt(r,s,n),[a]=c;if(a[0])for(const[o]of c)o&&i.push(o);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${J(r)}`,...i]}})}function er(){return W("unknown",()=>!0)}const ft=P([p({AddressOwner:h()}),p({ObjectOwner:h()}),p({Shared:p({initial_shared_version:$(h())})}),k("Immutable")]);W("SuiJsonValue",()=>!0);const Nr=P([p({u32:h()}),p({u64:h()}),p({f64:h()})]);p({attributes:Q(h(),$(Nr)),featureFlags:Q(h(),z()),maxSupportedProtocolVersion:h(),minSupportedProtocolVersion:h(),protocolVersion:h()});P([h(),k("package")]);const ce=p({digest:h(),objectId:h(),version:P([he(),h(),Mr()])});p({owner:ft,reference:ce});p({objectId:h(),sequenceNumber:h()});p({payment:E(ce),owner:h(),price:h(),budget:h()});const Dr=je(ce,p({type:h(),owner:ft,previousTransaction:h()})),Vr=Q(h(),it()),zr=Q(h(),er()),Fr=p({type:h(),fields:Vr,hasPublicTransfer:z()}),Gr=p({disassembled:zr}),Lr=P([je(Fr,p({dataType:k("moveObject")})),je(Gr,p({dataType:k("package")}))]),Wr=p({type:h(),hasPublicTransfer:z(),version:h(),bcsBytes:h()}),Kr=p({id:h(),moduleMap:Q(h(),h())}),Jr=P([je(Wr,p({dataType:k("moveObject")})),je(Kr,p({dataType:k("package")}))]);BigInt(1e9);const tr=p({code:h(),error:v(h()),object_id:v(h()),parent_object_id:v(h()),version:v(h()),digest:v(h())}),Hr=p({data:$(v(Q(h(),h()))),error:$(v(tr))}),qr=P([Hr,v(Q(h(),h()))]),rr=p({objectId:h(),version:h(),digest:h(),type:$(v(h())),content:$(v(Lr)),bcs:$(v(Jr)),owner:$(v(ft)),previousTransaction:$(v(h())),storageRebate:$(v(h())),display:$(v(qr))});p({showType:$(v(z())),showContent:$(v(z())),showBcs:$(v(z())),showOwner:$(v(z())),showPreviousTransaction:$(v(z())),showStorageRebate:$(v(z())),showDisplay:$(v(z()))});P([k("Exists"),k("notExists"),k("Deleted")]);E(Dr);const Xr=p({data:$(v(rr)),error:$(v(tr))});function Zr(t){return t.data}function Yr(t){if(t.error&&"object_id"in t.error&&"version"in t.error&&"digest"in t.error){const e=t.error;return{objectId:e.object_id,version:e.version,digest:e.digest}}}function Wt(t){if("reference"in t)return t.reference;const e=Zr(t);return e?{objectId:e.objectId,version:e.version,digest:e.digest}:Yr(t)}p({objectId:h(),atCheckpoint:v(he())});p({data:E(Xr),nextCursor:v($(h())),hasNextPage:z()});P([p({details:rr,status:k("VersionFound")}),p({details:h(),status:k("ObjectNotExists")}),p({details:ce,status:k("ObjectDeleted")}),p({details:Qt([h(),he()]),status:k("VersionNotFound")}),p({details:p({asked_version:he(),latest_version:he(),object_id:h()}),status:k("VersionTooHigh")})]);const Qr=P([h(),p({Object:h()})]);E(Qr);const en=p({address:h(),name:h()}),tn=P([k("Private"),k("Public"),k("Friend")]),ht=p({abilities:E(h())}),rn=p({constraints:ht,isPhantom:z()}),nn=p({TypeParameter:he()}),Xe=Qt([p({module:h(),package:h(),function:h()}),h()]);p({rank3Days:E(Xe),rank7Days:E(Xe),rank30Days:E(Xe)});function nr(t){if(!t)return!1;if(typeof t=="string"||L(t,nn)||ir(t))return!0;if(typeof t!="object")return!1;const e=t;return!!(L(e.Reference,me)||L(e.MutableReference,me)||L(e.Vector,me))}const me=W("SuiMoveNormalizedType",nr);function ir(t){if(!t||typeof t!="object")return!1;const e=t;if(!e.Struct||typeof e.Struct!="object")return!1;const r=e.Struct;return!(typeof r.address!="string"||typeof r.module!="string"||typeof r.name!="string"||!Array.isArray(r.typeArguments)||!r.typeArguments.every(n=>nr(n)))}W("SuiMoveNormalizedStructType",ir);const sn=p({visibility:tn,isEntry:z(),typeParameters:E(ht),parameters:E(me),return:E(me)}),an=p({name:h(),type:me}),on=p({abilities:ht,typeParameters:E(rn),fields:E(an)}),cn=p({fileFormatVersion:he(),address:h(),name:h(),friends:E(en),structs:Q(h(),on),exposedFunctions:Q(h(),sn)});Q(h(),cn);function st(t){return typeof t=="object"&&"MutableReference"in t?t.MutableReference:void 0}function sr(t){return typeof t=="object"&&"Reference"in t?t.Reference:void 0}function gt(t){if(typeof t=="object"&&"Struct"in t)return t;const e=sr(t),r=st(t);if(typeof e=="object"&&"Struct"in e)return e;if(typeof r=="object"&&"Struct"in r)return r}function un(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var i=t.charAt(n),s=i.charCodeAt(0);if(e[s]!==255)throw new TypeError(i+" is ambiguous");e[s]=n}var c=t.length,a=t.charAt(0),o=Math.log(c)/Math.log(256),d=Math.log(256)/Math.log(c);function u(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 S=0,T=0,f=0,O=y.length;f!==O&&y[f]===0;)f++,S++;for(var B=(O-f)*d+1>>>0,M=new Uint8Array(B);f!==O;){for(var A=y[f],j=0,R=B-1;(A!==0||j<T)&&R!==-1;R--,j++)A+=256*M[R]>>>0,M[R]=A%c>>>0,A=A/c>>>0;if(A!==0)throw new Error("Non-zero carry");T=j,f++}for(var H=B-T;H!==B&&M[H]===0;)H++;for(var pe=a.repeat(S);H<B;++H)pe+=t.charAt(M[H]);return pe}function g(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;for(var S=0,T=0,f=0;y[S]===a;)T++,S++;for(var O=(y.length-S)*o+1>>>0,B=new Uint8Array(O);y[S];){var M=e[y.charCodeAt(S)];if(M===255)return;for(var A=0,j=O-1;(M!==0||A<f)&&j!==-1;j--,A++)M+=c*B[j]>>>0,B[j]=M%256>>>0,M=M/256>>>0;if(M!==0)throw new Error("Non-zero carry");f=A,S++}for(var R=O-f;R!==O&&B[R]===0;)R++;for(var H=new Uint8Array(T+(O-R)),pe=T;R!==O;)H[pe++]=B[R++];return H}function m(y){var S=g(y);if(S)return S;throw new Error("Non-base"+c+" character")}return{encode:u,decodeUnsafe:g,decode:m}}var dn=un;const ln=dn,fn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var hn=ln(fn);const ar=w.getDefaultExportFromCjs(hn),xe=t=>ar.encode(t),pt=t=>ar.decode(t);function ue(t){return Uint8Array.from(atob(t),e=>e.charCodeAt(0))}const Ze=8192;function Be(t){if(t.length<Ze)return btoa(String.fromCharCode(...t));let e="";for(var r=0;r<t.length;r+=Ze){const n=t.slice(r,r+Ze);e+=String.fromCharCode(...n)}return btoa(e)}function Je(t){var i;const e=t.startsWith("0x")?t.slice(2):t,n=((i=(e.length%2===0?e:`0${e}}`).match(/.{2}/g))==null?void 0:i.map(s=>parseInt(s,16)))??[];return Uint8Array.from(n)}function Ce(t){return t.reduce((e,r)=>e+r.toString(16).padStart(2,"0"),"")}function yt(t){let e=[],r=0;if(t===0)return[0];for(;t>0;)e[r]=t&127,(t>>=7)&&(e[r]|=128),r+=1;return e}function gn(t){let e=0,r=0,n=0;for(;;){let i=t[n];if(n+=1,e|=(i&127)<<r,!(i&128))break;r+=7}return{value:e,length:n}}class or{constructor(e){this.bytePosition=0,this.dataView=new DataView(e.buffer)}shift(e){return this.bytePosition+=e,this}read8(){let e=this.dataView.getUint8(this.bytePosition);return this.shift(1),e}read16(){let e=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),e}read32(){let e=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),e}read64(){let e=this.read32(),n=this.read32().toString(16)+e.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){let e=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+e.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}read256(){let e=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+e.toString(16).padStart(32,"0");return BigInt("0x"+n).toString(10)}readBytes(e){let r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,e);return this.shift(e),n}readULEB(){let e=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,e),{value:n,length:i}=gn(r);return this.shift(i),n}readVec(e){let r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(e(this,i,r));return n}}function pn(t,e){switch(e){case"base58":return xe(t);case"base64":return Be(t);case"hex":return Ce(t);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function yn(t,e){switch(e){case"base58":return pt(t);case"base64":return ue(t);case"hex":return Je(t);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function mt(t,e=["<",">"]){const[r,n]=e,i=[];let s="",c=0;for(let a=0;a<t.length;a++){const o=t[a];if(o===r&&c++,o===n&&c--,c===0&&o===","){i.push(s.trim()),s="";continue}s+=o}return i.push(s.trim()),i}class cr{constructor({size:e=1024,maxSize:r,allocateSize:n=1024}={}){this.bytePosition=0,this.size=e,this.maxSize=r||e,this.allocateSize=n,this.dataView=new DataView(new ArrayBuffer(e))}ensureSizeOrGrow(e){const r=this.bytePosition+e;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(e){return this.bytePosition+=e,this}write8(e){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(e)),this.shift(1)}write16(e){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(e),!0),this.shift(2)}write32(e){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(e),!0),this.shift(4)}write64(e){return Ye(BigInt(e),8).forEach(r=>this.write8(r)),this}write128(e){return Ye(BigInt(e),16).forEach(r=>this.write8(r)),this}write256(e){return Ye(BigInt(e),32).forEach(r=>this.write8(r)),this}writeULEB(e){return yt(e).forEach(r=>this.write8(r)),this}writeVec(e,r){return this.writeULEB(e.length),Array.from(e).forEach((n,i)=>r(this,n,i,e.length)),this}*[Symbol.iterator](){for(let e=0;e<this.bytePosition;e++)yield this.dataView.getUint8(e);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(e){return pn(this.toBytes(),e)}}function Ye(t,e){let r=new Uint8Array(e),n=0;for(;t>0;)r[n]=Number(t%BigInt(256)),t=t/BigInt(256),n+=1;return r}var ur=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},X=(t,e,r)=>(ur(t,e,"read from private field"),r?r.call(t):e.get(t)),ze=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Fe=(t,e,r,n)=>(ur(t,e,"write to private field"),e.set(t,r),r),ye,Se,Me,ae;const dr=class{constructor(t){ze(this,ye,void 0),ze(this,Se,void 0),this.name=t.name,this.read=t.read,this.serializedSize=t.serializedSize??(()=>null),Fe(this,ye,t.write),Fe(this,Se,t.serialize??((e,r)=>{const n=new cr({size:this.serializedSize(e)??void 0,...r});return X(this,ye).call(this,e,n),n.toBytes()})),this.validate=t.validate??(()=>{})}write(t,e){this.validate(t),X(this,ye).call(this,t,e)}serialize(t,e){return this.validate(t),new mn(this,X(this,Se).call(this,t,e))}parse(t){const e=new or(t);return this.read(e)}transform({name:t,input:e,output:r}){return new dr({name:t??this.name,read:n=>r(this.read(n)),write:(n,i)=>X(this,ye).call(this,e(n),i),serializedSize:n=>this.serializedSize(e(n)),serialize:(n,i)=>X(this,Se).call(this,e(n),i),validate:n=>this.validate(e(n))})}};let Z=dr;ye=new WeakMap;Se=new WeakMap;const lr=Symbol.for("@mysten/serialized-bcs");function wt(t){return!!t&&typeof t=="object"&&t[lr]===!0}class mn{constructor(e,r){ze(this,Me,void 0),ze(this,ae,void 0),Fe(this,Me,e),Fe(this,ae,r)}get[lr](){return!0}toBytes(){return X(this,ae)}toHex(){return Ce(X(this,ae))}toBase64(){return Be(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 Ge({size:t,...e}){return new Z({...e,serializedSize:()=>t})}function Qe({readMethod:t,writeMethod:e,...r}){return Ge({...r,read:n=>n[t](),write:(n,i)=>i[e](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 et({readMethod:t,writeMethod:e,...r}){return Ge({...r,read:n=>n[t](),write:(n,i)=>i[e](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 wn({serialize:t,...e}){const r=new Z({...e,serialize:t,write:(n,i)=>{for(const s of r.serialize(n).toBytes())i.write8(s)}});return r}function bn({toBytes:t,fromBytes:e,...r}){return new Z({...r,read:n=>{const i=n.readULEB(),s=n.readBytes(i);return e(s)},write:(n,i)=>{const s=t(n);i.writeULEB(s.length);for(let c=0;c<s.length;c++)i.write8(s[c])},serialize:n=>{const i=t(n),s=yt(i.length),c=new Uint8Array(s.length+i.length);return c.set(s,0),c.set(i,s.length),c},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 Sn(t){let e=null;function r(){return e||(e=t()),e}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 l={u8(t){return Qe({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...t})},u16(t){return Qe({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...t})},u32(t){return Qe({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...t})},u64(t){return et({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...t})},u128(t){return et({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...t})},u256(t){return et({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...t})},bool(t){return Ge({name:"bool",size:1,read:e=>e.read8()===1,write:(e,r)=>r.write8(e?1:0),...t,validate:e=>{var r;if((r=t==null?void 0:t.validate)==null||r.call(t,e),typeof e!="boolean")throw new TypeError(`Expected boolean, found ${typeof e}`)}})},uleb128(t){return wn({name:"uleb128",read:e=>e.readULEB(),serialize:e=>Uint8Array.from(yt(e)),...t})},bytes(t,e){return Ge({name:`bytes[${t}]`,size:t,read:r=>r.readBytes(t),write:(r,n)=>{for(let i=0;i<t;i++)n.write8(r[i]??0)},...e,validate:r=>{var n;if((n=e==null?void 0:e.validate)==null||n.call(e,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==t)throw new TypeError(`Expected array of length ${t}, found ${r.length}`)}})},string(t){return bn({name:"string",toBytes:e=>new TextEncoder().encode(e),fromBytes:e=>new TextDecoder().decode(e),...t})},fixedArray(t,e,r){return new Z({name:`${e.name}[${t}]`,read:n=>{const i=new Array(t);for(let s=0;s<t;s++)i[s]=e.read(n);return i},write:(n,i)=>{for(const s of n)e.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!==t)throw new TypeError(`Expected array of length ${t}, found ${n.length}`)}})},option(t){return l.enum(`Option<${t.name}>`,{None:null,Some:t}).transform({input:e=>e==null?{None:!0}:{Some:e},output:e=>"Some"in e?e.Some:null})},vector(t,e){return new Z({name:`vector<${t.name}>`,read:r=>{const n=r.readULEB(),i=new Array(n);for(let s=0;s<n;s++)i[s]=t.read(r);return i},write:(r,n)=>{n.writeULEB(r.length);for(const i of r)t.write(i,n)},...e,validate:r=>{var n;if((n=e==null?void 0:e.validate)==null||n.call(e,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`)}})},tuple(t,e){return new Z({name:`(${t.map(r=>r.name).join(", ")})`,serializedSize:r=>{let n=0;for(let i=0;i<t.length;i++){const s=t[i].serializedSize(r[i]);if(s==null)return null;n+=s}return n},read:r=>{const n=[];for(const i of t)n.push(i.read(r));return n},write:(r,n)=>{for(let i=0;i<t.length;i++)t[i].write(r[i],n)},...e,validate:r=>{var n;if((n=e==null?void 0:e.validate)==null||n.call(e,r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==t.length)throw new TypeError(`Expected array of length ${t.length}, found ${r.length}`)}})},struct(t,e,r){const n=Object.entries(e);return new Z({name:t,serializedSize:i=>{let s=0;for(const[c,a]of n){const o=a.serializedSize(i[c]);if(o==null)return null;s+=o}return s},read:i=>{const s={};for(const[c,a]of n)s[c]=a.read(i);return s},write:(i,s)=>{for(const[c,a]of n)a.write(i[c],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(t,e,r){const n=Object.entries(e);return new Z({name:t,read:i=>{const s=i.readULEB(),[c,a]=n[s];return{[c]:(a==null?void 0:a.read(i))??!0}},write:(i,s)=>{const[c,a]=Object.entries(i)[0];for(let o=0;o<n.length;o++){const[d,u]=n[o];if(d===c){s.writeULEB(o),u==null||u.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[c]=s;if(!Object.hasOwn(e,c))throw new TypeError(`Invalid enum variant ${c}`)}})},map(t,e){return l.vector(l.tuple([t,e])).transform({name:`Map<${t.name}, ${e.name}>`,input:r=>[...r.entries()],output:r=>{const n=new Map;for(const[i,s]of r)n.set(i,s);return n}})},generic(t,e){return(...r)=>e(...r).transform({name:`${e.name}<${r.map(n=>n.name).join(", ")}>`,input:n=>n,output:n=>n})},lazy(t){return Sn(t)}},Tn=32,Te=class{constructor(t){if(this.types=new Map,this.counter=0,t instanceof Te){this.schema=t.schema,this.types=new Map(t.types);return}if(this.schema=t,this.registerAddressType(Te.ADDRESS,t.addressLength,t.addressEncoding),this.registerVectorType(t.vectorType),t.types&&t.types.structs)for(let e of Object.keys(t.types.structs))this.registerStructType(e,t.types.structs[e]);if(t.types&&t.types.enums)for(let e of Object.keys(t.types.enums))this.registerEnumType(e,t.types.enums[e]);if(t.types&&t.types.aliases)for(let e of Object.keys(t.types.aliases))this.registerAlias(e,t.types.aliases[e]);t.withPrimitives!==!1&&vn(this)}tempKey(){return`bcs-struct-${++this.counter}`}ser(t,e,r){if(typeof t=="string"||Array.isArray(t)){const{name:n,params:i}=this.parseTypeName(t);return this.getTypeInterface(n).encode(this,e,r,i)}if(typeof t=="object"){const n=this.tempKey();return new Te(this).registerStructType(n,t).ser(n,e,r)}throw new Error(`Incorrect type passed into the '.ser()' function.
1
+ "use strict";var xr=Object.defineProperty;var Br=(t,e,r)=>e in t?xr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var U=(t,e,r)=>Br(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./index-BU_DiszY.js"),b=require("./sui-CLKF35u2.js");require("./index-BQtbCwXd.js");class qt{constructor(e,r,n,i,s=!1){U(this,"transaction");U(this,"network");U(this,"chain");U(this,"description");U(this,"parallelizable");this.transaction=e,this.network=r,this.chain=n,this.description=i,this.parallelizable=s}}class Cr extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...c}=e,{path:a}=e,o=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??o),s!=null&&(this.cause=o),Object.assign(this,c),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function $r(t){return K(t)&&typeof t[Symbol.iterator]=="function"}function K(t){return typeof t=="object"&&t!=null}function J(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function Ur(t){const{done:e,value:r}=t.next();return e?void 0:r}function Pr(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:c}=r,{refinement:a,message:o=`Expected a value of type \`${c}\`${a?` with refinement \`${a}\``:""}, but received: \`${J(n)}\``}=t;return{value:n,type:c,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:o}}function*Lt(t,e,r,n){$r(t)||(t=[t]);for(const i of t){const s=Pr(i,e,r,n);s&&(yield s)}}function*lt(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:c=!1}=r,a={path:n,branch:i};if(s&&(t=e.coercer(t,a),c&&e.type!=="type"&&K(e.schema)&&K(t)&&!Array.isArray(t)))for(const d in t)e.schema[d]===void 0&&delete t[d];let o="valid";for(const d of e.validator(t,a))d.explanation=r.message,o="not_valid",yield[d,void 0];for(let[d,u,g]of e.entries(t,a)){const m=lt(u,g,{path:d===void 0?n:[...n,d],branch:d===void 0?i:[...i,u],coerce:s,mask:c,message:r.message});for(const y of m)y[0]?(o=y[0].refinement!=null?"not_refined":"not_valid",yield[y[0],void 0]):s&&(u=y[1],d===void 0?t=u:t instanceof Map?t.set(d,u):t instanceof Set?t.add(u):K(t)&&(u!==void 0||d in t)&&(t[d]=u))}if(o!=="not_valid")for(const d of e.refiner(t,a))d.explanation=r.message,o="not_refined",yield[d,void 0];o==="valid"&&(yield[void 0,t])}class te{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:c=o=>o,entries:a=function*(){}}=e;this.type=r,this.schema=n,this.entries=a,this.coercer=c,i?this.validator=(o,d)=>{const u=i(o,d);return Lt(u,d,this,o)}:this.validator=()=>[],s?this.refiner=(o,d)=>{const u=s(o,d);return Lt(u,d,this,o)}:this.refiner=()=>[]}assert(e,r){return nt(e,this,r)}create(e,r){return Xt(e,this,r)}is(e){return L(e,this)}mask(e,r){return Zt(e,this,r)}validate(e,r={}){return _e(e,this,r)}}function nt(t,e,r){const n=_e(t,e,{message:r});if(n[0])throw n[0]}function Xt(t,e,r){const n=_e(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Zt(t,e,r){const n=_e(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function L(t,e){return!_e(t,e)[0]}function _e(t,e,r={}){const n=lt(t,e,r),i=Ur(n);return i[0]?[new Cr(i[0],function*(){for(const c of n)c[0]&&(yield c[0])}),void 0]:[void 0,i[1]]}function je(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?Rr(n):p(n)}function W(t,e){return new te({type:t,schema:null,validator:e})}function it(){return W("any",()=>!0)}function E(t){return new te({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${J(e)}`}})}function Mr(){return W("bigint",t=>typeof t=="bigint")}function z(){return W("boolean",t=>typeof t=="boolean")}function ee(){return W("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${J(t)}`)}function k(t){const e=J(t),r=typeof t;return new te({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${J(n)}`}})}function Yt(){return W("never",()=>!1)}function $(t){return new te({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function he(){return W("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${J(t)}`)}function p(t){const e=t?Object.keys(t):[],r=Yt();return new te({type:"object",schema:t||null,*entries(n){if(t&&K(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[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 v(t){return new te({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function Q(t,e){return new te({type:"record",schema:null,*entries(r){if(K(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`}})}function h(){return W("string",t=>typeof t=="string"||`Expected a string, but received: ${J(t)}`)}function Qt(t){const e=Yt();return new te({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${J(r)}`}})}function Rr(t){const e=Object.keys(t);return new te({type:"type",schema:t,*entries(r){if(K(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return K(r)||`Expected an object, but received: ${J(r)}`},coercer(r){return K(r)?{...r}:r}})}function P(t){const e=t.map(r=>r.type).join(" | ");return new te({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...c]=lt(r,s,n),[a]=c;if(a[0])for(const[o]of c)o&&i.push(o);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${J(r)}`,...i]}})}function er(){return W("unknown",()=>!0)}const ft=P([p({AddressOwner:h()}),p({ObjectOwner:h()}),p({Shared:p({initial_shared_version:$(h())})}),k("Immutable")]);W("SuiJsonValue",()=>!0);const Nr=P([p({u32:h()}),p({u64:h()}),p({f64:h()})]);p({attributes:Q(h(),$(Nr)),featureFlags:Q(h(),z()),maxSupportedProtocolVersion:h(),minSupportedProtocolVersion:h(),protocolVersion:h()});P([h(),k("package")]);const ce=p({digest:h(),objectId:h(),version:P([he(),h(),Mr()])});p({owner:ft,reference:ce});p({objectId:h(),sequenceNumber:h()});p({payment:E(ce),owner:h(),price:h(),budget:h()});const Dr=je(ce,p({type:h(),owner:ft,previousTransaction:h()})),Vr=Q(h(),it()),zr=Q(h(),er()),Fr=p({type:h(),fields:Vr,hasPublicTransfer:z()}),Gr=p({disassembled:zr}),Lr=P([je(Fr,p({dataType:k("moveObject")})),je(Gr,p({dataType:k("package")}))]),Wr=p({type:h(),hasPublicTransfer:z(),version:h(),bcsBytes:h()}),Kr=p({id:h(),moduleMap:Q(h(),h())}),Jr=P([je(Wr,p({dataType:k("moveObject")})),je(Kr,p({dataType:k("package")}))]);BigInt(1e9);const tr=p({code:h(),error:v(h()),object_id:v(h()),parent_object_id:v(h()),version:v(h()),digest:v(h())}),Hr=p({data:$(v(Q(h(),h()))),error:$(v(tr))}),qr=P([Hr,v(Q(h(),h()))]),rr=p({objectId:h(),version:h(),digest:h(),type:$(v(h())),content:$(v(Lr)),bcs:$(v(Jr)),owner:$(v(ft)),previousTransaction:$(v(h())),storageRebate:$(v(h())),display:$(v(qr))});p({showType:$(v(z())),showContent:$(v(z())),showBcs:$(v(z())),showOwner:$(v(z())),showPreviousTransaction:$(v(z())),showStorageRebate:$(v(z())),showDisplay:$(v(z()))});P([k("Exists"),k("notExists"),k("Deleted")]);E(Dr);const Xr=p({data:$(v(rr)),error:$(v(tr))});function Zr(t){return t.data}function Yr(t){if(t.error&&"object_id"in t.error&&"version"in t.error&&"digest"in t.error){const e=t.error;return{objectId:e.object_id,version:e.version,digest:e.digest}}}function Wt(t){if("reference"in t)return t.reference;const e=Zr(t);return e?{objectId:e.objectId,version:e.version,digest:e.digest}:Yr(t)}p({objectId:h(),atCheckpoint:v(he())});p({data:E(Xr),nextCursor:v($(h())),hasNextPage:z()});P([p({details:rr,status:k("VersionFound")}),p({details:h(),status:k("ObjectNotExists")}),p({details:ce,status:k("ObjectDeleted")}),p({details:Qt([h(),he()]),status:k("VersionNotFound")}),p({details:p({asked_version:he(),latest_version:he(),object_id:h()}),status:k("VersionTooHigh")})]);const Qr=P([h(),p({Object:h()})]);E(Qr);const en=p({address:h(),name:h()}),tn=P([k("Private"),k("Public"),k("Friend")]),ht=p({abilities:E(h())}),rn=p({constraints:ht,isPhantom:z()}),nn=p({TypeParameter:he()}),Xe=Qt([p({module:h(),package:h(),function:h()}),h()]);p({rank3Days:E(Xe),rank7Days:E(Xe),rank30Days:E(Xe)});function nr(t){if(!t)return!1;if(typeof t=="string"||L(t,nn)||ir(t))return!0;if(typeof t!="object")return!1;const e=t;return!!(L(e.Reference,me)||L(e.MutableReference,me)||L(e.Vector,me))}const me=W("SuiMoveNormalizedType",nr);function ir(t){if(!t||typeof t!="object")return!1;const e=t;if(!e.Struct||typeof e.Struct!="object")return!1;const r=e.Struct;return!(typeof r.address!="string"||typeof r.module!="string"||typeof r.name!="string"||!Array.isArray(r.typeArguments)||!r.typeArguments.every(n=>nr(n)))}W("SuiMoveNormalizedStructType",ir);const sn=p({visibility:tn,isEntry:z(),typeParameters:E(ht),parameters:E(me),return:E(me)}),an=p({name:h(),type:me}),on=p({abilities:ht,typeParameters:E(rn),fields:E(an)}),cn=p({fileFormatVersion:he(),address:h(),name:h(),friends:E(en),structs:Q(h(),on),exposedFunctions:Q(h(),sn)});Q(h(),cn);function st(t){return typeof t=="object"&&"MutableReference"in t?t.MutableReference:void 0}function sr(t){return typeof t=="object"&&"Reference"in t?t.Reference:void 0}function gt(t){if(typeof t=="object"&&"Struct"in t)return t;const e=sr(t),r=st(t);if(typeof e=="object"&&"Struct"in e)return e;if(typeof r=="object"&&"Struct"in r)return r}function un(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var i=t.charAt(n),s=i.charCodeAt(0);if(e[s]!==255)throw new TypeError(i+" is ambiguous");e[s]=n}var c=t.length,a=t.charAt(0),o=Math.log(c)/Math.log(256),d=Math.log(256)/Math.log(c);function u(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 S=0,T=0,f=0,O=y.length;f!==O&&y[f]===0;)f++,S++;for(var B=(O-f)*d+1>>>0,M=new Uint8Array(B);f!==O;){for(var A=y[f],j=0,R=B-1;(A!==0||j<T)&&R!==-1;R--,j++)A+=256*M[R]>>>0,M[R]=A%c>>>0,A=A/c>>>0;if(A!==0)throw new Error("Non-zero carry");T=j,f++}for(var H=B-T;H!==B&&M[H]===0;)H++;for(var pe=a.repeat(S);H<B;++H)pe+=t.charAt(M[H]);return pe}function g(y){if(typeof y!="string")throw new TypeError("Expected String");if(y.length===0)return new Uint8Array;for(var S=0,T=0,f=0;y[S]===a;)T++,S++;for(var O=(y.length-S)*o+1>>>0,B=new Uint8Array(O);y[S];){var M=e[y.charCodeAt(S)];if(M===255)return;for(var A=0,j=O-1;(M!==0||A<f)&&j!==-1;j--,A++)M+=c*B[j]>>>0,B[j]=M%256>>>0,M=M/256>>>0;if(M!==0)throw new Error("Non-zero carry");f=A,S++}for(var R=O-f;R!==O&&B[R]===0;)R++;for(var H=new Uint8Array(T+(O-R)),pe=T;R!==O;)H[pe++]=B[R++];return H}function m(y){var S=g(y);if(S)return S;throw new Error("Non-base"+c+" character")}return{encode:u,decodeUnsafe:g,decode:m}}var dn=un;const ln=dn,fn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var hn=ln(fn);const ar=w.getDefaultExportFromCjs(hn),xe=t=>ar.encode(t),pt=t=>ar.decode(t);function ue(t){return Uint8Array.from(atob(t),e=>e.charCodeAt(0))}const Ze=8192;function Be(t){if(t.length<Ze)return btoa(String.fromCharCode(...t));let e="";for(var r=0;r<t.length;r+=Ze){const n=t.slice(r,r+Ze);e+=String.fromCharCode(...n)}return btoa(e)}function Je(t){var i;const e=t.startsWith("0x")?t.slice(2):t,n=((i=(e.length%2===0?e:`0${e}}`).match(/.{2}/g))==null?void 0:i.map(s=>parseInt(s,16)))??[];return Uint8Array.from(n)}function Ce(t){return t.reduce((e,r)=>e+r.toString(16).padStart(2,"0"),"")}function yt(t){let e=[],r=0;if(t===0)return[0];for(;t>0;)e[r]=t&127,(t>>=7)&&(e[r]|=128),r+=1;return e}function gn(t){let e=0,r=0,n=0;for(;;){let i=t[n];if(n+=1,e|=(i&127)<<r,!(i&128))break;r+=7}return{value:e,length:n}}class or{constructor(e){this.bytePosition=0,this.dataView=new DataView(e.buffer)}shift(e){return this.bytePosition+=e,this}read8(){let e=this.dataView.getUint8(this.bytePosition);return this.shift(1),e}read16(){let e=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),e}read32(){let e=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),e}read64(){let e=this.read32(),n=this.read32().toString(16)+e.toString(16).padStart(8,"0");return BigInt("0x"+n).toString(10)}read128(){let e=BigInt(this.read64()),n=BigInt(this.read64()).toString(16)+e.toString(16).padStart(16,"0");return BigInt("0x"+n).toString(10)}read256(){let e=BigInt(this.read128()),n=BigInt(this.read128()).toString(16)+e.toString(16).padStart(32,"0");return BigInt("0x"+n).toString(10)}readBytes(e){let r=this.bytePosition+this.dataView.byteOffset,n=new Uint8Array(this.dataView.buffer,r,e);return this.shift(e),n}readULEB(){let e=this.bytePosition+this.dataView.byteOffset,r=new Uint8Array(this.dataView.buffer,e),{value:n,length:i}=gn(r);return this.shift(i),n}readVec(e){let r=this.readULEB(),n=[];for(let i=0;i<r;i++)n.push(e(this,i,r));return n}}function pn(t,e){switch(e){case"base58":return xe(t);case"base64":return Be(t);case"hex":return Ce(t);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function yn(t,e){switch(e){case"base58":return pt(t);case"base64":return ue(t);case"hex":return Je(t);default:throw new Error("Unsupported encoding, supported values are: base64, hex")}}function mt(t,e=["<",">"]){const[r,n]=e,i=[];let s="",c=0;for(let a=0;a<t.length;a++){const o=t[a];if(o===r&&c++,o===n&&c--,c===0&&o===","){i.push(s.trim()),s="";continue}s+=o}return i.push(s.trim()),i}class cr{constructor({size:e=1024,maxSize:r,allocateSize:n=1024}={}){this.bytePosition=0,this.size=e,this.maxSize=r||e,this.allocateSize=n,this.dataView=new DataView(new ArrayBuffer(e))}ensureSizeOrGrow(e){const r=this.bytePosition+e;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(e){return this.bytePosition+=e,this}write8(e){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(e)),this.shift(1)}write16(e){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(e),!0),this.shift(2)}write32(e){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(e),!0),this.shift(4)}write64(e){return Ye(BigInt(e),8).forEach(r=>this.write8(r)),this}write128(e){return Ye(BigInt(e),16).forEach(r=>this.write8(r)),this}write256(e){return Ye(BigInt(e),32).forEach(r=>this.write8(r)),this}writeULEB(e){return yt(e).forEach(r=>this.write8(r)),this}writeVec(e,r){return this.writeULEB(e.length),Array.from(e).forEach((n,i)=>r(this,n,i,e.length)),this}*[Symbol.iterator](){for(let e=0;e<this.bytePosition;e++)yield this.dataView.getUint8(e);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(e){return pn(this.toBytes(),e)}}function Ye(t,e){let r=new Uint8Array(e),n=0;for(;t>0;)r[n]=Number(t%BigInt(256)),t=t/BigInt(256),n+=1;return r}var ur=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},X=(t,e,r)=>(ur(t,e,"read from private field"),r?r.call(t):e.get(t)),ze=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},Fe=(t,e,r,n)=>(ur(t,e,"write to private field"),e.set(t,r),r),ye,Se,Me,ae;const dr=class{constructor(t){ze(this,ye,void 0),ze(this,Se,void 0),this.name=t.name,this.read=t.read,this.serializedSize=t.serializedSize??(()=>null),Fe(this,ye,t.write),Fe(this,Se,t.serialize??((e,r)=>{const n=new cr({size:this.serializedSize(e)??void 0,...r});return X(this,ye).call(this,e,n),n.toBytes()})),this.validate=t.validate??(()=>{})}write(t,e){this.validate(t),X(this,ye).call(this,t,e)}serialize(t,e){return this.validate(t),new mn(this,X(this,Se).call(this,t,e))}parse(t){const e=new or(t);return this.read(e)}transform({name:t,input:e,output:r}){return new dr({name:t??this.name,read:n=>r(this.read(n)),write:(n,i)=>X(this,ye).call(this,e(n),i),serializedSize:n=>this.serializedSize(e(n)),serialize:(n,i)=>X(this,Se).call(this,e(n),i),validate:n=>this.validate(e(n))})}};let Z=dr;ye=new WeakMap;Se=new WeakMap;const lr=Symbol.for("@mysten/serialized-bcs");function wt(t){return!!t&&typeof t=="object"&&t[lr]===!0}class mn{constructor(e,r){ze(this,Me,void 0),ze(this,ae,void 0),Fe(this,Me,e),Fe(this,ae,r)}get[lr](){return!0}toBytes(){return X(this,ae)}toHex(){return Ce(X(this,ae))}toBase64(){return Be(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 Ge({size:t,...e}){return new Z({...e,serializedSize:()=>t})}function Qe({readMethod:t,writeMethod:e,...r}){return Ge({...r,read:n=>n[t](),write:(n,i)=>i[e](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 et({readMethod:t,writeMethod:e,...r}){return Ge({...r,read:n=>n[t](),write:(n,i)=>i[e](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 wn({serialize:t,...e}){const r=new Z({...e,serialize:t,write:(n,i)=>{for(const s of r.serialize(n).toBytes())i.write8(s)}});return r}function bn({toBytes:t,fromBytes:e,...r}){return new Z({...r,read:n=>{const i=n.readULEB(),s=n.readBytes(i);return e(s)},write:(n,i)=>{const s=t(n);i.writeULEB(s.length);for(let c=0;c<s.length;c++)i.write8(s[c])},serialize:n=>{const i=t(n),s=yt(i.length),c=new Uint8Array(s.length+i.length);return c.set(s,0),c.set(i,s.length),c},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 Sn(t){let e=null;function r(){return e||(e=t()),e}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 l={u8(t){return Qe({name:"u8",readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...t})},u16(t){return Qe({name:"u16",readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...t})},u32(t){return Qe({name:"u32",readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...t})},u64(t){return et({name:"u64",readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...t})},u128(t){return et({name:"u128",readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...t})},u256(t){return et({name:"u256",readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...t})},bool(t){return Ge({name:"bool",size:1,read:e=>e.read8()===1,write:(e,r)=>r.write8(e?1:0),...t,validate:e=>{var r;if((r=t==null?void 0:t.validate)==null||r.call(t,e),typeof e!="boolean")throw new TypeError(`Expected boolean, found ${typeof e}`)}})},uleb128(t){return wn({name:"uleb128",read:e=>e.readULEB(),serialize:e=>Uint8Array.from(yt(e)),...t})},bytes(t,e){return Ge({name:`bytes[${t}]`,size:t,read:r=>r.readBytes(t),write:(r,n)=>{for(let i=0;i<t;i++)n.write8(r[i]??0)},...e,validate:r=>{var n;if((n=e==null?void 0:e.validate)==null||n.call(e,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==t)throw new TypeError(`Expected array of length ${t}, found ${r.length}`)}})},string(t){return bn({name:"string",toBytes:e=>new TextEncoder().encode(e),fromBytes:e=>new TextDecoder().decode(e),...t})},fixedArray(t,e,r){return new Z({name:`${e.name}[${t}]`,read:n=>{const i=new Array(t);for(let s=0;s<t;s++)i[s]=e.read(n);return i},write:(n,i)=>{for(const s of n)e.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!==t)throw new TypeError(`Expected array of length ${t}, found ${n.length}`)}})},option(t){return l.enum(`Option<${t.name}>`,{None:null,Some:t}).transform({input:e=>e==null?{None:!0}:{Some:e},output:e=>"Some"in e?e.Some:null})},vector(t,e){return new Z({name:`vector<${t.name}>`,read:r=>{const n=r.readULEB(),i=new Array(n);for(let s=0;s<n;s++)i[s]=t.read(r);return i},write:(r,n)=>{n.writeULEB(r.length);for(const i of r)t.write(i,n)},...e,validate:r=>{var n;if((n=e==null?void 0:e.validate)==null||n.call(e,r),!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`)}})},tuple(t,e){return new Z({name:`(${t.map(r=>r.name).join(", ")})`,serializedSize:r=>{let n=0;for(let i=0;i<t.length;i++){const s=t[i].serializedSize(r[i]);if(s==null)return null;n+=s}return n},read:r=>{const n=[];for(const i of t)n.push(i.read(r));return n},write:(r,n)=>{for(let i=0;i<t.length;i++)t[i].write(r[i],n)},...e,validate:r=>{var n;if((n=e==null?void 0:e.validate)==null||n.call(e,r),!Array.isArray(r))throw new TypeError(`Expected array, found ${typeof r}`);if(r.length!==t.length)throw new TypeError(`Expected array of length ${t.length}, found ${r.length}`)}})},struct(t,e,r){const n=Object.entries(e);return new Z({name:t,serializedSize:i=>{let s=0;for(const[c,a]of n){const o=a.serializedSize(i[c]);if(o==null)return null;s+=o}return s},read:i=>{const s={};for(const[c,a]of n)s[c]=a.read(i);return s},write:(i,s)=>{for(const[c,a]of n)a.write(i[c],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(t,e,r){const n=Object.entries(e);return new Z({name:t,read:i=>{const s=i.readULEB(),[c,a]=n[s];return{[c]:(a==null?void 0:a.read(i))??!0}},write:(i,s)=>{const[c,a]=Object.entries(i)[0];for(let o=0;o<n.length;o++){const[d,u]=n[o];if(d===c){s.writeULEB(o),u==null||u.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[c]=s;if(!Object.hasOwn(e,c))throw new TypeError(`Invalid enum variant ${c}`)}})},map(t,e){return l.vector(l.tuple([t,e])).transform({name:`Map<${t.name}, ${e.name}>`,input:r=>[...r.entries()],output:r=>{const n=new Map;for(const[i,s]of r)n.set(i,s);return n}})},generic(t,e){return(...r)=>e(...r).transform({name:`${e.name}<${r.map(n=>n.name).join(", ")}>`,input:n=>n,output:n=>n})},lazy(t){return Sn(t)}},Tn=32,Te=class{constructor(t){if(this.types=new Map,this.counter=0,t instanceof Te){this.schema=t.schema,this.types=new Map(t.types);return}if(this.schema=t,this.registerAddressType(Te.ADDRESS,t.addressLength,t.addressEncoding),this.registerVectorType(t.vectorType),t.types&&t.types.structs)for(let e of Object.keys(t.types.structs))this.registerStructType(e,t.types.structs[e]);if(t.types&&t.types.enums)for(let e of Object.keys(t.types.enums))this.registerEnumType(e,t.types.enums[e]);if(t.types&&t.types.aliases)for(let e of Object.keys(t.types.aliases))this.registerAlias(e,t.types.aliases[e]);t.withPrimitives!==!1&&vn(this)}tempKey(){return`bcs-struct-${++this.counter}`}ser(t,e,r){if(typeof t=="string"||Array.isArray(t)){const{name:n,params:i}=this.parseTypeName(t);return this.getTypeInterface(n).encode(this,e,r,i)}if(typeof t=="object"){const n=this.tempKey();return new Te(this).registerStructType(n,t).ser(n,e,r)}throw new Error(`Incorrect type passed into the '.ser()' function.
2
2
  ${JSON.stringify(t)}`)}de(t,e,r){if(typeof e=="string")if(r)e=yn(e,r);else throw new Error("To pass a string to `bcs.de`, specify encoding");if(typeof t=="string"||Array.isArray(t)){const{name:n,params:i}=this.parseTypeName(t);return this.getTypeInterface(n).decode(this,e,i)}if(typeof t=="object"){const n=new Te(this),i=this.tempKey();return n.registerStructType(i,t).de(i,e,r)}throw new Error(`Incorrect type passed into the '.de()' function.
3
3
  ${JSON.stringify(t)}`)}hasType(t){return this.types.has(t)}registerAlias(t,e){return this.types.set(t,e),this}registerType(t,e,r,n=()=>!0){const{name:i,params:s}=this.parseTypeName(t);return this.types.set(i,{encode(c,a,o,d){const u=s.reduce((g,m,y)=>Object.assign(g,{[m]:d[y]}),{});return this._encodeRaw.call(c,new cr(o),a,d,u)},decode(c,a,o){const d=s.reduce((u,g,m)=>Object.assign(u,{[g]:o[m]}),{});return this._decodeRaw.call(c,new or(a),o,d)},_encodeRaw(c,a,o,d){if(n(a))return e.call(this,c,a,o,d);throw new Error(`Validation failed for type ${i}, data: ${a}`)},_decodeRaw(c,a,o){return r.call(this,c,a,o)}}),this}registerBcsType(t,e){return this.registerType(t,(r,n,i)=>{const s=i.map(c=>new Z({name:String(c),write:(a,o)=>{const{name:d,params:u}=this.parseTypeName(c),g=this.getTypeInterface(d),m=u.reduce((y,S,T)=>Object.assign(y,{[S]:i[T]}),{});return g._encodeRaw.call(this,o,a,u,m)},read:()=>{throw new Error("Not implemented")}}));return e(...s).write(n,r),r},(r,n)=>{const i=n.map(s=>new Z({name:String(s),write:(c,a)=>{throw new Error("Not implemented")},read:c=>{const{name:a,params:o}=this.parseTypeName(s),d=this.getTypeInterface(a),u=o.reduce((g,m,y)=>Object.assign(g,{[m]:n[y]}),{});return d._decodeRaw.call(this,c,o,u)}}));return e(...i).read(r)}),this}registerAddressType(t,e,r="hex"){switch(r){case"base64":return this.registerType(t,function(i,s){return ue(s).reduce((c,a)=>c.write8(a),i)},function(i){return Be(i.readBytes(e))});case"hex":return this.registerType(t,function(i,s){return Je(s).reduce((c,a)=>c.write8(a),i)},function(i){return Ce(i.readBytes(e))});default:throw new Error("Unsupported encoding! Use either hex or base64")}}registerVectorType(t){let{name:e,params:r}=this.parseTypeName(t);if(r.length>1)throw new Error("Vector can have only one type parameter; got "+e);return this.registerType(t,function(i,s,c,a){return i.writeVec(s,(o,d)=>{let u=c[0];if(!u)throw new Error(`Incorrect number of type parameters passed a to vector '${t}'`);let{name:g,params:m}=this.parseTypeName(u);if(this.hasType(g))return this.getTypeInterface(g)._encodeRaw.call(this,o,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:S}=this.parseTypeName(a[g]);return this.getTypeInterface(y)._encodeRaw.call(this,o,d,S,a)})},function(i,s,c){return i.readVec(a=>{let o=s[0];if(!o)throw new Error(`Incorrect number of type parameters passed to a vector '${t}'`);let{name:d,params:u}=this.parseTypeName(o);if(this.hasType(d))return this.getTypeInterface(d)._decodeRaw.call(this,a,u,c);if(!(d in c))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(c[d]);return this.getTypeInterface(g)._decodeRaw.call(this,a,m,c)})})}registerStructType(t,e){for(let c in e){let a=this.tempKey(),o=e[c];!Array.isArray(o)&&typeof o!="string"&&(e[c]=a,this.registerStructType(a,o))}let r=Object.freeze(e),n=Object.keys(r),{name:i,params:s}=this.parseTypeName(t);return this.registerType(t,function(a,o,d,u){if(!o||o.constructor!==Object)throw new Error(`Expected ${i} to be an Object, got: ${o}`);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 o))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,o[g],y,u);else{const S=s.indexOf(m);let{name:T,params:f}=this.parseTypeName(d[S]);if(this.hasType(T)){this.getTypeInterface(T)._encodeRaw.call(this,a,o[g],f,u);continue}if(!(T in u))throw new Error(`Unable to find a matching type definition for ${T} in ${i}; make sure you passed a generic`);let{name:O,params:B}=this.parseTypeName(u[T]);this.getTypeInterface(O)._encodeRaw.call(this,a,o[g],B,u)}}return a},function(a,o,d){if(o.length!==s.length)throw new Error(`Incorrect number of generic parameters passed; expected: ${s.length}, got: ${o.length}`);let u={};for(let g of n){const{name:m,params:y}=this.parseTypeName(r[g]);if(!s.includes(m))u[g]=this.getTypeInterface(m)._decodeRaw.call(this,a,y,d);else{const S=s.indexOf(m);let{name:T,params:f}=this.parseTypeName(o[S]);if(this.hasType(T)){u[g]=this.getTypeInterface(T)._decodeRaw.call(this,a,f,d);continue}if(!(T in d))throw new Error(`Unable to find a matching type definition for ${T} in ${i}; make sure you passed a generic`);let{name:O,params:B}=this.parseTypeName(d[T]);u[g]=this.getTypeInterface(O)._decodeRaw.call(this,a,B,d)}}return u})}registerEnumType(t,e){for(let c in e){let a=this.tempKey(),o=e[c];o!==null&&!Array.isArray(o)&&typeof o!="string"&&(e[c]=a,this.registerStructType(a,o))}let r=Object.freeze(e),n=Object.keys(r),{name:i,params:s}=this.parseTypeName(t);return this.registerType(t,function(a,o,d,u){if(!o)throw new Error(`Unable to write enum "${i}", missing data.
4
4
  Received: "${o}"`);if(typeof o!="object")throw new Error(`Incorrect data passed into enum "${i}", expected object with properties: "${n.join(" | ")}".
@@ -1 +1 @@
1
- "use strict";var A=Object.defineProperty;var y=(o,e,t)=>e in o?A(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var i=(o,e,t)=>y(o,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CEovIwuS.js"),g=require("./aptos-DLBpR9Uw.js");class f{constructor(e,t,r,n,a=!1){i(this,"transaction");i(this,"network");i(this,"chain");i(this,"description");i(this,"parallelizable");this.transaction=e,this.network=t,this.chain=r,this.description=n,this.parallelizable=a}}const w=[{name:"tokenBridgeAddress",...s.universalAddressItem},{name:"chain",...s.chainItem()},{name:"domainSeparator",binary:"bytes",custom:s.bytes.encode(s.APTOS_SEPARATOR),omit:!0},{name:"tokenId",...s.universalAddressItem},{name:"domainSeparator",binary:"bytes",custom:new Uint8Array([255]),omit:!0}],k=o=>s.serializeLayout(w,o);class d{constructor(e,t,r,n){i(this,"network");i(this,"chain");i(this,"connection");i(this,"contracts");i(this,"chainId");i(this,"tokenBridgeAddress");this.network=e,this.chain=t,this.connection=r,this.contracts=n,this.chainId=s.toChainId(t);const a=n.tokenBridge;if(!a)throw new Error(`TokenBridge contract Address for chain ${t} not found`);this.tokenBridgeAddress=a}static async fromRpc(e,t){const[r,n]=await g.AptosPlatform.chainFromRpc(e),a=t[n];if(a.network!==r)throw new Error("Network mismatch "+a.network+" !== "+r);return new d(r,n,e,a.contracts)}async isWrappedAsset(e){try{return await this.getOriginalAsset(e),!0}catch{return!1}}async getOriginalAsset(e){const t=e.toString().split(s.APTOS_SEPARATOR);let r;if(r=(await this.connection.getAccountResource(t[0],`${this.tokenBridgeAddress}::state::OriginInfo`)).data,!r)throw s.ErrNotWrapped;const n=s.toChain(parseInt(r.token_chain.number)),a=new s.UniversalAddress(r.token_address.external_address);return{chain:n,address:a}}async getTokenUniversalAddress(e){return new s.UniversalAddress(s.hex.encode(s.sha3_256(e.toString()),!0))}async getTokenNativeAddress(e,t){const r=e===this.chain?await this.getTypeFromExternalAddress(t.toString()):await this.getAssetFullyQualifiedType({chain:e,address:t});if(!r)throw new Error("Invalid asset address.");return new s.AptosAddress(r)}async hasWrappedAsset(e){try{return await this.getWrappedAsset(e),!0}catch{}return!1}async getWrappedAsset(e){if(s.isNative(e.address))throw new Error("native asset cannot be a wrapped asset");const t=await this.getAssetFullyQualifiedType(e);if(!t)throw new Error("Invalid asset address.");return await this.connection.getAccountResource(s.coalesceModuleAddress(t),`${this.tokenBridgeAddress}::state::OriginInfo`),s.toNative(this.chain,t)}async isTransferCompleted(e){const r=(await this.connection.getAccountResource(this.tokenBridgeAddress,`${this.tokenBridgeAddress}::state::State`)).data.consumed_vaas.elems.handle;try{return await this.connection.getTableItem(r,{key_type:"vector<u8>",value_type:"u8",key:`0x${s.dist.Buffer.from(s.keccak_256(e.hash)).toString("hex")}`}),!0}catch{return!1}}async getWrappedNative(){return s.toNative(this.chain,s.APTOS_COIN)}async*createAttestation(e,t){const r={chain:this.chain,address:new s.AptosAddress(e)},n=await this.getAssetFullyQualifiedType(r);if(!n)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::attest_token::attest_token_entry`,type_arguments:[n],arguments:[]},"Aptos.AttestToken")}async*submitAttestation(e,t){yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::wrapped::create_wrapped_coin_type`,type_arguments:[],arguments:[s.serialize(e)]},"Aptos.CreateWrappedCoinType");const r=await this.getAssetFullyQualifiedType(e.payload.token);if(!r)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::wrapped::create_wrapped_coin`,type_arguments:[r],arguments:[s.serialize(e)]},"Aptos.CreateWrappedCoin")}async*transfer(e,t,r,n,a){const p=0n,c=0n,h=s.isNative(r)?s.APTOS_COIN:r.toString(),l=t.address.toUniversalAddress().toUint8Array(),u=s.toChainId(t.chain);a?yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::transfer_tokens::transfer_tokens_with_payload_entry`,type_arguments:[h],arguments:[n,u,l,c,a]},"Aptos.TransferTokensWithPayload"):yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::transfer_tokens::transfer_tokens_entry`,type_arguments:[h],arguments:[n,u,l,p,c]},"Aptos.TransferTokens")}async*redeem(e,t,r=!0){const n=t.payload.token.chain===this.chain?await this.getTypeFromExternalAddress(t.payload.token.address.toString()):await this.getAssetFullyQualifiedType(t.payload.token);if(!n)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::complete_transfer::submit_vaa_and_register_entry`,type_arguments:[n],arguments:[s.serialize(t)]},"Aptos.CompleteTransfer")}async getAssetFullyQualifiedType(e){return e.chain===this.chain?s.isValidAptosType(e.address.toString())?e.address.toString():null:`${d.getForeignAssetAddress(this.chain,this.tokenBridgeAddress,e)}::coin::T`}async getTypeFromExternalAddress(e){try{const t=(await this.connection.getAccountResource(this.tokenBridgeAddress,`${this.tokenBridgeAddress}::state::State`)).data,{handle:r}=t.native_infos,n=await this.connection.getTableItem(r,{key_type:`${this.tokenBridgeAddress}::token_hash::TokenHash`,value_type:"0x1::type_info::TypeInfo",key:{hash:e}});return n?[n.account_address,String.fromCharCode(...s.hex.decode(n.module_name)),String.fromCharCode(...s.hex.decode(n.struct_name))].join(s.APTOS_SEPARATOR):null}catch{return null}}static getForeignAssetAddress(e,t,r){if(s.isNative(r.address))throw new Error("Invalid token address");const n=k({chain:r.chain,tokenBridgeAddress:new s.AptosAddress(t).toUniversalAddress(),tokenId:r.address.toUniversalAddress()});return s.hex.encode(s.sha3_256(n),!0)}createUnsignedTx(e,t,r=!1){return new f(e,this.network,this.chain,t,r)}}s.registerProtocol("Aptos","TokenBridge",d);exports.AptosTokenBridge=d;
1
+ "use strict";var A=Object.defineProperty;var y=(o,e,t)=>e in o?A(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t;var i=(o,e,t)=>y(o,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-BU_DiszY.js"),g=require("./aptos-j2PEnEen.js");class f{constructor(e,t,r,n,a=!1){i(this,"transaction");i(this,"network");i(this,"chain");i(this,"description");i(this,"parallelizable");this.transaction=e,this.network=t,this.chain=r,this.description=n,this.parallelizable=a}}const w=[{name:"tokenBridgeAddress",...s.universalAddressItem},{name:"chain",...s.chainItem()},{name:"domainSeparator",binary:"bytes",custom:s.bytes.encode(s.APTOS_SEPARATOR),omit:!0},{name:"tokenId",...s.universalAddressItem},{name:"domainSeparator",binary:"bytes",custom:new Uint8Array([255]),omit:!0}],k=o=>s.serializeLayout(w,o);class d{constructor(e,t,r,n){i(this,"network");i(this,"chain");i(this,"connection");i(this,"contracts");i(this,"chainId");i(this,"tokenBridgeAddress");this.network=e,this.chain=t,this.connection=r,this.contracts=n,this.chainId=s.toChainId(t);const a=n.tokenBridge;if(!a)throw new Error(`TokenBridge contract Address for chain ${t} not found`);this.tokenBridgeAddress=a}static async fromRpc(e,t){const[r,n]=await g.AptosPlatform.chainFromRpc(e),a=t[n];if(a.network!==r)throw new Error("Network mismatch "+a.network+" !== "+r);return new d(r,n,e,a.contracts)}async isWrappedAsset(e){try{return await this.getOriginalAsset(e),!0}catch{return!1}}async getOriginalAsset(e){const t=e.toString().split(s.APTOS_SEPARATOR);let r;if(r=(await this.connection.getAccountResource(t[0],`${this.tokenBridgeAddress}::state::OriginInfo`)).data,!r)throw s.ErrNotWrapped;const n=s.toChain(parseInt(r.token_chain.number)),a=new s.UniversalAddress(r.token_address.external_address);return{chain:n,address:a}}async getTokenUniversalAddress(e){return new s.UniversalAddress(s.hex.encode(s.sha3_256(e.toString()),!0))}async getTokenNativeAddress(e,t){const r=e===this.chain?await this.getTypeFromExternalAddress(t.toString()):await this.getAssetFullyQualifiedType({chain:e,address:t});if(!r)throw new Error("Invalid asset address.");return new s.AptosAddress(r)}async hasWrappedAsset(e){try{return await this.getWrappedAsset(e),!0}catch{}return!1}async getWrappedAsset(e){if(s.isNative(e.address))throw new Error("native asset cannot be a wrapped asset");const t=await this.getAssetFullyQualifiedType(e);if(!t)throw new Error("Invalid asset address.");return await this.connection.getAccountResource(s.coalesceModuleAddress(t),`${this.tokenBridgeAddress}::state::OriginInfo`),s.toNative(this.chain,t)}async isTransferCompleted(e){const r=(await this.connection.getAccountResource(this.tokenBridgeAddress,`${this.tokenBridgeAddress}::state::State`)).data.consumed_vaas.elems.handle;try{return await this.connection.getTableItem(r,{key_type:"vector<u8>",value_type:"u8",key:`0x${s.dist.Buffer.from(s.keccak_256(e.hash)).toString("hex")}`}),!0}catch{return!1}}async getWrappedNative(){return s.toNative(this.chain,s.APTOS_COIN)}async*createAttestation(e,t){const r={chain:this.chain,address:new s.AptosAddress(e)},n=await this.getAssetFullyQualifiedType(r);if(!n)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::attest_token::attest_token_entry`,type_arguments:[n],arguments:[]},"Aptos.AttestToken")}async*submitAttestation(e,t){yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::wrapped::create_wrapped_coin_type`,type_arguments:[],arguments:[s.serialize(e)]},"Aptos.CreateWrappedCoinType");const r=await this.getAssetFullyQualifiedType(e.payload.token);if(!r)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::wrapped::create_wrapped_coin`,type_arguments:[r],arguments:[s.serialize(e)]},"Aptos.CreateWrappedCoin")}async*transfer(e,t,r,n,a){const p=0n,c=0n,h=s.isNative(r)?s.APTOS_COIN:r.toString(),l=t.address.toUniversalAddress().toUint8Array(),u=s.toChainId(t.chain);a?yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::transfer_tokens::transfer_tokens_with_payload_entry`,type_arguments:[h],arguments:[n,u,l,c,a]},"Aptos.TransferTokensWithPayload"):yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::transfer_tokens::transfer_tokens_entry`,type_arguments:[h],arguments:[n,u,l,p,c]},"Aptos.TransferTokens")}async*redeem(e,t,r=!0){const n=t.payload.token.chain===this.chain?await this.getTypeFromExternalAddress(t.payload.token.address.toString()):await this.getAssetFullyQualifiedType(t.payload.token);if(!n)throw new Error("Invalid asset address.");yield this.createUnsignedTx({function:`${this.tokenBridgeAddress}::complete_transfer::submit_vaa_and_register_entry`,type_arguments:[n],arguments:[s.serialize(t)]},"Aptos.CompleteTransfer")}async getAssetFullyQualifiedType(e){return e.chain===this.chain?s.isValidAptosType(e.address.toString())?e.address.toString():null:`${d.getForeignAssetAddress(this.chain,this.tokenBridgeAddress,e)}::coin::T`}async getTypeFromExternalAddress(e){try{const t=(await this.connection.getAccountResource(this.tokenBridgeAddress,`${this.tokenBridgeAddress}::state::State`)).data,{handle:r}=t.native_infos,n=await this.connection.getTableItem(r,{key_type:`${this.tokenBridgeAddress}::token_hash::TokenHash`,value_type:"0x1::type_info::TypeInfo",key:{hash:e}});return n?[n.account_address,String.fromCharCode(...s.hex.decode(n.module_name)),String.fromCharCode(...s.hex.decode(n.struct_name))].join(s.APTOS_SEPARATOR):null}catch{return null}}static getForeignAssetAddress(e,t,r){if(s.isNative(r.address))throw new Error("Invalid token address");const n=k({chain:r.chain,tokenBridgeAddress:new s.AptosAddress(t).toUniversalAddress(),tokenId:r.address.toUniversalAddress()});return s.hex.encode(s.sha3_256(n),!0)}createUnsignedTx(e,t,r=!1){return new f(e,this.network,this.chain,t,r)}}s.registerProtocol("Aptos","TokenBridge",d);exports.AptosTokenBridge=d;
@@ -1,9 +1,9 @@
1
1
  var Q = Object.defineProperty;
2
2
  var X = (O, e, t) => e in O ? Q(O, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : O[e] = t;
3
3
  var d = (O, e, t) => X(O, typeof e != "symbol" ? e + "" : e, t);
4
- import { A as S, S as g, a as Y } from "./index-Cpjj11xV.mjs";
5
- import { da as Z, a5 as C, a8 as $, db as _, an as I, dc as v, dd as q, bO as tt, cq as b, ca as et, p as H, cf as K, de as y, df as u, dg as k, dh as U, bP as L, di as z, dj as st, dk as V, dl as ot, bU as nt, ak as rt } from "./index-DWJ5r15M.mjs";
6
- import { A as at } from "./algorand-CLoiUadv.mjs";
4
+ import { A as S, S as g, a as Y } from "./index-B8T2NaoX.mjs";
5
+ import { d9 as Z, a5 as C, a8 as $, da as _, an as I, db as v, dc as q, bN as tt, cp as b, c9 as et, p as H, ce as K, dd as y, de as u, df as k, dg as U, bO as L, dh as z, di as st, dj as V, dk as ot, bT as nt, ak as rt } from "./index-7zA9RXv7.mjs";
6
+ import { A as at } from "./algorand-D_QRI-bg.mjs";
7
7
  const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
8
8
  constructor(e, t, n, o) {
9
9
  d(this, "network");
@@ -94,29 +94,29 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
94
94
  r.push(...w);
95
95
  let f = "", i;
96
96
  if (o !== 0) {
97
- const m = await this.connection.getAssetByID(o).do(), j = v.from_obj_for_encoding(m), E = await this.connection.accountInformation(j.params.creator).do();
97
+ const l = await this.connection.getAssetByID(o).do(), j = v.from_obj_for_encoding(l), E = await this.connection.accountInformation(j.params.creator).do();
98
98
  if (i = q.from_obj_for_encoding(E), i.authAddr === this.tokenBridgeAddress.toString())
99
99
  throw new Error("Cannot re-attest wormhole assets");
100
100
  }
101
101
  const T = g.forNativeAsset(this.tokenBridgeAppId, BigInt(o)), B = await S.maybeCreateStorageTx(this.connection, n, this.tokenBridgeAppId, T);
102
102
  f = B.accounts[0], r.push(...B.txs);
103
- const l = y({
103
+ const m = y({
104
104
  from: n,
105
105
  appIndex: u(this.tokenBridgeAppId),
106
106
  onComplete: k.NoOpOC,
107
107
  appArgs: [c.noop],
108
108
  suggestedParams: a
109
109
  });
110
- r.push({ tx: l });
110
+ r.push({ tx: m });
111
111
  const A = await this.coreBridge.getMessageFee();
112
112
  if (A > BigInt(0)) {
113
- const m = U({
113
+ const l = U({
114
114
  from: n,
115
115
  suggestedParams: a,
116
116
  to: this.tokenBridgeAddress,
117
117
  amount: A
118
118
  });
119
- r.push({ tx: m });
119
+ r.push({ tx: l });
120
120
  }
121
121
  let W = [p, f, this.coreAppAddress];
122
122
  i && W.push(i.address);
@@ -131,8 +131,8 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
131
131
  suggestedParams: a
132
132
  });
133
133
  A > BigInt(0) ? h.fee *= 3 : h.fee *= 2, r.push({ tx: h });
134
- for (const m of r)
135
- yield this.createUnsignedTx(m, "TokenBridge.createAttestation", !0);
134
+ for (const l of r)
135
+ yield this.createUnsignedTx(l, "TokenBridge.createAttestation", !0);
136
136
  }
137
137
  // Submits the Token Attestation VAA to the Token Bridge
138
138
  // to create the wrapped token represented by the data in the VAA
@@ -186,17 +186,17 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
186
186
  appAddress: z(this.coreAppAddress).publicKey,
187
187
  idx: BigInt(0),
188
188
  address: z(this.tokenBridgeAddress).publicKey
189
- }), l = [], { accounts: [A], txs: W } = await S.maybeCreateStorageTx(this.connection, a, this.coreAppId, B, i);
190
- l.push(...W);
191
- let h = "", m, j = !1;
189
+ }), m = [], { accounts: [A], txs: W } = await S.maybeCreateStorageTx(this.connection, a, this.coreAppId, B, i);
190
+ m.push(...W);
191
+ let h = "", l, j = !1;
192
192
  if (s !== 0) {
193
193
  const x = await this.connection.getAssetByID(s).do();
194
194
  h = v.from_obj_for_encoding(x).params.creator;
195
195
  const R = await this.connection.accountInformation(h).do();
196
- m = q.from_obj_for_encoding(R), j = m.authAddr === this.tokenBridgeAddress.toString();
196
+ l = q.from_obj_for_encoding(R), j = l.authAddr === this.tokenBridgeAddress.toString();
197
197
  }
198
198
  const E = await this.coreBridge.getMessageFee();
199
- if (E > 0 && l.push({
199
+ if (E > 0 && m.push({
200
200
  tx: U({
201
201
  from: a,
202
202
  to: this.tokenBridgeAddress,
@@ -223,7 +223,7 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
223
223
  accounts: [h],
224
224
  suggestedParams: i
225
225
  });
226
- N.fee *= 2, l.unshift({ tx: x }, { tx: N });
226
+ N.fee *= 2, m.unshift({ tx: x }, { tx: N });
227
227
  }
228
228
  const J = y({
229
229
  from: a,
@@ -232,7 +232,7 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
232
232
  appArgs: [c.noop],
233
233
  suggestedParams: i
234
234
  });
235
- l.push({ tx: J });
235
+ m.push({ tx: J });
236
236
  let F = [];
237
237
  if (s === 0) {
238
238
  const x = U({
@@ -241,7 +241,7 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
241
241
  amount: p,
242
242
  suggestedParams: i
243
243
  });
244
- l.push({ tx: x }), F = [A, h, h];
244
+ m.push({ tx: x }), F = [A, h, h];
245
245
  } else {
246
246
  const x = V({
247
247
  from: a,
@@ -250,9 +250,9 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
250
250
  assetIndex: s,
251
251
  suggestedParams: i
252
252
  });
253
- l.push({ tx: x }), F = m != null && m.address ? [A, h, m.address] : [A, h];
253
+ m.push({ tx: x }), F = l != null && l.address ? [A, h, l.address] : [A, h];
254
254
  }
255
- const D = [
255
+ const M = [
256
256
  c.sendTransfer,
257
257
  b.toBytes(s, 8),
258
258
  b.toBytes(p, 8),
@@ -260,19 +260,19 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
260
260
  b.toBytes(w, 8),
261
261
  b.toBytes(T, 8)
262
262
  ];
263
- r && D.push(r);
264
- const M = y({
263
+ r && M.push(r);
264
+ const P = y({
265
265
  from: a,
266
266
  appIndex: u(this.tokenBridgeAppId),
267
267
  onComplete: k.NoOpOC,
268
- appArgs: D,
268
+ appArgs: M,
269
269
  foreignApps: [u(this.coreAppId)],
270
270
  foreignAssets: [s],
271
271
  accounts: F,
272
272
  suggestedParams: i
273
273
  });
274
- M.fee *= 2, l.push({ tx: M });
275
- for (const x of l)
274
+ P.fee *= 2, m.push({ tx: P });
275
+ for (const x of m)
276
276
  yield this.createUnsignedTx(x, "TokenBridge.transfer", !0);
277
277
  }
278
278
  async *redeem(e, t, n = !0, o) {
@@ -302,7 +302,7 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
302
302
  })
303
303
  });
304
304
  }
305
- const l = {
305
+ const m = {
306
306
  accounts: a,
307
307
  appArgs: [c.completeTransfer, L(t)],
308
308
  appIndex: u(this.tokenBridgeAppId),
@@ -312,7 +312,7 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
312
312
  suggestedParams: o
313
313
  };
314
314
  s.push({
315
- tx: y(l)
315
+ tx: y(m)
316
316
  }), s[s.length - 1].tx.fee = s[s.length - 1].tx.fee * (t.payloadName === "Transfer" && t.payload.fee !== void 0 && t.payload.fee === 0n ? 2 : 3), t.payloadName === "TransferWithPayload" && (s[s.length - 1].tx.appForeignApps = [T], s.push({
317
317
  tx: y({
318
318
  appArgs: [
@@ -350,9 +350,9 @@ const G = Z.fromSignature("portal_transfer(byte[])byte[]"), c = class c {
350
350
  }
351
351
  };
352
352
  d(c, "sendTransfer", C.encode("sendTransfer")), d(c, "attestToken", C.encode("attestToken")), d(c, "noop", C.encode("nop")), d(c, "optIn", C.encode("optin")), d(c, "completeTransfer", C.encode("completeTransfer")), d(c, "receiveAttest", C.encode("receiveAttest"));
353
- let P = c;
354
- nt(rt, "TokenBridge", P);
353
+ let D = c;
354
+ nt(rt, "TokenBridge", D);
355
355
  export {
356
- P as AlgorandTokenBridge,
356
+ D as AlgorandTokenBridge,
357
357
  G as TransferMethodSelector
358
358
  };
@@ -1,4 +1,4 @@
1
- import { bA as f, bB as s, bC as t, bD as c, bE as d, bF as A, aZ as o, bG as O, bH as b } from "./index-DWJ5r15M.mjs";
1
+ import { bz as f, bA as s, bB as t, bC as c, bD as d, bE as A, aY as o, bF as O, bG as b } from "./index-7zA9RXv7.mjs";
2
2
  class p extends Error {
3
3
  constructor(r) {
4
4
  super(r);
@@ -1,6 +1,6 @@
1
- import { h as Gt, ac as Dr, a1 as Yn, X as Zt } from "./index-DWJ5r15M.mjs";
2
- import { i as qn, b as Zn, d as Qn, e as ti, f as ei, g as ri, h as ni, j as ii, k as si, l as oi, m as ai, w as $r, r as Kr, c as fi } from "./index-BT10pzLw.mjs";
3
- import { e as ci } from "./events-D9h1HjEa.mjs";
1
+ import { h as Gt, ac as Dr, a1 as Yn, X as Zt } from "./index-7zA9RXv7.mjs";
2
+ import { i as qn, b as Zn, d as Qn, e as ti, f as ei, g as ri, h as ni, j as ii, k as si, l as oi, m as ai, w as $r, r as Kr, c as fi } from "./index-BoUKkFOJ.mjs";
3
+ import { e as ci } from "./events-Cq1VEeNf.mjs";
4
4
  function Ur(t = 0) {
5
5
  return globalThis.Buffer != null && globalThis.Buffer.allocUnsafe != null ? globalThis.Buffer.allocUnsafe(t) : new Uint8Array(t);
6
6
  }
@@ -1 +1 @@
1
- "use strict";var m=Object.defineProperty;var w=(i,e,t)=>e in i?m(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var s=(i,e,t)=>w(i,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-CEovIwuS.js"),g=require("./aptos-DLBpR9Uw.js");class d{constructor(e,t,r,o){s(this,"network");s(this,"chain");s(this,"connection");s(this,"contracts");s(this,"chainId");s(this,"coreBridge");this.network=e,this.chain=t,this.connection=r,this.contracts=o,this.chainId=c.toChainId(t);const n=o.coreBridge;if(!n)throw new Error(`CoreBridge contract Address for chain ${t} not found`);this.coreBridge=n}getGuardianSet(e){throw new Error("Method not implemented.")}getGuardianSetIndex(){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,t){const[r,o]=await g.AptosPlatform.chainFromRpc(e),n=t[o];if(n.network!==r)throw new Error(`Network mismatch: ${n.network} !== ${r}`);return new d(r,o,e,n.contracts)}async*publishMessage(e,t){throw new Error("Method not implemented.")}async*verifyMessage(e,t){throw new Error("Not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(r=>({chain:r.emitterChain,emitter:r.emitterAddress,sequence:r.sequence}))}async parseMessages(e){const t=await this.connection.getTransactionByHash(e);if(t.type!=="user_transaction")throw new Error(`${e} is not a user_transaction`);const o=t.events.filter(n=>n.type.endsWith("WormholeMessage"));if(!o||o.length===0)throw new Error(`WormholeMessage not found for ${e}`);return o.map(n=>{const a=n.data,h=new c.UniversalAddress(BigInt(a.sender).toString(16).padStart(64,"0"));return c.createVAA("Uint8Array",{guardianSet:0,emitterChain:this.chain,emitterAddress:h,sequence:BigInt(a.sequence),timestamp:Number(a.timestamp),consistencyLevel:a.consistency_level,nonce:Number(a.nonce),signatures:[],payload:c.hex.decode(a.payload)})})}}c.registerProtocol("Aptos","WormholeCore",d);exports.AptosWormholeCore=d;
1
+ "use strict";var m=Object.defineProperty;var w=(i,e,t)=>e in i?m(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var s=(i,e,t)=>w(i,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./index-BU_DiszY.js"),g=require("./aptos-j2PEnEen.js");class d{constructor(e,t,r,o){s(this,"network");s(this,"chain");s(this,"connection");s(this,"contracts");s(this,"chainId");s(this,"coreBridge");this.network=e,this.chain=t,this.connection=r,this.contracts=o,this.chainId=c.toChainId(t);const n=o.coreBridge;if(!n)throw new Error(`CoreBridge contract Address for chain ${t} not found`);this.coreBridge=n}getGuardianSet(e){throw new Error("Method not implemented.")}getGuardianSetIndex(){throw new Error("Method not implemented.")}getMessageFee(){throw new Error("Method not implemented.")}static async fromRpc(e,t){const[r,o]=await g.AptosPlatform.chainFromRpc(e),n=t[o];if(n.network!==r)throw new Error(`Network mismatch: ${n.network} !== ${r}`);return new d(r,o,e,n.contracts)}async*publishMessage(e,t){throw new Error("Method not implemented.")}async*verifyMessage(e,t){throw new Error("Not implemented.")}async parseTransaction(e){return(await this.parseMessages(e)).map(r=>({chain:r.emitterChain,emitter:r.emitterAddress,sequence:r.sequence}))}async parseMessages(e){const t=await this.connection.getTransactionByHash(e);if(t.type!=="user_transaction")throw new Error(`${e} is not a user_transaction`);const o=t.events.filter(n=>n.type.endsWith("WormholeMessage"));if(!o||o.length===0)throw new Error(`WormholeMessage not found for ${e}`);return o.map(n=>{const a=n.data,h=new c.UniversalAddress(BigInt(a.sender).toString(16).padStart(64,"0"));return c.createVAA("Uint8Array",{guardianSet:0,emitterChain:this.chain,emitterAddress:h,sequence:BigInt(a.sequence),timestamp:Number(a.timestamp),consistencyLevel:a.consistency_level,nonce:Number(a.nonce),signatures:[],payload:c.hex.decode(a.payload)})})}}c.registerProtocol("Aptos","WormholeCore",d);exports.AptosWormholeCore=d;