1var ti=Object.defineProperty;var ni=(e,t,n)=>t in e?ti(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var we=(e,t,n)=>ni(e,typeof t!="symbol"?t+"":t,n);import{be as S,bf as se,bg as w,bh as m,bi as y,bj as Q,bk as A,bl as p,bm as W,bn as Yt,bo as ze,bp as Ee,bq as ri,br as At,bs as Ce,bt as _n,bu as ii,bv as pt,bw as Bt}from"./index-DlUOkP_D.js";const h=new S("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),b=new S("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"),O=new S("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),ai=new S("So11111111111111111111111111111111111111112"),xn=new S("9pan9bMn5HatX4EJdBwg9VgCa7Uz5HL8N1m5D3NdXejP");function x(e){return!e.equals(h)}const Ft=e=>{const t=e.decode.bind(e),n=e.encode.bind(e);return{decode:t,encode:n}};var Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});function oi(e){{const t=Buffer.from(e);t.reverse();const n=t.toString("hex");return n.length===0?BigInt(0):BigInt(`0x${n}`)}}var si=Ae.toBigIntLE=oi;function ui(e){{const t=e.toString("hex");return t.length===0?BigInt(0):BigInt(`0x${t}`)}}Ae.toBigIntBE=ui;function ci(e,t){{const n=e.toString(16),r=Buffer.from(n.padStart(t*2,"0").slice(0,t*2),"hex");return r.reverse(),r}}var li=Ae.toBufferLE=ci;function fi(e,t){{const n=e.toString(16);return Buffer.from(n.padStart(t*2,"0").slice(0,t*2),"hex")}}Ae.toBufferBE=fi;const di=e=>t=>{const n=se(e,t),{encode:r,decode:i}=Ft(n),a=n;return a.decode=(o,s)=>{const u=i(o,s);return si(Buffer.from(u))},a.encode=(o,s,u)=>{const c=li(o,e);return r(c,s,u)},a},B=di(8),Y=e=>{const t=w(e),{encode:n,decode:r}=Ft(t),i=t;return i.decode=(a,o)=>!!r(a,o),i.encode=(a,o,s)=>{const u=Number(a);return n(u,o,s)},i},k=e=>{const t=se(32,e),{encode:n,decode:r}=Ft(t),i=t;return i.decode=(a,o)=>{const s=r(a,o);return new S(s)},i.encode=(a,o,s)=>{const u=a.toBuffer();return n(u,o,s)},i};class N extends Error{constructor(t){super(t)}}class ue extends N{constructor(){super(...arguments),this.name="TokenAccountNotFoundError"}}class wi extends N{constructor(){super(...arguments),this.name="TokenInvalidAccountError"}}class Gu extends N{constructor(){super(...arguments),this.name="TokenInvalidAccountDataError"}}class kt extends N{constructor(){super(...arguments),this.name="TokenInvalidAccountOwnerError"}}class ie extends N{constructor(){super(...arguments),this.name="TokenInvalidAccountSizeError"}}class Dn extends N{constructor(){super(...arguments),this.name="TokenInvalidMintError"}}class hi extends N{constructor(){super(...arguments),this.name="TokenInvalidOwnerError"}}class Pn extends N{constructor(){super(...arguments),this.name="TokenOwnerOffCurveError"}}class T extends N{constructor(){super(...arguments),this.name="TokenInvalidInstructionProgramError"}}class M extends N{constructor(){super(...arguments),this.name="TokenInvalidInstructionKeysError"}}class C extends N{constructor(){super(...arguments),this.name="TokenInvalidInstructionDataError"}}class E extends N{constructor(){super(...arguments),this.name="TokenInvalidInstructionTypeError"}}class D extends N{constructor(){super(...arguments),this.name="TokenUnsupportedInstructionError"}}class Bn extends N{constructor(){super(...arguments),this.name="TokenTransferHookAccountNotFound"}}class H extends N{constructor(){super(...arguments),this.name="TokenTransferHookInvalidSeed"}}class Fn extends N{constructor(){super(...arguments),this.name="TokenTransferHookAccountDataNotFound"}}class Ut extends N{constructor(){super(...arguments),this.name="TokenTransferHookInvalidPubkeyData"}}class Un extends N{constructor(){super(...arguments),this.name="TokenTransferHookPubkeyDataTooSmall"}}var f;(function(e){e[e.InitializeMint=0]="InitializeMint",e[e.InitializeAccount=1]="InitializeAccount",e[e.InitializeMultisig=2]="InitializeMultisig",e[e.Transfer=3]="Transfer",e[e.Approve=4]="Approve",e[e.Revoke=5]="Revoke",e[e.SetAuthority=6]="SetAuthority",e[e.MintTo=7]="MintTo",e[e.Burn=8]="Burn",e[e.CloseAccount=9]="CloseAccount",e[e.FreezeAccount=10]="FreezeAccount",e[e.ThawAccount=11]="ThawAccount",e[e.TransferChecked=12]="TransferChecked",e[e.ApproveChecked=13]="ApproveChecked",e[e.MintToChecked=14]="MintToChecked",e[e.BurnChecked=15]="BurnChecked",e[e.InitializeAccount2=16]="InitializeAccount2",e[e.SyncNative=17]="SyncNative",e[e.InitializeAccount3=18]="InitializeAccount3",e[e.InitializeMultisig2=19]="InitializeMultisig2",e[e.InitializeMint2=20]="InitializeMint2",e[e.GetAccountDataSize=21]="GetAccountDataSize",e[e.InitializeImmutableOwner=22]="InitializeImmutableOwner",e[e.AmountToUiAmount=23]="Amou
1ntToUiAmount",e[e.UiAmountToAmount=24]="UiAmountToAmount",e[e.InitializeMintCloseAuthority=25]="InitializeMintCloseAuthority",e[e.TransferFeeExtension=26]="TransferFeeExtension",e[e.ConfidentialTransferExtension=27]="ConfidentialTransferExtension",e[e.DefaultAccountStateExtension=28]="DefaultAccountStateExtension",e[e.Reallocate=29]="Reallocate",e[e.MemoTransferExtension=30]="MemoTransferExtension",e[e.CreateNativeMint=31]="CreateNativeMint",e[e.InitializeNonTransferableMint=32]="InitializeNonTransferableMint",e[e.InterestBearingMintExtension=33]="InterestBearingMintExtension",e[e.CpiGuardExtension=34]="CpiGuardExtension",e[e.InitializePermanentDelegate=35]="InitializePermanentDelegate",e[e.TransferHookExtension=36]="TransferHookExtension",e[e.MetadataPointerExtension=39]="MetadataPointerExtension",e[e.GroupPointerExtension=40]="GroupPointerExtension",e[e.GroupMemberPointerExtension=41]="GroupMemberPointerExtension",e[e.ScaledUiAmountExtension=43]="ScaledUiAmountExtension",e[e.PausableExtension=44]="PausableExtension"})(f||(f={}));const Te=m([w("instruction"),B("amount")]);function mi(e,t,n=h){const r=[{pubkey:e,isSigner:!1,isWritable:!1}],i=Buffer.alloc(Te.span);return Te.encode({instruction:f.AmountToUiAmount,amount:BigInt(t)},i),new y({keys:r,programId:n,data:i})}function gi(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==Te.span)throw new C;const{keys:{mint:n},data:r}=yi(e);if(r.instruction!==f.AmountToUiAmount)throw new E;if(!n)throw new M;return{programId:t,keys:{mint:n},data:r}}function yi({programId:e,keys:[t],data:n}){return{programId:e,keys:{mint:t},data:Te.decode(n)}}var Me;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Mint=1]="Mint",e[e.Account=2]="Account"})(Me||(Me={}));const Nt=1,Nn=m([w("m"),w("n"),Y("isInitialized"),k("signer1"),k("signer2"),k("signer3"),k("signer4"),k("signer5"),k("signer6"),k("signer7"),k("signer8"),k("signer9"),k("signer10"),k("signer11")]),ce=Nn.span;async function Ku(e,t,n,r=h){const i=await e.getAccountInfo(t,n);return bi(t,i,r)}function bi(e,t,n=h){if(!t)throw new ue;if(!t.owner.equals(n))throw new kt;if(t.data.length!=ce)throw new ie;const r=Nn.decode(t.data);return{address:e,...r}}async function Ai(e,t){return await e.getMinimumBalanceForRentExemption(ce,t)}var _e;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initialized=1]="Initialized",e[e.Frozen=2]="Frozen"})(_e||(_e={}));const Wn=m([k("mint"),k("owner"),B("amount"),Q("delegateOption"),k("delegate"),w("state"),Q("isNativeOption"),B("isNative"),B("delegatedAmount"),Q("closeAuthorityOption"),k("closeAuthority")]),G=Wn.span;async function Xt(e,t,n,r=h){const i=await e.getAccountInfo(t,n);return vn(t,i,r)}async function Hu(e,t,n,r=h){const i=await e.getMultipleAccountsInfo(t,n);return t.map((a,o)=>vn(a,i[o],r))}async function pi(e,t){return await ki(e,[],t)}async function ki(e,t,n){const r=Er(t);return await e.getMinimumBalanceForRentExemption(r,n)}function vn(e,t,n=h){if(!t)throw new ue;if(!t.owner.equals(n))throw new kt;if(t.data.length<G)throw new ie;const r=Wn.decode(t.data.slice(0,G));let i=Buffer.alloc(0);if(t.data.length>G){if(t.data.length===ce)throw new ie;if(t.data[G]!=Me.Account)throw new wi;i=t.data.slice(G+Nt)}return{address:e,mint:r.mint,owner:r.owner,amount:r.amount,delegate:r.delegateOption?r.delegate:null,delegatedAmount:r.delegatedAmount,isInitialized:r.state!==_e.Uninitialized,isFrozen:r.state===_e.Frozen,isNative:!!r.isNativeOption,rentExemptReserve:r.isNativeOption?r.isNative:null,closeAuthority:r.closeAuthorityOption?r.closeAuthority:null,tlvData:i}}function z(e,t){return e instanceof S?[e,t]:[e.publicKey,[e]]}function _(e,t,n){if(n.length){e.push({pubkey:t,isSigner:!1,isWritable:!1});for(const r of n)e.push({pubkey:r instanceof S?r:r.publicKey,isSigner:!0,isWritable:!1})}else e.push({pubkey:t,isSigner:!0,isWritable:!1});return e}var xe;(function(e){e[e.Enable=0]="Enable",e[e.Disable=1]="Disable"})(xe||(xe={}));const Jt=m([w("instruction"),w("cpiGuardInstruction")]);function Si(e,t,n=[],r=b){return Rn(xe.Enable,e,t,n,r)}function Ii(e,t,n=[],r=b){return Rn(xe.Disable,e,t,n,r)}function Rn(e,t,n,r,i){if(!x(i))throw new D;const a=_([{pubkey:t,isSigner:!1,isWritable:!0}],n,r),o=Buffer.alloc(Jt.span);return Jt.encode({instruction:f.CpiGuardExtension,cpiGuardInstruction:e}
1,o),new y({keys:a,programId:i,data:o})}async function $u(e,t,n,r,i=[],a,o=b){const[s,u]=z(r,i),c=new A().add(Si(n,s,u,o));return await p(e,c,[t,...u],a)}async function qu(e,t,n,r,i=[],a,o=b){const[s,u]=z(r,i),c=new A().add(Ii(n,s,u,o));return await p(e,c,[t,...u],a)}const On=m([Y("lockCpi")]),zi=On.span;function Vu(e){const t=F(l.CpiGuard,e.tlvData);return t!==null?On.decode(t):null}var De;(function(e){e[e.Initialize=0]="Initialize",e[e.Update=1]="Update"})(De||(De={}));const Pe=m([w("instruction"),w("defaultAccountStateInstruction"),w("accountState")]);function Ei(e,t,n=b){if(!x(n))throw new D;const r=[{pubkey:e,isSigner:!1,isWritable:!0}],i=Buffer.alloc(Pe.span);return Pe.encode({instruction:f.DefaultAccountStateExtension,defaultAccountStateInstruction:De.Initialize,accountState:t},i),new y({keys:r,programId:n,data:i})}function Ci(e,t,n,r=[],i=b){if(!x(i))throw new D;const a=_([{pubkey:e,isSigner:!1,isWritable:!0}],n,r),o=Buffer.alloc(Pe.span);return Pe.encode({instruction:f.DefaultAccountStateExtension,defaultAccountStateInstruction:De.Update,accountState:t},o),new y({keys:a,programId:i,data:o})}async function Zu(e,t,n,r,i,a=b){const o=new A().add(Ei(n,r,a));return await p(e,o,[t],i)}async function ju(e,t,n,r,i,a=[],o,s=b){const[u,c]=z(i,a),d=new A().add(Ci(n,r,u,c,s));return await p(e,d,[t,...c],o)}const Ln=m([w("state")]),Ti=Ln.span;function Yu(e){const t=F(l.DefaultAccountState,e.tlvData);return t!==null?Ln.decode(t):null}var Mi=8078e3,_i=8078001,xi=8078004,Di=8078005,Pi=8078006,Bi=8078007,Fi=8078011;function Gn(e){return Array.isArray(e)?"%5B"+e.map(Gn).join("%2C%20")+"%5D":typeof e=="bigint"?`${e}n`:encodeURIComponent(String(e!=null&&Object.getPrototypeOf(e)===null?{...e}:e))}function Ui([e,t]){return`${e}=${Gn(t)}`}function Ni(e){const t=Object.entries(e).map(Ui).join("&");return btoa(t)}function Wi(e,t={}){{let n=`Solana error #${e}; Decode this error by running \`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(n+=` '${Ni(t)}'`),`${n}\``}}var ee=class extends Error{constructor(...[n,r]){let i,a;if(r){const{cause:s,...u}=r;s&&(a={cause:s}),Object.keys(u).length>0&&(i=u)}const o=Wi(n,i);super(o,a);we(this,"cause",this.cause);we(this,"context");this.context={__code:n,...i},this.name="SolanaError"}},vi=(e,t)=>{if(e.length>=t)return e;const n=new Uint8Array(t).fill(0);return n.set(e),n},Ri=(e,t)=>vi(e.length<=t?e:e.slice(0,t),t);function Wt(e,t){return"fixedSize"in t?t.fixedSize:t.getSizeFromValue(e)}function le(e){return Object.freeze({...e,encode:t=>{const n=new Uint8Array(Wt(t,e));return e.write(t,n,0),n}})}function St(e){return Object.freeze({...e,decode:(t,n=0)=>e.read(t,n)[0]})}function K(e){return"fixedSize"in e&&typeof e.fixedSize=="number"}function Oi(e){return!K(e)}function It(e,t){if(K(e)!==K(t))throw new ee(xi);if(K(e)&&K(t)&&e.fixedSize!==t.fixedSize)throw new ee(Di,{decoderFixedSize:t.fixedSize,encoderFixedSize:e.fixedSize});if(!K(e)&&!K(t)&&e.maxSize!==t.maxSize)throw new ee(Pi,{decoderMaxSize:t.maxSize,encoderMaxSize:e.maxSize});return{...t,...e,decode:t.decode,encode:e.encode,read:t.read,write:e.write}}function Li(e,t,n=0){if(t.length-n<=0)throw new ee(Mi,{codecDescription:e})}function Kn(e,t,n,r=0){const i=n.length-r;if(i<t)throw new ee(_i,{bytesLength:i,codecDescription:e,expected:t})}function Hn(e,t){return le({fixedSize:t,write:(n,r,i)=>{const a=e.encode(n),o=a.length>t?a.slice(0,t):a;return r.set(o,i),i+t}})}function Gi(e,t){return St({fixedSize:t,read:(n,r)=>{Kn("fixCodecSize",t,n,r),(r>0||n.length>t)&&(n=n.slice(r,r+t)),K(e)&&(n=Ri(n,e.fixedSize));const[i]=e.read(n,0);return[i,r+t]}})}function Be(e,t){return It(Hn(e,t),Gi(e,t))}function $n(e,t){return le({...Oi(e)?{...e,getSizeFromValue:n=>e.getSizeFromValue(t(n))}:e,write:(n,r,i)=>e.write(t(n),r,i)})}function Ki(e,t,n,r){if(r<t||r>n)throw new ee(Fi,{codecDescription:e,max:n,min:t,value:r})}function qn(e){return(e==null?void 0:e.endian)!==1}function Hi(e){return le({fixedSize:e.size,write(t,n,r){e.range&&Ki(e.name,e.range[0],e.range[1],t);const i=new ArrayBuffer(e.size);return e.set(new DataView(i),t,qn(e.config)),n.set(new Uint8Array(i),r),r+e.size}})}function $i(e){return St({fixedSize:e.size,read(t,n=0){Li(e.name,t,n),Kn(e.name,e.size,t,n);const r=new DataView(qi(t,n,e.size));return[e.get(r,qn(e.config)),n+e.size]}})}
1function qi(e,t,n){const r=e.byteOffset+(t??0),i=n??e.byteLength;return e.buffer.slice(r,r+i)}var vt=(e={})=>Hi({config:e,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(t,n,r)=>t.setBigUint64(0,BigInt(n),r),size:8}),Vi=(e={})=>$i({config:e,get:(t,n)=>t.getBigUint64(0,n),name:"u64",size:8}),Dt=(e={})=>It(vt(e),Vi(e));function Zi(e,t,n){if(t!==n)throw new ee(Bi,{actual:n,codecDescription:e,expected:t})}function ae(e){return e.reduce((t,n)=>t===null||n===null?null:t+n,0)}function Rt(e){return K(e)?e.fixedSize:null}function Ot(e){return K(e)?e.fixedSize:e.maxSize??null}function Lt(){return le({getSizeFromValue:e=>e.length,write:(e,t,n)=>(t.set(e,n),n+e.length)})}function ji(){return St({read:(e,t)=>{const n=e.slice(t);return[n,t+n.length]}})}function Fe(){return It(Lt(),ji())}function Yi(e){const t=ae(e.map(Rt)),n=ae(e.map(Ot))??void 0;return le({...t===null?{getSizeFromValue:r=>e.map((i,a)=>Wt(r[a],i)).reduce((i,a)=>i+a,0),maxSize:n}:{fixedSize:t},write:(r,i,a)=>(Zi("tuple",e.length,r.length),e.forEach((o,s)=>{a=o.write(r[s],i,a)}),a)})}function pe(e){const t=e.map(([,i])=>i),n=ae(t.map(Rt)),r=ae(t.map(Ot))??void 0;return le({...n===null?{getSizeFromValue:i=>e.map(([a,o])=>Wt(i[a],o)).reduce((a,o)=>a+o,0),maxSize:r}:{fixedSize:n},write:(i,a,o)=>(e.forEach(([s,u])=>{o=u.write(i[s],a,o)}),o)})}function Xi(e){const t=e.map(([,i])=>i),n=ae(t.map(Rt)),r=ae(t.map(Ot))??void 0;return St({...n===null?{maxSize:r}:{fixedSize:n},read:(i,a)=>{const o={};return e.forEach(([s,u])=>{const[c,d]=u.read(i,a);a=d,o[s]=c}),[o,a]}})}function Vn(e){return It(pe(e),Xi(e))}function zt(e,t){return $n(Yi([Lt(),t]),n=>[e,n])}function Zn(){return $n(Hn(Lt(),32),e=>e.toBytes())}function jn(e){const{programId:t,group:n,mint:r,mintAuthority:i,updateAuthority:a,maxSize:o}=e;return new y({programId:t,keys:[{isSigner:!1,isWritable:!0,pubkey:n},{isSigner:!1,isWritable:!1,pubkey:r},{isSigner:!0,isWritable:!1,pubkey:i}],data:Buffer.from(zt(new Uint8Array([121,113,108,39,54,51,0,4]),pe([["updateAuthority",Zn()],["maxSize",vt()]])).encode({updateAuthority:a??W.programId,maxSize:o}))})}function Ji(e){const{programId:t,group:n,updateAuthority:r,maxSize:i}=e;return new y({programId:t,keys:[{isSigner:!1,isWritable:!0,pubkey:n},{isSigner:!0,isWritable:!1,pubkey:r}],data:Buffer.from(zt(new Uint8Array([108,37,171,143,248,30,18,110]),pe([["maxSize",vt()]])).encode({maxSize:i}))})}function Qi(e){const{programId:t,group:n,currentAuthority:r,newAuthority:i}=e;return new y({programId:t,keys:[{isSigner:!1,isWritable:!0,pubkey:n},{isSigner:!0,isWritable:!1,pubkey:r}],data:Buffer.from(zt(new Uint8Array([161,105,88,1,237,221,216,203]),pe([["newAuthority",Zn()]])).encode({newAuthority:i??W.programId}))})}function Yn(e){const{programId:t,member:n,memberMint:r,memberMintAuthority:i,group:a,groupUpdateAuthority:o}=e;return new y({programId:t,keys:[{isSigner:!1,isWritable:!0,pubkey:n},{isSigner:!1,isWritable:!1,pubkey:r},{isSigner:!0,isWritable:!1,pubkey:i},{isSigner:!1,isWritable:!0,pubkey:a},{isSigner:!0,isWritable:!1,pubkey:o}],data:Buffer.from(zt(new Uint8Array([152,32,222,176,223,237,116,134]),pe([])).encode({}))})}const Xn=Vn([["updateAuthority",Be(Fe(),32)],["mint",Be(Fe(),32)],["size",Dt()],["maxSize",Dt()]]),Jn=Xn.fixedSize;function ea(e){for(let t=0;t<e.length;t++)if(e[t]!==0)return!1;return!0}function ta(e){const t=Xn.decode(e);return ea(t.updateAuthority)?{mint:new S(t.mint),size:t.size,maxSize:t.maxSize}:{updateAuthority:new S(t.updateAuthority),mint:new S(t.mint),size:t.size,maxSize:t.maxSize}}const Qn=Vn([["mint",Be(Fe(),32)],["group",Be(Fe(),32)],["memberNumber",Dt()]]),er=Qn.fixedSize;function na(e){const t=Qn.decode(e);return{mint:new S(t.mint),group:new S(t.group),memberNumber:t.memberNumber}}async function Ju(e,t,n,r,i,a,o=[],s,u=b){const[c,d]=z(r,o),g=new A().add(jn({programId:u,group:n,mint:n,mintAuthority:c,updateAuthority:i,maxSize:a}));return await p(e,g,[t,...d],s)}async function Qu(e,t,n,r,i,a,o=[],s,u=b){const[c,d]=z(r,o),g=await e.getMinimumBalanceForRentExemption(Jn),I=new A().add(W.transfer({fromPubkey:t.publicKey,toPubkey:n,lamports:g}),jn({programId:u,group:n,mint:n,mintAuthority:c,updateAuthority:i,maxSize:a}));return await p(e,I,[t,...d],s)}async function ec(e,t,n,r,i,a=[],o,s=b){const[u,c]=z(r,a),d=new A().add(Ji({programId:s,group:n,updateAuthority:u,maxSize:i}));return await p(e,d,[t,...c],o)}async function tc(e,t,n,r,i,a=[],o,s=b){const[u,c]=z(r,a),d=new A().add(Qi({programId:s,group:n,currentAuthority:u,newAuthority:i}));return await p(e,d,[t,...c],o)}async function nc(e,t,n,r,i,a,o=[],s,u=b){const[c,d]=z(r,o),g=new A().add(Yn({programId:u,member:n,memberMint:n,memberMintAuthority:c,group:i,groupUpdateAuthority:a}));return await p(e,g,[t,...d],s)}async function rc(e,t,n,r,i,a,o=[],s,u=b){const[c,d]=z(r,o),g=await e.getMinimumBalanceForRentExemption(er),I=new A().add(W.transfer({fromPubkey:t.publicKey,toPubkey:n,lamports:g}),Yn({programId:u,member:n,memberMint:n,memberMintAuthority:c,group:i,groupUpdateAuthority:a}));return await p(e,I,[t,...d],s)}function ic(e){const t=F(l.TokenGroup,e.tlvData);if(t!==null){const{updateAuthority:n,mint:r,size:i,maxSize:a}=ta(t);return{updateAuthority:n!=null&&n.equals(S.default)?void 0:n,mint:r,size:i,maxSize:a}}else return null}function ac(e){const t=F(l.TokenGroupMember,e.tlvData);if(t!==null){const{mint:n,group:r,memberNumber:i}=na(t);return{mint:n,group:r,memberNumber:i}}else return null}const tr=m([k("authority"),k("memberAddress")]),ra=tr.span;function oc(e){const t=F(l.GroupMemberPointer,e.tlvData);if(t!==null){const{authority:n,memberAddress:r}=tr.decode(t);return{authority:n.equals(S.default)?null:n,memberAddress:r.equals(S.default)?null:r}}else return null}const nr=m([k("authority"),k("groupAddress")]),ia=nr.span;function sc(e){const t=F(l.GroupPointer,e.tlvData);if(t!==null){const{authority:n,groupAddress:r}=nr.decode(t);return{authority:n.equals(S.default)?null:n,groupAddress:r.equals(S.default)?null:r}}else return null}const rr=m([]),aa=rr.span;function uc(e){const t=F(l.ImmutableOwner,e.tlvData);return t!==null?rr.decode(t):null}const ir=m([k("rateAuthority"),Yt("initializationTimestamp"),ze("preUpdateAverageRate"),Yt("lastUpdateTimestamp"),ze("currentRate")]),oa=ir.span;function ar(e){const t=F(l.InterestBearingConfig,e.tlvData);return t!==null?ir.decode(t):null}var Ue;(function(e){e[e.Enable=0]="Enable",e[e.Disable=1]="Disable"})(Ue||(Ue={}));
1const Qt=m([w("instruction"),w("memoTransferInstruction")]);function sa(e,t,n=[],r=b){return or(Ue.Enable,e,t,n,r)}function ua(e,t,n=[],r=b){return or(Ue.Disable,e,t,n,r)}function or(e,t,n,r,i){if(!x(i))throw new D;const a=_([{pubkey:t,isSigner:!1,isWritable:!0}],n,r),o=Buffer.alloc(Qt.span);return Qt.encode({instruction:f.MemoTransferExtension,memoTransferInstruction:e},o),new y({keys:a,programId:i,data:o})}async function cc(e,t,n,r,i=[],a,o=b){const[s,u]=z(r,i),c=new A().add(sa(n,s,u,o));return await p(e,c,[t,...u],a)}async function lc(e,t,n,r,i=[],a,o=b){const[s,u]=z(r,i),c=new A().add(ua(n,s,u,o));return await p(e,c,[t,...u],a)}const sr=m([Y("requireIncomingTransferMemos")]),ca=sr.span;function fc(e){const t=F(l.MemoTransfer,e.tlvData);return t!==null?sr.decode(t):null}const ur=m([k("authority"),k("metadataAddress")]),la=ur.span;function dc(e){const t=F(l.MetadataPointer,e.tlvData);if(t!==null){const{authority:n,metadataAddress:r}=ur.decode(t);return{authority:n.equals(S.default)?null:n,metadataAddress:r.equals(S.default)?null:r}}else return null}const cr=m([k("closeAuthority")]),fa=cr.span;function wc(e){const t=F(l.MintCloseAuthority,e.tlvData);return t!==null?cr.decode(t):null}const Et=m([]),da=Et.span,wa=Et.span;function hc(e){const t=F(l.NonTransferable,e.tlvData);return t!==null?Et.decode(t):null}function mc(e){const t=F(l.NonTransferableAccount,e.tlvData);return t!==null?Et.decode(t):null}var ye;(function(e){e[e.Initialize=0]="Initialize",e[e.Pause=1]="Pause",e[e.Resume=2]="Resume"})(ye||(ye={}));const en=m([w("instruction"),w("pausableInstruction"),k("authority")]);function gc(e,t,n=b){if(!x(n))throw new D;const r=[{pubkey:e,isSigner:!1,isWritable:!0}],i=Buffer.alloc(en.span);return en.encode({instruction:f.PausableExtension,pausableInstruction:ye.Initialize,authority:t??S.default},i),new y({keys:r,programId:n,data:i})}const tn=m([w("instruction"),w("pausableInstruction")]);function ha(e,t,n=[],r=b){if(!x(r))throw new D;const i=_([{pubkey:e,isSigner:!1,isWritable:!0}],t,n),a=Buffer.alloc(tn.span);return tn.encode({instruction:f.PausableExtension,pausableInstruction:ye.Pause},a),new y({keys:i,programId:r,data:a})}const nn=m([w("instruction"),w("pausableInstruction")]);function ma(e,t,n=[],r=b){if(!x(r))throw new D;const i=_([{pubkey:e,isSigner:!1,isWritable:!0}],t,n),a=Buffer.alloc(nn.span);return nn.encode({instruction:f.PausableExtension,pausableInstruction:ye.Resume},a),new y({keys:i,programId:r,data:a})}async function yc(e,t,n,r,i=[],a,o=b){const[s,u]=z(r,i),c=new A().add(ha(n,s,i,o));return await p(e,c,[t,...u],a)}async function bc(e,t,n,r,i=[],a,o=b){const[s,u]=z(r,i),c=new A().add(ma(n,s,i,o));return await p(e,c,[t,...u],a)}const lr=m([k("authority"),Y("paused")]),ga=lr.span;function Ac(e){const t=F(l.PausableConfig,e.tlvData);return t!==null?lr.decode(t):null}const fr=m([]),ya=fr.span;function pc(e){const t=F(l.PausableAccount,e.tlvData);return t!==null?fr.decode(t):null}const dr=m([k("delegate")]),ba=dr.span;function kc(e){const t=F(l.PermanentDelegate,e.tlvData);return t!==null?dr.decode(t):null}var Ne;(function(e){e[e.Initialize=0]="Initialize",e[e.UpdateMultiplier=1]="UpdateMultiplier"})(Ne||(Ne={}));const rn=m([w("instruction"),w("scaledUiAmountInstruction"),k("authority"),Ee("multiplier")]);function Sc(e,t,n,r=b){if(!x(r))throw new D;const i=[{pubkey:e,isSigner:!1,isWritable:!0}],a=Buffer.alloc(rn.span);return rn.encode({instruction:f.ScaledUiAmountExtension,scaledUiAmountInstruction:Ne.Initialize,authority:t??S.default,multiplier:n},a),new y({keys:i,programId:r,data:a})}const an=m([w("instruction"),w("scaledUiAmountInstruction"),Ee("multiplier"),B("effectiveTimestamp")]);function Aa(e,t,n,r,i=[],a=b){if(!x(a))throw new D;const o=_([{pubkey:e,isSigner:!1,isWritable:!0}],t,i),s=Buffer.alloc(an.span);return an.encode({instruction:f.ScaledUiAmountExtension,scaledUiAmountInstruction:Ne.UpdateMultiplier,multiplier:n,effectiveTimestamp:r},s),new y({keys:o,programId:a,data:s})}async function Ic(e,t,n,r,i,a,o=[],s,u=b){const[c,d]=z(r,o),g=new A().add(Aa(n,c,i,a,o,u));return await p(e,g,[t,...d],s)}const wr=m([k("authority"),Ee("multiplier"),B("newMultiplierEffectiveTimestamp"),Ee("newMultiplier")]),pa=wr.span;function hr(e){const t=F(l.ScaledUiAmountConfig,e.tlvData);return t!==null?wr.decode(t):null}class oe extends ri{constructor(t){super(-1,t),this.publicKeyLayout=k()}decode(t,n=0){return t[n]===0?null:this.publicKeyLayout.decode(t,n+1)}encode(t,n,r=0){return t===null?(n[r]=0,1):(n[r]=1,this.publicKeyLayout.encode(t,n,r+1),33)}getSpan(t,n=0){if(t)return t[n]===0?1:1+this.publicKeyLayout.span;throw new RangeError("Buffer must be provided")}}var v;(function(e){e[e.InitializeTransferFeeConfig=0]="InitializeTransferFeeConfig",e[e.TransferCheckedWithFee=1]="TransferCheckedWithFee",e[e.WithdrawWithheldTokensFromMint=2]="WithdrawWithheldTokensFromMint",e[e.WithdrawWithheldTokensFromAccounts=3]="WithdrawWithheldTokensFromAccounts",e[e.HarvestWithheldTokensToMint=4]="HarvestWithheldTokensToMint",e[e.SetTransferFee=5]="SetTransferFee"})(v||(v={}));const We=m([w("instruction"),w("transferFeeInstruction"),new oe("transferFeeConfigAuthority"),new oe("withdrawWithheldAuthority"),At("transferFeeBasisPoints"),B("maximumFee")
1]);function zc(e,t,n,r,i,a=b){if(!x(a))throw new D;const o=[{pubkey:e,isSigner:!1,isWritable:!0}],s=Buffer.alloc(78);return We.encode({instruction:f.TransferFeeExtension,transferFeeInstruction:v.InitializeTransferFeeConfig,transferFeeConfigAuthority:t,withdrawWithheldAuthority:n,transferFeeBasisPoints:r,maximumFee:i},s),new y({keys:o,programId:a,data:s.subarray(0,We.getSpan(s))})}function Ec(e,t){if(!e.programId.equals(t))throw new T;if(e.data.length!==We.getSpan(e.data))throw new C;const{keys:{mint:n},data:r}=ka(e);if(r.instruction!==f.TransferFeeExtension||r.transferFeeInstruction!==v.InitializeTransferFeeConfig)throw new E;if(!n)throw new M;return{programId:t,keys:{mint:n},data:r}}function ka({programId:e,keys:[t],data:n}){const{instruction:r,transferFeeInstruction:i,transferFeeConfigAuthority:a,withdrawWithheldAuthority:o,transferFeeBasisPoints:s,maximumFee:u}=We.decode(n);return{programId:e,keys:{mint:t},data:{instruction:r,transferFeeInstruction:i,transferFeeConfigAuthority:a,withdrawWithheldAuthority:o,transferFeeBasisPoints:s,maximumFee:u}}}const ve=m([w("instruction"),w("transferFeeInstruction"),B("amount"),w("decimals"),B("fee")]);function mr(e,t,n,r,i,a,o,s=[],u=b){if(!x(u))throw new D;const c=Buffer.alloc(ve.span);ve.encode({instruction:f.TransferFeeExtension,transferFeeInstruction:v.TransferCheckedWithFee,amount:i,decimals:a,fee:o},c);const d=_([{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!1,isWritable:!0}],r,s);
1return new y({keys:d,programId:u,data:c})}function Cc(e,t){if(!e.programId.equals(t))throw new T;if(e.data.length!==ve.span)throw new C;const{keys:{source:n,mint:r,destination:i,authority:a,signers:o},data:s}=Sa(e);if(s.instruction!==f.TransferFeeExtension||s.transferFeeInstruction!==v.TransferCheckedWithFee)throw new E;if(!r)throw new M;return{programId:t,keys:{source:n,mint:r,destination:i,authority:a,signers:o||null},data:s}}function Sa({programId:e,keys:[t,n,r,i,...a],data:o}){const{instruction:s,transferFeeInstruction:u,amount:c,decimals:d,fee:g}=ve.decode(o);return{programId:e,keys:{source:t,mint:n,destination:r,authority:i,signers:a},data:{instruction:s,transferFeeInstruction:u,amount:c,decimals:d,fee:g}}}const Re=m([w("instruction"),w("transferFeeInstruction")]);function Ia(e,t,n,r=[],i=b){if(!x(i))throw new D;const a=Buffer.alloc(Re.span);Re.encode({instruction:f.TransferFeeExtension,transferFeeInstruction:v.WithdrawWithheldTokensFromMint},a);const o=_([{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!0}],n,r);
1return new y({keys:o,programId:i,data:a})}function Tc(e,t){if(!e.programId.equals(t))throw new T;if(e.data.length!==Re.span)throw new C;const{keys:{mint:n,destination:r,authority:i,signers:a},data:o}=za(e);if(o.instruction!==f.TransferFeeExtension||o.transferFeeInstruction!==v.WithdrawWithheldTokensFromMint)throw new E;if(!n)throw new M;return{programId:t,keys:{mint:n,destination:r,authority:i,signers:a||null},data:o}}function za({programId:e,keys:[t,n,r,...i],data:a}){const{instruction:o,transferFeeInstruction:s}=Re.decode(a);return{programId:e,keys:{mint:t,destination:n,authority:r,signers:i},data:{instruction:o,transferFeeInstruction:s}}}const Oe=m([w("instruction"),w("transferFeeInstruction"),w("numTokenAccounts")]);function Ea(e,t,n,r,i,a=b){if(!x(a))throw new D;const o=Buffer.alloc(Oe.span);Oe.encode({instruction:f.TransferFeeExtension,transferFeeInstruction:v.WithdrawWithheldTokensFromAccounts,numTokenAccounts:i.length},o);const s=_([{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!0}],n,r);for(const u of i)s.push({pubkey:u,isSigner:!1,isWritable:!0});
1return new y({keys:s,programId:a,data:o})}function Mc(e,t){if(!e.programId.equals(t))throw new T;if(e.data.length!==Oe.span)throw new C;const{keys:{mint:n,destination:r,authority:i,signers:a,sources:o},data:s}=Ca(e);if(s.instruction!==f.TransferFeeExtension||s.transferFeeInstruction!==v.WithdrawWithheldTokensFromAccounts)throw new E;if(!n)throw new M;return{programId:t,keys:{mint:n,destination:r,authority:i,signers:a||null,sources:o||null},data:s}}function Ca({programId:e,keys:t,data:n}){const{instruction:r,transferFeeInstruction:i,numTokenAccounts:a}=Oe.decode(n),[o,s,u,c,d]=[t[0],t[1],t[2],t.slice(3,3+a),t.slice(-1*a)];return{programId:e,keys:{mint:o,destination:s,authority:u,signers:c,sources:d},data:{instruction:r,transferFeeInstruction:i,numTokenAccounts:a}}}const Le=m([w("instruction"),w("transferFeeInstruction")]);function Ta(e,t,n=b){if(!x(n))throw new D;const r=Buffer.alloc(Le.span);Le.encode({instruction:f.TransferFeeExtension,transferFeeInstruction:v.HarvestWithheldTokensToMint},r);const i=[];i.push({pubkey:e,isSigner:!1,isWritable:!0});for(const a of t)i.push({pubkey:a,isSigner:!1,isWritable:!0});
1return new y({keys:i,programId:n,data:r})}function _c(e,t){if(!e.programId.equals(t))throw new T;if(e.data.length!==Le.span)throw new C;const{keys:{mint:n,sources:r},data:i}=Ma(e);if(i.instruction!==f.TransferFeeExtension||i.transferFeeInstruction!==v.HarvestWithheldTokensToMint)throw new E;if(!n)throw new M;return{programId:t,keys:{mint:n,sources:r},data:i}}function Ma({programId:e,keys:[t,...n],data:r}){const{instruction:i,transferFeeInstruction:a}=Le.decode(r);return{programId:e,keys:{mint:t,sources:n},data:{instruction:i,transferFeeInstruction:a}}}const Ge=m([w("instruction"),w("transferFeeInstruction"),At("transferFeeBasisPoints"),B("maximumFee")]);function _a(e,t,n,r,i,a=b){if(!x(a))throw new D;const o=Buffer.alloc(Ge.span);Ge.encode({instruction:f.TransferFeeExtension,transferFeeInstruction:v.SetTransferFee,transferFeeBasisPoints:r,maximumFee:i},o);const s=_([{pubkey:e,isSigner:!1,isWritable:!0}],t,n);return new y({keys:s,programId:a,data:o})}function xc(e,t){if(!e.programId.equals(t))throw new T;if(e.data.length!==Ge.span)throw new C;const{keys:{mint:n,authority:r,signers:i},data:a}=xa(e);if(a.instruction!==f.TransferFeeExtension||a.transferFeeInstruction!==v.SetTransferFee)throw new E;if(!n)throw new M;return{programId:t,keys:{mint:n,authority:r,signers:i||null},data:a}}function xa({programId:e,keys:[t,n,...r],data:i}){const{instruction:a,transferFeeInstruction:o,transferFeeBasisPoints:s,maximumFee:u}=Ge.decode(i);return{programId:e,keys:{mint:t,authority:n,signers:r},data:{instruction:a,transferFeeInstruction:o,transferFeeBasisPoints:s,maximumFee:u}}}async function Dc(e,t,n,r,i,a,o,s,u,c=[],d,g=b){const[I,P]=z(a,c),V=new A().add(mr(n,r,i,I,o,s,u,c,g));return await p(e,V,[t,...P],d)}async function Pc(e,t,n,r,i,a=[],o,s=b){const[u,c]=z(i,a),d=new A().add(Ia(n,r,u,c,s));return await p(e,d,[t,...c],o)}async function Bc(e,t,n,r,i,a,o,s,u=b){const[c,d]=z(i,a),g=new A().add(Ea(n,r,c,d,o,u));return await p(e,g,[t,...d],s)}async function Fc(e,t,n,r,i,a=b){const o=new A().add(Ta(n,r,a));return await p(e,o,[t],i)}async function Uc(e,t,n,r,i,a,o,s,u=b){const[c,d]=z(r,i),g=new A().add(_a(n,c,d,a,o,u));return await p(e,g,[t,...d],s)}const Da=1e4,on=BigInt(Da);function sn(e){return m([B("epoch"),B("maximumFee"),At("transferFeeBasisPoints")],e)}function Pa(e,t){const n=e.transferFeeBasisPoints;if(n===0||t===BigInt(0))return BigInt(0);{const i=(t*BigInt(n)+on-BigInt(1))/on,a=i>e.maximumFee?e.maximumFee:i;return BigInt(a)}}const gr=m([k("transferFeeConfigAuthority"),k("withdrawWithheldAuthority"),B("withheldAmount"),sn("olderTransferFee"),sn("newerTransferFee")]),Ba=gr.span;function Fa(e,t){return t>=e.newerTransferFee.epoch?e.newerTransferFee:e.olderTransferFee}function Nc(e,t,n){const r=Fa(e,t);return Pa(r,n)}const yr=m([B("withheldAmount")]),Ua=yr.span;function Wc(e){const t=F(l.TransferFeeConfig,e.tlvData);return t!==null?gr.decode(t):null}function vc(e){const t=F(l.TransferFeeAmount,e.tlvData);return t!==null?yr.decode(t):null}const Ke=m([w("instruction"),B("amount"),w("decimals")]);function br(e,t,n,r,i,a,o=[],s=h){const u=_([{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!1,isWritable:!0}],r,o),c=Buffer.alloc(Ke.span);return Ke.encode({instruction:f.TransferChecked,amount:BigInt(i),decimals:a},c),new y({keys:u,programId:s,data:c})}function Na(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==Ke.span)throw new C;const{keys:{source:n,mint:r,destination:i,owner:a,multiSigners:o},data:s}=Wa(e);if(s.instruction!==f.TransferChecked)throw new E;if(!n||!r||!i||!a)throw new M;return{programId:t,keys:{source:n,mint:r,destination:i,owner:a,multiSigners:o},data:s}}function Wa({programId:e,keys:[t,n,r,i,...a],data:o}){return{programId:e,keys:{source:t,mint:n,destination:r,owner:i,multiSigners:a},data:Ke.decode(o)}}const Ct=1,va=1,Ra=1,Oa=1,La=1,Ga=1,Ka=1,Ha=1;function $a(e){if(e.length<1)throw new H;const[t,...n]=e;if(n.length<t)throw new H;return{data:Buffer.from(n.slice(0,t)),packedLength:Ct+va+t}}function qa(e,t){if(e.length<2)throw new H;const[n,r]=e;if(t.length<r+n)throw new H;return{data:t.subarray(n,n+r),packedLength:Ct+Ra+Oa}}function Va(e,t){if(e.length<1)throw new H;const[n]=e;if(t.length<=n)throw new H;return{data:t[n].pubkey.toBuffer(),packedLength:Ct+La}}
1async function Za(e,t,n){if(e.length<3)throw new H;const[r,i,a]=e;if(t.length<=r)throw new H;const o=await n.getAccountInfo(t[r].pubkey);if(o==null)throw new Fn;if(o.data.length<i+a)throw new H;return{data:o.data.subarray(i,i+a),packedLength:Ct+Ga+Ka+Ha}}async function ja(e,t,n,r){const[i,...a]=e,o=new Uint8Array(a);switch(i){case 0:return null;case 1:return $a(o);case 2:return qa(o,n);case 3:return Va(o,t);case 4:return Za(o,t,r);default:throw new H}}async function Ya(e,t,n,r){const i=[];let a=0;for(;a<32;){const o=await ja(e.slice(a),t,n,r);if(o==null)break;i.push(o.data),a+=o.packedLength}return i}async function Xa(e,t,n,r){const[i,...a]=e,o=new Uint8Array(a);switch(i){case 1:return Ja(o,n);case 2:return Qa(o,t,r);default:throw new Ut}}function Ja(e,t){if(e.length<1)throw new Ut;const n=e[0];if(t.length<n+Ce)throw new Un;return new S(t.subarray(n,n+Ce))}async function Qa(e,t,n){if(e.length<2)throw new Ut;const[r,i]=e;if(t.length<=r)throw new Fn;const a=await n.getAccountInfo(t[r].pubkey);if(a==null)throw new Bn;if(a.data.length<i+Ce)throw new Un;return new S(a.data.subarray(i,i+Ce))}const Ar=m([k("authority"),k("programId")]),eo=Ar.span;function pr(e){const t=F(l.TransferHook,e.tlvData);return t!==null?Ar.decode(t):null}const kr=m([Y("transferring")]),to=kr.span;function Rc(e){const t=F(l.TransferHookAccount,e.tlvData);return t!==null?kr.decode(t):null}function no(e,t){const n=[Buffer.from("extra-account-metas"),e.toBuffer()];return S.findProgramAddressSync(n,t)[0]}const un=m([w("discriminator"),se(32,"addressConfig"),Y("isSigner"),Y("isWritable")]),ro=m([Q("count"),_n(un,ii(un.span),"extraAccounts")]),io=m([B("instructionDiscriminator"),Q("length"),ro.replicate("extraAccountsList")]);function ao(e){const t=io.decode(e.data).extraAccountsList;return t.extraAccounts.slice(0,t.count)}async function oo(e,t,n,r,i){if(t.discriminator===0)return{pubkey:new S(t.addressConfig),isSigner:t.isSigner,isWritable:t.isWritable};if(t.discriminator===2)return{pubkey:await Xa(t.addressConfig,n,r,e),isSigner:t.isSigner,isWritable:t.isWritable};let a=S.default;if(t.discriminator===1)a=i;else{const u=t.discriminator-128;if(n.length<=u)throw new Bn;a=n[u].pubkey}const o=await Ya(t.addressConfig,n,r,e);return{pubkey:S.findProgramAddressSync(o,a)[0],isSigner:t.isSigner,isWritable:t.isWritable}}var He;(function(e){e[e.Initialize=0]="Initialize",e[e.Update=1]="Update"})(He||(He={}));const cn=m([w("instruction"),w("transferHookInstruction"),k("authority"),k("transferHookProgramId")]);function so(e,t,n,r){if(!x(r))throw new D;const i=[{pubkey:e,isSigner:!1,isWritable:!0}],a=Buffer.alloc(cn.span);return cn.encode({instruction:f.TransferHookExtension,transferHookInstruction:He.Initialize,authority:t,transferHookProgramId:n},a),new y({keys:i,programId:r,data:a})}const ln=m([w("instruction"),w("transferHookInstruction"),k("transferHookProgramId")]);function uo(e,t,n,r=[],i=b){if(!x(i))throw new D;const a=_([{pubkey:e,isSigner:!1,isWritable:!0}],t,r),o=Buffer.alloc(ln.span);return ln.encode({instruction:f.TransferHookExtension,transferHookInstruction:He.Update,transferHookProgramId:n},o),new y({keys:a,programId:i,data:o})}function co(e,t){const n=t.filter(r=>r.pubkey.equals(e.pubkey)).reduce((r,i)=>r?{isSigner:r.isSigner||i.isSigner,isWritable:r.isWritable||i.isWritable}:{isSigner:i.isSigner,isWritable:i.isWritable},void 0);if(n){const{isSigner:r,isWritable:i}=n;!r&&r!==e.isSigner&&(e.isSigner=!1),!i&&i!==e.isWritable&&(e.isWritable=!1)}return e}function lo(e,t,n,r,i,a,o){const s=[t,n,r,i,a].map(c=>({pubkey:c,isSigner:!1,isWritable:!1})),u=Buffer.alloc(16);return u.set(Buffer.from([105,37,101,197,75,251,102,26]),0),u.writeBigUInt64LE(BigInt(o),8),new y({keys:s,programId:e,data:u})}async function Sr(e,t,n,r,i,a,o,s,u){const c=no(i,n),d=await e.getAccountInfo(c,u);if(d==null)return t;const g=ao(d);if(![r,i,a,o].every(P=>t.keys.some(V=>V.pubkey.equals(P))))throw new Error("Missing required account in instruction");const I=lo(n,r,i,a,o,c,BigInt(s));for(const P of g)I.keys.push(co(await oo(e,P,I.keys,I.data,I.programId),I.keys));t.keys.push(...I.keys.slice(5)),t.keys.push({pubkey:n,isSigner:!1,isWritable:!1}),t.keys.push({pubkey:c,isSigner:!1,isWritable:!1})}async function fo(e,t,n,r,i,a,o,s=[],u,c=h){const d=br(t,n,r,i,a,o,s,c),g=await Mt(e,n,u,c),I=pr(g);return I&&await Sr(e,d,I.programId,t,n,r,i,a,u),d}async function wo(e,t,n,r,i,a,o,s,u=[],c,d=h){const g=mr(t,n,r,i,a,o,s,u,d),I=await Mt(e,n,c,d),P=pr(I);return P&&await Sr(e,g,P.programId,t,n,r,i,a,c),g}async function Oc(e,t,n,r,i,a,o=b){const s=new A().add(so(n,r,i,o));return await p(e,s,[t],a)}async function Lc(e,t,n,r,i,a=[],o,s=b){const[u,c]=z(i,a),d=new A().add(uo(n,u,r,c,s));return await p(e,d,[t,...c],o)}async function Gc(e,t,n,r,i,a,o,s,u=[],c,d=h){const[g,I]=z(a,u),P=new A().add(await fo(e,n,r,i,g,o,s,I,c==null?void 0:c.commitment,d));return await p(e,P,[t,...I],c)}async function Kc(e,t,n,r,i,a,o,s,u,c=[],d,g=h){const[I,P]=z(a,c),V=new A().add(await wo(e,n,r,i,I,o,s,u,P,d==null?void 0:d.commitment,g));return await p(e,V,[t,...P],d)}var l;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.TransferFeeConfig=1]="TransferFeeConfig",e[e.TransferFeeAmount=2]="TransferFeeAmount",e[e.MintCloseAuthority=3]="MintCloseAuthority",e[e.ConfidentialTransferMint=4]="ConfidentialTransferMint",e[e.ConfidentialTransferAccount=5]="ConfidentialTransferAccount",e[e.DefaultAccountState=6]="DefaultAccountState",e[e.ImmutableOwner=7]="ImmutableOwner",e[e.MemoTransfer=8]="MemoTransfer",e[e.NonTransferable=9]="NonTransferable",e[e.InterestBearingConfig=10]="InterestBearingConfig",e[e.CpiGuard=11]="CpiGuard",e[e.PermanentDelegate=12]="PermanentDelegate",e[e.NonTransferableAccount=13]="NonTransferableAccount",e[e.TransferHook=14]="TransferHook",e[e.TransferHookAccount=15]="TransferHookAccount",e[e.MetadataPointer=18]="MetadataPointer",e[e.TokenMetadata=19]="TokenMetadata",e[e.GroupPointer=20]="GroupPointer",e[e.TokenGroup=21]="TokenGroup",e[e.GroupMemberPointer=22]="GroupMemberPointer",e[e.TokenGroupMember=23]="TokenGroupMember",e[e.ScaledUiAmountConfig=25]="ScaledUiAmountConfig",e[e.PausableConfig=26]="PausableConfig",e[e.PausableAccount=27]="PausableAccount"})(l||(l={}));const Tt=2,ho=2;function ne(e){return e+Tt+ho}function mo(e){switch(e){case l.TokenMetadata:return!0;default:return!1}}function go(e){switch(e){case l.Uninitialized:return 0;case l.TransferFeeConfig:return Ba;case l.TransferFeeAmount:return Ua;case l.MintCloseAuthority:return fa;case l.ConfidentialTransferMint:return 65;case l.ConfidentialTransferAccount:return 295;case l.CpiGuard:return zi;case l.DefaultAccountState:return Ti;case l.ImmutableOwner:return aa;case l.MemoTransfer:return ca;case l.MetadataPointer:return la;case l.NonTransferable:return da;case l.InterestBearingConfig:return oa;case l.PermanentDelegate:return ba;case l.NonTransferableAccount:return wa;case l.TransferHook:return eo;case l.TransferHookAccount:return to;case l.GroupPointer:return ia;case l.GroupMemberPointer:return ra;case l.TokenGroup:return Jn;case l.TokenGroupMember:return er;case l.ScaledUiAmountConfig:return pa;case l.PausableConfig:return ga;case l.PausableAccount:return ya;case l.TokenMetadata:throw Error(`Cannot get type length for variable extension type: ${e}`);default:throw Error(`Unknown extension type: ${e}`)}}function Hc(e){switch(e){case l.TransferFeeConfig:case l.MintCloseAuthority:case l.ConfidentialTransferMint:case l.DefaultAccountState:case l.NonTransferable:case l.InterestBearingConfig:case l.PermanentDelegate:case l.TransferHook:case l.MetadataPointer:case l.TokenMetadata:case l.GroupPointer:case l.GroupMemberPointer:case l.TokenGroup:case l.TokenGroupMember:case l.ScaledUiAmountConfig:case l.PausableConfig:return!0;case l.Uninitialized:case l.TransferFeeAmount:case l.ConfidentialTransferAccount:case l.ImmutableOwner:case l.MemoTransfer:case l.CpiGuard:case l.NonTransferableAccount:case l.TransferHookAccount:case l.PausableAccount:return!1;default:throw Error(`Unknown extension type: ${e}`)}}function $c(e){switch(e){case l.TransferFeeAmount:case l.ConfidentialTransferAccount:case l.ImmutableOwner:case l.MemoTransfer:case l.CpiGuard:case l.NonTransferableAccount:case l.TransferHookAccount:case l.PausableAccount:return!0;case l.Uninitialized:case l.TransferFeeConfig:case l.MintCloseAuthority:case l.ConfidentialTransferMint:case l.DefaultAccountState:case l.NonTransferable:case l.InterestBearingConfig:case l.PermanentDelegate:case l.TransferHook:case l.MetadataPointer:case l.TokenMetadata:case l.GroupPointer:case l.GroupMemberPointer:case l.TokenGroup:case l.TokenGroupMember:case l.ScaledUiAmountConfig:case l.PausableConfig:return!1;default:throw Error(`Unknown extension type: ${e}`)}}function yo(e){switch(e){case l.TransferFeeConfig:return l.TransferFeeAmount;case l.ConfidentialTransferMint:return l.ConfidentialTransferAccount;case l.NonTransferable:return l.NonTransferableAccount;case l.TransferHook:return l.TransferHookAccount;case l.PausableConfig:return l.PausableAccount;case l.TransferFeeAmount:case l.ConfidentialTransferAccount:case l.CpiGuard:case l.DefaultAccountState:case l.ImmutableOwner:case l.MemoTransfer:case l.MintCloseAuthority:case l.MetadataPointer:case l.TokenMetadata:case l.Uninitialized:case l.InterestBearingConfig:case l.PermanentDelegate:case l.NonTransferableAccount:case l.TransferHookAccount:case l.GroupPointer:case l.GroupMemberPointer:case l.TokenGroup:case l.TokenGroupMember:case l.ScaledUiAmountConfig:case l.PausableAccount:return l.Uninitialized}}function Ir(e,t,n={}){if(e.length===0&&Object.keys(n).length===0)return t;{const r=G+Nt+e.filter((i,a)=>a===e.indexOf(i)).map(i=>ne(go(i))).reduce((i,a)=>i+a,0)+Object.entries(n).map(([i,a])=>{if(!mo(Number(i)))throw Error(`Extension ${i} is not variable length`);return ne(a)}).reduce((i,a)=>i+a,0);return r===ce?r+Tt:r}}function zr(e,t={}){return Ir(e,me,t)}function Er(e){return Ir(e,G)}function F(e,t){let n=0;for(;ne(n)<=t.length;){const r=t.readUInt16LE(n),i=t.readUInt16LE(n+Tt),a=ne(n);if(r==e)return t.slice(a,a+i);n=a+i}return null}function bo(e){const t=[];let n=0;for(;n<e.length;){const r=e.readUInt16LE(n);t.push(r);const i=e.readUInt16LE(n+Tt);n+=ne(i)}return t}function Ao(e){const n=bo(e.tlvData).map(yo);return Er(n)}function Cr(e,t,n,r,i=b){const a=ke(t,e,i),o=F(n,a.tlvData),s=o?ne(o.length):0,u=ne(r);return e.data.length+u-s}const Tr=m([Q("mintAuthorityOption"),k("mintAuthority"),B("supply"),w("decimals"),Y("isInitialized"),Q("freezeAuthorityOption"),k("freezeAuthority")]),me=Tr.span;async function Mt(e,t,n,r=h){const i=await e.getAccountInfo(t,n);return ke(t,i,r)}function ke(e,t,n=h){if(!t)throw new ue;if(!t.owner.equals(n))throw new kt;if(t.data.length<me)throw new ie;const r=Tr.decode(t.data.slice(0,me));let i=Buffer.alloc(0);if(t.data.length>me){if(t.data.length<=G)throw new ie;if(t.data.length===ce)throw new ie;if(t.data[G]!=Me.Mint)throw new Dn;i=t.data.slice(G+Nt)}return{address:e,mintAuthority:r.mintAuthorityOption?r.mintAuthority:null,supply:r.supply,decimals:r.decimals,isInitialized:r.isInitialized,freezeAuthority:r.freezeAuthorityOption?r.freezeAuthority:null,tlvData:i}}async function po(e,t){return await ko(e,[],t)}async function ko(e,t,n){const r=zr(t);return await e.getMinimumBalanceForRentExemption(r,n)}async function qc(e,t,n=!1,r=h,i=O){if(!n&&!S.isOnCurve(t.toBuffer()))throw new Pn;const[a]=await S.findProgramAddress([t.toBuffer(),r.toBuffer(),e.toBuffer()],i);return a}function Z(e,t,n=!1,r=h,i=O){if(!n&&!S.isOnCurve(t.toBuffer()))throw new Pn;const[a]=S.findProgramAddressSync([t.toBuffer(),r.toBuffer(),e.toBuffer()],i);return a}const So=1e4,Io=60*60*24*365.24,zo=new S("SysvarC1ock11111111111111111111111111111111");async function Vc(e,t,n,r,i=h){const a=new A().add(mi(n,r,i)),{returnData:o,err:s}=(await e.simulateTransaction(a,[t],!1)).value;return o!=null&&o.data?Buffer.from(o.data[0],o.data[1]).toString("utf-8"):s}function $e(e,t,n){const r=t-e,a=n*r/(Io*So);return Math.exp(a)}async function Mr(e){const t=await e.getParsedAccountInfo(zo);if(!(t!=null&&t.value))throw new Error("Failed to fetch sysvar clock");if(typeof t.value=="object"&&"data"in t.value&&"parsed"in t.value.data)return t.value.data.parsed.info.unixTimestamp;throw new Error("Failed to parse sysvar clock")}function _t(e){return Math.pow(10,e)}function Gt(e,t){const n=parseFloat(e),r=_t(t);return n*r}function Eo(e,t,n,r,i,a,o){const s=$e(i,r,a),u=$e(r,n,o),c=s*u,d=Number(e)*c,g=_t(t);return(Math.trunc(d)/g).toString()}function Co(e,t,n){const r=Number(e)*n,i=_t(t);return(Math.trunc(r)/i).toString()}async function Zc(e,t,n){const r=await e.getAccountInfo(t),i=r==null?void 0:r.owner;if(!(i!=null&&i.equals(h))&&!(i!=null&&i.equals(b)))throw new Error("Invalid program ID");const a=ke(t,r,i),o=ar(a),s=hr(a);if(!o&&!s){const d=_t(a.decimals);return(Number(n)/d).toString()}const u=await Mr(e);
1if(o)return Eo(n,a.decimals,u,Number(o.lastUpdateTimestamp),Number(o.initializationTimestamp),o.preUpdateAverageRate,o.currentRate);let c=s.multiplier;return u>=Number(s.newMultiplierEffectiveTimestamp)&&(c=s.newMultiplier),Co(n,a.decimals,c)}function To(e,t,n,r,i,a,o){const s=Gt(e,t),u=$e(i,r,a),c=$e(r,n,o),d=u*c,g=s/d;return BigInt(Math.trunc(g))}function Mo(e,t,n){const i=Gt(e,t)/n;return BigInt(Math.trunc(i))}async function jc(e,t,n){const r=await e.getAccountInfo(t),i=r==null?void 0:r.owner;if(!(i!=null&&i.equals(h))&&!(i!=null&&i.equals(b)))throw new Error("Invalid program ID");const a=ke(t,r,i),o=ar(a),s=hr(a);if(!o&&!s)return BigInt(Math.trunc(Gt(n,a.decimals)));const u=await Mr(e);if(o)return To(n,a.decimals,u,Number(o.lastUpdateTimestamp),Number(o.initializationTimestamp),o.preUpdateAverageRate,o.currentRate);let c=s.multiplier;return u>=Number(s.newMultiplierEffectiveTimestamp)&&(c=s.newMultiplier),Mo(n,a.decimals,c)}const qe=m([w("instruction"),B("amount")]);function _o(e,t,n,r,i=[],a=h){const o=_([{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!1}],n,i),s=Buffer.alloc(qe.span);return qe.encode({instruction:f.Approve,amount:BigInt(r)},s),new y({keys:o,programId:a,data:s})}function xo(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==qe.span)throw new C;const{keys:{account:n,delegate:r,owner:i,multiSigners:a},data:o}=Do(e);if(o.instruction!==f.Approve)throw new E;if(!n||!r||!i)throw new M;return{programId:t,keys:{account:n,delegate:r,owner:i,multiSigners:a},data:o}}function Do({programId:e,keys:[t,n,r,...i],data:a}){return{programId:e,keys:{account:t,delegate:n,owner:r,multiSigners:i},data:qe.decode(a)}}async function Yc(e,t,n,r,i,a,o=[],s,u=h){const[c,d]=z(i,o),g=new A().add(_o(n,r,c,a,o,u));return await p(e,g,[t,...d],s)}const Ve=m([w("instruction"),B("amount"),w("decimals")]);function Po(e,t,n,r,i,a,o=[],s=h){const u=_([{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!1,isWritable:!1}],r,o),c=Buffer.alloc(Ve.span);return Ve.encode({instruction:f.ApproveChecked,amount:BigInt(i),decimals:a},c),new y({keys:u,programId:s,data:c})}function Bo(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==Ve.span)throw new C;const{keys:{account:n,mint:r,delegate:i,owner:a,multiSigners:o},data:s}=Fo(e);if(s.instruction!==f.ApproveChecked)throw new E;if(!n||!r||!i||!a)throw new M;return{programId:t,keys:{account:n,mint:r,delegate:i,owner:a,multiSigners:o},data:s}}function Fo({programId:e,keys:[t,n,r,i,...a],data:o}){return{programId:e,keys:{account:t,mint:n,delegate:r,owner:i,multiSigners:a},data:Ve.decode(o)}}async function Xc(e,t,n,r,i,a,o,s,u=[],c,d=h){const[g,I]=z(a,u),P=new A().add(Po(r,n,i,g,o,s,u,d));return await p(e,P,[t,...I],c)}const Ze=m([w("instruction"),B("amount")]);function Uo(e,t,n,r,i=[],a=h){const o=_([{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!0}],n,i),s=Buffer.alloc(Ze.span);return Ze.encode({instruction:f.Burn,amount:BigInt(r)},s),new y({keys:o,programId:a,data:s})}function No(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==Ze.span)throw new C;const{keys:{account:n,mint:r,owner:i,multiSigners:a},data:o}=Wo(e);if(o.instruction!==f.Burn)throw new E;if(!n||!r||!i)throw new M;return{programId:t,keys:{account:n,mint:r,owner:i,multiSigners:a},data:o}}function Wo({programId:e,keys:[t,n,r,...i],data:a}){return{programId:e,keys:{account:t,mint:n,owner:r,multiSigners:i},data:Ze.decode(a)}}async function Jc(e,t,n,r,i,a,o=[],s,u=h){const[c,d]=z(i,o),g=new A().add(Uo(n,r,c,a,o,u));return await p(e,g,[t,...d],s)}const je=m([w("instruction"),B("amount"),w("decimals")]);function vo(e,t,n,r,i,a=[],o=h){const s=_([{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!0}],n,a),u=Buffer.alloc(je.span);return je.encode({instruction:f.BurnChecked,amount:BigInt(r),decimals:i},u),new y({keys:s,programId:o,data:u})}function Ro(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==je.span)throw new C;const{keys:{account:n,mint:r,owner:i,multiSigners:a},data:o}=Oo(e);if(o.instruction!==f.BurnChecked)throw new E;if(!n||!r||!i)throw new M;return{programId:t,keys:{account:n,mint:r,owner:i,multiSigners:a},data:o}}function Oo({programId:e,keys:[t,n,r,...i],data:a}){return{programId:e,keys:{account:t,mint:n,owner:r,multiSigners:i},data:je.decode(a)}}async function Qc(e,t,n,r,i,a,o,s=[],u,c=h){const[d,g]=z(i,s),I=new A().add(vo(n,r,d,a,o,s,c));return await p(e,I,[t,...g],u)}const Ye=m([w("instruction")]);function Lo(e,t,n,r=[],i=h){const a=_([{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!0}],n,r),o=Buffer.alloc(Ye.span);return Ye.encode({instruction:f.CloseAccount}
1,o),new y({keys:a,programId:i,data:o})}function Go(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==Ye.span)throw new C;const{keys:{account:n,destination:r,authority:i,multiSigners:a},data:o}=Ko(e);if(o.instruction!==f.CloseAccount)throw new E;if(!n||!r||!i)throw new M;return{programId:t,keys:{account:n,destination:r,authority:i,multiSigners:a},data:o}}function Ko({programId:e,keys:[t,n,r,...i],data:a}){return{programId:e,keys:{account:t,destination:n,authority:r,multiSigners:i},data:Ye.decode(a)}}async function el(e,t,n,r,i,a=[],o,s=h){const[u,c]=z(i,a),d=new A().add(Lo(n,r,u,a,s));return await p(e,d,[t,...c],o)}const Xe=m([w("instruction")]);function _r(e,t,n,r=h){const i=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:pt,isSigner:!1,isWritable:!1}],a=Buffer.alloc(Xe.span);return Xe.encode({instruction:f.InitializeAccount},a),new y({keys:i,programId:r,data:a})}function Ho(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==Xe.span)throw new C;const{keys:{account:n,mint:r,owner:i,rent:a},data:o}=$o(e);if(o.instruction!==f.InitializeAccount)throw new E;if(!n||!r||!i||!a)throw new M;return{programId:t,keys:{account:n,mint:r,owner:i,rent:a},data:o}}function $o({programId:e,keys:[t,n,r,i],data:a}){return{programId:e,keys:{account:t,mint:n,owner:r,rent:i},data:Xe.decode(a)}}function Kt(e,t,n,r,i=h,a=O){return Dr(e,t,n,r,Buffer.alloc(0),i,a)}function xr(e,t,n,r,i=h,a=O){return Dr(e,t,n,r,Buffer.from([1]),i,a)}function tl(e,t,n,r=!0,i=h,a=O){const o=Z(n,t,r);return xr(e,o,t,n,i,a)}function Dr(e,t,n,r,i,a=h,o=O){const s=[{pubkey:e,isSigner:!0,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:W.programId,isSigner:!1,isWritable:!1},{pubkey:a,isSigner:!1,isWritable:!1}];
1return new y({keys:s,programId:o,data:i})}function qo(e,t,n,r,i,a,o=h,s=O){const u=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!1},{pubkey:a,isSigner:!0,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!1}];return new y({keys:u,programId:s,data:Buffer.from([2])})}async function Vo(e,t,n,r,i,a=h,o=O,s=!1){const u=Z(n,r,s,a,o),c=new A().add(Kt(t.publicKey,u,r,n,a,o));return await p(e,c,[t],i),u}async function Zo(e,t,n,r,i,a,o=h){if(!i)return await Vo(e,t,n,r,a,o);const s=await Mt(e,n,a==null?void 0:a.commitment,o),u=Ao(s),c=await e.getMinimumBalanceForRentExemption(u),d=new A().add(W.createAccount({fromPubkey:t.publicKey,newAccountPubkey:i.publicKey,space:u,lamports:c,programId:o}),_r(i.publicKey,n,r,o));return await p(e,d,[t,i],a),i.publicKey}async function nl(e,t,n,r,i,a=h,o=O,s=!1){const u=Z(n,r,s,a,o),c=new A().add(xr(t.publicKey,u,r,n,a,o));return await p(e,c,[t],i),u}const Je=m([w("instruction"),w("decimals"),k("mintAuthority"),new oe("freezeAuthority")]);function jo(e,t,n,r,i=h){const a=[{pubkey:e,isSigner:!1,isWritable:!0}],o=Buffer.alloc(67);return Je.encode({instruction:f.InitializeMint2,decimals:t,mintAuthority:n,freezeAuthority:r},o),new y({keys:a,programId:i,data:o.subarray(0,Je.getSpan(o))})}function Yo(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==Je.getSpan(e.data))throw new C;const{keys:{mint:n},data:r}=Xo(e);if(r.instruction!==f.InitializeMint2)throw new E;if(!n)throw new M;return{programId:t,keys:{mint:n},data:r}}function Xo({programId:e,keys:[t],data:n}){const{instruction:r,decimals:i,mintAuthority:a,freezeAuthority:o}=Je.decode(n);return{programId:e,keys:{mint:t},data:{instruction:r,decimals:i,mintAuthority:a,freezeAuthority:o}}}async function rl(e,t,n,r,i,a=Bt.generate(),o,s=h){const u=await po(e),c=new A().add(W.createAccount({fromPubkey:t.publicKey,newAccountPubkey:a.publicKey,space:me,lamports:u,programId:s}),jo(a.publicKey,i,n,r,s));return await p(e,c,[t,a],o),a.publicKey}const Qe=m([w("instruction"),w("m")]);function Jo(e,t,n,r=h){const i=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:pt,isSigner:!1,isWritable:!1}];for(const o of t)i.push({pubkey:o instanceof S?o:o.publicKey,isSigner:!1,isWritable:!1});const a=Buffer.alloc(Qe.span);return Qe.encode({instruction:f.InitializeMultisig,m:n},a),new y({keys:i,programId:r,data:a})}function Qo(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==Qe.span)throw new C;const{keys:{account:n,rent:r,signers:i},data:a}=es(e);if(a.instruction!==f.InitializeMultisig)throw new E;if(!n||!r||!i.length)throw new M;return{programId:t,keys:{account:n,rent:r,signers:i},data:a}}function es({programId:e,keys:[t,n,...r],data:i}){return{programId:e,keys:{account:t,rent:n,signers:r},data:Qe.decode(i)}}async function il(e,t,n,r,i=Bt.generate(),a,o=h){const s=await Ai(e),u=new A().add(W.createAccount({fromPubkey:t.publicKey,newAccountPubkey:i.publicKey,space:ce,lamports:s,programId:o}),Jo(i.publicKey,n,r,o));return await p(e,u,[t,i],a),i.publicKey}const fn=m([w("instruction")]);function ts(e,t=xn,n=b){if(!x(n))throw new D;const r=[{pubkey:e,isSigner:!0,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:W.programId,isSigner:!1,isWritable:!1}],i=Buffer.alloc(fn.span);return fn.encode({instruction:f.CreateNativeMint},i),new y({keys:r,programId:n,data:i})}async function al(e,t,n,r=xn,i=b){const a=new A().add(ts(t.publicKey,r,i));await p(e,a,[t],n)}const et=m([w("instruction")]);function Pr(e,t=h){const n=[{pubkey:e,isSigner:!1,isWritable:!0}],r=Buffer.alloc(et.span);return et.encode({instruction:f.SyncNative},r),new y({keys:n,programId:t,data:r})}function ns(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==et.span)throw new C;const{keys:{account:n},data:r}=rs(e);if(r.instruction!==f.SyncNative)throw new E;if(!n)throw new M;return{programId:t,keys:{account:n},data:r}}function rs({programId:e,keys:[t],data:n}){return{programId:e,keys:{account:t},data:et.decode(n)}}async function ol(e,t,n,r,i,a,o=h,s=ai){if(!r)return await Zo(e,t,s,n,i,a,o);if(!i){const d=Z(s,n,!1,o,O),g=new A().add(Kt(t.publicKey,d,n,s,o,O),W.transfer({fromPubkey:t.publicKey,toPubkey:d,lamports:r}),Pr(d,o));return await p(e,g,[t],a),d}const u=await pi(e),c=new A().add(W.createAccount({fromPubkey:t.publicKey,newAccountPubkey:i.publicKey,space:G,lamports:u,programId:o}),W.transfer({fromPubkey:t.publicKey,toPubkey:i.publicKey,lamports:r}),_r(i.publicKey,s,n,o));return await p(e,c,[t,i],a),i.publicKey}const tt=m([w("instruction")]);function is(e,t,n,r=[],i=h){const a=_([{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!1}],n,r),o=Buffer.alloc(tt.span);return tt.encode({instruction:f.FreezeAccount}
1,o),new y({keys:a,programId:i,data:o})}function as(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==tt.span)throw new C;const{keys:{account:n,mint:r,authority:i,multiSigners:a},data:o}=os(e);if(o.instruction!==f.FreezeAccount)throw new E;if(!n||!r||!i)throw new M;return{programId:t,keys:{account:n,mint:r,authority:i,multiSigners:a},data:o}}function os({programId:e,keys:[t,n,r,...i],data:a}){return{programId:e,keys:{account:t,mint:n,authority:r,multiSigners:i},data:tt.decode(a)}}async function sl(e,t,n,r,i,a=[],o,s=h){const[u,c]=z(i,a),d=new A().add(is(n,r,u,a,s));return await p(e,d,[t,...c],o)}async function ul(e,t,n,r,i=!1,a,o,s=h,u=O){const c=Z(n,r,i,s,u);let d;try{d=await Xt(e,c,a,s)}catch(g){if(g instanceof ue||g instanceof kt){try{const I=new A().add(Kt(t.publicKey,c,r,n,s,u));await p(e,I,[t],o)}catch{}d=await Xt(e,c,a,s)}else throw g}if(!d.mint.equals(n))throw new Dn;if(!d.owner.equals(r))throw new hi;return d}const nt=m([w("instruction"),B("amount")]);function ss(e,t,n,r,i=[],a=h){const o=_([{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!0}],n,i),s=Buffer.alloc(nt.span);return nt.encode({instruction:f.MintTo,amount:BigInt(r)},s),new y({keys:o,programId:a,data:s})}function us(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==nt.span)throw new C;const{keys:{mint:n,destination:r,authority:i,multiSigners:a},data:o}=cs(e);if(o.instruction!==f.MintTo)throw new E;if(!n||!r||!i)throw new M;return{programId:t,keys:{mint:n,destination:r,authority:i,multiSigners:a},data:o}}function cs({programId:e,keys:[t,n,r,...i],data:a}){return{programId:e,keys:{mint:t,destination:n,authority:r,multiSigners:i},data:nt.decode(a)}}async function cl(e,t,n,r,i,a,o=[],s,u=h){const[c,d]=z(i,o),g=new A().add(ss(n,r,c,a,o,u));return await p(e,g,[t,...d],s)}const rt=m([w("instruction"),B("amount"),w("decimals")]);function ls(e,t,n,r,i,a=[],o=h){const s=_([{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!0}],n,a),u=Buffer.alloc(rt.span);return rt.encode({instruction:f.MintToChecked,amount:BigInt(r),decimals:i},u),new y({keys:s,programId:o,data:u})}function fs(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==rt.span)throw new C;const{keys:{mint:n,destination:r,authority:i,multiSigners:a},data:o}=ds(e);if(o.instruction!==f.MintToChecked)throw new E;if(!n||!r||!i)throw new M;return{programId:t,keys:{mint:n,destination:r,authority:i,multiSigners:a},data:o}}function ds({programId:e,keys:[t,n,r,...i],data:a}){return{programId:e,keys:{mint:t,destination:n,authority:r,multiSigners:i},data:rt.decode(a)}}async function ll(e,t,n,r,i,a,o,s=[],u,c=h){const[d,g]=z(i,s),I=new A().add(ls(n,r,d,a,o,s,c));return await p(e,I,[t,...g],u)}async function fl(e,t,n,r,i,a,o=h,s=O){const u=Z(r,n.publicKey,!1,o,s),c=Z(i,n.publicKey,!1,o,s),d=Z(i,u,!0,o,s),g=new A().add(qo(d,i,c,u,r,n.publicKey,o,s));return await p(e,g,[t,n],a)}const it=m([w("instruction")]);function ws(e,t,n=[],r=h){const i=_([{pubkey:e,isSigner:!1,isWritable:!0}],t,n),a=Buffer.alloc(it.span);return it.encode({instruction:f.Revoke},a),new y({keys:i,programId:r,data:a})}function hs(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==it.span)throw new C;const{keys:{account:n,owner:r,multiSigners:i},data:a}=ms(e);if(a.instruction!==f.Revoke)throw new E;if(!n||!r)throw new M;return{programId:t,keys:{account:n,owner:r,multiSigners:i},data:a}}function ms({programId:e,keys:[t,n,...r],data:i}){return{programId:e,keys:{account:t,owner:n,multiSigners:r},data:it.decode(i)}}async function dl(e,t,n,r,i=[],a,o=h){const[s,u]=z(r,i),c=new A().add(ws(n,s,i,o));return await p(e,c,[t,...u],a)}var dn;(function(e){e[e.MintTokens=0]="MintTokens",e[e.FreezeAccount=1]="FreezeAccount",e[e.AccountOwner=2]="AccountOwner",e[e.CloseAccount=3]="CloseAccount",e[e.TransferFeeConfig=4]="TransferFeeConfig",e[e.WithheldWithdraw=5]="WithheldWithdraw",e[e.CloseMint=6]="CloseMint",e[e.InterestRate=7]="InterestRate",e[e.PermanentDelegate=8]="PermanentDelegate",e[e.ConfidentialTransferMint=9]="ConfidentialTransferMint",e[e.TransferHookProgramId=10]="TransferHookProgramId",e[e.ConfidentialTransferFeeConfig=11]="ConfidentialTransferFeeConfig",e[e.MetadataPointer=12]="MetadataPointer",e[e.GroupPointer=13]="GroupPointer",e[e.GroupMemberPointer=14]="GroupMemberPointer",e[e.ScaledUiAmountConfig=15]="ScaledUiAmountConfig",e[e.PausableConfig=16]="PausableConfig"})(dn||(dn={}));const at=m([w("instruction"),w("authorityType"),new oe("newAuthority")]);function gs(e,t,n,r,i=[],a=h){const o=_([{pubkey:e,isSigner:!1,isWritable:!0}],t,i),s=Buffer.alloc(35);return at.encode({instruction:f.SetAuthority,authorityType:n,newAuthority:r}
1,s),new y({keys:o,programId:a,data:s.subarray(0,at.getSpan(s))})}function ys(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==at.getSpan(e.data))throw new C;const{keys:{account:n,currentAuthority:r,multiSigners:i},data:a}=bs(e);if(a.instruction!==f.SetAuthority)throw new E;if(!n||!r)throw new M;return{programId:t,keys:{account:n,currentAuthority:r,multiSigners:i},data:a}}function bs({programId:e,keys:[t,n,...r],data:i}){const{instruction:a,authorityType:o,newAuthority:s}=at.decode(i);return{programId:e,keys:{account:t,currentAuthority:n,multiSigners:r},data:{instruction:a,authorityType:o,newAuthority:s}}}async function wl(e,t,n,r,i,a,o=[],s,u=h){const[c,d]=z(r,o),g=new A().add(gs(n,c,i,a,o,u));return await p(e,g,[t,...d],s)}async function hl(e,t,n,r,i=h){const a=new A().add(Pr(n,i));return await p(e,a,[t],r)}const ot=m([w("instruction")]);function As(e,t,n,r=[],i=h){const a=_([{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!1}],n,r),o=Buffer.alloc(ot.span);return ot.encode({instruction:f.ThawAccount},o),new y({keys:a,programId:i,data:o})}function ps(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==ot.span)throw new C;const{keys:{account:n,mint:r,authority:i,multiSigners:a},data:o}=ks(e);if(o.instruction!==f.ThawAccount)throw new E;if(!n||!r||!i)throw new M;return{programId:t,keys:{account:n,mint:r,authority:i,multiSigners:a},data:o}}function ks({programId:e,keys:[t,n,r,...i],data:a}){return{programId:e,keys:{account:t,mint:n,authority:r,multiSigners:i},data:ot.decode(a)}}async function ml(e,t,n,r,i,a=[],o,s=h){const[u,c]=z(i,a),d=new A().add(As(n,r,u,a,s));return await p(e,d,[t,...c],o)}const st=m([w("instruction"),B("amount")]);function Ss(e,t,n,r,i=[],a=h){const o=_([{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!0}],n,i),s=Buffer.alloc(st.span);return st.encode({instruction:f.Transfer,amount:BigInt(r)},s),new y({keys:o,programId:a,data:s})}function Is(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==st.span)throw new C;const{keys:{source:n,destination:r,owner:i,multiSigners:a},data:o}=zs(e);if(o.instruction!==f.Transfer)throw new E;if(!n||!r||!i)throw new M;return{programId:t,keys:{source:n,destination:r,owner:i,multiSigners:a},data:o}}function zs({programId:e,keys:[t,n,r,...i],data:a}){return{programId:e,keys:{source:t,destination:n,owner:r,multiSigners:i},data:st.decode(a)}}async function gl(e,t,n,r,i,a,o=[],s,u=h){const[c,d]=z(i,o),g=new A().add(Ss(n,r,c,a,o,u));return await p(e,g,[t,...d],s)}async function yl(e,t,n,r,i,a,o,s,u=[],c,d=h){const[g,I]=z(a,u),P=new A().add(br(n,r,i,g,o,s,u,d));return await p(e,P,[t,...I],c)}function Es(e,t,n=h){const r=[{pubkey:e,isSigner:!1,isWritable:!1}],i=Buffer.from(t,"utf8"),a=m([w("instruction"),se(i.length,"amount")]),o=Buffer.alloc(a.span);return a.encode({instruction:f.UiAmountToAmount,amount:i},o),new y({keys:r,programId:n,data:o})}function Cs(e,t=h){if(!e.programId.equals(t))throw new T;const n=m([w("instruction"),se(e.data.length-1,"amount")]);if(e.data.length!==n.span)throw new C;const{keys:{mint:r},data:i}=Ts(e);if(i.instruction!==f.UiAmountToAmount)throw new E;if(!r)throw new M;return{programId:t,keys:{mint:r},data:i}}function Ts({programId:e,keys:[t],data:n}){const r=m([w("instruction"),se(n.length-1,"amount")]);return{programId:e,keys:{mint:t},data:r.decode(n)}}async function bl(e,t,n,r,i=h){const a=new A().add(Es(n,r,i)),{returnData:o,err:s}=(await e.simulateTransaction(a,[t],!1)).value;if(o){const u=Buffer.from(o.data[0],o.data[1]);return B().decode(u)}return s}var ut;(function(e){e[e.Initialize=0]="Initialize",e[e.Update=1]="Update"})(ut||(ut={}));const wn=m([w("instruction"),w("groupMemberPointerInstruction"),k("authority"),k("memberAddress")]);function Al(e,t,n,r=b){if(!x(r))throw new D;const i=[{pubkey:e,isSigner:!1,isWritable:!0}],a=Buffer.alloc(wn.span);return wn.encode({instruction:f.GroupMemberPointerExtension,groupMemberPointerInstruction:ut.Initialize,authority:t??S.default,memberAddress:n??S.default},a),new y({keys:i,programId:r,data:a})}
1const hn=m([w("instruction"),w("groupMemberPointerInstruction"),k("memberAddress")]);function pl(e,t,n,r=[],i=b){if(!x(i))throw new D;const a=_([{pubkey:e,isSigner:!1,isWritable:!0}],t,r),o=Buffer.alloc(hn.span);return hn.encode({instruction:f.GroupMemberPointerExtension,groupMemberPointerInstruction:ut.Update,memberAddress:n??S.default},o),new y({keys:a,programId:i,data:o})}var ct;(function(e){e[e.Initialize=0]="Initialize",e[e.Update=1]="Update"})(ct||(ct={}));const mn=m([w("instruction"),w("groupPointerInstruction"),k("authority"),k("groupAddress")]);function kl(e,t,n,r=b){if(!x(r))throw new D;const i=[{pubkey:e,isSigner:!1,isWritable:!0}],a=Buffer.alloc(mn.span);return mn.encode({instruction:f.GroupPointerExtension,groupPointerInstruction:ct.Initialize,authority:t??S.default,groupAddress:n??S.default},a),new y({keys:i,programId:r,data:a})}const gn=m([w("instruction"),w("groupPointerInstruction"),k("groupAddress")]);function Sl(e,t,n,r=[],i=b){if(!x(i))throw new D;const a=_([{pubkey:e,isSigner:!1,isWritable:!0}],t,r),o=Buffer.alloc(gn.span);return gn.encode({instruction:f.GroupPointerExtension,groupPointerInstruction:ct.Update,groupAddress:n??S.default},o),new y({keys:a,programId:i,data:o})}const lt=m([w("instruction"),w("decimals"),k("mintAuthority"),new oe("freezeAuthority")]);function Ms(e,t,n,r,i=h){const a=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:pt,isSigner:!1,isWritable:!1}],o=Buffer.alloc(67);return lt.encode({instruction:f.InitializeMint,decimals:t,mintAuthority:n,freezeAuthority:r},o),new y({keys:a,programId:i,data:o.subarray(0,lt.getSpan(o))})}function _s(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==lt.getSpan(e.data))throw new C;const{keys:{mint:n,rent:r},data:i}=xs(e);if(i.instruction!==f.InitializeMint)throw new E;if(!n||!r)throw new M;return{programId:t,keys:{mint:n,rent:r},data:i}}function xs({programId:e,keys:[t,n],data:r}){const{instruction:i,decimals:a,mintAuthority:o,freezeAuthority:s}=lt.decode(r);return{programId:e,keys:{mint:t,rent:n},data:{instruction:i,decimals:a,mintAuthority:o,freezeAuthority:s}}}var ft;(function(e){e[e.Initialize=0]="Initialize",e[e.UpdateRate=1]="UpdateRate"})(ft||(ft={}));const yn=m([w("instruction"),w("interestBearingMintInstruction"),k("rateAuthority"),ze("rate")]),bn=m([w("instruction"),w("interestBearingMintInstruction"),ze("rate")]);function Ds(e,t,n,r=b){const i=[{pubkey:e,isSigner:!1,isWritable:!0}],a=Buffer.alloc(yn.span);return yn.encode({instruction:f.InterestBearingMintExtension,interestBearingMintInstruction:ft.Initialize,rateAuthority:t,rate:n},a),new y({keys:i,programId:r,data:a})}function Ps(e,t,n,r=[],i=b){const a=_([{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!r.length,isWritable:!1}],t,r),o=Buffer.alloc(bn.span);return bn.encode({instruction:f.InterestBearingMintExtension,interestBearingMintInstruction:ft.UpdateRate,rate:n},o),new y({keys:a,programId:i,data:o})}async function Il(e,t,n,r,i,a,o,s=Bt.generate(),u,c=b){const d=zr([l.InterestBearingConfig]),g=await e.getMinimumBalanceForRentExemption(d),I=new A().add(W.createAccount({fromPubkey:t.publicKey,newAccountPubkey:s.publicKey,space:d,lamports:g,programId:c}),Ds(s.publicKey,i,a,c),Ms(s.publicKey,o,n,r,c));return await p(e,I,[t,s],u),s.publicKey}async function zl(e,t,n,r,i,a=[],o,s=b){const[u,c]=z(r,a),d=new A().add(Ps(n,u,i,c,s));return await p(e,d,[t,r,...c],o)}var dt;(function(e){e[e.Initialize=0]="Initialize",e[e.Update=1]="Update"})(dt||(dt={}));const An=m([w("instruction"),w("metadataPointerInstruction"),k("authority"),k("metadataAddress")]);function El(e,t,n,r){if(!x(r))throw new D;const i=[{pubkey:e,isSigner:!1,isWritable:!0}],a=Buffer.alloc(An.span);return An.encode({instruction:f.MetadataPointerExtension,metadataPointerInstruction:dt.Initialize,authority:t??S.default,metadataAddress:n??S.default},a),new y({keys:i,programId:r,data:a})}const pn=m([w("instruction"),w("metadataPointerInstruction"),k("metadataAddress")]);function Cl(e,t,n,r=[],i=b){if(!x(i))throw new D;const a=_([{pubkey:e,isSigner:!1,isWritable:!0}],t,r),o=Buffer.alloc(pn.span);return pn.encode({instruction:f.MetadataPointerExtension,metadataPointerInstru
1ction:dt.Update,metadataAddress:n??S.default},o),new y({keys:a,programId:i,data:o})}var Bs=8078e3,Fs=8078001,Us=8078002,Ns=8078004,Ws=8078005,vs=8078006,Rs=8078007,Os=8078009,Ls=8078011,Gs=8078017;function Br(e){return Array.isArray(e)?"%5B"+e.map(Br).join("%2C%20")+"%5D":typeof e=="bigint"?`${e}n`:encodeURIComponent(String(e!=null&&Object.getPrototypeOf(e)===null?{...e}:e))}function Ks([e,t]){return`${e}=${Br(t)}`}function Hs(e){const t=Object.entries(e).map(Ks).join("&");return btoa(t)}function $s(e,t={}){{let n=`Solana error #${e}; Decode this error by running \`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(n+=` '${Hs(t)}'`),`${n}\``}}var $=class extends Error{constructor(...[t,n]){let r,i;if(n){const{cause:o,...s}=n;o&&(i={cause:o}),Object.keys(s).length>0&&(r=s)}const a=$s(t,r);super(a,i);we(this,"cause",this.cause);we(this,"context");this.context={__code:t,...r},this.name="SolanaError"}},qs=(e,t)=>{if(e.length>=t)return e;const n=new Uint8Array(t).fill(0);return n.set(e),n},Vs=(e,t)=>qs(e.length<=t?e:e.slice(0,t),t);function X(e,t){return"fixedSize"in t?t.fixedSize:t.getSizeFromValue(e)}function R(e){return Object.freeze({...e,encode:t=>{const n=new Uint8Array(X(t,e));return e.write(t,n,0),n}})}function L(e){return Object.freeze({...e,decode:(t,n=0)=>e.read(t,n)[0]})}function U(e){return"fixedSize"in e&&typeof e.fixedSize=="number"}function Zs(e){if(!U(e))throw new $(Us)}function js(e){return!U(e)}function q(e,t){if(U(e)!==U(t))throw new $(Ns);if(U(e)&&U(t)&&e.fixedSize!==t.fixedSize)throw new $(Ws,{decoderFixedSize:t.fixedSize,encoderFixedSize:e.fixedSize});if(!U(e)&&!U(t)&&e.maxSize!==t.maxSize)throw new $(vs,{decoderMaxSize:t.maxSize,encoderMaxSize:e.maxSize});return{...t,...e,decode:t.decode,encode:e.encode,read:t.read,write:e.write}}function Ys(e,t,n=0){if(t.length-n<=0)throw new $(Bs,{codecDescription:e})}function Ht(e,t,n,r=0){const i=n.length-r;if(i<t)throw new $(Fs,{bytesLength:i,codecDescription:e,expected:t})}function Fr(e,t){const n=(o,s,u)=>{const c=e.encode(o);return u=t.write(c.length,s,u),s.set(c,u),u+c.length};if(U(t)&&U(e))return R({...e,fixedSize:t.fixedSize+e.fixedSize,write:n});const r=U(t)?t.fixedSize:t.maxSize??null,i=U(e)?e.fixedSize:e.maxSize??null,a=r!==null&&i!==null?r+i:null;return R({...e,...a!==null?{maxSize:a}:{}
1,getSizeFromValue:o=>{const s=X(o,e);return X(s,t)+s},write:n})}function Xs(e,t){const n=(o,s)=>{const[u,c]=t.read(o,s),d=Number(u);return s=c,(s>0||o.length>d)&&(o=o.slice(s,s+d)),Ht("addDecoderSizePrefix",d,o),[e.decode(o),s+d]};if(U(t)&&U(e))return L({...e,fixedSize:t.fixedSize+e.fixedSize,read:n});const r=U(t)?t.fixedSize:t.maxSize??null,i=U(e)?e.fixedSize:e.maxSize??null,a=r!==null&&i!==null?r+i:null;return L({...e,...a!==null?{maxSize:a}:{},read:n})}function Ur(e,t){return q(Fr(e,t),Xs(e,t))}function $t(e,t){return R({fixedSize:t,write:(n,r,i)=>{const a=e.encode(n),o=a.length>t?a.slice(0,t):a;return r.set(o,i),i+t}})}function Js(e,t){return L({fixedSize:t,read:(n,r)=>{Ht("fixCodecSize",t,n,r),(r>0||n.length>t)&&(n=n.slice(r,r+t)),U(e)&&(n=Vs(n,e.fixedSize));const[i]=e.read(n,0);return[i,r+t]}})}function kn(e,t){return q($t(e,t),Js(e,t))}function te(e,t){return R({...js(e)?{...e,getSizeFromValue:n=>e.getSizeFromValue(t(n))}:e,write:(n,r,i)=>e.write(t(n),r,i)})}function Qs(e,t){return L({...e,read:(n,r)=>{const[i,a]=e.read(n,r);return[t(i,n,r),a]}})}function eu(e,t,n,r){if(r<t||r>n)throw new $(Ls,{codecDescription:e,max:n,min:t,value:r})}function Nr(e){return(e==null?void 0:e.endian)!==1}function qt(e){return R({fixedSize:e.size,write(t,n,r){e.range&&eu(e.name,e.range[0],e.range[1],t);const i=new ArrayBuffer(e.size);return e.set(new DataView(i),t,Nr(e.config)),n.set(new Uint8Array(i),r),r+e.size}})}function Wr(e){return L({fixedSize:e.size,read(t,n=0){Ys(e.name,t,n),Ht(e.name,e.size,t,n);const r=new DataView(tu(t,n,e.size));return[e.get(r,Nr(e.config)),n+e.size]}})}function tu(e,t,n){const r=e.byteOffset+(t??0),i=n??e.byteLength;return e.buffer.slice(r,r+i)}var Vt=(e={})=>qt({config:e,name:"u32",range:[0,+"0xffffffff"],set:(t,n,r)=>t.setUint32(0,Number(n),r),size:4}),vr=(e={})=>Wr({config:e,get:(t,n)=>t.getUint32(0,n),name:"u32",size:4}),Rr=(e={})=>q(Vt(e),vr(e)),Sn=(e={})=>qt({config:e,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(t,n,r)=>t.setBigUint64(0,BigInt(n),r),size:8}),Zt=()=>qt({name:"u8",range:[0,+"0xff"],set:(e,t)=>e.setUint8(0,Number(t)),size:1}),nu=()=>Wr({get:e=>e.getUint8(0),name:"u8",size:1});function Or(e,t,n){if(t!==n)throw new $(Rs,{actual:n,codecDescription:e,expected:t})}function ru(e){return e.reduce((t,n)=>t===null||n===null?null:Math.max(t,n),0)}function J(e){return e.reduce((t,n)=>t===null||n===null?null:t+n,0)}function fe(e){return U(e)?e.fixedSize:null}function re(e){return U(e)?e.fixedSize:e.maxSize??null}function iu(e,t={}){const n=t.size??Vt(),r=wt(n,fe(e)),i=wt(n,re(e))??void 0;return R({...r!==null?{fixedSize:r}:{getSizeFromValue:a=>(typeof n=="object"?X(a.length,n):0)+[...a].reduce((s,u)=>s+X(u,e),0),maxSize:i},write:(a,o,s)=>(typeof n=="number"&&Or("array",n,a.length),typeof n=="object"&&(s=n.write(a.length,o,s)),a.forEach(u=>{s=e.write(u,o,s)}),s)})}function au(e,t={}){const n=t.size??vr(),r=fe(e),i=wt(n,r),a=wt(n,re(e))??void 0;return L({...i!==null?{fixedSize:i}:{maxSize:a},read:(o,s)=>{const u=[];if(typeof n=="object"&&o.slice(s).length===0)return[u,s];if(n==="remainder"){for(;s<o.length;){const[g,I]=e.read(o,s);s=I,u.push(g)}return[u,s]}const[c,d]=typeof n=="number"?[n,s]:n.read(o,s);s=d;for(let g=0;g<c;g+=1){const[I,P]=e.read(o,s);s=P,u.push(I)}return[u,s]}})}function ou(e,t={}){return q(iu(e,t),au(e,t))}function wt(e,t){return typeof e!="number"?null:e===0?0:t===null?null:t*e}function Lr(e={}){return te(e.size??Zt(),t=>t?1:0)}function jt(){return R({getSizeFromValue:e=>e.length,write:(e,t,n)=>(t.set(e,n),n+e.length)})}function su(){return L({read:(e,t)=>{const n=e.slice(t);return[n,t+n.length]}})}function In(){return q(jt(),su())}function uu(e){return R({fixedSize:e.length,write:(t,n,r)=>(n.set(e,r),r+e.length)})}function be(e){const t=J(e.map(fe)),n=J(e.map(re))??void 0;return R({...t===null?{getSizeFromValue:r=>e.map((i,a)=>X(r[a],i)).reduce((i,a)=>i+a,0),maxSize:n}:{fixedSize:t},write:(r,i,a)=>(Or("tuple",e.length,r.length),e.forEach((o,s)=>{a=o.write(r[s],i,a)}),a)})}function Gr(e){const t=J(e.map(fe)),n=J(e.map(re))??void 0;return L({...t===null?{maxSize:n}:{fixedSize:t},read:(r,i)=>{const a=[];return e.forEach(o=>{const[s,u]=o.read(r,i);a.push(s),i=u}),[a,i]}})}function Kr(e){return q(be(e),Gr(e))}function Hr(e,t){const n=$r(e),r=(a,o,s)=>{const u=t(a);return Pt(e,u),e[u].write(a,o,s)};if(n!==null)return R({fixedSize:n,write:r});const i=qr(e);return R({...i!==null?{maxSize:i}:{}
1,getSizeFromValue:a=>{const o=t(a);return Pt(e,o),X(a,e[o])},write:r})}function cu(e,t){const n=$r(e),r=(a,o)=>{const s=t(a,o);return Pt(e,s),e[s].read(a,o)};if(n!==null)return L({fixedSize:n,read:r});const i=qr(e);return L({...i!==null?{maxSize:i}:{},read:r})}function Pt(e,t){if(typeof e[t]>"u")throw new $(Gs,{maxRange:e.length-1,minRange:0,variant:t})}function $r(e){if(e.length===0)return 0;if(!U(e[0]))return null;const t=e[0].fixedSize;return e.every(r=>U(r)&&r.fixedSize===t)?t:null}function qr(e){return ru(e.map(t=>re(t)))}function lu(e,t={}){const n=t.discriminator??"__kind",r=t.size??Zt();return Hr(e.map(([,i],a)=>te(be([r,i]),o=>[a,o])),i=>wu(e,i[n]))}function fu(e,t={}){const n=t.discriminator??"__kind",r=t.size??nu();return cu(e.map(([i,a])=>Qs(Gr([r,a]),([,o])=>({[n]:i,...o}))),(i,a)=>Number(r.read(i,a)[0]))}function du(e,t={}){return q(lu(e,t),fu(e,t))}function wu(e,t){const n=e.findIndex(([r])=>t===r);if(n<0)throw new $(Os,{value:t,variants:e.map(([r])=>r)});return n}var hu=du;function Ie(){return R({fixedSize:0,write:(e,t,n)=>n})}function mu(){return L({fixedSize:0,read:(e,t)=>[void 0,t]})}function xt(){return q(Ie(),mu())}function de(e){const t=e.map(([,i])=>i),n=J(t.map(fe)),r=J(t.map(re))??void 0;return R({...n===null?{getSizeFromValue:i=>e.map(([a,o])=>X(i[a],o)).reduce((a,o)=>a+o,0),maxSize:r}:{fixedSize:n},write:(i,a,o)=>(e.forEach(([s,u])=>{o=u.write(i[s],a,o)}),o)})}function gu(e){const t=e.map(([,i])=>i),n=J(t.map(fe)),r=J(t.map(re))??void 0;return L({...n===null?{maxSize:r}:{fixedSize:n},read:(i,a)=>{const o={};return e.forEach(([s,u])=>{const[c,d]=u.read(i,a);a=d,o[s]=c}),[o,a]}})}function Vr(e){return q(de(e),gu(e))}var yu=e=>e.replace(/\u0000/g,""),bu=globalThis.TextDecoder,zn=globalThis.TextEncoder,Zr=()=>{let e;return R({getSizeFromValue:t=>(e||(e=new zn)).encode(t).length,write:(t,n,r)=>{const i=(e||(e=new zn)).encode(t);return n.set(i,r),r+i.length}})},Au=()=>{let e;return L({read(t,n){const r=(e||(e=new bu)).decode(t.slice(n));return[yu(r),t.length]}})},jr=()=>q(Zr(),Au()),pu=e=>({__option:"Some",value:e}),ku=()=>({__option:"None"}),En=e=>!!(e&&typeof e=="object"&&"__option"in e&&(e.__option==="Some"&&"value"in e||e.__option==="None")),Cn=e=>e.__option==="Some",Su=e=>e!==null?pu(e):ku();function Tn(e,t={}){const n=t.prefix===null?te(Ie(),i=>{}):Lr({size:t.prefix??Zt()}),r=t.noneValue==="zeroes"?(Zs(e),$t(Ie(),e.fixedSize)):t.noneValue?uu(t.noneValue):Ie();return Hr([te(be([n,r]),i=>[!1,void 0]),te(be([n,e]),i=>[!0,En(i)&&Cn(i)?i.value:i])],i=>{const a=En(i)?i:Su(i);return Number(Cn(a))})}var j;(function(e){e[e.Name=0]="Name",e[e.Symbol=1]="Symbol",e[e.Uri=2]="Uri"})(j||(j={}));const Iu=()=>[["Name",xt()],["Symbol",xt()],["Uri",xt()],["Key",Vr([["value",Kr([Ur(jr(),Rr())])]])]];function zu(e){return e===j.Name||e==="Name"||e==="name"?{__kind:"Name"}:e===j.Symbol||e==="Symbol"||e==="symbol"?{__kind:"Symbol"}:e===j.Uri||e==="Uri"||e==="uri"?{__kind:"Uri"}:{__kind:"Key",value:[e]}}function Se(e,t){return te(be([jt(),t]),n=>[e,n])}function Eu(){return te($t(jt(),32),e=>e.toBytes())}function ge(){return Fr(Zr(),Vt())}function Yr(e){const{programId:t,metadata:n,updateAuthority:r,mint:i,mintAuthority:a,name:o,symbol:s,uri:u}=e;return new y({programId:t,keys:[{isSigner:!1,isWritable:!0,pubkey:n},{isSigner:!1,isWritable:!1,pubkey:r},{isSigner:!1,isWritable:!1,pubkey:i},{isSigner:!0,isWritable:!1,pubkey:a}],data:Buffer.from(Se(new Uint8Array([210,225,30,162,88,184,77,141]),de([["name",ge()],["symbol",ge()],["uri",ge()]])).encode({name:o,symbol:s,uri:u}))})}function Xr(e){const{programId:t,metadata:n,updateAuthority:r,field:i,value:a}=e;return new y({programId:t,keys:[{isSigner:!1,isWritable:!0,pubkey:n},{isSigner:!0,isWritable:!1,pubkey:r}],data:Buffer.from(Se(new Uint8Array([221,233,49,45,181,202,220,200]),de([["field",hu(Iu())],["value",ge()]])).encode({field:zu(i),value:a}))})}function Cu(e){const{programId:t,metadata:n,updateAuthority:r,key:i,idempotent:a}=e;return new y({programId:t,keys:[{isSigner:!1,isWritable:!0,pubkey:n},{isSigner:!0,isWritable:!1,pubkey:r}],data:Buffer.from(Se(new Uint8Array([234,18,32,56,89,141,37,181]),de([["
1idempotent",Lr()],["key",ge()]])).encode({idempotent:a,key:i}))})}function Tu(e){const{programId:t,metadata:n,oldAuthority:r,newAuthority:i}=e;return new y({programId:t,keys:[{isSigner:!1,isWritable:!0,pubkey:n},{isSigner:!0,isWritable:!1,pubkey:r}],data:Buffer.from(Se(new Uint8Array([215,228,166,228,84,100,86,123]),de([["newAuthority",Eu()]])).encode({newAuthority:i??W.programId}))})}function Tl(e){const{programId:t,metadata:n,start:r,end:i}=e;return new y({programId:t,keys:[{isSigner:!1,isWritable:!1,pubkey:n}],data:Buffer.from(Se(new Uint8Array([250,166,180,250,13,12,184,70]),de([["start",Tn(Sn())],["end",Tn(Sn())]])).encode({start:r??null,end:i??null}))})}Buffer.from([112,132,90,90,11,88,157,87]);function he(){return Ur(jr(),Rr())}const Jr=Vr([["updateAuthority",kn(In(),32)],["mint",kn(In(),32)],["name",he()],["symbol",he()],["uri",he()],["additionalMetadata",ou(Kr([he(),he()]))]]);function Mu(e){for(let t=0;t<e.length;t++)if(e[t]!==0)return!1;return!0}function Qr(e){const t=e.updateAuthority??S.default;return Jr.encode({...e,updateAuthority:t.toBuffer(),mint:e.mint.toBuffer()})}function ei(e){const t=Jr.decode(e);return Mu(t.updateAuthority)?{mint:new S(t.mint),name:t.name,symbol:t.symbol,uri:t.uri,additionalMetadata:t.additionalMetadata}:{updateAuthority:new S(t.updateAuthority),mint:new S(t.mint),name:t.name,symbol:t.symbol,uri:t.uri,additionalMetadata:t.additionalMetadata}}const _u=e=>e===j.Name||e==="Name"||e==="name"?"name":e===j.Symbol||e==="Symbol"||e==="symbol"?"symbol":e===j.Uri||e==="Uri"||e==="uri"?"uri":e;function xu(e,t,n){const r=_u(t);if(r==="mint"||r==="updateAuthority")throw new Error(`Cannot update ${r} via this instruction`);if(["name","symbol","uri"].includes(r))return{...e,[r]:n};const i=[...e.additionalMetadata],a=e.additionalMetadata.findIndex(o=>o[0]===r);return a===-1?i.push([r,n]):i[a]=[r,n],{...e,additionalMetadata:i}}async function Ml(e,t,n,r=b){const i=await Mt(e,t,n,r),a=F(l.TokenMetadata,i.tlvData);return a===null?null:ei(a)}async function Du(e,t,n,r=b){const i=await e.getAccountInfo(t);if(!i)throw new ue;const a=Qr(n).length,o=Cr(i,t,l.TokenMetadata,a,r);return o<=i.data.length?0:await e.getMinimumBalanceForRentExemption(o)-i.lamports}async function Pu(e,t,n,r,i=b){const a=await e.getAccountInfo(t);if(!a)throw new ue;const o=ke(t,a,i),s=F(l.TokenMetadata,o.tlvData);if(s===null)throw new Error("TokenMetadata extension not initialized");const u=xu(ei(s),n,r),c=Qr(u).length,d=Cr(a,t,l.TokenMetadata,c,i);return d<=a.data.length?0:await e.getMinimumBalanceForRentExemption(d)-a.lamports}async function _l(e,t,n,r,i,a,o,s,u=[],c,d=b){const[g,I]=z(i,u),P=new A().add(Yr({programId:d,metadata:n,updateAuthority:r,mint:n,mintAuthority:g,name:a,symbol:o,uri:s}));return await p(e,P,[t,...I],c)}async function xl(e,t,n,r,i,a,o,s,u=[],c,d=b){const[g,I]=z(i,u),P=new A,V=await Du(e,n,{updateAuthority:r,mint:n,name:a,symbol:o,uri:s,additionalMetadata:[]},d);return V>0&&P.add(W.transfer({fromPubkey:t.publicKey,toPubkey:n,lamports:V})),P.add(Yr({programId:d,metadata:n,updateAuthority:r,mint:n,mintAuthority:g,name:a,symbol:o,uri:s})),await p(e,P,[t,...I],c)}async function Dl(e,t,n,r,i,a,o=[],s,u=b){const[c,d]=z(r,o),g=new A().add(Xr({programId:u,metadata:n,updateAuthority:c,field:i,value:a}));return await p(e,g,[t,...d],s)}async function Pl(e,t,n,r,i,a,o=[],s,u=b){const[c,d]=z(r,o),g=new A,I=await Pu(e,n,i,a,u);return I>0&&g.add(W.transfer({fromPubkey:t.publicKey,toPubkey:n,lamports:I})),g.add(Xr({programId:u,metadata:n,updateAuthority:c,field:i,value:a})),await p(e,g,[t,...d],s)}async function Bl(e,t,n,r,i,a,o=[],s,u=b){const[c,d]=z(r,o),g=new A().add(Cu({programId:u,metadata:n,updateAuthority:c,key:i,idempotent:a}));return await p(e,g,[t,...d],s)}async function Fl(e,t,n,r,i,a=[],o,s=b){const[u,c]=z(r,a),d=new A().add(Tu({programId:s,metadata:n,oldAuthority:u,newAuthority:i}));return await p(e,d,[t,...c],o)}const ht=m([w("instruction"),k("owner")]);function Ul(e,t,n,r=h){const i=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!1},{pubkey:pt,isSigner:!1,isWritable:!1}],a=Buffer.alloc(ht.span);return ht.encode({instruction:f.InitializeAccount2,owner:n}
1,a),new y({keys:i,programId:r,data:a})}function Bu(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==ht.span)throw new C;const{keys:{account:n,mint:r,rent:i},data:a}=Fu(e);if(a.instruction!==f.InitializeAccount2)throw new E;if(!n||!r||!i)throw new M;return{programId:t,keys:{account:n,mint:r,rent:i},data:a}}function Fu({programId:e,keys:[t,n,r],data:i}){return{programId:e,keys:{account:t,mint:n,rent:r},data:ht.decode(i)}}const mt=m([w("instruction"),k("owner")]);function Nl(e,t,n,r=h){const i=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!1,isWritable:!1}],a=Buffer.alloc(mt.span);return mt.encode({instruction:f.InitializeAccount3,owner:n},a),new y({keys:i,programId:r,data:a})}function Uu(e,t=h){if(!e.programId.equals(t))throw new T;if(e.data.length!==mt.span)throw new C;const{keys:{account:n,mint:r},data:i}=Nu(e);if(i.instruction!==f.InitializeAccount3)throw new E;if(!n||!r)throw new M;return{programId:t,keys:{account:n,mint:r},data:i}}function Nu({programId:e,keys:[t,n],data:r}){return{programId:e,keys:{account:t,mint:n},data:mt.decode(r)}}function Wl(e,t=h){if(!e.data.length)throw new C;const n=w().decode(e.data);if(n===f.InitializeMint)return _s(e,t);if(n===f.InitializeAccount)return Ho(e,t);if(n===f.InitializeMultisig)return Qo(e,t);if(n===f.Transfer)return Is(e,t);if(n===f.Approve)return xo(e,t);if(n===f.Revoke)return hs(e,t);if(n===f.SetAuthority)return ys(e,t);if(n===f.MintTo)return us(e,t);if(n===f.Burn)return No(e,t);if(n===f.CloseAccount)return Go(e,t);if(n===f.FreezeAccount)return as(e,t);if(n===f.ThawAccount)return ps(e,t);if(n===f.TransferChecked)return Na(e,t);if(n===f.ApproveChecked)return Bo(e,t);if(n===f.MintToChecked)return fs(e,t);if(n===f.BurnChecked)return Ro(e,t);if(n===f.InitializeAccount2)return Bu(e,t);if(n===f.SyncNative)return ns(e,t);if(n===f.InitializeAccount3)return Uu(e,t);if(n===f.InitializeMint2)return Yo(e,t);if(n===f.AmountToUiAmount)return gi(e,t);if(n===f.UiAmountToAmount)return Cs(e,t);throw n===f.InitializeMultisig2?new E:new E}function vl(e){return e.data.instruction===f.InitializeMint}function Rl(e){return e.data.instruction===f.InitializeAccount}function Ol(e){return e.data.instruction===f.InitializeMultisig}function Ll(e){return e.data.instruction===f.Transfer}function Gl(e){return e.data.instruction===f.Approve}function Kl(e){return e.data.instruction===f.Revoke}function Hl(e){return e.data.instruction===f.SetAuthority}function $l(e){return e.data.instruction===f.MintTo}function ql(e){return e.data.instruction===f.Burn}function Vl(e){return e.data.instruction===f.CloseAccount}function Zl(e){return e.data.instruction===f.FreezeAccount}function jl(e){return e.data.instruction===f.ThawAccount}function Yl(e){return e.data.instruction===f.TransferChecked}function Xl(e){return e.data.instruction===f.ApproveChecked}function Jl(e){return e.data.instruction===f.MintToChecked}function Ql(e){return e.data.instruction===f.BurnChecked}function ef(e){return e.data.instruction===f.InitializeAccount2}function tf(e){return e.data.instruction===f.SyncNative}function nf(e){return e.data.instruction===f.InitializeAccount3}function rf(e){return e.data.instruction===f.InitializeMint2}function af(e){return e.data.instruction===f.AmountToUiAmount}function of(e){return e.data.instruction===f.UiAmountToAmount}const gt=m([w("instruction")]);function sf(e,t){const n=[{pubkey:e,isSigner:!1,isWritable:!0}],r=Buffer.alloc(gt.span);return gt.encode({instruction:f.InitializeImmutableOwner},r),new y({keys:n,programId:t,data:r})}function uf(e,t){if(!e.programId.equals(t))throw new T;if(e.data.length!==gt.span)throw new C;const{keys:{account:n},data:r}=Wu(e);if(r.instruction!==f.InitializeImmutableOwner)throw new E;if(!n)throw new M;return{programId:t,keys:{account:n},data:r}}function Wu({programId:e,keys:[t],data:n}){const{instruction:r}=gt.decode(n);return{programId:e,keys:{account:t},data:{instruction:r}}}const yt=m([w("instruction"),new oe("closeAuthority")]);function cf(e,t,n){if(!x(n))throw new D;const r=[{pubkey:e,isSigner:!1,isWritable:!0}],i=Buffer.alloc(34);return yt.encode({instruction:f.InitializeMintCloseAuthority,closeAuthority:t}
1,i),new y({keys:r,programId:n,data:i.subarray(0,yt.getSpan(i))})}function lf(e,t){if(!e.programId.equals(t))throw new T;if(e.data.length!==yt.getSpan(e.data))throw new C;const{keys:{mint:n},data:r}=vu(e);if(r.instruction!==f.InitializeMintCloseAuthority)throw new E;if(!n)throw new M;return{programId:t,keys:{mint:n},data:r}}function vu({programId:e,keys:[t],data:n}){const{instruction:r,closeAuthority:i}=yt.decode(n);return{programId:e,keys:{mint:t},data:{instruction:r,closeAuthority:i}}}function ff(e,t,n,r,i=[],a=b){if(!x(a))throw new D;const o=[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:t,isSigner:!0,isWritable:!0},{pubkey:W.programId,isSigner:!1,isWritable:!1}],s=_(o,r,i),u=m([w("instruction"),_n(At(),n.length,"extensionTypes")]),c=Buffer.alloc(u.span);return u.encode({instruction:f.Reallocate,extensionTypes:n},c),new y({keys:s,programId:a,data:c})}const Mn=m([w("instruction")]);function df(e,t){if(!x(t))throw new D;const n=[{pubkey:e,isSigner:!1,isWritable:!0}],r=Buffer.alloc(Mn.span);return Mn.encode({instruction:f.InitializeNonTransferableMint},r),new y({keys:n,programId:t,data:r})}const bt=m([w("instruction"),k("delegate")]);function wf(e,t,n){if(!x(n))throw new D;const r=[{pubkey:e,isSigner:!1,isWritable:!0}],i=Buffer.alloc(bt.span);return bt.encode({instruction:f.InitializePermanentDelegate,delegate:t||new S(0)},i),new y({keys:r,programId:n,data:i})}function hf(e,t){if(!e.programId.equals(t))throw new T;if(e.data.length!==bt.span)throw new C;const{keys:{mint:n},data:r}=Ru(e);if(r.instruction!==f.InitializePermanentDelegate)throw new E;if(!n)throw new M;return{programId:t,keys:{mint:n},data:r}}function Ru({programId:e,keys:[t],data:n}){const{instruction:r,delegate:i}=bt.decode(n);return{programId:e,keys:{mint:t},data:{instruction:r,delegate:i}}}export{G as ACCOUNT_SIZE,Nt as ACCOUNT_TYPE_SIZE,O as ASSOCIATED_TOKEN_PROGRAM_ID,Wn as AccountLayout,_e as AccountState,Me as AccountType,dn as AuthorityType,zi as CPI_GUARD_SIZE,xe as CpiGuardInstruction,On as CpiGuardLayout,Ti as DEFAULT_ACCOUNT_STATE_SIZE,De as DefaultAccountStateInstruction,Ln as DefaultAccountStateLayout,l as ExtensionType,io as ExtraAccountMetaAccountDataLayout,un as ExtraAccountMetaLayout,ro as ExtraAccountMetaListLayout,ra as GROUP_MEMBER_POINTER_SIZE,ia as GROUP_POINTER_SIZE,ut as GroupMemberPointerInstruction,tr as GroupMemberPointerLayout,ct as GroupPointerInstruction,nr as GroupPointerLayout,aa as IMMUTABLE_OWNER_SIZE,oa as INTEREST_BEARING_MINT_CONFIG_STATE_SIZE,rr as ImmutableOwnerLayout,ir as InterestBearingMintConfigStateLayout,ft as InterestBearingMintInstruction,ho as LENGTH_SIZE,Da as MAX_FEE_BASIS_POINTS,ca as MEMO_TRANSFER_SIZE,la as METADATA_POINTER_SIZE,fa as MINT_CLOSE_AUTHORITY_SIZE,me as MINT_SIZE,ce as MULTISIG_SIZE,Ue as MemoTransferInstruction,sr as MemoTransferLayout,dt as MetadataPointerInstruction,ur as MetadataPointerLayout,cr as MintCloseAuthorityLayout,Tr as MintLayout,Nn as MultisigLayout,ai as NATIVE_MINT,xn as NATIVE_MINT_2022,wa as NON_TRANSFERABLE_ACCOUNT_SIZE,da as NON_TRANSFERABLE_SIZE,Et as NonTransferableLayout,on as ONE_IN_BASIS_POINTS,ya as PAUSABLE_ACCOUNT_SIZE,ga as PAUSABLE_CONFIG_SIZE,ba as PERMANENT_DELEGATE_SIZE,fr as PausableAccountLayout,lr as PausableConfigLayout,ye as PausableInstruction,dr as PermanentDelegateLayout,pa as SCALED_UI_AMOUNT_CONFIG_SIZE,wr as ScaledUiAmountConfigLayout,Ne as ScaledUiAmountInstruction,b as TOKEN_2022_PROGRAM_ID,er as TOKEN_GROUP_MEMBER_SIZE,Jn as TOKEN_GROUP_SIZE,h as TOKEN_PROGRAM_ID,Ua as TRANSFER_FEE_AMOUNT_SIZE,Ba as TRANSFER_FEE_CONFIG_SIZE,to as TRANSFER_HOOK_ACCOUNT_SIZE,eo as TRANSFER_HOOK_SIZE,Tt as TYPE_SIZE,ue as TokenAccountNotFoundError,N as TokenError,f as TokenInstruction,Gu as TokenInvalidAccountDataError,wi as TokenInvalidAccountError,kt as TokenInvalidAccountOwnerError,ie as TokenInvalidAccountSizeError,C as TokenInvalidInstructionDataError,M as TokenInvalidInstructionKeysError,T as TokenInvalidInstructionProgramError,E as TokenInvalidInstructionTypeError,Dn as TokenInvalidMintError,hi as TokenInvalidOwnerError,Pn as TokenOwnerOffCurveError,Fn as TokenTransferHookAccountDataNotFound,Bn as TokenTransferHookAccountNotFound,Ut as TokenTransferHookInvalidPubkeyData,H as TokenTransferHookInvalidSeed,Un as TokenTransferHookPubkeyDataTooSmall,D as TokenUnsupportedInstructionError,yr as TransferFeeAmountLayout,gr as TransferFeeConfigLayout,v as TransferFeeInstruction,kr as TransferHookAccountLayout,He as TransferHookInstruction,Ar as TransferHookLayout,Sr as addExtraAccountMetasF
1orExecute,Vc as amountToUiAmount,Eo as amountToUiAmountForInterestBearingMintWithoutSimulation,Zc as amountToUiAmountForMintWithoutSimulation,Co as amountToUiAmountForScaledUiAmountMintWithoutSimulation,Te as amountToUiAmountInstructionData,Yc as approve,Xc as approveChecked,Ve as approveCheckedInstructionData,qe as approveInstructionData,Jc as burn,Qc as burnChecked,je as burnCheckedInstructionData,Ze as burnInstructionData,Nc as calculateEpochFee,Pa as calculateFee,el as closeAccount,Ye as closeAccountInstructionData,Jt as cpiGuardInstructionData,Zo as createAccount,mi as createAmountToUiAmountInstruction,Po as createApproveCheckedInstruction,_o as createApproveInstruction,Vo as createAssociatedTokenAccount,nl as createAssociatedTokenAccountIdempotent,xr as createAssociatedTokenAccountIdempotentInstruction,tl as createAssociatedTokenAccountIdempotentInstructionWithDerivation,Kt as createAssociatedTokenAccountInstruction,vo as createBurnCheckedInstruction,Uo as createBurnInstruction,Lo as createCloseAccountInstruction,ts as createCreateNativeMintInstruction,Ii as createDisableCpiGuardInstruction,ua as createDisableRequiredMemoTransfersInstruction,Tl as createEmitInstruction,Si as createEnableCpiGuardInstruction,sa as createEnableRequiredMemoTransfersInstruction,lo as createExecuteInstruction,is as createFreezeAccountInstruction,Ta as createHarvestWithheldTokensToMintInstruction,Ul as createInitializeAccount2Instruction,Nl as createInitializeAccount3Instruction,_r as createInitializeAccountInstruction,Ei as createInitializeDefaultAccountStateInstruction,jn as createInitializeGroupInstruction,Al as createInitializeGroupMemberPointerInstruction,kl as createInitializeGroupPointerInstruction,sf as createInitializeImmutableOwnerInstruction,Yr as createInitializeInstruction,Ds as createInitializeInterestBearingMintInstruction,Yn as createInitializeMemberInstruction,El as createInitializeMetadataPointerInstruction,jo as createInitializeMint2Instruction,cf as createInitializeMintCloseAuthorityInstruction,Ms as createInitializeMintInstruction,Jo as createInitializeMultisigInstruction,df as createInitializeNonTransferableMintInstruction,gc as createInitializePausableConfigInstruction,wf as createInitializePermanentDelegateInstruction,Sc as createInitializeScaledUiAmountConfigInstruction,zc as createInitializeTransferFeeConfigInstruction,so as createInitializeTransferHookInstruction,Il as createInterestBearingMint,rl as createMint,ls as createMintToCheckedInstruction,ss as createMintToInstruction,il as createMultisig,al as createNativeMint,fn as createNativeMintInstructionData,ha as createPauseInstruction,ff as createReallocateInstruction,qo as createRecoverNestedInstruction,Cu as createRemoveKeyInstruction,ma as createResumeInstruction,ws as createRevokeInstruction,gs as createSetAuthorityInstruction,_a as createSetTransferFeeInstruction,Pr as createSyncNativeInstruction,As as createThawAccountInstruction,br as createTransferCheckedInstruction,wo as createTransferCheckedWithFeeAndTransferHookInstruction,mr as createTransferCheckedWithFeeInstruction,fo as createTransferCheckedWithTransferHookInstruction,Ss as createTransferInstruction,Es as createUiAmountToAmountInstruction,Tu as createUpdateAuthorityInstruction,Ci as createUpdateDefaultAccountStateInstruction,Xr as createUpdateFieldInstruction,Qi as createUpdateGroupAuthorityInstruction,Ji as createUpdateGroupMaxSizeInstruction,pl as createUpdateGroupMemberPointerInstruction,Sl as createUpdateGroupPointerInstruction,Cl as createUpdateMetadataPointerInstruction,Aa as createUpdateMultiplierDataInstruction,Ps as createUpdateRateInterestBearingMintInstruction,uo as createUpdateTransferHookInstruction,Ea as createWithdrawWithheldTokensFromAccountsInstruction,Ia as createWithdrawWithheldTokensFromMintInstruction,ol as createWrappedNativeAccount,gi as decodeAmountToUiAmountInstruction,yi as decodeAmountToUiAmountInstructionUnchecked,Bo as decodeApproveCheckedInstruction,Fo as decodeApproveCheckedInstructionUnchecked,xo as decodeApproveInstruction,Do as decodeApproveInstructionUnchecked,Ro as decodeBurnCheckedInstruction,Oo as decodeBurnCheckedInstructionUnchecked,No as decodeBurnInstruction,Wo as decodeBurnInstructionUnchecked,Go as decodeCloseAccountInstruction,Ko as decodeCloseAccountInstructionUnchecked,as as decodeFreezeAccountInstruction,os as decodeFreezeAccountInstructionUnchecked,_c as decodeHarvestWithheldTokensToMintInstruction,Ma as decodeHarvestWithheldTokensToMintInstructionUnchecked,Bu as decodeInitializeAccount2Instruction,Fu as decodeInitializeAccount2InstructionUnchecked,Uu as decodeInitializeAccount3Instruction,Nu as decodeInitializeAccount3InstructionUnchecked,Ho as decodeInitializeAccountInstruction,$o as decodeInitializeAccountInstructionUnchecked,uf as decodeInitializeImmutableOwnerInstruction,Wu as decodeInitializeImmutableOwnerInstructionUnchecked,Yo as decodeInitializeMint2Instruction,Xo as decodeInitializeMint2InstructionUnchecked,lf as decodeInitializeMintCloseAuthorityInstruction,vu as decodeInitializeMintCloseAuthorityInstructionUnchecked,_s as decodeInitializeMintInstruction,xs as decodeInitializeMintInstructionUnchecked,Qo as decodeInitializeMultisigInstruction,es as decodeInitializeMultisigInstructionUnchecked,hf as decodeInitializePermanentDelegateInstruction,Ru as decodeInitializePermanentDelegateInstructionUnchecked,Ec as decodeInitializeTransferFeeConfigInstruction,ka as decodeInitializeTransferFeeConfigInstructionUnchecked,Wl as decodeInstruction,fs as decodeMintToCheckedInstruction,ds as decodeMintToCheckedInstructionUnchecked,us as decodeMintToInstruction,cs as decodeMintToInstructionUnchecked,hs as decodeRevokeInstru
1ction,ms as decodeRevokeInstructionUnchecked,ys as decodeSetAuthorityInstruction,bs as decodeSetAuthorityInstructionUnchecked,xc as decodeSetTransferFeeInstruction,xa as decodeSetTransferFeeInstructionUnchecked,ns as decodeSyncNativeInstruction,rs as decodeSyncNativeInstructionUnchecked,ps as decodeThawAccountInstruction,ks as decodeThawAccountInstructionUnchecked,Na as decodeTransferCheckedInstruction,Wa as decodeTransferCheckedInstructionUnchecked,Cc as decodeTransferCheckedWithFeeInstruction,Sa as decodeTransferCheckedWithFeeInstructionUnchecked,Is as decodeTransferInstruction,zs as decodeTransferInstructionUnchecked,Cs as decodeUiAmountToAmountInstruction,Ts as decodeUiAmountToAmountInstructionUnchecked,Mc as decodeWithdrawWithheldTokensFromAccountsInstruction,Ca as decodeWithdrawWithheldTokensFromAccountsInstructionUnchecked,Tc as decodeWithdrawWithheldTokensFromMintInstruction,za as decodeWithdrawWithheldTokensFromMintInstructionUnchecked,Pe as defaultAccountStateInstructionData,qu as disableCpiGuard,lc as disableRequiredMemoTransfers,$u as enableCpiGuard,cc as enableRequiredMemoTransfers,sl as freezeAccount,tt as freezeAccountInstructionData,Xt as getAccount,Er as getAccountLen,Ao as getAccountLenForMint,yo as getAccountTypeOfMintType,qc as getAssociatedTokenAddress,Z as getAssociatedTokenAddressSync,Vu as getCpiGuard,Yu as getDefaultAccountState,Fa as getEpochFee,F as getExtensionData,bo as getExtensionTypes,no as getExtraAccountMetaAddress,ao as getExtraAccountMetas,oc as getGroupMemberPointerState,sc as getGroupPointerState,uc as getImmutableOwner,ar as getInterestBearingMintConfigState,fc as getMemoTransfer,dc as getMetadataPointerState,pi as getMinimumBalanceForRentExemptAccount,ki as getMinimumBalanceForRentExemptAccountWithExtensions,po as getMinimumBalanceForRentExemptMint,ko as getMinimumBalanceForRentExemptMintWithExtensions,Ai as getMinimumBalanceForRentExemptMultisig,Mt as getMint,wc as getMintCloseAuthority,zr as getMintLen,Hu as getMultipleAccounts,Ku as getMultisig,Cr as getNewAccountLenForExtensionLen,hc as getNonTransferable,mc as getNonTransferableAccount,ul as getOrCreateAssociatedTokenAccount,pc as getPausableAccount,Ac as getPausableConfig,kc as getPermanentDelegate,hr as getScaledUiAmountConfig,ac as getTokenGroupMemberState,ic as getTokenGroupState,Ml as getTokenMetadata,vc as getTransferFeeAmount,Wc as getTransferFeeConfig,pr as getTransferHook,Rc as getTransferHookAccount,go as getTypeLen,Fc as harvestWithheldTokensToMint,Le as harvestWithheldTokensToMintInstructionData,ht as initializeAccount2InstructionData,mt as initializeAccount3InstructionData,Xe as initializeAccountInstructionData,Zu as initializeDefaultAccountState,wn as initializeGroupMemberPointerData,mn as initializeGroupPointerData,gt as initializeImmutableOwnerInstructionData,An as initializeMetadataPointerData,Je as initializeMint2InstructionData,yt as initializeMintCloseAuthorityInstructionData,lt as initializeMintInstructionData,Qe as initializeMultisigInstructionData,Mn as initializeNonTransferableMintInstructionData,en as initializePausableConfigInstructionData,bt as initializePermanentDelegateInstructionData,rn as initializeScaledUiAmountConfigInstructionData,We as initializeTransferFeeConfigInstructionData,Oc as initializeTransferHook,cn as initializeTransferHookInstructionData,yn as interestBearingMintInitializeInstructionData,bn as interestBearingMintUpdateRateInstructionData,$c as isAccountExtension,af as isAmountToUiAmountInstruction,Xl as isApproveCheckedInstruction,Gl as isApproveInstruction,Ql as isBurnCheckedInstruction,ql as isBurnInstruction,Vl as isCloseAccountInstruction,Zl as isFreezeAccountInstruction,ef as isInitializeAccount2Instruction,nf as isInitializeAccount3Instruction,Rl as isInitializeAccountInstruction,rf as isInitializeMint2Instruction,vl as isInitializeMintInstruction,Ol as isInitializeMultisigInstruction,Hc as isMintExtension,Jl as isMintToCheckedInstruction,$l as isMintToInstruction,Kl as isRevokeInstruction,Hl as isSetAuthorityInstruction,tf as isSyncNativeInstruction,jl as isThawAccountInstruction,Yl as isTransferCheckedInstruction,Ll as isTransferInstru
1ction,of as isUiamountToAmountInstruction,Qt as memoTransferInstructionData,cl as mintTo,ll as mintToChecked,rt as mintToCheckedInstructionData,nt as mintToInstructionData,yc as pause,tn as pauseInstructionData,x as programSupportsExtensions,fl as recoverNested,oo as resolveExtraAccountMeta,bc as resume,nn as resumeInstructionData,dl as revoke,it as revokeInstructionData,wl as setAuthority,at as setAuthorityInstructionData,Uc as setTransferFee,Ge as setTransferFeeInstructionData,hl as syncNative,et as syncNativeInstructionData,ml as thawAccount,ot as thawAccountInstructionData,Ju as tokenGroupInitializeGroup,Qu as tokenGroupInitializeGroupWithRentTransfer,nc as tokenGroupMemberInitialize,rc as tokenGroupMemberInitializeWithRentTransfer,tc as tokenGroupUpdateGroupAuthority,ec as tokenGroupUpdateGroupMaxSize,_l as tokenMetadataInitialize,xl as tokenMetadataInitializeWithRentTransfer,Bl as tokenMetadataRemoveKey,Fl as tokenMetadataUpdateAuthority,Dl as tokenMetadataUpdateField,Pl as tokenMetadataUpdateFieldWithRentTransfer,gl as transfer,yl as transferChecked,Ke as transferCheckedInstructionData,Dc as transferCheckedWithFee,Kc as transferCheckedWithFeeAndTransferHook,ve as transferCheckedWithFeeInstructionData,Gc as transferCheckedWithTransferHook,sn as transferFeeLayout,st as transferInstructionData,bl as uiAmountToAmount,To as uiAmountToAmountForInterestBearingMintWithoutSimulation,jc as uiAmountToAmountForMintWithoutSimulation,Mo as uiAmountToAmountForScaledUiAmountMintWithoutSimulation,vn as unpackAccount,ke as unpackMint,bi as unpackMultisig,Xa as unpackPubkeyData,Ya as unpackSeeds,ju as updateDefaultAccountState,hn as updateGroupMemberPointerData,gn as updateGroupPointerData,pn as updateMetadataPointerData,Ic as updateMultiplier,an as updateMultiplierData,zl as updateRateInterestBearingMint,xu as updateTokenMetadata,Lc as updateTransferHook,ln as updateTransferHookInstructionData,Bc as withdrawWithheldTokensFromAccounts,Oe as withdrawWithheldTokensFromAccountsInstructionData,Pc as withdrawWithheldTokensFromMint,Re as withdrawWithheldTokensFromMintInstructionData};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.