PageSourceSearch

https://xota.ai/_next/static/chunks/3a91511d.8d60a38d300ffded.js

js xota.ai collected 2026-10-05 15:59:47 UTC 66,914 bytes, 7 lines download raw bytes

vendor: 35,816 bytes, lines 1-7
1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3814],{64024:function(e,t,r){r.d(t,{GS:function(){return j},RG:function(){return eZ},nh:function(){return v}});var n=r(82957),i=r(61857),s=r(44373),a=r.n(s),o=r(59147),u=r.n(o),l=r(29272),c=r(88806),d=r(69028),p=r(21089),g=r(59367);r(69983),r(44633);var h=r(92530),y=r(71629);i.UN.utils.randomPrivateKey;let b=()=>{let e=i.UN.utils.randomPrivateKey(),t=m(e),r=new Uint8Array(64);return r.set(e),r.set(t,32),{publicKey:t,secretKey:r}},m=i.UN.getPublicKey;function f(e){try{return i.UN.ExtendedPoint.fromHex(e),!0}catch{return!1}}let k=(e,t)=>i.UN.sign(e,t.slice(0,32)),S=i.UN.verify,I=e=>n.Buffer.isBuffer(e)?e:e instanceof Uint8Array?n.Buffer.from(e.buffer,e.byteOffset,e.byteLength):n.Buffer.from(e);class w{constructor(e){Object.assign(this,e)}encode(){return n.Buffer.from((0,c.serialize)(A,this))}static decode(e){return(0,c.deserialize)(A,this,e)}static decodeUnchecked(e){return(0,c.deserializeUnchecked)(A,this,e)}}let A=new Map,x=1;class v extends w{constructor(e){if(super({}),this._bn=void 0,void 0!==e._bn)this._bn=e._bn;else{if("string"==typeof e){let t=u().decode(e);if(32!=t.length)throw Error("Invalid public key input");this._bn=new(a())(t)}else this._bn=new(a())(e);if(this._bn.byteLength()>32)throw Error("Invalid public key input")}}static unique(){let e=new v(x);return x+=1,new v(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return u().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){let e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){let e=this._bn.toArrayLike(n.Buffer);if(32===e.length)return e;let t=n.Buffer.alloc(32);return e.copy(t,32-e.length),t}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,t,r){let i=n.Buffer.concat([e.toBuffer(),n.Buffer.from(t),r.toBuffer()]);return new v((0,l.J)(i))}static createProgramAddressSync(e,t){let r=n.Buffer.alloc(0);e.forEach(function(e){if(e.length>32)throw TypeError("Max seed length exceeded");r=n.Buffer.concat([r,I(e)])}),r=n.Buffer.concat([r,t.toBuffer(),n.Buffer.from("ProgramDerivedAddress")]);let i=(0,l.J)(r);if(f(i))throw Error("Invalid seeds, address must fall off the curve");return new v(i)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let r,i=255;for(;0!=i;){try{let s=e.concat(n.Buffer.from([i]));r=this.createProgramAddressSync(s,t)}catch(e){if(e instanceof TypeError)throw e;i--;continue}return[r,i]}throw Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){return f(new v(e).toBytes())}}v.default=new v("11111111111111111111111111111111"),A.set(v,{kind:"struct",fields:[["_bn","u256"]]}),new v("BPFLoader1111111111111111111111111111111111");class B extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}}Object.defineProperty(B.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class W extends Error{constructor(e,t){super(`Transaction was not confirmed in ${t.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}}Object.defineProperty(W.prototype,"name",{value:"TransactionExpiredTimeoutError"});class P extends Error{constructor(e){super(`Signature ${e} has expired: the nonce is no longer valid.`),this.signature=void 0,this.signature=e}}Object.defineProperty(P.prototype,"name",{value:"TransactionExpiredNonceInvalidError"});class K{constructor(e,t){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=t}keySegments(){let e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(let t of this.keySegments()){if(e<t.length)return t[e];e-=t.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw Error("Account index overflow encountered during compilation");let t=new Map;this.keySegments().flat().forEach((e,r)=>{t.set(e.toBase58(),r)});let r=e=>{let r=t.get(e.toBase58());if(void 0===r)throw Error("Encountered an unknown instruction account key during compilation");return r};return e.map(e=>({programIdIndex:r(e.programId),accountKeyIndexes:e.keys.map(e=>r(e.pubkey)),data:e.data}))}}let z=(e="publicKey")=>d.Ik(32,e),T=(e="signature")=>d.Ik(64,e),_=(e="string")=>{let t=d.n_([d.Jq("length"),d.Jq("lengthPadding"),d.Ik(d.cv(d.Jq(),-8),"chars")],e),r=t.decode.bind(t),i=t.encode.bind(t);return t.decode=(e,t)=>r(e,t).chars.toString(),t.encode=(e,t,r)=>i({chars:n.Buffer.from(e,"utf8")},t,r),t.alloc=e=>d.Jq().span+d.Jq().span+n.Buffer.from(e,"utf8").length,t};function L(e){let t=0,r=0;for(;;){let n=e.shift();if(t|=(127&n)<<7*r,r+=1,(128&n)==0)break}return t}function E(e,t){let r=t;for(;;){let t=127&r;if(0==(r>>=7)){e.push(t);break}t|=128,e.push(t)}}function q(e,t){if(!e)throw Error(t||"Assertion failed")}class J{constructor(e,t){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=t}static compile(e,t){let r=new Map,n=e=>{let t=e.toBase58(),n=r.get(t);return void 0===n&&(n={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(t,n)),n},i=n(t);for(let t of(i.isSigner=!0,i.isWritable=!0,e))for(let e of(n(t.programId).isInvoked=!0,t.keys)){let t=n(e.pubkey);t.isSigner||=e.isSigner,t.isWritable||=e.isWritable}return new J(t,r)}getMessageComponents(){let e=[...this.keyMetaMap.entries()];q(e.length<=256,"Max static account keys length exceeded");let t=e.filter(([,e])=>e.isSigner&&e.isWritable),r=e.filter(([,e])=>e.isSigner&&!e.isWritable),n=e.filter(([,e])=>!e.isSigner&&e.isWritable),i=e.filter(([,e])=>!e.isSigner&&!e.isWritable),s={numRequiredSignatures:t.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:i.length};{q(t.length>0,"Expected at least one writable signer key");let[e]=t[0];q(e===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}return[s,[...t.map(([e])=>new v(e)),...r.map(([e])=>new v(e)),...n.map(([e])=>new v(e)),...i.map(([e])=>new v(e))]]}extractTableLookup(e){let[t,r]=this.drainKeysFoundInLookupTable(e.state.addresses,e=>!e.isSigner&&!e.isInvoked&&e.isWritable),[n,i]=this.drainKeysFoundInLookupTable(e.state.addresses,e=>!e.isSigner&&!e.isInvoked&&!e.isWritable);if(0!==t.length||0!==n.length)return[{accountKey:e.key,writableIndexes:t,readonlyIndexes:n},{writable:r,readonly:i}]}drainKeysFoundInLookupTable(e,t){let r=[],n=[];for(let[i,s]of this.keyMetaMap.entries())if(t(s)){let t=new v(i),s=e.findIndex(e=>e.equals(t));s>=0&&(q(s<256,"Max lookup table index exceeded"),r.push(s),n.push(t),this.keyMetaMap.delete(i))}return[r,n]}}let O="Reached end of buffer unexpectedly";function M(e){if(0===e.length)throw Error(O);return e.shift()}function C(e,...t){let[r]=t;if(2===t.length?r+(t[1]??0)>e.length:r>=e.length)throw Error(O);return e.splice(...t)}class U{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map(e=>new v(e)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach(e=>this.indexToProgramIds.set(e.programIdIndex,this.accountKeys[e.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:u().decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new K(this.staticAccountKeys)}static compile(e){let[t,r]=J.compile(e.instructions,e.payerKey).getMessageComponents(),n=new K(r).compileInstructions(e.instructions).map(e=>({programIdIndex:e.programIdIndex,accounts:e.accountKeyIndexes,data:u().encode(e.data)}));return new U({header:t,accountKeys:r,recentBlockhash:e.recentBlockhash,instructions:n})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){let t=this.header.numRequiredSignatures;if(!(e>=this.header.numRequiredSignatures))return e<t-this.header.numReadonlySignedAccounts;{let r=this.accountKeys.length-t-this.header.numReadonlyUnsignedAccounts;return e-t<r}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,t)=>!this.isProgramId(t))}serialize(){let e=this.accountKeys.length,t=[];E(t,e);let r=this.instructions.map(e=>{let{accounts:t,programIdIndex:r}=e,i=Array.from(u().decode(e.data)),s=[];E(s,t.length);let a=[];return E(a,i.length),{programIdIndex:r,keyIndicesCount:n.Buffer.from(s),keyIndices:t,dataLength:n.Buffer.from(a),data:i}}),i=[];E(i,r.length);let s=n.Buffer.alloc(1232);n.Buffer.from(i).copy(s);let a=i.length;r.forEach(e=>{let t=d.n_([d.u8("programIdIndex"),d.Ik(e.keyIndicesCount.length,"keyIndicesCount"),d.A9(d.u8("keyIndex"),e.keyIndices.length,"keyIndices"),d.Ik(e.dataLength.length,"dataLength"),d.A9(d.u8("userdatum"),e.data.length,"data")]).encode(e,s,a);a+=t}),s=s.slice(0,a);let o=d.n_([d.Ik(1,"numRequiredSignatures"),d.Ik(1,"numReadonlySignedAccounts"),d.Ik(1,"numReadonlyUnsignedAccounts"),d.Ik(t.length,"keyCount"),d.A9(z("key"),e,"keys"),z("recentBlockhash")]),l={numRequiredSignatures:n.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:n.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:n.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:n.Buffer.from(t),keys:this.accountKeys.map(e=>I(e.toBytes())),recentBlockhash:u().decode(this.recentBlockhash)},c=n.Buffer.alloc(2048),p=o.encode(l,c);return s.copy(c,p),c.slice(0,p+s.length)}static from(e){let t=[...e],r=M(t);if(r!==(127&r))throw Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");let i=M(t),s=M(t),a=L(t),o=[];for(let e=0;e<a;e++){let e=C(t,0,32);o.push(new v(n.Buffer.from(e)))}let l=C(t,0,32),c=L(t),d=[];for(let e=0;e<c;e++){let e=M(t),r=L(t),i=C(t,0,r),s=L(t),a=C(t,0,s),o=u().encode(n.Buffer.from(a));d.push({programIdIndex:e,accounts:i,data:o})}return new U({header:{numRequiredSignatures:r,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:s},recentBlockhash:u().encode(n.Buffer.from(l)),accountKeys:o,instructions:d})}}class R{constructor(e){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=e.header,this.staticAccountKeys=e.staticAccountKeys,this.recentBlockhash=e.recentBlockhash,this.compiledInstructions=e.compiledInstructions,this.addressTableLookups=e.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let e=0;for(let t of this.addressTableLookups)e+=t.readonlyIndexes.length+t.writableIndexes.length;return e}getAccountKeys(e){let t;if(e&&"accountKeysFromLookups"in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");t=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)t=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw Error("Failed to get account keys because address table lookups were not resolved");return new K(this.staticAccountKeys,t)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){let t=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(e>=r)return e-r<this.addressTableLookups.reduce((e,t)=>e+t.writableIndexes.length,0);if(!(e>=this.header.numRequiredSignatures))return e<t-this.header.numReadonlySignedAccounts;{let n=r-t-this.header.numReadonlyUnsignedAccounts;return e-t<n}}resolveAddressTableLookups(e){let t={writable:[],readonly:[]};for(let r of this.addressTableLookups){let n=e.find(e=>e.key.equals(r.accountKey));if(!n)throw Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(let e of r.writableIndexes)if(e<n.state.addresses.length)t.writable.push(n.state.addresses[e]);else throw Error(`Failed to find address for index ${e} in address lookup table ${r.accountKey.toBase58()}`);for(let e of r.readonlyIndexes)if(e<n.state.addresses.length)t.readonly.push(n.state.addresses[e]);else throw Error(`Failed to find address for index ${e} in address lookup table ${r.accountKey.toBase58()}`)}return t}static compile(e){let t=J.compile(e.instructions,e.payerKey),r=[],n={writable:[],readonly:[]};for(let i of e.addressLookupTableAccounts||[]){let e=t.extractTableLookup(i);if(void 0!==e){let[t,{writable:i,readonly:s}]=e;r.push(t),n.writable.push(...i),n.readonly.push(...s)}}let[i,s]=t.getMessageComponents(),a=new K(s,n).compileInstructions(e.instructions);return new R({header:i,staticAccountKeys:s,recentBlockhash:e.recentBlockhash,compiledInstructions:a,addressTableLookups:r})}serialize(){let e=[];E(e,this.staticAccountKeys.length);let t=this.serializeInstructions(),r=[];E(r,this.compiledInstructions.length);let n=this.serializeAddressTableLookups(),i=[];E(i,this.addressTableLookups.length);let s=d.n_([d.u8("prefix"),d.n_([d.u8("numRequiredSignatures"),d.u8("numReadonlySignedAccounts"),d.u8("numReadonlyUnsignedAccounts")],"header"),d.Ik(e.length,"staticAccountKeysLength"),d.A9(z(),this.staticAccountKeys.length,"staticAccountKeys"),z("recentBlockhash"),d.Ik(r.length,"instructionsLength"),d.Ik(t.length,"serializedInstructions"),d.Ik(i.length,"addressTableLookupsLength"),d.Ik(n.length,"serializedAddressTableLookups")]),a=new Uint8Array(1232),o=s.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map(e=>e.toBytes()),recentBlockhash:u().decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:t,addressTableLookupsLength:new Uint8Array(i),serializedAddressTableLookups:n},a);return a.slice(0,o)}serializeInstructions(){let e=0,t=new Uint8Array(1232);for(let r of this.compiledInstructions){let n=[];E(n,r.accountKeyIndexes.length);let i=[];E(i,r.data.length);let s=d.n_([d.u8("programIdIndex"),d.Ik(n.length,"encodedAccountKeyIndexesLength"),d.A9(d.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),d.Ik(i.length,"encodedDataLength"),d.Ik(r.data.length,"data")]);e+=s.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(n),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(i),data:r.data},t,e)}return t.slice(0,e)}serializeAddressTableLookups(){let e=0,t=new Uint8Array(1232);for(let r of this.addressTableLookups){let n=[];E(n,r.writableIndexes.length);let i=[];E(i,r.readonlyIndexes.length);let s=d.n_([z("accountKey"),d.Ik(n.length,"encodedWritableIndexesLength"),d.A9(d.u8(),r.writableIndexes.length,"writableIndexes"),d.Ik(i.length,"encodedReadonlyIndexesLength"),d.A9(d.u8(),r.readonlyIndexes.length,"readonlyIndexes")]);e+=s.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(n),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(i),readonlyIndexes:r.readonlyIndexes},t,e)}return t.slice(0,e)}static deserialize(e){let t=[...e],r=M(t),n=127&r;q(r!==n,"Expected versioned message but received legacy message"),q(0===n,`Expected versioned message with version 0 but found version ${n}`);let i={numRequiredSignatures:M(t),numReadonlySignedAccounts:M(t),numReadonlyUnsignedAccounts:M(t)},s=[],a=L(t);for(let e=0;e<a;e++)s.push(new v(C(t,0,32)));let o=u().encode(C(t,0,32)),l=L(t),c=[];for(let e=0;e<l;e++){let e=M(t),r=L(t),n=C(t,0,r),i=L(t),s=new Uint8Array(C(t,0,i));c.push({programIdIndex:e,accountKeyIndexes:n,data:s})}let d=L(t),p=[];for(let e=0;e<d;e++){let e=new v(C(t,0,32)),r=L(t),n=C(t,0,r),i=L(t),s=C(t,0,i);p.push({accountKey:e,writableIndexes:n,readonlyIndexes:s})}return new R({header:i,staticAccountKeys:s,recentBlockhash:o,compiledInstructions:c,addressTableLookups:p})}}let N={deserializeMessageVersion(e){let t=e[0],r=127&t;return r===t?"legacy":r},deserialize:e=>{let t=N.deserializeMessageVersion(e);if("legacy"===t)return U.from(e);if(0===t)return R.deserialize(e);throw Error(`Transaction message version ${t} deserialization is not supported`)}},$=n.Buffer.alloc(64).fill(0);class F{constructor(e){this.keys=void 0,this.programId=void 0,this.data=n.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map(({pubkey:e,isSigner:t,isWritable:r})=>({pubkey:e.toJSON(),isSigner:t,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class V{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!e)return;if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){let{minContextSlot:t,nonceInfo:r}=e;this.minNonceContextSlot=t,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){let{blockhash:t,lastValidBlockHeight:r}=e;this.recentBlockhash=t,this.lastValidBlockHeight=r}else{let{recentBlockhash:t,nonceInfo:r}=e;r&&(this.nonceInfo=r),this.recentBlockhash=t}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(e=>e.toJSON()),signers:this.signatures.map(({publicKey:e})=>e.toJSON())}}add(...e){if(0===e.length)throw Error("No instructions");return e.forEach(e=>{"instructions"in e?this.instructions=this.instructions.concat(e.instructions):"data"in e&&"programId"in e&&"keys"in e?this.instructions.push(e):this.instructions.push(new F(e))}),this}compileMessage(){let e,t,r;if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;if(this.nonceInfo?(e=this.nonceInfo.nonce,t=this.instructions[0]!=this.nonceInfo.nonceInstruction?[this.nonceInfo.nonceInstruction,...this.instructions]:this.instructions):(e=this.recentBlockhash,t=this.instructions),!e)throw Error("Transaction recentBlockhash required");if(t.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw Error("Transaction fee payer required");for(let e=0;e<t.length;e++)if(void 0===t[e].programId)throw Error(`Transaction instruction index ${e} has undefined program id`);let n=[],i=[];t.forEach(e=>{e.keys.forEach(e=>{i.push({...e})});let t=e.programId.toString();n.includes(t)||n.push(t)}),n.forEach(e=>{i.push({pubkey:new v(e),isSigner:!1,isWritable:!1})});let s=[];i.forEach(e=>{let t=e.pubkey.toString(),r=s.findIndex(e=>e.pubkey.toString()===t);r>-1?(s[r].isWritable=s[r].isWritable||e.isWritable,s[r].isSigner=s[r].isSigner||e.isSigner):s.push(e)}),s.sort(function(e,t){return e.isSigner!==t.isSigner?e.isSigner?-1:1:e.isWritable!==t.isWritable?e.isWritable?-1:1:e.pubkey.toBase58().localeCompare(t.pubkey.toBase58(),"en",{localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"})});let a=s.findIndex(e=>e.pubkey.equals(r));if(a>-1){let[e]=s.splice(a,1);e.isSigner=!0,e.isWritable=!0,s.unshift(e)}else s.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(let e of this.signatures){let t=s.findIndex(t=>t.pubkey.equals(e.publicKey));if(t>-1)s[t].isSigner||(s[t].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw Error(`unknown signer: ${e.publicKey.toString()}`)}let o=0,l=0,c=0,d=[],p=[];s.forEach(({pubkey:e,isSigner:t,isWritable:r})=>{t?(d.push(e.toString()),o+=1,r||(l+=1)):(p.push(e.toString()),r||(c+=1))});let g=d.concat(p),h=t.map(e=>{let{data:t,programId:r}=e;return{programIdIndex:g.indexOf(r.toString()),accounts:e.keys.map(e=>g.indexOf(e.pubkey.toString())),data:u().encode(t)}});return h.forEach(e=>{q(e.programIdIndex>=0),e.accounts.forEach(e=>q(e>=0))}),new U({header:{numRequiredSignatures:o,numReadonlySignedAccounts:l,numReadonlyUnsignedAccounts:c},accountKeys:g,recentBlockhash:e,instructions:h})}_compile(){let e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===t.length&&this.signatures.every((e,r)=>t[r].equals(e.publicKey))||(this.signatures=t.map(e=>({signature:null,publicKey:e}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(0===e.length)throw Error("No signers");let t=new Set;this.signatures=e.filter(e=>{let r=e.toString();return!t.has(r)&&(t.add(r),!0)}).map(e=>({signature:null,publicKey:e}))}sign(...e){if(0===e.length)throw Error("No signers");let t=new Set,r=[];for(let n of e){let e=n.publicKey.toString();t.has(e)||(t.add(e),r.push(n))}this.signatures=r.map(e=>({signature:null,publicKey:e.publicKey}));let n=this._compile();this._partialSign(n,...r)}partialSign(...e){if(0===e.length)throw Error("No signers");let t=new Set,r=[];for(let n of e){let e=n.publicKey.toString();t.has(e)||(t.add(e),r.push(n))}let n=this._compile();this._partialSign(n,...r)}_partialSign(e,...t){let r=e.serialize();t.forEach(e=>{let t=k(r,e.secretKey);this._addSignature(e.publicKey,I(t))})}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){q(64===t.length);let r=this.signatures.findIndex(t=>e.equals(t.publicKey));if(r<0)throw Error(`unknown signer: ${e.toString()}`);this.signatures[r].signature=n.Buffer.from(t)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,t){let r={};for(let{signature:n,publicKey:i}of this.signatures)null===n?t&&(r.missing||=[]).push(i):S(n,e,i.toBytes())||(r.invalid||=[]).push(i);return r.invalid||r.missing?r:void 0}serialize(e){let{requireAllSignatures:t,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),n=this.serializeMessage();if(r){let e=this._getMessageSignednessErrors(n,t);if(e){let t="Signature verification failed.";throw e.invalid&&(t+=`
2Invalid signature for public key${1===e.invalid.length?"":"(s)"} [\`${e.invalid.map(e=>e.toBase58()).join("`, `")}\`].`),e.missing&&(t+=`
3Missing signature for public key${1===e.missing.length?"":"(s)"} [\`${e.missing.map(e=>e.toBase58()).join("`, `")}\`].`),Error(t)}}return this._serialize(n)}_serialize(e){let{signatures:t}=this,r=[];E(r,t.length);let i=r.length+64*t.length+e.length,s=n.Buffer.alloc(i);return q(t.length<256),n.Buffer.from(r).copy(s,0),t.forEach(({signature:e},t)=>{null!==e&&(q(64===e.length,"signature has invalid length"),n.Buffer.from(e).copy(s,r.length+64*t))}),e.copy(s,r.length+64*t.length),q(s.length<=1232,`Transaction too large: ${s.length} > 1232`),s}get keys(){return q(1===this.instructions.length),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return q(1===this.instructions.length),this.instructions[0].programId}get data(){return q(1===this.instructions.length),this.instructions[0].data}static from(e){let t=[...e],r=L(t),i=[];for(let e=0;e<r;e++){let e=C(t,0,64);i.push(u().encode(n.Buffer.from(e)))}return V.populate(U.from(t),i)}static populate(e,t=[]){let r=new V;return r.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(r.feePayer=e.accountKeys[0]),t.forEach((t,n)=>{let i={signature:t==u().encode($)?null:u().decode(t),publicKey:e.accountKeys[n]};r.signatures.push(i)}),e.instructions.forEach(t=>{let n=t.accounts.map(t=>{let n=e.accountKeys[t];return{pubkey:n,isSigner:r.signatures.some(e=>e.publicKey.toString()===n.toString())||e.isAccountSigner(t),isWritable:e.isAccountWritable(t)}});r.instructions.push(new F({keys:n,programId:e.accountKeys[t.programIdIndex],data:u().decode(t.data)}))}),r._message=e,r._json=r.toJSON(),r}}class j{get version(){return this.message.version}constructor(e,t){if(this.signatures=void 0,this.message=void 0,void 0!==t)q(t.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=t;else{let t=[];for(let r=0;r<e.header.numRequiredSignatures;r++)t.push(new Uint8Array(64));this.signatures=t}this.message=e}serialize(){let e=this.message.serialize(),t=[];E(t,this.signatures.length);let r=d.n_([d.Ik(t.length,"encodedSignaturesLength"),d.A9(T(),this.signatures.length,"signatures"),d.Ik(e.length,"serializedMessage")]),n=new Uint8Array(2048),i=r.encode({encodedSignaturesLength:new Uint8Array(t),signatures:this.signatures,serializedMessage:e},n);return n.slice(0,i)}static deserialize(e){let t=[...e],r=[],n=L(t);for(let e=0;e<n;e++)r.push(new Uint8Array(C(t,0,64)));return new j(N.deserialize(new Uint8Array(t)),r)}sign(e){let t=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(let n of e){let e=r.findIndex(e=>e.equals(n.publicKey));q(e>=0,`Cannot sign with non signer key ${n.publicKey.toBase58()}`),this.signatures[e]=k(t,n.secretKey)}}addSignature(e,t){q(64===t.byteLength,"Signature must be 64 bytes long");let r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(t=>t.equals(e));q(r>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[r]=t}}let H=new v("SysvarC1ock11111111111111111111111111111111");new v("SysvarEpochSchedu1e111111111111111111111111"),new v("Sysvar1nstructions1111111111111111111111111");let D=new v("SysvarRecentB1ockHashes11111111111111111111"),G=new v("SysvarRent111111111111111111111111111111111");new v("SysvarRewards111111111111111111111111111111"),new v("SysvarS1otHashes111111111111111111111111111"),new v("SysvarS1otHistory11111111111111111111111111");let Q=new v("SysvarStakeHistory1111111111111111111111111");class X extends Error{constructor({action:e,signature:t,transactionMessage:r,logs:n}){let i;let s=n?`Logs: 
4${JSON.stringify(n.slice(-10),null,2)}. `:"",a="\nCatch the `SendTransactionError` and call `getLogs()` on it for full details.";switch(e){case"send":i=`Transaction ${t} resulted in an error. 
5${r}. `+s+a;break;case"simulate":i=`Simulation failed. 
6Message: ${r}. 
7`+s+a;break;default:i=`Unknown action '${e}'`}super(i),this.signature=void 0,this.transactionMessage=void 0,this.transactionLogs=void 0,this.signature=t,this.transactionMessage=r,this.transactionLogs=n||void 0}get transactionError(){return{message:this.transactionMessage,logs:Array.isArray(this.transactionLogs)?this.transactionLogs:void 0}}get logs(){let e=this.transactionLogs;if(null==e||"object"!=typeof e||!("then"in e))return e}async getLogs(e){return Array.isArray(this.transactionLogs)||(this.transactionLogs=new Promise((t,r)=>{e.getTransaction(this.signature).then(e=>{if(e&&e.meta&&e.meta.logMessages){let r=e.meta.logMessages;this.transactionLogs=r,t(r)}else r(Error("Log messages not found"))}).catch(r)})),await this.transactionLogs}}async function Y(e,t,r,n){let i;let s=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries,minContextSlot:n.minContextSlot},a=await e.sendTransaction(t,r,s);if(null!=t.recentBlockhash&&null!=t.lastValidBlockHeight)i=(await e.confirmTransaction({abortSignal:n?.abortSignal,signature:a,blockhash:t.recentBlockhash,lastValidBlockHeight:t.lastValidBlockHeight},n&&n.commitment)).value;else if(null!=t.minNonceContextSlot&&null!=t.nonceInfo){let{nonceInstruction:r}=t.nonceInfo,s=r.keys[0].pubkey;i=(await e.confirmTransaction({abortSignal:n?.abortSignal,minContextSlot:t.minNonceContextSlot,nonceAccountPubkey:s,nonceValue:t.nonceInfo.nonce,signature:a},n&&n.commitment)).value}else n?.abortSignal!=null&&console.warn("sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` or a combination of `nonceInfo` and `minNonceContextSlot` are abortable."),i=(await e.confirmTransaction(a,n&&n.commitment)).value;if(i.err){if(null!=a)throw new X({action:"send",signature:a,transactionMessage:`Status: (${JSON.stringify(i)})`});throw Error(`Transaction ${a} failed (${JSON.stringify(i)})`)}return a}function Z(e,t){let r=e.layout.span>=0?e.layout.span:function e(t,r){let n=t=>{if(t.span>=0)return t.span;if("function"==typeof t.alloc)return t.alloc(r[t.property]);if("count"in t&&"elementLayout"in t){let e=r[t.property];if(Array.isArray(e))return e.length*n(t.elementLayout)}else if("fields"in t)return e({layout:t},r[t.property]);return 0},i=0;return t.layout.fields.forEach(e=>{i+=n(e)}),i}(e,t),i=n.Buffer.alloc(r),s=Object.assign({instruction:e.index},t);return e.layout.encode(s,i),i}let ee=d._O("lamportsPerSignature"),et=d.n_([d.Jq("version"),d.Jq("state"),z("authorizedPubkey"),z("nonce"),d.n_([ee],"feeCalculator")]).span,er=e=>({decode:e.decode.bind(e),encode:e.encode.bind(e)}),en=e=>{let t=(0,d.Ik)(8,e),{encode:r,decode:i}=er(t);return t.decode=(e,t)=>{let r=i(e,t);return(0,p.oU)(n.Buffer.from(r))},t.encode=(e,t,n)=>r((0,p.k$)(e,8),t,n),t},ei=Object.freeze({Create:{index:0,layout:d.n_([d.Jq("instruction"),d.gM("lamports"),d.gM("space"),z("programId")])},Assign:{index:1,layout:d.n_([d.Jq("instruction"),z("programId")])},Transfer:{index:2,layout:d.n_([d.Jq("instruction"),en("lamports")])},CreateWithSeed:{index:3,layout:d.n_([d.Jq("instruction"),z("base"),_("seed"),d.gM("lamports"),d.gM("space"),z("programId")])},AdvanceNonceAccount:{index:4,layout:d.n_([d.Jq("instruction")])},WithdrawNonceAccount:{index:5,layout:d.n_([d.Jq("instruction"),d.gM("lamports")])},InitializeNonceAccount:{index:6,layout:d.n_([d.Jq("instruction"),z("authorized")])},AuthorizeNonceAccount:{index:7,layout:d.n_([d.Jq("instruction"),z("authorized")])},Allocate:{index:8,layout:d.n_([d.Jq("instruction"),d.gM("space")])},AllocateWithSeed:{index:9,layout:d.n_([d.Jq("instruction"),z("base"),_("seed"),d.gM("space"),z("programId")])},AssignWithSeed:{index:10,layout:d.n_([d.Jq("instruction"),z("base"),_("seed"),z("programId")])},TransferWithSeed:{index:11,layout:d.n_([d.Jq("instruction"),en("lamports"),_("seed"),z("programId")])},UpgradeNonceAccount:{index:12,layout:d.n_([d.Jq("instruction")])}});class es{constructor(){}static createAccount(e){let t=Z(ei.Create,{lamports:e.lamports,space:e.space,programId:I(e.programId.toBuffer())});return new F({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:t})}static transfer(e){let t,r;return"basePubkey"in e?(t=Z(ei.TransferWithSeed,{lamports:BigInt(e.lamports),seed:e.seed,programId:I(e.programId.toBuffer())}),r=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]):(t=Z(ei.Transfer,{lamports:BigInt(e.lamports)}),r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]),new F({keys:r,programId:this.programId,data:t})}static assign(e){let t,r;return"basePubkey"in e?(t=Z(ei.AssignWithSeed,{base:I(e.basePubkey.toBuffer()),seed:e.seed,programId:I(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=Z(ei.Assign,{programId:I(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]),new F({keys:r,programId:this.programId,data:t})}static createAccountWithSeed(e){let t=Z(ei.CreateWithSeed,{base:I(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:I(e.programId.toBuffer())}),r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey!=e.fromPubkey&&r.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new F({keys:r,programId:this.programId,data:t})}static createNonceAccount(e){let t=new V;"basePubkey"in e&&"seed"in e?t.add(es.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:et,programId:this.programId})):t.add(es.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:et,programId:this.programId}));let r={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return t.add(this.nonceInitialize(r)),t}static nonceInitialize(e){let t=Z(ei.InitializeNonceAccount,{authorized:I(e.authorizedPubkey.toBuffer())});return new F({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:D,isSigner:!1,isWritable:!1},{pubkey:G,isSigner:!1,isWritable:!1}],programId:this.programId,data:t})}static nonceAdvance(e){let t=Z(ei.AdvanceNonceAccount);return new F({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:D,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static nonceWithdraw(e){let t=Z(ei.WithdrawNonceAccount,{lamports:e.lamports});return new F({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:D,isSigner:!1,isWritable:!1},{pubkey:G,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static nonceAuthorize(e){let t=Z(ei.AuthorizeNonceAccount,{authorized:I(e.newAuthorizedPubkey.toBuffer())});return new F({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static allocate(e){let t,r;return"basePubkey"in e?(t=Z(ei.AllocateWithSeed,{base:I(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:I(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]):(t=Z(ei.Allocate,{space:e.space}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]),new F({keys:r,programId:this.programId,data:t})}}es.programId=new v("11111111111111111111111111111111");class ea{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/ea.chunkSize)+1+1)}static async load(e,t,r,i,s){{let n=await e.getMinimumBalanceForRentExemption(s.length),a=await e.getAccountInfo(r.publicKey,"confirmed"),o=null;if(null!==a){if(a.executable)return console.error("Program load failed, account is already executable"),!1;a.data.length!==s.length&&(o=o||new V).add(es.allocate({accountPubkey:r.publicKey,space:s.length})),a.owner.equals(i)||(o=o||new V).add(es.assign({accountPubkey:r.publicKey,programId:i})),a.lamports<n&&(o=o||new V).add(es.transfer({fromPubkey:t.publicKey,toPubkey:r.publicKey,lamports:n-a.lamports}))}else o=new V().add(es.createAccount({fromPubkey:t.publicKey,newAccountPubkey:r.publicKey,lamports:n>0?n:1,space:s.length,programId:i}));null!==o&&await Y(e,o,[t,r],{commitment:"confirmed"})}let a=d.n_([d.Jq("instruction"),d.Jq("offset"),d.Jq("bytesLength"),d.Jq("bytesLengthPadding"),d.A9(d.u8("byte"),d.cv(d.Jq(),-8),"bytes")]),o=ea.chunkSize,u=0,l=s,
7c=[];for(;l.length>0;){let s=l.slice(0,o),d=n.Buffer.alloc(o+16);a.encode({instruction:0,offset:u,bytes:s,bytesLength:0,bytesLengthPadding:0},d);let p=new V().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:i,data:d});c.push(Y(e,p,[t,r],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")&&await new Promise(e=>setTimeout(e,250)),u+=o,l=l.slice(o)}await Promise.all(c);{let s=d.n_([d.Jq("instruction")]),a=n.Buffer.alloc(s.span);s.encode({instruction:1},a);let o=new V().add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:G,isSigner:!1,isWritable:!1}],programId:i,data:a}),u="processed",l=await e.sendTransaction(o,[t,r],{preflightCommitment:u}),{context:c,value:p}=await e.confirmTransaction({signature:l,lastValidBlockHeight:o.lastValidBlockHeight,blockhash:o.recentBlockhash},u);if(p.err)throw Error(`Transaction ${l} failed (${JSON.stringify(p)})`);for(;;){try{if(await e.getSlot({commitment:u})>c.slot)break}catch{}await new Promise(e=>setTimeout(e,Math.round(200)))}}return!0}}ea.chunkSize=932,new v("BPFLoader2111111111111111111111111111111111"),Object.prototype.toString,d.n_([d.Jq("typeIndex"),en("deactivationSlot"),d._O("lastExtendedSlot"),d.u8("lastExtendedStartIndex"),d.u8(),d.A9(z(),d.cv(d.u8(),-1),"authority")]);let eo=(0,g.coerce)((0,g.instance)(v),(0,g.string)(),e=>new v(e)),eu=(0,g.tuple)([(0,g.string)(),(0,g.literal)("base64")]),el=(0,g.coerce)((0,g.instance)(n.Buffer),eu,e=>n.Buffer.from(e[0],"base64"));function ec(e){return(0,g.union)([(0,g.type)({jsonrpc:(0,g.literal)("2.0"),id:(0,g.string)(),result:e}),(0,g.type)({jsonrpc:(0,g.literal)("2.0"),id:(0,g.string)(),error:(0,g.type)({code:(0,g.unknown)(),message:(0,g.string)(),data:(0,g.optional)((0,g.any)())})})])}let ed=ec((0,g.unknown)());function ep(e){return(0,g.coerce)(ec(e),ed,t=>"error"in t?t:{...t,result:(0,g.create)(t.result,e)})}function eg(e){return ep((0,g.type)({context:(0,g.type)({slot:(0,g.number)()}),value:e}))}function eh(e){return(0,g.type)({context:(0,g.type)({slot:(0,g.number)()}),value:e})}let ey=(0,g.type)({foundation:(0,g.number)(),foundationTerm:(0,g.number)(),initial:(0,g.number)(),taper:(0,g.number)(),terminal:(0,g.number)()});ep((0,g.array)((0,g.nullable)((0,g.type)({epoch:(0,g.number)(),effectiveSlot:(0,g.number)(),amount:(0,g.number)(),postBalance:(0,g.number)(),commission:(0,g.optional)((0,g.nullable)((0,g.number)()))}))));let eb=(0,g.array)((0,g.type)({slot:(0,g.number)(),prioritizationFee:(0,g.number)()})),em=(0,g.type)({total:(0,g.number)(),validator:(0,g.number)(),foundation:(0,g.number)(),epoch:(0,g.number)()}),ef=(0,g.type)({epoch:(0,g.number)(),slotIndex:(0,g.number)(),slotsInEpoch:(0,g.number)(),absoluteSlot:(0,g.number)(),blockHeight:(0,g.optional)((0,g.number)()),transactionCount:(0,g.optional)((0,g.number)())}),ek=(0,g.type)({slotsPerEpoch:(0,g.number)(),leaderScheduleSlotOffset:(0,g.number)(),warmup:(0,g.boolean)(),firstNormalEpoch:(0,g.number)(),firstNormalSlot:(0,g.number)()}),eS=(0,g.record)((0,g.string)(),(0,g.array)((0,g.number)())),eI=(0,g.nullable)((0,g.union)([(0,g.type)({}),(0,g.string)()])),ew=(0,g.type)({err:eI}),eA=(0,g.literal)("receivedSignature");(0,g.type)({"solana-core":(0,g.string)(),"feature-set":(0,g.optional)((0,g.number)())}),eg((0,g.type)({err:(0,g.nullable)((0,g.union)([(0,g.type)({}),(0,g.string)()])),logs:(0,g.nullable)((0,g.array)((0,g.string)())),accounts:(0,g.optional)((0,g.nullable)((0,g.array)((0,g.nullable)((0,g.type)({executable:(0,g.boolean)(),owner:(0,g.string)(),lamports:(0,g.number)(),data:(0,g.array)((0,g.string)()),rentEpoch:(0,g.optional)((0,g.number)())}))))),unitsConsumed:(0,g.optional)((0,g.number)()),returnData:(0,g.optional)((0,g.nullable)((0,g.type)({programId:(0,g.string)(),data:(0,g.tuple)([(0,g.string)(),(0,g.literal)("base64")])})))})),eg((0,g.type)({byIdentity:(0,g.record)((0,g.string)(),(0,g.array)((0,g.number)())),range:(0,g.type)({firstSlot:(0,g.number)(),lastSlot:(0,g.number)()})})),ep(ey),ep(em),ep(eb),ep(ef),ep(ek),ep(eS),ep((0,g.number)()),eg((0,g.type)({total:(0,g.number)(),circulating:(0,g.number)(),nonCirculating:(0,g.number)(),nonCirculatingAccounts:(0,g.array)(eo)}));let ex=(0,g.type)({amount:(0,g.string)(),uiAmount:(0,g.nullable)((0,g.number)()),decimals:(0,g.number)(),uiAmountString:(0,g.optional)((0,g.string)())});eg((0,g.array)((0,g.type)({address:eo,amount:(0,g.string)(),uiAmount:(0,g.nullable)((0,g.number)()),decimals:(0,g.number)(),uiAmountString:(0,g.optional)((0,g.string)())}))),eg((0,g.array)((0,g.type)({pubkey:eo,account:(0,g.type)({executable:(0,g.boolean)(),owner:eo,lamports:(0,g.number)(),data:el,rentEpoch:(0,g.number)()})})));let ev=(0,g.type)({program:(0,g.string)(),parsed:(0,g.unknown)(),space:(0,g.number)()});eg((0,g.array)((0,g.type)({pubkey:eo,account:(0,g.type)({executable:(0,g.boolean)(),owner:eo,lamports:(0,g.number)(),data:ev,rentEpoch:(0,g.number)()})}))),eg((0,g.array)((0,g.type)({lamports:(0,g.number)(),address:eo})));let eB=(0,g.type)({executable:(0,g.boolean)(),owner:eo,lamports:(0,g.number)(),data:el,rentEpoch:(0,g.number)()});(0,g.type)({pubkey:eo,account:eB});let eW=(0,g.coerce)((0,g.union)([(0,g.instance)(n.Buffer),ev]),(0,g.union)([eu,ev]),e=>Array.isArray(e)?(0,g.create)(e,el):e),eP=(0,g.type)({executable:(0,g.boolean)(),owner:eo,lamports:(0,g.number)(),data:eW,rentEpoch:(0,g.number)()});(0,g.type)({pubkey:eo,account:eP}),(0,g.type)({state:(0,g.union)([(0,g.literal)("active"),(0,g.literal)("inactive"),(0,g.literal)("activating"),(0,g.literal)("deactivating")]),active:(0,g.number)(),inactive:(0,g.number)()}),ep((0,g.array)((0,g.type)({signature:(0,g.string)(),slot:(0,g.number)(),err:eI,memo:(0,g.nullable)((0,g.string)()),blockTime:(0,g.optional)((0,g.nullable)((0,g.number)()))}))),ep((0,g.array)((0,g.type)({signature:(0,g.string)(),slot:(0,g.number)(),err:eI,memo:(0,g.nullable)((0,g.string)()),blockTime:(0,g.optional)((0,g.nullable)((0,g.number)()))}))),(0,g.type)({subscription:(0,g.number)(),result:eh(eB)});let eK=(0,g.type)({pubkey:eo,account:eB});(0,g.type)({subscription:(0,g.number)(),result:eh(eK)});let ez=(0,g.type)({parent:(0,g.number)(),slot:(0,g.number)(),root:(0,g.number)()});(0,g.type)({subscription:(0,g.number)(),result:ez});let eT=(0,g.union)([(0,g.type)({type:(0,g.union)([(0,g.literal)("firstShredReceived"),(0,g.literal)("completed"),(0,g.literal)("optimisticConfirmation"),(0,g.literal)("root")
7]),slot:(0,g.number)(),timestamp:(0,g.number)()}),(0,g.type)({type:(0,g.literal)("createdBank"),parent:(0,g.number)(),slot:(0,g.number)(),timestamp:(0,g.number)()}),(0,g.type)({type:(0,g.literal)("frozen"),slot:(0,g.number)(),timestamp:(0,g.number)(),stats:(0,g.type)({numTransactionEntries:(0,g.number)(),numSuccessfulTransactions:(0,g.number)(),numFailedTransactions:(0,g.number)(),maxTransactionsPerEntry:(0,g.number)()})}),(0,g.type)({type:(0,g.literal)("dead"),slot:(0,g.number)(),timestamp:(0,g.number)(),err:(0,g.string)()})]);(0,g.type)({subscription:(0,g.number)(),result:eT}),(0,g.type)({subscription:(0,g.number)(),result:eh((0,g.union)([ew,eA]))}),(0,g.type)({subscription:(0,g.number)(),result:(0,g.number)()}),(0,g.type)({pubkey:(0,g.string)(),gossip:(0,g.nullable)((0,g.string)()),tpu:(0,g.nullable)((0,g.string)()),rpc:(0,g.nullable)((0,g.string)()),version:(0,g.nullable)((0,g.string)())});let e_=(0,g.type)({votePubkey:(0,g.string)(),nodePubkey:(0,g.string)(),activatedStake:(0,g.number)(),epochVoteAccount:(0,g.boolean)(),epochCredits:(0,g.array)((0,g.tuple)([(0,g.number)(),(0,g.number)(),(0,g.number)()])),commission:(0,g.number)(),lastVote:(0,g.number)(),rootSlot:(0,g.nullable)((0,g.number)())});ep((0,g.type)({current:(0,g.array)(e_),delinquent:(0,g.array)(e_)}));let eL=(0,g.union)([(0,g.literal)("processed"),(0,g.literal)("confirmed"),(0,g.literal)("finalized")]),eE=(0,g.type)({slot:(0,g.number)(),confirmations:(0,g.nullable)((0,g.number)()),err:eI,confirmationStatus:(0,g.optional)(eL)});eg((0,g.array)((0,g.nullable)(eE))),ep((0,g.number)());let eq=(0,g.type)({accountKey:eo,writableIndexes:(0,g.array)((0,g.number)()),readonlyIndexes:(0,g.array)((0,g.number)())}),eJ=(0,g.type)({signatures:(0,g.array)((0,g.string)()),message:(0,g.type)({accountKeys:(0,g.array)((0,g.string)()),header:(0,g.type)({numRequiredSignatures:(0,g.number)(),numReadonlySignedAccounts:(0,g.number)(),numReadonlyUnsignedAccounts:(0,g.number)()}),instructions:(0,g.array)((0,g.type)({accounts:(0,g.array)((0,g.number)()),data:(0,g.string)(),programIdIndex:(0,g.number)()})),recentBlockhash:(0,g.string)(),addressTableLookups:(0,g.optional)((0,g.array)(eq))})}),eO=(0,g.type)({pubkey:eo,signer:(0,g.boolean)(),writable:(0,g.boolean)(),source:(0,g.optional)((0,g.union)([(0,g.literal)("transaction"),(0,g.literal)("lookupTable")]))}),eM=(0,g.type)({accountKeys:(0,g.array)(eO),signatures:(0,g.array)((0,g.string)())}),eC=(0,g.type)({parsed:(0,g.unknown)(),program:(0,g.string)(),programId:eo}),eU=(0,g.type)({accounts:(0,g.array)(eo),data:(0,g.string)(),programId:eo}),eR=(0,g.union)([eU,eC]),eN=(0,g.union)([(0,g.type)({parsed:(0,g.unknown)(),program:(0,g.string)(),programId:(0,g.string)()}),(0,g.type)({accounts:(0,g.array)((0,g.string)()),data:(0,g.string)(),programId:(0,g.string)()})]),e$=(0,g.coerce)(eR,eN,e=>"accounts"in e?(0,g.create)(e,eU):(0,g.create)(e,eC)),eF=(0,g.type)({signatures:(0,g.array)((0,g.string)()),message:(0,g.type)({accountKeys:(0,g.array)(eO),instructions:(0,g.array)(e$),recentBlockhash:(0,g.string)(),addressTableLookups:(0,g.optional)((0,g.nullable)((0,g.array)(eq)))})}),eV=(0,g.type)({accountIndex:(0,g.number)(),mint:(0,g.string)(),owner:(0,g.optional)((0,g.string)()),uiTokenAmount:ex}),ej=(0,g.type)({writable:(0,g.array)(eo),readonly:(0,g.array)(eo)}),eH=(0,g.type)({err:eI,fee:(0,g.number)(),innerInstructions:(0,g.optional)((0,g.nullable)((0,g.array)((0,g.type)({index:(0,g.number)(),instructions:(0,g.array)((0,g.type)({accounts:(0,g.array)((0,g.number)()),data:(0,g.string)(),programIdIndex:(0,g.number)()}))})))),preBalances:(0,g.array)((0,g.number)()),postBalances:(0,g.array)((0,g.number)()),logMessages:(0,g.optional)((0,g.nullable)((0,g.array)((0,g.string)()))),preTokenBalances:(0,g.optional)((0,g.nullable)((0,g.array)(eV))),postTokenBalances:(0,g.optional)((0,g.nullable)((0,g.array)(eV))),loadedAddresses:(0,g.optional)(ej),computeUnitsConsumed:(0,g.optional)((0,g.number)())}),eD=(0,g.type)({err:eI,fee:(0,g.number)(),innerInstructions:(0,g.optional)((0,g.nullable)((0,g.array)((0,g.type)({index:(0,g.number)(),instructions:(0,g.array)(e$)})))),preBalances:(0,g.array)((0,g.number)()),postBalances:(0,g.array)((0,g.number)()),logMessages:(0,g.optional)((0,g.nullable)((0,g.array)((0,g.string)()))),preTokenBalances:(0,g.optional)((0,g.nullable)((0,g.array)(eV))),postTokenBalances:(0,g.optional)((0,g.nullable)((0,g.array)(eV))),loadedAddresses:(0,g.optional)(ej),computeUnitsConsumed:(0,g.optional)((0,g.number)())}),eG=(0,g.union)([(0,g.literal)(0),(0,g.literal)("legacy")]),eQ=(0,g.type)({pubkey:(0,g.string)(),lamports:(0,g.number)(),postBalance:(0,g.nullable)((0,g.number)()),rewardType:(0,g.nullable)((0,g.string)()),commission:(0,g.optional)((0,g.nullable)((0,g.number)()))});ep((0,g.nullable)((0,g.type)({blockhash:(0,g.string)(),previousBlockhash:(0,g.string)(),parentSlot:(0,g.number)(),transactions:(0,g.array)((0,g.type)({transaction:eJ,meta:(0,g.nullable)(eH),version:(0,g.optional)(eG)})),rewards:(0,g.optional)((0,g.array)(eQ)),blockTime:(0,g.nullable)((0,g.number)()),blockHeight:(0,g.nullable)((0,g.number)())}))),ep((0,g.nullable)((0,g.type)({blockhash:(0,g.string)(),previousBlockhash:(0,g.string)(),parentSlot:(0,g.number)(),rewards:(0,g.optional)((0,g.array)(eQ)),blockTime:(0,g.nullable)((0,g.number)()),blockHeight:(0,g.nullable)((0,g.number)())}))),ep((0,g.nullable)((0,g.type)({blockhash:(0,g.string)(),previousBlockhash:(0,g.string)(),parentSlot:(0,g.number)(),transactions:(0,g.array)((0,g.type)({transaction:eM,meta:(0,g.nullable)(eH),version:(0,g.optional)(eG)})),rewards:(0,g.optional)((0,g.array)(eQ)),blockTime:(0,g.nullable)((0,g.number)()),blockHeight:(0,g.nullable)((0,g.number)())}))),ep((0,g.nullable)((0,g.type)({blockhash:(0,g.string)(),previousBlockhash:(0,g.string)(),parentSlot:(0,g.number)(),transactions:(0,g.array)((0,g.type)({transaction:eF,meta:(0,g.nullable)(eD),version:(0,g.optional)(eG)})),rewards:(0,g.optional)((0,g.array)(eQ)),blockTime:(0,g.nullable)((0,g.number)()),blockHeight:(0,g.nullable)((0,g.number)())}))),ep((0,g.nullable)((0,g.type)({blockhash:(0,g.string)(),previousBlockhash:(0,g.string)(),parentSlot:(0,g.number)(),transactions:(0,g.array)((0,g.type)({transaction:eM,meta:(0,g.nullable)(eD),version:(0,g.optional)(eG)})),rewards:(0,g.optional)((0,g.array)(eQ)),blockTime:(0,g.nullable)((0,g.number)()),blockHeight:(0,g.nullable)((0,g.number)())}))),ep((0,g.nullable)((0,g.type)({blockhash:(0,g.string)(),previousBlockhash:(0,g.string)(),parentSlot:(0,g.number)(),rewards:(0,g.optional)((0,g.array)(eQ)),blockTime:(0,g.nullable)((0,g.number)()),blockHeight:(0,g.nullable)((0,g.number)())}))),ep((0,g.nullable)((0,g.type)({blockhash:(0,g.string)(),previousBlockhash:(0,g.string)(),parentSlot:(0,g.number)(),transactions:(0,g.array)((0,g.type)({transaction:eJ,meta:(0,g.nullable)(eH)})),rewards:(0,g.optional)((0,g.array)(eQ)),blockTime:(0,g.nullable)((0,g.number)())}))),ep((0,g.nullable)((0,g.type)({blockhash:(0,g.string)(),previousBlockhash:(0,g.string)(),parentSlot:(0,g.number)(),signatures:(0,g.array)((0,g.string)()),blockTime:(0,g.nullable)((0,g.number)())}))),ep((0,g.nullable)((0,g.type)({slot:(0,g.number)(),meta:(0,g.nullable)(eH),blockTime:(0,g.optional)((0,g.nullable)((0,g.number)())),transaction:eJ,version:(0,g.optional)(eG)}))),ep((0,g.nullable)((0,g.type)({slot:(0,g.number)(),transaction:eF,meta:(0,g.nullable)(eD),blockTime:(0,g.optional)((0,g.nullable)((0,g.number)())),version:(0,g.optional)(eG)}))),eg((0,g.type)({blockhash:(0,g.string)(),feeCalculator:(0,g.type)({lamportsPerSignature:(0,g.number)()})}
7)),eg((0,g.type)({blockhash:(0,g.string)(),lastValidBlockHeight:(0,g.number)()})),eg((0,g.boolean)());let eX=(0,g.type)({slot:(0,g.number)(),numTransactions:(0,g.number)(),numSlots:(0,g.number)(),samplePeriodSecs:(0,g.number)()});ep((0,g.array)(eX)),eg((0,g.nullable)((0,g.type)({feeCalculator:(0,g.type)({lamportsPerSignature:(0,g.number)()})}))),ep((0,g.string)()),ep((0,g.string)());let eY=(0,g.type)({err:eI,logs:(0,g.array)((0,g.string)()),signature:(0,g.string)()});(0,g.type)({result:eh(eY),subscription:(0,g.number)()});class eZ{constructor(e){this._keypair=void 0,this._keypair=e??b()}static generate(){return new eZ(b())}static fromSecretKey(e,t){if(64!==e.byteLength)throw Error("bad secret key size");let r=e.slice(32,64);if(!t||!t.skipValidation){let t=m(e.slice(0,32));for(let e=0;e<32;e++)if(r[e]!==t[e])throw Error("provided secretKey is invalid")}return new eZ({publicKey:r,secretKey:e})}static fromSeed(e){let t=m(e),r=new Uint8Array(64);return r.set(e),r.set(t,32),new eZ({publicKey:t,secretKey:r})}get publicKey(){return new v(this._keypair.publicKey)}get secretKey(){return new Uint8Array(this._keypair.secretKey)}}let e0=Object.freeze({CreateLookupTable:{index:0,layout:d.n_([d.Jq("instruction"),en("recentSlot"),d.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:d.n_([d.Jq("instruction")])},ExtendLookupTable:{index:2,layout:d.n_([d.Jq("instruction"),en(),d.A9(z(),d.cv(d.Jq(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:d.n_([d.Jq("instruction")])},CloseLookupTable:{index:4,layout:d.n_([d.Jq("instruction")])}});class e1{constructor(){}static createLookupTable(e){let[t,r]=v.findProgramAddressSync([e.authority.toBuffer(),(0,p.k$)(BigInt(e.recentSlot),8)],this.programId),n=Z(e0.CreateLookupTable,{recentSlot:BigInt(e.recentSlot),bumpSeed:r}),i=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:es.programId,isSigner:!1,isWritable:!1}];return[new F({programId:this.programId,keys:i,data:n}),t]}static freezeLookupTable(e){let t=Z(e0.FreezeLookupTable),r=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new F({programId:this.programId,keys:r,data:t})}static extendLookupTable(e){let t=Z(e0.ExtendLookupTable,{addresses:e.addresses.map(e=>e.toBytes())}),r=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return e.payer&&r.push({pubkey:e.payer,isSigner:!0,isWritable:!0},{pubkey:es.programId,isSigner:!1,isWritable:!1}),new F({programId:this.programId,keys:r,data:t})}static deactivateLookupTable(e){let t=Z(e0.DeactivateLookupTable),r=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1}];return new F({programId:this.programId,keys:r,data:t})}static closeLookupTable(e){let t=Z(e0.CloseLookupTable),r=[{pubkey:e.lookupTable,isSigner:!1,isWritable:!0},{pubkey:e.authority,isSigner:!0,isWritable:!1},{pubkey:e.recipient,isSigner:!1,isWritable:!0}];return new F({programId:this.programId,keys:r,data:t})}}e1.programId=new v("AddressLookupTab1e1111111111111111111111111");let e8=Object.freeze({RequestUnits:{index:0,layout:d.n_([d.u8("instruction"),d.Jq("units"),d.Jq("additionalFee")])},RequestHeapFrame:{index:1,layout:d.n_([d.u8("instruction"),d.Jq("bytes")])},SetComputeUnitLimit:{index:2,layout:d.n_([d.u8("instruction"),d.Jq("units")])},SetComputeUnitPrice:{index:3,layout:d.n_([d.u8("instruction"),en("microLamports")])}});class e2{constructor(){}static requestUnits(e){let t=Z(e8.RequestUnits,e);return new F({keys:[],programId:this.programId,data:t})}static requestHeapFrame(e){let t=Z(e8.RequestHeapFrame,e);return new F({keys:[],programId:this.programId,data:t})}static setComputeUnitLimit(e){let t=Z(e8.SetComputeUnitLimit,e);return new F({keys:[],programId:this.programId,data:t})}static setComputeUnitPrice(e){let t=Z(e8.SetComputeUnitPrice,{microLamports:BigInt(e.microLamports)});return new F({keys:[],programId:this.programId,data:t})}}e2.programId=new v("ComputeBudget111111111111111111111111111111");let e3=d.n_([d.u8("numSignatures"),d.u8("padding"),d.KB("signatureOffset"),d.KB("signatureInstructionIndex"),d.KB("publicKeyOffset"),d.KB("publicKeyInstructionIndex"),d.KB("messageDataOffset"),d.KB("messageDataSize"),d.KB("messageInstructionIndex")]
vendor: 8,692 bytes, line 7
7);class e6{constructor(){}static createInstructionWithPublicKey(e){let{publicKey:t,message:r,signature:i,instructionIndex:s}=e;q(32===t.length,`Public Key must be 32 bytes but received ${t.length} bytes`),q(64===i.length,`Signature must be 64 bytes but received ${i.length} bytes`);let a=e3.span,o=a+t.length,u=o+i.length,l=n.Buffer.alloc(u+r.length),c=null==s?65535:s;return e3.encode({numSignatures:1,padding:0,signatureOffset:o,signatureInstructionIndex:c,publicKeyOffset:a,publicKeyInstructionIndex:c,messageDataOffset:u,messageDataSize:r.length,messageInstructionIndex:c},l),l.fill(t,a),l.fill(i,o),l.fill(r,u),new F({keys:[],programId:e6.programId,data:l})}static createInstructionWithPrivateKey(e){let{privateKey:t,message:r,instructionIndex:n}=e;q(64===t.length,`Private key must be 64 bytes but received ${t.length} bytes`);try{let e=eZ.fromSecretKey(t),i=e.publicKey.toBytes(),s=k(r,e.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:s,instructionIndex:n})}catch(e){throw Error(`Error creating instruction; ${e}`)}}}e6.programId=new v("Ed25519SigVerify111111111111111111111111111");let e4=(e,t)=>{let r=y.kA.sign(e,t);return[r.toCompactRawBytes(),r.recovery]};y.kA.utils.isValidPrivateKey;let e5=y.kA.getPublicKey,e9=d.n_([d.u8("numSignatures"),d.KB("signatureOffset"),d.u8("signatureInstructionIndex"),d.KB("ethAddressOffset"),d.u8("ethAddressInstructionIndex"),d.KB("messageDataOffset"),d.KB("messageDataSize"),d.u8("messageInstructionIndex"),d.Ik(20,"ethAddress"),d.Ik(64,"signature"),d.u8("recoveryId")]);class e7{constructor(){}static publicKeyToEthAddress(e){q(64===e.length,`Public key must be 64 bytes but received ${e.length} bytes`);try{return n.Buffer.from((0,h.fr)(I(e))).slice(-20)}catch(e){throw Error(`Error constructing Ethereum address: ${e}`)}}static createInstructionWithPublicKey(e){let{publicKey:t,message:r,signature:n,recoveryId:i,instructionIndex:s}=e;return e7.createInstructionWithEthAddress({ethAddress:e7.publicKeyToEthAddress(t),message:r,signature:n,recoveryId:i,instructionIndex:s})}static createInstructionWithEthAddress(e){let t;let{ethAddress:r,message:i,signature:s,recoveryId:a,instructionIndex:o=0}=e;q(20===(t="string"==typeof r?r.startsWith("0x")?n.Buffer.from(r.substr(2),"hex"):n.Buffer.from(r,"hex"):r).length,`Address must be 20 bytes but received ${t.length} bytes`);let u=12+t.length,l=u+s.length+1,c=n.Buffer.alloc(e9.span+i.length);return e9.encode({numSignatures:1,signatureOffset:u,signatureInstructionIndex:o,ethAddressOffset:12,ethAddressInstructionIndex:o,messageDataOffset:l,messageDataSize:i.length,messageInstructionIndex:o,signature:I(s),ethAddress:I(t),recoveryId:a},c),c.fill(I(i),e9.span),new F({keys:[],programId:e7.programId,data:c})}static createInstructionWithPrivateKey(e){let{privateKey:t,message:r,instructionIndex:i}=e;q(32===t.length,`Private key must be 32 bytes but received ${t.length} bytes`);try{let e=I(t),s=e5(e,!1).slice(1),a=n.Buffer.from((0,h.fr)(I(r))),[o,u]=e4(a,e);return this.createInstructionWithPublicKey({publicKey:s,message:r,signature:o,recoveryId:u,instructionIndex:i})}catch(e){throw Error(`Error creating instruction; ${e}`)}}}e7.programId=new v("KeccakSecp256k11111111111111111111111111111");let te=new v("StakeConfig11111111111111111111111111111111");class tt{constructor(e,t,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=r}}tt.default=new tt(0,0,v.default);let tr=Object.freeze({Initialize:{index:0,layout:d.n_([d.Jq("instruction"),((e="authorized")=>d.n_([z("staker"),z("withdrawer")],e))(),((e="lockup")=>d.n_([d.gM("unixTimestamp"),d.gM("epoch"),z("custodian")],e))()])},Authorize:{index:1,layout:d.n_([d.Jq("instruction"),z("newAuthorized"),d.Jq("stakeAuthorizationType")])},Delegate:{index:2,layout:d.n_([d.Jq("instruction")])},Split:{index:3,layout:d.n_([d.Jq("instruction"),d.gM("lamports")])},Withdraw:{index:4,layout:d.n_([d.Jq("instruction"),d.gM("lamports")])},Deactivate:{index:5,layout:d.n_([d.Jq("instruction")])},Merge:{index:7,layout:d.n_([d.Jq("instruction")])},AuthorizeWithSeed:{index:8,layout:d.n_([d.Jq("instruction"),z("newAuthorized"),d.Jq("stakeAuthorizationType"),_("authoritySeed"),z("authorityOwner")])}});Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class tn{constructor(){}static initialize(e){let{stakePubkey:t,authorized:r,lockup:n}=e,i=n||tt.default,s=Z(tr.Initialize,{authorized:{staker:I(r.staker.toBuffer()),withdrawer:I(r.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:I(i.custodian.toBuffer())}});return new F({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:G,isSigner:!1,isWritable:!1}],programId:this.programId,data:s})}static createAccountWithSeed(e){let t=new V;t.add(es.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:n,lockup:i}=e;return t.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static createAccount(e){let t=new V;t.add(es.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));let{stakePubkey:r,authorized:n,lockup:i}=e;return t.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static delegate(e){let{stakePubkey:t,authorizedPubkey:r,votePubkey:n}=e,i=Z(tr.Delegate);return new V().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:H,isSigner:!1,isWritable:!1},{pubkey:Q,isSigner:!1,isWritable:!1},{pubkey:te,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static authorize(e){let{stakePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:n,stakeAuthorizationType:i,custodianPubkey:s}=e,a=Z(tr.Authorize,{newAuthorized:I(n.toBuffer()),stakeAuthorizationType:i.index}),o=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:H,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return s&&o.push({pubkey:s,isSigner:!0,isWritable:!1}),new V().add({keys:o,programId:this.programId,data:a})}static authorizeWithSeed(e){let{stakePubkey:t,authorityBase:r,authoritySeed:n,authorityOwner:i,newAuthorizedPubkey:s,stakeAuthorizationType:a,custodianPubkey:o}=e,u=Z(tr.AuthorizeWithSeed,{newAuthorized:I(s.toBuffer()),stakeAuthorizationType:a.index,authoritySeed:n,authorityOwner:I(i.toBuffer())}),l=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:H,isSigner:!1,isWritable:!1}];return o&&l.push({pubkey:o,isSigner:!0,isWritable:!1}),new V().add({keys:l,programId:this.programId,data:u})}static splitInstruction(e){let{stakePubkey:t,authorizedPubkey:r,splitStakePubkey:n,lamports:i}=e,s=Z(tr.Split,{lamports:i});return new F({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}static split(e,t){let r=new V;return r.add(es.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:t,space:this.space,programId:this.programId})),r.add(this.splitInstruction(e))}static splitWithSeed(e,t){let{stakePubkey:r,authorizedPubkey:n,splitStakePubkey:i,basePubkey:s,seed:a,lamports:o}=e,u=new V;return u.add(es.allocate({accountPubkey:i,basePubkey:s,seed:a,space:this.space,programId:this.programId})),t&&t>0&&u.add(es.transfer({fromPubkey:e.authorizedPubkey,toPubkey:i,lamports:t})),u.add(this.splitInstruction({stakePubkey:r,authorizedPubkey:n,splitStakePubkey:i,lamports:o}))}static merge(e){let{stakePubkey:t,sourceStakePubKey:r,authorizedPubkey:n}=e,i=Z(tr.Merge);return new V().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:H,isSigner:!1,isWritable:!1},{pubkey:Q,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static withdraw(e){let{stakePubkey:t,authorizedPubkey:r,toPubkey:n,lamports:i,custodianPubkey:s}=e,a=Z(tr.Withdraw,{lamports:i}),o=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:H,isSigner:!1,isWritable:!1},{pubkey:Q,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return s&&o.push({pubkey:s,isSigner:!0,isWritable:!1}),new V().add({keys:o,programId:this.programId,data:a})}static deactivate(e){let{stakePubkey:t,authorizedPubkey:r}=e,n=Z(tr.Deactivate);return new V().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:H,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}}tn.programId=new v("Stake11111111111111111111111111111111111111"),tn.space=2
700;let ti=Object.freeze({InitializeAccount:{index:0,layout:d.n_([d.Jq("instruction"),((e="voteInit")=>d.n_([z("nodePubkey"),z("authorizedVoter"),z("authorizedWithdrawer"),d.u8("commission")],e))()])},Authorize:{index:1,layout:d.n_([d.Jq("instruction"),z("newAuthorized"),d.Jq("voteAuthorizationType")])},Withdraw:{index:3,layout:d.n_([d.Jq("instruction"),d.gM("lamports")])},UpdateValidatorIdentity:{index:4,layout:d.n_([d.Jq("instruction")])},AuthorizeWithSeed:{index:10,layout:d.n_([d.Jq("instruction"),((e="voteAuthorizeWithSeedArgs")=>d.n_([d.Jq("voteAuthorizationType"),z("currentAuthorityDerivedKeyOwnerPubkey"),_("currentAuthorityDerivedKeySeed"),z("newAuthorized")],e))()])}});Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class ts{constructor(){}static initializeAccount(e){let{votePubkey:t,nodePubkey:r,voteInit:n}=e,i=Z(ti.InitializeAccount,{voteInit:{nodePubkey:I(n.nodePubkey.toBuffer()),authorizedVoter:I(n.authorizedVoter.toBuffer()),authorizedWithdrawer:I(n.authorizedWithdrawer.toBuffer()),commission:n.commission}});return new F({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:G,isSigner:!1,isWritable:!1},{pubkey:H,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static createAccount(e){let t=new V;return t.add(es.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){let{votePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:n,voteAuthorizationType:i}=e,s=Z(ti.Authorize,{newAuthorized:I(n.toBuffer()),voteAuthorizationType:i.index});return new V().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:H,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}static authorizeWithSeed(e){let{currentAuthorityDerivedKeyBasePubkey:t,currentAuthorityDerivedKeyOwnerPubkey:r,currentAuthorityDerivedKeySeed:n,newAuthorizedPubkey:i,voteAuthorizationType:s,votePubkey:a}=e,o=Z(ti.AuthorizeWithSeed,{voteAuthorizeWithSeedArgs:{currentAuthorityDerivedKeyOwnerPubkey:I(r.toBuffer()),currentAuthorityDerivedKeySeed:n,newAuthorized:I(i.toBuffer()),voteAuthorizationType:s.index}});return new V().add({keys:[{pubkey:a,isSigner:!1,isWritable:!0},{pubkey:H,isSigner:!1,isWritable:!1},{pubkey:t,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static withdraw(e){let{votePubkey:t,authorizedWithdrawerPubkey:r,lamports:n,toPubkey:i}=e,s=Z(ti.Withdraw,{lamports:n});return new V().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:s})}static safeWithdraw(e,t,r){if(e.lamports>t-r)throw Error("Withdraw will leave vote account with insufficient funds.");return ts.withdraw(e)}static updateValidatorIdentity(e){let{votePubkey:t,authorizedWithdrawerPubkey:r,nodePubkey:n}=e,i=Z(ti.UpdateValidatorIdentity);return new V().add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}}ts.programId=new v("Vote111111111111111111111111111111111111111"),ts.space=3762,new v("Va1idator1nfo111111111111111111111111111111"),(0,g.type)({name:(0,g.string)(),website:(0,g.optional)((0,g.string)()),details:(0,g.optional)((0,g.string)()),keybaseUsername:(0,g.optional)((0,g.string)())}),new v("Vote111111111111111111111111111111111111111"),d.n_([z("nodePubkey"),z("authorizedWithdrawer"),d.u8("commission"),d._O(),d.A9(d.n_([d._O("slot"),d.Jq("confirmationCount")]),d.cv(d.Jq(),-8),"votes"),d.u8("rootSlotValid"),d._O("rootSlot"),d._O(),d.A9(d.n_([d._O("epoch"),z("authorizedVoter")]),d.cv(d.Jq(),-8),"authorizedVoters"),d.n_([d.A9(d.n_([z("authorizedPubkey"),d._O("epochOfLastAuthorizedSwitch"),d._O("targetEpoch")]),32,"buf"),d._O("idx"),d.u8("isEmpty")],"priorVoters"),d._O(),d.A9(d.n_([d._O("epoch"),d._O("credits"),d._O("prevCredits")]),d.cv(d.Jq(),-8),"epochCredits"),d.n_([d._O("slot"),d._O("timestamp")],"lastTimestamp")])}}]);

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.