@revibase/core 0.0.38 → 0.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +338 -123
- package/dist/index.d.ts +338 -123
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getOptionEncoder,getOptionDecoder,getArrayEncoder,getU64Encoder,getArrayDecoder,getU64Decoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getU16Encoder,getU16Decoder,getBooleanEncoder,getBooleanDecoder,getEnumEncoder,getEnumDecoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64Encoder,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,getBase64Decoder,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,getBlockhashDecoder,compileTransaction,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {VERSION,featureFlags,createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,CTOKEN_PROGRAM_ID,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import {estimateComputeUnitLimitFactory,getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTokenDecoder,getTransferSolInstruction}from'gill/programs';import Fd from'bn.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {p256}from'@noble/curves/nist.js';var rs=new Uint8Array([201,232,212,229,59,241,106,197]);function KC(){return fixEncoderSize(getBytesEncoder(),8).encode(rs)}function su(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["rpIdHash",fixEncoderSize(getBytesEncoder(),32)],["bump",getU8Encoder()],["isDisabled",getU8Encoder()],["rpIdLength",getU8Encoder()],["numOrigins",getU8Encoder()],["rpId",fixEncoderSize(getBytesEncoder(),255)],["origins",fixEncoderSize(getBytesEncoder(),515)]]),e=>({...e,discriminator:rs}))}function ns(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["rpIdHash",fixDecoderSize(getBytesDecoder(),32)],["bump",getU8Decoder()],["isDisabled",getU8Decoder()],["rpIdLength",getU8Decoder()],["numOrigins",getU8Decoder()],["rpId",fixDecoderSize(getBytesDecoder(),255)],["origins",fixDecoderSize(getBytesDecoder(),515)]])}function jC(){return combineCodec(su(),ns())}function ss(e){return decodeAccount(e,ns())}async function os(e,n,r){let s=await ou(e,n,r);return assertAccountExists(s),s}async function ou(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ss(s)}async function JC(e,n,r){let s=await cu(e,n,r);return assertAccountsExist(s),s}async function cu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ss(t))}function qC(){return 846}var is=new Uint8Array([42,206,176,58,175,129,130,233]);function XC(){return fixEncoderSize(getBytesEncoder(),8).encode(is)}function xu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:is}))}function ds(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function QC(){return combineCodec(xu(),ds())}function us(e){return decodeAccount(e,ds())}async function $C(e,n,r){let s=await Iu(e,n,r);return assertAccountExists(s),s}async function Iu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return us(s)}async function eD(e,n,r){let s=await Cu(e,n,r);return assertAccountsExist(s),s}async function Cu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>us(t))}function tD(){return 24}function Er(){return getStructEncoder([["memberKey",ee()],["permissions",Le()],["userReadonlyArgs",Ce()]])}function hr(){return getStructDecoder([["memberKey",te()],["permissions",Oe()],["userReadonlyArgs",De()]])}function oD(){return combineCodec(Er(),hr())}function Rr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function br(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function iD(){return combineCodec(Rr(),br())}function dt(){return getStructEncoder([["treeInfo",At()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function ut(){return getStructDecoder([["treeInfo",gt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function gD(){return combineCodec(dt(),ut())}function pt(){return getStructEncoder([["treeInfo",At()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function mt(){return getStructDecoder([["treeInfo",gt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function TD(){return combineCodec(pt(),mt())}function kr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function Lr(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function SD(){return combineCodec(kr(),Lr())}function yt(){return getStructEncoder([["data",getOptionEncoder(Tt())]])}function q(){return getStructDecoder([["data",getOptionDecoder(lt())]])}function DD(){return combineCodec(yt(),q())}function Tt(){return getStructEncoder([["threshold",getU8Encoder()],["bump",getU8Encoder()],["index",getU128Encoder()],["multiWalletBump",getU8Encoder()],["members",getArrayEncoder(ft())],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function lt(){return getStructDecoder([["threshold",getU8Decoder()],["bump",getU8Decoder()],["index",getU128Decoder()],["multiWalletBump",getU8Decoder()],["members",getArrayDecoder(St())],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function hD(){return combineCodec(Tt(),lt())}function Be(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(wr())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Er())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Vr())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function we(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Nr())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(hr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Hr())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function _D(){return combineCodec(Be(),we())}function UD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function WD(e,n){return n.__kind===e}function Fr(){return getStructEncoder([["member",getAddressEncoder()],["role",Ne()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Te()]])}function Gr(){return getStructDecoder([["member",getAddressDecoder()],["role",Ve()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",le()]])}function BD(){return combineCodec(Fr(),Gr())}function wr(){return getStructEncoder([["memberKey",ee()],["permissions",Le()]])}function Nr(){return getStructDecoder([["memberKey",te()],["permissions",Oe()]])}function HD(){return combineCodec(wr(),Nr())}function xt(){return getStructEncoder([["memberKey",ee()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function It(){return getStructDecoder([["memberKey",te()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function KD(){return combineCodec(xt(),It())}function zr(){return getStructEncoder([["settingsMutArgs",F()],["transactionManager",getOptionEncoder(Ce())]])}function Kr(){return getStructDecoder([["settingsMutArgs",G()],["transactionManager",getOptionDecoder(De())]])}function ZD(){return combineCodec(zr(),Kr())}function ft(){return getStructEncoder([["pubkey",ee()],["permissions",Le()],["role",getU8Encoder()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function St(){return getStructDecoder([["pubkey",te()],["permissions",Oe()],["role",getU8Decoder()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function $D(){return combineCodec(ft(),St())}function ee(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function te(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function rM(){return combineCodec(ee(),te())}function qr(){return getStructEncoder([["authorityCreationArgs",Te()],["compressedProofArgs",C()]])}function Zr(){return getStructDecoder([["authorityCreationArgs",le()],["compressedProofArgs",D()]])}function cM(){return combineCodec(qr(),Zr())}function Ct(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function Dt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function dM(){return combineCodec(Ct(),Dt())}function Yr(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function Xr(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function gM(){return combineCodec(Yr(),Xr())}function At(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function gt(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function yM(){return combineCodec(At(),gt())}function Le(){return getStructEncoder([["mask",getU8Encoder()]])}function Oe(){return getStructDecoder([["mask",getU8Decoder()]])}function fM(){return combineCodec(Le(),Oe())}function C(){return getStructEncoder([["proof",getOptionEncoder(kr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function D(){return getStructDecoder([["proof",getOptionDecoder(Lr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function CM(){return combineCodec(C(),D())}function Vr(){return getStructEncoder([["memberKey",ee()],["userArgs",Qr()]])}function Hr(){return getStructDecoder([["memberKey",te()],["userArgs",$r()]])}function EM(){return combineCodec(Vr(),Hr())}function en(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Mt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function bM(){return combineCodec(en(),Mt())}function N(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function V(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function UM(){return combineCodec(N(),V())}function Z(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",N()]])}function Y(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",V()]])}function OM(){return combineCodec(Z(),Y())}function Pt(){return getStructEncoder([["addressTreeInfo",Ct()],["outputStateTreeIndex",getU8Encoder()]])}function Et(){return getStructDecoder([["addressTreeInfo",Dt()],["outputStateTreeIndex",getU8Decoder()]])}function VM(){return combineCodec(Pt(),Et())}function ht(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function Rt(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function GM(){return combineCodec(ht(),Rt())}function F(){return getStructEncoder([["accountMeta",dt()],["data",yt()]])}function G(){return getStructDecoder([["accountMeta",ut()],["data",q()]])}function JM(){return combineCodec(F(),G())}function bt(){return getStructEncoder([["accountMeta",pt()],["data",yt()]])}function vt(){return getStructDecoder([["accountMeta",mt()],["data",q()]])}function XM(){return combineCodec(bt(),vt())}function _t(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",Yr()]])}function Ut(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",Xr()]])}function tP(){return combineCodec(_t(),Ut())}function Wt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getArrayEncoder(xt())]])}function kt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getArrayDecoder(It())]])}function oP(){return combineCodec(Wt(),kt())}function Lt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(Rr())],["addressTableLookups",getArrayEncoder(tn())]])}function Ot(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(br())],["addressTableLookups",getArrayDecoder(rn())]])}function dP(){return combineCodec(Lt(),Ot())}function tn(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function rn(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function gP(){return combineCodec(tn(),rn())}function He(){return getStructEncoder([["member",ee()],["domainConfig",getOptionEncoder(getAddressEncoder())],["role",Ne()],["delegatedTo",getOptionEncoder(ht())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function X(){return getStructDecoder([["member",te()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",Ve()],["delegatedTo",getOptionDecoder(Rt())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function TP(){return combineCodec(He(),X())}function Te(){return getStructEncoder([["addressTreeInfo",Ct()],["outputStateTreeIndex",getU8Encoder()]])}function le(){return getStructDecoder([["addressTreeInfo",Dt()],["outputStateTreeIndex",getU8Decoder()]])}function xP(){return combineCodec(Te(),le())}function Fe(){return getStructEncoder([["accountMeta",dt()],["data",He()]])}function Ge(){return getStructDecoder([["accountMeta",ut()],["data",X()]])}function MP(){return combineCodec(Fe(),Ge())}function Ce(){return getStructEncoder([["accountMeta",pt()],["data",He()]])}function De(){return getStructDecoder([["accountMeta",mt()],["data",X()]])}function RP(){return combineCodec(Ce(),De())}function Qr(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Ce()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([Fe()])]])]])}function $r(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([De()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([Ge()])]])]])}function UP(){return combineCodec(Qr(),$r())}function WP(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function kP(e,n){return n.__kind===e}var Xe=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(Xe||{});function Ne(){return getEnumEncoder(Xe)}function Ve(){return getEnumDecoder(Xe)}function BP(){return combineCodec(Ne(),Ve())}var Js=new Uint8Array([223,179,163,190,177,224,67,173]);function EE(){return fixEncoderSize(getBytesEncoder(),8).encode(Js)}function qp(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(ft())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:Js}))}function qs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(St())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function hE(){return combineCodec(qp(),qs())}function Zs(e){return decodeAccount(e,qs())}async function RE(e,n,r){let s=await on(e,n,r);return assertAccountExists(s),s}async function on(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Zs(s)}async function bE(e,n,r){let s=await Zp(e,n,r);return assertAccountsExist(s),s}async function Zp(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Zs(t))}var eo=new Uint8Array([90,36,35,219,93,225,110,96]);function WE(){return fixEncoderSize(getBytesEncoder(),8).encode(eo)}function pm(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["multiWalletSettings",getAddressEncoder()],["multiWalletBump",getU8Encoder()],["canExecute",getBooleanEncoder()],["preauthorizeExecution",getBooleanEncoder()],["validTill",getU64Encoder()],["payer",getAddressEncoder()],["bump",getU8Encoder()],["bufferIndex",getU8Encoder()],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["creator",ee()],["executor",ee()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(ee())],["expectedSecp256r1Signers",getArrayEncoder(xt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:eo}))}function to(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multiWalletSettings",getAddressDecoder()],["multiWalletBump",getU8Decoder()],["canExecute",getBooleanDecoder()],["preauthorizeExecution",getBooleanDecoder()],["validTill",getU64Decoder()],["payer",getAddressDecoder()],["bump",getU8Decoder()],["bufferIndex",getU8Decoder()],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["creator",te()],["executor",te()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(te())],["expectedSecp256r1Signers",getArrayDecoder(It())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function kE(){return combineCodec(pm(),to())}function ro(e){return decodeAccount(e,to())}async function no(e,n,r){let s=await mm(e,n,r);return assertAccountExists(s),s}async function mm(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ro(s)}async function LE(e,n,r){let s=await ym(e,n,r);return assertAccountsExist(s),s}async function ym(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ro(t))}var co=new Uint8Array([105,23,173,2,197,255,80,87]);function wE(){return fixEncoderSize(getBytesEncoder(),8).encode(co)}function Wm(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:co}))}function ao(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function NE(){return combineCodec(Wm(),ao())}function io(e){return decodeAccount(e,ao())}async function uo(e,n,r){let s=await km(e,n,r);return assertAccountExists(s),s}async function km(e,n,r){let s=await fetchEncodedAccount(e,n,r);return io(s)}async function VE(e,n,r){let s=await Lm(e,n,r);return assertAccountsExist(s),s}async function Lm(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>io(t))}function m({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function go(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function _(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function y(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let s=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:_(r.value),role:Ao(r.value)?upgradeRoleToSigner(s):s,...Ao(r.value)?{signer:r.value}:{}})}}function Ao(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var mo=new Uint8Array([8]);function nh(){return fixEncoderSize(getBytesEncoder(),1).encode(mo)}function mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:mo}))}function yo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function sh(){return combineCodec(mn(),yo())}async function To(e,n){let r=n?.programAddress??d,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:mn().encode(c),programAddress:r})}function oh(e,n){let r=n?.programAddress??d,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:mn().encode(c),programAddress:r})}function ch(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:yo().decode(e.data)}}var Co=new Uint8Array([9]);function ph(){return fixEncoderSize(getBytesEncoder(),1).encode(Co)}function yn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(Be())],["secp256r1VerifyArgs",getArrayEncoder(Z())],["compressedProofArgs",getOptionEncoder(C())]]),e=>({...e,discriminator:Co}))}function Do(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(we())],["secp256r1VerifyArgs",getArrayDecoder(Y())],["compressedProofArgs",getOptionDecoder(D())]])}function mh(){return combineCodec(yn(),Do())}async function Mo(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.settings.value||(t.settings.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getU128Encoder().encode(go(c.settingsIndex))]})),t.authority.value||(t.authority.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(_(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:yn().encode(c),programAddress:r})}function yh(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:yn().encode(c),programAddress:r})}function Th(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Do().decode(e.data)}}var bo=new Uint8Array([19]);function Dh(){return fixEncoderSize(getBytesEncoder(),1).encode(bo)}function vo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(Be())],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:bo}))}function _o(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(we())],["secp256r1VerifyArgs",getArrayDecoder(Y())],["settingsMutArgs",G()],["compressedProofArgs",D()]])}function Mh(){return combineCodec(vo(),_o())}function Uo(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:vo().encode(c),programAddress:r})}function Ph(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:_o().decode(e.data)}}var Lo=new Uint8Array([18]);function Uh(){return fixEncoderSize(getBytesEncoder(),1).encode(Lo)}function Tn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["settingsCreation",Pt()],["userReadonlyArgs",Ce()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Lo}))}function Oo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["settingsCreation",Et()],["userReadonlyArgs",De()],["settingsIndex",getU128Decoder()]])}function Wh(){return combineCodec(Tn(),Oo())}async function Bo(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Tn().encode(c),programAddress:r})}function kh(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Tn().encode(c),programAddress:r})}function Lh(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:Oo().decode(e.data)}}var Ko=new Uint8Array([0]);function Fh(){return fixEncoderSize(getBytesEncoder(),1).encode(Ko)}function fn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",Te()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ko}))}function jo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",le()],["compressedProofArgs",D()]])}function Gh(){return combineCodec(fn(),jo())}async function Jo(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:fn().encode(c),programAddress:r})}function zh(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:fn().encode(c),programAddress:r})}function Kh(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:jo().decode(e.data)}}var Zo=new Uint8Array([4]);function Qh(){return fixEncoderSize(getBytesEncoder(),1).encode(Zo)}function xn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["member",en()],["role",Ne()],["userAccountCreationArgs",Te()],["linkWalletArgs",getOptionEncoder(zr())]]),e=>({...e,discriminator:Zo}))}function Yo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["member",Mt()],["role",Ve()],["userAccountCreationArgs",le()],["linkWalletArgs",getOptionDecoder(Kr())]])}function $h(){return combineCodec(xn(),Yo())}async function Xo(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:xn().encode(c),programAddress:r})}function eR(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:xn().encode(c),programAddress:r})}function tR(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:Yo().decode(e.data)}}var $o=new Uint8Array([3]);function aR(){return fixEncoderSize(getBytesEncoder(),1).encode($o)}function Cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:$o}))}function ec(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function iR(){return combineCodec(Cn(),ec())}async function tc(e,n){let r=n?.programAddress??d,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=y(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Cn().encode({}),programAddress:r})}function dR(e,n){let r=n?.programAddress??d,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=y(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Cn().encode({}),programAddress:r})}function uR(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:ec().decode(e.data)}}var nc=new Uint8Array([5]);function lR(){return fixEncoderSize(getBytesEncoder(),1).encode(nc)}function Mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["createUserArgs",getArrayEncoder(Fr())]]),e=>({...e,discriminator:nc}))}function sc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["createUserArgs",getArrayDecoder(Gr())]])}function fR(){return combineCodec(Mn(),sc())}async function oc(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Mn().encode(c),programAddress:r})}function SR(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Mn().encode(c),programAddress:r})}function xR(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:sc().decode(e.data)}}var ic=new Uint8Array([17]);function hR(){return fixEncoderSize(getBytesEncoder(),1).encode(ic)}function dc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",F()],["compressedProofArgs",C()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:ic}))}function uc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",G()],["compressedProofArgs",D()],["secp256r1VerifyArgs",getArrayDecoder(Y())]])}function RR(){return combineCodec(dc(),uc())}function Ac(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:dc().encode(c),programAddress:r})}function bR(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:uc().decode(e.data)}}var mc=new Uint8Array([2]);function LR(){return fixEncoderSize(getBytesEncoder(),1).encode(mc)}function yc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:mc}))}function Tc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function OR(){return combineCodec(yc(),Tc())}function lc(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:yc().encode(c),programAddress:r})}function BR(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:Tc().decode(e.data)}}var Ic=new Uint8Array([1]);function zR(){return fixEncoderSize(getBytesEncoder(),1).encode(Ic)}function En(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(qr())]]),e=>({...e,discriminator:Ic}))}function Cc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Zr())]])}function KR(){return combineCodec(En(),Cc())}async function jR(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:En().encode(c),programAddress:r})}function Dc(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:En().encode(c),programAddress:r})}function JR(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:Cc().decode(e.data)}}var Ec=new Uint8Array([6]);function eb(){return fixEncoderSize(getBytesEncoder(),1).encode(Ec)}function hc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Fe()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ec}))}function Rc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ge()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",D()]])}function tb(){return combineCodec(hc(),Rc())}function bc(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:hc().encode(c),programAddress:r})}function rb(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Rc().decode(e.data)}}var Uc=new Uint8Array([7]);function db(){return fixEncoderSize(getBytesEncoder(),1).encode(Uc)}function Wc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Fe()],["secp256r1VerifyArgs",getOptionEncoder(N())],["delegateTo",getOptionEncoder(ht())],["oldSettingsMutArgs",getOptionEncoder(F())],["newSettingsMutArgs",getOptionEncoder(F())],["compressedProofArgs",C()]]),e=>({...e,discriminator:Uc}))}function kc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ge()],["secp256r1VerifyArgs",getOptionDecoder(V())],["delegateTo",getOptionDecoder(Rt())],["oldSettingsMutArgs",getOptionDecoder(G())],["newSettingsMutArgs",getOptionDecoder(G())],["compressedProofArgs",D()]])}function ub(){return combineCodec(Wc(),kc())}function Lc(e,n){let r=n?.programAddress??d,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...i],data:Wc().encode(c),programAddress:r})}function Ab(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:kc().decode(e.data)}}var wc=new Uint8Array([32]);function fb(){return fixEncoderSize(getBytesEncoder(),1).encode(wc)}function Nc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Tt()],["compressedProofArgs",C()],["settingsCreationArgs",Pt()]]),e=>({...e,discriminator:wc}))}function Vc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",lt()],["compressedProofArgs",D()],["settingsCreationArgs",Et()]])}function Sb(){return combineCodec(Nc(),Vc())}function Hc(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:Nc().encode(c),programAddress:r})}function xb(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Vc().decode(e.data)}}var zc=new Uint8Array([31]);function hb(){return fixEncoderSize(getBytesEncoder(),1).encode(zc)}function Kc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",He()],["compressedProofArgs",C()],["userCreationArgs",Te()]]),e=>({...e,discriminator:zc}))}function jc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",X()],["compressedProofArgs",D()],["userCreationArgs",le()]])}function Rb(){return combineCodec(Kc(),jc())}function Jc(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:Kc().encode(c),programAddress:r})}function bb(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:jc().decode(e.data)}}var Zc=new Uint8Array([29]);function Ob(){return fixEncoderSize(getBytesEncoder(),1).encode(Zc)}function hn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:Zc}))}function Yc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Y())]])}function Bb(){return combineCodec(hn(),Yc())}async function wb(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(_(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:hn().encode(c),programAddress:r})}function Xc(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:hn().encode(c),programAddress:r})}function Nb(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Yc().decode(e.data)}}var ea=new Uint8Array([27]);function jb(){return fixEncoderSize(getBytesEncoder(),1).encode(ea)}function ta(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ea}))}function ra(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Y())],["settingsMutArgs",G()],["compressedProofArgs",D()]])}function Jb(){return combineCodec(ta(),ra())}function na(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:ta().encode(c),programAddress:r})}function qb(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:ra().decode(e.data)}}var aa=new Uint8Array([30]);function tv(){return fixEncoderSize(getBytesEncoder(),1).encode(aa)}function Rn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["sourceCompressedTokenAccount",getOptionEncoder(_t())],["compressedProofArgs",getOptionEncoder(C())],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:aa}))}function ia(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["sourceCompressedTokenAccount",getOptionDecoder(Ut())],["compressedProofArgs",getOptionDecoder(D())],["secp256r1VerifyArgs",getArrayDecoder(Y())]])}function rv(){return combineCodec(Rn(),ia())}async function nv(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(_(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(_(t.source.value)),getAddressEncoder().encode(_(t.tokenProgram.value)),getAddressEncoder().encode(_(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(_(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(_(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(_(t.destination.value)),getAddressEncoder().encode(_(t.tokenProgram.value)),getAddressEncoder().encode(_(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(_(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(_(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.splInterfacePda.value||(t.splInterfacePda.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getBytesEncoder().encode(new Uint8Array([112,111,111,108])),getAddressEncoder().encode(_(t.mint.value))]})),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Rn().encode(c),programAddress:r})}function da(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Rn().encode(c),programAddress:r})}function sv(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:ia().decode(e.data)}}var Aa=new Uint8Array([28]);function Av(){return fixEncoderSize(getBytesEncoder(),1).encode(Aa)}function bn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["sourceCompressedTokenAccount",getOptionEncoder(_t())],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Aa}))}function ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["sourceCompressedTokenAccount",getOptionDecoder(Ut())],["secp256r1VerifyArgs",getArrayDecoder(Y())],["settingsMutArgs",G()],["compressedProofArgs",D()]])}function gv(){return combineCodec(bn(),ga())}async function pv(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(_(t.source.value)),getAddressEncoder().encode(_(t.tokenProgram.value)),getAddressEncoder().encode(_(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(_(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(_(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(_(t.destination.value)),getAddressEncoder().encode(_(t.tokenProgram.value)),getAddressEncoder().encode(_(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(_(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(_(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.splInterfacePda.value||(t.splInterfacePda.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getBytesEncoder().encode(new Uint8Array([112,111,111,108])),getAddressEncoder().encode(_(t.mint.value))]})),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:bn().encode(c),programAddress:r})}function pa(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:bn().encode(c),programAddress:r})}function mv(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:ga().decode(e.data)}}var Ta=new Uint8Array([13]);function Iv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ta)}function la(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:Ta}))}function fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(V())]])}function Cv(){return combineCodec(la(),fa())}function Sa(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:la().encode(c),programAddress:r})}function Dv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:fa().decode(e.data)}}var Ca=new Uint8Array([23]);function vv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ca)}function Da(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ca}))}function Ma(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(V())],["settingsMutArgs",G()],["compressedProofArgs",D()]])}function _v(){return combineCodec(Da(),Ma())}function Pa(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Da().encode(c),programAddress:r})}function Uv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ma().decode(e.data)}}var Ra=new Uint8Array([10]);function Nv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ra)}function ba(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Wt()],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:Ra}))}function va(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",kt()],["secp256r1VerifyArgs",getOptionDecoder(V())]])}function Vv(){return combineCodec(ba(),va())}function _a(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:ba().encode(c),programAddress:r})}function Hv(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:va().decode(e.data)}}var ka=new Uint8Array([20]);function qv(){return fixEncoderSize(getBytesEncoder(),1).encode(ka)}function La(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Wt()],["secp256r1VerifyArgs",getOptionEncoder(N())],["settingsReadonlyArgs",bt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ka}))}function Oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",kt()],["secp256r1VerifyArgs",getOptionDecoder(V())],["settingsReadonlyArgs",vt()],["compressedProofArgs",D()]])}function Zv(){return combineCodec(La(),Oa())}function Ba(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:La().encode(c),programAddress:r})}function Yv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Oa().decode(e.data)}}var Va=new Uint8Array([14]);function n_(){return fixEncoderSize(getBytesEncoder(),1).encode(Va)}function Ha(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:Va}))}function Fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(V())]])}function s_(){return combineCodec(Ha(),Fa())}function Ga(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ha().encode(c),programAddress:r})}function o_(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Fa().decode(e.data)}}var ja=new Uint8Array([24]);function g_(){return fixEncoderSize(getBytesEncoder(),1).encode(ja)}function Ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ja}))}function qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(V())],["settingsMutArgs",G()],["compressedProofArgs",D()]])}function p_(){return combineCodec(Ja(),qa())}function Za(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ja().encode(c),programAddress:r})}function m_(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:qa().decode(e.data)}}var Qa=new Uint8Array([12]);function x_(){return fixEncoderSize(getBytesEncoder(),1).encode(Qa)}function $a(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Qa}))}function ei(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function I_(){return combineCodec($a(),ei())}function ti(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:$a().encode(c),programAddress:r})}function C_(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:ei().decode(e.data)}}var si=new Uint8Array([22]);function R_(){return fixEncoderSize(getBytesEncoder(),1).encode(si)}function oi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:si}))}function ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function b_(){return combineCodec(oi(),ci())}function ai(e,n){let r=n?.programAddress??d,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:oi().encode(c),programAddress:r})}function v_(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:ci().decode(e.data)}}var ui=new Uint8Array([11]);function B_(){return fixEncoderSize(getBytesEncoder(),1).encode(ui)}function Ai(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:ui}))}function gi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(V())]])}function w_(){return combineCodec(Ai(),gi())}function pi(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ai().encode(c),programAddress:r})}function N_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:gi().decode(e.data)}}var Ti=new Uint8Array([21]);function j_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ti)}function li(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())],["settingsReadonlyArgs",bt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ti}))}function fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(V())],["settingsReadonlyArgs",vt()],["compressedProofArgs",D()]])}function J_(){return combineCodec(li(),fi())}function Si(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:li().encode(c),programAddress:r})}function q_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:fi().decode(e.data)}}var Ci=new Uint8Array([15]);function eU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ci)}function Di(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Ci}))}function Mi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function tU(){return combineCodec(Di(),Mi())}function Pi(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=m({}),i=y(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:Di().encode({}),programAddress:r})}function rU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:Mi().decode(e.data)}}var Ri=new Uint8Array([25]);function iU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ri)}function bi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Ri}))}function vi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function dU(){return combineCodec(bi(),vi())}function _i(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:bi().encode(c),programAddress:r})}function uU(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:vi().decode(e.data)}}var ki=new Uint8Array([16]);function lU(){return fixEncoderSize(getBytesEncoder(),1).encode(ki)}function Li(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Lt()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:ki}))}function Oi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Ot()],["secp256r1VerifyArgs",getArrayDecoder(Y())]])}function fU(){return combineCodec(Li(),Oi())}function Bi(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Li().encode(c),programAddress:r})}function SU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Oi().decode(e.data)}}var Vi=new Uint8Array([26]);function EU(){return fixEncoderSize(getBytesEncoder(),1).encode(Vi)}function Hi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Lt()],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Vi}))}function Fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Ot()],["secp256r1VerifyArgs",getArrayDecoder(Y())],["settingsMutArgs",G()],["compressedProofArgs",D()]])}function hU(){return combineCodec(Hi(),Fi())}function Gi(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Hi().encode(c),programAddress:r})}function RU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Fi().decode(e.data)}}var d="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",tx=(c=>(c[c.DomainConfig=0]="DomainConfig",c[c.GlobalCounter=1]="GlobalCounter",c[c.Settings=2]="Settings",c[c.TransactionBuffer=3]="TransactionBuffer",c[c.WhitelistedAddressTree=4]="WhitelistedAddressTree",c))(tx||{});function gW(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([201,232,212,229,59,241,106,197])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([42,206,176,58,175,129,130,233])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([223,179,163,190,177,224,67,173])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([90,36,35,219,93,225,110,96])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([105,23,173,2,197,255,80,87])),0))return 4;throw new Error("The provided account could not be identified as a multiWallet account.")}var rx=(T=>(T[T.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",T[T.ChangeConfig=1]="ChangeConfig",T[T.ChangeConfigCompressed=2]="ChangeConfigCompressed",T[T.CreateCompressedWallet=3]="CreateCompressedWallet",T[T.CreateDomainConfig=4]="CreateDomainConfig",T[T.CreateDomainUserAccount=5]="CreateDomainUserAccount",T[T.CreateGlobalCounter=6]="CreateGlobalCounter",T[T.CreateUserAccounts=7]="CreateUserAccounts",T[T.DecompressSettingsAccount=8]="DecompressSettingsAccount",T[T.DisableDomainConfig=9]="DisableDomainConfig",T[T.EditDomainConfig=10]="EditDomainConfig",T[T.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",T[T.EditUserDelegate=12]="EditUserDelegate",T[T.MigrateCompressedSettings=13]="MigrateCompressedSettings",T[T.MigrateCompressedUsers=14]="MigrateCompressedUsers",T[T.NativeTransferIntent=15]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=17]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=19]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=21]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=23]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=25]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=27]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",T[T.TransactionExecute=29]="TransactionExecute",T[T.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=31]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",T))(rx||{});function pW(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 4;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 5;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 6;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 7;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 8;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 9;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 10;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 11;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 12;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([32])),0))return 13;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([31])),0))return 14;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 15;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 16;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 17;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 18;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 19;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 20;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 21;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 22;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 23;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 24;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 25;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 26;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 27;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 28;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 29;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 30;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 31;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 32;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var sx=6e3,ox=6001,cx=6002,ax=6003,ix=6004,dx=6005,ux=6006,Ax=6007,gx=6008,px=6009,mx=6010,yx=6011,Tx=6012,lx=6013,fx=6014,Sx=6015,xx=6016,Ix=6017,Cx=6018,Dx=6019,Mx=6020,Px=6021,Ex=6022,hx=6023,Rx=6024,bx=6025,vx=6026,_x=6027,Ux=6028,Wx=6029,kx=6030,Lx=6031,Ox=6032,Bx=6033,wx=6034,Nx=6035,Vx=6036,Hx=6037,Fx=6038,Gx=6039,zx=6040,Kx=6041,jx=6042,Jx=6043,qx=6044,Zx=6045,Yx=6046,Xx=6047,Qx=6048,$x=6049,eI=6050,tI=6051,rI=6052,nI=6053,sI=6054,zi;process.env.NODE_ENV!=="production"&&(zi={[kx]:"This member is already delegated to another wallet.",[Ax]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[eI]:"The domain configuration account is disabled. Please contact support or try again later.",[tI]:"Missing domain configuration account.",[mx]:"Duplicate public keys detected among members. Each member must have a unique key.",[px]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[Mx]:"No members provided. A multisig wallet must contain at least one member.",[Cx]:"Expected a User with Administrator role for this instruction.",[gx]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[xx]:"Expected a User with Transaction Manager role for this instruction.",[Gx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[zx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Kx]:"Declared buffer size does not match the actual serialized size.",[Bx]:"Not enough members with vote permission to meet the approval threshold.",[Lx]:"At least one signer with execute permission is required to proceed.",[Ox]:"At least one signer with initiate permission is required to perform this action.",[bx]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[sI]:"Address Tree supplied is not part of the whitelisted address trees",[Dx]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[_x]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Fx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[wx]:"Only delegated members are allowed for this transaction.",[Rx]:"Unexpected number of accounts provided for this instruction.",[lx]:"User with Permanent Member role requires a must have a delegated wallet.",[ox]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[ix]:"The extracted public key has an invalid length or encoding.",[sx]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[ax]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[$x]:"The specified slot number is not recent.",[Xx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[Ex]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[Ix]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[Sx]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[hx]:"Malformed transaction message: structure or formatting does not match the expected layout.",[vx]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[dx]:"The extracted WebAuthn signed message payload is malformed.",[Zx]:"An input string exceeds the maximum allowed character length.",[rI]:"This member is not registered under the provided domain configuration.",[Ux]:"A required account is missing from the instruction context.",[Wx]:"User mutation arguments are required when performing add or remove delegate operations.",[Yx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[Vx]:"No valid signer found in this transaction.",[Tx]:"Only one permanent member is allowed per wallet.",[fx]:"Only one transaction manager is allowed per wallet.",[nI]:"The given origin index is not in the whitelisted origins.",[yx]:"Permanent members cannot be removed from a wallet.",[qx]:"Writable CPI calls to protected accounts are not permitted.",[ux]:"The rpIdHash extracted from the signed message does not match the expected value.",[cx]:"The signature index provided is out of bounds for the secp256r1 instruction.",[Qx]:"The specified slot number was not found in the provided slot history.",[Px]:"Too many members: a maximum of 4 members are supported.",[jx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[Jx]:"This transaction has not yet reached the required approval threshold.",[Hx]:"Only the transaction creator or rent payer may close this transaction buffer.",[Nx]:"Member is not part of the expected signers for this transaction."});function SW(e){return process.env.NODE_ENV!=="production"?zi[e]:"Error message not available in production bundles."}function xW(e,n,r){return isProgramError(e,n,d,r)}async function _W({admin:e,addressTree:n}){return To({payer:e,addressTree:n,remainingAccounts:[]})}var Ht={Ed25519:1,Secp256r1:2};var Me={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Re=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(Me).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var Un=33,be=class{_bn;constructor(n){typeof n=="string"?this._bn=new Uint8Array(getBase58Encoder().encode(n)):this._bn=new Uint8Array(n),this.validateKeyLength(this._bn);}validateKeyLength(n){if(n.length!==Un)throw new Error(`Invalid public key length, expected ${Un} bytes but got ${n.length}`)}toBase58(){return getBase58Decoder().decode(this.toBytes())}toTruncatedBuffer(){let n=this.toBuffer();return n.subarray(1,n.length)}toBuffer(){if(!this._bn)throw new Error("Invalid public key input");let n=this._bn;if(n.byteLength===Un)return n;throw new Error("Invalid public key input")}toBytes(){let n=this.toBuffer();return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}toString(){return this.toBase58()}toJSON(){return this.toBase58()}},M=class extends be{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(n,r){super(n),this.verifyArgs=r.verifyArgs,this.domainConfig=r.domainConfig,this.authData=r.authData,this.signature=r.signature,this.originIndex=r.originIndex,this.crossOrigin=r.crossOrigin,this.clientAndDeviceHash=r.clientAndDeviceHash,this.authResponse=r.authResponse;}};function aI(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function iI(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var ji=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(aI())],["addressTableLookups",getArrayCodec(iI())]]);function Ji(e){return ji.encode({numSigners:e.header.numSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,accountKeys:e.staticAccounts,instructions:e.instructions.map(r=>({programAddressIndex:r.programAddressIndex,accountIndices:r.accountIndices??[],data:Array.from(r.data??[])})),addressTableLookups:e.version!=="legacy"?e.addressTableLookups?.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes,writableIndexes:r.writableIndexes}))??[]:[]})}function qi(e){let n=ji.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:d,staticAccounts:n.accountKeys,version:0}}featureFlags.version=VERSION.V2;var z={};function Zi(){if(!z.solanaRpcEndpoint)throw new Error("Rpc is not initialized yet.");return z.solanaRpcEndpoint}function $e(){if(!z.lightProtocolRpc)throw new Error("Rpc is not initialized yet");return z.lightProtocolRpc}function re(){if(!z.solanaRpc)throw new Error("Rpc is not initialized yet");return z.solanaRpc}function Yi(){if(!z.sendAndConfirm)throw new Error("Rpc is not initialized yet.");return z.sendAndConfirm}function Xi(){if(!z.computeEstimate)throw new Error("Rpc is not initialized yet");return z.computeEstimate}function kn(){return z.jitoTipsConfig?z.jitoTipsConfig:{blockEngineUrl:"https://mainnet.block-engine.jito.wtf/api/v1",getJitoTipsUrl:"https://bundles.jito.wtf/api/v1/bundles/tip_floor",priority:"landed_tips_75th_percentile"}}function tk(){Object.keys(z).forEach(e=>{z[e]=void 0;});}function rk({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){z.solanaRpcEndpoint=e,z.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});z.solanaRpc=t,z.sendAndConfirm=c,z.computeEstimate=estimateComputeUnitLimitFactory({rpc:t}),z.jitoTipsConfig=s??null;}var k=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:r?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(d.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await $e().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:a,queuePubkeyIndex:i,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,u=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=u);}for(let c of r){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:a,addressQueuePubkeyIndex:i});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function gr(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await $e().getCompressedAccount(e);return s&&n?.set(e.toString(),s),s}}async function ed(e,n,r){let s=e.toString()+(n?.mint?n?.mint.toString():""),t=r?.get(s);if(t)return t;{let c=await $e().getCompressedTokenAccountsByOwner(e,n);return c&&r?.set(s,c),c}}async function Gt(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await re().getAccountInfo(e,{encoding:"base64"}).send();return s&&n?.set(e.toString(),s),s}}async function de(e,n){let s=(await Promise.all(e.map(async t=>gr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new Error("Unable to find compressed account.");return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function v(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function ae(e,n,r,s,t){if(t.length===0)return [];let c=t.map((u,A)=>({treeInfo:n[A],root:r[A],rootIndex:s[A],address:u.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((u,A)=>({addressTreeInfo:a[A],outputStateTreeIndex:i,address:u.address,type:u.type}))}function se(e,n,r,s,t,c,a){let i=[];for(let A=0;A<n.length;A++)i.push({treeInfo:n[A],rootIndex:s[A],leafIndex:r[A],proveByIndex:t[A],hash:c[A].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((A,g)=>({data:a.decode(A.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(A.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Se(e,n,r,s,t){let c=null,a=null,i=null,o=new k;if(e){await o.addSystemAccounts();let{address:u}=await ne(n,r),A=(await de([{address:u,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[A.leafIndex],leaves:[],treeInfos:[A.treeInfo],proveByIndices:[A.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:i=await O([A],[]);let g=o.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:A.hash}],[]).stateTrees;if(!g)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(A.address),treeInfo:g.packedTreeInfos[0]},data:q().decode(A.data?.data)},a={accountMeta:{address:new Uint8Array(A.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:q().decode(A.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:o,settingsMutArgs:a}}async function O(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await $e().getValidityProofV0(e,n)}catch(c){if(console.error(`Attempt ${t}, Get Validity Proof failed. ${c}`),t++,t>=r)throw new Error(`Failed to get validity proof after ${r} attempts: ${c}`);await new Promise(a=>setTimeout(a,s));}throw new Error(`Failed to get validity proof after ${r} attempts`)}async function xe(){return (await pr()).length-1}var Ln;async function pr(){if(!Ln){let{data:e}=await uo(re(),await td());Ln=e.whitelistedAddressTrees;}return Ln}async function mr(e,n,r){let s=await fI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function fI(e,n,r){let{address:s}=await L(e,n),t=await gr(s,r);return t?.data?.data?X().decode(t.data.data):null}async function On(e,n,r){let s=await SI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function SI(e,n,r){try{let{address:s}=await ne(e,n),t=await gr(s,r);if(!t?.data?.data)throw new Error("No compressed settings account found.");let c=q().decode(t.data.data);if(c.data.__option==="None")throw new Error("No compressed settings account found.");return {...c.data.value,isCompressed:!0}}catch{let s=await on(re(),await oe(e));return s.exists?{...s.data,isCompressed:false}:null}}async function Bn(e){let n=await pr();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function Pk(e){let r=(await pr()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function ne(e,n=0){let r=await Bn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("multi_wallet")),new Uint8Array(getU128Encoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(d)).toString(),"base58"),addressTree:new PublicKey(r)}}async function L(e,n=0){let r=await Bn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),e instanceof be?e.toTruncatedBuffer():new Uint8Array(getAddressEncoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(d.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function tt({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(new Uint8Array(getUtf8Encoder().encode(n)));else throw new Error("RpId not found.");if(!e)throw new Error("RpIdHash not found.");let[r]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function cd(){let[e]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function td(){let[e]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function ad(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof be?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function Pe(e){let[n]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function oe(e){let[n]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function kk(e){let n=await oe(e);return await Pe(n)}async function Lk(){let[e]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}function Tr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function DI(e){let n=new Uint8Array(e.length/2);for(let r=0;r<n.length;r++)n[r]=parseInt(e.slice(r*2,r*2+2),16);return n}function dd(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let s=JSON.stringify(r);return new TextEncoder().encode(s.slice(1,-1))}function ud(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let a=e[s]|e[s+1]<<8;if(s+=2,s+a>e.length)throw new Error("MaxLengthExceeded");let i=e.slice(s,s+a),o=t.decode(i);r.push(o),s+=a;}return r}function Ad(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let I=n&127;r+=I;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let a=e[r+1],i=r+2,o=e.slice(i,i+a),u=c[0]===0&&c.length>32?c.slice(1):c,A=o[0]===0&&o.length>32?o.slice(1):o;if(u.length>32||A.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(u,32-u.length);let p=p256.Point.CURVE().n>>1n,l=BigInt("0x"+Tr(A)),b=(l>p?p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),S=DI(b);return new Uint8Array([...g,...S])}function lr(e){return new Uint8Array([...new Uint8Array(_e(e.response.authenticatorData)),...sha256(new Uint8Array(_e(e.response.clientDataJSON)))])}function Qk(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Tr(n.get(-2))),y:BigInt("0x"+Tr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function $k(e){let r=p256.Point.fromBytes(new Uint8Array(getBase58Encoder().encode(e))).toBytes(false),s=new Map;return s.set(1,2),s.set(3,-7),s.set(-1,1),s.set(-2,r.slice(1,33)),s.set(-3,r.slice(33,65)),new Uint8Array(encodeCBOR(s))}async function eL(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(_e(n)),c=JSON.parse(new TextDecoder().decode(_e(r))),a=dd(c),i=Ad(new Uint8Array(_e(s))),o=await tt({rpIdHash:t.subarray(0,32)});return new M(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(_e(r)),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:wn(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}async function tL(e,n){let{data:r}=await os(re(),e),t=ud(new Uint8Array(r.origins),r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Error("Origin not found in domain config");return t}function wn(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function rL(e){return sha256(new Uint8Array(getUtf8Encoder().encode(JSON.stringify(e))))}function nL(e){return Nn(e.data.payload.authResponse)}function sL(e,n,r,s){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...wn(n,r,s)]))}async function oL(e,n,r,s,t,c){let a;if(!t||!c){let o=(await re().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!o)throw new Error("Unable to fetch slot sysvar");let u=getBase64Encoder().encode(o[0]);c=getU64Decoder().decode(u.subarray(0,8)).toString(),a=u.subarray(8,40),t=getBase58Decoder().decode(a);}else a=new Uint8Array(getBase58Encoder().encode(t));let i=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...sha256(typeof e.transactionMessageBytes=="string"?new Uint8Array(_e(e.transactionMessageBytes)):e.transactionMessageBytes),...a,...wn(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:i}}function Nn(e){return sha256(lr(e))}function cL(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function _e(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),a=new Uint8Array(c);for(let i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return c}async function Vn(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await re().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(s.instructions,c),c=>setTransactionMessageFeePayerSigner(s.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let a=Math.ceil((s.unitsConsumed??0)*1.1)||8e5;return a>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:a})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function Td(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===AccountRole.WRITABLE||c.role===AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,a)=>c-a);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function ld(e,n){if(e.length===0)throw new Error("Bundle is empty.");for(let c=0;c<e.length;c++){if(e[c].length>1644)throw new Error(`Transaction ${c} exceeds maximum length, ${e[c].length}. Retry again.`);console.log(`Transaction ${c} length: ${e[c].length}`);}let r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})});if(!r.ok)throw console.error(await r.json()),new Error("Failed to simulate bundle");let{result:s,error:t}=await r.json();if(!s||t)throw console.error(t??s),new Error(`Unable to simulate bundle: ${JSON.stringify(t??s)}`);if(typeof s.value.summary!="string"&&s.value.summary.failed){let{TransactionFailure:c}=s.value.summary.failed.error,[,a]=c;throw console.error(t??s),new Error(`Simulation failed: ${a}`)}return s.value.transactionResults.map(c=>c.unitsConsumed)}function K(e,n=0){let r=e instanceof M?e:void 0,s=r?.verifyArgs&&n!==-1?some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):null,t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,a=r?.authData&&r.verifyArgs?.clientDataJson?lr(r.authResponse):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function nt(e){if(e instanceof be)return {keyType:Ht.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Ht.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function yd(e){return e instanceof M?e.toString():e.address.toString()}function me(e){let n=new Set,r=[];for(let s of e)n.has(yd(s))||(r.push(s),n.add(yd(s)));if(r.filter(s=>s instanceof M).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function fd({payer:e,tipAmount:n}){let r=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],s=r[Math.floor(Math.random()*r.length)];return getTransferSolInstruction({source:e,destination:address(s),amount:n})}async function DL(e){let n=await Vn(e,true),r=await ld(n.map(getBase64EncodedWireTransaction),Zi()),s=await Vn(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await cC(s.map(getBase64EncodedWireTransaction))}async function ML({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await re().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(e,c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([Xi()(c),Td(re(),c.instructions.flatMap(u=>u.accounts??[]))]),o=Math.ceil(a*1.1);return prependTransactionMessageInstructions([...o>2e5?[getSetComputeUnitLimitInstruction({units:o})]:[],...i>0?[getSetComputeUnitPriceInstruction({microLamports:i})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await Yi()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}async function cC(e,n=10,r=1e3,s=kn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/bundles`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})});if(a.status===429&&c<n){await new Promise(o=>setTimeout(o,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);return i.result}throw new Error("Failed to send bundle after retries.")}async function PL(e,n=30,r=3e3,s=kn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/getBundleStatuses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});if(a.status===429&&c<n){await new Promise(u=>setTimeout(u,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);let o=i.result;if(o.value.length){let u=o.value[0];if(u.confirmation_status==="confirmed"||u.confirmation_status==="finalized")return u.transactions[u.transactions.length-1]}if(c<n){await new Promise(u=>setTimeout(u,r));continue}}throw new Error("Failed to get bundle status after retries.")}function EL(e,n){if(n.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:r}=n.members.find(i=>xd(i.pubkey)===e)??{};if(!r)throw new Error("No permissions found for the current member.");let s=Re.has(r,Me.InitiateTransaction),t=Re.has(r,Me.VoteTransaction),c=Re.has(r,Me.ExecuteTransaction);if(s&&t&&c)return {};if(!t||!c)throw new Error("Signer lacks the required Vote/Execute permissions.");let a=n.members.find(i=>i.role===2);if(!a)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:address(xd(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function hL({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await mr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return aC(n,c.transactionManagerUrl.value,e,s)}function aC(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=getBase64Decoder().decode(s)),r&&(c.authResponses=r);let i=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json();if("error"in i)throw new Error(i.error);return i.signatures.map(o=>({[e]:getBase58Encoder().encode(o)}))}}}function xd(e){return e.keyType===Ht.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function RL(e){let n=e.map(c=>Be().encode(c)),r=4+n.reduce((c,a)=>c+a.length,0),s=new Uint8Array(r),t=0;s.set(getU32Encoder().encode(e.length),t),t+=4;for(let c of n)s.set(c,t),t+=c.length;return s}function bL(e){let n=0,[r,s]=getU32Decoder().read(e,n);n=s;let t=new Array(r);for(let c=0;c<r;c++){let a=we().read(e,n);t[c]=a[0],n=a[1];}if(n!==e.length)throw new Error(`Trailing bytes: ${e.length-n}`);return t}async function zL({payer:e,rpId:n,origins:r,authority:s}){let t=await tt({rpId:n}),c=new k;await c.addSystemAccounts();let a=await xe(),{address:i,addressTree:o}=await L(s.address,a),u=[{address:i,tree:o,queue:o,type:"User"}],A=await O([],u),g=(await ae(c,A.treeInfos,A.roots,A.rootIndices,u))[0],{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),f=v(A,l);return await Jo({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:f,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function eO({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new k;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await ne(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await L(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await de(a,t):[],o=await xe(),{address:u,addressTree:A}=await L(r.member,o),g=[{address:u,type:"User",tree:A,queue:A}],p=await O(i,g),l=null,f=null,b=i.filter(W=>W.type==="Settings"),S=i.filter(W=>W.type==="User");b.length&&(l=se(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),b,q())[0]),S.length&&(f=se(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),S,X())[0]);let I=await ae(c,p.treeInfos.slice(i.length),p.roots.slice(i.length),p.rootIndices.slice(i.length),g),{remainingAccounts:P,systemOffset:x}=c.toAccountMetas(),U=v(p,x);return await Xo({payer:n,authority:e,compressedProofArgs:U,member:Mt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:l?some({settingsMutArgs:l,transactionManager:f?some(f):none()}):none(),userAccountCreationArgs:I[0],domainConfig:s,remainingAccounts:P})}async function sO({payer:e}){let n=await cd();return tc({payer:e,globalCounter:n})}async function iO({admin:e,rpId:n,disable:r}){let s=await tt({rpId:n});return lc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function yO({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new k;await t.addSystemAccounts();let{address:c,addressTree:a}=await ne(r,s),i=[{address:c,tree:a,queue:a,type:"Settings"}],o=await O([],i),u=(await ae(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:A,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Hc({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:u,remainingAccounts:A})}async function CO({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new k;await t.addSystemAccounts();let{address:c,addressTree:a}=await L(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await O([],i),u=(await ae(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:A,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Jc({compressedProofArgs:p,args:e,authority:n,userCreationArgs:u,remainingAccounts:A})}function dC(e,n,r,s){let t=uC(e,n),c=AC(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function uC(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,a=s-t,i=r-s-c;return n>=r?false:n<a?true:n>=s?n-s<i:false}function AC(e,n){return n<e.header.numSignerAccounts}async function Sr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=qi(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(i=>i.lookupTableAddress),re()):{}),a=[];a.push(...t.addressTableLookups?.map(i=>({role:AccountRole.READONLY,address:i.lookupTableAddress}))??[]);for(let[i,o]of t.staticAccounts.entries())a.push({address:o,role:dC(t,i,o,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let o=c[i.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let u of i.writableIndexes){let A=o[u];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:A,role:AccountRole.WRITABLE});}for(let u of i.readonlyIndexes){let A=o[u];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:A,role:AccountRole.READONLY});}}for(let i of s?.filter(o=>o.address!==e)??[]){let o=a.findIndex(u=>u.address===i.address);o===-1?a.push({address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}):a[o].role===AccountRole.READONLY||a[o].role===AccountRole.READONLY_SIGNER?a[o]={address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}:(a[o].role===AccountRole.WRITABLE||a[o].role===AccountRole.WRITABLE_SIGNER)&&(a[o]={address:i.address,role:AccountRole.WRITABLE_SIGNER,signer:i});}return {accountMetas:a,addressLookupTableAccounts:c,transactionMessage:t}}var st=33,ot=64,Kn=14,fC=2,SC=address("Secp256r1SigVerify1111111111111111111111111");function xC(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function IC(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function Ed(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let s=getU8Decoder().decode(e,n);n+=1;let t=[],c=IC();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=Kn;let a=[];for(let i=0;i<r;i++){let o=fixDecoderSize(getBytesDecoder(),st).decode(e,n);n+=st;let u=fixDecoderSize(getBytesDecoder(),ot).decode(e,n);n+=ot;let A=t[i].messageDataSize,g=fixDecoderSize(getBytesDecoder(),A).decode(e,n);n+=A,a.push({publicKey:o,signature:u,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function hd(){return createEncoder({getSizeFromValue:e=>{let n=Kn*e.offsets.length,r=e.payload.reduce((s,t)=>s+st+ot+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=getU8Encoder().write(e.numSignatures,n,r),r=getU8Encoder().write(e.padding,n,r);let s=xC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),st).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),ot).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function BO(){return combineCodec(hd(),Ed())}function B(e,n){let r=e.length,s=fC+r*Kn,t=[];for(let o=0;o<r;o++){let{message:u}=e[o],A=s,g=A+st,p=g+ot;t.push({publicKeyOffset:A,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:u.length,messageInstructionIndex:65535}),s+=st+ot+u.length;}let c=n?.programAddress??SC,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:hd().encode(a)}}function wO(e){return {programAddress:e.programAddress,accounts:{},data:Ed().decode(e.data)}}async function Rd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let u=await Pe(e),{accountMetas:A,addressLookupTableAccounts:g}=await Sr({transactionMessageBytes:r,walletAddress:u,additionalSigners:a,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(B(c)),p.push(o?_i({transactionBuffer:n,payer:s.address,remainingAccounts:A,settingsKey:e}):Pi({transactionBuffer:n,payer:s.address,settings:e})),i&&p.push(fd({payer:s,tipAmount:i})),{instructions:p,addressLookupTableAccounts:g}}async function bd({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:u}){let A=me(s),g=await oe(e),p=await Pe(g),[{accountMetas:l,addressLookupTableAccounts:f,transactionMessage:b},{settingsMutArgs:S,proof:I,packedAccounts:P}]=await Promise.all([Sr({transactionMessageBytes:r,walletAddress:p,additionalSigners:A.filter($=>!($ instanceof M)),addressesByLookupTableAddress:c}),Se(i,e,n,o,u)]);P.addPreAccounts(l);let x=A.filter($=>$ instanceof M),U=[];for(let $ of x){let ue=a.length,{domainConfig:ye,verifyArgs:Ee,signature:Ue,publicKey:he,message:J}=K($,ue);J&&Ue&&he&&a.push({message:J,signature:Ue,publicKey:he}),ye&&(P.addPreAccounts([{address:ye,role:AccountRole.READONLY}]),Ee?.__option==="Some"&&U.push({domainConfigKey:ye,verifyArgs:Ee.value}));}let{remainingAccounts:W,systemOffset:j}=P.toAccountMetas(),w=[];a.length>0&&w.push(B(a));let Q=DC(b,l);if(i){if(!t||!S)throw new Error("Payer not found or proof args is missing.");let $=v(I,j);w.push(Gi({secp256r1VerifyArgs:U,transactionMessage:Q,settingsMutArgs:S,compressedProofArgs:$,payer:t,remainingAccounts:W}));}else w.push(Bi({secp256r1VerifyArgs:U,settings:g,transactionMessage:Q,remainingAccounts:W}));return {instructions:w,addressLookupTableAccounts:f}}function DC(e,n){if(e.version==="legacy")throw new Error("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:new Uint8Array(r.data??[])})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(s=>s.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function iB({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=me(s),u=await oe(e),A=await Pe(u),{packedAccounts:g,proof:p,settingsMutArgs:l}=await Se(i,e,n,false,t),f=[],b=[];for(let x of o)if(x instanceof M){let U=f.length,{domainConfig:W,verifyArgs:j,signature:w,publicKey:Q,message:$}=K(x,U);$&&w&&Q&&f.push({message:$,signature:w,publicKey:Q}),W&&(g.addPreAccounts([{address:W,role:AccountRole.READONLY}]),j?.__option==="Some"&&b.push({domainConfigKey:W,verifyArgs:j.value}));}else g.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:S,systemOffset:I}=g.toAccountMetas(),P=[];if(f.length>0&&P.push(B(f)),i){if(!a||!l)throw new Error("Payer not found or proof args is missing.");let x=v(p,I);P.push(na({amount:c,settingsMutArgs:l,compressedProofArgs:x,payer:a,secp256r1VerifyArgs:b,source:A,destination:r,remainingAccounts:S}));}else P.push(Xc({amount:c,secp256r1VerifyArgs:b,source:A,destination:r,settings:u,remainingAccounts:S}));return P}var kd=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),Ld=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti");async function IB({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,compressed:u=false}){let A=me(t),g=await oe(e),p=await Pe(g),[l,[f],b,[S],[I]]=await Promise.all([getAssociatedTokenAccountAddress(s,p,o),getProgramDerivedAddress({seeds:[getAddressEncoder().encode(p),getAddressEncoder().encode(address(CTOKEN_PROGRAM_ID.toString())),getAddressEncoder().encode(s)],programAddress:address(CTOKEN_PROGRAM_ID.toString())}),getAssociatedTokenAccountAddress(s,r,o),getProgramDerivedAddress({seeds:[getAddressEncoder().encode(r),getAddressEncoder().encode(address(CTOKEN_PROGRAM_ID.toString())),getAddressEncoder().encode(s)],programAddress:address(CTOKEN_PROGRAM_ID.toString())}),getProgramDerivedAddress({seeds:[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(s)],programAddress:address(CTOKEN_PROGRAM_ID.toString())})]),[P,x,U]=await Promise.all([Gt(b,c),Gt(l,c),_C(u,e,n,c)]),W=!!P.value,j=!!x.value,w=j?getTokenDecoder().decode(getBase64Encoder().encode(x.value.data[0])).amount:BigInt(0),Q=BigInt(0),$=true;if(w<BigInt(a)){let Ae=await Gt(f,c);$=!!Ae.value,Q=BigInt($?WC(new Uint8Array(getBase64Encoder().encode(Ae.value.data[0])))?.amount??0:0);}let ue=W?b:void 0,ye=W?void 0:S,Ee=j&&(w+Q<BigInt(a)||Q>BigInt(0)||!W)||!j&&W,Ue=!!ye,[{parsed:he,compressedAccount:J},Dr]=await Promise.all([vC(p,s,w,Q,BigInt(a),c),bC(Ee,I,c)]),T=null,ce=null,Ie=new k;if(Dr&&Ie.addPreAccounts([{address:s,role:AccountRole.WRITABLE}]),U||J){await Ie.addSystemAccounts();let Ae=[];if(J&&Ae.push({hash:J.hash,tree:J.treeInfo.tree,queue:J.treeInfo.queue,data:J.data,address:J.address}),U&&Ae.push(U),ce=await O(Ae,[]),U){let ke=J?1:0;T=se(Ie,ce.treeInfos.slice(ke),ce.leafIndices.slice(ke),ce.rootIndices.slice(ke),ce.proveByIndices.slice(ke),Ae.slice(ke),q())[0];}}let H=J&&he&&ce?some({amount:he.amount.toNumber(),merkleContext:{leafIndex:J.leafIndex,merkleTreePubkeyIndex:Ie.insertOrGet(J.treeInfo.tree.toString()),queuePubkeyIndex:Ie.insertOrGet(J.treeInfo.queue.toString()),proveByIndex:J.proveByIndex},rootIndex:ce.rootIndices[0],version:UC(J.data?.discriminator)}):none(),We=[],Mr=[];for(let Ae of A)if(Ae instanceof M){let ke=We.length,{domainConfig:Pr,verifyArgs:Qn,signature:$n,publicKey:es,message:ts}=K(Ae,ke);ts&&$n&&es&&We.push({message:ts,signature:$n,publicKey:es}),Pr&&(Ie.addPreAccounts([{address:Pr,role:AccountRole.READONLY}]),Qn?.__option==="Some"&&Mr.push({domainConfigKey:Pr,verifyArgs:Qn.value}));}else Ie.addPreAccounts([{address:Ae.address,role:AccountRole.READONLY_SIGNER,signer:Ae}]);let{remainingAccounts:Yn,systemOffset:jd}=Ie.toAccountMetas(),Kt=[];We.length>0&&Kt.push(B(We));let Xn=v(ce,jd);if(u){if(!T)throw new Error("Payer not found or proof args is missing.");Kt.push(pa({amount:a,settingsMutArgs:T,compressedProofArgs:Xn,payer:i,secp256r1VerifyArgs:Mr,source:p,destination:r,sourceCtokenTokenAccount:f,sourceSplTokenAccount:l,destinationCtokenTokenAccount:ye,destinationSplTokenAccount:ue,mint:s,tokenProgram:o,remainingAccounts:Yn,sourceCompressedTokenAccount:H,compressibleConfig:kd,splInterfacePda:Ee?I:void 0,rentSponsor:Ue?Ld:void 0}));}else Kt.push(da({amount:a,secp256r1VerifyArgs:Mr,source:p,destination:r,destinationCtokenTokenAccount:ye,destinationSplTokenAccount:ue,settings:g,mint:s,tokenProgram:o,remainingAccounts:Yn,payer:i,sourceCompressedTokenAccount:H,compressedProofArgs:Xn,sourceSplTokenAccount:l,sourceCtokenTokenAccount:f,compressibleConfig:kd,splInterfacePda:Ee?I:void 0,rentSponsor:Ue?Ld:void 0}));return Kt}async function bC(e,n,r){let s=false;if(e){let{value:t}=await Gt(n,r);s=!t;}return s}async function vC(e,n,r,s,t,c){if(r+s>=t)return {};let a=await ed(new PublicKey(e),{mint:new PublicKey(n)},c),i=a.items.length>0?a.items[0]:null;return i?i.compressedAccount.data?.data.length?i.compressedAccount.owner.equals(CTOKEN_PROGRAM_ID)?{compressedAccount:i.compressedAccount,parsed:i.parsed}:{}:{}:{}}async function _C(e,n,r,s){if(!e)return null;let{address:t}=await ne(n,r);return (await de([{address:t,type:"Settings"}],s))[0]}function UC(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let n=e[7];return n===3?2:3}function WC(e){if(!e||e.length===0)return null;try{return {amount:getU64Decoder().decode(e.slice(64,72))}}catch(n){return console.error("Token data parsing error:",n),null}}async function UB({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:a,proof:i,settingsMutArgs:o}=r,u=me(e),A=u.filter(P=>!(P instanceof M));a.addPreAccounts(A.map(P=>({address:P.address,role:AccountRole.READONLY_SIGNER,signer:P})));let g=u.filter(P=>P instanceof M),p=[],l=[];for(let P of g){let x=l.length,{domainConfig:U,verifyArgs:W,signature:j,publicKey:w,message:Q}=K(P,x);Q&&j&&w&&l.push({message:Q,signature:j,publicKey:w}),U&&(a.addPreAccounts([{address:U,role:AccountRole.READONLY}]),W?.__option==="Some"&&p.push({domainConfigKey:U,verifyArgs:W.value}));}let{remainingAccounts:f,systemOffset:b}=a.toAccountMetas(),S=v(i,b),I=[];if(l.length>0&&I.push(B(l)),c){if(!o)throw new Error("Payer not found or proof args is missing.");I.push(Uo({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:o,remainingAccounts:f,secp256r1VerifyArgs:p}));}else I.push(await Mo({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:f,secp256r1VerifyArgs:p}));return I}async function NB({createUserArgs:e,payer:n}){let r=new k;await r.addSystemAccounts(),r.addPreAccounts(e.map(A=>({address:A.member.address,role:AccountRole.READONLY_SIGNER,signer:A.member})));let s=await xe(),t=await Promise.all(e.map(async A=>{let{address:g,addressTree:p}=await L(A.member.address,s);return {address:g,tree:p,queue:p,type:"User"}})),c=await O([],t),a=await ae(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),u=v(c,o);return await oc({compressedProofArgs:u,payer:n,createUserArgs:e.map((A,g)=>({member:A.member.address,role:A.role,userCreationArgs:a[g],transactionManagerUrl:A.role===2?A.transactionManagerUrl:null})),remainingAccounts:i})}async function jB({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new k;await c.addSystemAccounts();let a=[],i=[];i.push(...await de([{address:(await L(r.address,s)).address,type:"User"}],t));let o=await xe(),{address:u,addressTree:A}=await ne(e,o);a.push({address:u,queue:A,tree:A,type:"Settings"});let g=i.length,p=await O(i,a),l=se(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),i.filter(x=>x.type==="User"),X())[0],b=(await ae(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),a)).find(x=>x.type==="Settings")??null,{remainingAccounts:S,systemOffset:I}=c.toAccountMetas(),P=v(p,I);if(!b)throw new Error("Settings creation args is missing.");return await Bo({settingsIndex:e,payer:n,initialMember:r,userReadonlyArgs:l,compressedProofArgs:P,settingsCreation:b,remainingAccounts:S})}async function tw({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:a,settingsMutArgs:i}=await Se(true,e,n,false,t);if(!i)throw new Error("Proof args is missing");let o=me(s),u=o.filter(I=>I instanceof M),A=[],g=[];for(let I of u){let P=A.length,{domainConfig:x,verifyArgs:U,signature:W,publicKey:j,message:w}=K(I,P);w&&W&&j&&A.push({message:w,signature:W,publicKey:j}),x&&(c.addPreAccounts([{address:x,role:AccountRole.READONLY}]),U?.__option==="Some"&&g.push({domainConfigKey:x,verifyArgs:U.value}));}c.addPreAccounts(o.filter(I=>"address"in I).map(I=>({address:I.address,role:AccountRole.READONLY_SIGNER,signer:I})));let{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),f=v(a,l),b=[];A.length>0&&b.push(B(A));let S=await oe(e);return b.push(Ac({settings:S,payer:r,settingsMutArgs:i,compressedProofArgs:f,secp256r1VerifyArgs:g,remainingAccounts:p})),b}async function iw({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new k;await a.addSystemAccounts();let i=await xe(),{address:o,addressTree:u}=await L(r.address,i),A=[{address:o,tree:u,queue:u,type:"User"}],g=await O([],A),p=(await ae(a,g.treeInfos,g.roots,g.rootIndices,A))[0],l=a.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:v(g,l.systemOffset),authorityCreationArgs:p};}return Dc({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function mw({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new k;await s.addSystemAccounts();let t=await de([{address:(await L(e.address,n)).address,type:"User"}]),c=await O(t,[]),a=se(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),u=v(c,o);return bc({authority:e,transactionManagerUrl:r,compressedProofArgs:u,userMutArgs:a,remainingAccounts:i})}async function Mw({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:a,message:i,signature:o,publicKey:u}=K(n),A=[];i&&o&&u&&A.push({message:i,signature:o,publicKey:u});let g=await mr(n instanceof M?n:n.address,r,t),p=[];p.push({address:(await L(n instanceof M?n:n.address,r)).address,type:"User"});let l,f=null,b,S=null;g.delegatedTo.__option==="Some"&&((await On(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ne(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),f={start:p.length-1,end:p.length}):l=await oe(g.delegatedTo.value.index)),s&&((await On(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ne(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):b=await oe(s.index));let I=new k;await I.addSystemAccounts();let P=await de(p,t),x=await O(P,[]),U=se(I,x.treeInfos.slice(0,1),x.leafIndices.slice(0,1),x.rootIndices.slice(0,1),x.proveByIndices.slice(0,1),P.slice(0,1),X())[0],W=f?some(se(I,x.treeInfos.slice(f.start,f.end),x.leafIndices.slice(f.start,f.end),x.rootIndices.slice(f.start,f.end),x.proveByIndices.slice(f.start,f.end),P.slice(f.start,f.end),q())[0]):none(),j=S?some(se(I,x.treeInfos.slice(S.start,S.end),x.leafIndices.slice(S.start,S.end),x.rootIndices.slice(S.start,S.end),x.proveByIndices.slice(S.start,S.end),P.slice(S.start,S.end),q())[0]):none(),{remainingAccounts:w,systemOffset:Q}=I.toAccountMetas(),$=v(x,Q),ue=[];return A.length>0&&ue.push(B(A)),ue.push(Lc({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof M?void 0:n,oldSettings:l,oldSettingsMutArgs:W,newSettings:b,newSettingsMutArgs:j,compressedProofArgs:$,userMutArgs:U,remainingAccounts:w})),ue}async function Vw({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await no(re(),s),o=i.data.multiWalletSettings,{packedAccounts:u,proof:A,settingsMutArgs:g}=await Se(c,e,n,false,a),{remainingAccounts:p,systemOffset:l}=u.toAccountMetas(),{domainConfig:f,verifyArgs:b,message:S,signature:I,publicKey:P}=K(r),x=[];if(S&&I&&P&&x.push(B([{message:S,signature:I,publicKey:P}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let U=v(A,l);x.push(Pa({transactionBuffer:s,domainConfig:f,closer:r instanceof M?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:b,settingsMutArgs:g,payer:t,compressedProofArgs:U,remainingAccounts:p}));}else x.push(Sa({transactionBuffer:s,domainConfig:f,closer:r instanceof M?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:b,remainingAccounts:[]}));return x}function wd({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:u,expectedSecp256r1Signers:A}){let{domainConfig:g,verifyArgs:p,message:l,signature:f,publicKey:b}=K(n),S=[];if(l&&f&&b&&S.push(B([{message:l,signature:f,publicKey:b}])),u){let{settingsReadonlyArgs:I,compressedProofArgs:P,remainingAccounts:x}=u;S.push(Ba({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof M?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:A},settingsReadonlyArgs:I,compressedProofArgs:P,remainingAccounts:x}));}else S.push(_a({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof M?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:A},remainingAccounts:[]}));return S}function Nd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=K(e),u=[];return i&&a&&o&&u.push(B([{message:i,signature:a,publicKey:o}])),s?u.push(Za({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(Ga({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,remainingAccounts:[]})),u}function Vd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?ai({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):ti({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Hd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=K(n),u=[];return o&&a&&i&&u.push(B([{message:o,signature:a,publicKey:i}])),s?u.push(Si({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(pi({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,remainingAccounts:[]})),u}async function R2({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await BC(r),a=new k,i=null,o=null,u=[];if(c.length||t){let g=await wC({packedAccounts:a,userAccounts:c,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:s});i=g.proof,o=g.settingsMutArgs??null,u=g.userMutArgs??[];}return {configActions:await NC({configActionsArgs:r,userMutArgs:u,index:e}),index:e,proof:i,settingsMutArgs:o,packedAccounts:a,compressed:t}}async function BC(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>L(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let s=await Promise.all(r.members.map(t=>L(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function wC({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let a=[];if(r){let l=(await ne(s,t)).address;a.push({address:l,type:"Settings"});}n.length&&a.push(...n);let i=a.length?await de(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await O(i,[]),u=[],A=[];for(let l of i)l.type==="Settings"?u.push(l):l.type==="User"&&A.push(l);let g,p=[];if(r&&o&&(g=se(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),u,q())[0]),A.length&&o){let l=r?1:0;p=se(e,o.treeInfos.slice(l),o.leafIndices.slice(l),o.rootIndices.slice(l),o.proveByIndices.slice(l),A,X());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function NC({index:e,configActionsArgs:n,userMutArgs:r}){let s=[];for(let t of n)switch(t.type){case "AddMembers":{let c=[];for(let a of t.members){let i=await L(a.member,a.userAddressTreeIndex).then(o=>r.find(u=>new Fd(new Uint8Array(u.accountMeta.address)).eq(o.address)));if(!i)throw new Error("Unable to find user account");c.push(FC({permissionArgs:a.permissions,userMutArgs:i,pubkey:a.member}));}s.push({__kind:t.type,fields:[c]});break}case "RemoveMembers":{let c=await Promise.all(t.members.map(a=>L(a.member,a.userAddressTreeIndex).then(i=>{let o=r.find(u=>new Fd(new Uint8Array(u.accountMeta.address)).eq(i.address));if(!o)throw new Error("Unable to find user account");return HC({pubkey:a.member,userMutArgs:o,index:e})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(a=>VC({permissionArgs:a.permissions,pubkey:a.member}));s.push({__kind:t.type,fields:[c]});break}default:s.push({__kind:t.type,fields:[t.threshold]});}return s}function VC({pubkey:e,permissionArgs:n}){return {memberKey:nt(e),permissions:Gd(n)}}function HC({pubkey:e,userMutArgs:n,index:r}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");let s=n.data.delegatedTo.__option==="Some"?Number(n.data.delegatedTo.value.index.toString())===r:false;return {memberKey:nt(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function FC({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===1)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===2&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:nt(e),permissions:Gd(n),userReadonlyArgs:r}}function Gd(e){let n=[];return e.initiate&&n.push(Me.InitiateTransaction),e.vote&&n.push(Me.VoteTransaction),e.execute&&n.push(Me.ExecuteTransaction),Re.fromPermissions(n)}async function O2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:u=false,additionalVoters:A=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:l}){let f=await oe(n),b=Math.floor(Math.random()*255),S=await ad(f,t instanceof M?t:t.address,b),I=[],P=[];for(let H=0;H<s.length;H+=p){let We=s.subarray(H,H+p);I.push(We),P.push(sha256(We));}let x=sha256(new Uint8Array(s)),{settingsReadonlyArgs:U,settingsMutArgs:W,proof:j,packedAccounts:w}=await Se(u,n,r,false,l),{remainingAccounts:Q,systemOffset:$}=w.toAccountMetas(),ue=j&&U&&W?{settingsReadonlyArgs:U,settingsMutArgs:W,compressedProofArgs:v(j,$),remainingAccounts:Q,payer:e}:null,ye=me([t,...c?[c]:[],...A]).filter(H=>H instanceof M).map(H=>({memberKey:nt(H),messageHash:Nn(H.authResponse)})),Ee=wd({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:b,payer:e,transactionBufferAddress:S,settings:f,creator:t,preauthorizeExecution:!c,bufferExtendHashes:P,compressedArgs:ue,expectedSecp256r1Signers:ye}),Ue=I.map(H=>Vd({transactionMessageBytes:H,transactionBufferAddress:S,settings:f,compressed:u})),he=A.map(H=>Hd({voter:H,transactionBufferAddress:S,settings:f,compressedArgs:ue})),J=Nd({compressedArgs:ue,settings:f,executor:c,transactionBufferAddress:S}),{instructions:Dr,addressLookupTableAccounts:T}=await Rd({compressed:u,settings:f,transactionMessageBytes:s,transactionBufferAddress:S,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),ce=H=>({payer:e,instructions:H,addressesByLookupTableAddress:T});return [ce(Ee),...Ue.map(H=>ce([H])),...he.length?[ce(he.flat())]:[],ce(J),ce(Dr)]}var Ir=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=a=>{let i=s.get(a);return i===void 0&&(i={isSigner:false,isWritable:false,isInvoked:false},s.set(a,i)),i},c=t(r);c.isSigner=true,c.isWritable=true;for(let a of n){t(a.programAddress).isInvoked=false;for(let i of a.accounts??[]){let o=t(i.address);o.isSigner||=i.role===AccountRole.READONLY_SIGNER||i.role===AccountRole.WRITABLE_SIGNER,o.isWritable||=i.role===AccountRole.WRITABLE||i.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),a={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let i=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [a,i]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&a.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&!a.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,a]of this.keyMetaMap.entries())if(r(a)){let i=c,o=n.findIndex(u=>u===i);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(i),this.keyMetaMap.delete(c);}}return [s,t]}};var Cr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,a)=>{s.set(c,a);});let t=c=>{let a=s.get(c);if(a===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return a};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(a=>t(a.address))??[],data:c.data}))}};function Kd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Ir.compile(r,e),c=new Array,a={writable:[],readonly:[]},i=Object.entries(s??{});for(let p of i){let l=t.extractTableLookup(p);if(l!==void 0){let{addressTableLookup:f,drainedKeys:b}=l;c.push({readonlyIndexes:f.readonlyIndexes,readableIndices:f.readonlyIndexes,writableIndexes:f.writableIndexes,writableIndices:f.writableIndexes,lookupTableAddress:address(f.lookupTableAddress)}),a.writable.push(...b.writable),a.readonly.push(...b.readonly);}}let[o,u]=t.getMessageComponents(),g=new Cr(u,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:u,addressTableLookups:c}}function Z2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Kd({instructions:e,payer:n,recentBlockhash:d,addressesByLookupTableAddress:r});return Ji(s)}async function eN({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:u=false}){let{instructions:A,addressLookupTableAccounts:g}=await bd({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:i});return {payer:e,instructions:A,addressesByLookupTableAddress:g}}
|
|
2
|
-
export{mo as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,bo as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,Co as CHANGE_CONFIG_DISCRIMINATOR,Lo as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,Ko as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Zo as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,$o as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,nc as CREATE_USER_ACCOUNTS_DISCRIMINATOR,ic as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,mc as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,rs as DOMAIN_CONFIG_DISCRIMINATOR,Ic as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,Ec as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,Uc as EDIT_USER_DELEGATE_DISCRIMINATOR,is as GLOBAL_COUNTER_DISCRIMINATOR,Ht as KeyType,wc as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,zc as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,kx as MULTI_WALLET_ERROR__ALREADY_DELEGATED,Ax as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,eI as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,tI as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,mx as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,px as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,Mx as MULTI_WALLET_ERROR__EMPTY_MEMBERS,Cx as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,gx as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,xx as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,Gx as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,zx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,Kx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,Bx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,Lx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,Ox as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,bx as MULTI_WALLET_ERROR__INVALID_ACCOUNT,sI as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,Dx as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,_x as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,Fx as MULTI_WALLET_ERROR__INVALID_BUFFER,wx as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,Rx as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,lx as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,ox as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,ix as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,sx as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,ax as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,$x as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,Xx as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,Ex as MULTI_WALLET_ERROR__INVALID_THRESHOLD,Ix as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,Sx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,hx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,vx as MULTI_WALLET_ERROR__INVALID_USER_ROLE,dx as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,Zx as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,rI as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,Ux as MULTI_WALLET_ERROR__MISSING_ACCOUNT,Wx as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,Yx as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,Vx as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,Tx as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,fx as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,nI as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,yx as MULTI_WALLET_ERROR__PERMANENT_MEMBER,qx as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,ux as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,cx as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,Qx as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,Px as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,jx as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,Jx as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,Hx as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,Nx as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,d as MULTI_WALLET_PROGRAM_ADDRESS,tx as MultiWalletAccount,rx as MultiWalletInstruction,ea as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Zc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Me as Permission,Re as Permissions,Js as SETTINGS_DISCRIMINATOR,be as Secp256r1Key,M as SignedSecp256r1Key,Aa as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,aa as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Ca as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,Ta as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,ka as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,Ra as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,eo as TRANSACTION_BUFFER_DISCRIMINATOR,ja as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Va as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,si as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Qa as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Ti as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,ui as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,Ri as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,Ci as TRANSACTION_EXECUTE_DISCRIMINATOR,Vi as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,ki as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Xe as UserRole,co as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,_W as addWhitelistedAddressTrees,_e as base64URLStringToBuffer,cL as bufferToBase64URLString,UB as changeConfig,Vw as closeTransactionBuffer,UD as configAction,xd as convertMemberKeyToString,$k as convertPubkeyCompressedToCose,Qk as convertPubkeyCoseToCompressed,nL as createClientAuthorizationCompleteRequestChallenge,rL as createClientAuthorizationStartRequestChallenge,zL as createDomainConfig,eO as createDomainUserAccounts,sO as createGlobalCounter,sL as createMessageChallenge,wd as createTransactionBuffer,oL as createTransactionChallenge,aC as createTransactionManagerSigner,NB as createUserAccounts,jB as createWallet,ss as decodeDomainConfig,us as decodeGlobalCounter,Zs as decodeSettings,ro as decodeTransactionBuffer,io as decodeWhitelistedAddressTree,tw as decompressSettingsAccount,bL as deserializeConfigActions,iO as disableDomainConfig,iw as editDomainConfig,mw as editTransactionManagerUrl,Mw as editUserDelegate,Rd as executeTransaction,Nd as executeTransactionBuffer,bd as executeTransactionSync,Vd as extendTransactionBuffer,JC as fetchAllDomainConfig,eD as fetchAllGlobalCounter,cu as fetchAllMaybeDomainConfig,Cu as fetchAllMaybeGlobalCounter,Zp as fetchAllMaybeSettings,ym as fetchAllMaybeTransactionBuffer,Lm as fetchAllMaybeWhitelistedAddressTree,bE as fetchAllSettings,LE as fetchAllTransactionBuffer,VE as fetchAllWhitelistedAddressTree,os as fetchDomainConfig,$C as fetchGlobalCounter,ou as fetchMaybeDomainConfig,Iu as fetchMaybeGlobalCounter,on as fetchMaybeSettings,SI as fetchMaybeSettingsAccountData,mm as fetchMaybeTransactionBuffer,fI as fetchMaybeUserAccountData,km as fetchMaybeWhitelistedAddressTree,RE as fetchSettings,On as fetchSettingsAccountData,no as fetchTransactionBuffer,mr as fetchUserAccountData,uo as fetchWhitelistedAddressTree,oD as getAddMemberArgsCodec,hr as getAddMemberArgsDecoder,Er as getAddMemberArgsEncoder,nh as getAddWhitelistedAddressTreesDiscriminatorBytes,oh as getAddWhitelistedAddressTreesInstruction,To as getAddWhitelistedAddressTreesInstructionAsync,sh as getAddWhitelistedAddressTreesInstructionDataCodec,yo as getAddWhitelistedAddressTreesInstructionDataDecoder,mn as getAddWhitelistedAddressTreesInstructionDataEncoder,Dh as getChangeConfigCompressedDiscriminatorBytes,Uo as getChangeConfigCompressedInstruction,Mh as getChangeConfigCompressedInstructionDataCodec,_o as getChangeConfigCompressedInstructionDataDecoder,vo as getChangeConfigCompressedInstructionDataEncoder,ph as getChangeConfigDiscriminatorBytes,yh as getChangeConfigInstruction,Mo as getChangeConfigInstructionAsync,mh as getChangeConfigInstructionDataCodec,Do as getChangeConfigInstructionDataDecoder,yn as getChangeConfigInstructionDataEncoder,wn as getClientAndDeviceHash,iD as getCompiledInstructionCodec,br as getCompiledInstructionDecoder,Rr as getCompiledInstructionEncoder,gD as getCompressedAccountMetaCodec,ut as getCompressedAccountMetaDecoder,dt as getCompressedAccountMetaEncoder,TD as getCompressedAccountMetaReadOnlyCodec,mt as getCompressedAccountMetaReadOnlyDecoder,pt as getCompressedAccountMetaReadOnlyEncoder,SD as getCompressedProofCodec,Lr as getCompressedProofDecoder,kr as getCompressedProofEncoder,ne as getCompressedSettingsAddressFromIndex,DD as getCompressedSettingsCodec,hD as getCompressedSettingsDataCodec,lt as getCompressedSettingsDataDecoder,Tt as getCompressedSettingsDataEncoder,q as getCompressedSettingsDecoder,yt as getCompressedSettingsEncoder,Xi as getComputeBudgetEstimate,_D as getConfigActionCodec,we as getConfigActionDecoder,Be as getConfigActionEncoder,Uh as getCreateCompressedWalletDiscriminatorBytes,kh as getCreateCompressedWalletInstruction,Bo as getCreateCompressedWalletInstructionAsync,Wh as getCreateCompressedWalletInstructionDataCodec,Oo as getCreateCompressedWalletInstructionDataDecoder,Tn as getCreateCompressedWalletInstructionDataEncoder,Fh as getCreateDomainConfigDiscriminatorBytes,zh as getCreateDomainConfigInstruction,Jo as getCreateDomainConfigInstructionAsync,Gh as getCreateDomainConfigInstructionDataCodec,jo as getCreateDomainConfigInstructionDataDecoder,fn as getCreateDomainConfigInstructionDataEncoder,Qh as getCreateDomainUserAccountDiscriminatorBytes,eR as getCreateDomainUserAccountInstruction,Xo as getCreateDomainUserAccountInstructionAsync,$h as getCreateDomainUserAccountInstructionDataCodec,Yo as getCreateDomainUserAccountInstructionDataDecoder,xn as getCreateDomainUserAccountInstructionDataEncoder,aR as getCreateGlobalCounterDiscriminatorBytes,dR as getCreateGlobalCounterInstruction,tc as getCreateGlobalCounterInstructionAsync,iR as getCreateGlobalCounterInstructionDataCodec,ec as getCreateGlobalCounterInstructionDataDecoder,Cn as getCreateGlobalCounterInstructionDataEncoder,BD as getCreateUserAccountArgsCodec,Gr as getCreateUserAccountArgsDecoder,Fr as getCreateUserAccountArgsEncoder,lR as getCreateUserAccountsDiscriminatorBytes,SR as getCreateUserAccountsInstruction,oc as getCreateUserAccountsInstructionAsync,fR as getCreateUserAccountsInstructionDataCodec,sc as getCreateUserAccountsInstructionDataDecoder,Mn as getCreateUserAccountsInstructionDataEncoder,hR as getDecompressSettingsAccountDiscriminatorBytes,Ac as getDecompressSettingsAccountInstruction,RR as getDecompressSettingsAccountInstructionDataCodec,uc as getDecompressSettingsAccountInstructionDataDecoder,dc as getDecompressSettingsAccountInstructionDataEncoder,LR as getDisableDomainConfigDiscriminatorBytes,lc as getDisableDomainConfigInstruction,OR as getDisableDomainConfigInstructionDataCodec,Tc as getDisableDomainConfigInstructionDataDecoder,yc as getDisableDomainConfigInstructionDataEncoder,tt as getDomainConfigAddress,jC as getDomainConfigCodec,ns as getDomainConfigDecoder,KC as getDomainConfigDiscriminatorBytes,su as getDomainConfigEncoder,qC as getDomainConfigSize,zR as getEditDomainConfigDiscriminatorBytes,Dc as getEditDomainConfigInstruction,jR as getEditDomainConfigInstructionAsync,KR as getEditDomainConfigInstructionDataCodec,Cc as getEditDomainConfigInstructionDataDecoder,En as getEditDomainConfigInstructionDataEncoder,HD as getEditMemberArgsCodec,Nr as getEditMemberArgsDecoder,wr as getEditMemberArgsEncoder,eb as getEditTransactionManagerUrlDiscriminatorBytes,bc as getEditTransactionManagerUrlInstruction,tb as getEditTransactionManagerUrlInstructionDataCodec,Rc as getEditTransactionManagerUrlInstructionDataDecoder,hc as getEditTransactionManagerUrlInstructionDataEncoder,db as getEditUserDelegateDiscriminatorBytes,Lc as getEditUserDelegateInstruction,ub as getEditUserDelegateInstructionDataCodec,kc as getEditUserDelegateInstructionDataDecoder,Wc as getEditUserDelegateInstructionDataEncoder,KD as getExpectedSecp256r1SignersCodec,It as getExpectedSecp256r1SignersDecoder,xt as getExpectedSecp256r1SignersEncoder,cd as getGlobalCounterAddress,QC as getGlobalCounterCodec,ds as getGlobalCounterDecoder,XC as getGlobalCounterDiscriminatorBytes,xu as getGlobalCounterEncoder,tD as getGlobalCounterSize,kn as getJitoTipsConfig,Lk as getLightCpiSigner,$e as getLightProtocolRpc,ZD as getLinkWalletArgsCodec,Kr as getLinkWalletArgsDecoder,zr as getLinkWalletArgsEncoder,$D as getMemberCodec,St as getMemberDecoder,ft as getMemberEncoder,rM as getMemberKeyCodec,te as getMemberKeyDecoder,ee as getMemberKeyEncoder,fb as getMigrateCompressedSettingsDiscriminatorBytes,Hc as getMigrateCompressedSettingsInstruction,Sb as getMigrateCompressedSettingsInstructionDataCodec,Vc as getMigrateCompressedSettingsInstructionDataDecoder,Nc as getMigrateCompressedSettingsInstructionDataEncoder,hb as getMigrateCompressedUsersDiscriminatorBytes,Jc as getMigrateCompressedUsersInstruction,Rb as getMigrateCompressedUsersInstructionDataCodec,jc as getMigrateCompressedUsersInstructionDataDecoder,Kc as getMigrateCompressedUsersInstructionDataEncoder,SW as getMultiWalletErrorMessage,jb as getNativeTransferIntentCompressedDiscriminatorBytes,na as getNativeTransferIntentCompressedInstruction,Jb as getNativeTransferIntentCompressedInstructionDataCodec,ra as getNativeTransferIntentCompressedInstructionDataDecoder,ta as getNativeTransferIntentCompressedInstructionDataEncoder,Ob as getNativeTransferIntentDiscriminatorBytes,Xc as getNativeTransferIntentInstruction,wb as getNativeTransferIntentInstructionAsync,Bb as getNativeTransferIntentInstructionDataCodec,Yc as getNativeTransferIntentInstructionDataDecoder,hn as getNativeTransferIntentInstructionDataEncoder,cM as getNewAuthorityArgsCodec,Zr as getNewAuthorityArgsDecoder,qr as getNewAuthorityArgsEncoder,tL as getOriginIndex,dM as getPackedAddressTreeInfoCodec,Dt as getPackedAddressTreeInfoDecoder,Ct as getPackedAddressTreeInfoEncoder,gM as getPackedMerkleContextCodec,Xr as getPackedMerkleContextDecoder,Yr as getPackedMerkleContextEncoder,yM as getPackedStateTreeInfoCodec,gt as getPackedStateTreeInfoDecoder,At as getPackedStateTreeInfoEncoder,fM as getPermissionsCodec,Oe as getPermissionsDecoder,Le as getPermissionsEncoder,CM as getProofArgsCodec,D as getProofArgsDecoder,C as getProofArgsEncoder,EM as getRemoveMemberArgsCodec,Hr as getRemoveMemberArgsDecoder,Vr as getRemoveMemberArgsEncoder,Nn as getSecp256r1MessageHash,bM as getSecp256r1PubkeyCodec,Mt as getSecp256r1PubkeyDecoder,en as getSecp256r1PubkeyEncoder,IC as getSecp256r1SignatureOffsetsDataDecoder,xC as getSecp256r1SignatureOffsetsDataEncoder,UM as getSecp256r1VerifyArgsCodec,V as getSecp256r1VerifyArgsDecoder,N as getSecp256r1VerifyArgsEncoder,OM as getSecp256r1VerifyArgsWithDomainAddressCodec,Y as getSecp256r1VerifyArgsWithDomainAddressDecoder,Z as getSecp256r1VerifyArgsWithDomainAddressEncoder,B as getSecp256r1VerifyInstruction,BO as getSecp256r1VerifyInstructionDataCodec,Ed as getSecp256r1VerifyInstructionDataDecoder,hd as getSecp256r1VerifyInstructionDataEncoder,Yi as getSendAndConfirmTransaction,hE as getSettingsCodec,VM as getSettingsCreationArgsCodec,Et as getSettingsCreationArgsDecoder,Pt as getSettingsCreationArgsEncoder,qs as getSettingsDecoder,EE as getSettingsDiscriminatorBytes,qp as getSettingsEncoder,oe as getSettingsFromIndex,GM as getSettingsIndexWithAddressCodec,Rt as getSettingsIndexWithAddressDecoder,ht as getSettingsIndexWithAddressEncoder,JM as getSettingsMutArgsCodec,G as getSettingsMutArgsDecoder,F as getSettingsMutArgsEncoder,XM as getSettingsReadonlyArgsCodec,vt as getSettingsReadonlyArgsDecoder,bt as getSettingsReadonlyArgsEncoder,eL as getSignedSecp256r1Key,hL as getSignedTransactionManager,re as getSolanaRpc,Zi as getSolanaRpcEndpoint,tP as getSourceCompressedTokenArgsCodec,Ut as getSourceCompressedTokenArgsDecoder,_t as getSourceCompressedTokenArgsEncoder,Av as getTokenTransferIntentCompressedDiscriminatorBytes,pa as getTokenTransferIntentCompressedInstruction,pv as getTokenTransferIntentCompressedInstructionAsync,gv as getTokenTransferIntentCompressedInstructionDataCodec,ga as getTokenTransferIntentCompressedInstructionDataDecoder,bn as getTokenTransferIntentCompressedInstructionDataEncoder,tv as getTokenTransferIntentDiscriminatorBytes,da as getTokenTransferIntentInstruction,nv as getTokenTransferIntentInstructionAsync,rv as getTokenTransferIntentInstructionDataCodec,ia as getTokenTransferIntentInstructionDataDecoder,Rn as getTokenTransferIntentInstructionDataEncoder,ad as getTransactionBufferAddress,vv as getTransactionBufferCloseCompressedDiscriminatorBytes,Pa as getTransactionBufferCloseCompressedInstruction,_v as getTransactionBufferCloseCompressedInstructionDataCodec,Ma as getTransactionBufferCloseCompressedInstructionDataDecoder,Da as getTransactionBufferCloseCompressedInstructionDataEncoder,Iv as getTransactionBufferCloseDiscriminatorBytes,Sa as getTransactionBufferCloseInstruction,Cv as getTransactionBufferCloseInstructionDataCodec,fa as getTransactionBufferCloseInstructionDataDecoder,la as getTransactionBufferCloseInstructionDataEncoder,kE as getTransactionBufferCodec,oP as getTransactionBufferCreateArgsCodec,kt as getTransactionBufferCreateArgsDecoder,Wt as getTransactionBufferCreateArgsEncoder,qv as getTransactionBufferCreateCompressedDiscriminatorBytes,Ba as getTransactionBufferCreateCompressedInstruction,Zv as getTransactionBufferCreateCompressedInstructionDataCodec,Oa as getTransactionBufferCreateCompressedInstructionDataDecoder,La as getTransactionBufferCreateCompressedInstructionDataEncoder,Nv as getTransactionBufferCreateDiscriminatorBytes,_a as getTransactionBufferCreateInstruction,Vv as getTransactionBufferCreateInstructionDataCodec,va as getTransactionBufferCreateInstructionDataDecoder,ba as getTransactionBufferCreateInstructionDataEncoder,to as getTransactionBufferDecoder,WE as getTransactionBufferDiscriminatorBytes,pm as getTransactionBufferEncoder,g_ as getTransactionBufferExecuteCompressedDiscriminatorBytes,Za as getTransactionBufferExecuteCompressedInstruction,p_ as getTransactionBufferExecuteCompressedInstructionDataCodec,qa as getTransactionBufferExecuteCompressedInstructionDataDecoder,Ja as getTransactionBufferExecuteCompressedInstructionDataEncoder,n_ as getTransactionBufferExecuteDiscriminatorBytes,Ga as getTransactionBufferExecuteInstruction,s_ as getTransactionBufferExecuteInstructionDataCodec,Fa as getTransactionBufferExecuteInstructionDataDecoder,Ha as getTransactionBufferExecuteInstructionDataEncoder,R_ as getTransactionBufferExtendCompressedDiscriminatorBytes,ai as getTransactionBufferExtendCompressedInstruction,b_ as getTransactionBufferExtendCompressedInstructionDataCodec,ci as getTransactionBufferExtendCompressedInstructionDataDecoder,oi as getTransactionBufferExtendCompressedInstructionDataEncoder,x_ as getTransactionBufferExtendDiscriminatorBytes,ti as getTransactionBufferExtendInstruction,I_ as getTransactionBufferExtendInstructionDataCodec,ei as getTransactionBufferExtendInstructionDataDecoder,$a as getTransactionBufferExtendInstructionDataEncoder,j_ as getTransactionBufferVoteCompressedDiscriminatorBytes,Si as getTransactionBufferVoteCompressedInstruction,J_ as getTransactionBufferVoteCompressedInstructionDataCodec,fi as getTransactionBufferVoteCompressedInstructionDataDecoder,li as getTransactionBufferVoteCompressedInstructionDataEncoder,B_ as getTransactionBufferVoteDiscriminatorBytes,pi as getTransactionBufferVoteInstruction,w_ as getTransactionBufferVoteInstructionDataCodec,gi as getTransactionBufferVoteInstructionDataDecoder,Ai as getTransactionBufferVoteInstructionDataEncoder,iU as getTransactionExecuteCompressedDiscriminatorBytes,_i as getTransactionExecuteCompressedInstruction,dU as getTransactionExecuteCompressedInstructionDataCodec,vi as getTransactionExecuteCompressedInstructionDataDecoder,bi as getTransactionExecuteCompressedInstructionDataEncoder,eU as getTransactionExecuteDiscriminatorBytes,Pi as getTransactionExecuteInstruction,tU as getTransactionExecuteInstructionDataCodec,Mi as getTransactionExecuteInstructionDataDecoder,Di as getTransactionExecuteInstructionDataEncoder,EU as getTransactionExecuteSyncCompressedDiscriminatorBytes,Gi as getTransactionExecuteSyncCompressedInstruction,hU as getTransactionExecuteSyncCompressedInstructionDataCodec,Fi as getTransactionExecuteSyncCompressedInstructionDataDecoder,Hi as getTransactionExecuteSyncCompressedInstructionDataEncoder,lU as getTransactionExecuteSyncDiscriminatorBytes,Bi as getTransactionExecuteSyncInstruction,fU as getTransactionExecuteSyncInstructionDataCodec,Oi as getTransactionExecuteSyncInstructionDataDecoder,Li as getTransactionExecuteSyncInstructionDataEncoder,gP as getTransactionMessageAddressTableLookupCodec,rn as getTransactionMessageAddressTableLookupDecoder,tn as getTransactionMessageAddressTableLookupEncoder,dP as getTransactionMessageCodec,Ot as getTransactionMessageDecoder,Lt as getTransactionMessageEncoder,L as getUserAccountAddress,TP as getUserCodec,xP as getUserCreationArgsCodec,le as getUserCreationArgsDecoder,Te as getUserCreationArgsEncoder,X as getUserDecoder,He as getUserEncoder,MP as getUserMutArgsCodec,Ge as getUserMutArgsDecoder,Fe as getUserMutArgsEncoder,RP as getUserReadOnlyArgsCodec,De as getUserReadOnlyArgsDecoder,Ce as getUserReadOnlyArgsEncoder,UP as getUserReadOnlyOrMutateArgsCodec,$r as getUserReadOnlyOrMutateArgsDecoder,Qr as getUserReadOnlyOrMutateArgsEncoder,BP as getUserRoleCodec,Ve as getUserRoleDecoder,Ne as getUserRoleEncoder,kk as getWalletAddressFromIndex,Pe as getWalletAddressFromSettings,NE as getWhitelistedAddressTreeCodec,ao as getWhitelistedAddressTreeDecoder,wE as getWhitelistedAddressTreeDiscriminatorBytes,Wm as getWhitelistedAddressTreeEncoder,Bn as getWhitelistedAddressTreeFromIndex,Pk as getWhitelistedAddressTreeIndexFromAddress,td as getWhitelistedAddressTreesAddress,gW as identifyMultiWalletAccount,pW as identifyMultiWalletInstruction,rk as initialize,WD as isConfigAction,xW as isMultiWalletError,kP as isUserReadOnlyOrMutateArgs,yO as migrateSettings,CO as migrateUsers,iB as nativeTransferIntent,ch as parseAddWhitelistedAddressTreesInstruction,Ph as parseChangeConfigCompressedInstruction,Th as parseChangeConfigInstruction,Lh as parseCreateCompressedWalletInstruction,Kh as parseCreateDomainConfigInstruction,tR as parseCreateDomainUserAccountInstruction,uR as parseCreateGlobalCounterInstruction,xR as parseCreateUserAccountsInstruction,bR as parseDecompressSettingsAccountInstruction,BR as parseDisableDomainConfigInstruction,JR as parseEditDomainConfigInstruction,rb as parseEditTransactionManagerUrlInstruction,Ab as parseEditUserDelegateInstruction,xb as parseMigrateCompressedSettingsInstruction,bb as parseMigrateCompressedUsersInstruction,qb as parseNativeTransferIntentCompressedInstruction,Nb as parseNativeTransferIntentInstruction,wO as parseSecp256r1VerifyInstruction,mv as parseTokenTransferIntentCompressedInstruction,sv as parseTokenTransferIntentInstruction,Uv as parseTransactionBufferCloseCompressedInstruction,Dv as parseTransactionBufferCloseInstruction,Yv as parseTransactionBufferCreateCompressedInstruction,Hv as parseTransactionBufferCreateInstruction,m_ as parseTransactionBufferExecuteCompressedInstruction,o_ as parseTransactionBufferExecuteInstruction,v_ as parseTransactionBufferExtendCompressedInstruction,C_ as parseTransactionBufferExtendInstruction,q_ as parseTransactionBufferVoteCompressedInstruction,N_ as parseTransactionBufferVoteInstruction,uU as parseTransactionExecuteCompressedInstruction,rU as parseTransactionExecuteInstruction,RU as parseTransactionExecuteSyncCompressedInstruction,SU as parseTransactionExecuteSyncInstruction,PL as pollJitoBundleConfirmation,R2 as prepareChangeConfigArgs,O2 as prepareTransactionBundle,Z2 as prepareTransactionMessage,eN as prepareTransactionSync,EL as retrieveTransactionManager,cC as sendJitoBundle,RL as serializeConfigActions,DL as signAndSendBundledTransactions,ML as signAndSendTransaction,IB as tokenTransferIntent,tk as uninitialize,WP as userReadOnlyOrMutateArgs,qi as vaultTransactionMessageDeserialize,Ji as vaultTransactionMessageSerialize,Hd as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
1
|
+
import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getOptionEncoder,getOptionDecoder,getArrayEncoder,getU64Encoder,getArrayDecoder,getU64Decoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getU16Encoder,getU16Decoder,getBooleanEncoder,getBooleanDecoder,getEnumEncoder,getEnumDecoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64Encoder,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,getBase64Decoder,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,getBlockhashDecoder,compileTransaction,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {VERSION,featureFlags,createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,CTOKEN_PROGRAM_ID,encodeBN254toBase58,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import S from'zod';import {estimateComputeUnitLimitFactory,getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTokenDecoder,getTransferSolInstruction}from'gill/programs';import {p256}from'@noble/curves/nist.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {equalBytes}from'@noble/curves/utils.js';var Kr=1644,or=2e5,Ds=1.1,Ms=30,Ps=3e3,ve=3,Ue=500,cr=2,ar=3e4,jr=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],hs="https://mainnet.block-engine.jito.wtf/api/v1",Rs="https://bundles.jito.wtf/api/v1/bundles/tip_floor",bs="landed_tips_75th_percentile",_s=255,vs=400,Us=429,qr=500;var Ie=class extends Error{constructor(r,s,t){super(r);this.code=s;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},We=class extends Ie{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},ee=class extends Ie{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},F=class extends Ie{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},Ce=class extends Ie{constructor(r,s,t){super(r,"NETWORK_ERROR",{statusCode:s,url:t});this.statusCode=s;this.url=t;}},Ws=class extends Ie{constructor(r,s,t){super(r,"TRANSACTION_ERROR",{signature:s,logs:t});this.signature=s;this.logs=t;}},Ae=class extends Ie{constructor(r,s,t){super(r,"BUNDLE_ERROR",{bundleId:s,attempt:t});this.bundleId=s;this.attempt=t;}},ir=class extends Ie{constructor(r,s,t){super(`Operation "${r}" failed after ${s} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=s;this.lastError=t;}},dr=class extends Ie{constructor(r,s,t){super(r,"PERMISSION_ERROR",{required:s,actual:t});this.required=s;this.actual=t;}};var Ls=new Uint8Array([201,232,212,229,59,241,106,197]);function SD(){return fixEncoderSize(getBytesEncoder(),8).encode(Ls)}function Ju(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["rpIdHash",fixEncoderSize(getBytesEncoder(),32)],["bump",getU8Encoder()],["isDisabled",getU8Encoder()],["rpIdLength",getU8Encoder()],["numOrigins",getU8Encoder()],["rpId",fixEncoderSize(getBytesEncoder(),255)],["origins",fixEncoderSize(getBytesEncoder(),515)]]),e=>({...e,discriminator:Ls}))}function ks(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["rpIdHash",fixDecoderSize(getBytesDecoder(),32)],["bump",getU8Decoder()],["isDisabled",getU8Decoder()],["rpIdLength",getU8Decoder()],["numOrigins",getU8Decoder()],["rpId",fixDecoderSize(getBytesDecoder(),255)],["origins",fixDecoderSize(getBytesDecoder(),515)]])}function xD(){return combineCodec(Ju(),ks())}function Os(e){return decodeAccount(e,ks())}async function Bs(e,n,r){let s=await Yu(e,n,r);return assertAccountExists(s),s}async function Yu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Os(s)}async function ID(e,n,r){let s=await Zu(e,n,r);return assertAccountsExist(s),s}async function Zu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Os(t))}function CD(){return 846}var Vs=new Uint8Array([42,206,176,58,175,129,130,233]);function MD(){return fixEncoderSize(getBytesEncoder(),8).encode(Vs)}function uA(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Vs}))}function Hs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function PD(){return combineCodec(uA(),Hs())}function Fs(e){return decodeAccount(e,Hs())}async function hD(e,n,r){let s=await AA(e,n,r);return assertAccountExists(s),s}async function AA(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Fs(s)}async function RD(e,n,r){let s=await gA(e,n,r);return assertAccountsExist(s),s}async function gA(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Fs(t))}function bD(){return 24}function Jr(){return getStructEncoder([["memberKey",te()],["permissions",He()],["userReadonlyArgs",he()]])}function Yr(){return getStructDecoder([["memberKey",re()],["permissions",Fe()],["userReadonlyArgs",Re()]])}function WD(){return combineCodec(Jr(),Yr())}function Zr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Xr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function OD(){return combineCodec(Zr(),Xr())}function ft(){return getStructEncoder([["treeInfo",xt()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function St(){return getStructDecoder([["treeInfo",It()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function VD(){return combineCodec(ft(),St())}function Ct(){return getStructEncoder([["treeInfo",xt()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function Et(){return getStructDecoder([["treeInfo",It()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function zD(){return combineCodec(Ct(),Et())}function rn(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function nn(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function qD(){return combineCodec(rn(),nn())}function Dt(){return getStructEncoder([["data",getOptionEncoder(Mt())]])}function q(){return getStructDecoder([["data",getOptionDecoder(Pt())]])}function XD(){return combineCodec(Dt(),q())}function Mt(){return getStructEncoder([["threshold",getU8Encoder()],["bump",getU8Encoder()],["index",getU128Encoder()],["multiWalletBump",getU8Encoder()],["members",getArrayEncoder(ht())],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function Pt(){return getStructDecoder([["threshold",getU8Decoder()],["bump",getU8Decoder()],["index",getU128Decoder()],["multiWalletBump",getU8Decoder()],["members",getArrayDecoder(Rt())],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function tM(){return combineCodec(Mt(),Pt())}function Ge(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(cn())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Jr())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(dn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function ze(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(an())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Yr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(un())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function oM(){return combineCodec(Ge(),ze())}function cM(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function aM(e,n){return n.__kind===e}function An(){return getStructEncoder([["member",getAddressEncoder()],["role",Ke()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",le()]])}function gn(){return getStructDecoder([["member",getAddressDecoder()],["role",je()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",fe()]])}function AM(){return combineCodec(An(),gn())}function cn(){return getStructEncoder([["memberKey",te()],["permissions",He()]])}function an(){return getStructDecoder([["memberKey",re()],["permissions",Fe()]])}function TM(){return combineCodec(cn(),an())}function bt(){return getStructEncoder([["memberKey",te()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function _t(){return getStructDecoder([["memberKey",re()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function SM(){return combineCodec(bt(),_t())}function pn(){return getStructEncoder([["settingsMutArgs",G()],["transactionManager",getOptionEncoder(he())]])}function mn(){return getStructDecoder([["settingsMutArgs",z()],["transactionManager",getOptionDecoder(Re())]])}function EM(){return combineCodec(pn(),mn())}function ht(){return getStructEncoder([["pubkey",te()],["permissions",He()],["role",getU8Encoder()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function Rt(){return getStructDecoder([["pubkey",re()],["permissions",Fe()],["role",getU8Decoder()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function hM(){return combineCodec(ht(),Rt())}function te(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function re(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function _M(){return combineCodec(te(),re())}function ln(){return getStructEncoder([["authorityCreationArgs",le()],["compressedProofArgs",E()]])}function fn(){return getStructDecoder([["authorityCreationArgs",fe()],["compressedProofArgs",D()]])}function LM(){return combineCodec(ln(),fn())}function vt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function Ut(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function BM(){return combineCodec(vt(),Ut())}function Sn(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function xn(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function VM(){return combineCodec(Sn(),xn())}function xt(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function It(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function GM(){return combineCodec(xt(),It())}function He(){return getStructEncoder([["mask",getU8Encoder()]])}function Fe(){return getStructDecoder([["mask",getU8Decoder()]])}function jM(){return combineCodec(He(),Fe())}function E(){return getStructEncoder([["proof",getOptionEncoder(rn())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function D(){return getStructDecoder([["proof",getOptionDecoder(nn())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function ZM(){return combineCodec(E(),D())}function dn(){return getStructEncoder([["memberKey",te()],["userArgs",In()]])}function un(){return getStructDecoder([["memberKey",re()],["userArgs",Cn()]])}function eP(){return combineCodec(dn(),un())}function En(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Wt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function nP(){return combineCodec(En(),Wt())}function w(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function V(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function cP(){return combineCodec(w(),V())}function J(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",w()]])}function Y(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",V()]])}function uP(){return combineCodec(J(),Y())}function Lt(){return getStructEncoder([["addressTreeInfo",vt()],["outputStateTreeIndex",getU8Encoder()]])}function kt(){return getStructDecoder([["addressTreeInfo",Ut()],["outputStateTreeIndex",getU8Decoder()]])}function mP(){return combineCodec(Lt(),kt())}function Ot(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function Bt(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function lP(){return combineCodec(Ot(),Bt())}function G(){return getStructEncoder([["accountMeta",ft()],["data",Dt()]])}function z(){return getStructDecoder([["accountMeta",St()],["data",q()]])}function IP(){return combineCodec(G(),z())}function Nt(){return getStructEncoder([["accountMeta",Ct()],["data",Dt()]])}function wt(){return getStructDecoder([["accountMeta",Et()],["data",q()]])}function MP(){return combineCodec(Nt(),wt())}function Vt(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",Sn()]])}function Ht(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",xn()]])}function bP(){return combineCodec(Vt(),Ht())}function Ft(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getArrayEncoder(bt())]])}function Gt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getArrayDecoder(_t())]])}function WP(){return combineCodec(Ft(),Gt())}function zt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(Zr())],["addressTableLookups",getArrayEncoder(Dn())]])}function Kt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Xr())],["addressTableLookups",getArrayDecoder(Mn())]])}function BP(){return combineCodec(zt(),Kt())}function Dn(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Mn(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function VP(){return combineCodec(Dn(),Mn())}function qe(){return getStructEncoder([["member",te()],["domainConfig",getOptionEncoder(getAddressEncoder())],["role",Ke()],["delegatedTo",getOptionEncoder(Ot())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function Z(){return getStructDecoder([["member",re()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",je()],["delegatedTo",getOptionDecoder(Bt())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function zP(){return combineCodec(qe(),Z())}function le(){return getStructEncoder([["addressTreeInfo",vt()],["outputStateTreeIndex",getU8Encoder()]])}function fe(){return getStructDecoder([["addressTreeInfo",Ut()],["outputStateTreeIndex",getU8Decoder()]])}function JP(){return combineCodec(le(),fe())}function Je(){return getStructEncoder([["accountMeta",ft()],["data",qe()]])}function Ye(){return getStructDecoder([["accountMeta",St()],["data",Z()]])}function QP(){return combineCodec(Je(),Ye())}function he(){return getStructEncoder([["accountMeta",Ct()],["data",qe()]])}function Re(){return getStructDecoder([["accountMeta",Et()],["data",Z()]])}function rh(){return combineCodec(he(),Re())}function In(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([he()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([Je()])]])]])}function Cn(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Re()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([Ye()])]])]])}function ch(){return combineCodec(In(),Cn())}function ah(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function ih(e,n){return n.__kind===e}var nt=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(nt||{});function Ke(){return getEnumEncoder(nt)}function je(){return getEnumDecoder(nt)}function Ah(){return combineCodec(Ke(),je())}var Po=new Uint8Array([223,179,163,190,177,224,67,173]);function eR(){return fixEncoderSize(getBytesEncoder(),8).encode(Po)}function N1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(ht())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:Po}))}function ho(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(Rt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function tR(){return combineCodec(N1(),ho())}function Ro(e){return decodeAccount(e,ho())}async function rR(e,n,r){let s=await Rn(e,n,r);return assertAccountExists(s),s}async function Rn(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Ro(s)}async function nR(e,n,r){let s=await w1(e,n,r);return assertAccountsExist(s),s}async function w1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ro(t))}var Wo=new Uint8Array([90,36,35,219,93,225,110,96]);function aR(){return fixEncoderSize(getBytesEncoder(),8).encode(Wo)}function nT(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["multiWalletSettings",getAddressEncoder()],["multiWalletBump",getU8Encoder()],["canExecute",getBooleanEncoder()],["preauthorizeExecution",getBooleanEncoder()],["validTill",getU64Encoder()],["payer",getAddressEncoder()],["bump",getU8Encoder()],["bufferIndex",getU8Encoder()],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["creator",te()],["executor",te()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(te())],["expectedSecp256r1Signers",getArrayEncoder(bt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Wo}))}function Lo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multiWalletSettings",getAddressDecoder()],["multiWalletBump",getU8Decoder()],["canExecute",getBooleanDecoder()],["preauthorizeExecution",getBooleanDecoder()],["validTill",getU64Decoder()],["payer",getAddressDecoder()],["bump",getU8Decoder()],["bufferIndex",getU8Decoder()],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["creator",re()],["executor",re()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(re())],["expectedSecp256r1Signers",getArrayDecoder(_t())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function iR(){return combineCodec(nT(),Lo())}function ko(e){return decodeAccount(e,Lo())}async function Oo(e,n,r){let s=await sT(e,n,r);return assertAccountExists(s),s}async function sT(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ko(s)}async function dR(e,n,r){let s=await oT(e,n,r);return assertAccountsExist(s),s}async function oT(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ko(t))}var wo=new Uint8Array([105,23,173,2,197,255,80,87]);function gR(){return fixEncoderSize(getBytesEncoder(),8).encode(wo)}function ET(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:wo}))}function Vo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function pR(){return combineCodec(ET(),Vo())}function Ho(e){return decodeAccount(e,Vo())}async function Fo(e,n,r){let s=await DT(e,n,r);return assertAccountExists(s),s}async function DT(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Ho(s)}async function mR(e,n,r){let s=await MT(e,n,r);return assertAccountsExist(s),s}async function MT(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ho(t))}function m({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function zo(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function U(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function T(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let s=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:U(r.value),role:Go(r.value)?upgradeRoleToSigner(s):s,...Go(r.value)?{signer:r.value}:{}})}}function Go(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var jo=new Uint8Array([8]);function vR(){return fixEncoderSize(getBytesEncoder(),1).encode(jo)}function On(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:jo}))}function qo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function UR(){return combineCodec(On(),qo())}async function Jo(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:On().encode(c),programAddress:r})}function WR(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:On().encode(c),programAddress:r})}function LR(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:qo().decode(e.data)}}var $o=new Uint8Array([9]);function HR(){return fixEncoderSize(getBytesEncoder(),1).encode($o)}function Nn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(Ge())],["secp256r1VerifyArgs",getArrayEncoder(J())],["compressedProofArgs",getOptionEncoder(E())]]),e=>({...e,discriminator:$o}))}function ec(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(ze())],["secp256r1VerifyArgs",getArrayDecoder(Y())],["compressedProofArgs",getOptionDecoder(D())]])}function FR(){return combineCodec(Nn(),ec())}async function tc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.settings.value||(t.settings.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getU128Encoder().encode(zo(c.settingsIndex))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Nn().encode(c),programAddress:r})}function GR(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Nn().encode(c),programAddress:r})}function zR(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:ec().decode(e.data)}}var cc=new Uint8Array([19]);function XR(){return fixEncoderSize(getBytesEncoder(),1).encode(cc)}function ac(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(Ge())],["secp256r1VerifyArgs",getArrayEncoder(J())],["settingsMutArgs",G()],["compressedProofArgs",E()]]),e=>({...e,discriminator:cc}))}function ic(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(ze())],["secp256r1VerifyArgs",getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function QR(){return combineCodec(ac(),ic())}function dc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ac().encode(c),programAddress:r})}function $R(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:ic().decode(e.data)}}var gc=new Uint8Array([18]);function cb(){return fixEncoderSize(getBytesEncoder(),1).encode(gc)}function wn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",E()],["settingsCreation",Lt()],["userReadonlyArgs",he()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:gc}))}function pc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["settingsCreation",kt()],["userReadonlyArgs",Re()],["settingsIndex",getU128Decoder()]])}function ab(){return combineCodec(wn(),pc())}async function mc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:wn().encode(c),programAddress:r})}function ib(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:wn().encode(c),programAddress:r})}function db(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:pc().decode(e.data)}}var Cc=new Uint8Array([0]);function yb(){return fixEncoderSize(getBytesEncoder(),1).encode(Cc)}function Hn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",le()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Cc}))}function Ec(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",fe()],["compressedProofArgs",D()]])}function lb(){return combineCodec(Hn(),Ec())}async function Dc(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Hn().encode(c),programAddress:r})}function fb(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Hn().encode(c),programAddress:r})}function Sb(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Ec().decode(e.data)}}var Pc=new Uint8Array([4]);function Pb(){return fixEncoderSize(getBytesEncoder(),1).encode(Pc)}function Gn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",E()],["member",En()],["role",Ke()],["userAccountCreationArgs",le()],["linkWalletArgs",getOptionEncoder(pn())]]),e=>({...e,discriminator:Pc}))}function hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["member",Wt()],["role",je()],["userAccountCreationArgs",fe()],["linkWalletArgs",getOptionDecoder(mn())]])}function hb(){return combineCodec(Gn(),hc())}async function Rc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:Gn().encode(c),programAddress:r})}function Rb(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:Gn().encode(c),programAddress:r})}function bb(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:hc().decode(e.data)}}var _c=new Uint8Array([3]);function kb(){return fixEncoderSize(getBytesEncoder(),1).encode(_c)}function Kn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:_c}))}function vc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function Ob(){return combineCodec(Kn(),vc())}async function Uc(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=T(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Kn().encode({}),programAddress:r})}function Bb(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=T(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Kn().encode({}),programAddress:r})}function Nb(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:vc().decode(e.data)}}var Lc=new Uint8Array([5]);function Kb(){return fixEncoderSize(getBytesEncoder(),1).encode(Lc)}function qn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",E()],["createUserArgs",getArrayEncoder(An())]]),e=>({...e,discriminator:Lc}))}function kc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["createUserArgs",getArrayDecoder(gn())]])}function jb(){return combineCodec(qn(),kc())}async function Oc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:qn().encode(c),programAddress:r})}function qb(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:qn().encode(c),programAddress:r})}function Jb(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:kc().decode(e.data)}}var wc=new Uint8Array([17]);function t_(){return fixEncoderSize(getBytesEncoder(),1).encode(wc)}function Vc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",G()],["compressedProofArgs",E()],["secp256r1VerifyArgs",getArrayEncoder(J())]]),e=>({...e,discriminator:wc}))}function Hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",z()],["compressedProofArgs",D()],["secp256r1VerifyArgs",getArrayDecoder(Y())]])}function r_(){return combineCodec(Vc(),Hc())}function Fc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Vc().encode(c),programAddress:r})}function n_(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Hc().decode(e.data)}}var Kc=new Uint8Array([2]);function d_(){return fixEncoderSize(getBytesEncoder(),1).encode(Kc)}function jc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:Kc}))}function qc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function u_(){return combineCodec(jc(),qc())}function Jc(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:jc().encode(c),programAddress:r})}function A_(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:qc().decode(e.data)}}var Qc=new Uint8Array([1]);function f_(){return fixEncoderSize(getBytesEncoder(),1).encode(Qc)}function Yn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(ln())]]),e=>({...e,discriminator:Qc}))}function $c(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(fn())]])}function S_(){return combineCodec(Yn(),$c())}async function x_(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Yn().encode(c),programAddress:r})}function ea(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Yn().encode(c),programAddress:r})}function I_(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:$c().decode(e.data)}}var na=new Uint8Array([6]);function R_(){return fixEncoderSize(getBytesEncoder(),1).encode(na)}function sa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Je()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",E()]]),e=>({...e,discriminator:na}))}function oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ye()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",D()]])}function b_(){return combineCodec(sa(),oa())}function ca(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.authority),...i],data:sa().encode(c),programAddress:r})}function __(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:oa().decode(e.data)}}var da=new Uint8Array([7]);function B_(){return fixEncoderSize(getBytesEncoder(),1).encode(da)}function ua(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Je()],["secp256r1VerifyArgs",getOptionEncoder(w())],["delegateTo",getOptionEncoder(Ot())],["oldSettingsMutArgs",getOptionEncoder(G())],["newSettingsMutArgs",getOptionEncoder(G())],["compressedProofArgs",E()]]),e=>({...e,discriminator:da}))}function Aa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ye()],["secp256r1VerifyArgs",getOptionDecoder(V())],["delegateTo",getOptionDecoder(Bt())],["oldSettingsMutArgs",getOptionDecoder(z())],["newSettingsMutArgs",getOptionDecoder(z())],["compressedProofArgs",D()]])}function N_(){return combineCodec(ua(),Aa())}function ga(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...i],data:ua().encode(c),programAddress:r})}function w_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:Aa().decode(e.data)}}var Ta=new Uint8Array([32]);function j_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ta)}function ya(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Mt()],["compressedProofArgs",E()],["settingsCreationArgs",Lt()]]),e=>({...e,discriminator:Ta}))}function la(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Pt()],["compressedProofArgs",D()],["settingsCreationArgs",kt()]])}function q_(){return combineCodec(ya(),la())}function fa(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.authority),...i],data:ya().encode(c),programAddress:r})}function J_(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:la().decode(e.data)}}var Ia=new Uint8Array([31]);function tv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ia)}function Ca(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",qe()],["compressedProofArgs",E()],["userCreationArgs",le()]]),e=>({...e,discriminator:Ia}))}function Ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Z()],["compressedProofArgs",D()],["userCreationArgs",fe()]])}function rv(){return combineCodec(Ca(),Ea())}function Da(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.authority),...i],data:Ca().encode(c),programAddress:r})}function nv(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Ea().decode(e.data)}}var Pa=new Uint8Array([29]);function uv(){return fixEncoderSize(getBytesEncoder(),1).encode(Pa)}function Zn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(J())]]),e=>({...e,discriminator:Pa}))}function ha(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Y())]])}function Av(){return combineCodec(Zn(),ha())}async function gv(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(U(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Zn().encode(c),programAddress:r})}function Ra(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Zn().encode(c),programAddress:r})}function pv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:ha().decode(e.data)}}var va=new Uint8Array([27]);function xv(){return fixEncoderSize(getBytesEncoder(),1).encode(va)}function Ua(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(J())],["settingsMutArgs",G()],["compressedProofArgs",E()]]),e=>({...e,discriminator:va}))}function Wa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function Iv(){return combineCodec(Ua(),Wa())}function La(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Ua().encode(c),programAddress:r})}function Cv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Wa().decode(e.data)}}var Na=new Uint8Array([30]);function bv(){return fixEncoderSize(getBytesEncoder(),1).encode(Na)}function Xn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["sourceCompressedTokenAccount",getOptionEncoder(Vt())],["compressedProofArgs",getOptionEncoder(E())],["secp256r1VerifyArgs",getArrayEncoder(J())]]),e=>({...e,discriminator:Na}))}function wa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["sourceCompressedTokenAccount",getOptionDecoder(Ht())],["compressedProofArgs",getOptionDecoder(D())],["secp256r1VerifyArgs",getArrayDecoder(Y())]])}function _v(){return combineCodec(Xn(),wa())}async function vv(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(U(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(U(t.source.value)),getAddressEncoder().encode(U(t.tokenProgram.value)),getAddressEncoder().encode(U(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(U(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(U(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(U(t.destination.value)),getAddressEncoder().encode(U(t.tokenProgram.value)),getAddressEncoder().encode(U(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(U(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(U(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.splInterfacePda.value||(t.splInterfacePda.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getBytesEncoder().encode(new Uint8Array([112,111,111,108])),getAddressEncoder().encode(U(t.mint.value))]})),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Xn().encode(c),programAddress:r})}function Va(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Xn().encode(c),programAddress:r})}function Uv(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:wa().decode(e.data)}}var Fa=new Uint8Array([28]);function wv(){return fixEncoderSize(getBytesEncoder(),1).encode(Fa)}function Qn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["sourceCompressedTokenAccount",getOptionEncoder(Vt())],["secp256r1VerifyArgs",getArrayEncoder(J())],["settingsMutArgs",G()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Fa}))}function Ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["sourceCompressedTokenAccount",getOptionDecoder(Ht())],["secp256r1VerifyArgs",getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function Vv(){return combineCodec(Qn(),Ga())}async function Hv(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(U(t.source.value)),getAddressEncoder().encode(U(t.tokenProgram.value)),getAddressEncoder().encode(U(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(U(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(U(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(U(t.destination.value)),getAddressEncoder().encode(U(t.tokenProgram.value)),getAddressEncoder().encode(U(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(U(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(U(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.splInterfacePda.value||(t.splInterfacePda.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getBytesEncoder().encode(new Uint8Array([112,111,111,108])),getAddressEncoder().encode(U(t.mint.value))]})),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Qn().encode(c),programAddress:r})}function za(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Qn().encode(c),programAddress:r})}function Fv(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:Ga().decode(e.data)}}var qa=new Uint8Array([13]);function Yv(){return fixEncoderSize(getBytesEncoder(),1).encode(qa)}function Ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(w())]]),e=>({...e,discriminator:qa}))}function Ya(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(V())]])}function Zv(){return combineCodec(Ja(),Ya())}function Za(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ja().encode(c),programAddress:r})}function Xv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ya().decode(e.data)}}var $a=new Uint8Array([23]);function sU(){return fixEncoderSize(getBytesEncoder(),1).encode($a)}function ei(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(w())],["settingsMutArgs",G()],["compressedProofArgs",E()]]),e=>({...e,discriminator:$a}))}function ti(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(V())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function oU(){return combineCodec(ei(),ti())}function ri(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ei().encode(c),programAddress:r})}function cU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ti().decode(e.data)}}var oi=new Uint8Array([10]);function pU(){return fixEncoderSize(getBytesEncoder(),1).encode(oi)}function ci(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Ft()],["secp256r1VerifyArgs",getOptionEncoder(w())]]),e=>({...e,discriminator:oi}))}function ai(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Gt()],["secp256r1VerifyArgs",getOptionDecoder(V())]])}function mU(){return combineCodec(ci(),ai())}function ii(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:ci().encode(c),programAddress:r})}function TU(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:ai().decode(e.data)}}var Ai=new Uint8Array([20]);function CU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ai)}function gi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Ft()],["secp256r1VerifyArgs",getOptionEncoder(w())],["settingsReadonlyArgs",Nt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ai}))}function pi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Gt()],["secp256r1VerifyArgs",getOptionDecoder(V())],["settingsReadonlyArgs",wt()],["compressedProofArgs",D()]])}function EU(){return combineCodec(gi(),pi())}function mi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:gi().encode(c),programAddress:r})}function DU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:pi().decode(e.data)}}var li=new Uint8Array([14]);function vU(){return fixEncoderSize(getBytesEncoder(),1).encode(li)}function fi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(w())]]),e=>({...e,discriminator:li}))}function Si(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(V())]])}function UU(){return combineCodec(fi(),Si())}function xi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:fi().encode(c),programAddress:r})}function WU(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Si().decode(e.data)}}var Ei=new Uint8Array([24]);function VU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ei)}function Di(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(w())],["settingsMutArgs",G()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ei}))}function Mi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(V())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function HU(){return combineCodec(Di(),Mi())}function Pi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Di().encode(c),programAddress:r})}function FU(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Mi().decode(e.data)}}var bi=new Uint8Array([12]);function JU(){return fixEncoderSize(getBytesEncoder(),1).encode(bi)}function _i(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:bi}))}function vi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function YU(){return combineCodec(_i(),vi())}function Ui(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:_i().encode(c),programAddress:r})}function ZU(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:vi().decode(e.data)}}var ki=new Uint8Array([22]);function rW(){return fixEncoderSize(getBytesEncoder(),1).encode(ki)}function Oi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:ki}))}function Bi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function nW(){return combineCodec(Oi(),Bi())}function Ni(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:Oi().encode(c),programAddress:r})}function sW(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:Bi().decode(e.data)}}var Hi=new Uint8Array([11]);function AW(){return fixEncoderSize(getBytesEncoder(),1).encode(Hi)}function Fi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(w())]]),e=>({...e,discriminator:Hi}))}function Gi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(V())]])}function gW(){return combineCodec(Fi(),Gi())}function zi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Fi().encode(c),programAddress:r})}function pW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Gi().decode(e.data)}}var qi=new Uint8Array([21]);function xW(){return fixEncoderSize(getBytesEncoder(),1).encode(qi)}function Ji(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(w())],["settingsReadonlyArgs",Nt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:qi}))}function Yi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(V())],["settingsReadonlyArgs",wt()],["compressedProofArgs",D()]])}function IW(){return combineCodec(Ji(),Yi())}function Zi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ji().encode(c),programAddress:r})}function CW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Yi().decode(e.data)}}var $i=new Uint8Array([15]);function RW(){return fixEncoderSize(getBytesEncoder(),1).encode($i)}function ed(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:$i}))}function td(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function bW(){return combineCodec(ed(),td())}function rd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=m({}),i=T(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:ed().encode({}),programAddress:r})}function _W(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:td().decode(e.data)}}var od=new Uint8Array([25]);function OW(){return fixEncoderSize(getBytesEncoder(),1).encode(od)}function cd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:od}))}function ad(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function BW(){return combineCodec(cd(),ad())}function id(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:cd().encode(c),programAddress:r})}function NW(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:ad().decode(e.data)}}var Ad=new Uint8Array([16]);function KW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ad)}function gd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",zt()],["secp256r1VerifyArgs",getArrayEncoder(J())]]),e=>({...e,discriminator:Ad}))}function pd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Kt()],["secp256r1VerifyArgs",getArrayDecoder(Y())]])}function jW(){return combineCodec(gd(),pd())}function md(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:gd().encode(c),programAddress:r})}function qW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:pd().decode(e.data)}}var ld=new Uint8Array([26]);function eL(){return fixEncoderSize(getBytesEncoder(),1).encode(ld)}function fd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",zt()],["secp256r1VerifyArgs",getArrayEncoder(J())],["settingsMutArgs",G()],["compressedProofArgs",E()]]),e=>({...e,discriminator:ld}))}function Sd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Kt()],["secp256r1VerifyArgs",getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function tL(){return combineCodec(fd(),Sd())}function xd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:fd().encode(c),programAddress:r})}function rL(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Sd().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",Kx=(c=>(c[c.DomainConfig=0]="DomainConfig",c[c.GlobalCounter=1]="GlobalCounter",c[c.Settings=2]="Settings",c[c.TransactionBuffer=3]="TransactionBuffer",c[c.WhitelistedAddressTree=4]="WhitelistedAddressTree",c))(Kx||{});function VL(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([201,232,212,229,59,241,106,197])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([42,206,176,58,175,129,130,233])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([223,179,163,190,177,224,67,173])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([90,36,35,219,93,225,110,96])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([105,23,173,2,197,255,80,87])),0))return 4;throw new Error("The provided account could not be identified as a multiWallet account.")}var jx=(y=>(y[y.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",y[y.ChangeConfig=1]="ChangeConfig",y[y.ChangeConfigCompressed=2]="ChangeConfigCompressed",y[y.CreateCompressedWallet=3]="CreateCompressedWallet",y[y.CreateDomainConfig=4]="CreateDomainConfig",y[y.CreateDomainUserAccount=5]="CreateDomainUserAccount",y[y.CreateGlobalCounter=6]="CreateGlobalCounter",y[y.CreateUserAccounts=7]="CreateUserAccounts",y[y.DecompressSettingsAccount=8]="DecompressSettingsAccount",y[y.DisableDomainConfig=9]="DisableDomainConfig",y[y.EditDomainConfig=10]="EditDomainConfig",y[y.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",y[y.EditUserDelegate=12]="EditUserDelegate",y[y.MigrateCompressedSettings=13]="MigrateCompressedSettings",y[y.MigrateCompressedUsers=14]="MigrateCompressedUsers",y[y.NativeTransferIntent=15]="NativeTransferIntent",y[y.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",y[y.TokenTransferIntent=17]="TokenTransferIntent",y[y.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",y[y.TransactionBufferClose=19]="TransactionBufferClose",y[y.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",y[y.TransactionBufferCreate=21]="TransactionBufferCreate",y[y.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",y[y.TransactionBufferExecute=23]="TransactionBufferExecute",y[y.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",y[y.TransactionBufferExtend=25]="TransactionBufferExtend",y[y.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",y[y.TransactionBufferVote=27]="TransactionBufferVote",y[y.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",y[y.TransactionExecute=29]="TransactionExecute",y[y.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",y[y.TransactionExecuteSync=31]="TransactionExecuteSync",y[y.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",y))(jx||{});function HL(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 4;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 5;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 6;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 7;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 8;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 9;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 10;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 11;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 12;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([32])),0))return 13;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([31])),0))return 14;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 15;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 16;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 17;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 18;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 19;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 20;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 21;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 22;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 23;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 24;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 25;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 26;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 27;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 28;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 29;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 30;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 31;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 32;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var Jx=6e3,Yx=6001,Zx=6002,Xx=6003,Qx=6004,$x=6005,eI=6006,tI=6007,rI=6008,nI=6009,sI=6010,oI=6011,cI=6012,aI=6013,iI=6014,dI=6015,uI=6016,AI=6017,gI=6018,pI=6019,mI=6020,TI=6021,yI=6022,lI=6023,fI=6024,SI=6025,xI=6026,II=6027,CI=6028,EI=6029,DI=6030,MI=6031,PI=6032,hI=6033,RI=6034,bI=6035,_I=6036,vI=6037,UI=6038,WI=6039,LI=6040,kI=6041,OI=6042,BI=6043,NI=6044,wI=6045,VI=6046,HI=6047,FI=6048,GI=6049,zI=6050,KI=6051,jI=6052,qI=6053,JI=6054,YI=6055,ZI=6056,XI=6057,QI=6058,$I=6059,eC=6060,tC=6061,rC=6062,nC=6063,sC=6064,oC=6065,cC=6066,aC=6067,iC=6068,dC=6069,uC=6070,AC=6071,gC=6072,pC=6073,mC=6074,TC=6075,yC=6076,lC=6077,fC=6078,SC=6079,xC=6080,IC=6081,CC=6082,Id;process.env.NODE_ENV!=="production"&&(Id={[DI]:"This member is already delegated to another wallet.",[tI]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[mC]:"Clock sysvar access failed. This may indicate a system error.",[zI]:"The domain configuration account is disabled. Please contact support or try again later.",[KI]:"Missing domain configuration account.",[gC]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[CC]:"Duplicate address tree detected. This address tree is already in the whitelist.",[sI]:"Duplicate public keys detected among members. Each member must have a unique key.",[nI]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[mI]:"No members provided. A multisig wallet must contain at least one member.",[XI]:"Slot numbers list is empty. At least one slot number is required for validation.",[gI]:"Expected a User with Administrator role for this instruction.",[rI]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[uI]:"Expected a User with Transaction Manager role for this instruction.",[WI]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[LI]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[kI]:"Declared buffer size does not match the actual serialized size.",[ZI]:"Failed to compute hash. This may indicate a system error.",[hI]:"Not enough members with vote permission to meet the approval threshold.",[MI]:"At least one signer with execute permission is required to proceed.",[PI]:"At least one signer with initiate permission is required to perform this action.",[SI]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[AC]:"Invalid account index in transaction message. The account index is out of bounds.",[JI]:"Address Tree supplied is not part of the whitelisted address trees.",[pI]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[II]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[UI]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[QI]:"Member key conversion failed. The provided key format is invalid.",[RI]:"Only delegated members are allowed for this transaction.",[fI]:"Unexpected number of accounts provided for this instruction.",[aI]:"User with Permanent Member role must have a delegated wallet.",[Yx]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[Qx]:"The extracted public key has an invalid length or encoding.",[Jx]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[Xx]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[GI]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[HI]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[yI]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[iC]:"Invalid source type for token transfer. The source account type is not supported.",[AI]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[dI]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[lI]:"Malformed transaction message: structure or formatting does not match the expected layout.",[xI]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[yC]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[aC]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[$x]:"The extracted WebAuthn signed message payload is malformed.",[wI]:"An input string exceeds the maximum allowed character length.",[jI]:"This member is not registered under the provided domain configuration.",[tC]:"Member not found in settings. Cannot remove a member that does not exist.",[uC]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[CI]:"A required account is missing from the instruction context.",[$I]:"Compressed proof arguments are missing. Required for compressed account operations.",[sC]:"Missing compressed token account. Required for token transfer operations.",[lC]:"Missing destination token account. Required for token transfer operations.",[cC]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[eC]:"Light CPI accounts are missing. Required for compressed account operations.",[EI]:"User mutation arguments are required when performing add or remove delegate operations.",[xC]:"Missing new authority account. Required for domain configuration updates.",[SC]:"Missing settings account. Required for delegate operations on compressed wallets.",[YI]:"Compressed settings data is missing. The settings account must be initialized with data.",[fC]:"Missing source token account. Required for token transfer operations.",[oC]:"Missing SPL interface PDA. Required for token transfer operations.",[VI]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[pC]:"User account address is missing. Required for secp256r1 signature verification.",[IC]:"Missing whitelisted address trees account. Required for domain configuration updates.",[_I]:"No valid signer found in this transaction.",[cI]:"Only one permanent member is allowed per wallet.",[iI]:"Only one transaction manager is allowed per wallet.",[qI]:"The given origin index is not in the whitelisted origins.",[nC]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[oI]:"Permanent members cannot be removed from a wallet.",[NI]:"Writable CPI calls to protected accounts are not permitted.",[eI]:"The rpIdHash extracted from the signed message does not match the expected value.",[rC]:"Settings key mismatch. The provided settings key does not match the expected value.",[Zx]:"The signature index provided is out of bounds for the secp256r1 instruction.",[FI]:"The specified slot number was not found in the provided slot history.",[dC]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[TI]:"Too many members: a maximum of 4 members are supported.",[OI]:"This transaction has expired. It must be executed within 3 minutes of approval.",[BI]:"This transaction has not yet reached the required approval threshold.",[vI]:"Only the transaction creator or rent payer may close this transaction buffer.",[TC]:"Unauthorized: Only the admin account is allowed to perform this action.",[bI]:"Member is not part of the expected signers for this transaction."});function qL(e){return process.env.NODE_ENV!=="production"?Id[e]:"Error message not available in production bundles."}function JL(e,n,r){return isProgramError(e,n,A,r)}async function ok({admin:e,addressTree:n}){return Jo({payer:e,addressTree:n,remainingAccounts:[]})}var Yt={Ed25519:1,Secp256r1:2};var Cd=S.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),Ak=S.object({transactionActionType:Cd,transactionAddress:S.string(),transactionMessageBytes:S.array(S.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),Ed=S.object({transactionActionType:Cd,transactionAddress:S.string(),transactionMessageBytes:S.string()}).strict(),Dd=S.object({authResponse:S.custom(),nonce:S.string(),clientSignature:S.object({clientOrigin:S.string(),signature:S.string()}).strict(),deviceSignature:S.object({publicKey:S.string(),signature:S.string()}).strict(),authProviderSignature:S.object({publicKey:S.string(),signature:S.string()}).strict().optional()}).strict(),Md=S.object({signer:S.string(),userAddressTreeIndex:S.number().optional(),additionalInfo:S.looseObject({})}).strict(),EC=S.object({transactionPayload:Ed,slotHash:S.string(),slotNumber:S.string(),originIndex:S.number(),crossOrigin:S.boolean()}).strict(),gk=S.object({phase:S.literal("start"),redirectOrigin:S.url(),signer:S.string().optional(),data:S.object({type:S.literal("message"),payload:S.string().optional()}).strict()}).strict(),pk=S.object({phase:S.literal("start"),redirectOrigin:S.url(),signer:S.string().optional(),data:S.object({type:S.literal("transaction"),payload:Ed}).strict()}).strict(),mk=S.object({phase:S.literal("complete"),data:S.object({type:S.literal("message"),payload:Md.extend(Dd.shape).extend({id:S.string().optional(),message:S.string(),clientSignature:S.object({clientOrigin:S.string()}).strict()})}).strict()}).strict(),Tk=S.object({phase:S.literal("complete"),data:S.object({type:S.literal("transaction"),payload:Md.extend(Dd.shape).extend(EC.shape).extend({clientSignature:S.object({clientOrigin:S.string()}).strict()})}).strict()}).strict();var be={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Le=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(be).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var ts=33,ke=class{_bn;constructor(n){typeof n=="string"?this._bn=new Uint8Array(getBase58Encoder().encode(n)):this._bn=new Uint8Array(n),this.validateKeyLength(this._bn);}validateKeyLength(n){if(n.length!==ts)throw new Error(`Invalid public key length, expected ${ts} bytes but got ${n.length}`)}toBase58(){return getBase58Decoder().decode(this.toBytes())}toTruncatedBuffer(){let n=this.toBuffer();return n.subarray(1,n.length)}toBuffer(){if(!this._bn)throw new Error("Invalid public key input");let n=this._bn;if(n.byteLength===ts)return n;throw new Error("Invalid public key input")}toBytes(){let n=this.toBuffer();return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}toString(){return this.toBase58()}toJSON(){return this.toBase58()}},M=class extends ke{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(n,r){super(n),this.verifyArgs=r.verifyArgs,this.domainConfig=r.domainConfig,this.authData=r.authData,this.signature=r.signature,this.originIndex=r.originIndex,this.crossOrigin=r.crossOrigin,this.clientAndDeviceHash=r.clientAndDeviceHash,this.authResponse=r.authResponse;}};function PC(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function hC(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var hd=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(PC())],["addressTableLookups",getArrayCodec(hC())]]);function Rd(e){return hd.encode({numSigners:e.header.numSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,accountKeys:e.staticAccounts,instructions:e.instructions.map(r=>({programAddressIndex:r.programAddressIndex,accountIndices:r.accountIndices??[],data:Array.from(r.data??[])})),addressTableLookups:e.version!=="legacy"?e.addressTableLookups?.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes,writableIndexes:r.writableIndexes}))??[]:[]})}function bd(e){let n=hd.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}function _d(e,n,r,s){if(e<n||e>r)throw new F(`${s} must be between ${n} and ${r} (inclusive), got ${e}`)}function vd(e,n){if(e<0)throw new F(`${n} must be non-negative, got ${e}`)}function Zt(e,n){if(e.length===0)throw new F(`${n} cannot be empty`)}function Ud(e,n){if(e.trim().length===0)throw new F(`${n} cannot be empty`)}featureFlags.version=VERSION.V2;var Q={};function Wd(){if(!Q.solanaRpcEndpoint)throw new We("RPC endpoint");return Q.solanaRpcEndpoint}function ot(){if(!Q.lightProtocolRpc)throw new We("Light Protocol RPC");return Q.lightProtocolRpc}function ne(){if(!Q.solanaRpc)throw new We("Solana RPC");return Q.solanaRpc}function Ld(){if(!Q.sendAndConfirm)throw new We("Send and confirm transaction function");return Q.sendAndConfirm}function kd(){if(!Q.computeEstimate)throw new We("Compute budget estimate function");return Q.computeEstimate}function ns(){return Q.jitoTipsConfig?Q.jitoTipsConfig:{blockEngineUrl:hs,getJitoTipsUrl:Rs,priority:bs}}function Hk({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){Q.solanaRpcEndpoint=e,Q.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});Q.solanaRpc=t,Q.sendAndConfirm=c,Q.computeEstimate=estimateComputeUnitLimitFactory({rpc:t}),Q.jitoTipsConfig=s??null;}function Od(e){return typeof e=="string"?e:e.toString()}function Bd(e,n){return e.toString()+(n?n.toString():"")}function Nd(e){return e.toString()}async function _r(e,n,r){let s=e?.get(n);if(s)return s;let t=await r();return t&&e&&e.set(n,t),t}var WC={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true};function LC(e,n,r=2,s=3e4){let t=n*Math.pow(r,e-1);return Math.min(t,s)}function kC(e){return new Promise(n=>setTimeout(n,e))}async function Xt(e,n){let{maxRetries:r,initialDelayMs:s,backoffBase:t=2,maxDelayMs:c=3e4,shouldRetry:a}={...WC,...n},i;for(let o=1;o<=r;o++)try{return await e()}catch(d){if(i=d,a&&!a(d,o))throw d;if(o>=r)break;let u=LC(o,s,t,c);await kC(u);}throw new ir(e.name||"retryWithBackoff",r,i)}async function ct(e,n){let r=(s,t)=>s instanceof Response?s.status===429?n.retryOnRateLimit??true:s.status>=400&&s.status<500?false:s.status>=500:s instanceof TypeError||s instanceof Error;return Xt(e,{...n,shouldRetry:n.shouldRetry??r})}var W=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:r?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(A.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await ot().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:a,queuePubkeyIndex:i,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:a,addressQueuePubkeyIndex:i});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function vr(e,n){let r=Od(e);return _r(n,r,()=>ot().getCompressedAccount(e))}async function Hd(e,n,r){let s=Bd(e,n?.mint);return _r(r,s,()=>ot().getCompressedTokenAccountsByOwner(e,n))}async function $t(e,n){let r=Nd(e);return _r(n,r,()=>ne().getAccountInfo(e,{encoding:"base64"}).send())}async function ge(e,n){let s=(await Promise.all(e.map(async t=>vr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new ee("Compressed account",`Expected ${e.length} accounts but found ${s.length}`);return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function v(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function de(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:s[u],address:d.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:a[u],outputStateTreeIndex:i,address:d.address,type:d.type}))}function ce(e,n,r,s,t,c,a){let i=[];for(let u=0;u<n.length;u++)i.push({treeInfo:n[u],rootIndex:s[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new F("Unable to parse state tree data");return c.map((u,g)=>({data:a.decode(u.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Ee(e,n,r,s,t){let c=null,a=null,i=null,o=new W;if(e){await o.addSystemAccounts();let{address:d}=await se(n,r),u=(await ge([{address:d,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:i=await B([u],[]);let g=o.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!g)throw new F("Unable to parse state tree data");c={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0]},data:q().decode(u.data?.data)},a={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:q().decode(u.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:o,settingsMutArgs:a}}async function B(e,n,r=3,s=500){return Xt(()=>ot().getValidityProofV0(e,n),{maxRetries:r,initialDelayMs:s})}async function De(){return (await Ur()).length-1}var ss;async function Ur(){if(!ss){let{data:e}=await Fo(ne(),await Fd());ss=e.whitelistedAddressTrees;}return ss}async function Wr(e,n,r){let s=await VC(e,n,r);if(!s)throw new ee("User account");return s}async function VC(e,n,r){let{address:s}=await O(e,n),t=await vr(s,r);return t?.data?.data?Z().decode(t.data.data):null}async function os(e,n,r){let s=await HC(e,n,r);if(!s)throw new ee("Settings account");return s}async function HC(e,n,r){try{let{address:s}=await se(e,n),t=await vr(s,r);if(!t?.data?.data)throw new ee("Compressed settings account");let c=q().decode(t.data.data);if(c.data.__option==="None")throw new ee("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let s=await Rn(ne(),await ae(e));return s.exists?{...s.data,isCompressed:false}:null}}async function cs(e){vd(e,"index");let n=await Ur();if(e>=n.length)throw new F(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function fO(e){let r=(await Ur()).findIndex(s=>s.toString()===e);if(r===-1)throw new ee("Address tree",`Address ${e} not found in whitelist`);return r}async function se(e,n=0){let r=await cs(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("multi_wallet")),new Uint8Array(getU128Encoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(A)).toString(),"base58"),addressTree:new PublicKey(r)}}async function O(e,n=0){let r=await cs(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),e instanceof ke?e.toTruncatedBuffer():new Uint8Array(getAddressEncoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(A.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function it({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(new Uint8Array(getUtf8Encoder().encode(n)));else throw new F("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function qd(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function Fd(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Jd(e,n,r){_d(r,0,255,"buffer_index");let[s]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof ke?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function _e(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function ae(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function _O(e){let n=await ae(e);return await _e(n)}async function vO(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function er(e,n){if(!e.ok){await e.text().catch(()=>e.statusText);throw new Ce(`Request failed: ${e.statusText} (${e.status})`,e.status,n)}return e}async function tr(e){try{return await e.json()}catch(n){throw new Ce(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function GO(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+kr(n.get(-2))),y:BigInt("0x"+kr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function zO(e){let r=p256.Point.fromBytes(new Uint8Array(getBase58Encoder().encode(e))).toBytes(false),s=new Map;return s.set(1,2),s.set(3,-7),s.set(-1,1),s.set(-2,r.slice(1,33)),s.set(-3,r.slice(33,65)),new Uint8Array(encodeCBOR(s))}async function KO(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Be(n)),c=JSON.parse(new TextDecoder().decode(Be(r))),a=Xd(c),i=$d(new Uint8Array(Be(s))),o=await it({rpIdHash:t.subarray(0,32)});return new M(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Be(r)),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:as(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function as(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function JO(e){return sha256(new Uint8Array(getUtf8Encoder().encode(JSON.stringify(e))))}function YO(e){return is(e.data.payload.authResponse)}function ZO(e,n,r,s){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...as(n,r,s)]))}async function XO(e,n,r,s,t,c){let a;if(!t||!c){let o=(await ne().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!o)throw new ee("Slot sysvar","Unable to fetch slot sysvar data");let d=getBase64Encoder().encode(o[0]);c=getU64Decoder().decode(d.subarray(0,8)).toString(),a=d.subarray(8,40),t=getBase58Decoder().decode(a);}else a=new Uint8Array(getBase58Encoder().encode(t));let i=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...sha256(typeof e.transactionMessageBytes=="string"?new Uint8Array(Be(e.transactionMessageBytes)):e.transactionMessageBytes),...a,...as(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:i}}function is(e){return sha256(Br(e))}function QO(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Be(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),a=new Uint8Array(c);for(let i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return c}async function $O(e,n){let{data:r}=await Bs(ne(),e),t=Qd(new Uint8Array(r.origins),r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Error("Origin not found in domain config");return t}function kr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function ZC(e){let n=new Uint8Array(e.length/2);for(let r=0;r<n.length;r++)n[r]=parseInt(e.slice(r*2,r*2+2),16);return n}function Xd(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let s=JSON.stringify(r);return new TextEncoder().encode(s.slice(1,-1))}function Qd(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let a=e[s]|e[s+1]<<8;if(s+=2,s+a>e.length)throw new Error("MaxLengthExceeded");let i=e.slice(s,s+a),o=t.decode(i);r.push(o),s+=a;}return r}function $d(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let C=n&127;r+=C;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let a=e[r+1],i=r+2,o=e.slice(i,i+a),d=c[0]===0&&c.length>32?c.slice(1):c,u=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let p=p256.Point.CURVE().n>>1n,l=BigInt("0x"+kr(u)),_=(l>p?p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),I=ZC(_);return new Uint8Array([...g,...I])}function Br(e){return new Uint8Array([...new Uint8Array(Be(e.response.authenticatorData)),...sha256(new Uint8Array(Be(e.response.clientDataJSON)))])}async function ds(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await ne().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(s.instructions,c),c=>setTransactionMessageFeePayerSigner(s.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let a=Math.ceil((s.unitsConsumed??0)*1.1);return a>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:a})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function nu(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===AccountRole.WRITABLE||c.role===AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,a)=>c-a);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function su(e,n){Zt(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new F(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await ct(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})}),{maxRetries:3,initialDelayMs:500});await er(r,n);let s=await tr(r);if(!s.result||s.error)throw new Ae(`Unable to simulate bundle: ${JSON.stringify(s.error??s.result)}`);if(typeof s.result.value.summary!="string"&&s.result.value.summary.failed){let{TransactionFailure:t}=s.result.value.summary.failed.error,[,c]=t;throw new Ae(`Simulation failed: ${c}`)}return s.result.value.transactionResults.map(t=>t.unitsConsumed)}function K(e,n=0){let r=e instanceof M?e:void 0,s=r?.verifyArgs&&n!==-1?some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,a=r?.authData&&r.verifyArgs.clientDataJson?Br(r.authResponse):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function ut(e){if(e instanceof ke)return {keyType:Yt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Yt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function ru(e){return e instanceof M?e.toString():e.address.toString()}function ye(e){let n=new Set,r=[];for(let t of e)n.has(ru(t))||(r.push(t),n.add(ru(t)));let s=r.filter(t=>t instanceof M);if(s.length>1)throw new F(`More than 1 Secp256r1 signers in an instruction is not supported (found ${s.length})`);return r}function ou({payer:e,tipAmount:n}){let r=jr[Math.floor(Math.random()*jr.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}async function MB(e){Zt(e,"bundle");let n=await ds(e,true),r=await su(n.map(getBase64EncodedWireTransaction),Wd()),s=await ds(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await pE(s.map(getBase64EncodedWireTransaction))}async function pE(e,n=3,r=500,s=ns()){Zt(e,"serializedTransactions");let{blockEngineUrl:t}=s,c=`${t}/bundles`,a=await ct(()=>fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})}),{maxRetries:n,initialDelayMs:r});await er(a,c);let i=await tr(a);if(i.error)throw new Ae(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new Ae("No bundle ID returned from Jito");return i.result}async function PB(e,n=30,r=3e3,s=ns()){Ud(e,"bundleId");let{blockEngineUrl:t}=s,c=`${t}/getBundleStatuses`;return Xt(async()=>{let a=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await er(a,c);let i=await tr(a);if(i.error)throw new Ae(`Error getting bundle status: ${JSON.stringify(i.error,null,2)}`,e);if(!i.result?.value?.length)throw new Ae("Bundle not yet confirmed",e);let o=i.result.value[0];if(o.confirmation_status==="confirmed"||o.confirmation_status==="finalized"){let d=o.transactions[o.transactions.length-1];if(!d)throw new Ae("No transactions in confirmed bundle",e);return d}throw new Ae(`Bundle status: ${o.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:a=>a instanceof Ae||a instanceof Ce})}async function WB({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await ne().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(e,c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([kd()(c),nu(ne(),c.instructions.flatMap(d=>d.accounts??[]))]),o=Math.ceil(a*1.1);return prependTransactionMessageInstructions([...o>2e5?[getSetComputeUnitLimitInstruction({units:o})]:[],...i>0?[getSetComputeUnitPriceInstruction({microLamports:i})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await Ld()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function YB(e,n){if(n.threshold>1)throw new F("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(o=>iu(o.pubkey)===e);if(!r)throw new ee("Member",`Signer ${e} not found in settings`);let{permissions:s}=r;if(!s)throw new ee("Permissions","No permissions found for the current member");let t=Le.has(s,be.InitiateTransaction),c=Le.has(s,be.VoteTransaction),a=Le.has(s,be.ExecuteTransaction);if(t&&c&&a)return {};if(!c||!a)throw new dr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,a?"ExecuteTransaction":void 0].filter(Boolean));let i=n.members.find(o=>o.role===2);if(!i)throw new ee("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(iu(i.pubkey)),userAddressTreeIndex:i.userAddressTreeIndex}}async function ZB({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await Wr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new ee("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return vE(n,c.transactionManagerUrl.value,e,s)}function vE(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=getBase64Decoder().decode(s)),r&&(c.authResponses=r);let a=await ct(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)}),{maxRetries:3,initialDelayMs:500});if(!a.ok)throw new Ce(`Transaction manager request failed: ${a.statusText}`,a.status,n);let i=await a.json();if("error"in i)throw new Ce(`Transaction manager error: ${i.error}`,a.status,n);return i.signatures.map(o=>({[e]:getBase58Encoder().encode(o)}))}}}function iu(e){return e.keyType===Yt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function XB(e){let n=e.map(c=>Ge().encode(c)),r=4+n.reduce((c,a)=>c+a.length,0),s=new Uint8Array(r),t=0;s.set(getU32Encoder().encode(e.length),t),t+=4;for(let c of n)s.set(c,t),t+=c.length;return s}function QB(e){let n=0,[r,s]=getU32Decoder().read(e,n);n=s;let t=new Array(r);for(let c=0;c<r;c++){let a=ze().read(e,n);t[c]=a[0],n=a[1];}if(n!==e.length)throw new F(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function mN({payer:e,rpId:n,origins:r,authority:s}){let t=await it({rpId:n}),c=new W;await c.addSystemAccounts();let a=await De(),{address:i,addressTree:o}=await O(s.address,a),d=[{address:i,tree:o,queue:o,type:"User"}],u=await B([],d),g=(await de(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),f=v(u,l);return await Dc({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:f,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function DN({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new W;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await se(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await O(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await ge(a,t):[],o=await De(),{address:d,addressTree:u}=await O(r.member,o),g=[{address:d,type:"User",tree:u,queue:u}],p=await B(i,g),l=null,f=null,_=i.filter(L=>L.type==="Settings"),I=i.filter(L=>L.type==="User");_.length&&(l=ce(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),_,q())[0]),I.length&&(f=ce(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),I,Z())[0]);let C=await de(c,p.treeInfos.slice(i.length),p.roots.slice(i.length),p.rootIndices.slice(i.length),g),{remainingAccounts:P,systemOffset:x}=c.toAccountMetas(),k=v(p,x);return await Rc({payer:n,authority:e,compressedProofArgs:k,member:Wt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:l?some({settingsMutArgs:l,transactionManager:f?some(f):none()}):none(),userAccountCreationArgs:C[0],domainConfig:s,remainingAccounts:P})}async function RN({payer:e}){let n=await qd();return Uc({payer:e,globalCounter:n})}async function UN({admin:e,rpId:n,disable:r}){let s=await it({rpId:n});return Jc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function wN({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new W;await t.addSystemAccounts();let{address:c,addressTree:a}=await se(r,s),i=[{address:c,tree:a,queue:a,type:"Settings"}],o=await B([],i),d=(await de(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return fa({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function jN({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new W;await t.addSystemAccounts();let{address:c,addressTree:a}=await O(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await B([],i),d=(await de(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Da({compressedProofArgs:p,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}function WE(e,n,r,s){let t=LE(e,n),c=kE(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function LE(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,a=s-t,i=r-s-c;return n>=r?false:n<a?true:n>=s?n-s<i:false}function kE(e,n){return n<e.header.numSignerAccounts}async function Nr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=bd(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(i=>i.lookupTableAddress),ne()):{}),a=[];a.push(...t.addressTableLookups?.map(i=>({role:AccountRole.READONLY,address:i.lookupTableAddress}))??[]);for(let[i,o]of t.staticAccounts.entries())a.push({address:o,role:WE(t,i,o,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let o=c[i.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let d of i.writableIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:u,role:AccountRole.WRITABLE});}for(let d of i.readonlyIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:u,role:AccountRole.READONLY});}}for(let i of s?.filter(o=>o.address!==e)??[]){let o=a.findIndex(d=>d.address===i.address);o===-1?a.push({address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}):a[o].role===AccountRole.READONLY||a[o].role===AccountRole.READONLY_SIGNER?a[o]={address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}:(a[o].role===AccountRole.WRITABLE||a[o].role===AccountRole.WRITABLE_SIGNER)&&(a[o]={address:i.address,role:AccountRole.WRITABLE_SIGNER,signer:i});}return {accountMetas:a,addressLookupTableAccounts:c,transactionMessage:t}}var At=33,gt=64,ps=14,FE=2,GE=address("Secp256r1SigVerify1111111111111111111111111");function zE(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function KE(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function mu(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let s=getU8Decoder().decode(e,n);n+=1;let t=[],c=KE();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=ps;let a=[];for(let i=0;i<r;i++){let o=fixDecoderSize(getBytesDecoder(),At).decode(e,n);n+=At;let d=fixDecoderSize(getBytesDecoder(),gt).decode(e,n);n+=gt;let u=t[i].messageDataSize,g=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,a.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function Tu(){return createEncoder({getSizeFromValue:e=>{let n=ps*e.offsets.length,r=e.payload.reduce((s,t)=>s+At+gt+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=getU8Encoder().write(e.numSignatures,n,r),r=getU8Encoder().write(e.padding,n,r);let s=zE();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),At).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),gt).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function aw(){return combineCodec(Tu(),mu())}function N(e,n){let r=e.length,s=FE+r*ps,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,g=u+At,p=g+gt;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),s+=At+gt+d.length;}let c=n?.programAddress??GE,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:Tu().encode(a)}}function iw(e){return {programAddress:e.programAddress,accounts:{},data:mu().decode(e.data)}}async function yu({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let d=await _e(e),{accountMetas:u,addressLookupTableAccounts:g}=await Nr({transactionMessageBytes:r,walletAddress:d,additionalSigners:a,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(N(c)),p.push(o?id({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):rd({transactionBuffer:n,payer:s.address,settings:e})),i&&p.push(ou({payer:s,tipAmount:i})),{instructions:p,addressLookupTableAccounts:g}}async function lu({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:d}){let u=ye(s),g=await ae(e),p=await _e(g),[{accountMetas:l,addressLookupTableAccounts:f,transactionMessage:_},{settingsMutArgs:I,proof:C,packedAccounts:P}]=await Promise.all([Nr({transactionMessageBytes:r,walletAddress:p,additionalSigners:u.filter(X=>!(X instanceof M)),addressesByLookupTableAddress:c}),Ee(i,e,n,o,d)]);P.addPreAccounts(l);let x=u.filter(X=>X instanceof M),{secp256r1VerifyArgs:k}=qE(x,a,P),{remainingAccounts:L,systemOffset:j}=P.toAccountMetas();return {instructions:JE({secp256r1VerifyInput:a,transactionMessage:_,accountMetas:l,compressed:i,payer:t,settingsMutArgs:I,proof:C,systemOffset:j,secp256r1VerifyArgs:k,settings:g,remainingAccounts:L}),addressLookupTableAccounts:f}}function qE(e,n,r){let s=[];for(let t of e){let c=n.length,{domainConfig:a,verifyArgs:i,signature:o,publicKey:d,message:u}=K(t,c);u&&o&&d&&n.push({message:u,signature:o,publicKey:d}),a&&(r.addPreAccounts([{address:a,role:AccountRole.READONLY}]),i.__option==="Some"&&s.push({domainConfigKey:a,verifyArgs:i.value}));}return {secp256r1VerifyArgs:s}}function JE({secp256r1VerifyInput:e,transactionMessage:n,accountMetas:r,compressed:s,payer:t,settingsMutArgs:c,proof:a,systemOffset:i,secp256r1VerifyArgs:o,settings:d,remainingAccounts:u}){let g=[];e.length>0&&g.push(N(e));let p=YE(n,r);if(s){if(!t||!c)throw new Error("Payer not found or proof args is missing.");let l=v(a,i);g.push(xd({secp256r1VerifyArgs:o,transactionMessage:p,settingsMutArgs:c,compressedProofArgs:l,payer:t,remainingAccounts:u}));}else g.push(md({secp256r1VerifyArgs:o,settings:d,transactionMessage:p,remainingAccounts:u}));return g}function YE(e,n){if(e.version==="legacy")throw new Error("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:new Uint8Array(r.data??[])})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(s=>s.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function Uw({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=ye(s),d=await ae(e),u=await _e(d),{packedAccounts:g,proof:p,settingsMutArgs:l}=await Ee(i,e,n,false,t),f=[],_=[];for(let x of o)if(x instanceof M){let k=f.length,{domainConfig:L,verifyArgs:j,signature:$,publicKey:X,message:Me}=K(x,k);Me&&$&&X&&f.push({message:Me,signature:$,publicKey:X}),L&&(g.addPreAccounts([{address:L,role:AccountRole.READONLY}]),j.__option==="Some"&&_.push({domainConfigKey:L,verifyArgs:j.value}));}else g.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:I,systemOffset:C}=g.toAccountMetas(),P=[];if(f.length>0&&P.push(N(f)),i){if(!a||!l)throw new Error("Payer not found or proof args is missing.");let x=v(p,C);P.push(La({amount:c,settingsMutArgs:l,compressedProofArgs:x,payer:a,secp256r1VerifyArgs:_,source:u,destination:r,remainingAccounts:I}));}else P.push(Ra({amount:c,secp256r1VerifyArgs:_,source:u,destination:r,settings:d,remainingAccounts:I}));return P}var Cu=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),Eu=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti");async function Kw({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,compressed:d=false}){let u=ye(t),g=await ae(e),p=await _e(g),[l,[f],_,[I],[C]]=await Promise.all([getAssociatedTokenAccountAddress(s,p,o),getProgramDerivedAddress({seeds:[getAddressEncoder().encode(p),getAddressEncoder().encode(address(CTOKEN_PROGRAM_ID.toString())),getAddressEncoder().encode(s)],programAddress:address(CTOKEN_PROGRAM_ID.toString())}),getAssociatedTokenAccountAddress(s,r,o),getProgramDerivedAddress({seeds:[getAddressEncoder().encode(r),getAddressEncoder().encode(address(CTOKEN_PROGRAM_ID.toString())),getAddressEncoder().encode(s)],programAddress:address(CTOKEN_PROGRAM_ID.toString())}),getProgramDerivedAddress({seeds:[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(s)],programAddress:address(CTOKEN_PROGRAM_ID.toString())})]),[P,x,k]=await Promise.all([$t(_,c),$t(l,c),nD(d,e,n,c)]),L=!!P.value,j=!!x.value,$=j?getTokenDecoder().decode(getBase64Encoder().encode(x.value.data[0])).amount:BigInt(0),X=BigInt(0),Me=true;if($<BigInt(a)){let pe=await $t(f,c);Me=!!pe.value,X=BigInt(Me?oD(new Uint8Array(getBase64Encoder().encode(pe.value.data[0])))?.amount??0:0);}let xe=L?_:void 0,Ne=L?void 0:I,mt=j&&($+X<BigInt(a)||X>BigInt(0)||!L)||!j&&L,nr=!!Ne,[{parsed:Tt,compressedAccount:oe},Fr]=await Promise.all([rD(p,s,$,X,BigInt(a),c),tD(mt,C,c)]),y=null,ie=null,Pe=new W;if(Fr&&Pe.addPreAccounts([{address:s,role:AccountRole.WRITABLE}]),k||oe){await Pe.addSystemAccounts();let pe=[];if(oe&&pe.push({hash:oe.hash,tree:oe.treeInfo.tree,queue:oe.treeInfo.queue,data:oe.data,address:oe.address}),k&&pe.push(k),ie=await B(pe,[]),k){let Ve=oe?1:0;y=ce(Pe,ie.treeInfos.slice(Ve),ie.leafIndices.slice(Ve),ie.rootIndices.slice(Ve),ie.proveByIndices.slice(Ve),pe.slice(Ve),q())[0];}}let H=oe&&Tt&&ie?some({amount:Tt.amount.toNumber(),merkleContext:{leafIndex:oe.leafIndex,merkleTreePubkeyIndex:Pe.insertOrGet(oe.treeInfo.tree.toString()),queuePubkeyIndex:Pe.insertOrGet(oe.treeInfo.queue.toString()),proveByIndex:oe.proveByIndex},rootIndex:ie.rootIndices[0],version:sD(oe.data?.discriminator)}):none(),we=[],Gr=[];for(let pe of u)if(pe instanceof M){let Ve=we.length,{domainConfig:zr,verifyArgs:xs,signature:Is,publicKey:Cs,message:Es}=K(pe,Ve);Es&&Is&&Cs&&we.push({message:Es,signature:Is,publicKey:Cs}),zr&&(Pe.addPreAccounts([{address:zr,role:AccountRole.READONLY}]),xs.__option==="Some"&&Gr.push({domainConfigKey:zr,verifyArgs:xs.value}));}else Pe.addPreAccounts([{address:pe.address,role:AccountRole.READONLY_SIGNER,signer:pe}]);let{remainingAccounts:fs,systemOffset:Ou}=Pe.toAccountMetas(),sr=[];we.length>0&&sr.push(N(we));let Ss=v(ie,Ou);if(d){if(!y)throw new Error("Payer not found or proof args is missing.");sr.push(za({amount:a,settingsMutArgs:y,compressedProofArgs:Ss,payer:i,secp256r1VerifyArgs:Gr,source:p,destination:r,sourceCtokenTokenAccount:f,sourceSplTokenAccount:l,destinationCtokenTokenAccount:Ne,destinationSplTokenAccount:xe,mint:s,tokenProgram:o,remainingAccounts:fs,sourceCompressedTokenAccount:H,compressibleConfig:Cu,splInterfacePda:mt?C:void 0,rentSponsor:nr?Eu:void 0}));}else sr.push(Va({amount:a,secp256r1VerifyArgs:Gr,source:p,destination:r,destinationCtokenTokenAccount:Ne,destinationSplTokenAccount:xe,settings:g,mint:s,tokenProgram:o,remainingAccounts:fs,payer:i,sourceCompressedTokenAccount:H,compressedProofArgs:Ss,sourceSplTokenAccount:l,sourceCtokenTokenAccount:f,compressibleConfig:Cu,splInterfacePda:mt?C:void 0,rentSponsor:nr?Eu:void 0}));return sr}async function tD(e,n,r){let s=false;if(e){let{value:t}=await $t(n,r);s=!t;}return s}async function rD(e,n,r,s,t,c){if(r+s>=t)return {};let a=await Hd(new PublicKey(e),{mint:new PublicKey(n)},c),i=a.items.length>0?a.items[0]:null;return i?i.compressedAccount.data?.data.length?i.compressedAccount.owner.equals(CTOKEN_PROGRAM_ID)?{compressedAccount:i.compressedAccount,parsed:i.parsed}:{}:{}:{}}async function nD(e,n,r,s){if(!e)return null;let{address:t}=await se(n,r);return (await ge([{address:t,type:"Settings"}],s))[0]}function sD(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let n=e[7];return n===3?2:3}function oD(e){if(!e||e.length===0)return null;try{return {amount:getU64Decoder().decode(e.slice(64,72))}}catch(n){return console.error("Token data parsing error:",n),null}}async function r2({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:a,proof:i,settingsMutArgs:o}=r,d=ye(e),u=d.filter(P=>!(P instanceof M));a.addPreAccounts(u.map(P=>({address:P.address,role:AccountRole.READONLY_SIGNER,signer:P})));let g=d.filter(P=>P instanceof M),p=[],l=[];for(let P of g){let x=l.length,{domainConfig:k,verifyArgs:L,signature:j,publicKey:$,message:X}=K(P,x);X&&j&&$&&l.push({message:X,signature:j,publicKey:$}),k&&(a.addPreAccounts([{address:k,role:AccountRole.READONLY}]),L.__option==="Some"&&p.push({domainConfigKey:k,verifyArgs:L.value}));}let{remainingAccounts:f,systemOffset:_}=a.toAccountMetas(),I=v(i,_),C=[];if(l.length>0&&C.push(N(l)),c){if(!o)throw new Error("Payer not found or proof args is missing.");C.push(dc({configActions:t,payer:n,compressedProofArgs:I,settingsMutArgs:o,remainingAccounts:f,secp256r1VerifyArgs:p}));}else C.push(await tc({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:I,remainingAccounts:f,secp256r1VerifyArgs:p}));return C}async function d2({createUserArgs:e,payer:n}){let r=new W;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:AccountRole.READONLY_SIGNER,signer:u.member})));let s=await De(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:p}=await O(u.member.address,s);return {address:g,tree:p,queue:p,type:"User"}})),c=await B([],t),a=await de(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),d=v(c,o);return await Oc({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:a[g],transactionManagerUrl:u.role===2?u.transactionManagerUrl:null})),remainingAccounts:i})}async function y2({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new W;await c.addSystemAccounts();let a=[],i=[];i.push(...await ge([{address:(await O(r.address,s)).address,type:"User"}],t));let o=await De(),{address:d,addressTree:u}=await se(e,o);a.push({address:d,queue:u,tree:u,type:"Settings"});let g=i.length,p=await B(i,a),l=ce(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),i.filter(x=>x.type==="User"),Z())[0],_=(await de(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),a)).find(x=>x.type==="Settings")??null,{remainingAccounts:I,systemOffset:C}=c.toAccountMetas(),P=v(p,C);if(!_)throw new Error("Settings creation args is missing.");return await mc({settingsIndex:e,payer:n,initialMember:r,userReadonlyArgs:l,compressedProofArgs:P,settingsCreation:_,remainingAccounts:I})}async function M2({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:a,settingsMutArgs:i}=await Ee(true,e,n,false,t);if(!i)throw new Error("Proof args is missing");let o=ye(s),d=o.filter(C=>C instanceof M),u=[],g=[];for(let C of d){let P=u.length,{domainConfig:x,verifyArgs:k,signature:L,publicKey:j,message:$}=K(C,P);$&&L&&j&&u.push({message:$,signature:L,publicKey:j}),x&&(c.addPreAccounts([{address:x,role:AccountRole.READONLY}]),k.__option==="Some"&&g.push({domainConfigKey:x,verifyArgs:k.value}));}c.addPreAccounts(o.filter(C=>"address"in C).map(C=>({address:C.address,role:AccountRole.READONLY_SIGNER,signer:C})));let{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),f=v(a,l),_=[];u.length>0&&_.push(N(u));let I=await ae(e);return _.push(Fc({settings:I,payer:r,settingsMutArgs:i,compressedProofArgs:f,secp256r1VerifyArgs:g,remainingAccounts:p})),_}async function U2({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new W;await a.addSystemAccounts();let i=await De(),{address:o,addressTree:d}=await O(r.address,i),u=[{address:o,tree:d,queue:d,type:"User"}],g=await B([],u),p=(await de(a,g.treeInfos,g.roots,g.rootIndices,u))[0],l=a.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:v(g,l.systemOffset),authorityCreationArgs:p};}return ea({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function N2({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new W;await s.addSystemAccounts();let t=await ge([{address:(await O(e.address,n)).address,type:"User"}]),c=await B(t,[]),a=ce(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,Z())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),d=v(c,o);return ca({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:a,remainingAccounts:i})}async function J2({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:a,message:i,signature:o,publicKey:d}=K(n),u=[];i&&o&&d&&u.push({message:i,signature:o,publicKey:d});let g=await Wr(n instanceof M?n:n.address,r,t),p=[];p.push({address:(await O(n instanceof M?n:n.address,r)).address,type:"User"});let l,f=null,_,I=null;g.delegatedTo.__option==="Some"&&((await os(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await se(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),f={start:p.length-1,end:p.length}):l=await ae(g.delegatedTo.value.index)),s&&((await os(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await se(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),I={start:p.length-1,end:p.length}):_=await ae(s.index));let C=new W;await C.addSystemAccounts();let P=await ge(p,t),x=await B(P,[]),k=ce(C,x.treeInfos.slice(0,1),x.leafIndices.slice(0,1),x.rootIndices.slice(0,1),x.proveByIndices.slice(0,1),P.slice(0,1),Z())[0],L=f?some(ce(C,x.treeInfos.slice(f.start,f.end),x.leafIndices.slice(f.start,f.end),x.rootIndices.slice(f.start,f.end),x.proveByIndices.slice(f.start,f.end),P.slice(f.start,f.end),q())[0]):none(),j=I?some(ce(C,x.treeInfos.slice(I.start,I.end),x.leafIndices.slice(I.start,I.end),x.rootIndices.slice(I.start,I.end),x.proveByIndices.slice(I.start,I.end),P.slice(I.start,I.end),q())[0]):none(),{remainingAccounts:$,systemOffset:X}=C.toAccountMetas(),Me=v(x,X),xe=[];return u.length>0&&xe.push(N(u)),xe.push(ga({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof M?void 0:n,oldSettings:l,oldSettingsMutArgs:L,newSettings:_,newSettingsMutArgs:j,compressedProofArgs:Me,userMutArgs:k,remainingAccounts:$})),xe}async function u5({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await Oo(ne(),s),o=i.data.multiWalletSettings,{packedAccounts:d,proof:u,settingsMutArgs:g}=await Ee(c,e,n,false,a),{remainingAccounts:p,systemOffset:l}=d.toAccountMetas(),{domainConfig:f,verifyArgs:_,message:I,signature:C,publicKey:P}=K(r),x=[];if(I&&C&&P&&x.push(N([{message:I,signature:C,publicKey:P}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let k=v(u,l);x.push(ri({transactionBuffer:s,domainConfig:f,closer:r instanceof M?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:_,settingsMutArgs:g,payer:t,compressedProofArgs:k,remainingAccounts:p}));}else x.push(Za({transactionBuffer:s,domainConfig:f,closer:r instanceof M?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:_,remainingAccounts:[]}));return x}function Pu({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:p,message:l,signature:f,publicKey:_}=K(n),I=[];if(l&&f&&_&&I.push(N([{message:l,signature:f,publicKey:_}])),d){let{settingsReadonlyArgs:C,compressedProofArgs:P,remainingAccounts:x}=d;I.push(mi({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof M?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:u},settingsReadonlyArgs:C,compressedProofArgs:P,remainingAccounts:x}));}else I.push(ii({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof M?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:u},remainingAccounts:[]}));return I}function hu({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=K(e),d=[];return i&&a&&o&&d.push(N([{message:i,signature:a,publicKey:o}])),s?d.push(Pi({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(xi({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,remainingAccounts:[]})),d}function Ru({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Ni({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Ui({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function bu({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=K(n),d=[];return o&&a&&i&&d.push(N([{message:o,signature:a,publicKey:i}])),s?d.push(Zi({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(zi({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,remainingAccounts:[]})),d}async function $5({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await dD(r),a=new W,i=null,o=null,d=[];if(c.length||t){let g=await uD({packedAccounts:a,userAccounts:c,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:s});i=g.proof,o=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await AD({configActionsArgs:r,userMutArgs:d,index:e}),index:e,proof:i,settingsMutArgs:o,packedAccounts:a,compressed:t}}async function dD(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>O(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let s=await Promise.all(r.members.map(t=>O(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function uD({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let a=[];if(r){let l=(await se(s,t)).address;a.push({address:l,type:"Settings"});}n.length&&a.push(...n);let i=a.length?await ge(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await B(i,[]),d=[],u=[];for(let l of i)l.type==="Settings"?d.push(l):l.type==="User"&&u.push(l);let g,p=[];if(r&&o&&(g=ce(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),d,q())[0]),u.length&&o){let l=r?1:0;p=ce(e,o.treeInfos.slice(l),o.leafIndices.slice(l),o.rootIndices.slice(l),o.proveByIndices.slice(l),u,Z());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function AD({index:e,configActionsArgs:n,userMutArgs:r}){let s=[];for(let t of n)switch(t.type){case "AddMembers":{let c=[];for(let a of t.members){let i=await O(a.member,a.userAddressTreeIndex).then(o=>r.find(d=>equalBytes(new Uint8Array(d.accountMeta.address),new Uint8Array(getBase58Encoder().encode(encodeBN254toBase58(o.address))))));if(!i)throw new Error("Unable to find user account");c.push(mD({permissionArgs:a.permissions,userMutArgs:i,pubkey:a.member}));}s.push({__kind:t.type,fields:[c]});break}case "RemoveMembers":{let c=await Promise.all(t.members.map(a=>O(a.member,a.userAddressTreeIndex).then(i=>{let o=r.find(d=>equalBytes(new Uint8Array(d.accountMeta.address),new Uint8Array(getBase58Encoder().encode(encodeBN254toBase58(i.address)))));if(!o)throw new Error("Unable to find user account");return pD({pubkey:a.member,userMutArgs:o,index:e})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(a=>gD({permissionArgs:a.permissions,pubkey:a.member}));s.push({__kind:t.type,fields:[c]});break}default:s.push({__kind:t.type,fields:[t.threshold]});}return s}function gD({pubkey:e,permissionArgs:n}){return {memberKey:ut(e),permissions:Wu(n)}}function pD({pubkey:e,userMutArgs:n,index:r}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");let s=n.data.delegatedTo.__option==="Some"?Number(n.data.delegatedTo.value.index.toString())===r:false;return {memberKey:ut(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function mD({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===1)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===2&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:ut(e),permissions:Wu(n),userReadonlyArgs:r}}function Wu(e){let n=[];return e.initiate&&n.push(be.InitiateTransaction),e.vote&&n.push(be.VoteTransaction),e.execute&&n.push(be.ExecuteTransaction),Le.fromPermissions(n)}async function a6({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:l}){let f=await ae(n),_=Math.floor(Math.random()*255),I=await Jd(f,t instanceof M?t:t.address,_),C=[],P=[];for(let H=0;H<s.length;H+=p){let we=s.subarray(H,H+p);C.push(we),P.push(sha256(we));}let x=sha256(new Uint8Array(s)),{settingsReadonlyArgs:k,settingsMutArgs:L,proof:j,packedAccounts:$}=await Ee(d,n,r,false,l),{remainingAccounts:X,systemOffset:Me}=$.toAccountMetas(),xe=j&&k&&L?{settingsReadonlyArgs:k,settingsMutArgs:L,compressedProofArgs:v(j,Me),remainingAccounts:X,payer:e}:null,Ne=ye([t,...c?[c]:[],...u]).filter(H=>H instanceof M).map(H=>({memberKey:ut(H),messageHash:is(H.authResponse)})),mt=Pu({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:_,payer:e,transactionBufferAddress:I,settings:f,creator:t,preauthorizeExecution:!c,bufferExtendHashes:P,compressedArgs:xe,expectedSecp256r1Signers:Ne}),nr=C.map(H=>Ru({transactionMessageBytes:H,transactionBufferAddress:I,settings:f,compressed:d})),Tt=u.map(H=>bu({voter:H,transactionBufferAddress:I,settings:f,compressedArgs:xe})),oe=hu({compressedArgs:xe,settings:f,executor:c,transactionBufferAddress:I}),{instructions:Fr,addressLookupTableAccounts:y}=await yu({compressed:d,settings:f,transactionMessageBytes:s,transactionBufferAddress:I,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),ie=H=>({payer:e,instructions:H,addressesByLookupTableAddress:y});return [ie(mt),...nr.map(H=>ie([H])),...Tt.length?[ie(Tt.flat())]:[],ie(oe),ie(Fr)]}var Vr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=a=>{let i=s.get(a);return i===void 0&&(i={isSigner:false,isWritable:false,isInvoked:false},s.set(a,i)),i},c=t(r);c.isSigner=true,c.isWritable=true;for(let a of n){t(a.programAddress).isInvoked=false;for(let i of a.accounts??[]){let o=t(i.address);o.isSigner||=i.role===AccountRole.READONLY_SIGNER||i.role===AccountRole.WRITABLE_SIGNER,o.isWritable||=i.role===AccountRole.WRITABLE||i.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),a={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let i=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [a,i]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&a.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&!a.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,a]of this.keyMetaMap.entries())if(r(a)){let i=c,o=n.findIndex(d=>d===i);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(i),this.keyMetaMap.delete(c);}}return [s,t]}};var Hr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,a)=>{s.set(c,a);});let t=c=>{let a=s.get(c);if(a===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return a};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(a=>t(a.address))??[],data:c.data}))}};function ku({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Vr.compile(r,e),c=new Array,a={writable:[],readonly:[]},i=Object.entries(s??{});for(let p of i){let l=t.extractTableLookup(p);if(l!==void 0){let{addressTableLookup:f,drainedKeys:_}=l;c.push({readonlyIndexes:f.readonlyIndexes,readableIndices:f.readonlyIndexes,writableIndexes:f.writableIndexes,writableIndices:f.writableIndexes,lookupTableAddress:address(f.lookupTableAddress)}),a.writable.push(..._.writable),a.readonly.push(..._.readonly);}}let[o,d]=t.getMessageComponents(),g=new Hr(d,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function x6({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=ku({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return Rd(s)}async function M6({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await lu({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:d,cachedAccounts:i});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}
|
|
2
|
+
export{jo as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,ar as BACKOFF_MAX_DELAY_MS,Ps as BUNDLE_POLL_DELAY_MS,Ms as BUNDLE_POLL_MAX_RETRIES,Ae as BundleError,cc as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,$o as CHANGE_CONFIG_DISCRIMINATOR,Ds as COMPUTE_UNIT_MULTIPLIER,gc as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,Cc as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Pc as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,_c as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Lc as CREATE_USER_ACCOUNTS_DISCRIMINATOR,mk as CompleteMessageRequestSchema,Tk as CompleteTransactionRequestSchema,wc as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,hs as DEFAULT_JITO_BLOCK_ENGINE_URL,Rs as DEFAULT_JITO_TIPS_URL,bs as DEFAULT_JITO_TIP_PRIORITY,Ue as DEFAULT_NETWORK_RETRY_DELAY_MS,ve as DEFAULT_NETWORK_RETRY_MAX_RETRIES,Kc as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Ls as DOMAIN_CONFIG_DISCRIMINATOR,Qc as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,na as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,da as EDIT_USER_DELEGATE_DISCRIMINATOR,cr as EXPONENTIAL_BACKOFF_BASE,Vs as GLOBAL_COUNTER_DISCRIMINATOR,vs as HTTP_STATUS_BAD_REQUEST,qr as HTTP_STATUS_INTERNAL_SERVER_ERROR,Us as HTTP_STATUS_TOO_MANY_REQUESTS,jr as JITO_TIP_ACCOUNTS,Yt as KeyType,_s as MAX_TRANSACTION_BUFFER_INDEX,Ta as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,Ia as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,or as MIN_COMPUTE_UNITS,DI as MULTI_WALLET_ERROR__ALREADY_DELEGATED,tI as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,mC as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,zI as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,KI as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,gC as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,CC as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,sI as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,nI as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,mI as MULTI_WALLET_ERROR__EMPTY_MEMBERS,XI as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,gI as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,rI as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,uI as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,WI as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,LI as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,kI as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,ZI as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,hI as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,MI as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,PI as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,SI as MULTI_WALLET_ERROR__INVALID_ACCOUNT,AC as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,JI as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,pI as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,II as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,UI as MULTI_WALLET_ERROR__INVALID_BUFFER,QI as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,RI as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,fI as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,aI as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,Yx as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,Qx as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,Jx as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,Xx as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,GI as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,HI as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,yI as MULTI_WALLET_ERROR__INVALID_THRESHOLD,iC as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,AI as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,dI as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,lI as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,xI as MULTI_WALLET_ERROR__INVALID_USER_ROLE,yC as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,aC as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,$x as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,wI as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,jI as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,tC as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,uC as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,CI as MULTI_WALLET_ERROR__MISSING_ACCOUNT,$I as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,sC as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,lC as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,cC as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,eC as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,EI as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,xC as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,SC as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,YI as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,fC as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,oC as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,VI as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,pC as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,IC as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,_I as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,cI as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,iI as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,qI as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,nC as MULTI_WALLET_ERROR__PAYER_MISMATCH,oI as MULTI_WALLET_ERROR__PERMANENT_MEMBER,NI as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,eI as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,rC as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,Zx as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,FI as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,dC as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,TI as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,OI as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,BI as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,vI as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,TC as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,bI as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,Kx as MultiWalletAccount,jx as MultiWalletInstruction,va as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Pa as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Ce as NetworkError,ee as NotFoundError,We as NotInitializedError,be as Permission,dr as PermissionError,Le as Permissions,ir as RetryExhaustedError,Ie as RevibaseError,Po as SETTINGS_DISCRIMINATOR,ke as Secp256r1Key,M as SignedSecp256r1Key,gk as StartMessageRequestSchema,pk as StartTransactionRequestSchema,Fa as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Na as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,$a as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,qa as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,Ai as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,oi as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Wo as TRANSACTION_BUFFER_DISCRIMINATOR,Ei as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,li as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,ki as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,bi as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,qi as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Hi as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,od as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,$i as TRANSACTION_EXECUTE_DISCRIMINATOR,ld as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,Ad as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Kr as TRANSACTION_SIZE_LIMIT,Cd as TransactionActionTypeSchema,Ws as TransactionError,Ak as TransactionPayloadSchema,Ed as TransactionPayloadWithBase64MessageBytesSchema,nt as UserRole,F as ValidationError,wo as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,ok as addWhitelistedAddressTrees,Be as base64URLStringToBuffer,QO as bufferToBase64URLString,r2 as changeConfig,u5 as closeTransactionBuffer,cM as configAction,iu as convertMemberKeyToString,zO as convertPubkeyCompressedToCose,GO as convertPubkeyCoseToCompressed,YO as createClientAuthorizationCompleteRequestChallenge,JO as createClientAuthorizationStartRequestChallenge,mN as createDomainConfig,DN as createDomainUserAccounts,RN as createGlobalCounter,ZO as createMessageChallenge,Pu as createTransactionBuffer,XO as createTransactionChallenge,vE as createTransactionManagerSigner,d2 as createUserAccounts,y2 as createWallet,Os as decodeDomainConfig,Fs as decodeGlobalCounter,Ro as decodeSettings,ko as decodeTransactionBuffer,Ho as decodeWhitelistedAddressTree,M2 as decompressSettingsAccount,QB as deserializeConfigActions,UN as disableDomainConfig,U2 as editDomainConfig,N2 as editTransactionManagerUrl,J2 as editUserDelegate,yu as executeTransaction,hu as executeTransactionBuffer,lu as executeTransactionSync,Ru as extendTransactionBuffer,ID as fetchAllDomainConfig,RD as fetchAllGlobalCounter,Zu as fetchAllMaybeDomainConfig,gA as fetchAllMaybeGlobalCounter,w1 as fetchAllMaybeSettings,oT as fetchAllMaybeTransactionBuffer,MT as fetchAllMaybeWhitelistedAddressTree,nR as fetchAllSettings,dR as fetchAllTransactionBuffer,mR as fetchAllWhitelistedAddressTree,Bs as fetchDomainConfig,hD as fetchGlobalCounter,Yu as fetchMaybeDomainConfig,AA as fetchMaybeGlobalCounter,Rn as fetchMaybeSettings,HC as fetchMaybeSettingsAccountData,sT as fetchMaybeTransactionBuffer,VC as fetchMaybeUserAccountData,DT as fetchMaybeWhitelistedAddressTree,rR as fetchSettings,os as fetchSettingsAccountData,Oo as fetchTransactionBuffer,Wr as fetchUserAccountData,Fo as fetchWhitelistedAddressTree,WD as getAddMemberArgsCodec,Yr as getAddMemberArgsDecoder,Jr as getAddMemberArgsEncoder,vR as getAddWhitelistedAddressTreesDiscriminatorBytes,WR as getAddWhitelistedAddressTreesInstruction,Jo as getAddWhitelistedAddressTreesInstructionAsync,UR as getAddWhitelistedAddressTreesInstructionDataCodec,qo as getAddWhitelistedAddressTreesInstructionDataDecoder,On as getAddWhitelistedAddressTreesInstructionDataEncoder,XR as getChangeConfigCompressedDiscriminatorBytes,dc as getChangeConfigCompressedInstruction,QR as getChangeConfigCompressedInstructionDataCodec,ic as getChangeConfigCompressedInstructionDataDecoder,ac as getChangeConfigCompressedInstructionDataEncoder,HR as getChangeConfigDiscriminatorBytes,GR as getChangeConfigInstruction,tc as getChangeConfigInstructionAsync,FR as getChangeConfigInstructionDataCodec,ec as getChangeConfigInstructionDataDecoder,Nn as getChangeConfigInstructionDataEncoder,as as getClientAndDeviceHash,OD as getCompiledInstructionCodec,Xr as getCompiledInstructionDecoder,Zr as getCompiledInstructionEncoder,VD as getCompressedAccountMetaCodec,St as getCompressedAccountMetaDecoder,ft as getCompressedAccountMetaEncoder,zD as getCompressedAccountMetaReadOnlyCodec,Et as getCompressedAccountMetaReadOnlyDecoder,Ct as getCompressedAccountMetaReadOnlyEncoder,qD as getCompressedProofCodec,nn as getCompressedProofDecoder,rn as getCompressedProofEncoder,se as getCompressedSettingsAddressFromIndex,XD as getCompressedSettingsCodec,tM as getCompressedSettingsDataCodec,Pt as getCompressedSettingsDataDecoder,Mt as getCompressedSettingsDataEncoder,q as getCompressedSettingsDecoder,Dt as getCompressedSettingsEncoder,kd as getComputeBudgetEstimate,oM as getConfigActionCodec,ze as getConfigActionDecoder,Ge as getConfigActionEncoder,cb as getCreateCompressedWalletDiscriminatorBytes,ib as getCreateCompressedWalletInstruction,mc as getCreateCompressedWalletInstructionAsync,ab as getCreateCompressedWalletInstructionDataCodec,pc as getCreateCompressedWalletInstructionDataDecoder,wn as getCreateCompressedWalletInstructionDataEncoder,yb as getCreateDomainConfigDiscriminatorBytes,fb as getCreateDomainConfigInstruction,Dc as getCreateDomainConfigInstructionAsync,lb as getCreateDomainConfigInstructionDataCodec,Ec as getCreateDomainConfigInstructionDataDecoder,Hn as getCreateDomainConfigInstructionDataEncoder,Pb as getCreateDomainUserAccountDiscriminatorBytes,Rb as getCreateDomainUserAccountInstruction,Rc as getCreateDomainUserAccountInstructionAsync,hb as getCreateDomainUserAccountInstructionDataCodec,hc as getCreateDomainUserAccountInstructionDataDecoder,Gn as getCreateDomainUserAccountInstructionDataEncoder,kb as getCreateGlobalCounterDiscriminatorBytes,Bb as getCreateGlobalCounterInstruction,Uc as getCreateGlobalCounterInstructionAsync,Ob as getCreateGlobalCounterInstructionDataCodec,vc as getCreateGlobalCounterInstructionDataDecoder,Kn as getCreateGlobalCounterInstructionDataEncoder,AM as getCreateUserAccountArgsCodec,gn as getCreateUserAccountArgsDecoder,An as getCreateUserAccountArgsEncoder,Kb as getCreateUserAccountsDiscriminatorBytes,qb as getCreateUserAccountsInstruction,Oc as getCreateUserAccountsInstructionAsync,jb as getCreateUserAccountsInstructionDataCodec,kc as getCreateUserAccountsInstructionDataDecoder,qn as getCreateUserAccountsInstructionDataEncoder,t_ as getDecompressSettingsAccountDiscriminatorBytes,Fc as getDecompressSettingsAccountInstruction,r_ as getDecompressSettingsAccountInstructionDataCodec,Hc as getDecompressSettingsAccountInstructionDataDecoder,Vc as getDecompressSettingsAccountInstructionDataEncoder,d_ as getDisableDomainConfigDiscriminatorBytes,Jc as getDisableDomainConfigInstruction,u_ as getDisableDomainConfigInstructionDataCodec,qc as getDisableDomainConfigInstructionDataDecoder,jc as getDisableDomainConfigInstructionDataEncoder,it as getDomainConfigAddress,xD as getDomainConfigCodec,ks as getDomainConfigDecoder,SD as getDomainConfigDiscriminatorBytes,Ju as getDomainConfigEncoder,CD as getDomainConfigSize,f_ as getEditDomainConfigDiscriminatorBytes,ea as getEditDomainConfigInstruction,x_ as getEditDomainConfigInstructionAsync,S_ as getEditDomainConfigInstructionDataCodec,$c as getEditDomainConfigInstructionDataDecoder,Yn as getEditDomainConfigInstructionDataEncoder,TM as getEditMemberArgsCodec,an as getEditMemberArgsDecoder,cn as getEditMemberArgsEncoder,R_ as getEditTransactionManagerUrlDiscriminatorBytes,ca as getEditTransactionManagerUrlInstruction,b_ as getEditTransactionManagerUrlInstructionDataCodec,oa as getEditTransactionManagerUrlInstructionDataDecoder,sa as getEditTransactionManagerUrlInstructionDataEncoder,B_ as getEditUserDelegateDiscriminatorBytes,ga as getEditUserDelegateInstruction,N_ as getEditUserDelegateInstructionDataCodec,Aa as getEditUserDelegateInstructionDataDecoder,ua as getEditUserDelegateInstructionDataEncoder,SM as getExpectedSecp256r1SignersCodec,_t as getExpectedSecp256r1SignersDecoder,bt as getExpectedSecp256r1SignersEncoder,qd as getGlobalCounterAddress,PD as getGlobalCounterCodec,Hs as getGlobalCounterDecoder,MD as getGlobalCounterDiscriminatorBytes,uA as getGlobalCounterEncoder,bD as getGlobalCounterSize,ns as getJitoTipsConfig,vO as getLightCpiSigner,ot as getLightProtocolRpc,EM as getLinkWalletArgsCodec,mn as getLinkWalletArgsDecoder,pn as getLinkWalletArgsEncoder,hM as getMemberCodec,Rt as getMemberDecoder,ht as getMemberEncoder,_M as getMemberKeyCodec,re as getMemberKeyDecoder,te as getMemberKeyEncoder,j_ as getMigrateCompressedSettingsDiscriminatorBytes,fa as getMigrateCompressedSettingsInstruction,q_ as getMigrateCompressedSettingsInstructionDataCodec,la as getMigrateCompressedSettingsInstructionDataDecoder,ya as getMigrateCompressedSettingsInstructionDataEncoder,tv as getMigrateCompressedUsersDiscriminatorBytes,Da as getMigrateCompressedUsersInstruction,rv as getMigrateCompressedUsersInstructionDataCodec,Ea as getMigrateCompressedUsersInstructionDataDecoder,Ca as getMigrateCompressedUsersInstructionDataEncoder,qL as getMultiWalletErrorMessage,xv as getNativeTransferIntentCompressedDiscriminatorBytes,La as getNativeTransferIntentCompressedInstruction,Iv as getNativeTransferIntentCompressedInstructionDataCodec,Wa as getNativeTransferIntentCompressedInstructionDataDecoder,Ua as getNativeTransferIntentCompressedInstructionDataEncoder,uv as getNativeTransferIntentDiscriminatorBytes,Ra as getNativeTransferIntentInstruction,gv as getNativeTransferIntentInstructionAsync,Av as getNativeTransferIntentInstructionDataCodec,ha as getNativeTransferIntentInstructionDataDecoder,Zn as getNativeTransferIntentInstructionDataEncoder,LM as getNewAuthorityArgsCodec,fn as getNewAuthorityArgsDecoder,ln as getNewAuthorityArgsEncoder,$O as getOriginIndex,BM as getPackedAddressTreeInfoCodec,Ut as getPackedAddressTreeInfoDecoder,vt as getPackedAddressTreeInfoEncoder,VM as getPackedMerkleContextCodec,xn as getPackedMerkleContextDecoder,Sn as getPackedMerkleContextEncoder,GM as getPackedStateTreeInfoCodec,It as getPackedStateTreeInfoDecoder,xt as getPackedStateTreeInfoEncoder,jM as getPermissionsCodec,Fe as getPermissionsDecoder,He as getPermissionsEncoder,ZM as getProofArgsCodec,D as getProofArgsDecoder,E as getProofArgsEncoder,eP as getRemoveMemberArgsCodec,un as getRemoveMemberArgsDecoder,dn as getRemoveMemberArgsEncoder,is as getSecp256r1MessageHash,nP as getSecp256r1PubkeyCodec,Wt as getSecp256r1PubkeyDecoder,En as getSecp256r1PubkeyEncoder,KE as getSecp256r1SignatureOffsetsDataDecoder,zE as getSecp256r1SignatureOffsetsDataEncoder,cP as getSecp256r1VerifyArgsCodec,V as getSecp256r1VerifyArgsDecoder,w as getSecp256r1VerifyArgsEncoder,uP as getSecp256r1VerifyArgsWithDomainAddressCodec,Y as getSecp256r1VerifyArgsWithDomainAddressDecoder,J as getSecp256r1VerifyArgsWithDomainAddressEncoder,N as getSecp256r1VerifyInstruction,aw as getSecp256r1VerifyInstructionDataCodec,mu as getSecp256r1VerifyInstructionDataDecoder,Tu as getSecp256r1VerifyInstructionDataEncoder,Ld as getSendAndConfirmTransaction,tR as getSettingsCodec,mP as getSettingsCreationArgsCodec,kt as getSettingsCreationArgsDecoder,Lt as getSettingsCreationArgsEncoder,ho as getSettingsDecoder,eR as getSettingsDiscriminatorBytes,N1 as getSettingsEncoder,ae as getSettingsFromIndex,lP as getSettingsIndexWithAddressCodec,Bt as getSettingsIndexWithAddressDecoder,Ot as getSettingsIndexWithAddressEncoder,IP as getSettingsMutArgsCodec,z as getSettingsMutArgsDecoder,G as getSettingsMutArgsEncoder,MP as getSettingsReadonlyArgsCodec,wt as getSettingsReadonlyArgsDecoder,Nt as getSettingsReadonlyArgsEncoder,KO as getSignedSecp256r1Key,ZB as getSignedTransactionManager,ne as getSolanaRpc,Wd as getSolanaRpcEndpoint,bP as getSourceCompressedTokenArgsCodec,Ht as getSourceCompressedTokenArgsDecoder,Vt as getSourceCompressedTokenArgsEncoder,wv as getTokenTransferIntentCompressedDiscriminatorBytes,za as getTokenTransferIntentCompressedInstruction,Hv as getTokenTransferIntentCompressedInstructionAsync,Vv as getTokenTransferIntentCompressedInstructionDataCodec,Ga as getTokenTransferIntentCompressedInstructionDataDecoder,Qn as getTokenTransferIntentCompressedInstructionDataEncoder,bv as getTokenTransferIntentDiscriminatorBytes,Va as getTokenTransferIntentInstruction,vv as getTokenTransferIntentInstructionAsync,_v as getTokenTransferIntentInstructionDataCodec,wa as getTokenTransferIntentInstructionDataDecoder,Xn as getTokenTransferIntentInstructionDataEncoder,Jd as getTransactionBufferAddress,sU as getTransactionBufferCloseCompressedDiscriminatorBytes,ri as getTransactionBufferCloseCompressedInstruction,oU as getTransactionBufferCloseCompressedInstructionDataCodec,ti as getTransactionBufferCloseCompressedInstructionDataDecoder,ei as getTransactionBufferCloseCompressedInstructionDataEncoder,Yv as getTransactionBufferCloseDiscriminatorBytes,Za as getTransactionBufferCloseInstruction,Zv as getTransactionBufferCloseInstructionDataCodec,Ya as getTransactionBufferCloseInstructionDataDecoder,Ja as getTransactionBufferCloseInstructionDataEncoder,iR as getTransactionBufferCodec,WP as getTransactionBufferCreateArgsCodec,Gt as getTransactionBufferCreateArgsDecoder,Ft as getTransactionBufferCreateArgsEncoder,CU as getTransactionBufferCreateCompressedDiscriminatorBytes,mi as getTransactionBufferCreateCompressedInstruction,EU as getTransactionBufferCreateCompressedInstructionDataCodec,pi as getTransactionBufferCreateCompressedInstructionDataDecoder,gi as getTransactionBufferCreateCompressedInstructionDataEncoder,pU as getTransactionBufferCreateDiscriminatorBytes,ii as getTransactionBufferCreateInstruction,mU as getTransactionBufferCreateInstructionDataCodec,ai as getTransactionBufferCreateInstructionDataDecoder,ci as getTransactionBufferCreateInstructionDataEncoder,Lo as getTransactionBufferDecoder,aR as getTransactionBufferDiscriminatorBytes,nT as getTransactionBufferEncoder,VU as getTransactionBufferExecuteCompressedDiscriminatorBytes,Pi as getTransactionBufferExecuteCompressedInstruction,HU as getTransactionBufferExecuteCompressedInstructionDataCodec,Mi as getTransactionBufferExecuteCompressedInstructionDataDecoder,Di as getTransactionBufferExecuteCompressedInstructionDataEncoder,vU as getTransactionBufferExecuteDiscriminatorBytes,xi as getTransactionBufferExecuteInstruction,UU as getTransactionBufferExecuteInstructionDataCodec,Si as getTransactionBufferExecuteInstructionDataDecoder,fi as getTransactionBufferExecuteInstructionDataEncoder,rW as getTransactionBufferExtendCompressedDiscriminatorBytes,Ni as getTransactionBufferExtendCompressedInstruction,nW as getTransactionBufferExtendCompressedInstructionDataCodec,Bi as getTransactionBufferExtendCompressedInstructionDataDecoder,Oi as getTransactionBufferExtendCompressedInstructionDataEncoder,JU as getTransactionBufferExtendDiscriminatorBytes,Ui as getTransactionBufferExtendInstruction,YU as getTransactionBufferExtendInstructionDataCodec,vi as getTransactionBufferExtendInstructionDataDecoder,_i as getTransactionBufferExtendInstructionDataEncoder,xW as getTransactionBufferVoteCompressedDiscriminatorBytes,Zi as getTransactionBufferVoteCompressedInstruction,IW as getTransactionBufferVoteCompressedInstructionDataCodec,Yi as getTransactionBufferVoteCompressedInstructionDataDecoder,Ji as getTransactionBufferVoteCompressedInstructionDataEncoder,AW as getTransactionBufferVoteDiscriminatorBytes,zi as getTransactionBufferVoteInstruction,gW as getTransactionBufferVoteInstructionDataCodec,Gi as getTransactionBufferVoteInstructionDataDecoder,Fi as getTransactionBufferVoteInstructionDataEncoder,OW as getTransactionExecuteCompressedDiscriminatorBytes,id as getTransactionExecuteCompressedInstruction,BW as getTransactionExecuteCompressedInstructionDataCodec,ad as getTransactionExecuteCompressedInstructionDataDecoder,cd as getTransactionExecuteCompressedInstructionDataEncoder,RW as getTransactionExecuteDiscriminatorBytes,rd as getTransactionExecuteInstruction,bW as getTransactionExecuteInstructionDataCodec,td as getTransactionExecuteInstructionDataDecoder,ed as getTransactionExecuteInstructionDataEncoder,eL as getTransactionExecuteSyncCompressedDiscriminatorBytes,xd as getTransactionExecuteSyncCompressedInstruction,tL as getTransactionExecuteSyncCompressedInstructionDataCodec,Sd as getTransactionExecuteSyncCompressedInstructionDataDecoder,fd as getTransactionExecuteSyncCompressedInstructionDataEncoder,KW as getTransactionExecuteSyncDiscriminatorBytes,md as getTransactionExecuteSyncInstruction,jW as getTransactionExecuteSyncInstructionDataCodec,pd as getTransactionExecuteSyncInstructionDataDecoder,gd as getTransactionExecuteSyncInstructionDataEncoder,VP as getTransactionMessageAddressTableLookupCodec,Mn as getTransactionMessageAddressTableLookupDecoder,Dn as getTransactionMessageAddressTableLookupEncoder,BP as getTransactionMessageCodec,Kt as getTransactionMessageDecoder,zt as getTransactionMessageEncoder,O as getUserAccountAddress,zP as getUserCodec,JP as getUserCreationArgsCodec,fe as getUserCreationArgsDecoder,le as getUserCreationArgsEncoder,Z as getUserDecoder,qe as getUserEncoder,QP as getUserMutArgsCodec,Ye as getUserMutArgsDecoder,Je as getUserMutArgsEncoder,rh as getUserReadOnlyArgsCodec,Re as getUserReadOnlyArgsDecoder,he as getUserReadOnlyArgsEncoder,ch as getUserReadOnlyOrMutateArgsCodec,Cn as getUserReadOnlyOrMutateArgsDecoder,In as getUserReadOnlyOrMutateArgsEncoder,Ah as getUserRoleCodec,je as getUserRoleDecoder,Ke as getUserRoleEncoder,_O as getWalletAddressFromIndex,_e as getWalletAddressFromSettings,pR as getWhitelistedAddressTreeCodec,Vo as getWhitelistedAddressTreeDecoder,gR as getWhitelistedAddressTreeDiscriminatorBytes,ET as getWhitelistedAddressTreeEncoder,cs as getWhitelistedAddressTreeFromIndex,fO as getWhitelistedAddressTreeIndexFromAddress,Fd as getWhitelistedAddressTreesAddress,VL as identifyMultiWalletAccount,HL as identifyMultiWalletInstruction,Hk as initialize,aM as isConfigAction,JL as isMultiWalletError,ih as isUserReadOnlyOrMutateArgs,wN as migrateSettings,jN as migrateUsers,Uw as nativeTransferIntent,LR as parseAddWhitelistedAddressTreesInstruction,$R as parseChangeConfigCompressedInstruction,zR as parseChangeConfigInstruction,db as parseCreateCompressedWalletInstruction,Sb as parseCreateDomainConfigInstruction,bb as parseCreateDomainUserAccountInstruction,Nb as parseCreateGlobalCounterInstruction,Jb as parseCreateUserAccountsInstruction,n_ as parseDecompressSettingsAccountInstruction,A_ as parseDisableDomainConfigInstruction,I_ as parseEditDomainConfigInstruction,__ as parseEditTransactionManagerUrlInstruction,w_ as parseEditUserDelegateInstruction,J_ as parseMigrateCompressedSettingsInstruction,nv as parseMigrateCompressedUsersInstruction,Cv as parseNativeTransferIntentCompressedInstruction,pv as parseNativeTransferIntentInstruction,iw as parseSecp256r1VerifyInstruction,Fv as parseTokenTransferIntentCompressedInstruction,Uv as parseTokenTransferIntentInstruction,cU as parseTransactionBufferCloseCompressedInstruction,Xv as parseTransactionBufferCloseInstruction,DU as parseTransactionBufferCreateCompressedInstruction,TU as parseTransactionBufferCreateInstruction,FU as parseTransactionBufferExecuteCompressedInstruction,WU as parseTransactionBufferExecuteInstruction,sW as parseTransactionBufferExtendCompressedInstruction,ZU as parseTransactionBufferExtendInstruction,CW as parseTransactionBufferVoteCompressedInstruction,pW as parseTransactionBufferVoteInstruction,NW as parseTransactionExecuteCompressedInstruction,_W as parseTransactionExecuteInstruction,rL as parseTransactionExecuteSyncCompressedInstruction,qW as parseTransactionExecuteSyncInstruction,PB as pollJitoBundleConfirmation,$5 as prepareChangeConfigArgs,a6 as prepareTransactionBundle,x6 as prepareTransactionMessage,M6 as prepareTransactionSync,YB as retrieveTransactionManager,pE as sendJitoBundle,XB as serializeConfigActions,MB as signAndSendBundledTransactions,WB as signAndSendTransaction,Kw as tokenTransferIntent,ah as userReadOnlyOrMutateArgs,bd as vaultTransactionMessageDeserialize,Rd as vaultTransactionMessageSerialize,bu as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|