@stakekit/widget 0.0.287 → 0.0.289

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 (89) hide show
  1. package/dist/bundle/Result-D66k67e4.js +3 -0
  2. package/dist/bundle/Schema-CnO1Nnkx.js +2 -0
  3. package/dist/bundle/{cardano-connector-Cg1NVNSz.js → cardano-connector-BdmhtPwK.js} +1 -1
  4. package/dist/{website/assets/configured-chains-C5lih9lm.js → bundle/configured-chains-BVaAJPl7.js} +1 -1
  5. package/dist/bundle/{cosmos-connector-meta-B3hXlZyj.js → cosmos-connector-meta-CsjY5xv_.js} +1 -1
  6. package/dist/bundle/{current-value-stream-sEIwrVMJ.js → current-value-stream-BphKxe9G.js} +1 -1
  7. package/dist/bundle/{esm-B8ixy8Ti.js → esm-BioWy-zm.js} +1 -1
  8. package/dist/bundle/index.bundle.css +1 -1
  9. package/dist/bundle/index.bundle.js +132 -100
  10. package/dist/bundle/{ledger-connector-ScKbHFK2.js → ledger-connector-BeFXqMQm.js} +2 -2
  11. package/dist/bundle/{network-DRjEa3NO.js → network-BR2dx0lQ.js} +1 -1
  12. package/dist/bundle/{polkadot-ledger-transaction-CSI9csNM.js → polkadot-ledger-transaction-CCpzhicj.js} +1 -1
  13. package/dist/bundle/{safe-connector-BuI_vM2N.js → safe-connector-BW8tBAGV.js} +1 -1
  14. package/dist/bundle/{solana-connector-BXIkWGi1.js → solana-connector-CEoNnJWx.js} +1 -1
  15. package/dist/bundle/{stellar-connector-D5G2p6aO.js → stellar-connector-C3GFN35d.js} +1 -1
  16. package/dist/bundle/{substrate-connector-AJ6EWjQP.js → substrate-connector-B7COXHL7.js} +1 -1
  17. package/dist/{website/assets/ton-connector-DWz2WVCw.js → bundle/ton-connector-DnPSYtXm.js} +1 -1
  18. package/dist/bundle/transaction-3CLRKFvX.js +1 -0
  19. package/dist/{website/assets/transaction-BJ3RmuAw.js → bundle/transaction-BDuN1rLk.js} +2 -2
  20. package/dist/bundle/{transaction-NX-vBbnh.js → transaction-DU8AaOQz.js} +1 -1
  21. package/dist/bundle/{tron-connector-nZfhLwx4.js → tron-connector-iA7bb0__.js} +1 -1
  22. package/dist/bundle/{utils-CfBIlQsz.js → utils-llPzGe7v.js} +1 -1
  23. package/dist/bundle/wagmi-connect-result-DOu6hDDM.js +11 -0
  24. package/dist/bundle/{wallet-errors-Bvwwydi9.js → wallet-errors-MrbcJr3I.js} +1 -1
  25. package/dist/bundle/{wallet-manager-C-MB05Qs.js → wallet-manager-D2AeCPRs.js} +2 -2
  26. package/dist/package/{Result-Cem4lYBf.js → Result-BA6lrqKV.js} +117 -49
  27. package/dist/package/{Schema-DFoi51wt.js → Schema-CUut1r-H.js} +1135 -1310
  28. package/dist/package/{cardano-connector-B9UToMFP.js → cardano-connector-ApyBIRYL.js} +3 -3
  29. package/dist/package/{configured-chains-BfQ8ESmR.js → configured-chains-CeRB7Tdy.js} +1 -1
  30. package/dist/package/{cosmos-connector-meta-UMFrkViG.js → cosmos-connector-meta-NNACISY5.js} +1 -1
  31. package/dist/package/{current-value-stream-BPaLLDf4.js → current-value-stream-Cs2IFPhP.js} +1 -1
  32. package/dist/package/{esm-89IrCtWy.js → esm-3BtHXmV9.js} +1 -1
  33. package/dist/package/index.package.css +31 -10
  34. package/dist/package/index.package.js +8695 -3962
  35. package/dist/package/{ledger-connector-B8D8xJOD.js → ledger-connector-ebEnv7IA.js} +9 -9
  36. package/dist/package/{network-DiYap-9L.js → network-Df21Fcdz.js} +1 -1
  37. package/dist/package/{polkadot-ledger-transaction-Bi14PyTF.js → polkadot-ledger-transaction-Cq_ImU8s.js} +1 -1
  38. package/dist/package/{safe-connector-lVCS_bS5.js → safe-connector-CMgopygU.js} +4 -4
  39. package/dist/package/{solana-connector-P-TqgNNC.js → solana-connector-B2Rf5Tyj.js} +3 -3
  40. package/dist/package/{stellar-connector-BMB2Cql4.js → stellar-connector-DdzqZgoG.js} +4 -4
  41. package/dist/package/{substrate-connector-a7SNpKjf.js → substrate-connector-DO7OAvZ9.js} +2 -2
  42. package/dist/package/{ton-connector-CMzOI2bi.js → ton-connector-CUtYVysK.js} +5 -5
  43. package/dist/package/{transaction-CmOScFm6.js → transaction-BjGgdyu0.js} +5 -5
  44. package/dist/package/{transaction-Do9wZHM8.js → transaction-MMiSjtGI.js} +1 -1
  45. package/dist/package/{transaction-C1e6h8J1.js → transaction-fIZimEky.js} +1 -1
  46. package/dist/package/{tron-connector-PLpMhB65.js → tron-connector-DT1NdAaP.js} +2 -2
  47. package/dist/package/{wagmi-connect-result-BJ91_jis.js → wagmi-connect-result-Bh6qH5iI.js} +593 -462
  48. package/dist/package/{wallet-errors-B4cGcGNy.js → wallet-errors-BMdJQ_kv.js} +1 -1
  49. package/dist/package/{wallet-manager-BsDss9DQ.js → wallet-manager-BbL7EBi6.js} +5 -5
  50. package/dist/types/domain/network/network.d.ts +2 -2
  51. package/dist/types/generated/api/legacy-schema.d.ts +3503 -1952
  52. package/dist/types/generated/api/yield-schema.d.ts +1491 -1114
  53. package/dist/types/public-api/types.d.ts +2 -2
  54. package/dist/website/assets/Result-D66k67e4.js +3 -0
  55. package/dist/website/assets/Schema-CnO1Nnkx.js +2 -0
  56. package/dist/website/assets/{cardano-connector-JluaLQJr.js → cardano-connector-DkgQsbib.js} +1 -1
  57. package/dist/{bundle/configured-chains-C5lih9lm.js → website/assets/configured-chains-BVaAJPl7.js} +1 -1
  58. package/dist/website/assets/{cosmos-connector-meta-B3hXlZyj.js → cosmos-connector-meta-CsjY5xv_.js} +1 -1
  59. package/dist/website/assets/{current-value-stream-sEIwrVMJ.js → current-value-stream-BphKxe9G.js} +1 -1
  60. package/dist/website/assets/{esm-DmRWC3up.js → esm-DJUTv1_r.js} +1 -1
  61. package/dist/website/assets/index-BYTj9y8r.js +592 -0
  62. package/dist/website/assets/{index-CYwddl65.css → index-m2lpHJ_u.css} +1 -1
  63. package/dist/website/assets/{ledger-connector-zHWvy_21.js → ledger-connector-CMFH1Z0M.js} +3 -3
  64. package/dist/website/assets/{network-DRjEa3NO.js → network-BR2dx0lQ.js} +1 -1
  65. package/dist/website/assets/{polkadot-ledger-transaction-CSI9csNM.js → polkadot-ledger-transaction-CCpzhicj.js} +1 -1
  66. package/dist/website/assets/{safe-connector-B_IWbdsx.js → safe-connector-BDc3OqKV.js} +1 -1
  67. package/dist/website/assets/{solana-connector-DUrUEFXI.js → solana-connector-Ij-Dm1HM.js} +1 -1
  68. package/dist/website/assets/{stellar-connector-D5G2p6aO.js → stellar-connector-C3GFN35d.js} +1 -1
  69. package/dist/website/assets/{substrate-connector-DxgYUQY4.js → substrate-connector-B-LTNtpz.js} +1 -1
  70. package/dist/{bundle/ton-connector-DWz2WVCw.js → website/assets/ton-connector-DnPSYtXm.js} +1 -1
  71. package/dist/{bundle/transaction-BJ3RmuAw.js → website/assets/transaction-BDuN1rLk.js} +2 -2
  72. package/dist/website/assets/{transaction-BIBBEBi6.js → transaction-Cth5mVGJ.js} +1 -1
  73. package/dist/website/assets/transaction-peV0IJTV.js +1 -0
  74. package/dist/website/assets/{tron-connector-C3nKPxdx.js → tron-connector-D_NeRPfc.js} +1 -1
  75. package/dist/website/assets/{utils-DVCp0qSW.js → utils-DOZR2zEE.js} +1 -1
  76. package/dist/website/assets/wagmi-connect-result-DOu6hDDM.js +11 -0
  77. package/dist/website/assets/{wallet-errors-Bvwwydi9.js → wallet-errors-MrbcJr3I.js} +1 -1
  78. package/dist/website/assets/{wallet-manager-9-XcN6SR.js → wallet-manager-DGQAWJIz.js} +3 -3
  79. package/dist/website/index.html +13 -13
  80. package/package.json +12 -11
  81. package/dist/bundle/Result-3MQjLy1V.js +0 -3
  82. package/dist/bundle/Schema-DgreXIef.js +0 -2
  83. package/dist/bundle/transaction-BnkP6nIP.js +0 -1
  84. package/dist/bundle/wagmi-connect-result-CqXaJhOa.js +0 -11
  85. package/dist/website/assets/Result-3MQjLy1V.js +0 -3
  86. package/dist/website/assets/Schema-DgreXIef.js +0 -2
  87. package/dist/website/assets/index-CbH5OQ2T.js +0 -560
  88. package/dist/website/assets/transaction-Sqg4_vo7.js +0 -1
  89. package/dist/website/assets/wagmi-connect-result-CqXaJhOa.js +0 -11
@@ -1,4 +1,4 @@
1
- import{n as e,o as t,r as n,s as r,t as i}from"./rolldown-runtime-BcKkbAw3.js";import{n as a,t as o}from"./dist-C9i0DjyB.js";import{C as s}from"./Schema-DgreXIef.js";import{n as c,t as l}from"./dist-D6L6gF64.js";import{n as u}from"./_esm-CXYNiZel.js";import{vn as d}from"./ccip-BxB3ZbpJ.js";import{n as f,t as p}from"./sha256-B81eAX-m.js";import{n as m,t as h}from"./sha3-DTWsE4Uo.js";import{n as g,r as _,t as v}from"./dist-KkMRwAp9.js";import{t as y}from"./fallback-Dw6P3XKE.js";import{n as ee,t as te}from"./ed25519-0TVA-MrV.js";import{n as ne,t as re}from"./bn-F_BR-QG7.js";import{t as b}from"./elliptic-BkWObsOB.js";import{t as x}from"./bs58-Cepc0rNH.js";import{n as S,t as C}from"./secp256k1-KrmNoC0i.js";import{t as w}from"./esm-DhvlA6gG.js";import{t as T}from"./events-D2w4OsQJ.js";import{a as E,c as ie,d as ae,f as oe,i as D,l as se,o as ce,r as le,s as ue,t as de,u as fe}from"./index.es-6FknJabw.js";import{_ as pe,a as me,d as O,f as he,g as ge,h as _e,i as ve,l as ye,n as be,o as xe,p as Se,r as Ce,s as we,u as Te,v as Ee}from"./browser-ponyfill-8IsXQqGl.js";import{a as De,i as Oe,n as ke,r as Ae,t as je}from"./index.es-DqXS4GHm.js";import{i as Me,n as Ne,r as Pe,t as Fe}from"./src-Dwq4W0Wh.js";import{t as Ie}from"./index.es-B-vaqu71.js";import{A as Le,C as k,D as Re,E as ze,O as Be,S as Ve,_ as He,a as Ue,c as We,d as A,f as Ge,g as Ke,h as qe,k as j,l as Je,m as Ye,o as Xe,p as Ze,u as Qe,v as $e,w as et,x as tt,y as nt}from"./exports-0dvJtd9q.js";import{i as rt,n as it,o as at,r as ot}from"./utils-CXyOXcxm.js";import{i as st,n as ct,r as lt}from"./ConnectorUtil-C2YHRvjK.js";var ut=i(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)})),dt,ft,pt=e((()=>{dt=r(ut(),1),ft=dt.default}));pt();var mt=class extends Error{constructor(e,t){super(e),this.error=t}},ht=class extends mt{constructor(){super(...arguments),this.name=`WalletNotReadyError`}},gt=class extends mt{constructor(){super(...arguments),this.name=`WalletConfigError`}},_t=class extends mt{constructor(){super(...arguments),this.name=`WalletConnectionError`}},vt=class extends mt{constructor(){super(...arguments),this.name=`WalletDisconnectedError`}},yt=class extends mt{constructor(){super(...arguments),this.name=`WalletDisconnectionError`}},bt=class extends mt{constructor(){super(...arguments),this.name=`WalletAccountError`}},xt=class extends mt{constructor(){super(...arguments),this.name=`WalletPublicKeyError`}},St=class extends mt{constructor(){super(...arguments),this.name=`WalletNotConnectedError`}},Ct=class extends mt{constructor(){super(...arguments),this.name=`WalletSendTransactionError`}},wt=class extends mt{constructor(){super(...arguments),this.name=`WalletSignTransactionError`}},Tt=class extends mt{constructor(){super(...arguments),this.name=`WalletSignMessageError`}},Et=class extends mt{constructor(){super(...arguments),this.name=`WalletSignInError`}},Dt=class extends mt{constructor(){super(...arguments),this.name=`WalletWindowClosedError`}},Ot;(function(e){e.Installed=`Installed`,e.NotDetected=`NotDetected`,e.Loadable=`Loadable`,e.Unsupported=`Unsupported`})(Ot||={});var kt=class extends ft{get connected(){return!!this.publicKey}async autoConnect(){await this.connect()}async prepareTransaction(e,t,n={}){let r=this.publicKey;if(!r)throw new St;return e.feePayer=e.feePayer||r,e.recentBlockhash=e.recentBlockhash||(await t.getLatestBlockhash({commitment:n.preflightCommitment,minContextSlot:n.minContextSlot})).blockhash,e}};function At(e){if(typeof window>`u`||typeof document>`u`)return;let t=[];function n(){if(e())for(let e of t)e()}let r=setInterval(n,1e3);t.push(()=>clearInterval(r)),document.readyState===`loading`&&(document.addEventListener(`DOMContentLoaded`,n,{once:!0}),t.push(()=>document.removeEventListener(`DOMContentLoaded`,n))),document.readyState!==`complete`&&(window.addEventListener(`load`,n,{once:!0}),t.push(()=>window.removeEventListener(`load`,n))),n()}function jt(){if(!navigator)return!1;let e=navigator.userAgent.toLowerCase(),t=e.includes(`iphone`)||e.includes(`ipad`),n=e.includes(`safari`);return t&&n}function Mt(e){return`version`in e}var Nt=class extends kt{async sendTransaction(e,t,n={}){let r=!0;try{if(Mt(e)){if(!this.supportedTransactionVersions)throw new Ct(`Sending versioned transactions isn't supported by this wallet`);if(!this.supportedTransactionVersions.has(e.version))throw new Ct(`Sending transaction version ${e.version} isn't supported by this wallet`);try{e=await this.signTransaction(e);let r=e.serialize();return await t.sendRawTransaction(r,n)}catch(e){throw e instanceof wt?(r=!1,e):new Ct(e?.message,e)}}try{let{signers:r,...i}=n;e=await this.prepareTransaction(e,t,i),r?.length&&e.partialSign(...r),e=await this.signTransaction(e);let a=e.serialize();return await t.sendRawTransaction(a,i)}catch(e){throw e instanceof wt?(r=!1,e):new Ct(e?.message,e)}}catch(e){throw r&&this.emit(`error`,e),e}}async signAllTransactions(e){for(let t of e)if(Mt(t)){if(!this.supportedTransactionVersions)throw new wt(`Signing versioned transactions isn't supported by this wallet`);if(!this.supportedTransactionVersions.has(t.version))throw new wt(`Signing transaction version ${t.version} isn't supported by this wallet`)}let t=[];for(let n of e)t.push(await this.signTransaction(n));return t}},Pt=class extends Nt{},Ft=class extends Pt{},It;(function(e){e.Mainnet=`mainnet-beta`,e.Testnet=`testnet`,e.Devnet=`devnet`})(It||={});var Lt=n({TextDecoder:()=>Wt,TextEncoder:()=>Gt});function Rt(e,t,n){return t<=e&&e<=n}function zt(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError(`Could not convert argument to dictionary`)}function Bt(e){for(var t=String(e),n=t.length,r=0,i=[];r<n;){var a=t.charCodeAt(r);if(a<55296||a>57343)i.push(a);else if(56320<=a&&a<=57343)i.push(65533);else if(55296<=a&&a<=56319){if(r===n-1)i.push(65533);else{var o=e.charCodeAt(r+1);if(56320<=o&&o<=57343){var s=a&1023,c=o&1023;i.push(65536+(s<<10)+c),r+=1}else i.push(65533)}}r+=1}return i}function Vt(e){for(var t=``,n=0;n<e.length;++n){var r=e[n];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t}function Ht(e){this.tokens=[].slice.call(e)}function Ut(e,t){if(e)throw TypeError(`Decoder error`);return t||65533}function Wt(e,t){if(!(this instanceof Wt))return new Wt(e,t);if(e=e===void 0?Xt:String(e).toLowerCase(),e!==Xt)throw Error(`Encoding not supported. Only utf-8 is supported`);t=zt(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!t.fatal,this._ignoreBOM=!!t.ignoreBOM,Object.defineProperty(this,"encoding",{value:`utf-8`}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function Gt(e,t){if(!(this instanceof Gt))return new Gt(e,t);if(e=e===void 0?Xt:String(e).toLowerCase(),e!==Xt)throw Error(`Encoding not supported. Only utf-8 is supported`);t=zt(t),this._streaming=!1,this._encoder=null,this._options={fatal:!!t.fatal},Object.defineProperty(this,"encoding",{value:`utf-8`})}function Kt(e){var t=e.fatal,n=0,r=0,i=0,a=128,o=191;this.handler=function(e,s){if(s===Jt&&i!==0)return i=0,Ut(t);if(s===Jt)return Yt;if(i===0){if(Rt(s,0,127))return s;if(Rt(s,194,223))i=1,n=s-192;else if(Rt(s,224,239))s===224&&(a=160),s===237&&(o=159),i=2,n=s-224;else if(Rt(s,240,244))s===240&&(a=144),s===244&&(o=143),i=3,n=s-240;else return Ut(t);return n<<=6*i,null}if(!Rt(s,a,o))return n=i=r=0,a=128,o=191,e.prepend(s),Ut(t);if(a=128,o=191,r+=1,n+=s-128<<6*(i-r),r!==i)return null;var c=n;return n=i=r=0,c}}function qt(e){e.fatal,this.handler=function(e,t){if(t===Jt)return Yt;if(Rt(t,0,127))return t;var n,r;Rt(t,128,2047)?(n=1,r=192):Rt(t,2048,65535)?(n=2,r=224):Rt(t,65536,1114111)&&(n=3,r=240);for(var i=[(t>>6*n)+r];n>0;){var a=t>>6*(n-1);i.push(128|a&63),--n}return i}}var Jt,Yt,Xt,Zt=e((()=>{Jt=-1,Ht.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Jt},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}},Yt=-1,Xt=`utf-8`,Wt.prototype={decode:function(e,t){var n=typeof e==`object`&&e instanceof ArrayBuffer?new Uint8Array(e):typeof e==`object`&&`buffer`in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array;t=zt(t),this._streaming||(this._decoder=new Kt({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!t.stream;for(var r=new Ht(n),i=[],a;!r.endOfStream()&&(a=this._decoder.handler(r,r.read()),a!==Yt);)a!==null&&(Array.isArray(a)?i.push.apply(i,a):i.push(a));if(!this._streaming){do{if(a=this._decoder.handler(r,r.read()),a===Yt)break;a!==null&&(Array.isArray(a)?i.push.apply(i,a):i.push(a))}while(!r.endOfStream());this._decoder=null}return i.length&&[`utf-8`].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(i[0]===65279?(this._BOMseen=!0,i.shift()):this._BOMseen=!0),Vt(i)}},Gt.prototype={encode:function(e,t){e=e?String(e):``,t=zt(t),this._streaming||(this._encoder=new qt(this._options)),this._streaming=!!t.stream;for(var n=[],r=new Ht(Bt(e)),i;!r.endOfStream()&&(i=this._encoder.handler(r,r.read()),i!==Yt);)Array.isArray(i)?n.push.apply(n,i):n.push(i);if(!this._streaming){for(;i=this._encoder.handler(r,r.read()),i!==Yt;)Array.isArray(i)?n.push.apply(n,i):n.push(i);this._encoder=null}return new Uint8Array(n)}}})),Qt=i((e=>{_();var n=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__decorate||function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},a=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)i!=="default"&&Object.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t},o=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeUnchecked=e.deserialize=e.serialize=e.BinaryReader=e.BinaryWriter=e.BorshError=e.baseDecode=e.baseEncode=void 0;var s=o(re()),c=o(x()),l=a((Zt(),t(Lt))),u=new(typeof TextDecoder==`function`?TextDecoder:l.TextDecoder)(`utf-8`,{fatal:!0});function d(e){return typeof e==`string`&&(e=v.from(e,`utf8`)),c.default.encode(v.from(e))}e.baseEncode=d;function f(e){return v.from(c.default.decode(e))}e.baseDecode=f;var p=1024,m=class extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+`: `+this.fieldPath.join(`.`)}};e.BorshError=m;var h=class{constructor(){this.buf=v.alloc(p),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=v.concat([this.buf,v.alloc(p)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(v.from(new s.default(e).toArray(`le`,8)))}writeU128(e){this.maybeResize(),this.writeBuffer(v.from(new s.default(e).toArray(`le`,16)))}writeU256(e){this.maybeResize(),this.writeBuffer(v.from(new s.default(e).toArray(`le`,32)))}writeU512(e){this.maybeResize(),this.writeBuffer(v.from(new s.default(e).toArray(`le`,64)))}writeBuffer(e){this.buf=v.concat([v.from(this.buf.subarray(0,this.length)),e,v.alloc(p)]),this.length+=e.length}writeString(e){this.maybeResize();let t=v.from(e,`utf8`);this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(v.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(let n of e)this.maybeResize(),t(n)}toArray(){return this.buf.subarray(0,this.length)}};e.BinaryWriter=h;function g(e,t,n){let r=n.value;n.value=function(...e){try{return r.apply(this,e)}catch(e){if(e instanceof RangeError){let t=e.code;if([`ERR_BUFFER_OUT_OF_BOUNDS`,`ERR_OUT_OF_RANGE`].indexOf(t)>=0)throw new m(`Reached the end of buffer when deserializing`)}throw e}}}var y=class{constructor(e){this.buf=e,this.offset=0}readU8(){let e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){let e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){let e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){let e=this.readBuffer(8);return new s.default(e,`le`)}readU128(){let e=this.readBuffer(16);return new s.default(e,`le`)}readU256(){let e=this.readBuffer(32);return new s.default(e,`le`)}readU512(){let e=this.readBuffer(64);return new s.default(e,`le`)}readBuffer(e){if(this.offset+e>this.buf.length)throw new m(`Expected buffer length ${e} isn't within bounds`);let t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){let e=this.readU32(),t=this.readBuffer(e);try{return u.decode(t)}catch(e){throw new m(`Error decoding UTF-8 string: ${e}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){let t=this.readU32(),n=[];for(let r=0;r<t;++r)n.push(e());return n}};i([g],y.prototype,`readU8`,null),i([g],y.prototype,`readU16`,null),i([g],y.prototype,`readU32`,null),i([g],y.prototype,`readU64`,null),i([g],y.prototype,`readU128`,null),i([g],y.prototype,`readU256`,null),i([g],y.prototype,`readU512`,null),i([g],y.prototype,`readString`,null),i([g],y.prototype,`readFixedArray`,null),i([g],y.prototype,`readArray`,null),e.BinaryReader=y;function ee(e){return e.charAt(0).toUpperCase()+e.slice(1)}function te(e,t,n,r,i){try{if(typeof r==`string`)i[`write${ee(r)}`](n);else if(r instanceof Array){if(typeof r[0]==`number`){if(n.length!==r[0])throw new m(`Expecting byte array of length ${r[0]}, but got ${n.length} bytes`);i.writeFixedArray(n)}else if(r.length===2&&typeof r[1]==`number`){if(n.length!==r[1])throw new m(`Expecting byte array of length ${r[1]}, but got ${n.length} bytes`);for(let t=0;t<r[1];t++)te(e,null,n[t],r[0],i)}else i.writeArray(n,n=>{te(e,t,n,r[0],i)})}else if(r.kind!==void 0)switch(r.kind){case`option`:n==null?i.writeU8(0):(i.writeU8(1),te(e,t,n,r.type,i));break;case`map`:i.writeU32(n.size),n.forEach((n,a)=>{te(e,t,a,r.key,i),te(e,t,n,r.value,i)});break;default:throw new m(`FieldType ${r} unrecognized`)}else ne(e,n,i)}catch(e){throw e instanceof m&&e.addToFieldPath(t),e}}function ne(e,t,n){if(typeof t.borshSerialize==`function`){t.borshSerialize(n);return}let r=e.get(t.constructor);if(!r)throw new m(`Class ${t.constructor.name} is missing in schema`);if(r.kind===`struct`)r.fields.map(([r,i])=>{te(e,r,t[r],i,n)});else if(r.kind===`enum`){let i=t[r.field];for(let a=0;a<r.values.length;++a){let[o,s]=r.values[a];if(o===i){n.writeU8(a),te(e,o,t[o],s,n);break}}}else throw new m(`Unexpected schema kind: ${r.kind} for ${t.constructor.name}`)}function b(e,t,n=h){let r=new n;return ne(e,t,r),r.toArray()}e.serialize=b;function S(e,t,n,r){try{if(typeof n==`string`)return r[`read${ee(n)}`]();if(n instanceof Array){if(typeof n[0]==`number`)return r.readFixedArray(n[0]);if(typeof n[1]==`number`){let t=[];for(let i=0;i<n[1];i++)t.push(S(e,null,n[0],r));return t}return r.readArray(()=>S(e,t,n[0],r))}if(n.kind===`option`)return r.readU8()?S(e,t,n.type,r):void 0;if(n.kind===`map`){let i=new Map,a=r.readU32();for(let o=0;o<a;o++){let a=S(e,t,n.key,r),o=S(e,t,n.value,r);i.set(a,o)}return i}return C(e,n,r)}catch(e){throw e instanceof m&&e.addToFieldPath(t),e}}function C(e,t,n){if(typeof t.borshDeserialize==`function`)return t.borshDeserialize(n);let r=e.get(t);if(!r)throw new m(`Class ${t.name} is missing in schema`);if(r.kind===`struct`){let r={};for(let[i,a]of e.get(t).fields)r[i]=S(e,i,a,n);return new t(r)}if(r.kind===`enum`){let i=n.readU8();if(i>=r.values.length)throw new m(`Enum index: ${i} is out of range`);let[a,o]=r.values[i],s=S(e,a,o,n);return new t({[a]:s})}throw new m(`Unexpected schema kind: ${r.kind} for ${t.constructor.name}`)}function w(e,t,n,r=y){let i=new r(n),a=C(e,t,i);if(i.offset<n.length)throw new m(`Unexpected ${n.length-i.offset} bytes after deserialized data`);return a}e.deserialize=w;function T(e,t,n,r=y){return C(e,t,new r(n))}e.deserializeUnchecked=T})),$t=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.s16=e.s8=e.nu64be=e.u48be=e.u40be=e.u32be=e.u24be=e.u16be=e.nu64=e.u48=e.u40=e.u32=e.u24=e.u16=e.u8=e.offset=e.greedy=e.Constant=e.UTF8=e.CString=e.Blob=e.Boolean=e.BitField=e.BitStructure=e.VariantLayout=e.Union=e.UnionLayoutDiscriminator=e.UnionDiscriminator=e.Structure=e.Sequence=e.DoubleBE=e.Double=e.FloatBE=e.Float=e.NearInt64BE=e.NearInt64=e.NearUInt64BE=e.NearUInt64=e.IntBE=e.Int=e.UIntBE=e.UInt=e.OffsetLayout=e.GreedyCount=e.ExternalLayout=e.bindConstructorLayout=e.nameWithProperty=e.Layout=e.uint8ArrayToBuffer=e.checkUint8Array=void 0,e.constant=e.utf8=e.cstr=e.blob=e.unionLayoutDiscriminator=e.union=e.seq=e.bits=e.struct=e.f64be=e.f64=e.f32be=e.f32=e.ns64be=e.s48be=e.s40be=e.s32be=e.s24be=e.s16be=e.ns64=e.s48=e.s40=e.s32=e.s24=void 0;var t=ne();function n(e){if(!(e instanceof Uint8Array))throw TypeError(`b must be a Uint8Array`)}e.checkUint8Array=n;function r(e){return n(e),t.Buffer.from(e.buffer,e.byteOffset,e.length)}e.uint8ArrayToBuffer=r;var i=class{constructor(e,t){if(!Number.isInteger(e))throw TypeError(`span must be an integer`);this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw RangeError(`indeterminate span`);return this.span}replicate(e){let t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}};e.Layout=i;function a(e,t){return t.property?e+`[`+t.property+`]`:e}e.nameWithProperty=a;function o(e,t){if(typeof e!=`function`)throw TypeError(`Class must be constructor`);if(Object.prototype.hasOwnProperty.call(e,`layout_`))throw Error(`Class is already bound to a layout`);if(!(t&&t instanceof i))throw TypeError(`layout must be a Layout`);if(Object.prototype.hasOwnProperty.call(t,`boundConstructor_`))throw Error(`layout is already bound to a constructor`);e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=(()=>new e),Object.defineProperty(e.prototype,"encode",{value(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(e,"decode",{value(e,n){return t.decode(e,n)},writable:!0})}e.bindConstructorLayout=o;var s=class extends i{isCount(){throw Error(`ExternalLayout is abstract`)}};e.ExternalLayout=s;var c=class extends s{constructor(e=1,t){if(!Number.isInteger(e)||0>=e)throw TypeError(`elementSpan must be a (positive) integer`);super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e,t=0){n(e);let r=e.length-t;return Math.floor(r/this.elementSpan)}encode(e,t,n){return 0}};e.GreedyCount=c;var l=class extends s{constructor(e,t=0,n){if(!(e instanceof i))throw TypeError(`layout must be a Layout`);if(!Number.isInteger(t))throw TypeError(`offset must be integer or undefined`);super(e.span,n||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof u||this.layout instanceof d}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,n=0){return this.layout.encode(e,t,n+this.offset)}};e.OffsetLayout=l;var u=class extends i{constructor(e,t){if(super(e,t),6<this.span)throw RangeError(`span must not exceed 6 bytes`)}decode(e,t=0){return r(e).readUIntLE(t,this.span)}encode(e,t,n=0){return r(t).writeUIntLE(e,n,this.span),this.span}};e.UInt=u;var d=class extends i{constructor(e,t){if(super(e,t),6<this.span)throw RangeError(`span must not exceed 6 bytes`)}decode(e,t=0){return r(e).readUIntBE(t,this.span)}encode(e,t,n=0){return r(t).writeUIntBE(e,n,this.span),this.span}};e.UIntBE=d;var f=class extends i{constructor(e,t){if(super(e,t),6<this.span)throw RangeError(`span must not exceed 6 bytes`)}decode(e,t=0){return r(e).readIntLE(t,this.span)}encode(e,t,n=0){return r(t).writeIntLE(e,n,this.span),this.span}};e.Int=f;var p=class extends i{constructor(e,t){if(super(e,t),6<this.span)throw RangeError(`span must not exceed 6 bytes`)}decode(e,t=0){return r(e).readIntBE(t,this.span)}encode(e,t,n=0){return r(t).writeIntBE(e,n,this.span),this.span}};e.IntBE=p;var m=2**32;function h(e){let t=Math.floor(e/m);return{hi32:t,lo32:e-t*m}}function g(e,t){return e*m+t}var _=class extends i{constructor(e){super(8,e)}decode(e,t=0){let n=r(e),i=n.readUInt32LE(t);return g(n.readUInt32LE(t+4),i)}encode(e,t,n=0){let i=h(e),a=r(t);return a.writeUInt32LE(i.lo32,n),a.writeUInt32LE(i.hi32,n+4),8}};e.NearUInt64=_;var v=class extends i{constructor(e){super(8,e)}decode(e,t=0){let n=r(e);return g(n.readUInt32BE(t),n.readUInt32BE(t+4))}encode(e,t,n=0){let i=h(e),a=r(t);return a.writeUInt32BE(i.hi32,n),a.writeUInt32BE(i.lo32,n+4),8}};e.NearUInt64BE=v;var y=class extends i{constructor(e){super(8,e)}decode(e,t=0){let n=r(e),i=n.readUInt32LE(t);return g(n.readInt32LE(t+4),i)}encode(e,t,n=0){let i=h(e),a=r(t);return a.writeUInt32LE(i.lo32,n),a.writeInt32LE(i.hi32,n+4),8}};e.NearInt64=y;var ee=class extends i{constructor(e){super(8,e)}decode(e,t=0){let n=r(e);return g(n.readInt32BE(t),n.readUInt32BE(t+4))}encode(e,t,n=0){let i=h(e),a=r(t);return a.writeInt32BE(i.hi32,n),a.writeUInt32BE(i.lo32,n+4),8}};e.NearInt64BE=ee;var te=class extends i{constructor(e){super(4,e)}decode(e,t=0){return r(e).readFloatLE(t)}encode(e,t,n=0){return r(t).writeFloatLE(e,n),4}};e.Float=te;var re=class extends i{constructor(e){super(4,e)}decode(e,t=0){return r(e).readFloatBE(t)}encode(e,t,n=0){return r(t).writeFloatBE(e,n),4}};e.FloatBE=re;var b=class extends i{constructor(e){super(8,e)}decode(e,t=0){return r(e).readDoubleLE(t)}encode(e,t,n=0){return r(t).writeDoubleLE(e,n),8}};e.Double=b;var x=class extends i{constructor(e){super(8,e)}decode(e,t=0){return r(e).readDoubleBE(t)}encode(e,t,n=0){return r(t).writeDoubleBE(e,n),8}};e.DoubleBE=x;var S=class extends i{constructor(e,t,n){if(!(e instanceof i))throw TypeError(`elementLayout must be a Layout`);if(!(t instanceof s&&t.isCount()||Number.isInteger(t)&&0<=t))throw TypeError(`count must be non-negative integer or an unsigned integer ExternalLayout`);let r=-1;!(t instanceof s)&&0<e.span&&(r=t*e.span),super(r,n),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let n=0,r=this.count;if(r instanceof s&&(r=r.decode(e,t)),0<this.elementLayout.span)n=r*this.elementLayout.span;else{let i=0;for(;i<r;)n+=this.elementLayout.getSpan(e,t+n),++i}return n}decode(e,t=0){let n=[],r=0,i=this.count;for(i instanceof s&&(i=i.decode(e,t));r<i;)n.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),r+=1;return n}encode(e,t,n=0){let r=this.elementLayout,i=e.reduce((e,i)=>e+r.encode(i,t,n+e),0);return this.count instanceof s&&this.count.encode(e.length,t,n),i}};e.Sequence=S;var C=class extends i{constructor(e,t,n){if(!(Array.isArray(e)&&e.reduce((e,t)=>e&&t instanceof i,!0)))throw TypeError(`fields must be array of Layout instances`);typeof t==`boolean`&&n===void 0&&(n=t,t=void 0);for(let t of e)if(0>t.span&&t.property===void 0)throw Error(`fields cannot contain unnamed variable-length layout`);let r=-1;try{r=e.reduce((e,t)=>e+t.getSpan(),0)}catch{}super(r,t),this.fields=e,this.decodePrefixes=!!n}getSpan(e,t=0){if(0<=this.span)return this.span;let n=0;try{n=this.fields.reduce((n,r)=>{let i=r.getSpan(e,t);return t+=i,n+i},0)}catch{throw RangeError(`indeterminate span`)}return n}decode(e,t=0){n(e);let r=this.makeDestinationObject();for(let n of this.fields)if(n.property!==void 0&&(r[n.property]=n.decode(e,t)),t+=n.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,n=0){let r=n,i=0,a=0;for(let r of this.fields){let o=r.span;if(a=0<o?o:0,r.property!==void 0){let i=e[r.property];i!==void 0&&(a=r.encode(i,t,n),0>o&&(o=r.getSpan(t,n)))}i=n,n+=o}return i+a-r}fromArray(e){let t=this.makeDestinationObject();for(let n of this.fields)n.property!==void 0&&0<e.length&&(t[n.property]=e.shift());return t}layoutFor(e){if(typeof e!=`string`)throw TypeError(`property must be string`);for(let t of this.fields)if(t.property===e)return t}offsetOf(e){if(typeof e!=`string`)throw TypeError(`property must be string`);let t=0;for(let n of this.fields){if(n.property===e)return t;0>n.span?t=-1:0<=t&&(t+=n.span)}}};e.Structure=C;var w=class{constructor(e){this.property=e}decode(e,t){throw Error(`UnionDiscriminator is abstract`)}encode(e,t,n){throw Error(`UnionDiscriminator is abstract`)}};e.UnionDiscriminator=w;var T=class extends w{constructor(e,t){if(!(e instanceof s&&e.isCount()))throw TypeError(`layout must be an unsigned integer ExternalLayout`);super(t||e.property||`variant`),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,n){return this.layout.encode(e,t,n)}};e.UnionLayoutDiscriminator=T;var E=class extends i{constructor(e,t,n){let r;if(e instanceof u||e instanceof d)r=new T(new l(e));else if(e instanceof s&&e.isCount())r=new T(e);else if(e instanceof w)r=e;else throw TypeError(`discr must be a UnionDiscriminator or an unsigned integer layout`);if(t===void 0&&(t=null),!(t===null||t instanceof i))throw TypeError(`defaultLayout must be null or a Layout`);if(t!==null){if(0>t.span)throw Error(`defaultLayout must have constant span`);t.property===void 0&&(t=t.replicate(`content`))}let a=-1;t&&(a=t.span,0<=a&&(e instanceof u||e instanceof d)&&(a+=r.layout.span)),super(a,n),this.discriminator=r,this.usesPrefixDiscriminator=e instanceof u||e instanceof d,this.defaultLayout=t,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(e){return o(e)},this.configGetSourceVariant=function(e){o=e.bind(this)}}getSpan(e,t=0){if(0<=this.span)return this.span;let n=this.getVariant(e,t);if(!n)throw Error(`unable to determine span for unrecognized variant`);return n.getSpan(e,t)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;let t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(let t in this.registry){let n=this.registry[t];if(n.property&&Object.prototype.hasOwnProperty.call(e,n.property))return n}throw Error(`unable to infer src variant`)}decode(e,t=0){let n,r=this.discriminator,i=r.decode(e,t),a=this.registry[i];if(a===void 0){let a=this.defaultLayout,o=0;this.usesPrefixDiscriminator&&(o=r.layout.span),n=this.makeDestinationObject(),n[r.property]=i,n[a.property]=a.decode(e,t+o)}else n=a.decode(e,t);return n}encode(e,t,n=0){let r=this.getSourceVariant(e);if(r===void 0){let r=this.discriminator,i=this.defaultLayout,a=0;return this.usesPrefixDiscriminator&&(a=r.layout.span),r.encode(e[r.property],t,n),a+i.encode(e[i.property],t,n+a)}return r.encode(e,t,n)}addVariant(e,t,n){let r=new ie(this,e,t,n);return this.registry[e]=r,r}getVariant(e,t=0){let n;return n=e instanceof Uint8Array?this.discriminator.decode(e,t):e,this.registry[n]}};e.Union=E;var ie=class extends i{constructor(e,t,n,r){if(!(e instanceof E))throw TypeError(`union must be a Union`);if(!Number.isInteger(t)||0>t)throw TypeError(`variant must be a (non-negative) integer`);if(typeof n==`string`&&r===void 0&&(r=n,n=null),n){if(!(n instanceof i))throw TypeError(`layout must be a Layout`);if(e.defaultLayout!==null&&0<=n.span&&n.span>e.defaultLayout.span)throw Error(`variant span exceeds span of containing union`);if(typeof r!=`string`)throw TypeError(`variant must have a String property`)}let a=e.span;0>e.span&&(a=n?n.span:0,0<=a&&e.usesPrefixDiscriminator&&(a+=e.discriminator.layout.span)),super(a,r),this.union=e,this.variant=t,this.layout=n||null}getSpan(e,t=0){if(0<=this.span)return this.span;let n=0;this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span);let r=0;return this.layout&&(r=this.layout.getSpan(e,t+n)),n+r}decode(e,t=0){let n=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw Error(`variant mismatch`);let r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}encode(e,t,n=0){let r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw TypeError(`variant lacks property `+this.property);this.union.discriminator.encode(this.variant,t,n);let i=r;if(this.layout&&(this.layout.encode(e[this.property],t,n+r),i+=this.layout.getSpan(t,n+r),0<=this.union.span&&i>this.union.span))throw Error(`encoded variant overruns containing union`);return i}fromArray(e){if(this.layout)return this.layout.fromArray(e)}};e.VariantLayout=ie;function ae(e){return 0>e&&(e+=4294967296),e}var oe=class extends i{constructor(e,t,n){if(!(e instanceof u||e instanceof d))throw TypeError(`word must be a UInt or UIntBE layout`);if(typeof t==`string`&&n===void 0&&(n=t,t=!1),4<e.span)throw RangeError(`word cannot exceed 32 bits`);super(e.span,n),this.word=e,this.msb=!!t,this.fields=[];let r=0;this._packedSetValue=function(e){return r=ae(e),this},this._packedGetValue=function(){return r}}decode(e,t=0){let n=this.makeDestinationObject(),r=this.word.decode(e,t);this._packedSetValue(r);for(let t of this.fields)t.property!==void 0&&(n[t.property]=t.decode(e));return n}encode(e,t,n=0){let r=this.word.decode(t,n);this._packedSetValue(r);for(let t of this.fields)if(t.property!==void 0){let n=e[t.property];n!==void 0&&t.encode(n)}return this.word.encode(this._packedGetValue(),t,n)}addField(e,t){let n=new D(this,e,t);return this.fields.push(n),n}addBoolean(e){let t=new se(this,e);return this.fields.push(t),t}fieldFor(e){if(typeof e!=`string`)throw TypeError(`property must be string`);for(let t of this.fields)if(t.property===e)return t}};e.BitStructure=oe;var D=class{constructor(e,t,n){if(!(e instanceof oe))throw TypeError(`container must be a BitStructure`);if(!Number.isInteger(t)||0>=t)throw TypeError(`bits must be positive integer`);let r=8*e.span,i=e.fields.reduce((e,t)=>e+t.bits,0);if(t+i>r)throw Error(`bits too long for span remainder (`+(r-i)+` of `+r+` remain)`);this.container=e,this.bits=t,this.valueMask=(1<<t)-1,t===32&&(this.valueMask=4294967295),this.start=i,this.container.msb&&(this.start=r-i-t),this.wordMask=ae(this.valueMask<<this.start),this.property=n}decode(e,t){return ae(this.container._packedGetValue()&this.wordMask)>>>this.start}encode(e){if(typeof e!=`number`||!Number.isInteger(e)||e!==ae(e&this.valueMask))throw TypeError(a(`BitField.encode`,this)+` value must be integer not exceeding `+this.valueMask);let t=this.container._packedGetValue(),n=ae(e<<this.start);this.container._packedSetValue(ae(t&~this.wordMask)|n)}};e.BitField=D;var se=class extends D{constructor(e,t){super(e,1,t)}decode(e,t){return!!super.decode(e,t)}encode(e){typeof e==`boolean`&&(e=+e),super.encode(e)}};e.Boolean=se;var ce=class extends i{constructor(e,t){if(!(e instanceof s&&e.isCount()||Number.isInteger(e)&&0<=e))throw TypeError(`length must be positive integer or an unsigned integer ExternalLayout`);let n=-1;e instanceof s||(n=e),super(n,t),this.length=e}getSpan(e,t){let n=this.span;return 0>n&&(n=this.length.decode(e,t)),n}decode(e,t=0){let n=this.span;return 0>n&&(n=this.length.decode(e,t)),r(e).slice(t,t+n)}encode(e,t,n){let i=this.length;if(this.length instanceof s&&(i=e.length),!(e instanceof Uint8Array&&i===e.length))throw TypeError(a(`Blob.encode`,this)+` requires (length `+i+`) Uint8Array as src`);if(n+i>t.length)throw RangeError(`encoding overruns Uint8Array`);let o=r(e);return r(t).write(o.toString(`hex`),n,i,`hex`),this.length instanceof s&&this.length.encode(i,t,n),i}};e.Blob=ce;var le=class extends i{constructor(e){super(-1,e)}getSpan(e,t=0){n(e);let r=t;for(;r<e.length&&e[r]!==0;)r+=1;return 1+r-t}decode(e,t=0){let n=this.getSpan(e,t);return r(e).slice(t,t+n-1).toString(`utf-8`)}encode(e,n,i=0){typeof e!=`string`&&(e=String(e));let a=t.Buffer.from(e,`utf8`),o=a.length;if(i+o>n.length)throw RangeError(`encoding overruns Buffer`);let s=r(n);return a.copy(s,i),s[i+o]=0,o+1}};e.CString=le;var ue=class extends i{constructor(e,t){if(typeof e==`string`&&t===void 0&&(t=e,e=void 0),e===void 0)e=-1;else if(!Number.isInteger(e))throw TypeError(`maxSpan must be an integer`);super(-1,t),this.maxSpan=e}getSpan(e,t=0){return n(e),e.length-t}decode(e,t=0){let n=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan<n)throw RangeError(`text length exceeds maxSpan`);return r(e).slice(t,t+n).toString(`utf-8`)}encode(e,n,i=0){typeof e!=`string`&&(e=String(e));let a=t.Buffer.from(e,`utf8`),o=a.length;if(0<=this.maxSpan&&this.maxSpan<o)throw RangeError(`text length exceeds maxSpan`);if(i+o>n.length)throw RangeError(`encoding overruns Buffer`);return a.copy(r(n),i),o}};e.UTF8=ue;var de=class extends i{constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,n){return 0}};e.Constant=de,e.greedy=((e,t)=>new c(e,t)),e.offset=((e,t,n)=>new l(e,t,n)),e.u8=(e=>new u(1,e)),e.u16=(e=>new u(2,e)),e.u24=(e=>new u(3,e)),e.u32=(e=>new u(4,e)),e.u40=(e=>new u(5,e)),e.u48=(e=>new u(6,e)),e.nu64=(e=>new _(e)),e.u16be=(e=>new d(2,e)),e.u24be=(e=>new d(3,e)),e.u32be=(e=>new d(4,e)),e.u40be=(e=>new d(5,e)),e.u48be=(e=>new d(6,e)),e.nu64be=(e=>new v(e)),e.s8=(e=>new f(1,e)),e.s16=(e=>new f(2,e)),e.s24=(e=>new f(3,e)),e.s32=(e=>new f(4,e)),e.s40=(e=>new f(5,e)),e.s48=(e=>new f(6,e)),e.ns64=(e=>new y(e)),e.s16be=(e=>new p(2,e)),e.s24be=(e=>new p(3,e)),e.s32be=(e=>new p(4,e)),e.s40be=(e=>new p(5,e)),e.s48be=(e=>new p(6,e)),e.ns64be=(e=>new ee(e)),e.f32=(e=>new te(e)),e.f32be=(e=>new re(e)),e.f64=(e=>new b(e)),e.f64be=(e=>new x(e)),e.struct=((e,t,n)=>new C(e,t,n)),e.bits=((e,t,n)=>new oe(e,t,n)),e.seq=((e,t,n)=>new S(e,t,n)),e.union=((e,t,n)=>new E(e,t,n)),e.unionLayoutDiscriminator=((e,t)=>new T(e,t)),e.blob=((e,t)=>new ce(e,t)),e.cstr=(e=>new le(e)),e.utf8=((e,t)=>new ue(e,t)),e.constant=((e,t)=>new de(e,t))}));function en(e){return Array.isArray(e)?`%5B`+e.map(en).join(`%2C%20`)+`%5D`:typeof e==`bigint`?`${e}n`:encodeURIComponent(String(e!=null&&Object.getPrototypeOf(e)===null?{...e}:e))}function tn([e,t]){return`${e}=${en(t)}`}function nn(e){let t=Object.entries(e).map(tn).join(`&`);return btoa(t)}function rn(e,t={}){let n=so[e];if(n.length===0)return``;let r;function i(e){if(r[lo]===2){let i=n.slice(r[co]+1,e);a.push(i in t?`${t[i]}`:`$${i}`)}else r[lo]===1&&a.push(n.slice(r[co],e))}let a=[];return n.split(``).forEach((e,t)=>{if(t===0){r={[co]:0,[lo]:n[0]===`\\`?0:n[0]===`$`?2:1};return}let a;switch(r[lo]){case 0:a={[co]:t,[lo]:1};break;case 1:e===`\\`?a={[co]:t,[lo]:0}:e===`$`&&(a={[co]:t,[lo]:2});break;case 2:e===`\\`?a={[co]:t,[lo]:0}:e===`$`?a={[co]:t,[lo]:2}:e.match(/\w/)||(a={[co]:t,[lo]:1})}a&&(r!==a&&i(t),r=a)}),i(),a.join(``)}function an(e,t={}){if(a.env.NODE_ENV!==`production`)return rn(e,t);{let n=`Solana error #${e}; Decode this error by running \`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(n+=` '${nn(t)}'`),`${n}\``}}var on,sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr,fr,pr,mr,hr,gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi,mi,hi,gi,_i,vi,yi,bi,xi,Si,Ci,wi,Ti,Ei,Di,Oi,ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa,Ga,Ka,qa,Ja,Ya,Xa,Za,Qa,$a,eo,to,no,ro,io,ao,oo,so,co,lo,uo,fo=e((()=>{o(),on=-32700,sn=-32603,cn=-32602,ln=-32601,un=-32600,dn=-32016,fn=-32015,pn=-32014,mn=-32013,hn=-32012,gn=-32011,_n=-32010,vn=-32009,yn=-32008,bn=-32007,xn=-32006,Sn=-32005,Cn=-32004,wn=-32003,Tn=-32002,En=-32001,Dn=28e5,On=2800001,kn=2800002,An=2800003,jn=2800004,Mn=2800005,Nn=2800006,Pn=2800007,Fn=2800008,In=2800009,Ln=2800010,Rn=2800011,zn=323e4,Bn=32300001,Vn=3230002,Hn=3230003,Un=3230004,Wn=361e4,Gn=3610001,Kn=3610002,qn=3610003,Jn=3610004,Yn=3610005,Xn=3610006,Zn=3610007,Qn=3611e3,$n=3704e3,er=3704001,tr=3704002,nr=3704003,rr=3704004,ir=4128e3,ar=4128001,or=4128002,sr=4615e3,cr=4615001,lr=4615002,ur=4615003,dr=4615004,fr=4615005,pr=4615006,mr=4615007,hr=4615008,gr=4615009,_r=4615010,vr=4615011,yr=4615012,br=4615013,xr=4615014,Sr=4615015,Cr=4615016,wr=4615017,Tr=4615018,Er=4615019,Dr=4615020,Or=4615021,kr=4615022,Ar=4615023,jr=4615024,Mr=4615025,Nr=4615026,Pr=4615027,Fr=4615028,Ir=4615029,Lr=4615030,Rr=4615031,zr=4615032,Br=4615033,Vr=4615034,Hr=4615035,Ur=4615036,Wr=4615037,Gr=4615038,Kr=4615039,qr=4615040,Jr=4615041,Yr=4615042,Xr=4615043,Zr=4615044,Qr=4615045,$r=4615046,ei=4615047,ti=4615048,ni=4615049,ri=4615050,ii=4615051,ai=4615052,oi=4615053,si=4615054,ci=5508e3,li=5508001,ui=5508002,di=5508003,fi=5508004,pi=5508005,mi=5508006,hi=5508007,gi=5508008,_i=5508009,vi=5508010,yi=5508011,bi=5663e3,xi=5663001,Si=5663002,Ci=5663003,wi=5663004,Ti=5663005,Ei=5663006,Di=5663007,Oi=5663008,ki=5663009,Ai=5663010,ji=5663011,Mi=5663012,Ni=5663013,Pi=5663014,Fi=5663015,Ii=5663016,Li=5663017,Ri=5663018,zi=5663019,Bi=5663020,Vi=705e4,Hi=7050001,Ui=7050002,Wi=7050003,Gi=7050004,Ki=7050005,qi=7050006,Ji=7050007,Yi=7050008,Xi=7050009,Zi=7050010,Qi=7050011,$i=7050012,ea=7050013,ta=7050014,na=7050015,ra=7050016,ia=7050017,aa=7050018,oa=7050019,sa=7050020,ca=7050021,la=7050022,ua=7050023,da=7050024,fa=7050025,pa=7050026,ma=7050027,ha=7050028,ga=7050029,_a=7050030,va=7050031,ya=7050032,ba=7050033,xa=7050034,Sa=7050035,Ca=7050036,wa=8078e3,Ta=8078001,Ea=8078002,Da=8078003,Oa=8078004,ka=8078005,Aa=8078006,ja=8078007,Ma=8078008,Na=8078009,Pa=8078010,Fa=8078011,Ia=8078012,La=8078013,Ra=8078014,za=8078015,Ba=8078016,Va=8078017,Ha=8078018,Ua=8078019,Wa=8078020,Ga=8078021,Ka=8078022,qa=81e5,Ja=8100001,Ya=8100002,Xa=8100003,Za=819e4,Qa=8190001,$a=8190002,eo=8190003,to=8190004,no=99e5,ro=9900001,io=9900002,ao=9900003,oo=9900004,so={[zn]:`Account not found at address: $address`,[Un]:`Not all accounts were decoded. Encoded accounts found at addresses: $addresses.`,[Hn]:`Expected decoded account at address: $address`,[Vn]:`Failed to decode account data at address: $address`,[Bn]:`Accounts not found at addresses: $addresses`,[In]:`Unable to find a viable program address bump seed.`,[kn]:`$putativeAddress is not a base58-encoded address.`,[Dn]:`Expected base58 encoded address to decode to a byte array of length 32. Actual length: $actualLength.`,[An]:"The `CryptoKey` must be an `Ed25519` public key.",[Rn]:`$putativeOffCurveAddress is not a base58-encoded off-curve address.`,[Fn]:`Invalid seeds; point must fall off the Ed25519 curve.`,[jn]:`Expected given program derived address to have the following format: [Address, ProgramDerivedAddressBump].`,[Nn]:`A maximum of $maxSeeds seeds, including the bump seed, may be supplied when creating an address. Received: $actual.`,[Pn]:`The seed at index $index with length $actual exceeds the maximum length of $maxSeedLength bytes.`,[Mn]:`Expected program derived address bump to be in the range [0, 255], got: $bump.`,[Ln]:`Program address cannot end with PDA marker.`,[On]:`Expected base58-encoded address string of length in the range [32, 44]. Actual length: $actualLength.`,4:`Expected base58-encoded blockash string of length in the range [32, 44]. Actual length: $actualLength.`,1:`The network has progressed past the last block for which this transaction could have been committed.`,[wa]:`Codec [$codecDescription] cannot decode empty byte arrays.`,[Ka]:"Enum codec cannot use lexical values [$stringValues] as discriminators. Either remove all lexical values or set `useValuesAsDiscriminators` to `false`.",[Wa]:`Sentinel [$hexSentinel] must not be present in encoded bytes [$hexEncodedBytes].`,[ka]:`Encoder and decoder must have the same fixed size, got [$encoderFixedSize] and [$decoderFixedSize].`,[Aa]:`Encoder and decoder must have the same max size, got [$encoderMaxSize] and [$decoderMaxSize].`,[Oa]:`Encoder and decoder must either both be fixed-size or variable-size.`,[Ma]:`Enum discriminator out of range. Expected a number in [$formattedValidDiscriminators], got $discriminator.`,[Ea]:`Expected a fixed-size codec, got a variable-size one.`,[La]:`Codec [$codecDescription] expected a positive byte length, got $bytesLength.`,[Da]:`Expected a variable-size codec, got a fixed-size one.`,[Ua]:`Codec [$codecDescription] expected zero-value [$hexZeroValue] to have the same size as the provided fixed-size item [$expectedSize bytes].`,[Ta]:`Codec [$codecDescription] expected $expected bytes, got $bytesLength.`,[Ha]:`Expected byte array constant [$hexConstant] to be present in data [$hexData] at offset [$offset].`,[Na]:`Invalid discriminated union variant. Expected one of [$variants], got $value.`,[Pa]:`Invalid enum variant. Expected one of [$stringValues] or a number in [$formattedNumericalValues], got $variant.`,[za]:`Invalid literal union variant. Expected one of [$variants], got $value.`,[ja]:`Expected [$codecDescription] to have $expected items, got $actual.`,[Ia]:`Invalid value $value for base $base with alphabet $alphabet.`,[Ba]:`Literal union discriminator out of range. Expected a number between $minRange and $maxRange, got $discriminator.`,[Fa]:`Codec [$codecDescription] expected number to be in the range [$min, $max], got $value.`,[Ra]:`Codec [$codecDescription] expected offset to be in the range [0, $bytesLength], got $offset.`,[Ga]:`Expected sentinel [$hexSentinel] to be present in decoded bytes [$hexDecodedBytes].`,[Va]:`Union variant out of range. Expected an index between $minRange and $maxRange, got $variant.`,[Qn]:`No random values implementation could be found.`,[gr]:`instruction requires an uninitialized account`,[Ar]:`instruction tries to borrow reference for an account which is already borrowed`,[jr]:`instruction left account with an outstanding borrowed reference`,[Or]:`program other than the account's owner changed the size of the account data`,[fr]:`account data too small for instruction`,[kr]:`instruction expected an executable account`,[$r]:`An account does not have enough lamports to be rent-exempt`,[ti]:`Program arithmetic overflowed`,[Qr]:`Failed to serialize or deserialize account data: $encodedData`,[si]:`Builtin programs must consume compute units`,[zr]:`Cross-program invocation call depth too deep`,[Gr]:`Computational budget exceeded`,[Nr]:`custom program error: #$code`,[wr]:`instruction contains duplicate accounts`,[Mr]:`instruction modifications of multiply-passed account differ`,[Lr]:`executable accounts must be rent exempt`,[Fr]:`instruction changed executable accounts data`,[Ir]:`instruction changed the balance of an executable account`,[Tr]:`instruction changed executable bit of an account`,[xr]:`instruction modified data of an account it does not own`,[br]:`instruction spent from the balance of an account it does not own`,[cr]:`generic instruction error`,[ri]:`Provided owner is not allowed`,[Xr]:`Account is immutable`,[Zr]:`Incorrect authority provided`,[mr]:`incorrect program id for instruction`,[pr]:`insufficient funds for instruction`,[dr]:`invalid account data for instruction`,[ei]:`Invalid account owner`,[lr]:`invalid program argument`,[Pr]:`program returned invalid error code`,[ur]:`invalid instruction data`,[Wr]:`Failed to reallocate account data`,[Ur]:`Provided seeds do not result in a valid address`,[ii]:`Accounts data allocations exceeded the maximum allowed per transaction`,[ai]:`Max accounts exceeded`,[oi]:`Max instruction trace length exceeded`,[Hr]:`Length of the seed is too long for address generation`,[Br]:`An account required by the instruction is missing`,[hr]:`missing required signature for instruction`,[yr]:`instruction illegally modified the program id of an account`,[Dr]:`insufficient account keys for instruction`,[Kr]:`Cross-program invocation with unauthorized signer or writable account`,[qr]:`Failed to create program execution environment`,[Yr]:`Program failed to compile`,[Jr]:`Program failed to complete`,[Cr]:`instruction modified data of a read-only account`,[Sr]:`instruction changed the balance of a read-only account`,[Vr]:`Cross-program invocation reentrancy not allowed for this instruction`,[Er]:`instruction modified rent epoch of an account`,[vr]:`sum of account balances before and after instruction do not match`,[_r]:`instruction requires an initialized account`,[sr]:``,[Rr]:`Unsupported program id`,[ni]:`Unsupported sysvar`,[ir]:`The instruction does not have any accounts.`,[ar]:`The instruction does not have any data.`,[or]:`Expected instruction to have progress address $expectedProgramAddress, got $actualProgramAddress.`,5:`Expected base58 encoded blockhash to decode to a byte array of length 32. Actual length: $actualLength.`,2:"The nonce `$expectedNonceValue` is no longer valid. It has advanced to `$actualNonceValue`",[io]:"Invariant violation: Found no abortable iterable cache entry for key `$cacheKey`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[oo]:"Invariant violation: This data publisher does not publish to the channel named `$channelName`. Supported channels include $supportedChannelNames.",[ro]:`Invariant violation: WebSocket message iterator state is corrupt; iterated without first resolving existing message promise. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant`,[no]:`Invariant violation: WebSocket message iterator is missing state storage. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant`,[ao]:"Invariant violation: Switch statement non-exhaustive. Received unexpected value `$unexpectedValue`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[sn]:`JSON-RPC error: Internal JSON-RPC error ($__serverMessage)`,[cn]:`JSON-RPC error: Invalid method parameter(s) ($__serverMessage)`,[un]:"JSON-RPC error: The JSON sent is not a valid `Request` object ($__serverMessage)",[ln]:`JSON-RPC error: The method does not exist / is not available ($__serverMessage)`,[on]:`JSON-RPC error: An error occurred on the server while parsing the JSON text ($__serverMessage)`,[hn]:`$__serverMessage`,[En]:`$__serverMessage`,[Cn]:`$__serverMessage`,[pn]:`$__serverMessage`,[_n]:`$__serverMessage`,[vn]:`$__serverMessage`,[dn]:`Minimum context slot has not been reached`,[Sn]:`Node is unhealthy; behind by $numSlotsBehind slots`,[yn]:`No snapshot`,[Tn]:`Transaction simulation failed`,[bn]:`$__serverMessage`,[gn]:`Transaction history is not available from this node`,[xn]:`$__serverMessage`,[mn]:`Transaction signature length mismatch`,[wn]:`Transaction signature verification failure`,[fn]:`$__serverMessage`,[$n]:`Key pair bytes must be of length 64, got $byteLength.`,[er]:`Expected private key bytes with length 32. Actual length: $actualLength.`,[tr]:`Expected base58-encoded signature to decode to a byte array of length 64. Actual length: $actualLength.`,[rr]:`The provided private key does not match the provided public key.`,[nr]:`Expected base58-encoded signature string of length in the range [64, 88]. Actual length: $actualLength.`,6:`Lamports value must be in the range [0, 2e64-1]`,7:"`$value` cannot be parsed as a `BigInt`",10:`$message`,8:"`$value` cannot be parsed as a `Number`",3:"No nonce account could be found at address `$nonceAccountAddress`",[Za]:`The notification name must end in 'Notifications' and the API must supply a subscription plan creator function for the notification '$notificationName'.`,[$a]:`WebSocket was closed before payload could be added to the send buffer`,[eo]:`WebSocket connection closed`,[to]:`WebSocket failed to connect`,[Qa]:`Failed to obtain a subscription id from the server`,[Xa]:"Could not find an API plan for RPC method: `$method`",[qa]:"The $argumentLabel argument to the `$methodName` RPC method$optionalPathLabel was `$value`. This number is unsafe for use with the Solana JSON-RPC because it exceeds `Number.MAX_SAFE_INTEGER`.",[Ya]:`HTTP error ($statusCode): $message`,[Ja]:`HTTP header(s) forbidden: $headers. Learn more at https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name.`,[ci]:"Multiple distinct signers were identified for address `$address`. Please ensure that you are using the same signer instance for each address.",[li]:"The provided value does not implement the `KeyPairSigner` interface",[di]:"The provided value does not implement the `MessageModifyingSigner` interface",[fi]:"The provided value does not implement the `MessagePartialSigner` interface",[ui]:"The provided value does not implement any of the `MessageSigner` interfaces",[mi]:"The provided value does not implement the `TransactionModifyingSigner` interface",[hi]:"The provided value does not implement the `TransactionPartialSigner` interface",[gi]:"The provided value does not implement the `TransactionSendingSigner` interface",[pi]:"The provided value does not implement any of the `TransactionSigner` interfaces",[_i]:"More than one `TransactionSendingSigner` was identified.",[vi]:"No `TransactionSendingSigner` was identified. Please provide a valid `TransactionWithSingleSendingSigner` transaction.",[yi]:`Wallet account signers do not support signing multiple messages/transactions in a single operation`,[Zn]:`Cannot export a non-extractable key.`,[Gn]:`No digest implementation could be found.`,[Wn]:`Cryptographic operations are only allowed in secure browser contexts. Read more here: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts.`,[Kn]:`This runtime does not support the generation of Ed25519 key pairs.
1
+ import{n as e,o as t,r as n,s as r,t as i}from"./rolldown-runtime-BcKkbAw3.js";import{n as a,t as o}from"./dist-C9i0DjyB.js";import{C as s}from"./Schema-CnO1Nnkx.js";import{n as c,t as l}from"./dist-D6L6gF64.js";import{n as u}from"./_esm-CXYNiZel.js";import{vn as d}from"./ccip-BxB3ZbpJ.js";import{n as f,t as p}from"./sha256-B81eAX-m.js";import{n as m,t as h}from"./sha3-DTWsE4Uo.js";import{n as g,r as _,t as v}from"./dist-KkMRwAp9.js";import{t as y}from"./fallback-Dw6P3XKE.js";import{n as ee,t as te}from"./ed25519-0TVA-MrV.js";import{n as ne,t as re}from"./bn-F_BR-QG7.js";import{t as b}from"./elliptic-BkWObsOB.js";import{t as x}from"./bs58-Cepc0rNH.js";import{n as S,t as C}from"./secp256k1-KrmNoC0i.js";import{t as w}from"./esm-DhvlA6gG.js";import{t as T}from"./events-D2w4OsQJ.js";import{a as E,c as ie,d as ae,f as oe,i as D,l as se,o as ce,r as le,s as ue,t as de,u as fe}from"./index.es-6FknJabw.js";import{_ as pe,a as me,d as O,f as he,g as ge,h as _e,i as ve,l as ye,n as be,o as xe,p as Se,r as Ce,s as we,u as Te,v as Ee}from"./browser-ponyfill-8IsXQqGl.js";import{a as De,i as Oe,n as ke,r as Ae,t as je}from"./index.es-DqXS4GHm.js";import{i as Me,n as Ne,r as Pe,t as Fe}from"./src-Dwq4W0Wh.js";import{t as Ie}from"./index.es-B-vaqu71.js";import{A as Le,C as k,D as Re,E as ze,O as Be,S as Ve,_ as He,a as Ue,c as We,d as A,f as Ge,g as Ke,h as qe,k as j,l as Je,m as Ye,o as Xe,p as Ze,u as Qe,v as $e,w as et,x as tt,y as nt}from"./exports-0dvJtd9q.js";import{i as rt,n as it,o as at,r as ot}from"./utils-CXyOXcxm.js";import{i as st,n as ct,r as lt}from"./ConnectorUtil-C2YHRvjK.js";var ut=i(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=`~`;function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(r=!1));function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if(typeof n!=`function`)throw TypeError(`The listener must be a function`);var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){--e._eventsCount===0?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var e=[],t,i;if(this._eventsCount===0)return e;for(i in t=this._events)n.call(t,i)&&e.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c=this._events[s],l=arguments.length,u,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,a),!0;case 6:return c.fn.call(c.context,t,n,i,a,o),!0}for(d=1,u=Array(l-1);d<l;d++)u[d-1]=arguments[d];c.fn.apply(c.context,u)}else{var f=c.length,p;for(d=0;d<f;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),l){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,n);break;case 4:c[d].fn.call(c[d].context,t,n,i);break;default:if(!u)for(p=1,u=Array(l-1);p<l;p++)u[p-1]=arguments[p];c[d].fn.apply(c[d].context,u)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,l=[],u=o.length;c<u;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&l.push(o[c]);l.length?this._events[a]=l.length===1?l[0]:l:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,t!==void 0&&(t.exports=c)})),dt,ft,pt=e((()=>{dt=r(ut(),1),ft=dt.default}));pt();var mt=class extends Error{constructor(e,t){super(e),this.error=t}},ht=class extends mt{constructor(){super(...arguments),this.name=`WalletNotReadyError`}},gt=class extends mt{constructor(){super(...arguments),this.name=`WalletConfigError`}},_t=class extends mt{constructor(){super(...arguments),this.name=`WalletConnectionError`}},vt=class extends mt{constructor(){super(...arguments),this.name=`WalletDisconnectedError`}},yt=class extends mt{constructor(){super(...arguments),this.name=`WalletDisconnectionError`}},bt=class extends mt{constructor(){super(...arguments),this.name=`WalletAccountError`}},xt=class extends mt{constructor(){super(...arguments),this.name=`WalletPublicKeyError`}},St=class extends mt{constructor(){super(...arguments),this.name=`WalletNotConnectedError`}},Ct=class extends mt{constructor(){super(...arguments),this.name=`WalletSendTransactionError`}},wt=class extends mt{constructor(){super(...arguments),this.name=`WalletSignTransactionError`}},Tt=class extends mt{constructor(){super(...arguments),this.name=`WalletSignMessageError`}},Et=class extends mt{constructor(){super(...arguments),this.name=`WalletSignInError`}},Dt=class extends mt{constructor(){super(...arguments),this.name=`WalletWindowClosedError`}},Ot;(function(e){e.Installed=`Installed`,e.NotDetected=`NotDetected`,e.Loadable=`Loadable`,e.Unsupported=`Unsupported`})(Ot||={});var kt=class extends ft{get connected(){return!!this.publicKey}async autoConnect(){await this.connect()}async prepareTransaction(e,t,n={}){let r=this.publicKey;if(!r)throw new St;return e.feePayer=e.feePayer||r,e.recentBlockhash=e.recentBlockhash||(await t.getLatestBlockhash({commitment:n.preflightCommitment,minContextSlot:n.minContextSlot})).blockhash,e}};function At(e){if(typeof window>`u`||typeof document>`u`)return;let t=[];function n(){if(e())for(let e of t)e()}let r=setInterval(n,1e3);t.push(()=>clearInterval(r)),document.readyState===`loading`&&(document.addEventListener(`DOMContentLoaded`,n,{once:!0}),t.push(()=>document.removeEventListener(`DOMContentLoaded`,n))),document.readyState!==`complete`&&(window.addEventListener(`load`,n,{once:!0}),t.push(()=>window.removeEventListener(`load`,n))),n()}function jt(){if(!navigator)return!1;let e=navigator.userAgent.toLowerCase(),t=e.includes(`iphone`)||e.includes(`ipad`),n=e.includes(`safari`);return t&&n}function Mt(e){return`version`in e}var Nt=class extends kt{async sendTransaction(e,t,n={}){let r=!0;try{if(Mt(e)){if(!this.supportedTransactionVersions)throw new Ct(`Sending versioned transactions isn't supported by this wallet`);if(!this.supportedTransactionVersions.has(e.version))throw new Ct(`Sending transaction version ${e.version} isn't supported by this wallet`);try{e=await this.signTransaction(e);let r=e.serialize();return await t.sendRawTransaction(r,n)}catch(e){throw e instanceof wt?(r=!1,e):new Ct(e?.message,e)}}try{let{signers:r,...i}=n;e=await this.prepareTransaction(e,t,i),r?.length&&e.partialSign(...r),e=await this.signTransaction(e);let a=e.serialize();return await t.sendRawTransaction(a,i)}catch(e){throw e instanceof wt?(r=!1,e):new Ct(e?.message,e)}}catch(e){throw r&&this.emit(`error`,e),e}}async signAllTransactions(e){for(let t of e)if(Mt(t)){if(!this.supportedTransactionVersions)throw new wt(`Signing versioned transactions isn't supported by this wallet`);if(!this.supportedTransactionVersions.has(t.version))throw new wt(`Signing transaction version ${t.version} isn't supported by this wallet`)}let t=[];for(let n of e)t.push(await this.signTransaction(n));return t}},Pt=class extends Nt{},Ft=class extends Pt{},It;(function(e){e.Mainnet=`mainnet-beta`,e.Testnet=`testnet`,e.Devnet=`devnet`})(It||={});var Lt=n({TextDecoder:()=>Wt,TextEncoder:()=>Gt});function Rt(e,t,n){return t<=e&&e<=n}function zt(e){if(e===void 0)return{};if(e===Object(e))return e;throw TypeError(`Could not convert argument to dictionary`)}function Bt(e){for(var t=String(e),n=t.length,r=0,i=[];r<n;){var a=t.charCodeAt(r);if(a<55296||a>57343)i.push(a);else if(56320<=a&&a<=57343)i.push(65533);else if(55296<=a&&a<=56319){if(r===n-1)i.push(65533);else{var o=e.charCodeAt(r+1);if(56320<=o&&o<=57343){var s=a&1023,c=o&1023;i.push(65536+(s<<10)+c),r+=1}else i.push(65533)}}r+=1}return i}function Vt(e){for(var t=``,n=0;n<e.length;++n){var r=e[n];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t}function Ht(e){this.tokens=[].slice.call(e)}function Ut(e,t){if(e)throw TypeError(`Decoder error`);return t||65533}function Wt(e,t){if(!(this instanceof Wt))return new Wt(e,t);if(e=e===void 0?Xt:String(e).toLowerCase(),e!==Xt)throw Error(`Encoding not supported. Only utf-8 is supported`);t=zt(t),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!t.fatal,this._ignoreBOM=!!t.ignoreBOM,Object.defineProperty(this,"encoding",{value:`utf-8`}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}function Gt(e,t){if(!(this instanceof Gt))return new Gt(e,t);if(e=e===void 0?Xt:String(e).toLowerCase(),e!==Xt)throw Error(`Encoding not supported. Only utf-8 is supported`);t=zt(t),this._streaming=!1,this._encoder=null,this._options={fatal:!!t.fatal},Object.defineProperty(this,"encoding",{value:`utf-8`})}function Kt(e){var t=e.fatal,n=0,r=0,i=0,a=128,o=191;this.handler=function(e,s){if(s===Jt&&i!==0)return i=0,Ut(t);if(s===Jt)return Yt;if(i===0){if(Rt(s,0,127))return s;if(Rt(s,194,223))i=1,n=s-192;else if(Rt(s,224,239))s===224&&(a=160),s===237&&(o=159),i=2,n=s-224;else if(Rt(s,240,244))s===240&&(a=144),s===244&&(o=143),i=3,n=s-240;else return Ut(t);return n<<=6*i,null}if(!Rt(s,a,o))return n=i=r=0,a=128,o=191,e.prepend(s),Ut(t);if(a=128,o=191,r+=1,n+=s-128<<6*(i-r),r!==i)return null;var c=n;return n=i=r=0,c}}function qt(e){e.fatal,this.handler=function(e,t){if(t===Jt)return Yt;if(Rt(t,0,127))return t;var n,r;Rt(t,128,2047)?(n=1,r=192):Rt(t,2048,65535)?(n=2,r=224):Rt(t,65536,1114111)&&(n=3,r=240);for(var i=[(t>>6*n)+r];n>0;){var a=t>>6*(n-1);i.push(128|a&63),--n}return i}}var Jt,Yt,Xt,Zt=e((()=>{Jt=-1,Ht.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Jt},prepend:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.unshift(t.pop());else this.tokens.unshift(e)},push:function(e){if(Array.isArray(e))for(var t=e;t.length;)this.tokens.push(t.shift());else this.tokens.push(e)}},Yt=-1,Xt=`utf-8`,Wt.prototype={decode:function(e,t){var n=typeof e==`object`&&e instanceof ArrayBuffer?new Uint8Array(e):typeof e==`object`&&`buffer`in e&&e.buffer instanceof ArrayBuffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array;t=zt(t),this._streaming||(this._decoder=new Kt({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!t.stream;for(var r=new Ht(n),i=[],a;!r.endOfStream()&&(a=this._decoder.handler(r,r.read()),a!==Yt);)a!==null&&(Array.isArray(a)?i.push.apply(i,a):i.push(a));if(!this._streaming){do{if(a=this._decoder.handler(r,r.read()),a===Yt)break;a!==null&&(Array.isArray(a)?i.push.apply(i,a):i.push(a))}while(!r.endOfStream());this._decoder=null}return i.length&&[`utf-8`].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(i[0]===65279?(this._BOMseen=!0,i.shift()):this._BOMseen=!0),Vt(i)}},Gt.prototype={encode:function(e,t){e=e?String(e):``,t=zt(t),this._streaming||(this._encoder=new qt(this._options)),this._streaming=!!t.stream;for(var n=[],r=new Ht(Bt(e)),i;!r.endOfStream()&&(i=this._encoder.handler(r,r.read()),i!==Yt);)Array.isArray(i)?n.push.apply(n,i):n.push(i);if(!this._streaming){for(;i=this._encoder.handler(r,r.read()),i!==Yt;)Array.isArray(i)?n.push.apply(n,i):n.push(i);this._encoder=null}return new Uint8Array(n)}}})),Qt=i((e=>{_();var n=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),r=e&&e.__setModuleDefault||(Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t}),i=e&&e.__decorate||function(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},a=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var i in e)i!=="default"&&Object.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t},o=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeUnchecked=e.deserialize=e.serialize=e.BinaryReader=e.BinaryWriter=e.BorshError=e.baseDecode=e.baseEncode=void 0;var s=o(re()),c=o(x()),l=a((Zt(),t(Lt))),u=new(typeof TextDecoder==`function`?TextDecoder:l.TextDecoder)(`utf-8`,{fatal:!0});function d(e){return typeof e==`string`&&(e=v.from(e,`utf8`)),c.default.encode(v.from(e))}e.baseEncode=d;function f(e){return v.from(c.default.decode(e))}e.baseDecode=f;var p=1024,m=class extends Error{constructor(e){super(e),this.fieldPath=[],this.originalMessage=e}addToFieldPath(e){this.fieldPath.splice(0,0,e),this.message=this.originalMessage+`: `+this.fieldPath.join(`.`)}};e.BorshError=m;var h=class{constructor(){this.buf=v.alloc(p),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=v.concat([this.buf,v.alloc(p)]))}writeU8(e){this.maybeResize(),this.buf.writeUInt8(e,this.length),this.length+=1}writeU16(e){this.maybeResize(),this.buf.writeUInt16LE(e,this.length),this.length+=2}writeU32(e){this.maybeResize(),this.buf.writeUInt32LE(e,this.length),this.length+=4}writeU64(e){this.maybeResize(),this.writeBuffer(v.from(new s.default(e).toArray(`le`,8)))}writeU128(e){this.maybeResize(),this.writeBuffer(v.from(new s.default(e).toArray(`le`,16)))}writeU256(e){this.maybeResize(),this.writeBuffer(v.from(new s.default(e).toArray(`le`,32)))}writeU512(e){this.maybeResize(),this.writeBuffer(v.from(new s.default(e).toArray(`le`,64)))}writeBuffer(e){this.buf=v.concat([v.from(this.buf.subarray(0,this.length)),e,v.alloc(p)]),this.length+=e.length}writeString(e){this.maybeResize();let t=v.from(e,`utf8`);this.writeU32(t.length),this.writeBuffer(t)}writeFixedArray(e){this.writeBuffer(v.from(e))}writeArray(e,t){this.maybeResize(),this.writeU32(e.length);for(let n of e)this.maybeResize(),t(n)}toArray(){return this.buf.subarray(0,this.length)}};e.BinaryWriter=h;function g(e,t,n){let r=n.value;n.value=function(...e){try{return r.apply(this,e)}catch(e){if(e instanceof RangeError){let t=e.code;if([`ERR_BUFFER_OUT_OF_BOUNDS`,`ERR_OUT_OF_RANGE`].indexOf(t)>=0)throw new m(`Reached the end of buffer when deserializing`)}throw e}}}var y=class{constructor(e){this.buf=e,this.offset=0}readU8(){let e=this.buf.readUInt8(this.offset);return this.offset+=1,e}readU16(){let e=this.buf.readUInt16LE(this.offset);return this.offset+=2,e}readU32(){let e=this.buf.readUInt32LE(this.offset);return this.offset+=4,e}readU64(){let e=this.readBuffer(8);return new s.default(e,`le`)}readU128(){let e=this.readBuffer(16);return new s.default(e,`le`)}readU256(){let e=this.readBuffer(32);return new s.default(e,`le`)}readU512(){let e=this.readBuffer(64);return new s.default(e,`le`)}readBuffer(e){if(this.offset+e>this.buf.length)throw new m(`Expected buffer length ${e} isn't within bounds`);let t=this.buf.slice(this.offset,this.offset+e);return this.offset+=e,t}readString(){let e=this.readU32(),t=this.readBuffer(e);try{return u.decode(t)}catch(e){throw new m(`Error decoding UTF-8 string: ${e}`)}}readFixedArray(e){return new Uint8Array(this.readBuffer(e))}readArray(e){let t=this.readU32(),n=[];for(let r=0;r<t;++r)n.push(e());return n}};i([g],y.prototype,`readU8`,null),i([g],y.prototype,`readU16`,null),i([g],y.prototype,`readU32`,null),i([g],y.prototype,`readU64`,null),i([g],y.prototype,`readU128`,null),i([g],y.prototype,`readU256`,null),i([g],y.prototype,`readU512`,null),i([g],y.prototype,`readString`,null),i([g],y.prototype,`readFixedArray`,null),i([g],y.prototype,`readArray`,null),e.BinaryReader=y;function ee(e){return e.charAt(0).toUpperCase()+e.slice(1)}function te(e,t,n,r,i){try{if(typeof r==`string`)i[`write${ee(r)}`](n);else if(r instanceof Array){if(typeof r[0]==`number`){if(n.length!==r[0])throw new m(`Expecting byte array of length ${r[0]}, but got ${n.length} bytes`);i.writeFixedArray(n)}else if(r.length===2&&typeof r[1]==`number`){if(n.length!==r[1])throw new m(`Expecting byte array of length ${r[1]}, but got ${n.length} bytes`);for(let t=0;t<r[1];t++)te(e,null,n[t],r[0],i)}else i.writeArray(n,n=>{te(e,t,n,r[0],i)})}else if(r.kind!==void 0)switch(r.kind){case`option`:n==null?i.writeU8(0):(i.writeU8(1),te(e,t,n,r.type,i));break;case`map`:i.writeU32(n.size),n.forEach((n,a)=>{te(e,t,a,r.key,i),te(e,t,n,r.value,i)});break;default:throw new m(`FieldType ${r} unrecognized`)}else ne(e,n,i)}catch(e){throw e instanceof m&&e.addToFieldPath(t),e}}function ne(e,t,n){if(typeof t.borshSerialize==`function`){t.borshSerialize(n);return}let r=e.get(t.constructor);if(!r)throw new m(`Class ${t.constructor.name} is missing in schema`);if(r.kind===`struct`)r.fields.map(([r,i])=>{te(e,r,t[r],i,n)});else if(r.kind===`enum`){let i=t[r.field];for(let a=0;a<r.values.length;++a){let[o,s]=r.values[a];if(o===i){n.writeU8(a),te(e,o,t[o],s,n);break}}}else throw new m(`Unexpected schema kind: ${r.kind} for ${t.constructor.name}`)}function b(e,t,n=h){let r=new n;return ne(e,t,r),r.toArray()}e.serialize=b;function S(e,t,n,r){try{if(typeof n==`string`)return r[`read${ee(n)}`]();if(n instanceof Array){if(typeof n[0]==`number`)return r.readFixedArray(n[0]);if(typeof n[1]==`number`){let t=[];for(let i=0;i<n[1];i++)t.push(S(e,null,n[0],r));return t}return r.readArray(()=>S(e,t,n[0],r))}if(n.kind===`option`)return r.readU8()?S(e,t,n.type,r):void 0;if(n.kind===`map`){let i=new Map,a=r.readU32();for(let o=0;o<a;o++){let a=S(e,t,n.key,r),o=S(e,t,n.value,r);i.set(a,o)}return i}return C(e,n,r)}catch(e){throw e instanceof m&&e.addToFieldPath(t),e}}function C(e,t,n){if(typeof t.borshDeserialize==`function`)return t.borshDeserialize(n);let r=e.get(t);if(!r)throw new m(`Class ${t.name} is missing in schema`);if(r.kind===`struct`){let r={};for(let[i,a]of e.get(t).fields)r[i]=S(e,i,a,n);return new t(r)}if(r.kind===`enum`){let i=n.readU8();if(i>=r.values.length)throw new m(`Enum index: ${i} is out of range`);let[a,o]=r.values[i],s=S(e,a,o,n);return new t({[a]:s})}throw new m(`Unexpected schema kind: ${r.kind} for ${t.constructor.name}`)}function w(e,t,n,r=y){let i=new r(n),a=C(e,t,i);if(i.offset<n.length)throw new m(`Unexpected ${n.length-i.offset} bytes after deserialized data`);return a}e.deserialize=w;function T(e,t,n,r=y){return C(e,t,new r(n))}e.deserializeUnchecked=T})),$t=i((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.s16=e.s8=e.nu64be=e.u48be=e.u40be=e.u32be=e.u24be=e.u16be=e.nu64=e.u48=e.u40=e.u32=e.u24=e.u16=e.u8=e.offset=e.greedy=e.Constant=e.UTF8=e.CString=e.Blob=e.Boolean=e.BitField=e.BitStructure=e.VariantLayout=e.Union=e.UnionLayoutDiscriminator=e.UnionDiscriminator=e.Structure=e.Sequence=e.DoubleBE=e.Double=e.FloatBE=e.Float=e.NearInt64BE=e.NearInt64=e.NearUInt64BE=e.NearUInt64=e.IntBE=e.Int=e.UIntBE=e.UInt=e.OffsetLayout=e.GreedyCount=e.ExternalLayout=e.bindConstructorLayout=e.nameWithProperty=e.Layout=e.uint8ArrayToBuffer=e.checkUint8Array=void 0,e.constant=e.utf8=e.cstr=e.blob=e.unionLayoutDiscriminator=e.union=e.seq=e.bits=e.struct=e.f64be=e.f64=e.f32be=e.f32=e.ns64be=e.s48be=e.s40be=e.s32be=e.s24be=e.s16be=e.ns64=e.s48=e.s40=e.s32=e.s24=void 0;var t=ne();function n(e){if(!(e instanceof Uint8Array))throw TypeError(`b must be a Uint8Array`)}e.checkUint8Array=n;function r(e){return n(e),t.Buffer.from(e.buffer,e.byteOffset,e.length)}e.uint8ArrayToBuffer=r;var i=class{constructor(e,t){if(!Number.isInteger(e))throw TypeError(`span must be an integer`);this.span=e,this.property=t}makeDestinationObject(){return{}}getSpan(e,t){if(0>this.span)throw RangeError(`indeterminate span`);return this.span}replicate(e){let t=Object.create(this.constructor.prototype);return Object.assign(t,this),t.property=e,t}fromArray(e){}};e.Layout=i;function a(e,t){return t.property?e+`[`+t.property+`]`:e}e.nameWithProperty=a;function o(e,t){if(typeof e!=`function`)throw TypeError(`Class must be constructor`);if(Object.prototype.hasOwnProperty.call(e,`layout_`))throw Error(`Class is already bound to a layout`);if(!(t&&t instanceof i))throw TypeError(`layout must be a Layout`);if(Object.prototype.hasOwnProperty.call(t,`boundConstructor_`))throw Error(`layout is already bound to a constructor`);e.layout_=t,t.boundConstructor_=e,t.makeDestinationObject=(()=>new e),Object.defineProperty(e.prototype,"encode",{value(e,n){return t.encode(this,e,n)},writable:!0}),Object.defineProperty(e,"decode",{value(e,n){return t.decode(e,n)},writable:!0})}e.bindConstructorLayout=o;var s=class extends i{isCount(){throw Error(`ExternalLayout is abstract`)}};e.ExternalLayout=s;var c=class extends s{constructor(e=1,t){if(!Number.isInteger(e)||0>=e)throw TypeError(`elementSpan must be a (positive) integer`);super(-1,t),this.elementSpan=e}isCount(){return!0}decode(e,t=0){n(e);let r=e.length-t;return Math.floor(r/this.elementSpan)}encode(e,t,n){return 0}};e.GreedyCount=c;var l=class extends s{constructor(e,t=0,n){if(!(e instanceof i))throw TypeError(`layout must be a Layout`);if(!Number.isInteger(t))throw TypeError(`offset must be integer or undefined`);super(e.span,n||e.property),this.layout=e,this.offset=t}isCount(){return this.layout instanceof u||this.layout instanceof d}decode(e,t=0){return this.layout.decode(e,t+this.offset)}encode(e,t,n=0){return this.layout.encode(e,t,n+this.offset)}};e.OffsetLayout=l;var u=class extends i{constructor(e,t){if(super(e,t),6<this.span)throw RangeError(`span must not exceed 6 bytes`)}decode(e,t=0){return r(e).readUIntLE(t,this.span)}encode(e,t,n=0){return r(t).writeUIntLE(e,n,this.span),this.span}};e.UInt=u;var d=class extends i{constructor(e,t){if(super(e,t),6<this.span)throw RangeError(`span must not exceed 6 bytes`)}decode(e,t=0){return r(e).readUIntBE(t,this.span)}encode(e,t,n=0){return r(t).writeUIntBE(e,n,this.span),this.span}};e.UIntBE=d;var f=class extends i{constructor(e,t){if(super(e,t),6<this.span)throw RangeError(`span must not exceed 6 bytes`)}decode(e,t=0){return r(e).readIntLE(t,this.span)}encode(e,t,n=0){return r(t).writeIntLE(e,n,this.span),this.span}};e.Int=f;var p=class extends i{constructor(e,t){if(super(e,t),6<this.span)throw RangeError(`span must not exceed 6 bytes`)}decode(e,t=0){return r(e).readIntBE(t,this.span)}encode(e,t,n=0){return r(t).writeIntBE(e,n,this.span),this.span}};e.IntBE=p;var m=2**32;function h(e){let t=Math.floor(e/m);return{hi32:t,lo32:e-t*m}}function g(e,t){return e*m+t}var _=class extends i{constructor(e){super(8,e)}decode(e,t=0){let n=r(e),i=n.readUInt32LE(t);return g(n.readUInt32LE(t+4),i)}encode(e,t,n=0){let i=h(e),a=r(t);return a.writeUInt32LE(i.lo32,n),a.writeUInt32LE(i.hi32,n+4),8}};e.NearUInt64=_;var v=class extends i{constructor(e){super(8,e)}decode(e,t=0){let n=r(e);return g(n.readUInt32BE(t),n.readUInt32BE(t+4))}encode(e,t,n=0){let i=h(e),a=r(t);return a.writeUInt32BE(i.hi32,n),a.writeUInt32BE(i.lo32,n+4),8}};e.NearUInt64BE=v;var y=class extends i{constructor(e){super(8,e)}decode(e,t=0){let n=r(e),i=n.readUInt32LE(t);return g(n.readInt32LE(t+4),i)}encode(e,t,n=0){let i=h(e),a=r(t);return a.writeUInt32LE(i.lo32,n),a.writeInt32LE(i.hi32,n+4),8}};e.NearInt64=y;var ee=class extends i{constructor(e){super(8,e)}decode(e,t=0){let n=r(e);return g(n.readInt32BE(t),n.readUInt32BE(t+4))}encode(e,t,n=0){let i=h(e),a=r(t);return a.writeInt32BE(i.hi32,n),a.writeUInt32BE(i.lo32,n+4),8}};e.NearInt64BE=ee;var te=class extends i{constructor(e){super(4,e)}decode(e,t=0){return r(e).readFloatLE(t)}encode(e,t,n=0){return r(t).writeFloatLE(e,n),4}};e.Float=te;var re=class extends i{constructor(e){super(4,e)}decode(e,t=0){return r(e).readFloatBE(t)}encode(e,t,n=0){return r(t).writeFloatBE(e,n),4}};e.FloatBE=re;var b=class extends i{constructor(e){super(8,e)}decode(e,t=0){return r(e).readDoubleLE(t)}encode(e,t,n=0){return r(t).writeDoubleLE(e,n),8}};e.Double=b;var x=class extends i{constructor(e){super(8,e)}decode(e,t=0){return r(e).readDoubleBE(t)}encode(e,t,n=0){return r(t).writeDoubleBE(e,n),8}};e.DoubleBE=x;var S=class extends i{constructor(e,t,n){if(!(e instanceof i))throw TypeError(`elementLayout must be a Layout`);if(!(t instanceof s&&t.isCount()||Number.isInteger(t)&&0<=t))throw TypeError(`count must be non-negative integer or an unsigned integer ExternalLayout`);let r=-1;!(t instanceof s)&&0<e.span&&(r=t*e.span),super(r,n),this.elementLayout=e,this.count=t}getSpan(e,t=0){if(0<=this.span)return this.span;let n=0,r=this.count;if(r instanceof s&&(r=r.decode(e,t)),0<this.elementLayout.span)n=r*this.elementLayout.span;else{let i=0;for(;i<r;)n+=this.elementLayout.getSpan(e,t+n),++i}return n}decode(e,t=0){let n=[],r=0,i=this.count;for(i instanceof s&&(i=i.decode(e,t));r<i;)n.push(this.elementLayout.decode(e,t)),t+=this.elementLayout.getSpan(e,t),r+=1;return n}encode(e,t,n=0){let r=this.elementLayout,i=e.reduce((e,i)=>e+r.encode(i,t,n+e),0);return this.count instanceof s&&this.count.encode(e.length,t,n),i}};e.Sequence=S;var C=class extends i{constructor(e,t,n){if(!(Array.isArray(e)&&e.reduce((e,t)=>e&&t instanceof i,!0)))throw TypeError(`fields must be array of Layout instances`);typeof t==`boolean`&&n===void 0&&(n=t,t=void 0);for(let t of e)if(0>t.span&&t.property===void 0)throw Error(`fields cannot contain unnamed variable-length layout`);let r=-1;try{r=e.reduce((e,t)=>e+t.getSpan(),0)}catch{}super(r,t),this.fields=e,this.decodePrefixes=!!n}getSpan(e,t=0){if(0<=this.span)return this.span;let n=0;try{n=this.fields.reduce((n,r)=>{let i=r.getSpan(e,t);return t+=i,n+i},0)}catch{throw RangeError(`indeterminate span`)}return n}decode(e,t=0){n(e);let r=this.makeDestinationObject();for(let n of this.fields)if(n.property!==void 0&&(r[n.property]=n.decode(e,t)),t+=n.getSpan(e,t),this.decodePrefixes&&e.length===t)break;return r}encode(e,t,n=0){let r=n,i=0,a=0;for(let r of this.fields){let o=r.span;if(a=0<o?o:0,r.property!==void 0){let i=e[r.property];i!==void 0&&(a=r.encode(i,t,n),0>o&&(o=r.getSpan(t,n)))}i=n,n+=o}return i+a-r}fromArray(e){let t=this.makeDestinationObject();for(let n of this.fields)n.property!==void 0&&0<e.length&&(t[n.property]=e.shift());return t}layoutFor(e){if(typeof e!=`string`)throw TypeError(`property must be string`);for(let t of this.fields)if(t.property===e)return t}offsetOf(e){if(typeof e!=`string`)throw TypeError(`property must be string`);let t=0;for(let n of this.fields){if(n.property===e)return t;0>n.span?t=-1:0<=t&&(t+=n.span)}}};e.Structure=C;var w=class{constructor(e){this.property=e}decode(e,t){throw Error(`UnionDiscriminator is abstract`)}encode(e,t,n){throw Error(`UnionDiscriminator is abstract`)}};e.UnionDiscriminator=w;var T=class extends w{constructor(e,t){if(!(e instanceof s&&e.isCount()))throw TypeError(`layout must be an unsigned integer ExternalLayout`);super(t||e.property||`variant`),this.layout=e}decode(e,t){return this.layout.decode(e,t)}encode(e,t,n){return this.layout.encode(e,t,n)}};e.UnionLayoutDiscriminator=T;var E=class extends i{constructor(e,t,n){let r;if(e instanceof u||e instanceof d)r=new T(new l(e));else if(e instanceof s&&e.isCount())r=new T(e);else if(e instanceof w)r=e;else throw TypeError(`discr must be a UnionDiscriminator or an unsigned integer layout`);if(t===void 0&&(t=null),!(t===null||t instanceof i))throw TypeError(`defaultLayout must be null or a Layout`);if(t!==null){if(0>t.span)throw Error(`defaultLayout must have constant span`);t.property===void 0&&(t=t.replicate(`content`))}let a=-1;t&&(a=t.span,0<=a&&(e instanceof u||e instanceof d)&&(a+=r.layout.span)),super(a,n),this.discriminator=r,this.usesPrefixDiscriminator=e instanceof u||e instanceof d,this.defaultLayout=t,this.registry={};let o=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(e){return o(e)},this.configGetSourceVariant=function(e){o=e.bind(this)}}getSpan(e,t=0){if(0<=this.span)return this.span;let n=this.getVariant(e,t);if(!n)throw Error(`unable to determine span for unrecognized variant`);return n.getSpan(e,t)}defaultGetSourceVariant(e){if(Object.prototype.hasOwnProperty.call(e,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(e,this.defaultLayout.property))return;let t=this.registry[e[this.discriminator.property]];if(t&&(!t.layout||t.property&&Object.prototype.hasOwnProperty.call(e,t.property)))return t}else for(let t in this.registry){let n=this.registry[t];if(n.property&&Object.prototype.hasOwnProperty.call(e,n.property))return n}throw Error(`unable to infer src variant`)}decode(e,t=0){let n,r=this.discriminator,i=r.decode(e,t),a=this.registry[i];if(a===void 0){let a=this.defaultLayout,o=0;this.usesPrefixDiscriminator&&(o=r.layout.span),n=this.makeDestinationObject(),n[r.property]=i,n[a.property]=a.decode(e,t+o)}else n=a.decode(e,t);return n}encode(e,t,n=0){let r=this.getSourceVariant(e);if(r===void 0){let r=this.discriminator,i=this.defaultLayout,a=0;return this.usesPrefixDiscriminator&&(a=r.layout.span),r.encode(e[r.property],t,n),a+i.encode(e[i.property],t,n+a)}return r.encode(e,t,n)}addVariant(e,t,n){let r=new ie(this,e,t,n);return this.registry[e]=r,r}getVariant(e,t=0){let n;return n=e instanceof Uint8Array?this.discriminator.decode(e,t):e,this.registry[n]}};e.Union=E;var ie=class extends i{constructor(e,t,n,r){if(!(e instanceof E))throw TypeError(`union must be a Union`);if(!Number.isInteger(t)||0>t)throw TypeError(`variant must be a (non-negative) integer`);if(typeof n==`string`&&r===void 0&&(r=n,n=null),n){if(!(n instanceof i))throw TypeError(`layout must be a Layout`);if(e.defaultLayout!==null&&0<=n.span&&n.span>e.defaultLayout.span)throw Error(`variant span exceeds span of containing union`);if(typeof r!=`string`)throw TypeError(`variant must have a String property`)}let a=e.span;0>e.span&&(a=n?n.span:0,0<=a&&e.usesPrefixDiscriminator&&(a+=e.discriminator.layout.span)),super(a,r),this.union=e,this.variant=t,this.layout=n||null}getSpan(e,t=0){if(0<=this.span)return this.span;let n=0;this.union.usesPrefixDiscriminator&&(n=this.union.discriminator.layout.span);let r=0;return this.layout&&(r=this.layout.getSpan(e,t+n)),n+r}decode(e,t=0){let n=this.makeDestinationObject();if(this!==this.union.getVariant(e,t))throw Error(`variant mismatch`);let r=0;return this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout?n[this.property]=this.layout.decode(e,t+r):this.property?n[this.property]=!0:this.union.usesPrefixDiscriminator&&(n[this.union.discriminator.property]=this.variant),n}encode(e,t,n=0){let r=0;if(this.union.usesPrefixDiscriminator&&(r=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(e,this.property))throw TypeError(`variant lacks property `+this.property);this.union.discriminator.encode(this.variant,t,n);let i=r;if(this.layout&&(this.layout.encode(e[this.property],t,n+r),i+=this.layout.getSpan(t,n+r),0<=this.union.span&&i>this.union.span))throw Error(`encoded variant overruns containing union`);return i}fromArray(e){if(this.layout)return this.layout.fromArray(e)}};e.VariantLayout=ie;function ae(e){return 0>e&&(e+=4294967296),e}var oe=class extends i{constructor(e,t,n){if(!(e instanceof u||e instanceof d))throw TypeError(`word must be a UInt or UIntBE layout`);if(typeof t==`string`&&n===void 0&&(n=t,t=!1),4<e.span)throw RangeError(`word cannot exceed 32 bits`);super(e.span,n),this.word=e,this.msb=!!t,this.fields=[];let r=0;this._packedSetValue=function(e){return r=ae(e),this},this._packedGetValue=function(){return r}}decode(e,t=0){let n=this.makeDestinationObject(),r=this.word.decode(e,t);this._packedSetValue(r);for(let t of this.fields)t.property!==void 0&&(n[t.property]=t.decode(e));return n}encode(e,t,n=0){let r=this.word.decode(t,n);this._packedSetValue(r);for(let t of this.fields)if(t.property!==void 0){let n=e[t.property];n!==void 0&&t.encode(n)}return this.word.encode(this._packedGetValue(),t,n)}addField(e,t){let n=new D(this,e,t);return this.fields.push(n),n}addBoolean(e){let t=new se(this,e);return this.fields.push(t),t}fieldFor(e){if(typeof e!=`string`)throw TypeError(`property must be string`);for(let t of this.fields)if(t.property===e)return t}};e.BitStructure=oe;var D=class{constructor(e,t,n){if(!(e instanceof oe))throw TypeError(`container must be a BitStructure`);if(!Number.isInteger(t)||0>=t)throw TypeError(`bits must be positive integer`);let r=8*e.span,i=e.fields.reduce((e,t)=>e+t.bits,0);if(t+i>r)throw Error(`bits too long for span remainder (`+(r-i)+` of `+r+` remain)`);this.container=e,this.bits=t,this.valueMask=(1<<t)-1,t===32&&(this.valueMask=4294967295),this.start=i,this.container.msb&&(this.start=r-i-t),this.wordMask=ae(this.valueMask<<this.start),this.property=n}decode(e,t){return ae(this.container._packedGetValue()&this.wordMask)>>>this.start}encode(e){if(typeof e!=`number`||!Number.isInteger(e)||e!==ae(e&this.valueMask))throw TypeError(a(`BitField.encode`,this)+` value must be integer not exceeding `+this.valueMask);let t=this.container._packedGetValue(),n=ae(e<<this.start);this.container._packedSetValue(ae(t&~this.wordMask)|n)}};e.BitField=D;var se=class extends D{constructor(e,t){super(e,1,t)}decode(e,t){return!!super.decode(e,t)}encode(e){typeof e==`boolean`&&(e=+e),super.encode(e)}};e.Boolean=se;var ce=class extends i{constructor(e,t){if(!(e instanceof s&&e.isCount()||Number.isInteger(e)&&0<=e))throw TypeError(`length must be positive integer or an unsigned integer ExternalLayout`);let n=-1;e instanceof s||(n=e),super(n,t),this.length=e}getSpan(e,t){let n=this.span;return 0>n&&(n=this.length.decode(e,t)),n}decode(e,t=0){let n=this.span;return 0>n&&(n=this.length.decode(e,t)),r(e).slice(t,t+n)}encode(e,t,n){let i=this.length;if(this.length instanceof s&&(i=e.length),!(e instanceof Uint8Array&&i===e.length))throw TypeError(a(`Blob.encode`,this)+` requires (length `+i+`) Uint8Array as src`);if(n+i>t.length)throw RangeError(`encoding overruns Uint8Array`);let o=r(e);return r(t).write(o.toString(`hex`),n,i,`hex`),this.length instanceof s&&this.length.encode(i,t,n),i}};e.Blob=ce;var le=class extends i{constructor(e){super(-1,e)}getSpan(e,t=0){n(e);let r=t;for(;r<e.length&&e[r]!==0;)r+=1;return 1+r-t}decode(e,t=0){let n=this.getSpan(e,t);return r(e).slice(t,t+n-1).toString(`utf-8`)}encode(e,n,i=0){typeof e!=`string`&&(e=String(e));let a=t.Buffer.from(e,`utf8`),o=a.length;if(i+o>n.length)throw RangeError(`encoding overruns Buffer`);let s=r(n);return a.copy(s,i),s[i+o]=0,o+1}};e.CString=le;var ue=class extends i{constructor(e,t){if(typeof e==`string`&&t===void 0&&(t=e,e=void 0),e===void 0)e=-1;else if(!Number.isInteger(e))throw TypeError(`maxSpan must be an integer`);super(-1,t),this.maxSpan=e}getSpan(e,t=0){return n(e),e.length-t}decode(e,t=0){let n=this.getSpan(e,t);if(0<=this.maxSpan&&this.maxSpan<n)throw RangeError(`text length exceeds maxSpan`);return r(e).slice(t,t+n).toString(`utf-8`)}encode(e,n,i=0){typeof e!=`string`&&(e=String(e));let a=t.Buffer.from(e,`utf8`),o=a.length;if(0<=this.maxSpan&&this.maxSpan<o)throw RangeError(`text length exceeds maxSpan`);if(i+o>n.length)throw RangeError(`encoding overruns Buffer`);return a.copy(r(n),i),o}};e.UTF8=ue;var de=class extends i{constructor(e,t){super(0,t),this.value=e}decode(e,t){return this.value}encode(e,t,n){return 0}};e.Constant=de,e.greedy=((e,t)=>new c(e,t)),e.offset=((e,t,n)=>new l(e,t,n)),e.u8=(e=>new u(1,e)),e.u16=(e=>new u(2,e)),e.u24=(e=>new u(3,e)),e.u32=(e=>new u(4,e)),e.u40=(e=>new u(5,e)),e.u48=(e=>new u(6,e)),e.nu64=(e=>new _(e)),e.u16be=(e=>new d(2,e)),e.u24be=(e=>new d(3,e)),e.u32be=(e=>new d(4,e)),e.u40be=(e=>new d(5,e)),e.u48be=(e=>new d(6,e)),e.nu64be=(e=>new v(e)),e.s8=(e=>new f(1,e)),e.s16=(e=>new f(2,e)),e.s24=(e=>new f(3,e)),e.s32=(e=>new f(4,e)),e.s40=(e=>new f(5,e)),e.s48=(e=>new f(6,e)),e.ns64=(e=>new y(e)),e.s16be=(e=>new p(2,e)),e.s24be=(e=>new p(3,e)),e.s32be=(e=>new p(4,e)),e.s40be=(e=>new p(5,e)),e.s48be=(e=>new p(6,e)),e.ns64be=(e=>new ee(e)),e.f32=(e=>new te(e)),e.f32be=(e=>new re(e)),e.f64=(e=>new b(e)),e.f64be=(e=>new x(e)),e.struct=((e,t,n)=>new C(e,t,n)),e.bits=((e,t,n)=>new oe(e,t,n)),e.seq=((e,t,n)=>new S(e,t,n)),e.union=((e,t,n)=>new E(e,t,n)),e.unionLayoutDiscriminator=((e,t)=>new T(e,t)),e.blob=((e,t)=>new ce(e,t)),e.cstr=(e=>new le(e)),e.utf8=((e,t)=>new ue(e,t)),e.constant=((e,t)=>new de(e,t))}));function en(e){return Array.isArray(e)?`%5B`+e.map(en).join(`%2C%20`)+`%5D`:typeof e==`bigint`?`${e}n`:encodeURIComponent(String(e!=null&&Object.getPrototypeOf(e)===null?{...e}:e))}function tn([e,t]){return`${e}=${en(t)}`}function nn(e){let t=Object.entries(e).map(tn).join(`&`);return btoa(t)}function rn(e,t={}){let n=so[e];if(n.length===0)return``;let r;function i(e){if(r[lo]===2){let i=n.slice(r[co]+1,e);a.push(i in t?`${t[i]}`:`$${i}`)}else r[lo]===1&&a.push(n.slice(r[co],e))}let a=[];return n.split(``).forEach((e,t)=>{if(t===0){r={[co]:0,[lo]:n[0]===`\\`?0:n[0]===`$`?2:1};return}let a;switch(r[lo]){case 0:a={[co]:t,[lo]:1};break;case 1:e===`\\`?a={[co]:t,[lo]:0}:e===`$`&&(a={[co]:t,[lo]:2});break;case 2:e===`\\`?a={[co]:t,[lo]:0}:e===`$`?a={[co]:t,[lo]:2}:e.match(/\w/)||(a={[co]:t,[lo]:1})}a&&(r!==a&&i(t),r=a)}),i(),a.join(``)}function an(e,t={}){if(a.env.NODE_ENV!==`production`)return rn(e,t);{let n=`Solana error #${e}; Decode this error by running \`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(n+=` '${nn(t)}'`),`${n}\``}}var on,sn,cn,ln,un,dn,fn,pn,mn,hn,gn,_n,vn,yn,bn,xn,Sn,Cn,wn,Tn,En,Dn,On,kn,An,jn,Mn,Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn,Zn,Qn,$n,er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr,fr,pr,mr,hr,gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi,mi,hi,gi,_i,vi,yi,bi,xi,Si,Ci,wi,Ti,Ei,Di,Oi,ki,Ai,ji,Mi,Ni,Pi,Fi,Ii,Li,Ri,zi,Bi,Vi,Hi,Ui,Wi,Gi,Ki,qi,Ji,Yi,Xi,Zi,Qi,$i,ea,ta,na,ra,ia,aa,oa,sa,ca,la,ua,da,fa,pa,ma,ha,ga,_a,va,ya,ba,xa,Sa,Ca,wa,Ta,Ea,Da,Oa,ka,Aa,ja,Ma,Na,Pa,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua,Wa,Ga,Ka,qa,Ja,Ya,Xa,Za,Qa,$a,eo,to,no,ro,io,ao,oo,so,co,lo,uo,fo=e((()=>{o(),on=-32700,sn=-32603,cn=-32602,ln=-32601,un=-32600,dn=-32016,fn=-32015,pn=-32014,mn=-32013,hn=-32012,gn=-32011,_n=-32010,vn=-32009,yn=-32008,bn=-32007,xn=-32006,Sn=-32005,Cn=-32004,wn=-32003,Tn=-32002,En=-32001,Dn=28e5,On=2800001,kn=2800002,An=2800003,jn=2800004,Mn=2800005,Nn=2800006,Pn=2800007,Fn=2800008,In=2800009,Ln=2800010,Rn=2800011,zn=323e4,Bn=32300001,Vn=3230002,Hn=3230003,Un=3230004,Wn=361e4,Gn=3610001,Kn=3610002,qn=3610003,Jn=3610004,Yn=3610005,Xn=3610006,Zn=3610007,Qn=3611e3,$n=3704e3,er=3704001,tr=3704002,nr=3704003,rr=3704004,ir=4128e3,ar=4128001,or=4128002,sr=4615e3,cr=4615001,lr=4615002,ur=4615003,dr=4615004,fr=4615005,pr=4615006,mr=4615007,hr=4615008,gr=4615009,_r=4615010,vr=4615011,yr=4615012,br=4615013,xr=4615014,Sr=4615015,Cr=4615016,wr=4615017,Tr=4615018,Er=4615019,Dr=4615020,Or=4615021,kr=4615022,Ar=4615023,jr=4615024,Mr=4615025,Nr=4615026,Pr=4615027,Fr=4615028,Ir=4615029,Lr=4615030,Rr=4615031,zr=4615032,Br=4615033,Vr=4615034,Hr=4615035,Ur=4615036,Wr=4615037,Gr=4615038,Kr=4615039,qr=4615040,Jr=4615041,Yr=4615042,Xr=4615043,Zr=4615044,Qr=4615045,$r=4615046,ei=4615047,ti=4615048,ni=4615049,ri=4615050,ii=4615051,ai=4615052,oi=4615053,si=4615054,ci=5508e3,li=5508001,ui=5508002,di=5508003,fi=5508004,pi=5508005,mi=5508006,hi=5508007,gi=5508008,_i=5508009,vi=5508010,yi=5508011,bi=5663e3,xi=5663001,Si=5663002,Ci=5663003,wi=5663004,Ti=5663005,Ei=5663006,Di=5663007,Oi=5663008,ki=5663009,Ai=5663010,ji=5663011,Mi=5663012,Ni=5663013,Pi=5663014,Fi=5663015,Ii=5663016,Li=5663017,Ri=5663018,zi=5663019,Bi=5663020,Vi=705e4,Hi=7050001,Ui=7050002,Wi=7050003,Gi=7050004,Ki=7050005,qi=7050006,Ji=7050007,Yi=7050008,Xi=7050009,Zi=7050010,Qi=7050011,$i=7050012,ea=7050013,ta=7050014,na=7050015,ra=7050016,ia=7050017,aa=7050018,oa=7050019,sa=7050020,ca=7050021,la=7050022,ua=7050023,da=7050024,fa=7050025,pa=7050026,ma=7050027,ha=7050028,ga=7050029,_a=7050030,va=7050031,ya=7050032,ba=7050033,xa=7050034,Sa=7050035,Ca=7050036,wa=8078e3,Ta=8078001,Ea=8078002,Da=8078003,Oa=8078004,ka=8078005,Aa=8078006,ja=8078007,Ma=8078008,Na=8078009,Pa=8078010,Fa=8078011,Ia=8078012,La=8078013,Ra=8078014,za=8078015,Ba=8078016,Va=8078017,Ha=8078018,Ua=8078019,Wa=8078020,Ga=8078021,Ka=8078022,qa=81e5,Ja=8100001,Ya=8100002,Xa=8100003,Za=819e4,Qa=8190001,$a=8190002,eo=8190003,to=8190004,no=99e5,ro=9900001,io=9900002,ao=9900003,oo=9900004,so={[zn]:`Account not found at address: $address`,[Un]:`Not all accounts were decoded. Encoded accounts found at addresses: $addresses.`,[Hn]:`Expected decoded account at address: $address`,[Vn]:`Failed to decode account data at address: $address`,[Bn]:`Accounts not found at addresses: $addresses`,[In]:`Unable to find a viable program address bump seed.`,[kn]:`$putativeAddress is not a base58-encoded address.`,[Dn]:`Expected base58 encoded address to decode to a byte array of length 32. Actual length: $actualLength.`,[An]:"The `CryptoKey` must be an `Ed25519` public key.",[Rn]:`$putativeOffCurveAddress is not a base58-encoded off-curve address.`,[Fn]:`Invalid seeds; point must fall off the Ed25519 curve.`,[jn]:`Expected given program derived address to have the following format: [Address, ProgramDerivedAddressBump].`,[Nn]:`A maximum of $maxSeeds seeds, including the bump seed, may be supplied when creating an address. Received: $actual.`,[Pn]:`The seed at index $index with length $actual exceeds the maximum length of $maxSeedLength bytes.`,[Mn]:`Expected program derived address bump to be in the range [0, 255], got: $bump.`,[Ln]:`Program address cannot end with PDA marker.`,[On]:`Expected base58-encoded address string of length in the range [32, 44]. Actual length: $actualLength.`,4:`Expected base58-encoded blockash string of length in the range [32, 44]. Actual length: $actualLength.`,1:`The network has progressed past the last block for which this transaction could have been committed.`,[wa]:`Codec [$codecDescription] cannot decode empty byte arrays.`,[Ka]:"Enum codec cannot use lexical values [$stringValues] as discriminators. Either remove all lexical values or set `useValuesAsDiscriminators` to `false`.",[Wa]:`Sentinel [$hexSentinel] must not be present in encoded bytes [$hexEncodedBytes].`,[ka]:`Encoder and decoder must have the same fixed size, got [$encoderFixedSize] and [$decoderFixedSize].`,[Aa]:`Encoder and decoder must have the same max size, got [$encoderMaxSize] and [$decoderMaxSize].`,[Oa]:`Encoder and decoder must either both be fixed-size or variable-size.`,[Ma]:`Enum discriminator out of range. Expected a number in [$formattedValidDiscriminators], got $discriminator.`,[Ea]:`Expected a fixed-size codec, got a variable-size one.`,[La]:`Codec [$codecDescription] expected a positive byte length, got $bytesLength.`,[Da]:`Expected a variable-size codec, got a fixed-size one.`,[Ua]:`Codec [$codecDescription] expected zero-value [$hexZeroValue] to have the same size as the provided fixed-size item [$expectedSize bytes].`,[Ta]:`Codec [$codecDescription] expected $expected bytes, got $bytesLength.`,[Ha]:`Expected byte array constant [$hexConstant] to be present in data [$hexData] at offset [$offset].`,[Na]:`Invalid discriminated union variant. Expected one of [$variants], got $value.`,[Pa]:`Invalid enum variant. Expected one of [$stringValues] or a number in [$formattedNumericalValues], got $variant.`,[za]:`Invalid literal union variant. Expected one of [$variants], got $value.`,[ja]:`Expected [$codecDescription] to have $expected items, got $actual.`,[Ia]:`Invalid value $value for base $base with alphabet $alphabet.`,[Ba]:`Literal union discriminator out of range. Expected a number between $minRange and $maxRange, got $discriminator.`,[Fa]:`Codec [$codecDescription] expected number to be in the range [$min, $max], got $value.`,[Ra]:`Codec [$codecDescription] expected offset to be in the range [0, $bytesLength], got $offset.`,[Ga]:`Expected sentinel [$hexSentinel] to be present in decoded bytes [$hexDecodedBytes].`,[Va]:`Union variant out of range. Expected an index between $minRange and $maxRange, got $variant.`,[Qn]:`No random values implementation could be found.`,[gr]:`instruction requires an uninitialized account`,[Ar]:`instruction tries to borrow reference for an account which is already borrowed`,[jr]:`instruction left account with an outstanding borrowed reference`,[Or]:`program other than the account's owner changed the size of the account data`,[fr]:`account data too small for instruction`,[kr]:`instruction expected an executable account`,[$r]:`An account does not have enough lamports to be rent-exempt`,[ti]:`Program arithmetic overflowed`,[Qr]:`Failed to serialize or deserialize account data: $encodedData`,[si]:`Builtin programs must consume compute units`,[zr]:`Cross-program invocation call depth too deep`,[Gr]:`Computational budget exceeded`,[Nr]:`custom program error: #$code`,[wr]:`instruction contains duplicate accounts`,[Mr]:`instruction modifications of multiply-passed account differ`,[Lr]:`executable accounts must be rent exempt`,[Fr]:`instruction changed executable accounts data`,[Ir]:`instruction changed the balance of an executable account`,[Tr]:`instruction changed executable bit of an account`,[xr]:`instruction modified data of an account it does not own`,[br]:`instruction spent from the balance of an account it does not own`,[cr]:`generic instruction error`,[ri]:`Provided owner is not allowed`,[Xr]:`Account is immutable`,[Zr]:`Incorrect authority provided`,[mr]:`incorrect program id for instruction`,[pr]:`insufficient funds for instruction`,[dr]:`invalid account data for instruction`,[ei]:`Invalid account owner`,[lr]:`invalid program argument`,[Pr]:`program returned invalid error code`,[ur]:`invalid instruction data`,[Wr]:`Failed to reallocate account data`,[Ur]:`Provided seeds do not result in a valid address`,[ii]:`Accounts data allocations exceeded the maximum allowed per transaction`,[ai]:`Max accounts exceeded`,[oi]:`Max instruction trace length exceeded`,[Hr]:`Length of the seed is too long for address generation`,[Br]:`An account required by the instruction is missing`,[hr]:`missing required signature for instruction`,[yr]:`instruction illegally modified the program id of an account`,[Dr]:`insufficient account keys for instruction`,[Kr]:`Cross-program invocation with unauthorized signer or writable account`,[qr]:`Failed to create program execution environment`,[Yr]:`Program failed to compile`,[Jr]:`Program failed to complete`,[Cr]:`instruction modified data of a read-only account`,[Sr]:`instruction changed the balance of a read-only account`,[Vr]:`Cross-program invocation reentrancy not allowed for this instruction`,[Er]:`instruction modified rent epoch of an account`,[vr]:`sum of account balances before and after instruction do not match`,[_r]:`instruction requires an initialized account`,[sr]:``,[Rr]:`Unsupported program id`,[ni]:`Unsupported sysvar`,[ir]:`The instruction does not have any accounts.`,[ar]:`The instruction does not have any data.`,[or]:`Expected instruction to have progress address $expectedProgramAddress, got $actualProgramAddress.`,5:`Expected base58 encoded blockhash to decode to a byte array of length 32. Actual length: $actualLength.`,2:"The nonce `$expectedNonceValue` is no longer valid. It has advanced to `$actualNonceValue`",[io]:"Invariant violation: Found no abortable iterable cache entry for key `$cacheKey`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[oo]:"Invariant violation: This data publisher does not publish to the channel named `$channelName`. Supported channels include $supportedChannelNames.",[ro]:`Invariant violation: WebSocket message iterator state is corrupt; iterated without first resolving existing message promise. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant`,[no]:`Invariant violation: WebSocket message iterator is missing state storage. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant`,[ao]:"Invariant violation: Switch statement non-exhaustive. Received unexpected value `$unexpectedValue`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[sn]:`JSON-RPC error: Internal JSON-RPC error ($__serverMessage)`,[cn]:`JSON-RPC error: Invalid method parameter(s) ($__serverMessage)`,[un]:"JSON-RPC error: The JSON sent is not a valid `Request` object ($__serverMessage)",[ln]:`JSON-RPC error: The method does not exist / is not available ($__serverMessage)`,[on]:`JSON-RPC error: An error occurred on the server while parsing the JSON text ($__serverMessage)`,[hn]:`$__serverMessage`,[En]:`$__serverMessage`,[Cn]:`$__serverMessage`,[pn]:`$__serverMessage`,[_n]:`$__serverMessage`,[vn]:`$__serverMessage`,[dn]:`Minimum context slot has not been reached`,[Sn]:`Node is unhealthy; behind by $numSlotsBehind slots`,[yn]:`No snapshot`,[Tn]:`Transaction simulation failed`,[bn]:`$__serverMessage`,[gn]:`Transaction history is not available from this node`,[xn]:`$__serverMessage`,[mn]:`Transaction signature length mismatch`,[wn]:`Transaction signature verification failure`,[fn]:`$__serverMessage`,[$n]:`Key pair bytes must be of length 64, got $byteLength.`,[er]:`Expected private key bytes with length 32. Actual length: $actualLength.`,[tr]:`Expected base58-encoded signature to decode to a byte array of length 64. Actual length: $actualLength.`,[rr]:`The provided private key does not match the provided public key.`,[nr]:`Expected base58-encoded signature string of length in the range [64, 88]. Actual length: $actualLength.`,6:`Lamports value must be in the range [0, 2e64-1]`,7:"`$value` cannot be parsed as a `BigInt`",10:`$message`,8:"`$value` cannot be parsed as a `Number`",3:"No nonce account could be found at address `$nonceAccountAddress`",[Za]:`The notification name must end in 'Notifications' and the API must supply a subscription plan creator function for the notification '$notificationName'.`,[$a]:`WebSocket was closed before payload could be added to the send buffer`,[eo]:`WebSocket connection closed`,[to]:`WebSocket failed to connect`,[Qa]:`Failed to obtain a subscription id from the server`,[Xa]:"Could not find an API plan for RPC method: `$method`",[qa]:"The $argumentLabel argument to the `$methodName` RPC method$optionalPathLabel was `$value`. This number is unsafe for use with the Solana JSON-RPC because it exceeds `Number.MAX_SAFE_INTEGER`.",[Ya]:`HTTP error ($statusCode): $message`,[Ja]:`HTTP header(s) forbidden: $headers. Learn more at https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name.`,[ci]:"Multiple distinct signers were identified for address `$address`. Please ensure that you are using the same signer instance for each address.",[li]:"The provided value does not implement the `KeyPairSigner` interface",[di]:"The provided value does not implement the `MessageModifyingSigner` interface",[fi]:"The provided value does not implement the `MessagePartialSigner` interface",[ui]:"The provided value does not implement any of the `MessageSigner` interfaces",[mi]:"The provided value does not implement the `TransactionModifyingSigner` interface",[hi]:"The provided value does not implement the `TransactionPartialSigner` interface",[gi]:"The provided value does not implement the `TransactionSendingSigner` interface",[pi]:"The provided value does not implement any of the `TransactionSigner` interfaces",[_i]:"More than one `TransactionSendingSigner` was identified.",[vi]:"No `TransactionSendingSigner` was identified. Please provide a valid `TransactionWithSingleSendingSigner` transaction.",[yi]:`Wallet account signers do not support signing multiple messages/transactions in a single operation`,[Zn]:`Cannot export a non-extractable key.`,[Gn]:`No digest implementation could be found.`,[Wn]:`Cryptographic operations are only allowed in secure browser contexts. Read more here: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts.`,[Kn]:`This runtime does not support the generation of Ed25519 key pairs.
2
2
 
3
3
  Install @solana/webcrypto-ed25519-polyfill and call its \`install\` function before generating keys in environments that do not support Ed25519.
4
4