@revibase/core 0.0.42 → 0.0.43
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 +366 -23
- package/dist/index.d.ts +366 -23
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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,encodeBN254toBase58,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import f 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");}},G=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;}},ge=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 St(){return getStructEncoder([["treeInfo",It()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function xt(){return getStructDecoder([["treeInfo",Ct()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function VD(){return combineCodec(St(),xt())}function Et(){return getStructEncoder([["treeInfo",It()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function Dt(){return getStructDecoder([["treeInfo",Ct()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function zD(){return combineCodec(Et(),Dt())}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 Mt(){return getStructEncoder([["data",getOptionEncoder(Pt())]])}function J(){return getStructDecoder([["data",getOptionDecoder(ht())]])}function XD(){return combineCodec(Mt(),J())}function Pt(){return getStructEncoder([["threshold",getU8Encoder()],["bump",getU8Encoder()],["index",getU128Encoder()],["multiWalletBump",getU8Encoder()],["members",getArrayEncoder(Rt())],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function ht(){return getStructDecoder([["threshold",getU8Decoder()],["bump",getU8Decoder()],["index",getU128Decoder()],["multiWalletBump",getU8Decoder()],["members",getArrayDecoder(bt())],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function tM(){return combineCodec(Pt(),ht())}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",fe()]])}function gn(){return getStructDecoder([["member",getAddressDecoder()],["role",je()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",Se()]])}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 _t(){return getStructEncoder([["memberKey",te()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function vt(){return getStructDecoder([["memberKey",re()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function SM(){return combineCodec(_t(),vt())}function pn(){return getStructEncoder([["settingsMutArgs",z()],["transactionManager",getOptionEncoder(he())]])}function mn(){return getStructDecoder([["settingsMutArgs",K()],["transactionManager",getOptionDecoder(Re())]])}function EM(){return combineCodec(pn(),mn())}function Rt(){return getStructEncoder([["pubkey",te()],["permissions",He()],["role",getU8Encoder()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function bt(){return getStructDecoder([["pubkey",re()],["permissions",Fe()],["role",getU8Decoder()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function hM(){return combineCodec(Rt(),bt())}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",fe()],["compressedProofArgs",E()]])}function fn(){return getStructDecoder([["authorityCreationArgs",Se()],["compressedProofArgs",D()]])}function LM(){return combineCodec(ln(),fn())}function Ut(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function Wt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function BM(){return combineCodec(Ut(),Wt())}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 It(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function Ct(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function GM(){return combineCodec(It(),Ct())}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 Lt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function nP(){return combineCodec(En(),Lt())}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 Y(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",w()]])}function Z(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",V()]])}function uP(){return combineCodec(Y(),Z())}function kt(){return getStructEncoder([["addressTreeInfo",Ut()],["outputStateTreeIndex",getU8Encoder()]])}function Ot(){return getStructDecoder([["addressTreeInfo",Wt()],["outputStateTreeIndex",getU8Decoder()]])}function mP(){return combineCodec(kt(),Ot())}function Bt(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function Nt(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function lP(){return combineCodec(Bt(),Nt())}function z(){return getStructEncoder([["accountMeta",St()],["data",Mt()]])}function K(){return getStructDecoder([["accountMeta",xt()],["data",J()]])}function IP(){return combineCodec(z(),K())}function wt(){return getStructEncoder([["accountMeta",Et()],["data",Mt()]])}function Vt(){return getStructDecoder([["accountMeta",Dt()],["data",J()]])}function MP(){return combineCodec(wt(),Vt())}function Ht(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",Sn()]])}function Ft(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",xn()]])}function bP(){return combineCodec(Ht(),Ft())}function Gt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getArrayEncoder(_t())]])}function zt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getArrayDecoder(vt())]])}function WP(){return combineCodec(Gt(),zt())}function Kt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(Zr())],["addressTableLookups",getArrayEncoder(Dn())]])}function jt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Xr())],["addressTableLookups",getArrayDecoder(Mn())]])}function BP(){return combineCodec(Kt(),jt())}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(Bt())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function X(){return getStructDecoder([["member",re()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",je()],["delegatedTo",getOptionDecoder(Nt())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function zP(){return combineCodec(qe(),X())}function fe(){return getStructEncoder([["addressTreeInfo",Ut()],["outputStateTreeIndex",getU8Encoder()]])}function Se(){return getStructDecoder([["addressTreeInfo",Wt()],["outputStateTreeIndex",getU8Decoder()]])}function JP(){return combineCodec(fe(),Se())}function Je(){return getStructEncoder([["accountMeta",St()],["data",qe()]])}function Ye(){return getStructDecoder([["accountMeta",xt()],["data",X()]])}function QP(){return combineCodec(Je(),Ye())}function he(){return getStructEncoder([["accountMeta",Et()],["data",qe()]])}function Re(){return getStructDecoder([["accountMeta",Dt()],["data",X()]])}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 ot=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(ot||{});function Ke(){return getEnumEncoder(ot)}function je(){return getEnumDecoder(ot)}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(Rt())],["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(bt())],["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(_t())],["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(vt())],["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 W(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:W(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(Y())],["compressedProofArgs",getOptionEncoder(E())]]),e=>({...e,discriminator:$o}))}function ec(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(ze())],["secp256r1VerifyArgs",getArrayDecoder(Z())],["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(Y())],["settingsMutArgs",z()],["compressedProofArgs",E()]]),e=>({...e,discriminator:cc}))}function ic(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(ze())],["secp256r1VerifyArgs",getArrayDecoder(Z())],["settingsMutArgs",K()],["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",kt()],["userReadonlyArgs",he()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:gc}))}function pc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["settingsCreation",Ot()],["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",fe()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Cc}))}function Ec(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",Se()],["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",fe()],["linkWalletArgs",getOptionEncoder(pn())]]),e=>({...e,discriminator:Pc}))}function hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["member",Lt()],["role",je()],["userAccountCreationArgs",Se()],["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",z()],["compressedProofArgs",E()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:wc}))}function Hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",K()],["compressedProofArgs",D()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}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(Bt())],["oldSettingsMutArgs",getOptionEncoder(z())],["newSettingsMutArgs",getOptionEncoder(z())],["compressedProofArgs",E()]]),e=>({...e,discriminator:da}))}function Aa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ye()],["secp256r1VerifyArgs",getOptionDecoder(V())],["delegateTo",getOptionDecoder(Nt())],["oldSettingsMutArgs",getOptionDecoder(K())],["newSettingsMutArgs",getOptionDecoder(K())],["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",Pt()],["compressedProofArgs",E()],["settingsCreationArgs",kt()]]),e=>({...e,discriminator:Ta}))}function la(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",ht()],["compressedProofArgs",D()],["settingsCreationArgs",Ot()]])}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",fe()]]),e=>({...e,discriminator:Ia}))}function Ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",X()],["compressedProofArgs",D()],["userCreationArgs",Se()]])}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(Y())]]),e=>({...e,discriminator:Pa}))}function ha(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}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(W(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(Y())],["settingsMutArgs",z()],["compressedProofArgs",E()]]),e=>({...e,discriminator:va}))}function Wa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Z())],["settingsMutArgs",K()],["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(Ht())],["compressedProofArgs",getOptionEncoder(E())],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:Na}))}function wa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["sourceCompressedTokenAccount",getOptionDecoder(Ft())],["compressedProofArgs",getOptionDecoder(D())],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}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(W(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(W(t.source.value)),getAddressEncoder().encode(W(t.tokenProgram.value)),getAddressEncoder().encode(W(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(W(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(W(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(W(t.destination.value)),getAddressEncoder().encode(W(t.tokenProgram.value)),getAddressEncoder().encode(W(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(W(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(W(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(W(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(Ht())],["secp256r1VerifyArgs",getArrayEncoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Fa}))}function Ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["sourceCompressedTokenAccount",getOptionDecoder(Ft())],["secp256r1VerifyArgs",getArrayDecoder(Z())],["settingsMutArgs",K()],["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(W(t.source.value)),getAddressEncoder().encode(W(t.tokenProgram.value)),getAddressEncoder().encode(W(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(W(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(W(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(W(t.destination.value)),getAddressEncoder().encode(W(t.tokenProgram.value)),getAddressEncoder().encode(W(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(W(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(W(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(W(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",z()],["compressedProofArgs",E()]]),e=>({...e,discriminator:$a}))}function ti(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(V())],["settingsMutArgs",K()],["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",Gt()],["secp256r1VerifyArgs",getOptionEncoder(w())]]),e=>({...e,discriminator:oi}))}function ai(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",zt()],["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",Gt()],["secp256r1VerifyArgs",getOptionEncoder(w())],["settingsReadonlyArgs",wt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ai}))}function pi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",zt()],["secp256r1VerifyArgs",getOptionDecoder(V())],["settingsReadonlyArgs",Vt()],["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",z()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ei}))}function Mi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(V())],["settingsMutArgs",K()],["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",wt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:qi}))}function Yi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(V())],["settingsReadonlyArgs",Vt()],["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",Kt()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:Ad}))}function pd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",jt()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}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",Kt()],["secp256r1VerifyArgs",getArrayEncoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",E()]]),e=>({...e,discriminator:ld}))}function Sd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",jt()],["secp256r1VerifyArgs",getArrayDecoder(Z())],["settingsMutArgs",K()],["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 Zt={Ed25519:1,Secp256r1:2};var Cd=f.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),Ak=f.object({transactionActionType:Cd,transactionAddress:f.string(),transactionMessageBytes:f.array(f.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),Ed=f.object({transactionActionType:Cd,transactionAddress:f.string(),transactionMessageBytes:f.string()}).strict(),Dd=f.object({authResponse:f.custom(),nonce:f.string(),clientSignature:f.object({clientOrigin:f.string(),signature:f.string()}).strict(),deviceSignature:f.object({publicKey:f.string(),signature:f.string()}).strict(),authProviderSignature:f.object({publicKey:f.string(),signature:f.string()}).strict().optional()}).strict(),Md=f.object({signer:f.string(),userAddressTreeIndex:f.number().optional(),additionalInfo:f.looseObject({}).optional()}).strict(),EC=f.object({transactionPayload:Ed,slotHash:f.string(),slotNumber:f.string(),originIndex:f.number(),crossOrigin:f.boolean()}).strict(),gk=f.object({phase:f.literal("start"),redirectOrigin:f.url(),signer:f.string().optional(),data:f.object({type:f.literal("message"),payload:f.string().optional()}).strict()}).strict(),pk=f.object({phase:f.literal("start"),redirectOrigin:f.url(),signer:f.string().optional(),data:f.object({type:f.literal("transaction"),payload:Ed}).strict()}).strict(),mk=f.object({phase:f.literal("complete"),data:f.object({type:f.literal("message"),payload:Md.extend(Dd.shape).extend({id:f.string().optional(),message:f.string(),clientSignature:f.object({clientOrigin:f.string()}).strict()})}).strict()}).strict(),Tk=f.object({phase:f.literal("complete"),data:f.object({type:f.literal("transaction"),payload:Md.extend(Dd.shape).extend(EC.shape).extend({clientSignature:f.object({clientOrigin:f.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 G(`${s} must be between ${n} and ${r} (inclusive), got ${e}`)}function vd(e,n){if(e<0)throw new G(`${n} must be non-negative, got ${e}`)}function Xt(e,n){if(e.length===0)throw new G(`${n} cannot be empty`)}function Ud(e,n){if(e.trim().length===0)throw new G(`${n} cannot be empty`)}featureFlags.version=VERSION.V2;var $={};function Wd(){if(!$.solanaRpcEndpoint)throw new We("RPC endpoint");return $.solanaRpcEndpoint}function at(){if(!$.lightProtocolRpc)throw new We("Light Protocol RPC");return $.lightProtocolRpc}function ne(){if(!$.solanaRpc)throw new We("Solana RPC");return $.solanaRpc}function Ld(){if(!$.sendAndConfirm)throw new We("Send and confirm transaction function");return $.sendAndConfirm}function kd(){if(!$.computeEstimate)throw new We("Compute budget estimate function");return $.computeEstimate}function ns(){return $.jitoTipsConfig?$.jitoTipsConfig:{blockEngineUrl:hs,getJitoTipsUrl:Rs,priority:bs}}function Hk({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){$.solanaRpcEndpoint=e,$.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});$.solanaRpc=t,$.sendAndConfirm=c,$.computeEstimate=estimateComputeUnitLimitFactory({rpc:t}),$.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 Qt(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(u){if(i=u,a&&!a(u,o))throw u;if(o>=r)break;let d=LC(o,s,t,c);await kC(d);}throw new ir(e.name||"retryWithBackoff",r,i)}async function it(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 Qt(e,{...n,shouldRetry:n.shouldRetry??r})}var L=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 at().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 vr(e,n){let r=Od(e);return _r(n,r,()=>at().getCompressedAccount(e))}async function Hd(e,n,r){let s=Bd(e,n?.mint);return _r(r,s,()=>at().getCompressedTokenAccountsByOwner(e,n))}async function Qe(e,n){let r=Nd(e);return _r(n,r,()=>ne().getAccountInfo(e,{encoding:"base64"}).send())}async function pe(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((u,d)=>({treeInfo:n[d],root:r[d],rootIndex:s[d],address:u.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((u,d)=>({addressTreeInfo:a[d],outputStateTreeIndex:i,address:u.address,type:u.type}))}function ce(e,n,r,s,t,c,a){let i=[];for(let d=0;d<n.length;d++)i.push({treeInfo:n[d],rootIndex:s[d],leafIndex:r[d],proveByIndex:t[d],hash:c[d].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new G("Unable to parse state tree data");return c.map((d,g)=>({data:a.decode(d.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(d.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Ee(e,n,r,s,t){let c=null,a=null,i=null,o=new L;if(e){await o.addSystemAccounts();let{address:u}=await se(n,r),d=(await pe([{address:u,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[d.leafIndex],leaves:[],treeInfos:[d.treeInfo],proveByIndices:[d.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([d],[]);let g=o.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!g)throw new G("Unable to parse state tree data");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:g.packedTreeInfos[0]},data:J().decode(d.data?.data)},a={accountMeta:{address:new Uint8Array(d.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:J().decode(d.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:o,settingsMutArgs:a}}async function B(e,n,r=3,s=500){return Qt(()=>at().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 k(e,n),t=await vr(s,r);return t?.data?.data?X().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=J().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 G(`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 k(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 ut({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(new Uint8Array(getUtf8Encoder().encode(n)));else throw new G("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 ut({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 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(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),u=c[0]===0&&c.length>32?c.slice(1):c,d=o[0]===0&&o.length>32?o.slice(1):o;if(u.length>32||d.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"+kr(d)),P=(l>p?p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),x=ZC(P);return new Uint8Array([...g,...x])}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){Xt(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new G(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await it(()=>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 ge(`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 ge(`Simulation failed: ${c}`)}return s.result.value.transactionResults.map(t=>t.unitsConsumed)}function j(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 gt(e){if(e instanceof ke)return {keyType:Zt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Zt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function ru(e){return e instanceof M?e.toString():e.address.toString()}function le(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 G(`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){Xt(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()){Xt(e,"serializedTransactions");let{blockEngineUrl:t}=s,c=`${t}/bundles`,a=await it(()=>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 ge(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new ge("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 Qt(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 ge(`Error getting bundle status: ${JSON.stringify(i.error,null,2)}`,e);if(!i.result?.value?.length)throw new ge("Bundle not yet confirmed",e);let o=i.result.value[0];if(o.confirmation_status==="confirmed"||o.confirmation_status==="finalized"){let u=o.transactions[o.transactions.length-1];if(!u)throw new ge("No transactions in confirmed bundle",e);return u}throw new ge(`Bundle status: ${o.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:a=>a instanceof ge||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(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 Ld()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function YB(e,n){if(n.threshold>1)throw new G("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 it(()=>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===Zt.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 G(`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 ut({rpId:n}),c=new L;await c.addSystemAccounts();let a=await De(),{address:i,addressTree:o}=await k(s.address,a),u=[{address:i,tree:o,queue:o,type:"User"}],d=await B([],u),g=(await de(c,d.treeInfos,d.roots,d.rootIndices,u))[0],{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),S=v(d,l);return await Dc({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function DN({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new L;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 k(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await pe(a,t):[],o=await De(),{address:u,addressTree:d}=await k(r.member,o),g=[{address:u,type:"User",tree:d,queue:d}],p=await B(i,g),l=null,S=null,P=i.filter(O=>O.type==="Settings"),x=i.filter(O=>O.type==="User");P.length&&(l=ce(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),P,J())[0]),x.length&&(S=ce(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,X())[0]);let C=await de(c,p.treeInfos.slice(i.length),p.roots.slice(i.length),p.rootIndices.slice(i.length),g),{remainingAccounts:_,systemOffset:I}=c.toAccountMetas(),U=v(p,I);return await Rc({payer:n,authority:e,compressedProofArgs:U,member:Lt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:l?some({settingsMutArgs:l,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:C[0],domainConfig:s,remainingAccounts:_})}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 ut({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 L;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),u=(await de(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:d,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return fa({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:u,remainingAccounts:d})}async function jN({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new L;await t.addSystemAccounts();let{address:c,addressTree:a}=await k(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await B([],i),u=(await de(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:d,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Da({compressedProofArgs:p,args:e,authority:n,userCreationArgs:u,remainingAccounts:d})}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 u of i.writableIndexes){let d=o[u];if(!d)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:d,role:AccountRole.WRITABLE});}for(let u of i.readonlyIndexes){let d=o[u];if(!d)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:d,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 pt=33,mt=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(),pt).decode(e,n);n+=pt;let u=fixDecoderSize(getBytesDecoder(),mt).decode(e,n);n+=mt;let d=t[i].messageDataSize,g=fixDecoderSize(getBytesDecoder(),d).decode(e,n);n+=d,a.push({publicKey:o,signature:u,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+pt+mt+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(),pt).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),mt).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:u}=e[o],d=s,g=d+pt,p=g+mt;t.push({publicKeyOffset:d,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:u.length,messageInstructionIndex:65535}),s+=pt+mt+u.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 u=await _e(e),{accountMetas:d,addressLookupTableAccounts:g}=await Nr({transactionMessageBytes:r,walletAddress:u,additionalSigners:a,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(N(c)),p.push(o?id({transactionBuffer:n,payer:s.address,remainingAccounts:d,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:u}){let d=le(s),g=await ae(e),p=await _e(g),[{accountMetas:l,addressLookupTableAccounts:S,transactionMessage:P},{settingsMutArgs:x,proof:C,packedAccounts:_}]=await Promise.all([Nr({transactionMessageBytes:r,walletAddress:p,additionalSigners:d.filter(q=>!(q instanceof M)),addressesByLookupTableAddress:c}),Ee(i,e,n,o,u)]);_.addPreAccounts(l);let I=d.filter(q=>q instanceof M),{secp256r1VerifyArgs:U}=qE(I,a,_),{remainingAccounts:O,systemOffset:H}=_.toAccountMetas();return {instructions:JE({secp256r1VerifyInput:a,transactionMessage:P,accountMetas:l,compressed:i,payer:t,settingsMutArgs:x,proof:C,systemOffset:H,secp256r1VerifyArgs:U,settings:g,remainingAccounts:O}),addressLookupTableAccounts:S}}function qE(e,n,r){let s=[];for(let t of e){let c=n.length,{domainConfig:a,verifyArgs:i,signature:o,publicKey:u,message:d}=j(t,c);d&&o&&u&&n.push({message:d,signature:o,publicKey:u}),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:u,remainingAccounts:d}){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:d}));}else g.push(md({secp256r1VerifyArgs:o,settings:u,transactionMessage:p,remainingAccounts:d}));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=le(s),u=await ae(e),d=await _e(u),[{packedAccounts:g,proof:p,settingsMutArgs:l},{value:S}]=await Promise.all([Ee(i,e,n,false,t),Qe(d,t)]);if((S?.lamports??0)<BigInt(c))throw new Error("Insufficient balance");let P=[],x=[];for(let U of o)if(U instanceof M){let O=P.length,{domainConfig:H,verifyArgs:Q,signature:q,publicKey:Me,message:Ae}=j(U,O);Ae&&q&&Me&&P.push({message:Ae,signature:q,publicKey:Me}),H&&(g.addPreAccounts([{address:H,role:AccountRole.READONLY}]),Q.__option==="Some"&&x.push({domainConfigKey:H,verifyArgs:Q.value}));}else g.addPreAccounts([{address:U.address,role:AccountRole.READONLY_SIGNER,signer:U}]);let{remainingAccounts:C,systemOffset:_}=g.toAccountMetas(),I=[];if(P.length>0&&I.push(N(P)),i){if(!a||!l)throw new Error("Payer not found or proof args is missing.");let U=v(p,_);I.push(La({amount:c,settingsMutArgs:l,compressedProofArgs:U,payer:a,secp256r1VerifyArgs:x,source:d,destination:r,remainingAccounts:C}));}else I.push(Ra({amount:c,secp256r1VerifyArgs:x,source:d,destination:r,settings:u,remainingAccounts:C}));return I}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:u=false}){let d=le(t),g=await ae(e),p=await _e(g),[l,[S],P,[x],[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())})]),[_,I,U]=await Promise.all([Qe(P,c),Qe(l,c),nD(u,e,n,c)]),O=!!_.value,H=!!I.value,Q=H?getTokenDecoder().decode(getBase64Encoder().encode(I.value.data[0])).amount:BigInt(0),q=BigInt(0),Me=true;if(Q<BigInt(a)){let me=await Qe(S,c);Me=!!me.value,q=BigInt(Me?oD(new Uint8Array(getBase64Encoder().encode(me.value.data[0])))?.amount??0:0);}let Ae=O?P:void 0,Ne=O?void 0:x,yt=H&&(Q+q<BigInt(a)||q>BigInt(0)||!O)||!H&&O,nr=!!Ne,[{parsed:st,compressedAccount:oe},Fr]=await Promise.all([rD(p,s,Q,q,BigInt(a),c),tD(yt,C,c)]);if(Q+q+BigInt(st?.amount.toNumber()??0)<BigInt(a))throw new Error("Insufficient balance");let y=null,ie=null,Pe=new L;if(Fr&&Pe.addPreAccounts([{address:s,role:AccountRole.WRITABLE}]),U||oe){await Pe.addSystemAccounts();let me=[];if(oe&&me.push({hash:oe.hash,tree:oe.treeInfo.tree,queue:oe.treeInfo.queue,data:oe.data,address:oe.address}),U&&me.push(U),ie=await B(me,[]),U){let Ve=oe?1:0;y=ce(Pe,ie.treeInfos.slice(Ve),ie.leafIndices.slice(Ve),ie.rootIndices.slice(Ve),ie.proveByIndices.slice(Ve),me.slice(Ve),J())[0];}}let F=oe&&st&&ie?some({amount:st.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 me of d)if(me instanceof M){let Ve=we.length,{domainConfig:zr,verifyArgs:xs,signature:Is,publicKey:Cs,message:Es}=j(me,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:me.address,role:AccountRole.READONLY_SIGNER,signer:me}]);let{remainingAccounts:fs,systemOffset:Ou}=Pe.toAccountMetas(),sr=[];we.length>0&&sr.push(N(we));let Ss=v(ie,Ou);if(u){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:S,sourceSplTokenAccount:l,destinationCtokenTokenAccount:Ne,destinationSplTokenAccount:Ae,mint:s,tokenProgram:o,remainingAccounts:fs,sourceCompressedTokenAccount:F,compressibleConfig:Cu,splInterfacePda:yt?C:void 0,rentSponsor:nr?Eu:void 0}));}else sr.push(Va({amount:a,secp256r1VerifyArgs:Gr,source:p,destination:r,destinationCtokenTokenAccount:Ne,destinationSplTokenAccount:Ae,settings:g,mint:s,tokenProgram:o,remainingAccounts:fs,payer:i,sourceCompressedTokenAccount:F,compressedProofArgs:Ss,sourceSplTokenAccount:l,sourceCtokenTokenAccount:S,compressibleConfig:Cu,splInterfacePda:yt?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 Qe(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 pe([{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,u=le(e),d=u.filter(_=>!(_ instanceof M));a.addPreAccounts(d.map(_=>({address:_.address,role:AccountRole.READONLY_SIGNER,signer:_})));let g=u.filter(_=>_ instanceof M),p=[],l=[];for(let _ of g){let I=l.length,{domainConfig:U,verifyArgs:O,signature:H,publicKey:Q,message:q}=j(_,I);q&&H&&Q&&l.push({message:q,signature:H,publicKey:Q}),U&&(a.addPreAccounts([{address:U,role:AccountRole.READONLY}]),O.__option==="Some"&&p.push({domainConfigKey:U,verifyArgs:O.value}));}let{remainingAccounts:S,systemOffset:P}=a.toAccountMetas(),x=v(i,P),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:x,settingsMutArgs:o,remainingAccounts:S,secp256r1VerifyArgs:p}));}else C.push(await tc({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:S,secp256r1VerifyArgs:p}));return C}async function d2({createUserArgs:e,payer:n}){let r=new L;await r.addSystemAccounts(),r.addPreAccounts(e.map(d=>({address:d.member.address,role:AccountRole.READONLY_SIGNER,signer:d.member})));let s=await De(),t=await Promise.all(e.map(async d=>{let{address:g,addressTree:p}=await k(d.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(),u=v(c,o);return await Oc({compressedProofArgs:u,payer:n,createUserArgs:e.map((d,g)=>({member:d.member.address,role:d.role,userCreationArgs:a[g],transactionManagerUrl:d.role===2?d.transactionManagerUrl:null})),remainingAccounts:i})}async function y2({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new L;await c.addSystemAccounts();let a=[],i=[];i.push(...await pe([{address:(await k(r.address,s)).address,type:"User"}],t));let o=await De(),{address:u,addressTree:d}=await se(e,o);a.push({address:u,queue:d,tree:d,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(I=>I.type==="User"),X())[0],P=(await de(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),a)).find(I=>I.type==="Settings")??null,{remainingAccounts:x,systemOffset:C}=c.toAccountMetas(),_=v(p,C);if(!P)throw new Error("Settings creation args is missing.");return await mc({settingsIndex:e,payer:n,initialMember:r,userReadonlyArgs:l,compressedProofArgs:_,settingsCreation:P,remainingAccounts:x})}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=le(s),u=o.filter(C=>C instanceof M),d=[],g=[];for(let C of u){let _=d.length,{domainConfig:I,verifyArgs:U,signature:O,publicKey:H,message:Q}=j(C,_);Q&&O&&H&&d.push({message:Q,signature:O,publicKey:H}),I&&(c.addPreAccounts([{address:I,role:AccountRole.READONLY}]),U.__option==="Some"&&g.push({domainConfigKey:I,verifyArgs:U.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(),S=v(a,l),P=[];d.length>0&&P.push(N(d));let x=await ae(e);return P.push(Fc({settings:x,payer:r,settingsMutArgs:i,compressedProofArgs:S,secp256r1VerifyArgs:g,remainingAccounts:p})),P}async function U2({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new L;await a.addSystemAccounts();let i=await De(),{address:o,addressTree:u}=await k(r.address,i),d=[{address:o,tree:u,queue:u,type:"User"}],g=await B([],d),p=(await de(a,g.treeInfos,g.roots,g.rootIndices,d))[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 L;await s.addSystemAccounts();let t=await pe([{address:(await k(e.address,n)).address,type:"User"}]),c=await B(t,[]),a=ce(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),u=v(c,o);return ca({authority:e,transactionManagerUrl:r,compressedProofArgs:u,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:u}=j(n),d=[];i&&o&&u&&d.push({message:i,signature:o,publicKey:u});let g=await Wr(n instanceof M?n:n.address,r,t),p=[];p.push({address:(await k(n instanceof M?n:n.address,r)).address,type:"User"});let l,S=null,P,x=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"}),S={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"}),x={start:p.length-1,end:p.length}):P=await ae(s.index));let C=new L;await C.addSystemAccounts();let _=await pe(p,t),I=await B(_,[]),U=ce(C,I.treeInfos.slice(0,1),I.leafIndices.slice(0,1),I.rootIndices.slice(0,1),I.proveByIndices.slice(0,1),_.slice(0,1),X())[0],O=S?some(ce(C,I.treeInfos.slice(S.start,S.end),I.leafIndices.slice(S.start,S.end),I.rootIndices.slice(S.start,S.end),I.proveByIndices.slice(S.start,S.end),_.slice(S.start,S.end),J())[0]):none(),H=x?some(ce(C,I.treeInfos.slice(x.start,x.end),I.leafIndices.slice(x.start,x.end),I.rootIndices.slice(x.start,x.end),I.proveByIndices.slice(x.start,x.end),_.slice(x.start,x.end),J())[0]):none(),{remainingAccounts:Q,systemOffset:q}=C.toAccountMetas(),Me=v(I,q),Ae=[];return d.length>0&&Ae.push(N(d)),Ae.push(ga({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof M?void 0:n,oldSettings:l,oldSettingsMutArgs:O,newSettings:P,newSettingsMutArgs:H,compressedProofArgs:Me,userMutArgs:U,remainingAccounts:Q})),Ae}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:u,proof:d,settingsMutArgs:g}=await Ee(c,e,n,false,a),{remainingAccounts:p,systemOffset:l}=u.toAccountMetas(),{domainConfig:S,verifyArgs:P,message:x,signature:C,publicKey:_}=j(r),I=[];if(x&&C&&_&&I.push(N([{message:x,signature:C,publicKey:_}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let U=v(d,l);I.push(ri({transactionBuffer:s,domainConfig:S,closer:r instanceof M?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:P,settingsMutArgs:g,payer:t,compressedProofArgs:U,remainingAccounts:p}));}else I.push(Za({transactionBuffer:s,domainConfig:S,closer:r instanceof M?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:P,remainingAccounts:[]}));return I}function Pu({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:u,expectedSecp256r1Signers:d}){let{domainConfig:g,verifyArgs:p,message:l,signature:S,publicKey:P}=j(n),x=[];if(l&&S&&P&&x.push(N([{message:l,signature:S,publicKey:P}])),u){let{settingsReadonlyArgs:C,compressedProofArgs:_,remainingAccounts:I}=u;x.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:d},settingsReadonlyArgs:C,compressedProofArgs:_,remainingAccounts:I}));}else x.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:d},remainingAccounts:[]}));return x}function hu({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=j(e),u=[];return i&&a&&o&&u.push(N([{message:i,signature:a,publicKey:o}])),s?u.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})):u.push(xi({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,remainingAccounts:[]})),u}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}=j(n),u=[];return o&&a&&i&&u.push(N([{message:o,signature:a,publicKey:i}])),s?u.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})):u.push(zi({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,remainingAccounts:[]})),u}async function $5({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await dD(r),a=new L,i=null,o=null,u=[];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,u=g.userMutArgs??[];}return {configActions:await AD({configActionsArgs:r,userMutArgs:u,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=>k(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=>k(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 pe(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await B(i,[]),u=[],d=[];for(let l of i)l.type==="Settings"?u.push(l):l.type==="User"&&d.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),u,J())[0]),d.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),d,X());}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 k(a.member,a.userAddressTreeIndex).then(o=>r.find(u=>equalBytes(new Uint8Array(u.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=>k(a.member,a.userAddressTreeIndex).then(i=>{let o=r.find(u=>equalBytes(new Uint8Array(u.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:gt(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:gt(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:gt(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:u=false,additionalVoters:d=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:l}){let S=await ae(n),P=Math.floor(Math.random()*255),x=await Jd(S,t instanceof M?t:t.address,P),C=[],_=[];for(let F=0;F<s.length;F+=p){let we=s.subarray(F,F+p);C.push(we),_.push(sha256(we));}let I=sha256(new Uint8Array(s)),{settingsReadonlyArgs:U,settingsMutArgs:O,proof:H,packedAccounts:Q}=await Ee(u,n,r,false,l),{remainingAccounts:q,systemOffset:Me}=Q.toAccountMetas(),Ae=H&&U&&O?{settingsReadonlyArgs:U,settingsMutArgs:O,compressedProofArgs:v(H,Me),remainingAccounts:q,payer:e}:null,Ne=le([t,...c?[c]:[],...d]).filter(F=>F instanceof M).map(F=>({memberKey:gt(F),messageHash:is(F.authResponse)})),yt=Pu({finalBufferHash:I,finalBufferSize:s.length,bufferIndex:P,payer:e,transactionBufferAddress:x,settings:S,creator:t,preauthorizeExecution:!c,bufferExtendHashes:_,compressedArgs:Ae,expectedSecp256r1Signers:Ne}),nr=C.map(F=>Ru({transactionMessageBytes:F,transactionBufferAddress:x,settings:S,compressed:u})),st=d.map(F=>bu({voter:F,transactionBufferAddress:x,settings:S,compressedArgs:Ae})),oe=hu({compressedArgs:Ae,settings:S,executor:c,transactionBufferAddress:x}),{instructions:Fr,addressLookupTableAccounts:y}=await yu({compressed:u,settings:S,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),ie=F=>({payer:e,instructions:F,addressesByLookupTableAddress:y});return [ie(yt),...nr.map(F=>ie([F])),...st.length?[ie(st.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(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 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:S,drainedKeys:P}=l;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),a.writable.push(...P.writable),a.readonly.push(...P.readonly);}}let[o,u]=t.getMessageComponents(),g=new Hr(u,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:u,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:u=false}){let{instructions:d,addressLookupTableAccounts:g}=await lu({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:i});return {payer:e,instructions:d,addressesByLookupTableAddress:g}}
|
|
2
|
-
export{jo as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,Dd as AuthenticationContextSchema,ar as BACKOFF_MAX_DELAY_MS,Ps as BUNDLE_POLL_DELAY_MS,Ms as BUNDLE_POLL_MAX_RETRIES,Md as BaseResponseSchema,ge 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,Zt 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,EC as TransactionDetailsSchema,Ws as TransactionError,Ak as TransactionPayloadSchema,Ed as TransactionPayloadWithBase64MessageBytesSchema,ot as UserRole,G 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,xt as getCompressedAccountMetaDecoder,St as getCompressedAccountMetaEncoder,zD as getCompressedAccountMetaReadOnlyCodec,Dt as getCompressedAccountMetaReadOnlyDecoder,Et as getCompressedAccountMetaReadOnlyEncoder,qD as getCompressedProofCodec,nn as getCompressedProofDecoder,rn as getCompressedProofEncoder,se as getCompressedSettingsAddressFromIndex,XD as getCompressedSettingsCodec,tM as getCompressedSettingsDataCodec,ht as getCompressedSettingsDataDecoder,Pt as getCompressedSettingsDataEncoder,J as getCompressedSettingsDecoder,Mt 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,ut 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,vt as getExpectedSecp256r1SignersDecoder,_t 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,at as getLightProtocolRpc,EM as getLinkWalletArgsCodec,mn as getLinkWalletArgsDecoder,pn as getLinkWalletArgsEncoder,hM as getMemberCodec,bt as getMemberDecoder,Rt 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,Wt as getPackedAddressTreeInfoDecoder,Ut as getPackedAddressTreeInfoEncoder,VM as getPackedMerkleContextCodec,xn as getPackedMerkleContextDecoder,Sn as getPackedMerkleContextEncoder,GM as getPackedStateTreeInfoCodec,Ct as getPackedStateTreeInfoDecoder,It 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,Lt as getSecp256r1PubkeyDecoder,En as getSecp256r1PubkeyEncoder,KE as getSecp256r1SignatureOffsetsDataDecoder,zE as getSecp256r1SignatureOffsetsDataEncoder,cP as getSecp256r1VerifyArgsCodec,V as getSecp256r1VerifyArgsDecoder,w as getSecp256r1VerifyArgsEncoder,uP as getSecp256r1VerifyArgsWithDomainAddressCodec,Z as getSecp256r1VerifyArgsWithDomainAddressDecoder,Y as getSecp256r1VerifyArgsWithDomainAddressEncoder,N as getSecp256r1VerifyInstruction,aw as getSecp256r1VerifyInstructionDataCodec,mu as getSecp256r1VerifyInstructionDataDecoder,Tu as getSecp256r1VerifyInstructionDataEncoder,Ld as getSendAndConfirmTransaction,tR as getSettingsCodec,mP as getSettingsCreationArgsCodec,Ot as getSettingsCreationArgsDecoder,kt as getSettingsCreationArgsEncoder,ho as getSettingsDecoder,eR as getSettingsDiscriminatorBytes,N1 as getSettingsEncoder,ae as getSettingsFromIndex,lP as getSettingsIndexWithAddressCodec,Nt as getSettingsIndexWithAddressDecoder,Bt as getSettingsIndexWithAddressEncoder,IP as getSettingsMutArgsCodec,K as getSettingsMutArgsDecoder,z as getSettingsMutArgsEncoder,MP as getSettingsReadonlyArgsCodec,Vt as getSettingsReadonlyArgsDecoder,wt as getSettingsReadonlyArgsEncoder,KO as getSignedSecp256r1Key,ZB as getSignedTransactionManager,ne as getSolanaRpc,Wd as getSolanaRpcEndpoint,bP as getSourceCompressedTokenArgsCodec,Ft as getSourceCompressedTokenArgsDecoder,Ht 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,zt as getTransactionBufferCreateArgsDecoder,Gt 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,jt as getTransactionMessageDecoder,Kt as getTransactionMessageEncoder,k as getUserAccountAddress,zP as getUserCodec,JP as getUserCreationArgsCodec,Se as getUserCreationArgsDecoder,fe as getUserCreationArgsEncoder,X 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
|
|
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,getU64Encoder,getU64Decoder,getOptionEncoder,getOptionDecoder,getArrayEncoder,getArrayDecoder,getU16Encoder,getBooleanEncoder,getU16Decoder,getBooleanDecoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getUnitEncoder,getUnitDecoder,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,CTOKEN_PROGRAM_ID,createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,encodeBN254toBase58,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import f from'zod';import {estimateComputeUnitLimitFactory,getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTokenDecoder,AccountState,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 Qr=1644,Ar=2e5,fo=1.1,So=30,xo=3e3,ke=3,Le=500,gr=2,pr=3e4,$r=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Io="https://mainnet.block-engine.jito.wtf/api/v1",Co="https://bundles.jito.wtf/api/v1/bundles/tip_floor",Eo="landed_tips_75th_percentile",Do=255,Po=400,Mo=429,en=500;var Ee=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);}},Oe=class extends Ee{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},ne=class extends Ee{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},z=class extends Ee{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},De=class extends Ee{constructor(r,s,t){super(r,"NETWORK_ERROR",{statusCode:s,url:t});this.statusCode=s;this.url=t;}},ho=class extends Ee{constructor(r,s,t){super(r,"TRANSACTION_ERROR",{signature:s,logs:t});this.signature=s;this.logs=t;}},ye=class extends Ee{constructor(r,s,t){super(r,"BUNDLE_ERROR",{bundleId:s,attempt:t});this.bundleId=s;this.attempt=t;}},mr=class extends Ee{constructor(r,s,t){super(`Operation "${r}" failed after ${s} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=s;this.lastError=t;}},yr=class extends Ee{constructor(r,s,t){super(r,"PERMISSION_ERROR",{required:s,actual:t});this.required=s;this.actual=t;}};var Ro=new Uint8Array([201,232,212,229,59,241,106,197]);function HM(){return fixEncoderSize(getBytesEncoder(),8).encode(Ro)}function lg(){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:Ro}))}function bo(){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 FM(){return combineCodec(lg(),bo())}function _o(e){return decodeAccount(e,bo())}async function vo(e,n,r){let s=await fg(e,n,r);return assertAccountExists(s),s}async function fg(e,n,r){let s=await fetchEncodedAccount(e,n,r);return _o(s)}async function GM(e,n,r){let s=await Sg(e,n,r);return assertAccountsExist(s),s}async function Sg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>_o(t))}function zM(){return 846}var ko=new Uint8Array([42,206,176,58,175,129,130,233]);function JM(){return fixEncoderSize(getBytesEncoder(),8).encode(ko)}function Wg(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:ko}))}function Lo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function qM(){return combineCodec(Wg(),Lo())}function Oo(e){return decodeAccount(e,Lo())}async function YM(e,n,r){let s=await kg(e,n,r);return assertAccountExists(s),s}async function kg(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Oo(s)}async function ZM(e,n,r){let s=await Lg(e,n,r);return assertAccountsExist(s),s}async function Lg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Oo(t))}function XM(){return 24}function tn(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function rn(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function eh(){return combineCodec(tn(),rn())}function nn(){return getStructEncoder([["memberKey",se()],["permissions",He()],["userReadonlyArgs",Re()]])}function sn(){return getStructDecoder([["memberKey",oe()],["permissions",Fe()],["userReadonlyArgs",be()]])}function sh(){return combineCodec(nn(),sn())}function on(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function cn(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function ah(){return combineCodec(on(),cn())}function Ct(){return getStructEncoder([["treeInfo",Dt()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function Et(){return getStructDecoder([["treeInfo",Pt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function Ah(){return combineCodec(Ct(),Et())}function Mt(){return getStructEncoder([["treeInfo",Dt()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function ht(){return getStructDecoder([["treeInfo",Pt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function yh(){return combineCodec(Mt(),ht())}function an(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function dn(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function fh(){return combineCodec(an(),dn())}function mn(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function yn(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function Ih(){return combineCodec(mn(),yn())}function Rt(){return getStructEncoder([["data",getOptionEncoder(bt())]])}function Z(){return getStructDecoder([["data",getOptionDecoder(_t())]])}function Ph(){return combineCodec(Rt(),Z())}function bt(){return getStructEncoder([["threshold",getU8Encoder()],["bump",getU8Encoder()],["index",getU128Encoder()],["multiWalletBump",getU8Encoder()],["members",getArrayEncoder(vt())],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function _t(){return getStructDecoder([["threshold",getU8Decoder()],["bump",getU8Decoder()],["index",getU128Decoder()],["multiWalletBump",getU8Decoder()],["members",getArrayDecoder(Ut())],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function bh(){return combineCodec(bt(),_t())}function Wt(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",ln()],["tlv",getOptionEncoder(getArrayEncoder(Tn()))],["hasDelegate",getBooleanEncoder()],["isFrozen",getBooleanEncoder()]])}function kt(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",fn()],["tlv",getOptionDecoder(getArrayDecoder(Lt()))],["hasDelegate",getBooleanDecoder()],["isFrozen",getBooleanDecoder()]])}function Wh(){return combineCodec(Wt(),kt())}function In(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",En()]])}function Cn(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",Dn()]])}function Bh(){return combineCodec(In(),Cn())}function En(){return getStructEncoder([["configAccountVersion",getU16Encoder()],["compressToPubkey",getU8Encoder()],["accountVersion",getU8Encoder()],["lamportsPerWrite",getU32Encoder()],["compressionAuthority",fixEncoderSize(getBytesEncoder(),32)],["rentSponsor",fixEncoderSize(getBytesEncoder(),32)],["lastClaimedSlot",getU64Encoder()],["rentExemptionPaid",getU32Encoder()],["reserved",getU32Encoder()],["rentConfig",hn()]])}function Dn(){return getStructDecoder([["configAccountVersion",getU16Decoder()],["compressToPubkey",getU8Decoder()],["accountVersion",getU8Decoder()],["lamportsPerWrite",getU32Decoder()],["compressionAuthority",fixDecoderSize(getBytesDecoder(),32)],["rentSponsor",fixDecoderSize(getBytesDecoder(),32)],["lastClaimedSlot",getU64Decoder()],["rentExemptionPaid",getU32Decoder()],["reserved",getU32Decoder()],["rentConfig",Rn()]])}function Hh(){return combineCodec(En(),Dn())}function Ge(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(vn())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(nn())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Wn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function ze(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Un())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(sn())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(kn())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function Kh(){return combineCodec(Ge(),ze())}function jh(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Jh(e,n){return n.__kind===e}function Ln(){return getStructEncoder([["member",getAddressEncoder()],["role",Ke()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",xe()]])}function On(){return getStructDecoder([["member",getAddressDecoder()],["role",je()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",Ie()]])}function Xh(){return combineCodec(Ln(),On())}function vn(){return getStructEncoder([["memberKey",se()],["permissions",He()]])}function Un(){return getStructDecoder([["memberKey",oe()],["permissions",Fe()]])}function tR(){return combineCodec(vn(),Un())}function Ot(){return getStructEncoder([["memberKey",se()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function Bt(){return getStructDecoder([["memberKey",oe()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function oR(){return combineCodec(Ot(),Bt())}function Tn(){return getDiscriminatedUnionEncoder([["Placeholder0",getUnitEncoder()],["Placeholder1",getUnitEncoder()],["Placeholder2",getUnitEncoder()],["Placeholder3",getUnitEncoder()],["Placeholder4",getUnitEncoder()],["Placeholder5",getUnitEncoder()],["Placeholder6",getUnitEncoder()],["Placeholder7",getUnitEncoder()],["Placeholder8",getUnitEncoder()],["Placeholder9",getUnitEncoder()],["Placeholder10",getUnitEncoder()],["Placeholder11",getUnitEncoder()],["Placeholder12",getUnitEncoder()],["Placeholder13",getUnitEncoder()],["Placeholder14",getUnitEncoder()],["Placeholder15",getUnitEncoder()],["Placeholder16",getUnitEncoder()],["Placeholder17",getUnitEncoder()],["Placeholder18",getUnitEncoder()],["TokenMetadata",getStructEncoder([["fields",getTupleEncoder([Hn()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([Bn()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([wn()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([Gn()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([Kn()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([an()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([In()])]])]])}function Lt(){return getDiscriminatedUnionDecoder([["Placeholder0",getUnitDecoder()],["Placeholder1",getUnitDecoder()],["Placeholder2",getUnitDecoder()],["Placeholder3",getUnitDecoder()],["Placeholder4",getUnitDecoder()],["Placeholder5",getUnitDecoder()],["Placeholder6",getUnitDecoder()],["Placeholder7",getUnitDecoder()],["Placeholder8",getUnitDecoder()],["Placeholder9",getUnitDecoder()],["Placeholder10",getUnitDecoder()],["Placeholder11",getUnitDecoder()],["Placeholder12",getUnitDecoder()],["Placeholder13",getUnitDecoder()],["Placeholder14",getUnitDecoder()],["Placeholder15",getUnitDecoder()],["Placeholder16",getUnitDecoder()],["Placeholder17",getUnitDecoder()],["Placeholder18",getUnitDecoder()],["TokenMetadata",getStructDecoder([["fields",getTupleDecoder([Fn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([Nn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([Vn()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([zn()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([jn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([dn()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([Cn()])]])]])}function dR(){return combineCodec(Tn(),Lt())}function uR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function AR(e,n){return n.__kind===e}function Jn(){return getStructEncoder([["settingsMutArgs",K()],["transactionManager",getOptionEncoder(Re())]])}function qn(){return getStructDecoder([["settingsMutArgs",j()],["transactionManager",getOptionDecoder(be())]])}function yR(){return combineCodec(Jn(),qn())}function vt(){return getStructEncoder([["pubkey",se()],["permissions",He()],["role",getU8Encoder()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function Ut(){return getStructDecoder([["pubkey",oe()],["permissions",Fe()],["role",getU8Decoder()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function SR(){return combineCodec(vt(),Ut())}function se(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function oe(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function CR(){return combineCodec(se(),oe())}function Xn(){return getStructEncoder([["authorityCreationArgs",xe()],["compressedProofArgs",E()]])}function Qn(){return getStructDecoder([["authorityCreationArgs",Ie()],["compressedProofArgs",D()]])}function MR(){return combineCodec(Xn(),Qn())}function Nt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function wt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function bR(){return combineCodec(Nt(),wt())}function ln(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function fn(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function UR(){return combineCodec(ln(),fn())}function Dt(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function Pt(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function LR(){return combineCodec(Dt(),Pt())}function Bn(){return getStructEncoder([])}function Nn(){return getStructDecoder([])}function NR(){return combineCodec(Bn(),Nn())}function wn(){return getStructEncoder([])}function Vn(){return getStructDecoder([])}function HR(){return combineCodec(wn(),Vn())}function He(){return getStructEncoder([["mask",getU8Encoder()]])}function Fe(){return getStructDecoder([["mask",getU8Decoder()]])}function zR(){return combineCodec(He(),Fe())}function E(){return getStructEncoder([["proof",getOptionEncoder(mn())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function D(){return getStructDecoder([["proof",getOptionDecoder(yn())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function qR(){return combineCodec(E(),D())}function Wn(){return getStructEncoder([["memberKey",se()],["userArgs",$n()]])}function kn(){return getStructDecoder([["memberKey",oe()],["userArgs",es()]])}function QR(){return combineCodec(Wn(),kn())}function hn(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function Rn(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function tb(){return combineCodec(hn(),Rn())}function ns(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Vt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function sb(){return combineCodec(ns(),Vt())}function H(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function F(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function ab(){return combineCodec(H(),F())}function X(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",H()]])}function Q(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",F()]])}function Ab(){return combineCodec(X(),Q())}function Ht(){return getStructEncoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",getU8Encoder()]])}function Ft(){return getStructDecoder([["addressTreeInfo",wt()],["outputStateTreeIndex",getU8Decoder()]])}function yb(){return combineCodec(Ht(),Ft())}function Gt(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function zt(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function fb(){return combineCodec(Gt(),zt())}function K(){return getStructEncoder([["accountMeta",Ct()],["data",Rt()]])}function j(){return getStructDecoder([["accountMeta",Et()],["data",Z()]])}function Cb(){return combineCodec(K(),j())}function Kt(){return getStructEncoder([["accountMeta",Mt()],["data",Rt()]])}function jt(){return getStructDecoder([["accountMeta",ht()],["data",Z()]])}function Mb(){return combineCodec(Kt(),jt())}function Jt(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function qt(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function bb(){return combineCodec(Jt(),qt())}function Hn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(tn())]])}function Fn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(rn())]])}function Wb(){return combineCodec(Hn(),Fn())}function Yt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getArrayEncoder(Ot())]])}function Zt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getArrayDecoder(Bt())]])}function Bb(){return combineCodec(Yt(),Zt())}function Xt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(on())],["addressTableLookups",getArrayEncoder(us())]])}function Qt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(cn())],["addressTableLookups",getArrayDecoder(As())]])}function Hb(){return combineCodec(Xt(),Qt())}function us(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function As(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function zb(){return combineCodec(us(),As())}function Gn(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function zn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function Jb(){return combineCodec(Gn(),zn())}function Kn(){return getStructEncoder([["transferring",getU8Encoder()]])}function jn(){return getStructDecoder([["transferring",getU8Decoder()]])}function Zb(){return combineCodec(Kn(),jn())}function Xe(){return getStructEncoder([["member",se()],["domainConfig",getOptionEncoder(getAddressEncoder())],["role",Ke()],["delegatedTo",getOptionEncoder(Gt())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function $(){return getStructDecoder([["member",oe()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",je()],["delegatedTo",getOptionDecoder(zt())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function e_(){return combineCodec(Xe(),$())}function xe(){return getStructEncoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",getU8Encoder()]])}function Ie(){return getStructDecoder([["addressTreeInfo",wt()],["outputStateTreeIndex",getU8Decoder()]])}function s_(){return combineCodec(xe(),Ie())}function Qe(){return getStructEncoder([["accountMeta",Ct()],["data",Xe()]])}function $e(){return getStructDecoder([["accountMeta",Et()],["data",$()]])}function i_(){return combineCodec(Qe(),$e())}function Re(){return getStructEncoder([["accountMeta",Mt()],["data",Xe()]])}function be(){return getStructDecoder([["accountMeta",ht()],["data",$()]])}function g_(){return combineCodec(Re(),be())}function $n(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Re()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([Qe()])]])]])}function es(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([be()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([$e()])]])]])}function T_(){return combineCodec($n(),es())}function l_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function f_(e,n){return n.__kind===e}var it=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(it||{});function Ke(){return getEnumEncoder(it)}function je(){return getEnumDecoder(it)}function I_(){return combineCodec(Ke(),je())}var wc=new Uint8Array([223,179,163,190,177,224,67,173]);function Cv(){return fixEncoderSize(getBytesEncoder(),8).encode(wc)}function Al(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(vt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:wc}))}function Vc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(Ut())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function Ev(){return combineCodec(Al(),Vc())}function Hc(e){return decodeAccount(e,Vc())}async function Dv(e,n,r){let s=await ms(e,n,r);return assertAccountExists(s),s}async function ms(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Hc(s)}async function Pv(e,n,r){let s=await gl(e,n,r);return assertAccountsExist(s),s}async function gl(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Hc(t))}var jc=new Uint8Array([90,36,35,219,93,225,110,96]);function bv(){return fixEncoderSize(getBytesEncoder(),8).encode(jc)}function _l(){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",se()],["executor",se()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(se())],["expectedSecp256r1Signers",getArrayEncoder(Ot())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:jc}))}function Jc(){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",oe()],["executor",oe()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(oe())],["expectedSecp256r1Signers",getArrayDecoder(Bt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function _v(){return combineCodec(_l(),Jc())}function qc(e){return decodeAccount(e,Jc())}async function Yc(e,n,r){let s=await vl(e,n,r);return assertAccountExists(s),s}async function vl(e,n,r){let s=await fetchEncodedAccount(e,n,r);return qc(s)}async function vv(e,n,r){let s=await Ul(e,n,r);return assertAccountsExist(s),s}async function Ul(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>qc(t))}var Qc=new Uint8Array([105,23,173,2,197,255,80,87]);function kv(){return fixEncoderSize(getBytesEncoder(),8).encode(Qc)}function Zl(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Qc}))}function $c(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function Lv(){return combineCodec(Zl(),$c())}function ea(e){return decodeAccount(e,$c())}async function ta(e,n,r){let s=await Xl(e,n,r);return assertAccountExists(s),s}async function Xl(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ea(s)}async function Ov(e,n,r){let s=await Ql(e,n,r);return assertAccountsExist(s),s}async function Ql(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ea(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 na(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function O(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:O(r.value),role:ra(r.value)?upgradeRoleToSigner(s):s,...ra(r.value)?{signer:r.value}:{}})}}function ra(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var oa=new Uint8Array([8]);function $v(){return fixEncoderSize(getBytesEncoder(),1).encode(oa)}function Cs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:oa}))}function ca(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function eU(){return combineCodec(Cs(),ca())}async function aa(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=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:Cs().encode(c),programAddress:r})}function tU(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=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:Cs().encode(c),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:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:ca().decode(e.data)}}var ga=new Uint8Array([9]);function dU(){return fixEncoderSize(getBytesEncoder(),1).encode(ga)}function Ds(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(Ge())],["secp256r1VerifyArgs",getArrayEncoder(X())],["compressedProofArgs",getOptionEncoder(E())]]),e=>({...e,discriminator:ga}))}function pa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(ze())],["secp256r1VerifyArgs",getArrayDecoder(Q())],["compressedProofArgs",getOptionDecoder(D())]])}function uU(){return combineCodec(Ds(),pa())}async function ma(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(na(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=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ds().encode(c),programAddress:r})}function AU(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=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ds().encode(c),programAddress:r})}function gU(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:pa().decode(e.data)}}var Sa=new Uint8Array([19]);function SU(){return fixEncoderSize(getBytesEncoder(),1).encode(Sa)}function xa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(Ge())],["secp256r1VerifyArgs",getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Sa}))}function Ia(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(ze())],["secp256r1VerifyArgs",getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function xU(){return combineCodec(xa(),Ia())}function Ca(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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:xa().encode(c),programAddress:r})}function IU(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:Ia().decode(e.data)}}var Pa=new Uint8Array([18]);function RU(){return fixEncoderSize(getBytesEncoder(),1).encode(Pa)}function Ps(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",E()],["settingsCreation",Ht()],["userReadonlyArgs",Re()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Pa}))}function Ma(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["settingsCreation",Ft()],["userReadonlyArgs",be()],["settingsIndex",getU128Decoder()]])}function bU(){return combineCodec(Ps(),Ma())}async function ha(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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Ps().encode(c),programAddress:r})}function _U(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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Ps().encode(c),programAddress:r})}function vU(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:Ma().decode(e.data)}}var La=new Uint8Array([0]);function NU(){return fixEncoderSize(getBytesEncoder(),1).encode(La)}function hs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",xe()],["compressedProofArgs",E()]]),e=>({...e,discriminator:La}))}function Oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",Ie()],["compressedProofArgs",D()]])}function wU(){return combineCodec(hs(),Oa())}async function Ba(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=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:hs().encode(c),programAddress:r})}function VU(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=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:hs().encode(c),programAddress:r})}function HU(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:Oa().decode(e.data)}}var wa=new Uint8Array([4]);function qU(){return fixEncoderSize(getBytesEncoder(),1).encode(wa)}function bs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",E()],["member",ns()],["role",Ke()],["userAccountCreationArgs",xe()],["linkWalletArgs",getOptionEncoder(Jn())]]),e=>({...e,discriminator:wa}))}function Va(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["member",Vt()],["role",je()],["userAccountCreationArgs",Ie()],["linkWalletArgs",getOptionDecoder(qn())]])}function YU(){return combineCodec(bs(),Va())}async function Ha(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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:bs().encode(c),programAddress:r})}function ZU(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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:bs().encode(c),programAddress:r})}function XU(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:Va().decode(e.data)}}var Ga=new Uint8Array([3]);function nW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ga)}function vs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Ga}))}function za(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function sW(){return combineCodec(vs(),za())}async function Ka(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=y(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:vs().encode({}),programAddress:r})}function oW(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=y(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:vs().encode({}),programAddress:r})}function cW(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:za().decode(e.data)}}var Ja=new Uint8Array([5]);function pW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ja)}function Ws(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",E()],["createUserArgs",getArrayEncoder(Ln())]]),e=>({...e,discriminator:Ja}))}function qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["createUserArgs",getArrayDecoder(On())]])}function mW(){return combineCodec(Ws(),qa())}async function Ya(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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Ws().encode(c),programAddress:r})}function yW(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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Ws().encode(c),programAddress:r})}function TW(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:qa().decode(e.data)}}var Qa=new Uint8Array([17]);function EW(){return fixEncoderSize(getBytesEncoder(),1).encode(Qa)}function $a(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",K()],["compressedProofArgs",E()],["secp256r1VerifyArgs",getArrayEncoder(X())]]),e=>({...e,discriminator:Qa}))}function ei(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",j()],["compressedProofArgs",D()],["secp256r1VerifyArgs",getArrayDecoder(Q())]])}function DW(){return combineCodec($a(),ei())}function ti(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=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:$a().encode(c),programAddress:r})}function PW(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:ei().decode(e.data)}}var si=new Uint8Array([2]);function vW(){return fixEncoderSize(getBytesEncoder(),1).encode(si)}function oi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:si}))}function ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function UW(){return combineCodec(oi(),ci())}function ai(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=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:oi().encode(c),programAddress:r})}function WW(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:ci().decode(e.data)}}var Ai=new Uint8Array([1]);function VW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ai)}function Ls(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Xn())]]),e=>({...e,discriminator:Ai}))}function gi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Qn())]])}function HW(){return combineCodec(Ls(),gi())}async function FW(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=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Ls().encode(c),programAddress:r})}function pi(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=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Ls().encode(c),programAddress:r})}function GW(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:gi().decode(e.data)}}var Ti=new Uint8Array([6]);function ZW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ti)}function li(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Qe()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ti}))}function fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",$e()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",D()]])}function XW(){return combineCodec(li(),fi())}function Si(e,n){let r=n?.programAddress??A,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:li().encode(c),programAddress:r})}function QW(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:fi().decode(e.data)}}var Ci=new Uint8Array([7]);function ok(){return fixEncoderSize(getBytesEncoder(),1).encode(Ci)}function Ei(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Qe()],["secp256r1VerifyArgs",getOptionEncoder(H())],["delegateTo",getOptionEncoder(Gt())],["oldSettingsMutArgs",getOptionEncoder(K())],["newSettingsMutArgs",getOptionEncoder(K())],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ci}))}function Di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",$e()],["secp256r1VerifyArgs",getOptionDecoder(F())],["delegateTo",getOptionDecoder(zt())],["oldSettingsMutArgs",getOptionDecoder(j())],["newSettingsMutArgs",getOptionDecoder(j())],["compressedProofArgs",D()]])}function ck(){return combineCodec(Ei(),Di())}function Pi(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=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:Ei().encode(c),programAddress:r})}function ak(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:Di().decode(e.data)}}var Ri=new Uint8Array([32]);function mk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ri)}function bi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",bt()],["compressedProofArgs",E()],["settingsCreationArgs",Ht()]]),e=>({...e,discriminator:Ri}))}function _i(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",_t()],["compressedProofArgs",D()],["settingsCreationArgs",Ft()]])}function yk(){return combineCodec(bi(),_i())}function vi(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=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:bi().encode(c),programAddress:r})}function Tk(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:_i().decode(e.data)}}var ki=new Uint8Array([31]);function Ek(){return fixEncoderSize(getBytesEncoder(),1).encode(ki)}function Li(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Xe()],["compressedProofArgs",E()],["userCreationArgs",xe()]]),e=>({...e,discriminator:ki}))}function Oi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",$()],["compressedProofArgs",D()],["userCreationArgs",Ie()]])}function Dk(){return combineCodec(Li(),Oi())}function Bi(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=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:Li().encode(c),programAddress:r})}function Pk(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:Oi().decode(e.data)}}var wi=new Uint8Array([29]);function Uk(){return fixEncoderSize(getBytesEncoder(),1).encode(wi)}function Os(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(X())]]),e=>({...e,discriminator:wi}))}function Vi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Q())]])}function Wk(){return combineCodec(Os(),Vi())}async function kk(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(O(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:Os().encode(c),programAddress:r})}function Hi(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=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:Os().encode(c),programAddress:r})}function Lk(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:Vi().decode(e.data)}}var zi=new Uint8Array([27]);function Fk(){return fixEncoderSize(getBytesEncoder(),1).encode(zi)}function Ki(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:zi}))}function ji(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function Gk(){return combineCodec(Ki(),ji())}function Ji(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=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:Ki().encode(c),programAddress:r})}function zk(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:ji().decode(e.data)}}var Xi=new Uint8Array([30]);function Xk(){return fixEncoderSize(getBytesEncoder(),1).encode(Xi)}function ws(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Jt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(Wt()))],["compressedProofArgs",getOptionEncoder(E())],["secp256r1VerifyArgs",getArrayEncoder(X())]]),e=>({...e,discriminator:Xi}))}function Qi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(qt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(kt()))],["compressedProofArgs",getOptionDecoder(D())],["secp256r1VerifyArgs",getArrayDecoder(Q())]])}function Qk(){return combineCodec(ws(),Qi())}async function $k(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(O(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(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(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(O(t.mint.value))]})),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:ws().encode(c),programAddress:r})}function $i(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=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:ws().encode(c),programAddress:r})}function eL(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:Qi().decode(e.data)}}var od=new Uint8Array([28]);function aL(){return fixEncoderSize(getBytesEncoder(),1).encode(od)}function Vs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Jt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(Wt()))],["secp256r1VerifyArgs",getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:od}))}function cd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(qt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(kt()))],["secp256r1VerifyArgs",getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function iL(){return combineCodec(Vs(),cd())}async function dL(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(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(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(O(t.mint.value))]})),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:Vs().encode(c),programAddress:r})}function ad(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=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:Vs().encode(c),programAddress:r})}function uL(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:cd().decode(e.data)}}var ud=new Uint8Array([13]);function lL(){return fixEncoderSize(getBytesEncoder(),1).encode(ud)}function Ad(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())]]),e=>({...e,discriminator:ud}))}function gd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function fL(){return combineCodec(Ad(),gd())}function pd(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=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:Ad().encode(c),programAddress:r})}function SL(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:gd().decode(e.data)}}var Td=new Uint8Array([23]);function ML(){return fixEncoderSize(getBytesEncoder(),1).encode(Td)}function ld(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Td}))}function fd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function hL(){return combineCodec(ld(),fd())}function Sd(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=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:ld().encode(c),programAddress:r})}function RL(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:fd().decode(e.data)}}var Cd=new Uint8Array([10]);function LL(){return fixEncoderSize(getBytesEncoder(),1).encode(Cd)}function Ed(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Yt()],["secp256r1VerifyArgs",getOptionEncoder(H())]]),e=>({...e,discriminator:Cd}))}function Dd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Zt()],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function OL(){return combineCodec(Ed(),Dd())}function Pd(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=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:Ed().encode(c),programAddress:r})}function BL(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:Dd().decode(e.data)}}var Rd=new Uint8Array([20]);function zL(){return fixEncoderSize(getBytesEncoder(),1).encode(Rd)}function bd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Yt()],["secp256r1VerifyArgs",getOptionEncoder(H())],["settingsReadonlyArgs",Kt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Rd}))}function _d(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Zt()],["secp256r1VerifyArgs",getOptionDecoder(F())],["settingsReadonlyArgs",jt()],["compressedProofArgs",D()]])}function KL(){return combineCodec(bd(),_d())}function vd(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=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:bd().encode(c),programAddress:r})}function jL(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:_d().decode(e.data)}}var kd=new Uint8Array([14]);function $L(){return fixEncoderSize(getBytesEncoder(),1).encode(kd)}function Ld(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())]]),e=>({...e,discriminator:kd}))}function Od(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function eO(){return combineCodec(Ld(),Od())}function Bd(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=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:Ld().encode(c),programAddress:r})}function tO(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:Od().decode(e.data)}}var Vd=new Uint8Array([24]);function iO(){return fixEncoderSize(getBytesEncoder(),1).encode(Vd)}function Hd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Vd}))}function Fd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function dO(){return combineCodec(Hd(),Fd())}function Gd(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=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:Hd().encode(c),programAddress:r})}function uO(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:Fd().decode(e.data)}}var jd=new Uint8Array([12]);function TO(){return fixEncoderSize(getBytesEncoder(),1).encode(jd)}function Jd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:jd}))}function qd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function lO(){return combineCodec(Jd(),qd())}function Yd(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=y(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:Jd().encode(c),programAddress:r})}function fO(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:qd().decode(e.data)}}var Qd=new Uint8Array([22]);function DO(){return fixEncoderSize(getBytesEncoder(),1).encode(Qd)}function $d(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Qd}))}function eu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function PO(){return combineCodec($d(),eu())}function tu(e,n){let r=n?.programAddress??A,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:$d().encode(c),programAddress:r})}function MO(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:eu().decode(e.data)}}var su=new Uint8Array([11]);function WO(){return fixEncoderSize(getBytesEncoder(),1).encode(su)}function ou(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())]]),e=>({...e,discriminator:su}))}function cu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function kO(){return combineCodec(ou(),cu())}function au(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=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:ou().encode(c),programAddress:r})}function LO(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:cu().decode(e.data)}}var uu=new Uint8Array([21]);function FO(){return fixEncoderSize(getBytesEncoder(),1).encode(uu)}function Au(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())],["settingsReadonlyArgs",Kt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:uu}))}function gu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())],["settingsReadonlyArgs",jt()],["compressedProofArgs",D()]])}function GO(){return combineCodec(Au(),gu())}function pu(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=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:Au().encode(c),programAddress:r})}function zO(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:gu().decode(e.data)}}var Tu=new Uint8Array([15]);function ZO(){return fixEncoderSize(getBytesEncoder(),1).encode(Tu)}function lu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Tu}))}function fu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function XO(){return combineCodec(lu(),fu())}function Su(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=y(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:lu().encode({}),programAddress:r})}function QO(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:fu().decode(e.data)}}var Cu=new Uint8Array([25]);function sB(){return fixEncoderSize(getBytesEncoder(),1).encode(Cu)}function Eu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Cu}))}function Du(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function oB(){return combineCodec(Eu(),Du())}function Pu(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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:Eu().encode(c),programAddress:r})}function cB(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:Du().decode(e.data)}}var Ru=new Uint8Array([16]);function pB(){return fixEncoderSize(getBytesEncoder(),1).encode(Ru)}function bu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Xt()],["secp256r1VerifyArgs",getArrayEncoder(X())]]),e=>({...e,discriminator:Ru}))}function _u(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Qt()],["secp256r1VerifyArgs",getArrayDecoder(Q())]])}function mB(){return combineCodec(bu(),_u())}function vu(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=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:bu().encode(c),programAddress:r})}function yB(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:_u().decode(e.data)}}var ku=new Uint8Array([26]);function CB(){return fixEncoderSize(getBytesEncoder(),1).encode(ku)}function Lu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Xt()],["secp256r1VerifyArgs",getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:ku}))}function Ou(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Qt()],["secp256r1VerifyArgs",getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function EB(){return combineCodec(Lu(),Ou())}function Bu(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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Lu().encode(c),programAddress:r})}function DB(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:Ou().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",gE=(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))(gE||{});function iN(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 pE=(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))(pE||{});function dN(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 yE=6e3,TE=6001,lE=6002,fE=6003,SE=6004,xE=6005,IE=6006,CE=6007,EE=6008,DE=6009,PE=6010,ME=6011,hE=6012,RE=6013,bE=6014,_E=6015,vE=6016,UE=6017,WE=6018,kE=6019,LE=6020,OE=6021,BE=6022,NE=6023,wE=6024,VE=6025,HE=6026,FE=6027,GE=6028,zE=6029,KE=6030,jE=6031,JE=6032,qE=6033,YE=6034,ZE=6035,XE=6036,QE=6037,$E=6038,eD=6039,tD=6040,rD=6041,nD=6042,sD=6043,oD=6044,cD=6045,aD=6046,iD=6047,dD=6048,uD=6049,AD=6050,gD=6051,pD=6052,mD=6053,yD=6054,TD=6055,lD=6056,fD=6057,SD=6058,xD=6059,ID=6060,CD=6061,ED=6062,DD=6063,PD=6064,MD=6065,hD=6066,RD=6067,bD=6068,_D=6069,vD=6070,UD=6071,WD=6072,kD=6073,LD=6074,OD=6075,BD=6076,ND=6077,wD=6078,VD=6079,HD=6080,FD=6081,GD=6082,Nu;process.env.NODE_ENV!=="production"&&(Nu={[KE]:"This member is already delegated to another wallet.",[CE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[LD]:"Clock sysvar access failed. This may indicate a system error.",[AD]:"The domain configuration account is disabled. Please contact support or try again later.",[gD]:"Missing domain configuration account.",[WD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[GD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[PE]:"Duplicate public keys detected among members. Each member must have a unique key.",[DE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[LE]:"No members provided. A multisig wallet must contain at least one member.",[fD]:"Slot numbers list is empty. At least one slot number is required for validation.",[WE]:"Expected a User with Administrator role for this instruction.",[EE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[vE]:"Expected a User with Transaction Manager role for this instruction.",[eD]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[tD]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[rD]:"Declared buffer size does not match the actual serialized size.",[lD]:"Failed to compute hash. This may indicate a system error.",[qE]:"Not enough members with vote permission to meet the approval threshold.",[jE]:"At least one signer with execute permission is required to proceed.",[JE]:"At least one signer with initiate permission is required to perform this action.",[VE]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[UD]:"Invalid account index in transaction message. The account index is out of bounds.",[yD]:"Address Tree supplied is not part of the whitelisted address trees.",[kE]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[FE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[$E]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[SD]:"Member key conversion failed. The provided key format is invalid.",[YE]:"Only delegated members are allowed for this transaction.",[wE]:"Unexpected number of accounts provided for this instruction.",[RE]:"User with Permanent Member role must have a delegated wallet.",[TE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[SE]:"The extracted public key has an invalid length or encoding.",[yE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[fE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[uD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[iD]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[BE]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[bD]:"Invalid source type for token transfer. The source account type is not supported.",[UE]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[_E]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[NE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[HE]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[BD]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[RD]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[xE]:"The extracted WebAuthn signed message payload is malformed.",[cD]:"An input string exceeds the maximum allowed character length.",[pD]:"This member is not registered under the provided domain configuration.",[CD]:"Member not found in settings. Cannot remove a member that does not exist.",[vD]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[GE]:"A required account is missing from the instruction context.",[xD]:"Compressed proof arguments are missing. Required for compressed account operations.",[PD]:"Missing compressed token account. Required for token transfer operations.",[ND]:"Missing destination token account. Required for token transfer operations.",[hD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[ID]:"Light CPI accounts are missing. Required for compressed account operations.",[zE]:"User mutation arguments are required when performing add or remove delegate operations.",[HD]:"Missing new authority account. Required for domain configuration updates.",[VD]:"Missing settings account. Required for delegate operations on compressed wallets.",[TD]:"Compressed settings data is missing. The settings account must be initialized with data.",[wD]:"Missing source token account. Required for token transfer operations.",[MD]:"Missing SPL interface PDA. Required for token transfer operations.",[aD]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[kD]:"User account address is missing. Required for secp256r1 signature verification.",[FD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[XE]:"No valid signer found in this transaction.",[hE]:"Only one permanent member is allowed per wallet.",[bE]:"Only one transaction manager is allowed per wallet.",[mD]:"The given origin index is not in the whitelisted origins.",[DD]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[ME]:"Permanent members cannot be removed from a wallet.",[oD]:"Writable CPI calls to protected accounts are not permitted.",[IE]:"The rpIdHash extracted from the signed message does not match the expected value.",[ED]:"Settings key mismatch. The provided settings key does not match the expected value.",[lE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[dD]:"The specified slot number was not found in the provided slot history.",[_D]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[OE]:"Too many members: a maximum of 4 members are supported.",[nD]:"This transaction has expired. It must be executed within 3 minutes of approval.",[sD]:"This transaction has not yet reached the required approval threshold.",[QE]:"Only the transaction creator or rent payer may close this transaction buffer.",[OD]:"Unauthorized: Only the admin account is allowed to perform this action.",[ZE]:"Member is not part of the expected signers for this transaction."});function yN(e){return process.env.NODE_ENV!=="production"?Nu[e]:"Error message not available in production bundles."}function TN(e,n,r){return isProgramError(e,n,A,r)}async function hN({admin:e,addressTree:n}){return aa({payer:e,addressTree:n,remainingAccounts:[]})}var tr={Ed25519:1,Secp256r1:2};var wu=f.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),WN=f.object({transactionActionType:wu,transactionAddress:f.string(),transactionMessageBytes:f.array(f.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),Vu=f.object({transactionActionType:wu,transactionAddress:f.string(),transactionMessageBytes:f.string()}).strict(),Hu=f.object({authResponse:f.custom(),nonce:f.string(),clientSignature:f.object({clientOrigin:f.string(),signature:f.string()}).strict(),deviceSignature:f.object({publicKey:f.string(),signature:f.string()}).strict(),authProviderSignature:f.object({publicKey:f.string(),signature:f.string()}).strict().optional()}).strict(),Fu=f.object({signer:f.string(),userAddressTreeIndex:f.number().optional(),additionalInfo:f.looseObject({}).optional()}).strict(),zD=f.object({transactionPayload:Vu,slotHash:f.string(),slotNumber:f.string(),originIndex:f.number(),crossOrigin:f.boolean()}).strict(),kN=f.object({phase:f.literal("start"),redirectOrigin:f.url(),signer:f.string().optional(),data:f.object({type:f.literal("message"),payload:f.string().optional()}).strict()}).strict(),LN=f.object({phase:f.literal("start"),redirectOrigin:f.url(),signer:f.string().optional(),data:f.object({type:f.literal("transaction"),payload:Vu}).strict()}).strict(),ON=f.object({phase:f.literal("complete"),data:f.object({type:f.literal("message"),payload:Fu.extend(Hu.shape).extend({id:f.string().optional(),message:f.string(),clientSignature:f.object({clientOrigin:f.string()}).strict()})}).strict()}).strict(),BN=f.object({phase:f.literal("complete"),data:f.object({type:f.literal("transaction"),payload:Fu.extend(Hu.shape).extend(zD.shape).extend({clientSignature:f.object({clientOrigin:f.string()}).strict()})}).strict()}).strict();var _e={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Be=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(_e).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var Gs=33,Ne=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!==Gs)throw new Error(`Invalid public key length, expected ${Gs} 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===Gs)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()}},P=class extends Ne{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 JD(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function qD(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var zu=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(JD())],["addressTableLookups",getArrayCodec(qD())]]);function Ku(e){return zu.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 ju(e){let n=zu.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 Ju(e,n,r,s){if(e<n||e>r)throw new z(`${s} must be between ${n} and ${r} (inclusive), got ${e}`)}function qu(e,n){if(e<0)throw new z(`${n} must be non-negative, got ${e}`)}function rr(e,n){if(e.length===0)throw new z(`${n} cannot be empty`)}function Yu(e,n){if(e.trim().length===0)throw new z(`${n} cannot be empty`)}featureFlags.version=VERSION.V2;var te={};function Zu(){if(!te.solanaRpcEndpoint)throw new Oe("RPC endpoint");return te.solanaRpcEndpoint}function tt(){if(!te.lightProtocolRpc)throw new Oe("Light Protocol RPC");return te.lightProtocolRpc}function ce(){if(!te.solanaRpc)throw new Oe("Solana RPC");return te.solanaRpc}function Xu(){if(!te.sendAndConfirm)throw new Oe("Send and confirm transaction function");return te.sendAndConfirm}function Qu(){if(!te.computeEstimate)throw new Oe("Compute budget estimate function");return te.computeEstimate}function Ks(){return te.jitoTipsConfig?te.jitoTipsConfig:{blockEngineUrl:Io,getJitoTipsUrl:Co,priority:Eo}}function dw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){te.solanaRpcEndpoint=e,te.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});te.solanaRpc=t,te.sendAndConfirm=c,te.computeEstimate=estimateComputeUnitLimitFactory({rpc:t}),te.jitoTipsConfig=s??null;}function $u(e){return typeof e=="string"?e:e.toString()}function eA(e){return e.toString()}async function js(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 eP={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true};function tP(e,n,r=2,s=3e4){let t=n*Math.pow(r,e-1);return Math.min(t,s)}function rP(e){return new Promise(n=>setTimeout(n,e))}async function nr(e,n){let{maxRetries:r,initialDelayMs:s,backoffBase:t=2,maxDelayMs:c=3e4,shouldRetry:a}={...eP,...n},i;for(let o=1;o<=r;o++)try{return await e()}catch(u){if(i=u,a&&!a(u,o))throw u;if(o>=r)break;let d=tP(o,s,t,c);await rP(d);}throw new mr(e.name||"retryWithBackoff",r,i)}async function ut(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 nr(e,{...n,shouldRetry:n.shouldRetry??r})}var B=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 tt().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 Nr(e,n){let r=$u(e);return js(n,r,()=>tt().getCompressedAccount(e))}async function rt(e,n){let r=eA(e);return js(n,r,()=>ce().getAccountInfo(e,{encoding:"base64"}).send())}async function Te(e,n){let s=(await Promise.all(e.map(async t=>Nr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new ne("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 ge(e,n,r,s,t){if(t.length===0)return [];let c=t.map((u,d)=>({treeInfo:n[d],root:r[d],rootIndex:s[d],address:u.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((u,d)=>({addressTreeInfo:a[d],outputStateTreeIndex:i,address:u.address,type:u.type}))}function de(e,n,r,s,t,c,a){let i=[];for(let d=0;d<n.length;d++)i.push({treeInfo:n[d],rootIndex:s[d],leafIndex:r[d],proveByIndex:t[d],hash:c[d].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new z("Unable to parse state tree data");return c.map((d,g)=>({data:a.decode(d.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(d.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Me(e,n,r,s,t){let c=null,a=null,i=null,o=new B;if(e){await o.addSystemAccounts();let{address:u}=await ae(n,r),d=(await Te([{address:u,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[d.leafIndex],leaves:[],treeInfos:[d.treeInfo],proveByIndices:[d.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 w([d],[]);let g=o.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!g)throw new z("Unable to parse state tree data");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:g.packedTreeInfos[0]},data:Z().decode(d.data?.data)},a={accountMeta:{address:new Uint8Array(d.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:Z().decode(d.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:o,settingsMutArgs:a}}async function w(e,n,r=3,s=500){return nr(()=>tt().getValidityProofV0(e,n),{maxRetries:r,initialDelayMs:s})}async function he(){return (await wr()).length-1}var Js;async function wr(){if(!Js){let{data:e}=await ta(ce(),await sA());Js=e.whitelistedAddressTrees;}return Js}function nA(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let n=e[7];return n===3?2:3}async function Vr(e,n,r){let s=await aP(e,n,r);if(!s)throw new ne("User account");return s}async function aP(e,n,r){let{address:s}=await N(e,n),t=await Nr(s,r);return t?.data?.data?$().decode(t.data.data):null}async function qs(e,n,r){let s=await iP(e,n,r);if(!s)throw new ne("Settings account");return s}async function iP(e,n,r){try{let{address:s}=await ae(e,n),t=await Nr(s,r);if(!t?.data?.data)throw new ne("Compressed settings account");let c=Z().decode(t.data.data);if(c.data.__option==="None")throw new ne("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let s=await ms(ce(),await ue(e));return s.exists?{...s.data,isCompressed:false}:null}}async function Ys(e){qu(e,"index");let n=await wr();if(e>=n.length)throw new z(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function Vw(e){let r=(await wr()).findIndex(s=>s.toString()===e);if(r===-1)throw new ne("Address tree",`Address ${e} not found in whitelist`);return r}async function ae(e,n=0){let r=await Ys(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 N(e,n=0){let r=await Ys(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),e instanceof Ne?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 gt({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(new Uint8Array(getUtf8Encoder().encode(n)));else throw new z("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function dA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function sA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function uA(e,n,r){Ju(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 Ne?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function ve(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function ue(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function Qw(e){let n=await ue(e);return await ve(n)}async function $w(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function or(e,n){if(!e.ok){await e.text().catch(()=>e.statusText);throw new De(`Request failed: ${e.statusText} (${e.status})`,e.status,n)}return e}async function cr(e){try{return await e.json()}catch(n){throw new De(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function A2(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Fr(n.get(-2))),y:BigInt("0x"+Fr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function g2(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 p2(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Ve(n)),c=JSON.parse(new TextDecoder().decode(Ve(r))),a=pA(c),i=yA(new Uint8Array(Ve(s))),o=await gt({rpIdHash:t.subarray(0,32)});return new P(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Ve(r)),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:Zs(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function Zs(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function T2(e){return sha256(new Uint8Array(getUtf8Encoder().encode(JSON.stringify(e))))}function l2(e){return Xs(e.data.payload.authResponse)}function f2(e,n,r,s){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...Zs(n,r,s)]))}async function S2(e,n,r,s,t,c){let a;if(!t||!c){let o=(await ce().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!o)throw new ne("Slot sysvar","Unable to fetch slot sysvar data");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(Ve(e.transactionMessageBytes)):e.transactionMessageBytes),...a,...Zs(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:i}}function Xs(e){return sha256(zr(e))}function x2(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ve(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 I2(e,n){let{data:r}=await vo(ce(),e),t=mA(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 Fr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function lP(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 pA(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 mA(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 yA(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),u=c[0]===0&&c.length>32?c.slice(1):c,d=o[0]===0&&o.length>32?o.slice(1):o;if(u.length>32||d.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"+Fr(d)),b=(l>p?p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),x=lP(b);return new Uint8Array([...g,...x])}function zr(e){return new Uint8Array([...new Uint8Array(Ve(e.response.authenticatorData)),...sha256(new Uint8Array(Ve(e.response.clientDataJSON)))])}async function Qs(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await ce().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 SA(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 xA(e,n){rr(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new z(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await ut(()=>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 or(r,n);let s=await cr(r);if(!s.result||s.error)throw new ye(`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 ye(`Simulation failed: ${c}`)}return s.result.value.transactionResults.map(t=>t.unitsConsumed)}function J(e,n=0){let r=e instanceof P?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?zr(r.authResponse):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function mt(e){if(e instanceof Ne)return {keyType:tr.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:tr.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function fA(e){return e instanceof P?e.toString():e.address.toString()}function Se(e){let n=new Set,r=[];for(let t of e)n.has(fA(t))||(r.push(t),n.add(fA(t)));let s=r.filter(t=>t instanceof P);if(s.length>1)throw new z(`More than 1 Secp256r1 signers in an instruction is not supported (found ${s.length})`);return r}function IA({payer:e,tipAmount:n}){let r=$r[Math.floor(Math.random()*$r.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}async function J2(e){rr(e,"bundle");let n=await Qs(e,true),r=await xA(n.map(getBase64EncodedWireTransaction),Zu()),s=await Qs(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await kP(s.map(getBase64EncodedWireTransaction))}async function kP(e,n=3,r=500,s=Ks()){rr(e,"serializedTransactions");let{blockEngineUrl:t}=s,c=`${t}/bundles`,a=await ut(()=>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 or(a,c);let i=await cr(a);if(i.error)throw new ye(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new ye("No bundle ID returned from Jito");return i.result}async function q2(e,n=30,r=3e3,s=Ks()){Yu(e,"bundleId");let{blockEngineUrl:t}=s,c=`${t}/getBundleStatuses`;return nr(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 or(a,c);let i=await cr(a);if(i.error)throw new ye(`Error getting bundle status: ${JSON.stringify(i.error,null,2)}`,e);if(!i.result?.value?.length)throw new ye("Bundle not yet confirmed",e);let o=i.result.value[0];if(o.confirmation_status==="confirmed"||o.confirmation_status==="finalized"){let u=o.transactions[o.transactions.length-1];if(!u)throw new ye("No transactions in confirmed bundle",e);return u}throw new ye(`Bundle status: ${o.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:a=>a instanceof ye||a instanceof De})}async function t5({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await ce().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([Qu()(c),SA(ce(),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 Xu()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function l5(e,n){if(n.threshold>1)throw new z("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(o=>DA(o.pubkey)===e);if(!r)throw new ne("Member",`Signer ${e} not found in settings`);let{permissions:s}=r;if(!s)throw new ne("Permissions","No permissions found for the current member");let t=Be.has(s,_e.InitiateTransaction),c=Be.has(s,_e.VoteTransaction),a=Be.has(s,_e.ExecuteTransaction);if(t&&c&&a)return {};if(!c||!a)throw new yr("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 ne("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(DA(i.pubkey)),userAddressTreeIndex:i.userAddressTreeIndex}}async function f5({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await Vr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new ne("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return QP(n,c.transactionManagerUrl.value,e,s)}function QP(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 ut(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)}),{maxRetries:3,initialDelayMs:500});if(!a.ok)throw new De(`Transaction manager request failed: ${a.statusText}`,a.status,n);let i=await a.json();if("error"in i)throw new De(`Transaction manager error: ${i.error}`,a.status,n);return i.signatures.map(o=>({[e]:getBase58Encoder().encode(o)}))}}}function DA(e){return e.keyType===tr.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function S5(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 x5(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 z(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function O5({payer:e,rpId:n,origins:r,authority:s}){let t=await gt({rpId:n}),c=new B;await c.addSystemAccounts();let a=await he(),{address:i,addressTree:o}=await N(s.address,a),u=[{address:i,tree:o,queue:o,type:"User"}],d=await w([],u),g=(await ge(c,d.treeInfos,d.roots,d.rootIndices,u))[0],{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),S=v(d,l);return await Ba({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function j5({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await ae(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await N(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await Te(a,t):[],o=await he(),{address:u,addressTree:d}=await N(r.member,o),g=[{address:u,type:"User",tree:d,queue:d}],p=await w(i,g),l=null,S=null,b=i.filter(G=>G.type==="Settings"),x=i.filter(G=>G.type==="User");b.length&&(l=de(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),b,Z())[0]),x.length&&(S=de(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,$())[0]);let C=await ge(c,p.treeInfos.slice(i.length),p.roots.slice(i.length),p.rootIndices.slice(i.length),g),{remainingAccounts:_,systemOffset:I}=c.toAccountMetas(),W=v(p,I);return await Ha({payer:n,authority:e,compressedProofArgs:W,member:Vt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:l?some({settingsMutArgs:l,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:C[0],domainConfig:s,remainingAccounts:_})}async function Z5({payer:e}){let n=await dA();return Ka({payer:e,globalCounter:n})}async function e6({admin:e,rpId:n,disable:r}){let s=await gt({rpId:n});return ai({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function a6({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:a}=await ae(r,s),i=[{address:c,tree:a,queue:a,type:"Settings"}],o=await w([],i),u=(await ge(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:d,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return vi({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:u,remainingAccounts:d})}async function m6({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:a}=await N(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await w([],i),u=(await ge(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:d,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Bi({compressedProofArgs:p,args:e,authority:n,userCreationArgs:u,remainingAccounts:d})}function eM(e,n,r,s){let t=tM(e,n),c=rM(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function tM(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 rM(e,n){return n<e.header.numSignerAccounts}async function Kr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=ju(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),ce()):{}),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:eM(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 d=o[u];if(!d)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:d,role:AccountRole.WRITABLE});}for(let u of i.readonlyIndexes){let d=o[u];if(!d)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:d,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 yt=33,Tt=64,ro=14,dM=2,uM=address("Secp256r1SigVerify1111111111111111111111111");function AM(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function gM(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function _A(){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=gM();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=ro;let a=[];for(let i=0;i<r;i++){let o=fixDecoderSize(getBytesDecoder(),yt).decode(e,n);n+=yt;let u=fixDecoderSize(getBytesDecoder(),Tt).decode(e,n);n+=Tt;let d=t[i].messageDataSize,g=fixDecoderSize(getBytesDecoder(),d).decode(e,n);n+=d,a.push({publicKey:o,signature:u,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function vA(){return createEncoder({getSizeFromValue:e=>{let n=ro*e.offsets.length,r=e.payload.reduce((s,t)=>s+yt+Tt+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=AM();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),yt).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),Tt).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function b6(){return combineCodec(vA(),_A())}function V(e,n){let r=e.length,s=dM+r*ro,t=[];for(let o=0;o<r;o++){let{message:u}=e[o],d=s,g=d+yt,p=g+Tt;t.push({publicKeyOffset:d,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:u.length,messageInstructionIndex:65535}),s+=yt+Tt+u.length;}let c=n?.programAddress??uM,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:vA().encode(a)}}function _6(e){return {programAddress:e.programAddress,accounts:{},data:_A().decode(e.data)}}async function UA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let u=await ve(e),{accountMetas:d,addressLookupTableAccounts:g}=await Kr({transactionMessageBytes:r,walletAddress:u,additionalSigners:a,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(V(c)),p.push(o?Pu({transactionBuffer:n,payer:s.address,remainingAccounts:d,settingsKey:e}):Su({transactionBuffer:n,payer:s.address,settings:e})),i&&p.push(IA({payer:s,tipAmount:i})),{instructions:p,addressLookupTableAccounts:g}}async function WA({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:u}){let d=Se(s),g=await ue(e),p=await ve(g),[{accountMetas:l,addressLookupTableAccounts:S,transactionMessage:b},{settingsMutArgs:x,proof:C,packedAccounts:_}]=await Promise.all([Kr({transactionMessageBytes:r,walletAddress:p,additionalSigners:d.filter(ee=>!(ee instanceof P)),addressesByLookupTableAddress:c}),Me(i,e,n,o,u)]);_.addPreAccounts(l);let I=d.filter(ee=>ee instanceof P),{secp256r1VerifyArgs:W}=mM(I,a,_),{remainingAccounts:G,systemOffset:q}=_.toAccountMetas();return {instructions:yM({secp256r1VerifyInput:a,transactionMessage:b,accountMetas:l,compressed:i,payer:t,settingsMutArgs:x,proof:C,systemOffset:q,secp256r1VerifyArgs:W,settings:g,remainingAccounts:G}),addressLookupTableAccounts:S}}function mM(e,n,r){let s=[];for(let t of e){let c=n.length,{domainConfig:a,verifyArgs:i,signature:o,publicKey:u,message:d}=J(t,c);d&&o&&u&&n.push({message:d,signature:o,publicKey:u}),a&&(r.addPreAccounts([{address:a,role:AccountRole.READONLY}]),i.__option==="Some"&&s.push({domainConfigKey:a,verifyArgs:i.value}));}return {secp256r1VerifyArgs:s}}function yM({secp256r1VerifyInput:e,transactionMessage:n,accountMetas:r,compressed:s,payer:t,settingsMutArgs:c,proof:a,systemOffset:i,secp256r1VerifyArgs:o,settings:u,remainingAccounts:d}){let g=[];e.length>0&&g.push(V(e));let p=TM(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(Bu({secp256r1VerifyArgs:o,transactionMessage:p,settingsMutArgs:c,compressedProofArgs:l,payer:t,remainingAccounts:d}));}else g.push(vu({secp256r1VerifyArgs:o,settings:u,transactionMessage:p,remainingAccounts:d}));return g}function TM(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 eV({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=Se(s),u=await ue(e),d=await ve(u),[{packedAccounts:g,proof:p,settingsMutArgs:l},{value:S}]=await Promise.all([Me(i,e,n,false,t),rt(d,t)]);if((S?.lamports??0)<BigInt(c))throw new Error("Insufficient balance");let b=[],x=[];for(let W of o)if(W instanceof P){let G=b.length,{domainConfig:q,verifyArgs:ie,signature:ee,publicKey:le,message:Ae}=J(W,G);Ae&&ee&&le&&b.push({message:Ae,signature:ee,publicKey:le}),q&&(g.addPreAccounts([{address:q,role:AccountRole.READONLY}]),ie.__option==="Some"&&x.push({domainConfigKey:q,verifyArgs:ie.value}));}else g.addPreAccounts([{address:W.address,role:AccountRole.READONLY_SIGNER,signer:W}]);let{remainingAccounts:C,systemOffset:_}=g.toAccountMetas(),I=[];if(b.length>0&&I.push(V(b)),i){if(!a||!l)throw new Error("Payer not found or proof args is missing.");let W=v(p,_);I.push(Ji({amount:c,settingsMutArgs:l,compressedProofArgs:W,payer:a,secp256r1VerifyArgs:x,source:d,destination:r,remainingAccounts:C}));}else I.push(Hi({amount:c,secp256r1VerifyArgs:x,source:d,destination:r,settings:u,remainingAccounts:C}));return I}var CM=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),EM=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),co=address(CTOKEN_PROGRAM_ID.toString());async function pV({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,splInterfacePdaArgs:u={index:0,restricted:false},compressed:d=false}){let g=Se(t),p=await ue(e),l=await ve(p),S=U=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(U),getAddressEncoder().encode(co),getAddressEncoder().encode(s)],programAddress:co}),b=()=>{let U=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(s)];return u.restricted&&U.push(getUtf8Encoder().encode("restricted")),u.index>0&&U.push(getU8Encoder().encode(u.index)),U},[x,[C],_,[I],[W]]=await Promise.all([getAssociatedTokenAccountAddress(s,l,o),S(l),getAssociatedTokenAccountAddress(s,r,o),S(r),getProgramDerivedAddress({seeds:b(),programAddress:co})]),[G,q,ie,ee]=await Promise.all([rt(_,c),rt(x,c),rt(C,c),MM(d,e,n,c)]),le=!!G.value,Ae=!!q.value,lt=!!ie.value,ft=Ae?getTokenDecoder().decode(getBase64Encoder().encode(q.value.data[0])).amount:BigInt(0),ct=BigInt(lt?hM(new Uint8Array(getBase64Encoder().encode(ie.value.data[0])))?.amount??0:0),ir=le?_:void 0,Zr=le?void 0:I,St=Ae&&(ft+ct<BigInt(a)||ct>BigInt(0)||!le)||!Ae&&le,T=!le,[me,Ao]=await Promise.all([PM(l,s,ft,ct,BigInt(a),d?3:4),DM(St,W,c)]),Y=me.reduce((U,re)=>U+re.parsed.amount.toNumber(),0);if(ft+ct+BigInt(Y)<BigInt(a))throw new Error("Insufficient balance");let at=null,Ue=null,We=new B;if(Ao&&We.addPreAccounts([{address:s,role:AccountRole.WRITABLE}]),ee||me.length){await We.addSystemAccounts();let U=[];if(me.length&&U.push(...me.map(re=>({hash:re.compressedAccount.hash,tree:re.compressedAccount.treeInfo.tree,queue:re.compressedAccount.treeInfo.queue,data:re.compressedAccount.data,address:re.compressedAccount.address}))),ee&&U.push(ee),Ue=await w(U,[]),ee){let re=me.length;at=de(We,Ue.treeInfos.slice(re),Ue.leafIndices.slice(re),Ue.rootIndices.slice(re),Ue.proveByIndices.slice(re),U.slice(re),Z())[0];}}let $A=me.length&&Ue?some(me.map((U,re)=>({isFrozen:U.parsed.state===AccountState.Frozen,hasDelegate:U.parsed.delegate!=null,amount:U.parsed.amount.toNumber(),merkleContext:{leafIndex:U.compressedAccount.leafIndex,merkleTreePubkeyIndex:We.insertOrGet(U.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:We.insertOrGet(U.compressedAccount.treeInfo.queue.toString()),proveByIndex:U.compressedAccount.proveByIndex},rootIndex:Ue.rootIndices[re],version:nA(U.compressedAccount.data?.discriminator),tlv:U.parsed.tlv?some(getArrayDecoder(Lt()).decode(U.parsed.tlv)):none()}))):none(),dr=[],go=[];for(let U of g)if(U instanceof P){let re=dr.length,{domainConfig:Xr,verifyArgs:mo,signature:yo,publicKey:To,message:lo}=J(U,re);lo&&yo&&To&&dr.push({message:lo,signature:yo,publicKey:To}),Xr&&(We.addPreAccounts([{address:Xr,role:AccountRole.READONLY}]),mo.__option==="Some"&&go.push({domainConfigKey:Xr,verifyArgs:mo.value}));}else We.addPreAccounts([{address:U.address,role:AccountRole.READONLY_SIGNER,signer:U}]);let{remainingAccounts:eg,systemOffset:tg}=We.toAccountMetas(),ur=[];dr.length>0&&ur.push(V(dr));let rg=v(Ue,tg),ng=St?W:void 0,sg=T?EM:void 0,og=St?some(u):none(),po={amount:a,secp256r1VerifyArgs:go,source:l,destination:r,sourceCtokenTokenAccount:C,sourceSplTokenAccount:x,destinationCtokenTokenAccount:Zr,destinationSplTokenAccount:ir,mint:s,tokenProgram:o,remainingAccounts:eg,payer:i,sourceCompressedTokenAccounts:$A,compressedProofArgs:rg,compressibleConfig:CM,splInterfacePda:ng,rentSponsor:sg,splInterfacePdaArgs:og};if(d){if(!at)throw new Error("Payer not found or proof args is missing.");ur.push(ad({...po,settingsMutArgs:at}));}else ur.push($i({...po,settings:p}));return ur}async function DM(e,n,r){if(!e)return false;let{value:s}=await rt(n,r);return !s}async function PM(e,n,r,s,t,c){let a=t-r-s;if(a<=0)return [];let o=(await tt().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(n)})).items.filter(g=>!!g.compressedAccount.data?.data.length&&g.compressedAccount.owner.equals(CTOKEN_PROGRAM_ID)&&!g.parsed.amount.isZero()).sort((g,p)=>p.parsed.amount.cmp(g.parsed.amount));if(o.length===0)return [];let u=BigInt(0),d=[];for(let g of o){if(d.length>=c||u>=a)break;u+=BigInt(g.parsed.amount.toNumber()),d.push(g);}if(u<a)throw d.length>=c?new Error("Transaction size limit exceeded. Consider multiple transfers to transfer full balance."):new Error("Insufficient balance.");return d}async function MM(e,n,r,s){if(!e)return null;let{address:t}=await ae(n,r);return (await Te([{address:t,type:"Settings"}],s))[0]}function hM(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 DV({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:a,proof:i,settingsMutArgs:o}=r,u=Se(e),d=u.filter(_=>!(_ instanceof P));a.addPreAccounts(d.map(_=>({address:_.address,role:AccountRole.READONLY_SIGNER,signer:_})));let g=u.filter(_=>_ instanceof P),p=[],l=[];for(let _ of g){let I=l.length,{domainConfig:W,verifyArgs:G,signature:q,publicKey:ie,message:ee}=J(_,I);ee&&q&&ie&&l.push({message:ee,signature:q,publicKey:ie}),W&&(a.addPreAccounts([{address:W,role:AccountRole.READONLY}]),G.__option==="Some"&&p.push({domainConfigKey:W,verifyArgs:G.value}));}let{remainingAccounts:S,systemOffset:b}=a.toAccountMetas(),x=v(i,b),C=[];if(l.length>0&&C.push(V(l)),c){if(!o)throw new Error("Payer not found or proof args is missing.");C.push(Ca({configActions:t,payer:n,compressedProofArgs:x,settingsMutArgs:o,remainingAccounts:S,secp256r1VerifyArgs:p}));}else C.push(await ma({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:S,secp256r1VerifyArgs:p}));return C}async function vV({createUserArgs:e,payer:n}){let r=new B;await r.addSystemAccounts(),r.addPreAccounts(e.map(d=>({address:d.member.address,role:AccountRole.READONLY_SIGNER,signer:d.member})));let s=await he(),t=await Promise.all(e.map(async d=>{let{address:g,addressTree:p}=await N(d.member.address,s);return {address:g,tree:p,queue:p,type:"User"}})),c=await w([],t),a=await ge(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),u=v(c,o);return await Ya({compressedProofArgs:u,payer:n,createUserArgs:e.map((d,g)=>({member:d.member.address,role:d.role,userCreationArgs:a[g],transactionManagerUrl:d.role===2?d.transactionManagerUrl:null})),remainingAccounts:i})}async function NV({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let a=[],i=[];i.push(...await Te([{address:(await N(r.address,s)).address,type:"User"}],t));let o=await he(),{address:u,addressTree:d}=await ae(e,o);a.push({address:u,queue:d,tree:d,type:"Settings"});let g=i.length,p=await w(i,a),l=de(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),i.filter(I=>I.type==="User"),$())[0],b=(await ge(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),a)).find(I=>I.type==="Settings")??null,{remainingAccounts:x,systemOffset:C}=c.toAccountMetas(),_=v(p,C);if(!b)throw new Error("Settings creation args is missing.");return await ha({settingsIndex:e,payer:n,initialMember:r,userReadonlyArgs:l,compressedProofArgs:_,settingsCreation:b,remainingAccounts:x})}async function JV({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:a,settingsMutArgs:i}=await Me(true,e,n,false,t);if(!i)throw new Error("Proof args is missing");let o=Se(s),u=o.filter(C=>C instanceof P),d=[],g=[];for(let C of u){let _=d.length,{domainConfig:I,verifyArgs:W,signature:G,publicKey:q,message:ie}=J(C,_);ie&&G&&q&&d.push({message:ie,signature:G,publicKey:q}),I&&(c.addPreAccounts([{address:I,role:AccountRole.READONLY}]),W.__option==="Some"&&g.push({domainConfigKey:I,verifyArgs:W.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(),S=v(a,l),b=[];d.length>0&&b.push(V(d));let x=await ue(e);return b.push(ti({settings:x,payer:r,settingsMutArgs:i,compressedProofArgs:S,secp256r1VerifyArgs:g,remainingAccounts:p})),b}async function e8({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new B;await a.addSystemAccounts();let i=await he(),{address:o,addressTree:u}=await N(r.address,i),d=[{address:o,tree:u,queue:u,type:"User"}],g=await w([],d),p=(await ge(a,g.treeInfos,g.roots,g.rootIndices,d))[0],l=a.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:v(g,l.systemOffset),authorityCreationArgs:p};}return pi({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function c8({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new B;await s.addSystemAccounts();let t=await Te([{address:(await N(e.address,n)).address,type:"User"}]),c=await w(t,[]),a=de(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,$())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),u=v(c,o);return Si({authority:e,transactionManagerUrl:r,compressedProofArgs:u,userMutArgs:a,remainingAccounts:i})}async function T8({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:a,message:i,signature:o,publicKey:u}=J(n),d=[];i&&o&&u&&d.push({message:i,signature:o,publicKey:u});let g=await Vr(n instanceof P?n:n.address,r,t),p=[];p.push({address:(await N(n instanceof P?n:n.address,r)).address,type:"User"});let l,S=null,b,x=null;g.delegatedTo.__option==="Some"&&((await qs(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):l=await ue(g.delegatedTo.value.index)),s&&((await qs(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):b=await ue(s.index));let C=new B;await C.addSystemAccounts();let _=await Te(p,t),I=await w(_,[]),W=de(C,I.treeInfos.slice(0,1),I.leafIndices.slice(0,1),I.rootIndices.slice(0,1),I.proveByIndices.slice(0,1),_.slice(0,1),$())[0],G=S?some(de(C,I.treeInfos.slice(S.start,S.end),I.leafIndices.slice(S.start,S.end),I.rootIndices.slice(S.start,S.end),I.proveByIndices.slice(S.start,S.end),_.slice(S.start,S.end),Z())[0]):none(),q=x?some(de(C,I.treeInfos.slice(x.start,x.end),I.leafIndices.slice(x.start,x.end),I.rootIndices.slice(x.start,x.end),I.proveByIndices.slice(x.start,x.end),_.slice(x.start,x.end),Z())[0]):none(),{remainingAccounts:ie,systemOffset:ee}=C.toAccountMetas(),le=v(I,ee),Ae=[];return d.length>0&&Ae.push(V(d)),Ae.push(Pi({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof P?void 0:n,oldSettings:l,oldSettingsMutArgs:G,newSettings:b,newSettingsMutArgs:q,compressedProofArgs:le,userMutArgs:W,remainingAccounts:ie})),Ae}async function U8({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await Yc(ce(),s),o=i.data.multiWalletSettings,{packedAccounts:u,proof:d,settingsMutArgs:g}=await Me(c,e,n,false,a),{remainingAccounts:p,systemOffset:l}=u.toAccountMetas(),{domainConfig:S,verifyArgs:b,message:x,signature:C,publicKey:_}=J(r),I=[];if(x&&C&&_&&I.push(V([{message:x,signature:C,publicKey:_}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let W=v(d,l);I.push(Sd({transactionBuffer:s,domainConfig:S,closer:r instanceof P?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:b,settingsMutArgs:g,payer:t,compressedProofArgs:W,remainingAccounts:p}));}else I.push(pd({transactionBuffer:s,domainConfig:S,closer:r instanceof P?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:b,remainingAccounts:[]}));return I}function GA({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:u,expectedSecp256r1Signers:d}){let{domainConfig:g,verifyArgs:p,message:l,signature:S,publicKey:b}=J(n),x=[];if(l&&S&&b&&x.push(V([{message:l,signature:S,publicKey:b}])),u){let{settingsReadonlyArgs:C,compressedProofArgs:_,remainingAccounts:I}=u;x.push(vd({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:d},settingsReadonlyArgs:C,compressedProofArgs:_,remainingAccounts:I}));}else x.push(Pd({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:d},remainingAccounts:[]}));return x}function zA({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=J(e),u=[];return i&&a&&o&&u.push(V([{message:i,signature:a,publicKey:o}])),s?u.push(Gd({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof P?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(Bd({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof P?void 0:e,remainingAccounts:[]})),u}function KA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?tu({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Yd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function jA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=J(n),u=[];return o&&a&&i&&u.push(V([{message:o,signature:a,publicKey:i}])),s?u.push(pu({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof P?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(au({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof P?void 0:n,remainingAccounts:[]})),u}async function IH({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await vM(r),a=new B,i=null,o=null,u=[];if(c.length||t){let g=await UM({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 WM({configActionsArgs:r,userMutArgs:u,index:e}),index:e,proof:i,settingsMutArgs:o,packedAccounts:a,compressed:t}}async function vM(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>N(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=>N(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function UM({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let a=[];if(r){let l=(await ae(s,t)).address;a.push({address:l,type:"Settings"});}n.length&&a.push(...n);let i=a.length?await Te(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await w(i,[]),u=[],d=[];for(let l of i)l.type==="Settings"?u.push(l):l.type==="User"&&d.push(l);let g,p=[];if(r&&o&&(g=de(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),u,Z())[0]),d.length&&o){let l=r?1:0;p=de(e,o.treeInfos.slice(l),o.leafIndices.slice(l),o.rootIndices.slice(l),o.proveByIndices.slice(l),d,$());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function WM({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 N(a.member,a.userAddressTreeIndex).then(o=>r.find(u=>equalBytes(new Uint8Array(u.accountMeta.address),new Uint8Array(getBase58Encoder().encode(encodeBN254toBase58(o.address))))));if(!i)throw new Error("Unable to find user account");c.push(OM({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=>N(a.member,a.userAddressTreeIndex).then(i=>{let o=r.find(u=>equalBytes(new Uint8Array(u.accountMeta.address),new Uint8Array(getBase58Encoder().encode(encodeBN254toBase58(i.address)))));if(!o)throw new Error("Unable to find user account");return LM({pubkey:a.member,userMutArgs:o,index:e})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(a=>kM({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 kM({pubkey:e,permissionArgs:n}){return {memberKey:mt(e),permissions:ZA(n)}}function LM({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:mt(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function OM({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:mt(e),permissions:ZA(n),userReadonlyArgs:r}}function ZA(e){let n=[];return e.initiate&&n.push(_e.InitiateTransaction),e.vote&&n.push(_e.VoteTransaction),e.execute&&n.push(_e.ExecuteTransaction),Be.fromPermissions(n)}async function bH({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:u=false,additionalVoters:d=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:l}){let S=await ue(n),b=Math.floor(Math.random()*255),x=await uA(S,t instanceof P?t:t.address,b),C=[],_=[];for(let Y=0;Y<s.length;Y+=p){let at=s.subarray(Y,Y+p);C.push(at),_.push(sha256(at));}let I=sha256(new Uint8Array(s)),{settingsReadonlyArgs:W,settingsMutArgs:G,proof:q,packedAccounts:ie}=await Me(u,n,r,false,l),{remainingAccounts:ee,systemOffset:le}=ie.toAccountMetas(),Ae=q&&W&&G?{settingsReadonlyArgs:W,settingsMutArgs:G,compressedProofArgs:v(q,le),remainingAccounts:ee,payer:e}:null,lt=Se([t,...c?[c]:[],...d]).filter(Y=>Y instanceof P).map(Y=>({memberKey:mt(Y),messageHash:Xs(Y.authResponse)})),ft=GA({finalBufferHash:I,finalBufferSize:s.length,bufferIndex:b,payer:e,transactionBufferAddress:x,settings:S,creator:t,preauthorizeExecution:!c,bufferExtendHashes:_,compressedArgs:Ae,expectedSecp256r1Signers:lt}),ct=C.map(Y=>KA({transactionMessageBytes:Y,transactionBufferAddress:x,settings:S,compressed:u})),ir=d.map(Y=>jA({voter:Y,transactionBufferAddress:x,settings:S,compressedArgs:Ae})),Zr=zA({compressedArgs:Ae,settings:S,executor:c,transactionBufferAddress:x}),{instructions:St,addressLookupTableAccounts:T}=await UA({compressed:u,settings:S,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),me=Y=>({payer:e,instructions:Y,addressesByLookupTableAddress:T});return [me(ft),...ct.map(Y=>me([Y])),...ir.length?[me(ir.flat())]:[],me(Zr),me(St)]}var qr=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 Yr=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 QA({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=qr.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:S,drainedKeys:b}=l;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),a.writable.push(...b.writable),a.readonly.push(...b.readonly);}}let[o,u]=t.getMessageComponents(),g=new Yr(u,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:u,addressTableLookups:c}}function FH({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=QA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return Ku(s)}async function JH({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:u=false}){let{instructions:d,addressLookupTableAccounts:g}=await WA({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:i});return {payer:e,instructions:d,addressesByLookupTableAddress:g}}
|
|
2
|
+
export{oa as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,Hu as AuthenticationContextSchema,pr as BACKOFF_MAX_DELAY_MS,xo as BUNDLE_POLL_DELAY_MS,So as BUNDLE_POLL_MAX_RETRIES,Fu as BaseResponseSchema,ye as BundleError,Sa as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,ga as CHANGE_CONFIG_DISCRIMINATOR,fo as COMPUTE_UNIT_MULTIPLIER,Pa as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,La as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,wa as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Ga as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Ja as CREATE_USER_ACCOUNTS_DISCRIMINATOR,ON as CompleteMessageRequestSchema,BN as CompleteTransactionRequestSchema,Qa as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Io as DEFAULT_JITO_BLOCK_ENGINE_URL,Co as DEFAULT_JITO_TIPS_URL,Eo as DEFAULT_JITO_TIP_PRIORITY,Le as DEFAULT_NETWORK_RETRY_DELAY_MS,ke as DEFAULT_NETWORK_RETRY_MAX_RETRIES,si as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Ro as DOMAIN_CONFIG_DISCRIMINATOR,Ai as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,Ti as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,Ci as EDIT_USER_DELEGATE_DISCRIMINATOR,gr as EXPONENTIAL_BACKOFF_BASE,ko as GLOBAL_COUNTER_DISCRIMINATOR,Po as HTTP_STATUS_BAD_REQUEST,en as HTTP_STATUS_INTERNAL_SERVER_ERROR,Mo as HTTP_STATUS_TOO_MANY_REQUESTS,$r as JITO_TIP_ACCOUNTS,tr as KeyType,Do as MAX_TRANSACTION_BUFFER_INDEX,Ri as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,ki as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,Ar as MIN_COMPUTE_UNITS,KE as MULTI_WALLET_ERROR__ALREADY_DELEGATED,CE as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,LD as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,AD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,gD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,WD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,GD as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,PE as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,DE as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,LE as MULTI_WALLET_ERROR__EMPTY_MEMBERS,fD as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,WE as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,EE as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,vE as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,eD as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,tD as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,rD as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,lD as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,qE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,jE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,JE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,VE as MULTI_WALLET_ERROR__INVALID_ACCOUNT,UD as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,yD as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,kE as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,FE as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,$E as MULTI_WALLET_ERROR__INVALID_BUFFER,SD as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,YE as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,wE as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,RE as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,TE as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,SE as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,yE as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,fE as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,uD as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,iD as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,BE as MULTI_WALLET_ERROR__INVALID_THRESHOLD,bD as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,UE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,_E as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,NE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,HE as MULTI_WALLET_ERROR__INVALID_USER_ROLE,BD as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,RD as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,xE as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,cD as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,pD as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,CD as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,vD as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,GE as MULTI_WALLET_ERROR__MISSING_ACCOUNT,xD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,PD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,ND as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,hD as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,ID as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,zE as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,HD as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,VD as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,TD as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,wD as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,MD as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,aD as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,kD as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,FD as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,XE as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,hE as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,bE as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,mD as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,DD as MULTI_WALLET_ERROR__PAYER_MISMATCH,ME as MULTI_WALLET_ERROR__PERMANENT_MEMBER,oD as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,IE as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,ED as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,lE as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,dD as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,_D as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,OE as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,nD as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,sD as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,QE as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,OD as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,ZE as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,gE as MultiWalletAccount,pE as MultiWalletInstruction,zi as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,wi as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,De as NetworkError,ne as NotFoundError,Oe as NotInitializedError,_e as Permission,yr as PermissionError,Be as Permissions,mr as RetryExhaustedError,Ee as RevibaseError,wc as SETTINGS_DISCRIMINATOR,Ne as Secp256r1Key,P as SignedSecp256r1Key,kN as StartMessageRequestSchema,LN as StartTransactionRequestSchema,od as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Xi as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Td as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,ud as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,Rd as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,Cd as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,jc as TRANSACTION_BUFFER_DISCRIMINATOR,Vd as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,kd as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Qd as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,jd as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,uu as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,su as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,Cu as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,Tu as TRANSACTION_EXECUTE_DISCRIMINATOR,ku as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,Ru as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Qr as TRANSACTION_SIZE_LIMIT,wu as TransactionActionTypeSchema,zD as TransactionDetailsSchema,ho as TransactionError,WN as TransactionPayloadSchema,Vu as TransactionPayloadWithBase64MessageBytesSchema,it as UserRole,z as ValidationError,Qc as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,hN as addWhitelistedAddressTrees,Ve as base64URLStringToBuffer,x2 as bufferToBase64URLString,DV as changeConfig,U8 as closeTransactionBuffer,jh as configAction,DA as convertMemberKeyToString,g2 as convertPubkeyCompressedToCose,A2 as convertPubkeyCoseToCompressed,l2 as createClientAuthorizationCompleteRequestChallenge,T2 as createClientAuthorizationStartRequestChallenge,O5 as createDomainConfig,j5 as createDomainUserAccounts,Z5 as createGlobalCounter,f2 as createMessageChallenge,GA as createTransactionBuffer,S2 as createTransactionChallenge,QP as createTransactionManagerSigner,vV as createUserAccounts,NV as createWallet,_o as decodeDomainConfig,Oo as decodeGlobalCounter,Hc as decodeSettings,qc as decodeTransactionBuffer,ea as decodeWhitelistedAddressTree,JV as decompressSettingsAccount,x5 as deserializeConfigActions,e6 as disableDomainConfig,e8 as editDomainConfig,c8 as editTransactionManagerUrl,T8 as editUserDelegate,UA as executeTransaction,zA as executeTransactionBuffer,WA as executeTransactionSync,KA as extendTransactionBuffer,uR as extensionStruct,GM as fetchAllDomainConfig,ZM as fetchAllGlobalCounter,Sg as fetchAllMaybeDomainConfig,Lg as fetchAllMaybeGlobalCounter,gl as fetchAllMaybeSettings,Ul as fetchAllMaybeTransactionBuffer,Ql as fetchAllMaybeWhitelistedAddressTree,Pv as fetchAllSettings,vv as fetchAllTransactionBuffer,Ov as fetchAllWhitelistedAddressTree,vo as fetchDomainConfig,YM as fetchGlobalCounter,fg as fetchMaybeDomainConfig,kg as fetchMaybeGlobalCounter,ms as fetchMaybeSettings,iP as fetchMaybeSettingsAccountData,vl as fetchMaybeTransactionBuffer,aP as fetchMaybeUserAccountData,Xl as fetchMaybeWhitelistedAddressTree,Dv as fetchSettings,qs as fetchSettingsAccountData,Yc as fetchTransactionBuffer,Vr as fetchUserAccountData,ta as fetchWhitelistedAddressTree,sh as getAddMemberArgsCodec,sn as getAddMemberArgsDecoder,nn as getAddMemberArgsEncoder,$v as getAddWhitelistedAddressTreesDiscriminatorBytes,tU as getAddWhitelistedAddressTreesInstruction,aa as getAddWhitelistedAddressTreesInstructionAsync,eU as getAddWhitelistedAddressTreesInstructionDataCodec,ca as getAddWhitelistedAddressTreesInstructionDataDecoder,Cs as getAddWhitelistedAddressTreesInstructionDataEncoder,eh as getAdditionalMetadataCodec,rn as getAdditionalMetadataDecoder,tn as getAdditionalMetadataEncoder,SU as getChangeConfigCompressedDiscriminatorBytes,Ca as getChangeConfigCompressedInstruction,xU as getChangeConfigCompressedInstructionDataCodec,Ia as getChangeConfigCompressedInstructionDataDecoder,xa as getChangeConfigCompressedInstructionDataEncoder,dU as getChangeConfigDiscriminatorBytes,AU as getChangeConfigInstruction,ma as getChangeConfigInstructionAsync,uU as getChangeConfigInstructionDataCodec,pa as getChangeConfigInstructionDataDecoder,Ds as getChangeConfigInstructionDataEncoder,Zs as getClientAndDeviceHash,ah as getCompiledInstructionCodec,cn as getCompiledInstructionDecoder,on as getCompiledInstructionEncoder,Ah as getCompressedAccountMetaCodec,Et as getCompressedAccountMetaDecoder,Ct as getCompressedAccountMetaEncoder,yh as getCompressedAccountMetaReadOnlyCodec,ht as getCompressedAccountMetaReadOnlyDecoder,Mt as getCompressedAccountMetaReadOnlyEncoder,fh as getCompressedOnlyExtensionCodec,dn as getCompressedOnlyExtensionDecoder,an as getCompressedOnlyExtensionEncoder,Ih as getCompressedProofCodec,yn as getCompressedProofDecoder,mn as getCompressedProofEncoder,ae as getCompressedSettingsAddressFromIndex,Ph as getCompressedSettingsCodec,bh as getCompressedSettingsDataCodec,_t as getCompressedSettingsDataDecoder,bt as getCompressedSettingsDataEncoder,Z as getCompressedSettingsDecoder,Rt as getCompressedSettingsEncoder,Wh as getCompressedTokenArgsCodec,kt as getCompressedTokenArgsDecoder,Wt as getCompressedTokenArgsEncoder,Bh as getCompressibleExtensionCodec,Cn as getCompressibleExtensionDecoder,In as getCompressibleExtensionEncoder,Hh as getCompressionInfoCodec,Dn as getCompressionInfoDecoder,En as getCompressionInfoEncoder,Qu as getComputeBudgetEstimate,Kh as getConfigActionCodec,ze as getConfigActionDecoder,Ge as getConfigActionEncoder,RU as getCreateCompressedWalletDiscriminatorBytes,_U as getCreateCompressedWalletInstruction,ha as getCreateCompressedWalletInstructionAsync,bU as getCreateCompressedWalletInstructionDataCodec,Ma as getCreateCompressedWalletInstructionDataDecoder,Ps as getCreateCompressedWalletInstructionDataEncoder,NU as getCreateDomainConfigDiscriminatorBytes,VU as getCreateDomainConfigInstruction,Ba as getCreateDomainConfigInstructionAsync,wU as getCreateDomainConfigInstructionDataCodec,Oa as getCreateDomainConfigInstructionDataDecoder,hs as getCreateDomainConfigInstructionDataEncoder,qU as getCreateDomainUserAccountDiscriminatorBytes,ZU as getCreateDomainUserAccountInstruction,Ha as getCreateDomainUserAccountInstructionAsync,YU as getCreateDomainUserAccountInstructionDataCodec,Va as getCreateDomainUserAccountInstructionDataDecoder,bs as getCreateDomainUserAccountInstructionDataEncoder,nW as getCreateGlobalCounterDiscriminatorBytes,oW as getCreateGlobalCounterInstruction,Ka as getCreateGlobalCounterInstructionAsync,sW as getCreateGlobalCounterInstructionDataCodec,za as getCreateGlobalCounterInstructionDataDecoder,vs as getCreateGlobalCounterInstructionDataEncoder,Xh as getCreateUserAccountArgsCodec,On as getCreateUserAccountArgsDecoder,Ln as getCreateUserAccountArgsEncoder,pW as getCreateUserAccountsDiscriminatorBytes,yW as getCreateUserAccountsInstruction,Ya as getCreateUserAccountsInstructionAsync,mW as getCreateUserAccountsInstructionDataCodec,qa as getCreateUserAccountsInstructionDataDecoder,Ws as getCreateUserAccountsInstructionDataEncoder,EW as getDecompressSettingsAccountDiscriminatorBytes,ti as getDecompressSettingsAccountInstruction,DW as getDecompressSettingsAccountInstructionDataCodec,ei as getDecompressSettingsAccountInstructionDataDecoder,$a as getDecompressSettingsAccountInstructionDataEncoder,vW as getDisableDomainConfigDiscriminatorBytes,ai as getDisableDomainConfigInstruction,UW as getDisableDomainConfigInstructionDataCodec,ci as getDisableDomainConfigInstructionDataDecoder,oi as getDisableDomainConfigInstructionDataEncoder,gt as getDomainConfigAddress,FM as getDomainConfigCodec,bo as getDomainConfigDecoder,HM as getDomainConfigDiscriminatorBytes,lg as getDomainConfigEncoder,zM as getDomainConfigSize,VW as getEditDomainConfigDiscriminatorBytes,pi as getEditDomainConfigInstruction,FW as getEditDomainConfigInstructionAsync,HW as getEditDomainConfigInstructionDataCodec,gi as getEditDomainConfigInstructionDataDecoder,Ls as getEditDomainConfigInstructionDataEncoder,tR as getEditMemberArgsCodec,Un as getEditMemberArgsDecoder,vn as getEditMemberArgsEncoder,ZW as getEditTransactionManagerUrlDiscriminatorBytes,Si as getEditTransactionManagerUrlInstruction,XW as getEditTransactionManagerUrlInstructionDataCodec,fi as getEditTransactionManagerUrlInstructionDataDecoder,li as getEditTransactionManagerUrlInstructionDataEncoder,ok as getEditUserDelegateDiscriminatorBytes,Pi as getEditUserDelegateInstruction,ck as getEditUserDelegateInstructionDataCodec,Di as getEditUserDelegateInstructionDataDecoder,Ei as getEditUserDelegateInstructionDataEncoder,oR as getExpectedSecp256r1SignersCodec,Bt as getExpectedSecp256r1SignersDecoder,Ot as getExpectedSecp256r1SignersEncoder,dR as getExtensionStructCodec,Lt as getExtensionStructDecoder,Tn as getExtensionStructEncoder,dA as getGlobalCounterAddress,qM as getGlobalCounterCodec,Lo as getGlobalCounterDecoder,JM as getGlobalCounterDiscriminatorBytes,Wg as getGlobalCounterEncoder,XM as getGlobalCounterSize,Ks as getJitoTipsConfig,$w as getLightCpiSigner,tt as getLightProtocolRpc,yR as getLinkWalletArgsCodec,qn as getLinkWalletArgsDecoder,Jn as getLinkWalletArgsEncoder,SR as getMemberCodec,Ut as getMemberDecoder,vt as getMemberEncoder,CR as getMemberKeyCodec,oe as getMemberKeyDecoder,se as getMemberKeyEncoder,mk as getMigrateCompressedSettingsDiscriminatorBytes,vi as getMigrateCompressedSettingsInstruction,yk as getMigrateCompressedSettingsInstructionDataCodec,_i as getMigrateCompressedSettingsInstructionDataDecoder,bi as getMigrateCompressedSettingsInstructionDataEncoder,Ek as getMigrateCompressedUsersDiscriminatorBytes,Bi as getMigrateCompressedUsersInstruction,Dk as getMigrateCompressedUsersInstructionDataCodec,Oi as getMigrateCompressedUsersInstructionDataDecoder,Li as getMigrateCompressedUsersInstructionDataEncoder,yN as getMultiWalletErrorMessage,Fk as getNativeTransferIntentCompressedDiscriminatorBytes,Ji as getNativeTransferIntentCompressedInstruction,Gk as getNativeTransferIntentCompressedInstructionDataCodec,ji as getNativeTransferIntentCompressedInstructionDataDecoder,Ki as getNativeTransferIntentCompressedInstructionDataEncoder,Uk as getNativeTransferIntentDiscriminatorBytes,Hi as getNativeTransferIntentInstruction,kk as getNativeTransferIntentInstructionAsync,Wk as getNativeTransferIntentInstructionDataCodec,Vi as getNativeTransferIntentInstructionDataDecoder,Os as getNativeTransferIntentInstructionDataEncoder,MR as getNewAuthorityArgsCodec,Qn as getNewAuthorityArgsDecoder,Xn as getNewAuthorityArgsEncoder,I2 as getOriginIndex,bR as getPackedAddressTreeInfoCodec,wt as getPackedAddressTreeInfoDecoder,Nt as getPackedAddressTreeInfoEncoder,UR as getPackedMerkleContextCodec,fn as getPackedMerkleContextDecoder,ln as getPackedMerkleContextEncoder,LR as getPackedStateTreeInfoCodec,Pt as getPackedStateTreeInfoDecoder,Dt as getPackedStateTreeInfoEncoder,NR as getPausableAccountExtensionCodec,Nn as getPausableAccountExtensionDecoder,Bn as getPausableAccountExtensionEncoder,HR as getPermanentDelegateAccountExtensionCodec,Vn as getPermanentDelegateAccountExtensionDecoder,wn as getPermanentDelegateAccountExtensionEncoder,zR as getPermissionsCodec,Fe as getPermissionsDecoder,He as getPermissionsEncoder,qR as getProofArgsCodec,D as getProofArgsDecoder,E as getProofArgsEncoder,QR as getRemoveMemberArgsCodec,kn as getRemoveMemberArgsDecoder,Wn as getRemoveMemberArgsEncoder,tb as getRentConfigCodec,Rn as getRentConfigDecoder,hn as getRentConfigEncoder,Xs as getSecp256r1MessageHash,sb as getSecp256r1PubkeyCodec,Vt as getSecp256r1PubkeyDecoder,ns as getSecp256r1PubkeyEncoder,gM as getSecp256r1SignatureOffsetsDataDecoder,AM as getSecp256r1SignatureOffsetsDataEncoder,ab as getSecp256r1VerifyArgsCodec,F as getSecp256r1VerifyArgsDecoder,H as getSecp256r1VerifyArgsEncoder,Ab as getSecp256r1VerifyArgsWithDomainAddressCodec,Q as getSecp256r1VerifyArgsWithDomainAddressDecoder,X as getSecp256r1VerifyArgsWithDomainAddressEncoder,V as getSecp256r1VerifyInstruction,b6 as getSecp256r1VerifyInstructionDataCodec,_A as getSecp256r1VerifyInstructionDataDecoder,vA as getSecp256r1VerifyInstructionDataEncoder,Xu as getSendAndConfirmTransaction,Ev as getSettingsCodec,yb as getSettingsCreationArgsCodec,Ft as getSettingsCreationArgsDecoder,Ht as getSettingsCreationArgsEncoder,Vc as getSettingsDecoder,Cv as getSettingsDiscriminatorBytes,Al as getSettingsEncoder,ue as getSettingsFromIndex,fb as getSettingsIndexWithAddressCodec,zt as getSettingsIndexWithAddressDecoder,Gt as getSettingsIndexWithAddressEncoder,Cb as getSettingsMutArgsCodec,j as getSettingsMutArgsDecoder,K as getSettingsMutArgsEncoder,Mb as getSettingsReadonlyArgsCodec,jt as getSettingsReadonlyArgsDecoder,Kt as getSettingsReadonlyArgsEncoder,p2 as getSignedSecp256r1Key,f5 as getSignedTransactionManager,ce as getSolanaRpc,Zu as getSolanaRpcEndpoint,bb as getSplInterfacePdaArgsCodec,qt as getSplInterfacePdaArgsDecoder,Jt as getSplInterfacePdaArgsEncoder,Wb as getTokenMetadataCodec,Fn as getTokenMetadataDecoder,Hn as getTokenMetadataEncoder,aL as getTokenTransferIntentCompressedDiscriminatorBytes,ad as getTokenTransferIntentCompressedInstruction,dL as getTokenTransferIntentCompressedInstructionAsync,iL as getTokenTransferIntentCompressedInstructionDataCodec,cd as getTokenTransferIntentCompressedInstructionDataDecoder,Vs as getTokenTransferIntentCompressedInstructionDataEncoder,Xk as getTokenTransferIntentDiscriminatorBytes,$i as getTokenTransferIntentInstruction,$k as getTokenTransferIntentInstructionAsync,Qk as getTokenTransferIntentInstructionDataCodec,Qi as getTokenTransferIntentInstructionDataDecoder,ws as getTokenTransferIntentInstructionDataEncoder,uA as getTransactionBufferAddress,ML as getTransactionBufferCloseCompressedDiscriminatorBytes,Sd as getTransactionBufferCloseCompressedInstruction,hL as getTransactionBufferCloseCompressedInstructionDataCodec,fd as getTransactionBufferCloseCompressedInstructionDataDecoder,ld as getTransactionBufferCloseCompressedInstructionDataEncoder,lL as getTransactionBufferCloseDiscriminatorBytes,pd as getTransactionBufferCloseInstruction,fL as getTransactionBufferCloseInstructionDataCodec,gd as getTransactionBufferCloseInstructionDataDecoder,Ad as getTransactionBufferCloseInstructionDataEncoder,_v as getTransactionBufferCodec,Bb as getTransactionBufferCreateArgsCodec,Zt as getTransactionBufferCreateArgsDecoder,Yt as getTransactionBufferCreateArgsEncoder,zL as getTransactionBufferCreateCompressedDiscriminatorBytes,vd as getTransactionBufferCreateCompressedInstruction,KL as getTransactionBufferCreateCompressedInstructionDataCodec,_d as getTransactionBufferCreateCompressedInstructionDataDecoder,bd as getTransactionBufferCreateCompressedInstructionDataEncoder,LL as getTransactionBufferCreateDiscriminatorBytes,Pd as getTransactionBufferCreateInstruction,OL as getTransactionBufferCreateInstructionDataCodec,Dd as getTransactionBufferCreateInstructionDataDecoder,Ed as getTransactionBufferCreateInstructionDataEncoder,Jc as getTransactionBufferDecoder,bv as getTransactionBufferDiscriminatorBytes,_l as getTransactionBufferEncoder,iO as getTransactionBufferExecuteCompressedDiscriminatorBytes,Gd as getTransactionBufferExecuteCompressedInstruction,dO as getTransactionBufferExecuteCompressedInstructionDataCodec,Fd as getTransactionBufferExecuteCompressedInstructionDataDecoder,Hd as getTransactionBufferExecuteCompressedInstructionDataEncoder,$L as getTransactionBufferExecuteDiscriminatorBytes,Bd as getTransactionBufferExecuteInstruction,eO as getTransactionBufferExecuteInstructionDataCodec,Od as getTransactionBufferExecuteInstructionDataDecoder,Ld as getTransactionBufferExecuteInstructionDataEncoder,DO as getTransactionBufferExtendCompressedDiscriminatorBytes,tu as getTransactionBufferExtendCompressedInstruction,PO as getTransactionBufferExtendCompressedInstructionDataCodec,eu as getTransactionBufferExtendCompressedInstructionDataDecoder,$d as getTransactionBufferExtendCompressedInstructionDataEncoder,TO as getTransactionBufferExtendDiscriminatorBytes,Yd as getTransactionBufferExtendInstruction,lO as getTransactionBufferExtendInstructionDataCodec,qd as getTransactionBufferExtendInstructionDataDecoder,Jd as getTransactionBufferExtendInstructionDataEncoder,FO as getTransactionBufferVoteCompressedDiscriminatorBytes,pu as getTransactionBufferVoteCompressedInstruction,GO as getTransactionBufferVoteCompressedInstructionDataCodec,gu as getTransactionBufferVoteCompressedInstructionDataDecoder,Au as getTransactionBufferVoteCompressedInstructionDataEncoder,WO as getTransactionBufferVoteDiscriminatorBytes,au as getTransactionBufferVoteInstruction,kO as getTransactionBufferVoteInstructionDataCodec,cu as getTransactionBufferVoteInstructionDataDecoder,ou as getTransactionBufferVoteInstructionDataEncoder,sB as getTransactionExecuteCompressedDiscriminatorBytes,Pu as getTransactionExecuteCompressedInstruction,oB as getTransactionExecuteCompressedInstructionDataCodec,Du as getTransactionExecuteCompressedInstructionDataDecoder,Eu as getTransactionExecuteCompressedInstructionDataEncoder,ZO as getTransactionExecuteDiscriminatorBytes,Su as getTransactionExecuteInstruction,XO as getTransactionExecuteInstructionDataCodec,fu as getTransactionExecuteInstructionDataDecoder,lu as getTransactionExecuteInstructionDataEncoder,CB as getTransactionExecuteSyncCompressedDiscriminatorBytes,Bu as getTransactionExecuteSyncCompressedInstruction,EB as getTransactionExecuteSyncCompressedInstructionDataCodec,Ou as getTransactionExecuteSyncCompressedInstructionDataDecoder,Lu as getTransactionExecuteSyncCompressedInstructionDataEncoder,pB as getTransactionExecuteSyncDiscriminatorBytes,vu as getTransactionExecuteSyncInstruction,mB as getTransactionExecuteSyncInstructionDataCodec,_u as getTransactionExecuteSyncInstructionDataDecoder,bu as getTransactionExecuteSyncInstructionDataEncoder,zb as getTransactionMessageAddressTableLookupCodec,As as getTransactionMessageAddressTableLookupDecoder,us as getTransactionMessageAddressTableLookupEncoder,Hb as getTransactionMessageCodec,Qt as getTransactionMessageDecoder,Xt as getTransactionMessageEncoder,Jb as getTransferFeeAccountExtensionCodec,zn as getTransferFeeAccountExtensionDecoder,Gn as getTransferFeeAccountExtensionEncoder,Zb as getTransferHookAccountExtensionCodec,jn as getTransferHookAccountExtensionDecoder,Kn as getTransferHookAccountExtensionEncoder,N as getUserAccountAddress,e_ as getUserCodec,s_ as getUserCreationArgsCodec,Ie as getUserCreationArgsDecoder,xe as getUserCreationArgsEncoder,$ as getUserDecoder,Xe as getUserEncoder,i_ as getUserMutArgsCodec,$e as getUserMutArgsDecoder,Qe as getUserMutArgsEncoder,g_ as getUserReadOnlyArgsCodec,be as getUserReadOnlyArgsDecoder,Re as getUserReadOnlyArgsEncoder,T_ as getUserReadOnlyOrMutateArgsCodec,es as getUserReadOnlyOrMutateArgsDecoder,$n as getUserReadOnlyOrMutateArgsEncoder,I_ as getUserRoleCodec,je as getUserRoleDecoder,Ke as getUserRoleEncoder,Qw as getWalletAddressFromIndex,ve as getWalletAddressFromSettings,Lv as getWhitelistedAddressTreeCodec,$c as getWhitelistedAddressTreeDecoder,kv as getWhitelistedAddressTreeDiscriminatorBytes,Zl as getWhitelistedAddressTreeEncoder,Ys as getWhitelistedAddressTreeFromIndex,Vw as getWhitelistedAddressTreeIndexFromAddress,sA as getWhitelistedAddressTreesAddress,iN as identifyMultiWalletAccount,dN as identifyMultiWalletInstruction,dw as initialize,Jh as isConfigAction,AR as isExtensionStruct,TN as isMultiWalletError,f_ as isUserReadOnlyOrMutateArgs,a6 as migrateSettings,m6 as migrateUsers,eV as nativeTransferIntent,rU as parseAddWhitelistedAddressTreesInstruction,IU as parseChangeConfigCompressedInstruction,gU as parseChangeConfigInstruction,vU as parseCreateCompressedWalletInstruction,HU as parseCreateDomainConfigInstruction,XU as parseCreateDomainUserAccountInstruction,cW as parseCreateGlobalCounterInstruction,TW as parseCreateUserAccountsInstruction,PW as parseDecompressSettingsAccountInstruction,WW as parseDisableDomainConfigInstruction,GW as parseEditDomainConfigInstruction,QW as parseEditTransactionManagerUrlInstruction,ak as parseEditUserDelegateInstruction,Tk as parseMigrateCompressedSettingsInstruction,Pk as parseMigrateCompressedUsersInstruction,zk as parseNativeTransferIntentCompressedInstruction,Lk as parseNativeTransferIntentInstruction,_6 as parseSecp256r1VerifyInstruction,uL as parseTokenTransferIntentCompressedInstruction,eL as parseTokenTransferIntentInstruction,RL as parseTransactionBufferCloseCompressedInstruction,SL as parseTransactionBufferCloseInstruction,jL as parseTransactionBufferCreateCompressedInstruction,BL as parseTransactionBufferCreateInstruction,uO as parseTransactionBufferExecuteCompressedInstruction,tO as parseTransactionBufferExecuteInstruction,MO as parseTransactionBufferExtendCompressedInstruction,fO as parseTransactionBufferExtendInstruction,zO as parseTransactionBufferVoteCompressedInstruction,LO as parseTransactionBufferVoteInstruction,cB as parseTransactionExecuteCompressedInstruction,QO as parseTransactionExecuteInstruction,DB as parseTransactionExecuteSyncCompressedInstruction,yB as parseTransactionExecuteSyncInstruction,q2 as pollJitoBundleConfirmation,IH as prepareChangeConfigArgs,bH as prepareTransactionBundle,FH as prepareTransactionMessage,JH as prepareTransactionSync,l5 as retrieveTransactionManager,kP as sendJitoBundle,S5 as serializeConfigActions,J2 as signAndSendBundledTransactions,t5 as signAndSendTransaction,pV as tokenTransferIntent,l_ as userReadOnlyOrMutateArgs,ju as vaultTransactionMessageDeserialize,Ku as vaultTransactionMessageSerialize,jA as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|