@revibase/core 0.0.55 → 0.0.57
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 +44 -1
- package/dist/index.d.ts +44 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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,getBase64Decoder,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,getBlockhashDecoder,compileTransaction,getTransactionEncoder,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {TreeType,batchCpiContext1,batchQueue1,batchMerkleTree1,batchCpiContext2,batchQueue2,batchMerkleTree2,batchCpiContext3,batchQueue3,batchMerkleTree3,batchCpiContext4,batchQueue4,batchMerkleTree4,batchCpiContext5,batchQueue5,batchMerkleTree5,createRpc,rpcRequest,versionedEndpoint,encodeBN254toBase58,featureFlags,jsonRpcResultAndContext,CompressedAccountResultV2,CompressedAccountResult,getStateTreeInfoByPubkey,createCompressedAccountWithMerkleContextLegacy,createMerkleContextLegacy,bn as bn$1,parseAccountData,deriveAddressSeedV2,createBN254,deriveAddressV2,getLightSystemAccountMetasV2,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey,SolanaJSONRPCError}from'@solana/web3.js';import y from'zod';import {create,nullable}from'superstruct';import {getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTokenDecoder,AccountState,getTransferSolInstruction}from'gill/programs';import {p256}from'@noble/curves/nist.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {canonicalize}from'json-canonicalize';import {equalBytes}from'@noble/curves/utils.js';var Cs=new Uint8Array([201,232,212,229,59,241,106,197]);function Bh(){return fixEncoderSize(getBytesEncoder(),8).encode(Cs)}function Rg(){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:Cs}))}function Es(){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 Nh(){return combineCodec(Rg(),Es())}function Ds(e){return decodeAccount(e,Es())}async function Ps(e,n,r){let o=await bg(e,n,r);return assertAccountExists(o),o}async function bg(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Ds(o)}async function wh(e,n,r){let o=await _g(e,n,r);return assertAccountsExist(o),o}async function _g(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ds(t))}function Hh(){return 846}var Rs=new Uint8Array([42,206,176,58,175,129,130,233]);function Gh(){return fixEncoderSize(getBytesEncoder(),8).encode(Rs)}function zg(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Rs}))}function bs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function zh(){return combineCodec(zg(),bs())}function _s(e){return decodeAccount(e,bs())}async function Kh(e,n,r){let o=await Kg(e,n,r);return assertAccountExists(o),o}async function Kg(e,n,r){let o=await fetchEncodedAccount(e,n,r);return _s(o)}async function jh(e,n,r){let o=await jg(e,n,r);return assertAccountsExist(o),o}async function jg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>_s(t))}function qh(){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 Zh(){return combineCodec(tn(),rn())}function nn(){return getStructEncoder([["memberKey",V()],["permissions",Ge()],["userArgs",Ke()]])}function on(){return getStructDecoder([["memberKey",ie()],["permissions",ze()],["userArgs",je()]])}function eR(){return combineCodec(nn(),on())}function sn(){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 nR(){return combineCodec(sn(),cn())}function It(){return getStructEncoder([["treeInfo",Et()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function Ct(){return getStructDecoder([["treeInfo",Dt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function aR(){return combineCodec(It(),Ct())}function Pt(){return getStructEncoder([["treeInfo",Et()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function Mt(){return getStructDecoder([["treeInfo",Dt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function AR(){return combineCodec(Pt(),Mt())}function an(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function dn(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function mR(){return combineCodec(an(),dn())}function mn(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function ln(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function yR(){return combineCodec(mn(),ln())}function ht(){return getStructEncoder([["data",getOptionEncoder(Tn())]])}function J(){return getStructDecoder([["data",getOptionDecoder(yn())]])}function IR(){return combineCodec(ht(),J())}function Tn(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(Rt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function yn(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(bt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function PR(){return combineCodec(Tn(),yn())}function _t(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",Sn()],["tlv",getOptionEncoder(getArrayEncoder(fn()))],["hasDelegate",getBooleanEncoder()],["isFrozen",getBooleanEncoder()]])}function vt(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",xn()],["tlv",getOptionDecoder(getArrayDecoder(Ut()))],["hasDelegate",getBooleanDecoder()],["isFrozen",getBooleanDecoder()]])}function bR(){return combineCodec(_t(),vt())}function En(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",Pn()]])}function Dn(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",Mn()]])}function kR(){return combineCodec(En(),Dn())}function Pn(){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",bn()]])}function Mn(){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",_n()]])}function BR(){return combineCodec(Pn(),Mn())}function qe(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(kn())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(nn())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Ln())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Je(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Wn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(on())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(On())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function VR(){return combineCodec(qe(),Je())}function FR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function GR(e,n){return n.__kind===e}function Bn(){return getStructEncoder([["member",getAddressEncoder()],["role",Ye()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",ve()]])}function Nn(){return getStructDecoder([["member",getAddressDecoder()],["role",Ze()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",Ue()]])}function qR(){return combineCodec(Bn(),Nn())}function kn(){return getStructEncoder([["memberKey",V()],["permissions",Ge()]])}function Wn(){return getStructDecoder([["memberKey",ie()],["permissions",ze()]])}function XR(){return combineCodec(kn(),Wn())}function kt(){return getStructEncoder([["memberKey",V()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function Wt(){return getStructDecoder([["memberKey",ie()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function tb(){return combineCodec(kt(),Wt())}function fn(){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([Gn()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([wn()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([Vn()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([Kn()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([qn()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([an()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([En()])]])]])}function Ut(){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([zn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([Hn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([Fn()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([jn()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([Jn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([dn()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([Dn()])]])]])}function sb(){return combineCodec(fn(),Ut())}function cb(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function ab(e,n){return n.__kind===e}function Yn(){return getStructEncoder([["settingsMutArgs",Y()],["transactionManager",getOptionEncoder(Lt())]])}function Zn(){return getStructDecoder([["settingsMutArgs",Z()],["transactionManager",getOptionDecoder(Ot())]])}function Ab(){return combineCodec(Yn(),Zn())}function Rt(){return getStructEncoder([["pubkey",V()],["role",getU8Encoder()],["permissions",Ge()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function bt(){return getStructDecoder([["pubkey",ie()],["role",getU8Decoder()],["permissions",ze()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function lb(){return combineCodec(Rt(),bt())}function V(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function ie(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function fb(){return combineCodec(V(),ie())}function $n(){return getStructEncoder([["authorityCreationArgs",ve()],["compressedProofArgs",D()]])}function eo(){return getStructDecoder([["authorityCreationArgs",Ue()],["compressedProofArgs",P()]])}function Cb(){return combineCodec($n(),eo())}function Bt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function Nt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function Pb(){return combineCodec(Bt(),Nt())}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 Rb(){return combineCodec(Sn(),xn())}function Et(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function Dt(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function vb(){return combineCodec(Et(),Dt())}function wn(){return getStructEncoder([])}function Hn(){return getStructDecoder([])}function Wb(){return combineCodec(wn(),Hn())}function Vn(){return getStructEncoder([])}function Fn(){return getStructDecoder([])}function Bb(){return combineCodec(Vn(),Fn())}function Ge(){return getStructEncoder([["mask",getU8Encoder()]])}function ze(){return getStructDecoder([["mask",getU8Decoder()]])}function Hb(){return combineCodec(Ge(),ze())}function D(){return getStructEncoder([["proof",getOptionEncoder(mn())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function P(){return getStructDecoder([["proof",getOptionDecoder(ln())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function zb(){return combineCodec(D(),P())}function Ln(){return getStructEncoder([["memberKey",V()],["userArgs",Ke()]])}function On(){return getStructDecoder([["memberKey",ie()],["userArgs",je()]])}function Jb(){return combineCodec(Ln(),On())}function bn(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function _n(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function Xb(){return combineCodec(bn(),_n())}function no(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function wt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function e_(){return combineCodec(no(),wt())}function F(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function G(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function n_(){return combineCodec(F(),G())}function oo(){return getStructEncoder([["verifyArgs",F()],["domainConfigIndex",getU8Encoder()]])}function so(){return getStructDecoder([["verifyArgs",G()],["domainConfigIndex",getU8Decoder()]])}function a_(){return combineCodec(oo(),so())}function co(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function ao(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function u_(){return combineCodec(co(),ao())}function io(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function uo(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function p_(){return combineCodec(io(),uo())}function Y(){return getStructEncoder([["accountMeta",It()],["data",ht()]])}function Z(){return getStructDecoder([["accountMeta",Ct()],["data",J()]])}function y_(){return combineCodec(Y(),Z())}function Ht(){return getStructEncoder([["accountMeta",Pt()],["data",ht()]])}function Vt(){return getStructDecoder([["accountMeta",Mt()],["data",J()]])}function I_(){return combineCodec(Ht(),Vt())}function Ft(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function Gt(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function D_(){return combineCodec(Ft(),Gt())}function Gn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(tn())]])}function zn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(rn())]])}function R_(){return combineCodec(Gn(),zn())}function zt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(kt())]])}function Kt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(Wt())]])}function U_(){return combineCodec(zt(),Kt())}function jt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(sn())],["addressTableLookups",getArrayEncoder(yo())]])}function qt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(cn())],["addressTableLookups",getArrayDecoder(fo())]])}function O_(){return combineCodec(jt(),qt())}function yo(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function fo(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function w_(){return combineCodec(yo(),fo())}function Q(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([oo()])]])]])}function $(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([so()])]])]])}function G_(){return combineCodec(Q(),$())}function z_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function K_(e,n){return n.__kind===e}function Kn(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function jn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function J_(){return combineCodec(Kn(),jn())}function qn(){return getStructEncoder([["transferring",getU8Encoder()]])}function Jn(){return getStructDecoder([["transferring",getU8Decoder()]])}function X_(){return combineCodec(qn(),Jn())}var So=(a=>(a[a.Ble=0]="Ble",a[a.Cable=1]="Cable",a[a.Hybrid=2]="Hybrid",a[a.Internal=3]="Internal",a[a.Nfc=4]="Nfc",a[a.SmartCard=5]="SmartCard",a[a.Usb=6]="Usb",a))(So||{});function Jt(){return getEnumEncoder(So)}function Yt(){return getEnumDecoder(So)}function ev(){return combineCodec(Jt(),Yt())}function Zt(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",V()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(Jt()))],["wallets",getArrayEncoder(io())],["role",Ye()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function ne(){return getStructDecoder([["domainConfig",getOptionDecoder(getAddressDecoder())],["member",ie()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(Yt()))],["wallets",getArrayDecoder(uo())],["role",Ze()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function ov(){return combineCodec(Zt(),ne())}function ve(){return getStructEncoder([["addressTreeInfo",Bt()],["outputStateTreeIndex",getU8Encoder()]])}function Ue(){return getStructDecoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",getU8Decoder()]])}function iv(){return combineCodec(ve(),Ue())}function tt(){return getStructEncoder([["accountMeta",It()],["data",Zt()]])}function rt(){return getStructDecoder([["accountMeta",Ct()],["data",ne()]])}function gv(){return combineCodec(tt(),rt())}function Lt(){return getStructEncoder([["accountMeta",Pt()],["data",Zt()]])}function Ot(){return getStructDecoder([["accountMeta",Mt()],["data",ne()]])}function Tv(){return combineCodec(Lt(),Ot())}function Ke(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Lt()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([tt()])]])]])}function je(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Ot()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([rt()])]])]])}function xv(){return combineCodec(Ke(),je())}function Iv(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Cv(e,n){return n.__kind===e}var Ne=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(Ne||{});function Ye(){return getEnumEncoder(Ne)}function Ze(){return getEnumDecoder(Ne)}function Pv(){return combineCodec(Ye(),Ze())}var Gc=new Uint8Array([223,179,163,190,177,224,67,173]);function RU(){return fixEncoderSize(getBytesEncoder(),8).encode(Gc)}function W1(){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:Gc}))}function hr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(bt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function bU(){return combineCodec(W1(),hr())}function zc(e){return decodeAccount(e,hr())}async function _U(e,n,r){let o=await xo(e,n,r);return assertAccountExists(o),o}async function xo(e,n,r){let o=await fetchEncodedAccount(e,n,r);return zc(o)}async function vU(e,n,r){let o=await L1(e,n,r);return assertAccountsExist(o),o}async function L1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>zc(t))}var Yc=new Uint8Array([90,36,35,219,93,225,110,96]);function LU(){return fixEncoderSize(getBytesEncoder(),8).encode(Yc)}function $1(){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",V()],["executor",V()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(V())],["expectedSigners",getArrayEncoder(kt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Yc}))}function Zc(){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",ie()],["executor",ie()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(ie())],["expectedSigners",getArrayDecoder(Wt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function OU(){return combineCodec($1(),Zc())}function Xc(e){return decodeAccount(e,Zc())}async function Qc(e,n,r){let o=await ef(e,n,r);return assertAccountExists(o),o}async function ef(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Xc(o)}async function BU(e,n,r){let o=await tf(e,n,r);return assertAccountsExist(o),o}async function tf(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Xc(t))}var ta=new Uint8Array([105,23,173,2,197,255,80,87]);function HU(){return fixEncoderSize(getBytesEncoder(),8).encode(ta)}function xf(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:ta}))}function ra(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function VU(){return combineCodec(xf(),ra())}function na(e){return decodeAccount(e,ra())}async function oa(e,n,r){let o=await If(e,n,r);return assertAccountExists(o),o}async function If(e,n,r){let o=await fetchEncodedAccount(e,n,r);return na(o)}async function FU(e,n,r){let o=await Cf(e,n,r);return assertAccountsExist(o),o}async function Cf(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>na(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 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 l(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let o=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:O(r.value),role:sa(r.value)?upgradeRoleToSigner(o):o,...sa(r.value)?{signer:r.value}:{}})}}function sa(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var aa=new Uint8Array([8]);function sk(){return fixEncoderSize(getBytesEncoder(),1).encode(aa)}function Ro(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:aa}))}function ia(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function ck(){return combineCodec(Ro(),ia())}async function da(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},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Ro().encode(c),programAddress:r})}function ak(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Ro().encode(c),programAddress:r})}function ik(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:ia().decode(e.data)}}var ma=new Uint8Array([9]);function lk(){return fixEncoderSize(getBytesEncoder(),1).encode(ma)}function la(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(qe())],["signers",getArrayEncoder(Q())],["compressedProofArgs",getOptionEncoder(D())]]),e=>({...e,discriminator:ma}))}function Ta(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Je())],["signers",getArrayDecoder($())],["compressedProofArgs",getOptionDecoder(P())]])}function Tk(){return combineCodec(la(),Ta())}function ya(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:la().encode(c),programAddress:r})}function yk(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Ta().decode(e.data)}}var Ca=new Uint8Array([19]);function Dk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ca)}function Ea(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(qe())],["signers",getArrayEncoder(Q())],["settingsMutArgs",Y()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Ca}))}function Da(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Je())],["signers",getArrayDecoder($())],["settingsMutArgs",Z()],["compressedProofArgs",P()]])}function Pk(){return combineCodec(Ea(),Da())}function Pa(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Ea().encode(c),programAddress:r})}function Mk(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Da().decode(e.data)}}var Ra=new Uint8Array([18]);function kk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ra)}function bo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["addressTreeInfo",Bt()],["outputStateTreeIndex",getU8Encoder()],["userArgs",Ke()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Ra}))}function ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",P()],["addressTreeInfo",Nt()],["outputStateTreeIndex",getU8Decoder()],["userArgs",je()],["settingsIndex",getU128Decoder()]])}function Wk(){return combineCodec(bo(),ba())}async function _a(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},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:bo().encode(c),programAddress:r})}function Lk(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:bo().encode(c),programAddress:r})}function Ok(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:ba().decode(e.data)}}var Na=new Uint8Array([0]);function Gk(){return fixEncoderSize(getBytesEncoder(),1).encode(Na)}function vo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",ve()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Na}))}function wa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",Ue()],["compressedProofArgs",P()]])}function zk(){return combineCodec(vo(),wa())}async function Ha(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},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:vo().encode(c),programAddress:r})}function Kk(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:vo().encode(c),programAddress:r})}function jk(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:wa().decode(e.data)}}var Ga=new Uint8Array([4]);function $k(){return fixEncoderSize(getBytesEncoder(),1).encode(Ga)}function Uo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["member",no()],["role",Ye()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(Jt())],["userAccountCreationArgs",ve()],["linkWalletArgs",getOptionEncoder(Yn())]]),e=>({...e,discriminator:Ga}))}function za(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",P()],["member",wt()],["role",Ze()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Yt())],["userAccountCreationArgs",Ue()],["linkWalletArgs",getOptionDecoder(Zn())]])}function eW(){return combineCodec(Uo(),za())}async function Ka(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={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:Uo().encode(c),programAddress:r})}function tW(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=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:Uo().encode(c),programAddress:r})}function rW(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:za().decode(e.data)}}var qa=new Uint8Array([3]);function iW(){return fixEncoderSize(getBytesEncoder(),1).encode(qa)}function Wo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:qa}))}function Ja(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function dW(){return combineCodec(Wo(),Ja())}async function Ya(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 i=m(c),a=l(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:Wo().encode({}),programAddress:r})}function uW(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 i=m(c),a=l(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:Wo().encode({}),programAddress:r})}function AW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:Ja().decode(e.data)}}var Xa=new Uint8Array([5]);function fW(){return fixEncoderSize(getBytesEncoder(),1).encode(Xa)}function Oo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["createUserArgs",getArrayEncoder(Bn())]]),e=>({...e,discriminator:Xa}))}function Qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",P()],["createUserArgs",getArrayDecoder(Nn())]])}function SW(){return combineCodec(Oo(),Qa())}async function $a(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},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Oo().encode(c),programAddress:r})}function xW(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Oo().encode(c),programAddress:r})}function IW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Qa().decode(e.data)}}var ri=new Uint8Array([17]);function RW(){return fixEncoderSize(getBytesEncoder(),1).encode(ri)}function ni(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",Y()],["compressedProofArgs",D()],["signers",getArrayEncoder(Q())]]),e=>({...e,discriminator:ri}))}function oi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",Z()],["compressedProofArgs",P()],["signers",getArrayDecoder($())]])}function bW(){return combineCodec(ni(),oi())}function si(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:ni().encode(c),programAddress:r})}function _W(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:oi().decode(e.data)}}var ii=new Uint8Array([2]);function OW(){return fixEncoderSize(getBytesEncoder(),1).encode(ii)}function di(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:ii}))}function ui(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function BW(){return combineCodec(di(),ui())}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},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.admin),...a],data:di().encode(c),programAddress:r})}function NW(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:ui().decode(e.data)}}var li=new Uint8Array([1]);function KW(){return fixEncoderSize(getBytesEncoder(),1).encode(li)}function No(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder($n())]]),e=>({...e,discriminator:li}))}function Ti(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(eo())]])}function jW(){return combineCodec(No(),Ti())}async function qW(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},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:No().encode(c),programAddress:r})}function yi(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:No().encode(c),programAddress:r})}function JW(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:o(),whitelistedAddressTrees:o(),systemProgram:r()},data:Ti().decode(e.data)}}var xi=new Uint8Array([6]);function tL(){return fixEncoderSize(getBytesEncoder(),1).encode(xi)}function Ii(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",tt()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",D()]]),e=>({...e,discriminator:xi}))}function Ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",rt()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",P()]])}function rL(){return combineCodec(Ii(),Ci())}function Ei(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.authority),...a],data:Ii().encode(c),programAddress:r})}function nL(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{authority:r()},data:Ci().decode(e.data)}}var Mi=new Uint8Array([7]);function uL(){return fixEncoderSize(getBytesEncoder(),1).encode(Mi)}function hi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",tt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["delegateTo",getOptionEncoder(co())],["oldSettingsMutArgs",getOptionEncoder(Y())],["newSettingsMutArgs",getOptionEncoder(Y())],["compressedProofArgs",D()]]),e=>({...e,discriminator:Mi}))}function Ri(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",rt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["delegateTo",getOptionDecoder(ao())],["oldSettingsMutArgs",getOptionDecoder(Z())],["newSettingsMutArgs",getOptionDecoder(Z())],["compressedProofArgs",P()]])}function AL(){return combineCodec(hi(),Ri())}function bi(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.feePayer),s(t.signer),s(t.oldSettings),s(t.newSettings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.domainConfig),...a],data:hi().encode(c),programAddress:r})}function gL(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:o(),oldSettings:o(),newSettings:o(),slotHashSysvar:o(),instructionsSysvar:o(),domainConfig:o()},data:Ri().decode(e.data)}}var vi=new Uint8Array([29]);function SL(){return fixEncoderSize(getBytesEncoder(),1).encode(vi)}function wo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(Q())]]),e=>({...e,discriminator:vi}))}function Ui(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder($())]])}function xL(){return combineCodec(wo(),Ui())}async function IL(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},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:wo().encode(c),programAddress:r})}function ki(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:wo().encode(c),programAddress:r})}function CL(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Ui().decode(e.data)}}var Oi=new Uint8Array([27]);function bL(){return fixEncoderSize(getBytesEncoder(),1).encode(Oi)}function Bi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(Q())],["settingsMutArgs",Y()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Oi}))}function Ni(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder($())],["settingsMutArgs",Z()],["compressedProofArgs",P()]])}function _L(){return combineCodec(Bi(),Ni())}function wi(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Bi().encode(c),programAddress:r})}function vL(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Ni().decode(e.data)}}var Gi=new Uint8Array([30]);function NL(){return fixEncoderSize(getBytesEncoder(),1).encode(Gi)}function Fo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Ft())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(_t()))],["compressedProofArgs",getOptionEncoder(D())],["signers",getArrayEncoder(Q())]]),e=>({...e,discriminator:Gi}))}function zi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Gt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(vt()))],["compressedProofArgs",getOptionDecoder(P())],["signers",getArrayDecoder($())]])}function wL(){return combineCodec(Fo(),zi())}async function HL(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},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Fo().encode(c),programAddress:r})}function Ki(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},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Fo().encode(c),programAddress:r})}function VL(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:zi().decode(e.data)}}var Xi=new Uint8Array([28]);function JL(){return fixEncoderSize(getBytesEncoder(),1).encode(Xi)}function Go(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Ft())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(_t()))],["signers",getArrayEncoder(Q())],["settingsMutArgs",Y()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Xi}))}function Qi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Gt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(vt()))],["signers",getArrayDecoder($())],["settingsMutArgs",Z()],["compressedProofArgs",P()]])}function YL(){return combineCodec(Go(),Qi())}async function ZL(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},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Go().encode(c),programAddress:r})}function $i(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},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Go().encode(c),programAddress:r})}function XL(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:Qi().decode(e.data)}}var rd=new Uint8Array([13]);function oO(){return fixEncoderSize(getBytesEncoder(),1).encode(rd)}function nd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:rd}))}function od(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function sO(){return combineCodec(nd(),od())}function sd(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:nd().encode(c),programAddress:r})}function cO(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:od().decode(e.data)}}var id=new Uint8Array([23]);function pO(){return fixEncoderSize(getBytesEncoder(),1).encode(id)}function dd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",Y()],["compressedProofArgs",D()]]),e=>({...e,discriminator:id}))}function ud(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",Z()],["compressedProofArgs",P()]])}function mO(){return combineCodec(dd(),ud())}function Ad(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.rentCollector),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:dd().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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:ud().decode(e.data)}}var md=new Uint8Array([10]);function CO(){return fixEncoderSize(getBytesEncoder(),1).encode(md)}function ld(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",zt()],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:md}))}function Td(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Kt()],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function EO(){return combineCodec(ld(),Td())}function yd(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:ld().encode(c),programAddress:r})}function DO(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:Td().decode(e.data)}}var xd=new Uint8Array([20]);function vO(){return fixEncoderSize(getBytesEncoder(),1).encode(xd)}function Id(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",zt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",Ht()],["compressedProofArgs",D()]]),e=>({...e,discriminator:xd}))}function Cd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Kt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Vt()],["compressedProofArgs",P()]])}function UO(){return combineCodec(Id(),Cd())}function Ed(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:Id().encode(c),programAddress:r})}function kO(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:Cd().decode(e.data)}}var Md=new Uint8Array([14]);function HO(){return fixEncoderSize(getBytesEncoder(),1).encode(Md)}function hd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Md}))}function Rd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function VO(){return combineCodec(hd(),Rd())}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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:hd().encode(c),programAddress:r})}function FO(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:Rd().decode(e.data)}}var Ud=new Uint8Array([24]);function YO(){return fixEncoderSize(getBytesEncoder(),1).encode(Ud)}function kd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",Y()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Ud}))}function Wd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",Z()],["compressedProofArgs",P()]])}function ZO(){return combineCodec(kd(),Wd())}function Ld(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:kd().encode(c),programAddress:r})}function XO(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:Wd().decode(e.data)}}var Nd=new Uint8Array([12]);function nB(){return fixEncoderSize(getBytesEncoder(),1).encode(Nd)}function wd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Nd}))}function Hd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function oB(){return combineCodec(wd(),Hd())}function Vd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.transactionBuffer),...a],data:wd().encode(c),programAddress:r})}function sB(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:Hd().decode(e.data)}}var zd=new Uint8Array([22]);function AB(){return fixEncoderSize(getBytesEncoder(),1).encode(zd)}function Kd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:zd}))}function jd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function gB(){return combineCodec(Kd(),jd())}function qd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.transactionBuffer),...a],data:Kd().encode(c),programAddress:r})}function pB(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:jd().decode(e.data)}}var Zd=new Uint8Array([11]);function xB(){return fixEncoderSize(getBytesEncoder(),1).encode(Zd)}function Xd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Zd}))}function Qd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function IB(){return combineCodec(Xd(),Qd())}function $d(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Xd().encode(c),programAddress:r})}function CB(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:Qd().decode(e.data)}}var ru=new Uint8Array([21]);function bB(){return fixEncoderSize(getBytesEncoder(),1).encode(ru)}function nu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",Ht()],["compressedProofArgs",D()]]),e=>({...e,discriminator:ru}))}function ou(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Vt()],["compressedProofArgs",P()]])}function _B(){return combineCodec(nu(),ou())}function su(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:nu().encode(c),programAddress:r})}function vB(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:ou().decode(e.data)}}var iu=new Uint8Array([15]);function BB(){return fixEncoderSize(getBytesEncoder(),1).encode(iu)}function du(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:iu}))}function uu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function NB(){return combineCodec(du(),uu())}function Au(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}},i=m({}),a=l(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:du().encode({}),programAddress:r})}function wB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:uu().decode(e.data)}}var mu=new Uint8Array([25]);function KB(){return fixEncoderSize(getBytesEncoder(),1).encode(mu)}function lu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:mu}))}function Tu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function jB(){return combineCodec(lu(),Tu())}function yu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.transactionBuffer),...a],data:lu().encode(c),programAddress:r})}function qB(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:Tu().decode(e.data)}}var xu=new Uint8Array([16]);function eN(){return fixEncoderSize(getBytesEncoder(),1).encode(xu)}function Iu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",jt()],["signers",getArrayEncoder(Q())]]),e=>({...e,discriminator:xu}))}function Cu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",qt()],["signers",getArrayDecoder($())]])}function tN(){return combineCodec(Iu(),Cu())}function Eu(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Iu().encode(c),programAddress:r})}function rN(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Cu().decode(e.data)}}var Mu=new Uint8Array([26]);function dN(){return fixEncoderSize(getBytesEncoder(),1).encode(Mu)}function hu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",jt()],["signers",getArrayEncoder(Q())],["settingsMutArgs",Y()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Mu}))}function Ru(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",qt()],["signers",getArrayDecoder($())],["settingsMutArgs",Z()],["compressedProofArgs",P()]])}function uN(){return combineCodec(hu(),Ru())}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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:hu().encode(c),programAddress:r})}function AN(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Ru().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",RE=(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))(RE||{});function qN(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 bE=(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.NativeTransferIntent=13]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=14]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=15]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=16]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=17]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=18]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=19]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=20]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=21]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=22]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=23]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=24]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=25]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=26]="TransactionBufferVoteCompressed",T[T.TransactionExecute=27]="TransactionExecute",T[T.TransactionExecuteCompressed=28]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=29]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=30]="TransactionExecuteSyncCompressed",T))(bE||{});function JN(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([29])),0))return 13;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 14;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 15;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 16;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 17;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 18;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 19;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 20;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 21;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 22;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 23;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 24;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 25;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 26;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 27;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 28;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 29;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 30;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var vE=6e3,UE=6001,kE=6002,WE=6003,LE=6004,OE=6005,BE=6006,NE=6007,wE=6008,HE=6009,VE=6010,FE=6011,GE=6012,zE=6013,KE=6014,jE=6015,qE=6016,JE=6017,YE=6018,ZE=6019,XE=6020,QE=6021,$E=6022,eD=6023,tD=6024,rD=6025,nD=6026,oD=6027,sD=6028,cD=6029,aD=6030,iD=6031,dD=6032,uD=6033,AD=6034,gD=6035,pD=6036,mD=6037,lD=6038,TD=6039,yD=6040,fD=6041,SD=6042,xD=6043,ID=6044,CD=6045,ED=6046,DD=6047,PD=6048,MD=6049,hD=6050,RD=6051,bD=6052,_D=6053,vD=6054,UD=6055,kD=6056,WD=6057,LD=6058,OD=6059,BD=6060,ND=6061,wD=6062,HD=6063,VD=6064,FD=6065,GD=6066,zD=6067,KD=6068,jD=6069,qD=6070,JD=6071,YD=6072,ZD=6073,XD=6074,QD=6075,$D=6076,eP=6077,tP=6078,rP=6079,nP=6080,oP=6081,sP=6082,cP=6083,aP=6084,iP=6085,dP=6086,_u;process.env.NODE_ENV!=="production"&&(_u={[iD]:"This member is already delegated to another wallet.",[NE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[eP]:"Clock sysvar access failed. This may indicate a system error.",[RD]:"Missing credential id.",[_D]:"The domain configuration account is disabled. Please contact support or try again later.",[vD]:"Missing domain configuration account.",[QD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[dP]:"Duplicate address tree detected. This address tree is already in the whitelist.",[VE]:"Duplicate public keys detected among members. Each member must have a unique key.",[HE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[QE]:"No members provided. A multisig wallet must contain at least one member.",[BD]:"Slot numbers list is empty. At least one slot number is required for validation.",[YE]:"Expected a User with Administrator role for this instruction.",[wE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[qE]:"Expected a User with Transaction Manager role for this instruction.",[yD]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[fD]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[SD]:"Declared buffer size does not match the actual serialized size.",[OD]:"Failed to compute hash. This may indicate a system error.",[AD]:"Not enough members with vote permission to meet the approval threshold.",[dD]:"At least one signer with execute permission is required to proceed.",[uD]:"At least one signer with initiate permission is required to perform this action.",[nD]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[XD]:"Invalid account index in transaction message. The account index is out of bounds.",[WD]:"Address Tree supplied is not part of the whitelisted address trees.",[ZE]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[sD]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[TD]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[ND]:"Member key conversion failed. The provided key format is invalid.",[gD]:"Only delegated members are allowed for this transaction.",[rD]:"Unexpected number of accounts provided for this instruction.",[zE]:"User with Permanent Member role must have a delegated wallet.",[UE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[LE]:"The extracted public key has an invalid length or encoding.",[vE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[WE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[hD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[PD]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[eD]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[JD]:"Invalid source type for token transfer. The source account type is not supported.",[JE]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[jE]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[tD]:"Malformed transaction message: structure or formatting does not match the expected layout.",[nP]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[oD]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[rP]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[qD]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[OE]:"The extracted WebAuthn signed message payload is malformed.",[ED]:"An input string exceeds the maximum allowed character length.",[UD]:"This member is not registered under the provided domain configuration.",[VD]:"Member not found in settings. Cannot remove a member that does not exist.",[ZD]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[cD]:"A required account is missing from the instruction context.",[wD]:"Compressed proof arguments are missing. Required for compressed account operations.",[zD]:"Missing compressed token account. Required for token transfer operations.",[oP]:"Missing destination token account. Required for token transfer operations.",[jD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[HD]:"Light CPI accounts are missing. Required for compressed account operations.",[aD]:"User mutation arguments are required when performing add or remove delegate operations.",[aP]:"Missing new authority account. Required for domain configuration updates.",[cP]:"Missing settings account. Required for delegate operations on compressed wallets.",[LD]:"Compressed settings data is missing. The settings account must be initialized with data.",[sP]:"Missing source token account. Required for token transfer operations.",[KD]:"Missing SPL interface PDA. Required for token transfer operations.",[DD]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[$D]:"User account address is missing. Required for secp256r1 signature verification.",[iP]:"Missing whitelisted address trees account. Required for domain configuration updates.",[mD]:"No valid signer found in this transaction.",[XE]:"Only one administrator is allowed per wallet.",[GE]:"Only one permanent member is allowed per wallet.",[KE]:"Only one transaction manager is allowed per wallet.",[kD]:"The given origin index is not in the whitelisted origins.",[GD]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[FE]:"Permanent members cannot be removed from a wallet.",[CD]:"Writable CPI calls to protected accounts are not permitted.",[BE]:"The rpIdHash extracted from the signed message does not match the expected value.",[FD]:"Settings key mismatch. The provided settings key does not match the expected value.",[kE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[MD]:"The specified slot number was not found in the provided slot history.",[YD]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[$E]:"Too many members: a maximum of 4 members are supported.",[xD]:"This transaction has expired. It must be executed within 3 minutes of approval.",[ID]:"This transaction has not yet reached the required approval threshold.",[bD]:"Missing transports.",[lD]:"Only the transaction creator or rent payer may close this transaction buffer.",[tP]:"Unauthorized: Only the admin account is allowed to perform this action.",[pD]:"Member is not part of the expected signers for this transaction."});function ew(e){return process.env.NODE_ENV!=="production"?_u[e]:"Error message not available in production bundles."}function tw(e,n,r){return isProgramError(e,n,A,r)}async function gw({admin:e,addressTree:n}){return da({payer:e,addressTree:n,remainingAccounts:[]})}var jo=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],vu="https://mainnet.block-engine.jito.wtf/api/v1",Uu="https://bundles.jito.wtf/api/v1/bundles/tip_floor",ku="landed_tips_75th_percentile";var ke=class extends Error{constructor(r,o,t){super(r);this.code=o;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},nt=class extends ke{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},oe=class extends ke{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},z=class extends ke{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},De=class extends ke{constructor(r,o,t){super(r,"NETWORK_ERROR",{statusCode:o,url:t});this.statusCode=o;this.url=t;}};var le=class extends ke{constructor(r,o,t){super(r,"BUNDLE_ERROR",{bundleId:o,attempt:t});this.bundleId=o;this.attempt=t;}},Br=class extends ke{constructor(r,o,t){super(`Operation "${r}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=o;this.lastError=t;}},Nr=class extends ke{constructor(r,o,t){super(r,"PERMISSION_ERROR",{required:o,actual:t});this.required=o;this.actual=t;}};var $t={Ed25519:1,Secp256r1:2};var Wu=y.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),xw=y.object({transactionActionType:Wu,transactionAddress:y.string(),transactionMessageBytes:y.array(y.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),uP=y.object({transactionActionType:Wu,transactionAddress:y.string(),transactionMessageBytes:y.base64()}).strict(),Lu=y.object({phase:y.literal("start"),redirectOrigin:y.url(),signer:y.string().optional(),rid:y.string(),validTill:y.number(),data:y.object({type:y.literal("message"),payload:y.string()}).strict()}).strict(),Ou=y.object({phase:y.literal("start"),redirectOrigin:y.url(),signer:y.string().optional(),rid:y.string(),validTill:y.number(),data:y.object({type:y.literal("transaction"),payload:uP,sendTx:y.boolean()}).strict()}).strict(),Bu=y.object({startRequest:y.union([Lu,Ou]),authResponse:y.custom(),client:y.object({clientOrigin:y.url(),jws:y.string()}).strict(),device:y.object({jwk:y.base64(),jws:y.string()}).strict(),authProvider:y.object({jwk:y.base64(),jws:y.string()}).strict().optional()}).strict(),Nu=y.object({signer:y.string(),userAddressTreeIndex:y.number().optional(),additionalInfo:y.looseObject({}).optional()}).strict(),AP=y.object({slotHash:y.string(),slotNumber:y.string(),originIndex:y.number(),crossOrigin:y.boolean()}).strict(),Iw=y.object({phase:y.literal("complete"),data:y.object({type:y.literal("message"),payload:Nu.extend(Bu.shape).extend({id:y.string().optional(),client:y.object({clientOrigin:y.url()}).strict()})}).strict()}).strict(),Cw=y.object({phase:y.literal("complete"),data:y.object({type:y.literal("transaction"),payload:Nu.extend(Bu.shape).extend(AP.shape).extend({client:y.object({clientOrigin:y.url()}).strict()})}).strict()}).strict(),Ew=y.object({phase:y.literal("complete"),data:y.object({type:y.literal("transaction"),payload:y.object({startRequest:y.union([Ou,Lu]),txSig:y.string()})}).strict()}).strict();var We={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},we=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,o)=>r|o,0))}static all(){return new e(Object.values(We).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var qo=33,He=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!==qo)throw new Error(`Invalid public key length, expected ${qo} 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===qo)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 He{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 mP(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function lP(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var Hu=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(mP())],["addressTableLookups",getArrayCodec(lP())]]);function Vu(e){return Hu.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 Fu(e){let n=Hu.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}}var Ae={};function Gu(){if(!Ae.solanaRpcEndpoint)throw new nt("RPC endpoint");return Ae.solanaRpcEndpoint}function Fe(){if(!Ae.lightProtocolRpc)throw new nt("Light Protocol RPC");return Ae.lightProtocolRpc}function ee(){if(!Ae.solanaRpc)throw new nt("Solana RPC");return Ae.solanaRpc}function zu(){if(!Ae.sendAndConfirm)throw new nt("Send and confirm transaction function");return Ae.sendAndConfirm}function Yo(){return Ae.jitoTipsConfig?Ae.jitoTipsConfig:{blockEngineUrl:vu,getJitoTipsUrl:Uu,priority:ku}}function jw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:o}){Ae.solanaRpcEndpoint=e,Ae.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});Ae.solanaRpc=t,Ae.sendAndConfirm=c,Ae.jitoTipsConfig=o??null;}async function er(e,n){if(!e.ok)throw new De(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function tr(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"+Hr(n.get(-2))),y:BigInt("0x"+Hr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function i2(e){let r=p256.Point.fromBytes(getBase58Encoder().encode(e)).toBytes(false),o=new Map;return o.set(1,2),o.set(3,-7),o.set(-1,1),o.set(-2,r.slice(1,33)),o.set(-3,r.slice(33,65)),new Uint8Array(encodeCBOR(o))}async function d2(e){let{authenticatorData:n,clientDataJSON:r,signature:o}=e.authResponse.response,t=Ce(n),c=JSON.parse(getUtf8Decoder().decode(Ce(r))),i=Ju(c),a=Zu(Ce(o)),s=await mt({rpIdHash:t.subarray(0,32)});return new M(e.signer.toString(),{verifyArgs:{clientDataJson:Ce(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:Zo(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:s,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function Zo(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(n),...getBase64Encoder().encode(r)]))}function u2(e){return sha256(getUtf8Encoder().encode(JSON.stringify(e)))}function A2(e){return Xo(e.data.payload.authResponse)}function g2(e,n,r,o){let t=Zo(n,r,o);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...t]))}async function p2(e,n,r,o,t,c){let i;if(!t||!c){let u=(await ee().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!u)throw new oe("Slot sysvar","Unable to fetch slot sysvar data");let g=getBase64Encoder().encode(u[0]);c=getU64Decoder().decode(g.subarray(0,8)).toString(),i=g.subarray(8,40),t=getBase58Decoder().decode(i);}else i=getBase58Encoder().encode(t);let a=sha256(typeof e.transactionMessageBytes=="string"?getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),s=Zo(n,r,o),d=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...a,...i,...s]));return {slotNumber:c,slotHash:t,challenge:d}}function Xo(e){let n=Vr(e);return sha256(n)}function m2(e){let n="";for(let o of e)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ce(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,o=n.padEnd(n.length+r,"="),t=atob(o),c=new ArrayBuffer(t.length),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}async function l2(e,n){let{data:r}=await Ps(ee(),e),t=Yu(r.origins,r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new oe("Origin","Origin not found in domain config");return t}function T2(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function y2(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}function Hr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function PP(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 Ju(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 o=JSON.stringify(r);return new TextEncoder().encode(o.slice(1,-1))}function Yu(e,n){let r=[],o=0,t=new TextDecoder;for(let c=0;c<n;c++){if(o+2>e.length)throw new Error("MaxLengthExceeded");let i=e[o]|e[o+1]<<8;if(o+=2,o+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(o,o+i),s=t.decode(a);r.push(s),o+=i;}return r}function Zu(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 _=n&127;r+=_;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let o=e[r+1],t=r+2,c=e.slice(t,t+o);if(r=t+o,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,s=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=s[0]===0&&s.length>32?s.slice(1):s;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let p=p256.Point.CURVE().n>>1n,f=BigInt("0x"+Hr(u)),I=(f>p?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=PP(I);return new Uint8Array([...g,...x])}function Vr(e){let n=Ce(e.response.clientDataJSON),r=Ce(e.response.authenticatorData),o=sha256(n);return new Uint8Array([...r,...o])}var $u={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true,initialDelayMs:500,maxRetries:3};function eA(e){return e===429}function tA(e){return e>=500}function UP(e){return e>=400&&e<500}function kP(e){return eA(e)||tA(e)}function WP(e,n,r){return e instanceof Response?eA(e.status)?r.retryOnRateLimit??true:UP(e.status)?false:tA(e.status):e instanceof TypeError||e instanceof Error}function LP(e,n,r,o){let t=n*Math.pow(r,e-1);return Math.min(t,o)}function OP(e){return new Promise(n=>setTimeout(n,e))}async function or(e,n){let{maxRetries:r,initialDelayMs:o,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...$u,...n},a;for(let s=1;s<=r;s++)try{return await e()}catch(d){if(a=d,i&&!i(d,s))throw d;if(s>=r)break;let u=LP(s,o,t,c);await OP(u);}throw new Br(e.name||"retryWithBackoff",r,a)}async function lt(e,n){let r={...$u,...n},o=(c,i)=>WP(c,i,r);return or(async()=>{let c=await e();if(!c.ok&&kP(c.status))throw c;return c},{...r,shouldRetry:n?.shouldRetry??o})}function rA(...e){return n=>e.some(r=>n instanceof r)}function nA(e,n,r,o){if(e<n||e>r)throw new z(`${o} must be between ${n} and ${r} (inclusive), got ${e}`)}function oA(e,n){if(e<0)throw new z(`${n} must be non-negative, got ${e}`)}function sr(e,n){if(e.length===0)throw new z(`${n} cannot be empty`)}function sA(e,n){if(e.trim().length===0)throw new z(`${n} cannot be empty`)}async function $o(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await ee().getLatestBlockhash().send()).value;return await Promise.all(e.map(async o=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(o.instructions,c),c=>setTransactionMessageFeePayerSigner(o.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>o.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,o.addressesByLookupTableAddress):c,async c=>{let i=Math.ceil((o.unitsConsumed??0)*1.1);return i>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:i})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function AA(e){let n=prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:8e5}),getSetComputeUnitPriceInstruction({microLamports:1e4})],e),r=getBase64EncodedWireTransaction(compileTransaction(n));if(r.length>1644)throw new z(`Transaction exceeds maximum length of ${1644} bytes (actual: ${r.length} bytes)`);let o=await ee().simulateTransaction(r,{encoding:"base64"}).send();if(o.value.err){if(o.value.logs){let c=["Transaction simulation failed:","",...o.value.logs].join(`
|
|
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,getBase64Decoder,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,getBlockhashDecoder,compileTransaction,getTransactionEncoder,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {TreeType,batchCpiContext1,batchQueue1,batchMerkleTree1,batchCpiContext2,batchQueue2,batchMerkleTree2,batchCpiContext3,batchQueue3,batchMerkleTree3,batchCpiContext4,batchQueue4,batchMerkleTree4,batchCpiContext5,batchQueue5,batchMerkleTree5,createRpc,rpcRequest,versionedEndpoint,encodeBN254toBase58,featureFlags,jsonRpcResultAndContext,CompressedAccountResultV2,CompressedAccountResult,getStateTreeInfoByPubkey,createCompressedAccountWithMerkleContextLegacy,createMerkleContextLegacy,bn as bn$1,parseAccountData,deriveAddressSeedV2,createBN254,deriveAddressV2,getLightSystemAccountMetasV2,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey,SolanaJSONRPCError}from'@solana/web3.js';import m from'zod';import {create,nullable}from'superstruct';import {getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTokenDecoder,AccountState,getTransferSolInstruction}from'gill/programs';import {p256}from'@noble/curves/nist.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {canonicalize}from'json-canonicalize';import {equalBytes}from'@noble/curves/utils.js';var Cs=new Uint8Array([201,232,212,229,59,241,106,197]);function Nh(){return fixEncoderSize(getBytesEncoder(),8).encode(Cs)}function Rg(){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:Cs}))}function Es(){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 wh(){return combineCodec(Rg(),Es())}function Ds(e){return decodeAccount(e,Es())}async function Ps(e,n,r){let o=await bg(e,n,r);return assertAccountExists(o),o}async function bg(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Ds(o)}async function Hh(e,n,r){let o=await _g(e,n,r);return assertAccountsExist(o),o}async function _g(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ds(t))}function Vh(){return 846}var Rs=new Uint8Array([42,206,176,58,175,129,130,233]);function zh(){return fixEncoderSize(getBytesEncoder(),8).encode(Rs)}function zg(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Rs}))}function bs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function Kh(){return combineCodec(zg(),bs())}function _s(e){return decodeAccount(e,bs())}async function jh(e,n,r){let o=await Kg(e,n,r);return assertAccountExists(o),o}async function Kg(e,n,r){let o=await fetchEncodedAccount(e,n,r);return _s(o)}async function qh(e,n,r){let o=await jg(e,n,r);return assertAccountsExist(o),o}async function jg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>_s(t))}function Jh(){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 Xh(){return combineCodec(tn(),rn())}function nn(){return getStructEncoder([["memberKey",V()],["permissions",Ge()],["userArgs",Ke()]])}function on(){return getStructDecoder([["memberKey",ie()],["permissions",ze()],["userArgs",je()]])}function tR(){return combineCodec(nn(),on())}function sn(){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 oR(){return combineCodec(sn(),cn())}function It(){return getStructEncoder([["treeInfo",Et()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function Ct(){return getStructDecoder([["treeInfo",Dt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function iR(){return combineCodec(It(),Ct())}function Pt(){return getStructEncoder([["treeInfo",Et()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function Mt(){return getStructDecoder([["treeInfo",Dt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function gR(){return combineCodec(Pt(),Mt())}function an(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function dn(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function lR(){return combineCodec(an(),dn())}function mn(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function ln(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function fR(){return combineCodec(mn(),ln())}function ht(){return getStructEncoder([["data",getOptionEncoder(Tn())]])}function J(){return getStructDecoder([["data",getOptionDecoder(yn())]])}function CR(){return combineCodec(ht(),J())}function Tn(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(Rt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function yn(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(bt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function MR(){return combineCodec(Tn(),yn())}function _t(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",Sn()],["tlv",getOptionEncoder(getArrayEncoder(fn()))],["hasDelegate",getBooleanEncoder()],["isFrozen",getBooleanEncoder()]])}function vt(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",xn()],["tlv",getOptionDecoder(getArrayDecoder(Ut()))],["hasDelegate",getBooleanDecoder()],["isFrozen",getBooleanDecoder()]])}function _R(){return combineCodec(_t(),vt())}function En(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",Pn()]])}function Dn(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",Mn()]])}function WR(){return combineCodec(En(),Dn())}function Pn(){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",bn()]])}function Mn(){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",_n()]])}function NR(){return combineCodec(Pn(),Mn())}function qe(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(kn())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(nn())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Ln())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Je(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Wn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(on())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(On())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function FR(){return combineCodec(qe(),Je())}function GR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function zR(e,n){return n.__kind===e}function Bn(){return getStructEncoder([["member",getAddressEncoder()],["role",Ye()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",ve()]])}function Nn(){return getStructDecoder([["member",getAddressDecoder()],["role",Ze()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",Ue()]])}function JR(){return combineCodec(Bn(),Nn())}function kn(){return getStructEncoder([["memberKey",V()],["permissions",Ge()]])}function Wn(){return getStructDecoder([["memberKey",ie()],["permissions",ze()]])}function QR(){return combineCodec(kn(),Wn())}function kt(){return getStructEncoder([["memberKey",V()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function Wt(){return getStructDecoder([["memberKey",ie()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function rb(){return combineCodec(kt(),Wt())}function fn(){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([Gn()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([wn()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([Vn()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([Kn()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([qn()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([an()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([En()])]])]])}function Ut(){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([zn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([Hn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([Fn()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([jn()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([Jn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([dn()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([Dn()])]])]])}function cb(){return combineCodec(fn(),Ut())}function ab(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function ib(e,n){return n.__kind===e}function Yn(){return getStructEncoder([["settingsMutArgs",Y()],["transactionManager",getOptionEncoder(Lt())]])}function Zn(){return getStructDecoder([["settingsMutArgs",Z()],["transactionManager",getOptionDecoder(Ot())]])}function gb(){return combineCodec(Yn(),Zn())}function Rt(){return getStructEncoder([["pubkey",V()],["role",getU8Encoder()],["permissions",Ge()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function bt(){return getStructDecoder([["pubkey",ie()],["role",getU8Decoder()],["permissions",ze()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function Tb(){return combineCodec(Rt(),bt())}function V(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function ie(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function Sb(){return combineCodec(V(),ie())}function $n(){return getStructEncoder([["authorityCreationArgs",ve()],["compressedProofArgs",D()]])}function eo(){return getStructDecoder([["authorityCreationArgs",Ue()],["compressedProofArgs",P()]])}function Eb(){return combineCodec($n(),eo())}function Bt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function Nt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function Mb(){return combineCodec(Bt(),Nt())}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 bb(){return combineCodec(Sn(),xn())}function Et(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function Dt(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function Ub(){return combineCodec(Et(),Dt())}function wn(){return getStructEncoder([])}function Hn(){return getStructDecoder([])}function Lb(){return combineCodec(wn(),Hn())}function Vn(){return getStructEncoder([])}function Fn(){return getStructDecoder([])}function Nb(){return combineCodec(Vn(),Fn())}function Ge(){return getStructEncoder([["mask",getU8Encoder()]])}function ze(){return getStructDecoder([["mask",getU8Decoder()]])}function Vb(){return combineCodec(Ge(),ze())}function D(){return getStructEncoder([["proof",getOptionEncoder(mn())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function P(){return getStructDecoder([["proof",getOptionDecoder(ln())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function Kb(){return combineCodec(D(),P())}function Ln(){return getStructEncoder([["memberKey",V()],["userArgs",Ke()]])}function On(){return getStructDecoder([["memberKey",ie()],["userArgs",je()]])}function Yb(){return combineCodec(Ln(),On())}function bn(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function _n(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function Qb(){return combineCodec(bn(),_n())}function no(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function wt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function t_(){return combineCodec(no(),wt())}function F(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function G(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function o_(){return combineCodec(F(),G())}function oo(){return getStructEncoder([["verifyArgs",F()],["domainConfigIndex",getU8Encoder()]])}function so(){return getStructDecoder([["verifyArgs",G()],["domainConfigIndex",getU8Decoder()]])}function i_(){return combineCodec(oo(),so())}function co(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function ao(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function A_(){return combineCodec(co(),ao())}function io(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function uo(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function m_(){return combineCodec(io(),uo())}function Y(){return getStructEncoder([["accountMeta",It()],["data",ht()]])}function Z(){return getStructDecoder([["accountMeta",Ct()],["data",J()]])}function f_(){return combineCodec(Y(),Z())}function Ht(){return getStructEncoder([["accountMeta",Pt()],["data",ht()]])}function Vt(){return getStructDecoder([["accountMeta",Mt()],["data",J()]])}function C_(){return combineCodec(Ht(),Vt())}function Ft(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function Gt(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function P_(){return combineCodec(Ft(),Gt())}function Gn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(tn())]])}function zn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(rn())]])}function b_(){return combineCodec(Gn(),zn())}function zt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(kt())]])}function Kt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(Wt())]])}function k_(){return combineCodec(zt(),Kt())}function jt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(sn())],["addressTableLookups",getArrayEncoder(yo())]])}function qt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(cn())],["addressTableLookups",getArrayDecoder(fo())]])}function B_(){return combineCodec(jt(),qt())}function yo(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function fo(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function H_(){return combineCodec(yo(),fo())}function Q(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([oo()])]])]])}function $(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([so()])]])]])}function z_(){return combineCodec(Q(),$())}function K_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function j_(e,n){return n.__kind===e}function Kn(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function jn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function Y_(){return combineCodec(Kn(),jn())}function qn(){return getStructEncoder([["transferring",getU8Encoder()]])}function Jn(){return getStructDecoder([["transferring",getU8Decoder()]])}function Q_(){return combineCodec(qn(),Jn())}var So=(a=>(a[a.Ble=0]="Ble",a[a.Cable=1]="Cable",a[a.Hybrid=2]="Hybrid",a[a.Internal=3]="Internal",a[a.Nfc=4]="Nfc",a[a.SmartCard=5]="SmartCard",a[a.Usb=6]="Usb",a))(So||{});function Jt(){return getEnumEncoder(So)}function Yt(){return getEnumDecoder(So)}function tv(){return combineCodec(Jt(),Yt())}function Zt(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",V()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(Jt()))],["wallets",getArrayEncoder(io())],["role",Ye()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function ne(){return getStructDecoder([["domainConfig",getOptionDecoder(getAddressDecoder())],["member",ie()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(Yt()))],["wallets",getArrayDecoder(uo())],["role",Ze()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function sv(){return combineCodec(Zt(),ne())}function ve(){return getStructEncoder([["addressTreeInfo",Bt()],["outputStateTreeIndex",getU8Encoder()]])}function Ue(){return getStructDecoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",getU8Decoder()]])}function dv(){return combineCodec(ve(),Ue())}function tt(){return getStructEncoder([["accountMeta",It()],["data",Zt()]])}function rt(){return getStructDecoder([["accountMeta",Ct()],["data",ne()]])}function pv(){return combineCodec(tt(),rt())}function Lt(){return getStructEncoder([["accountMeta",Pt()],["data",Zt()]])}function Ot(){return getStructDecoder([["accountMeta",Mt()],["data",ne()]])}function yv(){return combineCodec(Lt(),Ot())}function Ke(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Lt()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([tt()])]])]])}function je(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Ot()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([rt()])]])]])}function Iv(){return combineCodec(Ke(),je())}function Cv(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Ev(e,n){return n.__kind===e}var Ne=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(Ne||{});function Ye(){return getEnumEncoder(Ne)}function Ze(){return getEnumDecoder(Ne)}function Mv(){return combineCodec(Ye(),Ze())}var Gc=new Uint8Array([223,179,163,190,177,224,67,173]);function bU(){return fixEncoderSize(getBytesEncoder(),8).encode(Gc)}function W1(){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:Gc}))}function hr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(bt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function _U(){return combineCodec(W1(),hr())}function zc(e){return decodeAccount(e,hr())}async function vU(e,n,r){let o=await xo(e,n,r);return assertAccountExists(o),o}async function xo(e,n,r){let o=await fetchEncodedAccount(e,n,r);return zc(o)}async function UU(e,n,r){let o=await L1(e,n,r);return assertAccountsExist(o),o}async function L1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>zc(t))}var Yc=new Uint8Array([90,36,35,219,93,225,110,96]);function OU(){return fixEncoderSize(getBytesEncoder(),8).encode(Yc)}function $1(){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",V()],["executor",V()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(V())],["expectedSigners",getArrayEncoder(kt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Yc}))}function Zc(){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",ie()],["executor",ie()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(ie())],["expectedSigners",getArrayDecoder(Wt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function BU(){return combineCodec($1(),Zc())}function Xc(e){return decodeAccount(e,Zc())}async function Qc(e,n,r){let o=await ef(e,n,r);return assertAccountExists(o),o}async function ef(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Xc(o)}async function NU(e,n,r){let o=await tf(e,n,r);return assertAccountsExist(o),o}async function tf(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Xc(t))}var ta=new Uint8Array([105,23,173,2,197,255,80,87]);function VU(){return fixEncoderSize(getBytesEncoder(),8).encode(ta)}function xf(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:ta}))}function ra(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function FU(){return combineCodec(xf(),ra())}function na(e){return decodeAccount(e,ra())}async function oa(e,n,r){let o=await If(e,n,r);return assertAccountExists(o),o}async function If(e,n,r){let o=await fetchEncodedAccount(e,n,r);return na(o)}async function GU(e,n,r){let o=await Cf(e,n,r);return assertAccountsExist(o),o}async function Cf(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>na(t))}function l({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 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 T(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let o=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:O(r.value),role:sa(r.value)?upgradeRoleToSigner(o):o,...sa(r.value)?{signer:r.value}:{}})}}function sa(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var aa=new Uint8Array([8]);function ck(){return fixEncoderSize(getBytesEncoder(),1).encode(aa)}function Ro(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:aa}))}function ia(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function ak(){return combineCodec(Ro(),ia())}async function da(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},i={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 a=l(i),s=T(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Ro().encode(c),programAddress:r})}function ik(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Ro().encode(c),programAddress:r})}function dk(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:ia().decode(e.data)}}var ma=new Uint8Array([9]);function Tk(){return fixEncoderSize(getBytesEncoder(),1).encode(ma)}function la(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(qe())],["signers",getArrayEncoder(Q())],["compressedProofArgs",getOptionEncoder(D())]]),e=>({...e,discriminator:ma}))}function Ta(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Je())],["signers",getArrayDecoder($())],["compressedProofArgs",getOptionDecoder(P())]])}function yk(){return combineCodec(la(),Ta())}function ya(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:la().encode(c),programAddress:r})}function fk(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Ta().decode(e.data)}}var Ca=new Uint8Array([19]);function Pk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ca)}function Ea(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(qe())],["signers",getArrayEncoder(Q())],["settingsMutArgs",Y()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Ca}))}function Da(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Je())],["signers",getArrayDecoder($())],["settingsMutArgs",Z()],["compressedProofArgs",P()]])}function Mk(){return combineCodec(Ea(),Da())}function Pa(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Ea().encode(c),programAddress:r})}function hk(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Da().decode(e.data)}}var Ra=new Uint8Array([18]);function Wk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ra)}function bo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["addressTreeInfo",Bt()],["outputStateTreeIndex",getU8Encoder()],["userArgs",Ke()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Ra}))}function ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",P()],["addressTreeInfo",Nt()],["outputStateTreeIndex",getU8Decoder()],["userArgs",je()],["settingsIndex",getU128Decoder()]])}function Lk(){return combineCodec(bo(),ba())}async function _a(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},i={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 a=l(i),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:bo().encode(c),programAddress:r})}function Ok(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:bo().encode(c),programAddress:r})}function Bk(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:ba().decode(e.data)}}var Na=new Uint8Array([0]);function zk(){return fixEncoderSize(getBytesEncoder(),1).encode(Na)}function vo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",ve()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Na}))}function wa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",Ue()],["compressedProofArgs",P()]])}function Kk(){return combineCodec(vo(),wa())}async function Ha(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},i={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 a=l(i),s=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:vo().encode(c),programAddress:r})}function jk(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:vo().encode(c),programAddress:r})}function qk(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:wa().decode(e.data)}}var Ga=new Uint8Array([4]);function eW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ga)}function Uo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["member",no()],["role",Ye()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(Jt())],["userAccountCreationArgs",ve()],["linkWalletArgs",getOptionEncoder(Yn())]]),e=>({...e,discriminator:Ga}))}function za(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",P()],["member",wt()],["role",Ze()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Yt())],["userAccountCreationArgs",Ue()],["linkWalletArgs",getOptionDecoder(Zn())]])}function tW(){return combineCodec(Uo(),za())}async function Ka(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={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 a=l(i),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:Uo().encode(c),programAddress:r})}function rW(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=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:Uo().encode(c),programAddress:r})}function nW(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:za().decode(e.data)}}var qa=new Uint8Array([3]);function dW(){return fixEncoderSize(getBytesEncoder(),1).encode(qa)}function Wo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:qa}))}function Ja(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function uW(){return combineCodec(Wo(),Ja())}async function Ya(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 i=l(c),a=T(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:Wo().encode({}),programAddress:r})}function AW(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 i=l(c),a=T(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:Wo().encode({}),programAddress:r})}function gW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:Ja().decode(e.data)}}var Xa=new Uint8Array([5]);function SW(){return fixEncoderSize(getBytesEncoder(),1).encode(Xa)}function Oo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["createUserArgs",getArrayEncoder(Bn())]]),e=>({...e,discriminator:Xa}))}function Qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",P()],["createUserArgs",getArrayDecoder(Nn())]])}function xW(){return combineCodec(Oo(),Qa())}async function $a(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},i={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 a=l(i),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Oo().encode(c),programAddress:r})}function IW(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Oo().encode(c),programAddress:r})}function CW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Qa().decode(e.data)}}var ri=new Uint8Array([17]);function bW(){return fixEncoderSize(getBytesEncoder(),1).encode(ri)}function ni(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",Y()],["compressedProofArgs",D()],["signers",getArrayEncoder(Q())]]),e=>({...e,discriminator:ri}))}function oi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",Z()],["compressedProofArgs",P()],["signers",getArrayDecoder($())]])}function _W(){return combineCodec(ni(),oi())}function si(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:ni().encode(c),programAddress:r})}function vW(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:oi().decode(e.data)}}var ii=new Uint8Array([2]);function BW(){return fixEncoderSize(getBytesEncoder(),1).encode(ii)}function di(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:ii}))}function ui(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function NW(){return combineCodec(di(),ui())}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},a=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.admin),...a],data:di().encode(c),programAddress:r})}function wW(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:ui().decode(e.data)}}var li=new Uint8Array([1]);function jW(){return fixEncoderSize(getBytesEncoder(),1).encode(li)}function No(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder($n())]]),e=>({...e,discriminator:li}))}function Ti(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(eo())]])}function qW(){return combineCodec(No(),Ti())}async function JW(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},i={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 a=l(i),s=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:No().encode(c),programAddress:r})}function yi(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:No().encode(c),programAddress:r})}function YW(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:o(),whitelistedAddressTrees:o(),systemProgram:r()},data:Ti().decode(e.data)}}var xi=new Uint8Array([6]);function rL(){return fixEncoderSize(getBytesEncoder(),1).encode(xi)}function Ii(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",tt()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",D()]]),e=>({...e,discriminator:xi}))}function Ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",rt()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",P()]])}function nL(){return combineCodec(Ii(),Ci())}function Ei(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.authority),...a],data:Ii().encode(c),programAddress:r})}function oL(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{authority:r()},data:Ci().decode(e.data)}}var Mi=new Uint8Array([7]);function AL(){return fixEncoderSize(getBytesEncoder(),1).encode(Mi)}function hi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",tt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["delegateTo",getOptionEncoder(co())],["oldSettingsMutArgs",getOptionEncoder(Y())],["newSettingsMutArgs",getOptionEncoder(Y())],["compressedProofArgs",D()]]),e=>({...e,discriminator:Mi}))}function Ri(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",rt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["delegateTo",getOptionDecoder(ao())],["oldSettingsMutArgs",getOptionDecoder(Z())],["newSettingsMutArgs",getOptionDecoder(Z())],["compressedProofArgs",P()]])}function gL(){return combineCodec(hi(),Ri())}function bi(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.feePayer),s(t.signer),s(t.oldSettings),s(t.newSettings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.domainConfig),...a],data:hi().encode(c),programAddress:r})}function pL(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:o(),oldSettings:o(),newSettings:o(),slotHashSysvar:o(),instructionsSysvar:o(),domainConfig:o()},data:Ri().decode(e.data)}}var vi=new Uint8Array([29]);function xL(){return fixEncoderSize(getBytesEncoder(),1).encode(vi)}function wo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(Q())]]),e=>({...e,discriminator:vi}))}function Ui(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder($())]])}function IL(){return combineCodec(wo(),Ui())}async function CL(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},i={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 a=l(i),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:wo().encode(c),programAddress:r})}function ki(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:wo().encode(c),programAddress:r})}function EL(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Ui().decode(e.data)}}var Oi=new Uint8Array([27]);function _L(){return fixEncoderSize(getBytesEncoder(),1).encode(Oi)}function Bi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(Q())],["settingsMutArgs",Y()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Oi}))}function Ni(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder($())],["settingsMutArgs",Z()],["compressedProofArgs",P()]])}function vL(){return combineCodec(Bi(),Ni())}function wi(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Bi().encode(c),programAddress:r})}function UL(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Ni().decode(e.data)}}var Gi=new Uint8Array([30]);function wL(){return fixEncoderSize(getBytesEncoder(),1).encode(Gi)}function Fo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Ft())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(_t()))],["compressedProofArgs",getOptionEncoder(D())],["signers",getArrayEncoder(Q())]]),e=>({...e,discriminator:Gi}))}function zi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Gt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(vt()))],["compressedProofArgs",getOptionDecoder(P())],["signers",getArrayDecoder($())]])}function HL(){return combineCodec(Fo(),zi())}async function VL(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},i={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 a=l(i),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Fo().encode(c),programAddress:r})}function Ki(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},i={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 a=l(i),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Fo().encode(c),programAddress:r})}function FL(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:zi().decode(e.data)}}var Xi=new Uint8Array([28]);function YL(){return fixEncoderSize(getBytesEncoder(),1).encode(Xi)}function Go(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Ft())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(_t()))],["signers",getArrayEncoder(Q())],["settingsMutArgs",Y()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Xi}))}function Qi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Gt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(vt()))],["signers",getArrayDecoder($())],["settingsMutArgs",Z()],["compressedProofArgs",P()]])}function ZL(){return combineCodec(Go(),Qi())}async function XL(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},i={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 a=l(i),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Go().encode(c),programAddress:r})}function $i(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},i={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 a=l(i),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Go().encode(c),programAddress:r})}function QL(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:Qi().decode(e.data)}}var rd=new Uint8Array([13]);function sO(){return fixEncoderSize(getBytesEncoder(),1).encode(rd)}function nd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:rd}))}function od(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function cO(){return combineCodec(nd(),od())}function sd(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:nd().encode(c),programAddress:r})}function aO(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:od().decode(e.data)}}var id=new Uint8Array([23]);function mO(){return fixEncoderSize(getBytesEncoder(),1).encode(id)}function dd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",Y()],["compressedProofArgs",D()]]),e=>({...e,discriminator:id}))}function ud(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",Z()],["compressedProofArgs",P()]])}function lO(){return combineCodec(dd(),ud())}function Ad(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.rentCollector),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:dd().encode(c),programAddress:r})}function TO(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:ud().decode(e.data)}}var md=new Uint8Array([10]);function EO(){return fixEncoderSize(getBytesEncoder(),1).encode(md)}function ld(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",zt()],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:md}))}function Td(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Kt()],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function DO(){return combineCodec(ld(),Td())}function yd(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:ld().encode(c),programAddress:r})}function PO(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:Td().decode(e.data)}}var xd=new Uint8Array([20]);function UO(){return fixEncoderSize(getBytesEncoder(),1).encode(xd)}function Id(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",zt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",Ht()],["compressedProofArgs",D()]]),e=>({...e,discriminator:xd}))}function Cd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Kt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Vt()],["compressedProofArgs",P()]])}function kO(){return combineCodec(Id(),Cd())}function Ed(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:Id().encode(c),programAddress:r})}function WO(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:Cd().decode(e.data)}}var Md=new Uint8Array([14]);function VO(){return fixEncoderSize(getBytesEncoder(),1).encode(Md)}function hd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Md}))}function Rd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function FO(){return combineCodec(hd(),Rd())}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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:hd().encode(c),programAddress:r})}function GO(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:Rd().decode(e.data)}}var Ud=new Uint8Array([24]);function ZO(){return fixEncoderSize(getBytesEncoder(),1).encode(Ud)}function kd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",Y()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Ud}))}function Wd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",Z()],["compressedProofArgs",P()]])}function XO(){return combineCodec(kd(),Wd())}function Ld(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:kd().encode(c),programAddress:r})}function QO(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:Wd().decode(e.data)}}var Nd=new Uint8Array([12]);function oB(){return fixEncoderSize(getBytesEncoder(),1).encode(Nd)}function wd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Nd}))}function Hd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function sB(){return combineCodec(wd(),Hd())}function Vd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.transactionBuffer),...a],data:wd().encode(c),programAddress:r})}function cB(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:Hd().decode(e.data)}}var zd=new Uint8Array([22]);function gB(){return fixEncoderSize(getBytesEncoder(),1).encode(zd)}function Kd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:zd}))}function jd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function pB(){return combineCodec(Kd(),jd())}function qd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.transactionBuffer),...a],data:Kd().encode(c),programAddress:r})}function mB(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:jd().decode(e.data)}}var Zd=new Uint8Array([11]);function IB(){return fixEncoderSize(getBytesEncoder(),1).encode(Zd)}function Xd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Zd}))}function Qd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function CB(){return combineCodec(Xd(),Qd())}function $d(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Xd().encode(c),programAddress:r})}function EB(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:Qd().decode(e.data)}}var ru=new Uint8Array([21]);function _B(){return fixEncoderSize(getBytesEncoder(),1).encode(ru)}function nu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",Ht()],["compressedProofArgs",D()]]),e=>({...e,discriminator:ru}))}function ou(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Vt()],["compressedProofArgs",P()]])}function vB(){return combineCodec(nu(),ou())}function su(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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:nu().encode(c),programAddress:r})}function UB(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:ou().decode(e.data)}}var iu=new Uint8Array([15]);function NB(){return fixEncoderSize(getBytesEncoder(),1).encode(iu)}function du(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:iu}))}function uu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function wB(){return combineCodec(du(),uu())}function Au(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}},i=l({}),a=T(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:du().encode({}),programAddress:r})}function HB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:uu().decode(e.data)}}var mu=new Uint8Array([25]);function jB(){return fixEncoderSize(getBytesEncoder(),1).encode(mu)}function lu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:mu}))}function Tu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function qB(){return combineCodec(lu(),Tu())}function yu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.transactionBuffer),...a],data:lu().encode(c),programAddress:r})}function JB(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:Tu().decode(e.data)}}var xu=new Uint8Array([16]);function tN(){return fixEncoderSize(getBytesEncoder(),1).encode(xu)}function Iu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",jt()],["signers",getArrayEncoder(Q())]]),e=>({...e,discriminator:xu}))}function Cu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",qt()],["signers",getArrayDecoder($())]])}function rN(){return combineCodec(Iu(),Cu())}function Eu(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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Iu().encode(c),programAddress:r})}function nN(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Cu().decode(e.data)}}var Mu=new Uint8Array([26]);function uN(){return fixEncoderSize(getBytesEncoder(),1).encode(Mu)}function hu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",jt()],["signers",getArrayEncoder(Q())],["settingsMutArgs",Y()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Mu}))}function Ru(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",qt()],["signers",getArrayDecoder($())],["settingsMutArgs",Z()],["compressedProofArgs",P()]])}function AN(){return combineCodec(hu(),Ru())}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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:hu().encode(c),programAddress:r})}function gN(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Ru().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",RE=(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))(RE||{});function JN(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 bE=(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.NativeTransferIntent=13]="NativeTransferIntent",y[y.NativeTransferIntentCompressed=14]="NativeTransferIntentCompressed",y[y.TokenTransferIntent=15]="TokenTransferIntent",y[y.TokenTransferIntentCompressed=16]="TokenTransferIntentCompressed",y[y.TransactionBufferClose=17]="TransactionBufferClose",y[y.TransactionBufferCloseCompressed=18]="TransactionBufferCloseCompressed",y[y.TransactionBufferCreate=19]="TransactionBufferCreate",y[y.TransactionBufferCreateCompressed=20]="TransactionBufferCreateCompressed",y[y.TransactionBufferExecute=21]="TransactionBufferExecute",y[y.TransactionBufferExecuteCompressed=22]="TransactionBufferExecuteCompressed",y[y.TransactionBufferExtend=23]="TransactionBufferExtend",y[y.TransactionBufferExtendCompressed=24]="TransactionBufferExtendCompressed",y[y.TransactionBufferVote=25]="TransactionBufferVote",y[y.TransactionBufferVoteCompressed=26]="TransactionBufferVoteCompressed",y[y.TransactionExecute=27]="TransactionExecute",y[y.TransactionExecuteCompressed=28]="TransactionExecuteCompressed",y[y.TransactionExecuteSync=29]="TransactionExecuteSync",y[y.TransactionExecuteSyncCompressed=30]="TransactionExecuteSyncCompressed",y))(bE||{});function YN(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([29])),0))return 13;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 14;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 15;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 16;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 17;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 18;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 19;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 20;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 21;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 22;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 23;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 24;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 25;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 26;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 27;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 28;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 29;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 30;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var vE=6e3,UE=6001,kE=6002,WE=6003,LE=6004,OE=6005,BE=6006,NE=6007,wE=6008,HE=6009,VE=6010,FE=6011,GE=6012,zE=6013,KE=6014,jE=6015,qE=6016,JE=6017,YE=6018,ZE=6019,XE=6020,QE=6021,$E=6022,eD=6023,tD=6024,rD=6025,nD=6026,oD=6027,sD=6028,cD=6029,aD=6030,iD=6031,dD=6032,uD=6033,AD=6034,gD=6035,pD=6036,mD=6037,lD=6038,TD=6039,yD=6040,fD=6041,SD=6042,xD=6043,ID=6044,CD=6045,ED=6046,DD=6047,PD=6048,MD=6049,hD=6050,RD=6051,bD=6052,_D=6053,vD=6054,UD=6055,kD=6056,WD=6057,LD=6058,OD=6059,BD=6060,ND=6061,wD=6062,HD=6063,VD=6064,FD=6065,GD=6066,zD=6067,KD=6068,jD=6069,qD=6070,JD=6071,YD=6072,ZD=6073,XD=6074,QD=6075,$D=6076,eP=6077,tP=6078,rP=6079,nP=6080,oP=6081,sP=6082,cP=6083,aP=6084,iP=6085,dP=6086,_u;process.env.NODE_ENV!=="production"&&(_u={[iD]:"This member is already delegated to another wallet.",[NE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[eP]:"Clock sysvar access failed. This may indicate a system error.",[RD]:"Missing credential id.",[_D]:"The domain configuration account is disabled. Please contact support or try again later.",[vD]:"Missing domain configuration account.",[QD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[dP]:"Duplicate address tree detected. This address tree is already in the whitelist.",[VE]:"Duplicate public keys detected among members. Each member must have a unique key.",[HE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[QE]:"No members provided. A multisig wallet must contain at least one member.",[BD]:"Slot numbers list is empty. At least one slot number is required for validation.",[YE]:"Expected a User with Administrator role for this instruction.",[wE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[qE]:"Expected a User with Transaction Manager role for this instruction.",[yD]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[fD]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[SD]:"Declared buffer size does not match the actual serialized size.",[OD]:"Failed to compute hash. This may indicate a system error.",[AD]:"Not enough members with vote permission to meet the approval threshold.",[dD]:"At least one signer with execute permission is required to proceed.",[uD]:"At least one signer with initiate permission is required to perform this action.",[nD]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[XD]:"Invalid account index in transaction message. The account index is out of bounds.",[WD]:"Address Tree supplied is not part of the whitelisted address trees.",[ZE]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[sD]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[TD]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[ND]:"Member key conversion failed. The provided key format is invalid.",[gD]:"Only delegated members are allowed for this transaction.",[rD]:"Unexpected number of accounts provided for this instruction.",[zE]:"User with Permanent Member role must have a delegated wallet.",[UE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[LE]:"The extracted public key has an invalid length or encoding.",[vE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[WE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[hD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[PD]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[eD]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[JD]:"Invalid source type for token transfer. The source account type is not supported.",[JE]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[jE]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[tD]:"Malformed transaction message: structure or formatting does not match the expected layout.",[nP]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[oD]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[rP]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[qD]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[OE]:"The extracted WebAuthn signed message payload is malformed.",[ED]:"An input string exceeds the maximum allowed character length.",[UD]:"This member is not registered under the provided domain configuration.",[VD]:"Member not found in settings. Cannot remove a member that does not exist.",[ZD]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[cD]:"A required account is missing from the instruction context.",[wD]:"Compressed proof arguments are missing. Required for compressed account operations.",[zD]:"Missing compressed token account. Required for token transfer operations.",[oP]:"Missing destination token account. Required for token transfer operations.",[jD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[HD]:"Light CPI accounts are missing. Required for compressed account operations.",[aD]:"User mutation arguments are required when performing add or remove delegate operations.",[aP]:"Missing new authority account. Required for domain configuration updates.",[cP]:"Missing settings account. Required for delegate operations on compressed wallets.",[LD]:"Compressed settings data is missing. The settings account must be initialized with data.",[sP]:"Missing source token account. Required for token transfer operations.",[KD]:"Missing SPL interface PDA. Required for token transfer operations.",[DD]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[$D]:"User account address is missing. Required for secp256r1 signature verification.",[iP]:"Missing whitelisted address trees account. Required for domain configuration updates.",[mD]:"No valid signer found in this transaction.",[XE]:"Only one administrator is allowed per wallet.",[GE]:"Only one permanent member is allowed per wallet.",[KE]:"Only one transaction manager is allowed per wallet.",[kD]:"The given origin index is not in the whitelisted origins.",[GD]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[FE]:"Permanent members cannot be removed from a wallet.",[CD]:"Writable CPI calls to protected accounts are not permitted.",[BE]:"The rpIdHash extracted from the signed message does not match the expected value.",[FD]:"Settings key mismatch. The provided settings key does not match the expected value.",[kE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[MD]:"The specified slot number was not found in the provided slot history.",[YD]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[$E]:"Too many members: a maximum of 4 members are supported.",[xD]:"This transaction has expired. It must be executed within 3 minutes of approval.",[ID]:"This transaction has not yet reached the required approval threshold.",[bD]:"Missing transports.",[lD]:"Only the transaction creator or rent payer may close this transaction buffer.",[tP]:"Unauthorized: Only the admin account is allowed to perform this action.",[pD]:"Member is not part of the expected signers for this transaction."});function tw(e){return process.env.NODE_ENV!=="production"?_u[e]:"Error message not available in production bundles."}function rw(e,n,r){return isProgramError(e,n,A,r)}async function pw({admin:e,addressTree:n}){return da({payer:e,addressTree:n,remainingAccounts:[]})}var jo=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],vu="https://mainnet.block-engine.jito.wtf/api/v1",Uu="https://bundles.jito.wtf/api/v1/bundles/tip_floor",ku="landed_tips_75th_percentile";var ke=class extends Error{constructor(r,o,t){super(r);this.code=o;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},nt=class extends ke{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},oe=class extends ke{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},z=class extends ke{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},De=class extends ke{constructor(r,o,t){super(r,"NETWORK_ERROR",{statusCode:o,url:t});this.statusCode=o;this.url=t;}};var le=class extends ke{constructor(r,o,t){super(r,"BUNDLE_ERROR",{bundleId:o,attempt:t});this.bundleId=o;this.attempt=t;}},Br=class extends ke{constructor(r,o,t){super(`Operation "${r}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=o;this.lastError=t;}},Nr=class extends ke{constructor(r,o,t){super(r,"PERMISSION_ERROR",{required:o,actual:t});this.required=o;this.actual=t;}};var $t={Ed25519:1,Secp256r1:2};var Wu=m.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),Iw=m.object({transactionActionType:Wu,transactionAddress:m.string(),transactionMessageBytes:m.array(m.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),uP=m.object({transactionActionType:Wu,transactionAddress:m.string(),transactionMessageBytes:m.base64()}).strict(),AP=m.union([m.object({type:m.literal("Ephemeral"),secretKey:m.string()}),m.object({type:m.literal("Default"),endpoint:m.string()})]).array().optional(),Lu=m.object({phase:m.literal("start"),redirectOrigin:m.url(),signer:m.string().optional(),rid:m.string(),validTill:m.number(),data:m.object({type:m.literal("message"),payload:m.string()}).strict()}).strict(),Ou=m.object({phase:m.literal("start"),redirectOrigin:m.url(),signer:m.string().optional(),rid:m.string(),validTill:m.number(),data:m.object({type:m.literal("transaction"),payload:uP,sendTx:m.boolean(),additionalSigners:AP}).strict()}).strict(),Bu=m.object({startRequest:m.union([Lu,Ou]),authResponse:m.custom(),client:m.object({clientOrigin:m.url(),jws:m.string()}).strict(),device:m.object({jwk:m.base64(),jws:m.string()}).strict(),authProvider:m.object({jwk:m.base64(),jws:m.string()}).strict().optional()}).strict(),Nu=m.object({signer:m.string(),userAddressTreeIndex:m.number().optional(),additionalInfo:m.looseObject({}).optional()}).strict(),gP=m.object({slotHash:m.string(),slotNumber:m.string(),originIndex:m.number(),crossOrigin:m.boolean()}).strict(),Cw=m.object({phase:m.literal("complete"),data:m.object({type:m.literal("message"),payload:Nu.extend(Bu.shape).extend({id:m.string().optional(),client:m.object({clientOrigin:m.url()}).strict()})}).strict()}).strict(),Ew=m.object({phase:m.literal("complete"),data:m.object({type:m.literal("transaction"),payload:Nu.extend(Bu.shape).extend(gP.shape).extend({client:m.object({clientOrigin:m.url()}).strict()})}).strict()}).strict(),Dw=m.object({phase:m.literal("complete"),data:m.object({type:m.literal("transaction"),payload:m.object({startRequest:m.union([Ou,Lu]),txSig:m.string()})}).strict()}).strict();var We={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},we=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,o)=>r|o,0))}static all(){return new e(Object.values(We).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var qo=33,He=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!==qo)throw new Error(`Invalid public key length, expected ${qo} 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===qo)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 He{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 lP(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function TP(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var Hu=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(lP())],["addressTableLookups",getArrayCodec(TP())]]);function Vu(e){return Hu.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 Fu(e){let n=Hu.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}}var Ae={};function Gu(){if(!Ae.solanaRpcEndpoint)throw new nt("RPC endpoint");return Ae.solanaRpcEndpoint}function Fe(){if(!Ae.lightProtocolRpc)throw new nt("Light Protocol RPC");return Ae.lightProtocolRpc}function ee(){if(!Ae.solanaRpc)throw new nt("Solana RPC");return Ae.solanaRpc}function zu(){if(!Ae.sendAndConfirm)throw new nt("Send and confirm transaction function");return Ae.sendAndConfirm}function Yo(){return Ae.jitoTipsConfig?Ae.jitoTipsConfig:{blockEngineUrl:vu,getJitoTipsUrl:Uu,priority:ku}}function qw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:o}){Ae.solanaRpcEndpoint=e,Ae.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});Ae.solanaRpc=t,Ae.sendAndConfirm=c,Ae.jitoTipsConfig=o??null;}async function er(e,n){if(!e.ok)throw new De(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function tr(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 i2(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Hr(n.get(-2))),y:BigInt("0x"+Hr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function d2(e){let r=p256.Point.fromBytes(getBase58Encoder().encode(e)).toBytes(false),o=new Map;return o.set(1,2),o.set(3,-7),o.set(-1,1),o.set(-2,r.slice(1,33)),o.set(-3,r.slice(33,65)),new Uint8Array(encodeCBOR(o))}async function u2(e){let{authenticatorData:n,clientDataJSON:r,signature:o}=e.authResponse.response,t=Ce(n),c=JSON.parse(getUtf8Decoder().decode(Ce(r))),i=Ju(c),a=Zu(Ce(o)),s=await mt({rpIdHash:t.subarray(0,32)});return new M(e.signer.toString(),{verifyArgs:{clientDataJson:Ce(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:Zo(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:s,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function Zo(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(n),...getBase64Encoder().encode(r)]))}function A2(e){return sha256(getUtf8Encoder().encode(JSON.stringify(e)))}function g2(e){return Xo(e.data.payload.authResponse)}function p2(e,n,r,o){let t=Zo(n,r,o);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...t]))}async function m2(e,n,r,o,t,c){let i;if(!t||!c){let u=(await ee().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!u)throw new oe("Slot sysvar","Unable to fetch slot sysvar data");let g=getBase64Encoder().encode(u[0]);c=getU64Decoder().decode(g.subarray(0,8)).toString(),i=g.subarray(8,40),t=getBase58Decoder().decode(i);}else i=getBase58Encoder().encode(t);let a=sha256(typeof e.transactionMessageBytes=="string"?getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),s=Zo(n,r,o),d=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...a,...i,...s]));return {slotNumber:c,slotHash:t,challenge:d}}function Xo(e){let n=Vr(e);return sha256(n)}function l2(e){let n="";for(let o of e)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ce(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,o=n.padEnd(n.length+r,"="),t=atob(o),c=new ArrayBuffer(t.length),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}async function T2(e,n){let{data:r}=await Ps(ee(),e),t=Yu(r.origins,r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new oe("Origin","Origin not found in domain config");return t}function y2(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function f2(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}function Hr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function MP(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 Ju(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 o=JSON.stringify(r);return new TextEncoder().encode(o.slice(1,-1))}function Yu(e,n){let r=[],o=0,t=new TextDecoder;for(let c=0;c<n;c++){if(o+2>e.length)throw new Error("MaxLengthExceeded");let i=e[o]|e[o+1]<<8;if(o+=2,o+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(o,o+i),s=t.decode(a);r.push(s),o+=i;}return r}function Zu(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 _=n&127;r+=_;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let o=e[r+1],t=r+2,c=e.slice(t,t+o);if(r=t+o,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,s=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=s[0]===0&&s.length>32?s.slice(1):s;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let p=p256.Point.CURVE().n>>1n,f=BigInt("0x"+Hr(u)),I=(f>p?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=MP(I);return new Uint8Array([...g,...x])}function Vr(e){let n=Ce(e.response.clientDataJSON),r=Ce(e.response.authenticatorData),o=sha256(n);return new Uint8Array([...r,...o])}var $u={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true,initialDelayMs:500,maxRetries:3};function eA(e){return e===429}function tA(e){return e>=500}function kP(e){return e>=400&&e<500}function WP(e){return eA(e)||tA(e)}function LP(e,n,r){return e instanceof Response?eA(e.status)?r.retryOnRateLimit??true:kP(e.status)?false:tA(e.status):e instanceof TypeError||e instanceof Error}function OP(e,n,r,o){let t=n*Math.pow(r,e-1);return Math.min(t,o)}function BP(e){return new Promise(n=>setTimeout(n,e))}async function or(e,n){let{maxRetries:r,initialDelayMs:o,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...$u,...n},a;for(let s=1;s<=r;s++)try{return await e()}catch(d){if(a=d,i&&!i(d,s))throw d;if(s>=r)break;let u=OP(s,o,t,c);await BP(u);}throw new Br(e.name||"retryWithBackoff",r,a)}async function lt(e,n){let r={...$u,...n},o=(c,i)=>LP(c,i,r);return or(async()=>{let c=await e();if(!c.ok&&WP(c.status))throw c;return c},{...r,shouldRetry:n?.shouldRetry??o})}function rA(...e){return n=>e.some(r=>n instanceof r)}function nA(e,n,r,o){if(e<n||e>r)throw new z(`${o} must be between ${n} and ${r} (inclusive), got ${e}`)}function oA(e,n){if(e<0)throw new z(`${n} must be non-negative, got ${e}`)}function sr(e,n){if(e.length===0)throw new z(`${n} cannot be empty`)}function sA(e,n){if(e.trim().length===0)throw new z(`${n} cannot be empty`)}async function $o(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await ee().getLatestBlockhash().send()).value;return await Promise.all(e.map(async o=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(o.instructions,c),c=>setTransactionMessageFeePayerSigner(o.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>o.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,o.addressesByLookupTableAddress):c,async c=>{let i=Math.ceil((o.unitsConsumed??0)*1.1);return i>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:i})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function AA(e){let n=prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:8e5}),getSetComputeUnitPriceInstruction({microLamports:1e4})],e),r=getBase64EncodedWireTransaction(compileTransaction(n));if(r.length>1644)throw new z(`Transaction exceeds maximum length of ${1644} bytes (actual: ${r.length} bytes)`);let o=await ee().simulateTransaction(r,{encoding:"base64"}).send();if(o.value.err){if(o.value.logs){let c=["Transaction simulation failed:","",...o.value.logs].join(`
|
|
2
2
|
`);throw new Error(c)}let t=["Transaction simulation failed:","",o.value.err.toString()].join(`
|
|
3
|
-
`);throw new Error(t)}return o.value.unitsConsumed}async function gA(e,n){let o=(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));o.sort((c,i)=>c-i);let t=Math.floor(o.length/2);return o.length%2===0?Math.round((o[t-1]+o[t])/2):o[t]}async function pA(e,n){sr(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 lt(()=>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:[]}))}]})}));await er(r,n);let o=await tr(r);if(!o.result||o.error)throw new le(`Unable to simulate bundle: ${JSON.stringify(o.error??o.result)}`);if(typeof o.result.value.summary!="string"&&o.result.value.summary.failed){let{TransactionFailure:t}=o.result.value.summary.failed.error,[,c]=t;throw new le(`Simulation failed: ${c}`)}return o.result.value.transactionResults.map(t=>t.unitsConsumed)}function X(e,n=0){let r=e instanceof M?e:void 0,o=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,i=r?.authData&&r.verifyArgs.clientDataJson?Vr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:o,signature:c,message:i,publicKey:a}}function Pe(e){if(e instanceof He)return {keyType:$t.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:$t.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function aA(e){return e instanceof M?e.toString():e.address.toString()}function Se(e){let n=new Set,r=[];for(let t of e)n.has(aA(t))||(r.push(t),n.add(aA(t)));let o=r.filter(t=>t instanceof M);if(o.length>1)throw new z(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return r}function mA({payer:e,tipAmount:n}){let r=jo[Math.floor(Math.random()*jo.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function lA(e){return typeof e=="string"?e:e.toString()}function TA(e){return e.toString()}async function es(e,n,r){let o=e?.get(n);if(o)return o;let t=await r();return t&&e&&e.set(n,t),t}var ts=[{tree:new PublicKey(batchMerkleTree1),queue:new PublicKey(batchQueue1),cpiContext:new PublicKey(batchCpiContext1),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree2),queue:new PublicKey(batchQueue2),cpiContext:new PublicKey(batchCpiContext2),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree3),queue:new PublicKey(batchQueue3),cpiContext:new PublicKey(batchCpiContext3),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree4),queue:new PublicKey(batchQueue4),cpiContext:new PublicKey(batchCpiContext4),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree5),queue:new PublicKey(batchQueue5),cpiContext:new PublicKey(batchCpiContext5),nextTreeInfo:null,treeType:TreeType.StateV2}],N=class{systemAccounts;nextPreIndex;preMap;nextPackedIndex;packedMap;outputTreeIndex;constructor(){this.systemAccounts=[],this.nextPreIndex=0,this.preMap=new Map,this.nextPackedIndex=0,this.packedMap=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){for(let r of n)this.insertOrGet(r.address.toString(),r,false);return this.preMap}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,r={address:address(n),role:AccountRole.WRITABLE},o=true){let t=o?this.packedMap:this.preMap;if(!t.has(n)){let c=o?this.nextPackedIndex++:this.nextPreIndex++;t.set(n,{index:c,accountMeta:r});}return t.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=selectStateTreeInfo(ts);return this.packOutputTreeIndex(n)}packTreeInfos(n,r){let o=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());o.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let s=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(s);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:o.length>0?{packedTreeInfos:o,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(n){return Array.from(n.entries()).sort((o,t)=>o[1].index-t[1].index).map(([,{accountMeta:o}])=>({...o}))}getOffsets(n){let r=n,o=r+this.systemAccounts.length;return [r,o]}toAccountMetas(){let n=this.hashSetAccountsToMetas(this.preMap),r=this.hashSetAccountsToMetas(this.packedMap),[o,t]=this.getOffsets(n.length);return {remainingAccounts:[...n,...this.systemAccounts,...r],systemOffset:o,packedOffset:t}}};async function Gr(e,n){let r=lA(e);return es(n,r,()=>SA(e))}async function ct(e,n){let r=TA(e);return es(n,r,()=>ee().getAccountInfo(e,{encoding:"base64"}).send())}async function Te(e,n){let r=(await Promise.all(e.map(o=>Gr(o.address,n)))).filter(o=>o!==null).filter(o=>o.data!==null&&o.address!==null);if(r.length!==e.length)throw new oe("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((o,t)=>({...o,type:e[t].type,tree:o.treeInfo.tree,queue:o.treeInfo.queue}))}function k(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 Me(e,n,r,o,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:o[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function ue(e,n,r,o,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:o[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let s=e.packTreeInfos(a,[]).stateTrees;if(!s)throw new z("Unable to parse state tree data");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:s.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:s.outputTreeIndex}}))}async function he(e,n,r,o,t){let c=null,i=null,a=null,s=new N;if(e){await s.addSystemAccounts();let{address:d}=await ge(n,r),u=(await Te([{address:d,type:"Settings"}],t))[0];o?a={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:a=await te([u],[]);let g=s.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!g)throw new z("Unable to parse state tree data");c={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0]},data:J().decode(u.data?.data)},i={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:J().decode(u.data?.data)};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:s,settingsMutArgs:i}}async function te(e,n){return or(()=>Fe().getValidityProofV0(e,n))}async function Re(){return (await zr()).length-1}var rs;async function zr(){if(!rs){let{data:e}=await oa(ee(),await xA());rs=e.whitelistedAddressTrees;}return rs}function fA(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 ar(e,n,r){let o=await RM(e,n,r);if(!o)throw new oe("User account");return o}async function RM(e,n,r){let{address:o}=await w(e,n),t=await Gr(o,r);return t?.data?.data?ne().decode(t.data.data):null}async function m8(e,{member:n,credentialId:r}){let o=[{memcmp:{offset:1,encoding:"base58",bytes:e}}];if(n)o.push({memcmp:{offset:33,encoding:"base58",bytes:getBase58Decoder().decode(V().encode(Pe(n)))}});else if(r)o.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(Ce(r))}});else return null;let t=await Fe().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:o});return t.items.filter(c=>!!c.data).length?t.items.map(c=>ne().decode(c.data?.data))[0]:null}async function Kr(e,n,r){let o=await bM(e,n,r);if(!o)throw new oe("Settings account");return o}async function bM(e,n,r){try{let{address:o}=await ge(e,n),t=await Gr(o,r);if(!t?.data?.data)throw new oe("Compressed settings account");let c=J().decode(t.data.data);if(c.data.__option==="None")throw new oe("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let o=await xo(ee(),e);return o.exists?{...o.data,isCompressed:false}:null}}async function l8(e,n,r){let o=await ar(e,n,r);if(o.role===1||o.role===0){let t=[],[c,i]=await Promise.all([Fe().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:getBase58Decoder().decode(V().encode(Pe(e)))}}]}),ee().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(V().encode(Pe(e)))}}]}).send()]);return c.items.forEach(a=>{if(a.data?.data){let s=J().decode(a.data.data);s.data.__option==="Some"&&t.push({...s.data.value,isCompressed:true});}}),i.forEach(a=>{let s=hr().decode(getBase64Encoder().encode(a.account.data[0]));t.push({...s,isCompressed:false});}),t}else return await Promise.all(o.wallets.map(async t=>Kr(await be(t.index),t.settingsAddressTreeIndex,r)))}async function os(e){oA(e,"index");let n=await zr();if(e>=n.length)throw new z(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function T8(e){let r=(await zr()).findIndex(o=>o.toString()===e);if(r===-1)throw new oe("Address tree",`Address ${e} not found in whitelist`);return r}async function SA(e,n){if(!n&&!e)throw new Error("Either hash or address must be provided");if(n&&e)throw new Error("Only one of hash or address must be provided");let r=await rpcRequest(Fe().compressionApiEndpoint,versionedEndpoint("getCompressedAccount"),{hash:n?encodeBN254toBase58(n):void 0,address:e?encodeBN254toBase58(e):void 0}),o;if(featureFlags.isV2()?o=create(r,jsonRpcResultAndContext(nullable(CompressedAccountResultV2))):o=create(r,jsonRpcResultAndContext(nullable(CompressedAccountResult))),"error"in o)throw new SolanaJSONRPCError(o.error,`failed to get info for compressed account ${n?n.toString():e?e.toString():""}`);if(o.result.value===null)return null;let t=featureFlags.isV2()?o.result.value.merkleContext.tree:o.result.value.tree,c=getStateTreeInfoByPubkey(ts,t),i=o.result.value;return createCompressedAccountWithMerkleContextLegacy(createMerkleContextLegacy(c,i.hash,i.leafIndex),i.owner,bn$1(i.lamports),i.data?parseAccountData(i.data):void 0,i.address||void 0)}async function ge(e,n=0){let r=await os(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(o,new PublicKey(r),new PublicKey(A)).toString(),"base58"),addressTree:new PublicKey(r)}}async function w(e,n=0){let r=await os(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("user"),e instanceof He?e.toTruncatedBuffer():getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(o,new PublicKey(r),new PublicKey(A.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function mt({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(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 _A(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function xA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function vA(e,n,r){nA(r,0,255,"buffer_index");let[o]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof He?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return o}async function Le(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function be(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function R8(e){let n=await be(e);return await Le(n)}async function b8(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function w8(e){sr(e,"bundle");let n=await $o(e,true),r=await pA(n.map(getBase64EncodedWireTransaction),Gu()),o=await $o(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await OM(o.map(getBase64EncodedWireTransaction))}async function OM(e,n=Yo(),r){sr(e,"serializedTransactions");let{blockEngineUrl:o}=n,t=`${o}/bundles`,c=await lt(()=>fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})}),r);await er(c,t);let i=await tr(c);if(i.error)throw new le(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new le("No bundle ID returned from Jito");return i.result}async function H8(e,n=30,r=3e3,o=Yo()){sA(e,"bundleId");let{blockEngineUrl:t}=o,c=`${t}/getBundleStatuses`;return or(async()=>{let i=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await er(i,c);let a=await tr(i);if(a.error)throw new le(`Error getting bundle status: ${JSON.stringify(a.error,null,2)}`,e);if(!a.result?.value?.length)throw new le("Bundle not yet confirmed",e);let s=a.result.value[0];if(s.confirmation_status==="confirmed"||s.confirmation_status==="finalized"){let d=s.transactions[s.transactions.length-1];if(!d)throw new le("No transactions in confirmed bundle",e);return d}throw new le(`Bundle status: ${s.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:rA(le,De)})}async function q8({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=await ee().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(e,c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(o.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([AA(c),gA(ee(),c.instructions.flatMap(d=>d.accounts??[]))]),s=Math.ceil((Number(i)??0)*1.1);return prependTransactionMessageInstructions([...s>2e5?[getSetComputeUnitLimitInstruction({units:s})]:[],...a>0?[getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await zu()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function iH(e,n){if(n.threshold>1)throw new z("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(s=>LA(s.pubkey)===e);if(!r)throw new oe("Member",`Signer ${e} not found in settings`);let{permissions:o}=r;if(!o)throw new oe("Permissions","No permissions found for the current member");let t=we.has(o,We.InitiateTransaction),c=we.has(o,We.VoteTransaction),i=we.has(o,We.ExecuteTransaction);if(t&&c&&i)return {};if(!c||!i)throw new Nr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(s=>s.role===0);if(!a)throw new oe("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(LA(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function dH({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:o,cachedAccounts:t}){if(!n)return null;let c=await ar(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new oe("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return $M(n,c.transactionManagerUrl.value,e,o)}function $M(e,n,r,o){return {address:e,async signTransactions(t){let c=await lt(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:e.toString(),payload:t.map(a=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(a)),transactionMessageBytes:o?getBase64Decoder().decode(o):void 0,authResponses:r}))})}));if(!c.ok)throw new De(`Transaction manager request failed: ${c.statusText}`,c.status,n);let i=await c.json();if("error"in i)throw new De(`Transaction manager error: ${i.error}`,c.status,n);return i.signatures.map(a=>({[e]:getBase58Encoder().encode(a)}))}}}function LA(e){return e.keyType===$t.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function uH(e){let n=e.map(c=>qe().encode(c)),r=4+n.reduce((c,i)=>c+i.length,0),o=new Uint8Array(r),t=0;o.set(getU32Encoder().encode(e.length),t),t+=4;for(let c of n)o.set(c,t),t+=c.length;return o}function AH(e){let n=0,[r,o]=getU32Decoder().read(e,n);n=o;let t=new Array(r);for(let c=0;c<r;c++){let i=Je().read(e,n);t[c]=i[0],n=i[1];}if(n!==e.length)throw new z(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function hH({payer:e,rpId:n,origins:r,authority:o}){let t=await mt({rpId:n}),c=new N;await c.addSystemAccounts();let i=await Re(),{address:a,addressTree:s}=await w(o.address,i),d=[{address:a,tree:s,queue:s,type:"User"}],u=await te([],d),g=(await Me(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:f}=c.toAccountMetas(),S=k(u,f);return await Ha({origins:r,authorityCreationArgs:g,authority:o,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function NH({authority:e,payer:n,createUserArgs:r,domainConfig:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[];r.settings&&(i.push({address:(await ge(r.settings,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&i.push({address:(await w(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let a=i.length?await Te(i,t):[],s=await Re(),{address:d,addressTree:u}=await w(r.member,s),g=[{address:d,type:"User",tree:u,queue:u}],p=await te(a,g),f=null,S=null,I=a.filter(B=>B.type==="Settings"),x=a.filter(B=>B.type==="User");I.length&&(f=ue(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),I,J())[0]),x.length&&(S=ue(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,ne())[0]);let _=await Me(c,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),g),{remainingAccounts:E,systemOffset:C}=c.toAccountMetas(),v=k(p,C);return await Ka({payer:n,authority:e,compressedProofArgs:v,member:wt().decode(r.member.toBuffer()),credentialId:Ce(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:f?some({settingsMutArgs:f,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:_[0],domainConfig:o,remainingAccounts:E})}async function FH({payer:e}){let n=await _A();return Ya({payer:e,globalCounter:n})}async function jH({admin:e,rpId:n,disable:r}){let o=await mt({rpId:n});return Ai({domainConfig:o,admin:e,disable:r,remainingAccounts:[]})}function th(e,n,r,o){let t=rh(e,n),c=nh(e,n)&&r!==o;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function rh(e,n){let r=e.staticAccounts.length,{numSignerAccounts:o,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=o-t,a=r-o-c;return n>=r?false:n<i?true:n>=o?n-o<a:false}function nh(e,n){return n<e.header.numSignerAccounts}async function jr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:o}){let t=Fu(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),ee()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,s]of t.staticAccounts.entries())i.push({address:s,role:th(t,a,s,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let s=c[a.lookupTableAddress];if(!s)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.READONLY});}}for(let a of o?.filter(s=>s.address!==e)??[]){let s=i.findIndex(d=>d.address===a.address);s===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[s].role===AccountRole.READONLY||i[s].role===AccountRole.READONLY_SIGNER?i[s]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[s].role===AccountRole.WRITABLE||i[s].role===AccountRole.WRITABLE_SIGNER)&&(i[s]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}var yt=33,ft=64,is=14,uh=2,Ah=address("Secp256r1SigVerify1111111111111111111111111");function gh(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function ph(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function VA(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let o=getU8Decoder().decode(e,n);n+=1;let t=[],c=ph();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=is;let i=[];for(let a=0;a<r;a++){let s=fixDecoderSize(getBytesDecoder(),yt).decode(e,n);n+=yt;let d=fixDecoderSize(getBytesDecoder(),ft).decode(e,n);n+=ft;let u=t[a].messageDataSize,g=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:s,signature:d,message:g});}return [{numSignatures:r,padding:o,offsets:t,payload:i},n]}})}function FA(){return createEncoder({getSizeFromValue:e=>{let n=is*e.offsets.length,r=e.payload.reduce((o,t)=>o+yt+ft+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 o=gh();for(let t of e.offsets)r=o.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),yt).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),ft).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function s5(){return combineCodec(FA(),VA())}function H(e,n){let r=e.length,o=uh+r*is,t=[];for(let s=0;s<r;s++){let{message:d}=e[s],u=o,g=u+yt,p=g+ft;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),o+=yt+ft+d.length;}let c=n?.programAddress??Ah,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:FA().encode(i)}}function c5(e){return {programAddress:e.programAddress,accounts:{},data:VA().decode(e.data)}}async function GA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:o,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:s=false}){let d=await Le(e),{accountMetas:u,addressLookupTableAccounts:g}=await jr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(H(c)),p.push(s?yu({transactionBuffer:n,payer:o.address,remainingAccounts:u,settingsKey:e}):Au({transactionBuffer:n,payer:o.address,settings:e})),a&&p.push(mA({payer:o,tipAmount:a})),{instructions:p,addressLookupTableAccounts:g}}async function KA({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,additionalSigners:o,signers:t,payer:c,addressesByLookupTableAddress:i,secp256r1VerifyInput:a=[],compressed:s=false,simulateProof:d=false,cachedAccounts:u}){let g=Se(t),p=await Le(e),[{accountMetas:f,addressLookupTableAccounts:S,transactionMessage:I},{settingsMutArgs:x,proof:_,packedAccounts:E}]=await Promise.all([jr({transactionMessageBytes:r,walletAddress:p,additionalSigners:o,addressesByLookupTableAddress:i}),he(s,e,n,d,u)]);E.addPreAccounts(f);let C=[];for(let j of g)if(j instanceof M){let ce=a.length,{domainConfig:ye,verifyArgs:fe,signature:ae,publicKey:_e,message:ut}=X(j,ce);if(ut&&ae&&_e&&a.push({message:ut,signature:ae,publicKey:_e}),ye){let T=E.addPreAccounts([{address:ye,role:AccountRole.READONLY}]).get(ye)?.index;fe.__option==="Some"&&T!==void 0&&C.push({__kind:"Secp256r1",fields:[{domainConfigIndex:T,verifyArgs:fe.value}]});}}else {let ce=E.addPreAccounts([{address:j.address,role:AccountRole.READONLY_SIGNER,signer:j}]).get(j.address)?.index;ce!==void 0&&C.push({__kind:"Ed25519",fields:[ce]});}let{remainingAccounts:v,systemOffset:B}=E.toAccountMetas(),K=[];a.length>0&&K.push(H(a));let se=mh(I,f);if(s){if(!c||!x)throw new Error("Payer not found or proof args is missing.");let j=k(_,B);K.push(bu({signers:C,transactionMessage:se,settingsMutArgs:x,compressedProofArgs:j,payer:c,remainingAccounts:v}));}else K.push(Eu({signers:C,settings:e,transactionMessage:se,remainingAccounts:v}));return {instructions:K,addressLookupTableAccounts:S}}function mh(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:r.data??[]})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(o=>o.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function _5({settings:e,settingsAddressTreeIndex:n,destination:r,signers:o,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let s=Se(o),d=await Le(e),[{packedAccounts:u,proof:g,settingsMutArgs:p},{value:f}]=await Promise.all([he(a,e,n,false,t),ct(d,t)]);if((f?.lamports??0)<BigInt(c))throw new Error("Insufficient balance");let S=[],I=[];for(let C of s)if(C instanceof M){let v=S.length,{domainConfig:B,verifyArgs:K,signature:se,publicKey:j,message:ce}=X(C,v);if(ce&&se&&j&&S.push({message:ce,signature:se,publicKey:j}),B){let ye=u.addPreAccounts([{address:B,role:AccountRole.READONLY}]).get(B)?.index;K.__option==="Some"&&ye!==void 0&&I.push({__kind:"Secp256r1",fields:[{domainConfigIndex:ye,verifyArgs:K.value}]});}}else {let v=u.addPreAccounts([{address:C.address,role:AccountRole.READONLY_SIGNER,signer:C}]).get(C.address)?.index;v!==void 0&&I.push({__kind:"Ed25519",fields:[v]});}let{remainingAccounts:x,systemOffset:_}=u.toAccountMetas(),E=[];if(S.length>0&&E.push(H(S)),a){if(!i||!p)throw new Error("Payer not found or proof args is missing.");let C=k(g,_);E.push(wi({amount:c,settingsMutArgs:p,compressedProofArgs:C,payer:i,signers:I,source:d,destination:r,remainingAccounts:x}));}else E.push(ki({amount:c,signers:I,source:d,destination:r,settings:e,remainingAccounts:x}));return E}var xh=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),Ih=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Jr=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function G5({settings:e,settingsAddressTreeIndex:n,destination:r,mint:o,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:s,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false}){let g=Se(t),p=await Le(e),f=U=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(U),getAddressEncoder().encode(Jr),getAddressEncoder().encode(o)],programAddress:Jr}),S=()=>{let U=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(o)];return d.restricted&&U.push(getUtf8Encoder().encode("restricted")),d.index>0&&U.push(getU8Encoder().encode(d.index)),U},[I,[x],_,[E],[C]]=await Promise.all([getAssociatedTokenAccountAddress(o,p,s),f(p),getAssociatedTokenAccountAddress(o,r,s),f(r),getProgramDerivedAddress({seeds:S(),programAddress:Jr})]),[v,B,K,se]=await Promise.all([ct(_,c),ct(I,c),ct(x,c),Dh(u,e,n,c)]),j=!!v.value,ce=!!B.value,ye=!!K.value,fe=ce?getTokenDecoder().decode(getBase64Encoder().encode(B.value.data[0])).amount:BigInt(0),ae=BigInt(ye?Ph(getBase64Encoder().encode(K.value.data[0]))?.amount??0:0),_e=j?_:void 0,ut=j?void 0:E,T=ce&&(fe+ae<BigInt(i)||ae>BigInt(0)||!j)||!ce&&j,Qr=!j,[me,ls]=await Promise.all([Eh(p,o,fe,ae,BigInt(i),u?3:4),Ch(T,C,c)]),re=me.reduce((U,q)=>U+q.parsed.amount.toNumber(),0);if(fe+ae+BigInt(re)<BigInt(i))throw new Error("Insufficient balance");let At=null,Oe=null,Be=new N;if(ls&&Be.addPreAccounts([{address:o,role:AccountRole.WRITABLE}]),se||me.length){await Be.addSystemAccounts();let U=[];if(me.length&&U.push(...me.map(q=>({hash:q.compressedAccount.hash,tree:q.compressedAccount.treeInfo.tree,queue:q.compressedAccount.treeInfo.queue,data:q.compressedAccount.data,address:q.compressedAccount.address}))),se&&U.push(se),Oe=await te(U,[]),se){let q=me.length;At=ue(Be,Oe.treeInfos.slice(q),Oe.leafIndices.slice(q),Oe.rootIndices.slice(q),Oe.proveByIndices.slice(q),U.slice(q),J())[0];}}let ug=me.length&&Oe?some(me.map((U,q)=>({isFrozen:U.parsed.state===AccountState.Frozen,hasDelegate:U.parsed.delegate!=null,amount:U.parsed.amount.toNumber(),merkleContext:{leafIndex:U.compressedAccount.leafIndex,merkleTreePubkeyIndex:Be.insertOrGet(U.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:Be.insertOrGet(U.compressedAccount.treeInfo.queue.toString()),proveByIndex:U.compressedAccount.proveByIndex},rootIndex:Oe.rootIndices[q],version:fA(U.compressedAccount.data?.discriminator),tlv:U.parsed.tlv?some(getArrayDecoder(Ut()).decode(U.parsed.tlv)):none()}))):none(),dr=[],$r=[];for(let U of g)if(U instanceof M){let q=dr.length,{domainConfig:en,verifyArgs:ys,signature:fs,publicKey:Ss,message:xs}=X(U,q);if(xs&&fs&&Ss&&dr.push({message:xs,signature:fs,publicKey:Ss}),en){let Is=Be.addPreAccounts([{address:en,role:AccountRole.READONLY}]).get(en)?.index;ys.__option==="Some"&&Is!==void 0&&$r.push({__kind:"Secp256r1",fields:[{domainConfigIndex:Is,verifyArgs:ys.value}]});}}else {let q=Be.addPreAccounts([{address:U.address,role:AccountRole.READONLY_SIGNER,signer:U}]).get(U.address)?.index;q!==void 0&&$r.push({__kind:"Ed25519",fields:[q]});}let{remainingAccounts:Ag,systemOffset:gg}=Be.toAccountMetas(),ur=[];dr.length>0&&ur.push(H(dr));let pg=k(Oe,gg),mg=T?C:void 0,lg=Qr?Ih:void 0,Tg=T?some(d):none(),Ts={amount:i,signers:$r,source:p,destination:r,sourceCtokenTokenAccount:x,sourceSplTokenAccount:I,destinationCtokenTokenAccount:ut,destinationSplTokenAccount:_e,mint:o,tokenProgram:s,remainingAccounts:Ag,payer:a,sourceCompressedTokenAccounts:ug,compressedProofArgs:pg,compressibleConfig:xh,splInterfacePda:mg,rentSponsor:lg,splInterfacePdaArgs:Tg};if(u){if(!At)throw new Error("Payer not found or proof args is missing.");ur.push($i({...Ts,settingsMutArgs:At}));}else ur.push(Ki({...Ts,settings:e}));return ur}async function Ch(e,n,r){if(!e)return false;let{value:o}=await ct(n,r);return !o}async function Eh(e,n,r,o,t,c){let i=t-r-o;if(i<=0)return [];let s=(await Fe().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(n)})).items.filter(g=>!!g.compressedAccount.data?.data.length&&g.compressedAccount.owner.toString()===Jr.toString()&&!g.parsed.amount.isZero()).sort((g,p)=>p.parsed.amount.cmp(g.parsed.amount));if(s.length===0)return [];let d=BigInt(0),u=[];for(let g of s){if(u.length>=c||d>=i)break;d+=BigInt(g.parsed.amount.toNumber()),u.push(g);}if(d<i)throw u.length>=c?new Error("Transaction size limit exceeded. Consider multiple transfers to transfer full balance."):new Error("Insufficient balance.");return u}async function Dh(e,n,r,o){if(!e)return null;let{address:t}=await ge(n,r);return (await Te([{address:t,type:"Settings"}],o))[0]}function Ph(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 e6({signers:e,payer:n,changeConfigArgs:r}){let{settings:o,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:s}=r,d=Se(e),u=[],g=[];for(let x of d)if(x instanceof M){let _=g.length,{domainConfig:E,verifyArgs:C,signature:v,publicKey:B,message:K}=X(x,_);if(K&&v&&B&&g.push({message:K,signature:v,publicKey:B}),E){let se=i.addPreAccounts([{address:E,role:AccountRole.READONLY}]).get(E)?.index;C.__option==="Some"&&se!==void 0&&u.push({__kind:"Secp256r1",fields:[{domainConfigIndex:se,verifyArgs:C.value}]});}}else {let _=i.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]).get(x.address)?.index;_!==void 0&&u.push({__kind:"Ed25519",fields:[_]});}let{remainingAccounts:p,systemOffset:f}=i.toAccountMetas(),S=k(a,f),I=[];if(g.length>0&&I.push(H(g)),c){if(!s)throw new Error("Payer not found or proof args is missing.");I.push(Pa({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:s,remainingAccounts:p,signers:u}));}else I.push(ya({settings:o,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:p,signers:u}));return I}async function a6({createUserArgs:e,payer:n}){let r=new N;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:AccountRole.READONLY_SIGNER,signer:u.member})));let o=await Re(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:p}=await w(u.member.address,o);return {address:g,tree:p,queue:p,type:"User"}})),c=await te([],t),i=await Me(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:s}=r.toAccountMetas(),d=k(c,s);return await $a({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:i[g],transactionManagerUrl:u.role===0?u.transactionManagerUrl:null})),remainingAccounts:a})}async function m6({index:e,payer:n,initialMember:r,userAddressTreeIndex:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[],a=[];a.push(...await Te([{address:(await w(r.address,o)).address,type:"User"}],t));let s=await Re(),{address:d,addressTree:u}=await ge(await be(e),s);i.push({address:d,queue:u,tree:u,type:"Settings"});let g=a.length,p=await te(a,i),f=ue(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),a.filter(C=>C.type==="User"),ne())[0],I=(await Me(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),i)).find(C=>C.type==="Settings")??null,{remainingAccounts:x,systemOffset:_}=c.toAccountMetas(),E=k(p,_);if(!I)throw new Error("Settings creation args is missing.");return await _a({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:E,...I,remainingAccounts:x})}async function C6({settings:e,settingsAddressTreeIndex:n,payer:r,signers:o,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await he(true,e,n,false,t);if(!a)throw new Error("Proof args is missing");let s=Se(o),d=[],u=[];for(let I of s)if(I instanceof M){let x=d.length,{domainConfig:_,verifyArgs:E,signature:C,publicKey:v,message:B}=X(I,x);if(B&&C&&v&&d.push({message:B,signature:C,publicKey:v}),_){let K=c.addPreAccounts([{address:_,role:AccountRole.READONLY}]).get(_)?.index;E.__option==="Some"&&K!==void 0&&u.push({__kind:"Secp256r1",fields:[{domainConfigIndex:K,verifyArgs:E.value}]});}}else {let x=c.addPreAccounts([{address:I.address,role:AccountRole.READONLY_SIGNER,signer:I}]).get(I.address)?.index;x!==void 0&&u.push({__kind:"Ed25519",fields:[x]});}let{remainingAccounts:g,systemOffset:p}=c.toAccountMetas(),f=k(i,p),S=[];return d.length>0&&S.push(H(d)),S.push(si({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:f,signers:u,remainingAccounts:g})),S}async function b6({authority:e,domainConfig:n,newAuthority:r,newOrigins:o}){let t=null,c=[];if(r){let i=new N;await i.addSystemAccounts();let a=await Re(),{address:s,addressTree:d}=await w(r.address,a),u=[{address:s,tree:d,queue:d,type:"User"}],g=await te([],u),p=(await Me(i,g.treeInfos,g.roots,g.rootIndices,u))[0],f=i.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:k(g,f.systemOffset),authorityCreationArgs:p};}return yi({domainConfig:n,authority:e,newOrigins:o?some(o):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function L6({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let o=new N;await o.addSystemAccounts();let t=await Te([{address:(await w(e.address,n)).address,type:"User"}]),c=await te(t,[]),i=ue(o,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,ne())[0],{remainingAccounts:a,systemOffset:s}=o.toAccountMetas(),d=k(c,s);return Ei({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function K6({payer:e,user:n,userAddressTreeIndex:r,newDelegate:o,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:s,publicKey:d}=X(n),u=[];a&&s&&d&&u.push({message:a,signature:s,publicKey:d});let g=await ar(n instanceof M?n:n.address,r,t),p=[];p.push({address:(await w(n instanceof M?n:n.address,r)).address,type:"User"});let f,S=null,I,x=null,_=g.wallets.find(ae=>ae.isDelegate);if(_){let ae=await be(_.index);(await Kr(ae,_.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ge(ae,_.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):f=await be(_.index);}if(o){let ae=await be(o.index);(await Kr(ae,o.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ge(ae,o.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):I=await be(o.index);}let E=new N;await E.addSystemAccounts();let C=await Te(p,t),v=await te(C,[]),B=ue(E,v.treeInfos.slice(0,1),v.leafIndices.slice(0,1),v.rootIndices.slice(0,1),v.proveByIndices.slice(0,1),C.slice(0,1),ne())[0],K=S?some(ue(E,v.treeInfos.slice(S.start,S.end),v.leafIndices.slice(S.start,S.end),v.rootIndices.slice(S.start,S.end),v.proveByIndices.slice(S.start,S.end),C.slice(S.start,S.end),J())[0]):none(),se=x?some(ue(E,v.treeInfos.slice(x.start,x.end),v.leafIndices.slice(x.start,x.end),v.rootIndices.slice(x.start,x.end),v.proveByIndices.slice(x.start,x.end),C.slice(x.start,x.end),J())[0]):none(),{remainingAccounts:j,systemOffset:ce}=E.toAccountMetas(),ye=k(v,ce),fe=[];return u.length>0&&fe.push(H(u)),fe.push(bi({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:o?some(o):none(),feePayer:e,signer:n instanceof M?void 0:n,oldSettings:f,oldSettingsMutArgs:K,newSettings:I,newSettingsMutArgs:se,compressedProofArgs:ye,userMutArgs:B,remainingAccounts:j})),fe}async function aV({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:o,compressed:t=false,cachedAccounts:c}){let i=await Qc(ee(),r),a=i.data.multiWalletSettings,{packedAccounts:s,proof:d,settingsMutArgs:u}=await he(t,a,e,false,c),{remainingAccounts:g,systemOffset:p}=s.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:I,signature:x,publicKey:_}=X(n),E=[];if(I&&x&&_&&E.push(H([{message:I,signature:x,publicKey:_}])),t){if(!o||!u)throw new Error("Payer not found or proof args is missing.");let C=k(d,p);E.push(Ad({transactionBuffer:r,domainConfig:f,closer:n instanceof M?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:u,payer:o,compressedProofArgs:C,remainingAccounts:g}));}else E.push(sd({transactionBuffer:r,domainConfig:f,closer:n instanceof M?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return E}function eg({payer:e,creator:n,bufferIndex:r,settings:o,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,compressedArgs:d,expectedSigners:u}){let{domainConfig:g,verifyArgs:p,message:f,signature:S,publicKey:I}=X(n),x=[];if(f&&S&&I&&x.push(H([{message:f,signature:S,publicKey:I}])),d){let{settingsReadonlyArgs:_,compressedProofArgs:E,remainingAccounts:C}=d;x.push(Ed({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof M?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},settingsReadonlyArgs:_,compressedProofArgs:E,remainingAccounts:C}));}else x.push(yd({settings:o,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof M?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},remainingAccounts:[]}));return x}function tg({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:s}=X(e),d=[];return a&&i&&s&&d.push(H([{message:a,signature:i,publicKey:s}])),o?d.push(Ld({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,settingsMutArgs:o.settingsMutArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(bd({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,remainingAccounts:[]})),d}function rg({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:o=false}){return o?qd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Vd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function ng({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:s}=X(n),d=[];return s&&i&&a&&d.push(H([{message:s,signature:i,publicKey:a}])),o?d.push(su({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,settingsReadonlyArgs:o.settingsReadonlyArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push($d({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,remainingAccounts:[]})),d}async function ZV({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:o,compressed:t=false}){let c=await bh(r),i=new N,a=null,s=null,d=[];if(c.length||t){let g=await _h({packedAccounts:i,userAccounts:c,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:o});a=g.proof,s=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await vh({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:s,packedAccounts:i,compressed:t}}async function bh(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}}return n}async function _h({packedAccounts:e,userAccounts:n,compressed:r,settings:o,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let f=(await ge(o,t)).address;i.push({address:f,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await Te(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let s=await te(a,[]),d=[],u=[];for(let f of a)f.type==="Settings"?d.push(f):f.type==="User"&&u.push(f);let g,p=[];if(r&&s&&(g=ue(e,s.treeInfos.slice(0,1),s.leafIndices.slice(0,1),s.rootIndices.slice(0,1),s.proveByIndices.slice(0,1),d,J())[0]),u.length&&s){let f=r?1:0;p=ue(e,s.treeInfos.slice(f),s.leafIndices.slice(f),s.rootIndices.slice(f),s.proveByIndices.slice(f),u,ne());}return {proof:s,settingsMutArgs:g,userMutArgs:p}}async function vh({configActionsArgs:e,userMutArgs:n}){let r=[];for(let o of e)switch(o.type){case "AddMembers":{let t=[];for(let c of o.members){let i=await w(c.member,c.userAddressTreeIndex).then(a=>n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(a.address)))));if(!i)throw new Error("Unable to find user account");t.push(Wh({permissionArgs:c.permissions,userMutArgs:i,pubkey:c.member}));}r.push({__kind:o.type,fields:[t]});break}case "RemoveMembers":{let t=await Promise.all(o.members.map(c=>w(c.member,c.userAddressTreeIndex).then(i=>{let a=n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(i.address))));if(!a)throw new Error("Unable to find user account");return kh({pubkey:c.member,userMutArgs:a})})));r.push({__kind:o.type,fields:[t]});break}case "EditPermissions":{let t=o.members.map(c=>Uh({permissionArgs:c.permissions,pubkey:c.member}));r.push({__kind:o.type,fields:[t]});break}default:r.push({__kind:o.type,fields:[o.threshold]});}return r}function Uh({pubkey:e,permissionArgs:n}){return {memberKey:Pe(e),permissions:ag(n)}}function kh({pubkey:e,userMutArgs:n}){let r=n.data.role;if(r===2)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:Pe(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function Wh({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===2)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===0&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:Pe(e),permissions:ag(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function ag(e){let n=[];return e.initiate&&n.push(We.InitiateTransaction),e.vote&&n.push(We.VoteTransaction),e.execute&&n.push(We.ExecuteTransaction),we.fromPermissions(n)}async function oF({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:p=Math.ceil(o.length/2),cachedAccounts:f}){let S=Math.floor(Math.random()*255),I=await vA(n,t instanceof M?t:t.address,S),x=[],_=[];for(let re=0;re<o.length;re+=p){let At=o.subarray(re,re+p);x.push(At),_.push(sha256(At));}let E=sha256(o),{settingsReadonlyArgs:C,settingsMutArgs:v,proof:B,packedAccounts:K}=await he(d,n,r,false,f),{remainingAccounts:se,systemOffset:j}=K.toAccountMetas(),ce=B&&C&&v?{settingsReadonlyArgs:C,settingsMutArgs:v,compressedProofArgs:k(B,j),remainingAccounts:se,payer:e}:null,ye=Se([t,...c?[c]:[],...u]).map(re=>({memberKey:Pe(re),messageHash:re instanceof M?Xo(re.authResponse):null})),fe=eg({finalBufferHash:E,finalBufferSize:o.length,bufferIndex:S,payer:e,transactionBufferAddress:I,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:_,compressedArgs:ce,expectedSigners:ye}),ae=x.map(re=>rg({transactionMessageBytes:re,transactionBufferAddress:I,settings:n,compressed:d})),_e=u.map(re=>ng({voter:re,transactionBufferAddress:I,settings:n,compressedArgs:ce})),ut=tg({compressedArgs:ce,settings:n,executor:c,transactionBufferAddress:I}),{instructions:T,addressLookupTableAccounts:Qr}=await GA({compressed:d,settings:n,transactionMessageBytes:o,transactionBufferAddress:I,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s}),me=re=>({payer:e,instructions:re,addressesByLookupTableAddress:Qr});return [me(fe),...ae.map(re=>me([re])),..._e.length?[me(_e.flat())]:[],me(ut),me(T)]}var Zr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let o=new Map,t=i=>{let a=o.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},o.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let s=t(a.address);s.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,o)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),o=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),c=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+o.length,numReadonlySignerAccounts:o.length,numReadonlyNonSignerAccounts:c.length};if(r.length===0)throw new Error("Expected at least one writable signer key");let[a]=r[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let s=[...r.map(([d])=>d),...o.map(([d])=>d),...t.map(([d])=>d),...c.map(([d])=>d)];return [i,s]}extractTableLookup(n){let[r,o]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(n,r){let o=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,s=n.findIndex(d=>d===a);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),t.push(a),this.keyMetaMap.delete(c);}}return [o,t]}};var Xr=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 o=new Map;this.keySegments().flat().forEach((c,i)=>{o.set(c,i);});let t=c=>{let i=o.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function dg({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:o}){let t=Zr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(o??{});for(let p of a){let f=t.extractTableLookup(p);if(f!==void 0){let{addressTableLookup:S,drainedKeys:I}=f;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),i.writable.push(...I.writable),i.readonly.push(...I.readonly);}}let[s,d]=t.getMessageComponents(),g=new Xr(d,i).compileInstructions(r);return {version:0,header:s,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function yF({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=dg({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(Vu(o))}async function CF({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,signers:t,additionalSigners:c,secp256r1VerifyInput:i,addressesByLookupTableAddress:a,cachedAccounts:s,compressed:d=false,simulateProof:u=false}){let{instructions:g,addressLookupTableAccounts:p}=await KA({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,additionalSigners:c,transactionMessageBytes:o,secp256r1VerifyInput:i,compressed:d,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:s});return {payer:e,instructions:g,addressesByLookupTableAddress:p}}export{aa as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,Bu as AuthenticationContextSchema,Nu as BaseResponseSchema,Ca as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,ma as CHANGE_CONFIG_DISCRIMINATOR,Ra as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,Na as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Ga as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,qa as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Xa as CREATE_USER_ACCOUNTS_DISCRIMINATOR,Iw as CompleteMessageRequestSchema,Ew as CompleteSendTransactionRequestSchema,Cw as CompleteTransactionRequestSchema,ri as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,ii as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Cs as DOMAIN_CONFIG_DISCRIMINATOR,li as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,xi as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,Mi as EDIT_USER_DELEGATE_DISCRIMINATOR,Rs as GLOBAL_COUNTER_DISCRIMINATOR,$t as KeyType,iD as MULTI_WALLET_ERROR__ALREADY_DELEGATED,NE as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,eP as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,RD as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,_D as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,vD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,QD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,dP as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,VE as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,HE as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,QE as MULTI_WALLET_ERROR__EMPTY_MEMBERS,BD as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,YE as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,wE as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,qE as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,yD as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,fD as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,SD as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,OD as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,AD as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,dD as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,uD as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,nD as MULTI_WALLET_ERROR__INVALID_ACCOUNT,XD as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,WD as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,ZE as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,sD as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,TD as MULTI_WALLET_ERROR__INVALID_BUFFER,ND as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,gD as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,rD as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,zE as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,UE as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,LE as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,vE as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,WE as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,hD as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,PD as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,eD as MULTI_WALLET_ERROR__INVALID_THRESHOLD,JD as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,JE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,jE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,tD as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,nP as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,oD as MULTI_WALLET_ERROR__INVALID_USER_ROLE,rP as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,qD as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,OE as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,ED as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,UD as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,VD as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,ZD as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,cD as MULTI_WALLET_ERROR__MISSING_ACCOUNT,wD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,zD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,oP as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,jD as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,HD as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,aD as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,aP as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,cP as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,LD as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,sP as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,KD as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,DD as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,$D as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,iP as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,mD as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,XE as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,GE as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,KE as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,kD as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,GD as MULTI_WALLET_ERROR__PAYER_MISMATCH,FE as MULTI_WALLET_ERROR__PERMANENT_MEMBER,CD as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,BE as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,FD as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,kE as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,MD as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,YD as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,$E as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,xD as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,ID as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,bD as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,lD as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,tP as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,pD as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,RE as MultiWalletAccount,bE as MultiWalletInstruction,Oi as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,vi as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,We as Permission,we as Permissions,Gc as SETTINGS_DISCRIMINATOR,He as Secp256r1Key,M as SignedSecp256r1Key,Lu as StartMessageRequestSchema,Ou as StartTransactionRequestSchema,Xi as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Gi as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,id as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,rd as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,xd as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,md as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Yc as TRANSACTION_BUFFER_DISCRIMINATOR,Ud as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Md as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,zd as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Nd as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,ru as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Zd as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,mu as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,iu as TRANSACTION_EXECUTE_DISCRIMINATOR,Mu as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,xu as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Wu as TransactionActionTypeSchema,AP as TransactionDetailsSchema,xw as TransactionPayloadSchema,uP as TransactionPayloadWithBase64MessageBytesSchema,So as Transports,Ne as UserRole,ta as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,gw as addWhitelistedAddressTrees,Ce as base64URLStringToBuffer,m2 as bufferToBase64URLString,e6 as changeConfig,aV as closeTransactionBuffer,FR as configAction,y2 as convertBase64StringToJWK,T2 as convertJWKToBase64String,LA as convertMemberKeyToString,i2 as convertPubkeyCompressedToCose,a2 as convertPubkeyCoseToCompressed,A2 as createClientAuthorizationCompleteRequestChallenge,u2 as createClientAuthorizationStartRequestChallenge,hH as createDomainConfig,NH as createDomainUserAccounts,FH as createGlobalCounter,g2 as createMessageChallenge,eg as createTransactionBuffer,p2 as createTransactionChallenge,$M as createTransactionManagerSigner,a6 as createUserAccounts,m6 as createWallet,Ds as decodeDomainConfig,_s as decodeGlobalCounter,zc as decodeSettings,Xc as decodeTransactionBuffer,na as decodeWhitelistedAddressTree,C6 as decompressSettingsAccount,AH as deserializeConfigActions,jH as disableDomainConfig,b6 as editDomainConfig,L6 as editTransactionManagerUrl,K6 as editUserDelegate,GA as executeTransaction,tg as executeTransactionBuffer,KA as executeTransactionSync,rg as extendTransactionBuffer,cb as extensionStruct,wh as fetchAllDomainConfig,jh as fetchAllGlobalCounter,_g as fetchAllMaybeDomainConfig,jg as fetchAllMaybeGlobalCounter,L1 as fetchAllMaybeSettings,tf as fetchAllMaybeTransactionBuffer,Cf as fetchAllMaybeWhitelistedAddressTree,vU as fetchAllSettings,l8 as fetchAllSettingsAccountByMember,BU as fetchAllTransactionBuffer,FU as fetchAllWhitelistedAddressTree,SA as fetchCompressedAccount,Ps as fetchDomainConfig,Kh as fetchGlobalCounter,bg as fetchMaybeDomainConfig,Kg as fetchMaybeGlobalCounter,xo as fetchMaybeSettings,bM as fetchMaybeSettingsAccountData,ef as fetchMaybeTransactionBuffer,RM as fetchMaybeUserAccountData,If as fetchMaybeWhitelistedAddressTree,_U as fetchSettings,Kr as fetchSettingsAccountData,Qc as fetchTransactionBuffer,m8 as fetchUserAccountByFilters,ar as fetchUserAccountData,oa as fetchWhitelistedAddressTree,eR as getAddMemberArgsCodec,on as getAddMemberArgsDecoder,nn as getAddMemberArgsEncoder,sk as getAddWhitelistedAddressTreesDiscriminatorBytes,ak as getAddWhitelistedAddressTreesInstruction,da as getAddWhitelistedAddressTreesInstructionAsync,ck as getAddWhitelistedAddressTreesInstructionDataCodec,ia as getAddWhitelistedAddressTreesInstructionDataDecoder,Ro as getAddWhitelistedAddressTreesInstructionDataEncoder,Zh as getAdditionalMetadataCodec,rn as getAdditionalMetadataDecoder,tn as getAdditionalMetadataEncoder,Dk as getChangeConfigCompressedDiscriminatorBytes,Pa as getChangeConfigCompressedInstruction,Pk as getChangeConfigCompressedInstructionDataCodec,Da as getChangeConfigCompressedInstructionDataDecoder,Ea as getChangeConfigCompressedInstructionDataEncoder,lk as getChangeConfigDiscriminatorBytes,ya as getChangeConfigInstruction,Tk as getChangeConfigInstructionDataCodec,Ta as getChangeConfigInstructionDataDecoder,la as getChangeConfigInstructionDataEncoder,Zo as getClientAndDeviceHash,nR as getCompiledInstructionCodec,cn as getCompiledInstructionDecoder,sn as getCompiledInstructionEncoder,aR as getCompressedAccountMetaCodec,Ct as getCompressedAccountMetaDecoder,It as getCompressedAccountMetaEncoder,AR as getCompressedAccountMetaReadOnlyCodec,Mt as getCompressedAccountMetaReadOnlyDecoder,Pt as getCompressedAccountMetaReadOnlyEncoder,mR as getCompressedOnlyExtensionCodec,dn as getCompressedOnlyExtensionDecoder,an as getCompressedOnlyExtensionEncoder,yR as getCompressedProofCodec,ln as getCompressedProofDecoder,mn as getCompressedProofEncoder,ge as getCompressedSettingsAddress,IR as getCompressedSettingsCodec,PR as getCompressedSettingsDataCodec,yn as getCompressedSettingsDataDecoder,Tn as getCompressedSettingsDataEncoder,J as getCompressedSettingsDecoder,ht as getCompressedSettingsEncoder,bR as getCompressedTokenArgsCodec,vt as getCompressedTokenArgsDecoder,_t as getCompressedTokenArgsEncoder,kR as getCompressibleExtensionCodec,Dn as getCompressibleExtensionDecoder,En as getCompressibleExtensionEncoder,BR as getCompressionInfoCodec,Mn as getCompressionInfoDecoder,Pn as getCompressionInfoEncoder,VR as getConfigActionCodec,Je as getConfigActionDecoder,qe as getConfigActionEncoder,kk as getCreateCompressedWalletDiscriminatorBytes,Lk as getCreateCompressedWalletInstruction,_a as getCreateCompressedWalletInstructionAsync,Wk as getCreateCompressedWalletInstructionDataCodec,ba as getCreateCompressedWalletInstructionDataDecoder,bo as getCreateCompressedWalletInstructionDataEncoder,Gk as getCreateDomainConfigDiscriminatorBytes,Kk as getCreateDomainConfigInstruction,Ha as getCreateDomainConfigInstructionAsync,zk as getCreateDomainConfigInstructionDataCodec,wa as getCreateDomainConfigInstructionDataDecoder,vo as getCreateDomainConfigInstructionDataEncoder,$k as getCreateDomainUserAccountDiscriminatorBytes,tW as getCreateDomainUserAccountInstruction,Ka as getCreateDomainUserAccountInstructionAsync,eW as getCreateDomainUserAccountInstructionDataCodec,za as getCreateDomainUserAccountInstructionDataDecoder,Uo as getCreateDomainUserAccountInstructionDataEncoder,iW as getCreateGlobalCounterDiscriminatorBytes,uW as getCreateGlobalCounterInstruction,Ya as getCreateGlobalCounterInstructionAsync,dW as getCreateGlobalCounterInstructionDataCodec,Ja as getCreateGlobalCounterInstructionDataDecoder,Wo as getCreateGlobalCounterInstructionDataEncoder,qR as getCreateUserAccountArgsCodec,Nn as getCreateUserAccountArgsDecoder,Bn as getCreateUserAccountArgsEncoder,fW as getCreateUserAccountsDiscriminatorBytes,xW as getCreateUserAccountsInstruction,$a as getCreateUserAccountsInstructionAsync,SW as getCreateUserAccountsInstructionDataCodec,Qa as getCreateUserAccountsInstructionDataDecoder,Oo as getCreateUserAccountsInstructionDataEncoder,RW as getDecompressSettingsAccountDiscriminatorBytes,si as getDecompressSettingsAccountInstruction,bW as getDecompressSettingsAccountInstructionDataCodec,oi as getDecompressSettingsAccountInstructionDataDecoder,ni as getDecompressSettingsAccountInstructionDataEncoder,OW as getDisableDomainConfigDiscriminatorBytes,Ai as getDisableDomainConfigInstruction,BW as getDisableDomainConfigInstructionDataCodec,ui as getDisableDomainConfigInstructionDataDecoder,di as getDisableDomainConfigInstructionDataEncoder,mt as getDomainConfigAddress,Nh as getDomainConfigCodec,Es as getDomainConfigDecoder,Bh as getDomainConfigDiscriminatorBytes,Rg as getDomainConfigEncoder,Hh as getDomainConfigSize,KW as getEditDomainConfigDiscriminatorBytes,yi as getEditDomainConfigInstruction,qW as getEditDomainConfigInstructionAsync,jW as getEditDomainConfigInstructionDataCodec,Ti as getEditDomainConfigInstructionDataDecoder,No as getEditDomainConfigInstructionDataEncoder,XR as getEditMemberArgsCodec,Wn as getEditMemberArgsDecoder,kn as getEditMemberArgsEncoder,tL as getEditTransactionManagerUrlDiscriminatorBytes,Ei as getEditTransactionManagerUrlInstruction,rL as getEditTransactionManagerUrlInstructionDataCodec,Ci as getEditTransactionManagerUrlInstructionDataDecoder,Ii as getEditTransactionManagerUrlInstructionDataEncoder,uL as getEditUserDelegateDiscriminatorBytes,bi as getEditUserDelegateInstruction,AL as getEditUserDelegateInstructionDataCodec,Ri as getEditUserDelegateInstructionDataDecoder,hi as getEditUserDelegateInstructionDataEncoder,tb as getExpectedSignerCodec,Wt as getExpectedSignerDecoder,kt as getExpectedSignerEncoder,sb as getExtensionStructCodec,Ut as getExtensionStructDecoder,fn as getExtensionStructEncoder,_A as getGlobalCounterAddress,zh as getGlobalCounterCodec,bs as getGlobalCounterDecoder,Gh as getGlobalCounterDiscriminatorBytes,zg as getGlobalCounterEncoder,qh as getGlobalCounterSize,Yo as getJitoTipsConfig,b8 as getLightCpiSigner,Fe as getLightProtocolRpc,Ab as getLinkWalletArgsCodec,Zn as getLinkWalletArgsDecoder,Yn as getLinkWalletArgsEncoder,lb as getMemberCodec,bt as getMemberDecoder,Rt as getMemberEncoder,fb as getMemberKeyCodec,ie as getMemberKeyDecoder,V as getMemberKeyEncoder,ew as getMultiWalletErrorMessage,bL as getNativeTransferIntentCompressedDiscriminatorBytes,wi as getNativeTransferIntentCompressedInstruction,_L as getNativeTransferIntentCompressedInstructionDataCodec,Ni as getNativeTransferIntentCompressedInstructionDataDecoder,Bi as getNativeTransferIntentCompressedInstructionDataEncoder,SL as getNativeTransferIntentDiscriminatorBytes,ki as getNativeTransferIntentInstruction,IL as getNativeTransferIntentInstructionAsync,xL as getNativeTransferIntentInstructionDataCodec,Ui as getNativeTransferIntentInstructionDataDecoder,wo as getNativeTransferIntentInstructionDataEncoder,Cb as getNewAuthorityArgsCodec,eo as getNewAuthorityArgsDecoder,$n as getNewAuthorityArgsEncoder,l2 as getOriginIndex,Pb as getPackedAddressTreeInfoCodec,Nt as getPackedAddressTreeInfoDecoder,Bt as getPackedAddressTreeInfoEncoder,Rb as getPackedMerkleContextCodec,xn as getPackedMerkleContextDecoder,Sn as getPackedMerkleContextEncoder,vb as getPackedStateTreeInfoCodec,Dt as getPackedStateTreeInfoDecoder,Et as getPackedStateTreeInfoEncoder,Wb as getPausableAccountExtensionCodec,Hn as getPausableAccountExtensionDecoder,wn as getPausableAccountExtensionEncoder,Bb as getPermanentDelegateAccountExtensionCodec,Fn as getPermanentDelegateAccountExtensionDecoder,Vn as getPermanentDelegateAccountExtensionEncoder,Hb as getPermissionsCodec,ze as getPermissionsDecoder,Ge as getPermissionsEncoder,zb as getProofArgsCodec,P as getProofArgsDecoder,D as getProofArgsEncoder,Jb as getRemoveMemberArgsCodec,On as getRemoveMemberArgsDecoder,Ln as getRemoveMemberArgsEncoder,Xb as getRentConfigCodec,_n as getRentConfigDecoder,bn as getRentConfigEncoder,Xo as getSecp256r1MessageHash,e_ as getSecp256r1PubkeyCodec,wt as getSecp256r1PubkeyDecoder,no as getSecp256r1PubkeyEncoder,ph as getSecp256r1SignatureOffsetsDataDecoder,gh as getSecp256r1SignatureOffsetsDataEncoder,n_ as getSecp256r1VerifyArgsCodec,G as getSecp256r1VerifyArgsDecoder,F as getSecp256r1VerifyArgsEncoder,a_ as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,so as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,oo as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,H as getSecp256r1VerifyInstruction,s5 as getSecp256r1VerifyInstructionDataCodec,VA as getSecp256r1VerifyInstructionDataDecoder,FA as getSecp256r1VerifyInstructionDataEncoder,zu as getSendAndConfirmTransaction,bU as getSettingsCodec,hr as getSettingsDecoder,RU as getSettingsDiscriminatorBytes,W1 as getSettingsEncoder,be as getSettingsFromIndex,p_ as getSettingsIndexWithAddressAndDelegateInfoCodec,uo as getSettingsIndexWithAddressAndDelegateInfoDecoder,io as getSettingsIndexWithAddressAndDelegateInfoEncoder,u_ as getSettingsIndexWithAddressCodec,ao as getSettingsIndexWithAddressDecoder,co as getSettingsIndexWithAddressEncoder,y_ as getSettingsMutArgsCodec,Z as getSettingsMutArgsDecoder,Y as getSettingsMutArgsEncoder,I_ as getSettingsReadonlyArgsCodec,Vt as getSettingsReadonlyArgsDecoder,Ht as getSettingsReadonlyArgsEncoder,d2 as getSignedSecp256r1Key,dH as getSignedTransactionManager,ee as getSolanaRpc,Gu as getSolanaRpcEndpoint,D_ as getSplInterfacePdaArgsCodec,Gt as getSplInterfacePdaArgsDecoder,Ft as getSplInterfacePdaArgsEncoder,R_ as getTokenMetadataCodec,zn as getTokenMetadataDecoder,Gn as getTokenMetadataEncoder,JL as getTokenTransferIntentCompressedDiscriminatorBytes,$i as getTokenTransferIntentCompressedInstruction,ZL as getTokenTransferIntentCompressedInstructionAsync,YL as getTokenTransferIntentCompressedInstructionDataCodec,Qi as getTokenTransferIntentCompressedInstructionDataDecoder,Go as getTokenTransferIntentCompressedInstructionDataEncoder,NL as getTokenTransferIntentDiscriminatorBytes,Ki as getTokenTransferIntentInstruction,HL as getTokenTransferIntentInstructionAsync,wL as getTokenTransferIntentInstructionDataCodec,zi as getTokenTransferIntentInstructionDataDecoder,Fo as getTokenTransferIntentInstructionDataEncoder,vA as getTransactionBufferAddress,pO as getTransactionBufferCloseCompressedDiscriminatorBytes,Ad as getTransactionBufferCloseCompressedInstruction,mO as getTransactionBufferCloseCompressedInstructionDataCodec,ud as getTransactionBufferCloseCompressedInstructionDataDecoder,dd as getTransactionBufferCloseCompressedInstructionDataEncoder,oO as getTransactionBufferCloseDiscriminatorBytes,sd as getTransactionBufferCloseInstruction,sO as getTransactionBufferCloseInstructionDataCodec,od as getTransactionBufferCloseInstructionDataDecoder,nd as getTransactionBufferCloseInstructionDataEncoder,OU as getTransactionBufferCodec,U_ as getTransactionBufferCreateArgsCodec,Kt as getTransactionBufferCreateArgsDecoder,zt as getTransactionBufferCreateArgsEncoder,vO as getTransactionBufferCreateCompressedDiscriminatorBytes,Ed as getTransactionBufferCreateCompressedInstruction,UO as getTransactionBufferCreateCompressedInstructionDataCodec,Cd as getTransactionBufferCreateCompressedInstructionDataDecoder,Id as getTransactionBufferCreateCompressedInstructionDataEncoder,CO as getTransactionBufferCreateDiscriminatorBytes,yd as getTransactionBufferCreateInstruction,EO as getTransactionBufferCreateInstructionDataCodec,Td as getTransactionBufferCreateInstructionDataDecoder,ld as getTransactionBufferCreateInstructionDataEncoder,Zc as getTransactionBufferDecoder,LU as getTransactionBufferDiscriminatorBytes,$1 as getTransactionBufferEncoder,YO as getTransactionBufferExecuteCompressedDiscriminatorBytes,Ld as getTransactionBufferExecuteCompressedInstruction,ZO as getTransactionBufferExecuteCompressedInstructionDataCodec,Wd as getTransactionBufferExecuteCompressedInstructionDataDecoder,kd as getTransactionBufferExecuteCompressedInstructionDataEncoder,HO as getTransactionBufferExecuteDiscriminatorBytes,bd as getTransactionBufferExecuteInstruction,VO as getTransactionBufferExecuteInstructionDataCodec,Rd as getTransactionBufferExecuteInstructionDataDecoder,hd as getTransactionBufferExecuteInstructionDataEncoder,AB as getTransactionBufferExtendCompressedDiscriminatorBytes,qd as getTransactionBufferExtendCompressedInstruction,gB as getTransactionBufferExtendCompressedInstructionDataCodec,jd as getTransactionBufferExtendCompressedInstructionDataDecoder,Kd as getTransactionBufferExtendCompressedInstructionDataEncoder,nB as getTransactionBufferExtendDiscriminatorBytes,Vd as getTransactionBufferExtendInstruction,oB as getTransactionBufferExtendInstructionDataCodec,Hd as getTransactionBufferExtendInstructionDataDecoder,wd as getTransactionBufferExtendInstructionDataEncoder,bB as getTransactionBufferVoteCompressedDiscriminatorBytes,su as getTransactionBufferVoteCompressedInstruction,_B as getTransactionBufferVoteCompressedInstructionDataCodec,ou as getTransactionBufferVoteCompressedInstructionDataDecoder,nu as getTransactionBufferVoteCompressedInstructionDataEncoder,xB as getTransactionBufferVoteDiscriminatorBytes,$d as getTransactionBufferVoteInstruction,IB as getTransactionBufferVoteInstructionDataCodec,Qd as getTransactionBufferVoteInstructionDataDecoder,Xd as getTransactionBufferVoteInstructionDataEncoder,KB as getTransactionExecuteCompressedDiscriminatorBytes,yu as getTransactionExecuteCompressedInstruction,jB as getTransactionExecuteCompressedInstructionDataCodec,Tu as getTransactionExecuteCompressedInstructionDataDecoder,lu as getTransactionExecuteCompressedInstructionDataEncoder,BB as getTransactionExecuteDiscriminatorBytes,Au as getTransactionExecuteInstruction,NB as getTransactionExecuteInstructionDataCodec,uu as getTransactionExecuteInstructionDataDecoder,du as getTransactionExecuteInstructionDataEncoder,dN as getTransactionExecuteSyncCompressedDiscriminatorBytes,bu as getTransactionExecuteSyncCompressedInstruction,uN as getTransactionExecuteSyncCompressedInstructionDataCodec,Ru as getTransactionExecuteSyncCompressedInstructionDataDecoder,hu as getTransactionExecuteSyncCompressedInstructionDataEncoder,eN as getTransactionExecuteSyncDiscriminatorBytes,Eu as getTransactionExecuteSyncInstruction,tN as getTransactionExecuteSyncInstructionDataCodec,Cu as getTransactionExecuteSyncInstructionDataDecoder,Iu as getTransactionExecuteSyncInstructionDataEncoder,w_ as getTransactionMessageAddressTableLookupCodec,fo as getTransactionMessageAddressTableLookupDecoder,yo as getTransactionMessageAddressTableLookupEncoder,O_ as getTransactionMessageCodec,qt as getTransactionMessageDecoder,jt as getTransactionMessageEncoder,G_ as getTransactionSyncSignersCodec,$ as getTransactionSyncSignersDecoder,Q as getTransactionSyncSignersEncoder,J_ as getTransferFeeAccountExtensionCodec,jn as getTransferFeeAccountExtensionDecoder,Kn as getTransferFeeAccountExtensionEncoder,X_ as getTransferHookAccountExtensionCodec,Jn as getTransferHookAccountExtensionDecoder,qn as getTransferHookAccountExtensionEncoder,ev as getTransportsCodec,Yt as getTransportsDecoder,Jt as getTransportsEncoder,w as getUserAccountAddress,ov as getUserCodec,iv as getUserCreationArgsCodec,Ue as getUserCreationArgsDecoder,ve as getUserCreationArgsEncoder,ne as getUserDecoder,Zt as getUserEncoder,gv as getUserMutArgsCodec,rt as getUserMutArgsDecoder,tt as getUserMutArgsEncoder,Tv as getUserReadOnlyArgsCodec,Ot as getUserReadOnlyArgsDecoder,Lt as getUserReadOnlyArgsEncoder,xv as getUserReadOnlyOrMutateArgsCodec,je as getUserReadOnlyOrMutateArgsDecoder,Ke as getUserReadOnlyOrMutateArgsEncoder,Pv as getUserRoleCodec,Ze as getUserRoleDecoder,Ye as getUserRoleEncoder,R8 as getWalletAddressFromIndex,Le as getWalletAddressFromSettings,VU as getWhitelistedAddressTreeCodec,ra as getWhitelistedAddressTreeDecoder,HU as getWhitelistedAddressTreeDiscriminatorBytes,xf as getWhitelistedAddressTreeEncoder,os as getWhitelistedAddressTreeFromIndex,T8 as getWhitelistedAddressTreeIndexFromAddress,xA as getWhitelistedAddressTreesAddress,qN as identifyMultiWalletAccount,JN as identifyMultiWalletInstruction,jw as initialize,GR as isConfigAction,ab as isExtensionStruct,tw as isMultiWalletError,K_ as isTransactionSyncSigners,Cv as isUserReadOnlyOrMutateArgs,_5 as nativeTransferIntent,ik as parseAddWhitelistedAddressTreesInstruction,Mk as parseChangeConfigCompressedInstruction,yk as parseChangeConfigInstruction,Ok as parseCreateCompressedWalletInstruction,jk as parseCreateDomainConfigInstruction,rW as parseCreateDomainUserAccountInstruction,AW as parseCreateGlobalCounterInstruction,IW as parseCreateUserAccountsInstruction,_W as parseDecompressSettingsAccountInstruction,NW as parseDisableDomainConfigInstruction,JW as parseEditDomainConfigInstruction,nL as parseEditTransactionManagerUrlInstruction,gL as parseEditUserDelegateInstruction,vL as parseNativeTransferIntentCompressedInstruction,CL as parseNativeTransferIntentInstruction,c5 as parseSecp256r1VerifyInstruction,XL as parseTokenTransferIntentCompressedInstruction,VL as parseTokenTransferIntentInstruction,lO as parseTransactionBufferCloseCompressedInstruction,cO as parseTransactionBufferCloseInstruction,kO as parseTransactionBufferCreateCompressedInstruction,DO as parseTransactionBufferCreateInstruction,XO as parseTransactionBufferExecuteCompressedInstruction,FO as parseTransactionBufferExecuteInstruction,pB as parseTransactionBufferExtendCompressedInstruction,sB as parseTransactionBufferExtendInstruction,vB as parseTransactionBufferVoteCompressedInstruction,CB as parseTransactionBufferVoteInstruction,qB as parseTransactionExecuteCompressedInstruction,wB as parseTransactionExecuteInstruction,AN as parseTransactionExecuteSyncCompressedInstruction,rN as parseTransactionExecuteSyncInstruction,H8 as pollJitoBundleConfirmation,ZV as prepareChangeConfigArgs,oF as prepareTransactionBundle,yF as prepareTransactionMessage,CF as prepareTransactionSync,iH as retrieveTransactionManager,OM as sendJitoBundle,uH as serializeConfigActions,w8 as signAndSendBundledTransactions,q8 as signAndSendTransaction,G5 as tokenTransferIntent,z_ as transactionSyncSigners,Iv as userReadOnlyOrMutateArgs,Fu as vaultTransactionMessageDeserialize,Vu as vaultTransactionMessageSerialize,ng as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
3
|
+
`);throw new Error(t)}return o.value.unitsConsumed}async function gA(e,n){let o=(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));o.sort((c,i)=>c-i);let t=Math.floor(o.length/2);return o.length%2===0?Math.round((o[t-1]+o[t])/2):o[t]}async function pA(e,n){sr(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 lt(()=>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:[]}))}]})}));await er(r,n);let o=await tr(r);if(!o.result||o.error)throw new le(`Unable to simulate bundle: ${JSON.stringify(o.error??o.result)}`);if(typeof o.result.value.summary!="string"&&o.result.value.summary.failed){let{TransactionFailure:t}=o.result.value.summary.failed.error,[,c]=t;throw new le(`Simulation failed: ${c}`)}return o.result.value.transactionResults.map(t=>t.unitsConsumed)}function X(e,n=0){let r=e instanceof M?e:void 0,o=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,i=r?.authData&&r.verifyArgs.clientDataJson?Vr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:o,signature:c,message:i,publicKey:a}}function Pe(e){if(e instanceof He)return {keyType:$t.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:$t.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function aA(e){return e instanceof M?e.toString():e.address.toString()}function Se(e){let n=new Set,r=[];for(let t of e)n.has(aA(t))||(r.push(t),n.add(aA(t)));let o=r.filter(t=>t instanceof M);if(o.length>1)throw new z(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return r}function mA({payer:e,tipAmount:n}){let r=jo[Math.floor(Math.random()*jo.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function lA(e){return typeof e=="string"?e:e.toString()}function TA(e){return e.toString()}async function es(e,n,r){let o=e?.get(n);if(o)return o;let t=await r();return t&&e&&e.set(n,t),t}var ts=[{tree:new PublicKey(batchMerkleTree1),queue:new PublicKey(batchQueue1),cpiContext:new PublicKey(batchCpiContext1),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree2),queue:new PublicKey(batchQueue2),cpiContext:new PublicKey(batchCpiContext2),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree3),queue:new PublicKey(batchQueue3),cpiContext:new PublicKey(batchCpiContext3),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree4),queue:new PublicKey(batchQueue4),cpiContext:new PublicKey(batchCpiContext4),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree5),queue:new PublicKey(batchQueue5),cpiContext:new PublicKey(batchCpiContext5),nextTreeInfo:null,treeType:TreeType.StateV2}],N=class{systemAccounts;nextPreIndex;preMap;nextPackedIndex;packedMap;outputTreeIndex;constructor(){this.systemAccounts=[],this.nextPreIndex=0,this.preMap=new Map,this.nextPackedIndex=0,this.packedMap=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){for(let r of n)this.insertOrGet(r.address.toString(),r,false);return this.preMap}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,r={address:address(n),role:AccountRole.WRITABLE},o=true){let t=o?this.packedMap:this.preMap;if(!t.has(n)){let c=o?this.nextPackedIndex++:this.nextPreIndex++;t.set(n,{index:c,accountMeta:r});}return t.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=selectStateTreeInfo(ts);return this.packOutputTreeIndex(n)}packTreeInfos(n,r){let o=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());o.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let s=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(s);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:o.length>0?{packedTreeInfos:o,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(n){return Array.from(n.entries()).sort((o,t)=>o[1].index-t[1].index).map(([,{accountMeta:o}])=>({...o}))}getOffsets(n){let r=n,o=r+this.systemAccounts.length;return [r,o]}toAccountMetas(){let n=this.hashSetAccountsToMetas(this.preMap),r=this.hashSetAccountsToMetas(this.packedMap),[o,t]=this.getOffsets(n.length);return {remainingAccounts:[...n,...this.systemAccounts,...r],systemOffset:o,packedOffset:t}}};async function Gr(e,n){let r=lA(e);return es(n,r,()=>SA(e))}async function ct(e,n){let r=TA(e);return es(n,r,()=>ee().getAccountInfo(e,{encoding:"base64"}).send())}async function Te(e,n){let r=(await Promise.all(e.map(o=>Gr(o.address,n)))).filter(o=>o!==null).filter(o=>o.data!==null&&o.address!==null);if(r.length!==e.length)throw new oe("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((o,t)=>({...o,type:e[t].type,tree:o.treeInfo.tree,queue:o.treeInfo.queue}))}function k(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 Me(e,n,r,o,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:o[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function ue(e,n,r,o,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:o[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let s=e.packTreeInfos(a,[]).stateTrees;if(!s)throw new z("Unable to parse state tree data");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:s.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:s.outputTreeIndex}}))}async function he(e,n,r,o,t){let c=null,i=null,a=null,s=new N;if(e){await s.addSystemAccounts();let{address:d}=await ge(n,r),u=(await Te([{address:d,type:"Settings"}],t))[0];o?a={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:a=await te([u],[]);let g=s.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!g)throw new z("Unable to parse state tree data");c={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0]},data:J().decode(u.data?.data)},i={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:J().decode(u.data?.data)};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:s,settingsMutArgs:i}}async function te(e,n){return or(()=>Fe().getValidityProofV0(e,n))}async function Re(){return (await zr()).length-1}var rs;async function zr(){if(!rs){let{data:e}=await oa(ee(),await xA());rs=e.whitelistedAddressTrees;}return rs}function fA(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 ar(e,n,r){let o=await bM(e,n,r);if(!o)throw new oe("User account");return o}async function bM(e,n,r){let{address:o}=await w(e,n),t=await Gr(o,r);return t?.data?.data?ne().decode(t.data.data):null}async function l8(e,{member:n,credentialId:r}){let o=[{memcmp:{offset:1,encoding:"base58",bytes:e}}];if(n)o.push({memcmp:{offset:33,encoding:"base58",bytes:getBase58Decoder().decode(V().encode(Pe(n)))}});else if(r)o.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(Ce(r))}});else return null;let t=await Fe().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:o});return t.items.filter(c=>!!c.data).length?t.items.map(c=>ne().decode(c.data?.data))[0]:null}async function Kr(e,n,r){let o=await _M(e,n,r);if(!o)throw new oe("Settings account");return o}async function _M(e,n,r){try{let{address:o}=await ge(e,n),t=await Gr(o,r);if(!t?.data?.data)throw new oe("Compressed settings account");let c=J().decode(t.data.data);if(c.data.__option==="None")throw new oe("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let o=await xo(ee(),e);return o.exists?{...o.data,isCompressed:false}:null}}async function T8(e,n,r){let o=await ar(e,n,r);if(o.role===1||o.role===0){let t=[],[c,i]=await Promise.all([Fe().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:getBase58Decoder().decode(V().encode(Pe(e)))}}]}),ee().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(V().encode(Pe(e)))}}]}).send()]);return c.items.forEach(a=>{if(a.data?.data){let s=J().decode(a.data.data);s.data.__option==="Some"&&t.push({...s.data.value,isCompressed:true});}}),i.forEach(a=>{let s=hr().decode(getBase64Encoder().encode(a.account.data[0]));t.push({...s,isCompressed:false});}),t}else return await Promise.all(o.wallets.map(async t=>Kr(await be(t.index),t.settingsAddressTreeIndex,r)))}async function os(e){oA(e,"index");let n=await zr();if(e>=n.length)throw new z(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function y8(e){let r=(await zr()).findIndex(o=>o.toString()===e);if(r===-1)throw new oe("Address tree",`Address ${e} not found in whitelist`);return r}async function SA(e,n){if(!n&&!e)throw new Error("Either hash or address must be provided");if(n&&e)throw new Error("Only one of hash or address must be provided");let r=await rpcRequest(Fe().compressionApiEndpoint,versionedEndpoint("getCompressedAccount"),{hash:n?encodeBN254toBase58(n):void 0,address:e?encodeBN254toBase58(e):void 0}),o;if(featureFlags.isV2()?o=create(r,jsonRpcResultAndContext(nullable(CompressedAccountResultV2))):o=create(r,jsonRpcResultAndContext(nullable(CompressedAccountResult))),"error"in o)throw new SolanaJSONRPCError(o.error,`failed to get info for compressed account ${n?n.toString():e?e.toString():""}`);if(o.result.value===null)return null;let t=featureFlags.isV2()?o.result.value.merkleContext.tree:o.result.value.tree,c=getStateTreeInfoByPubkey(ts,t),i=o.result.value;return createCompressedAccountWithMerkleContextLegacy(createMerkleContextLegacy(c,i.hash,i.leafIndex),i.owner,bn$1(i.lamports),i.data?parseAccountData(i.data):void 0,i.address||void 0)}async function ge(e,n=0){let r=await os(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(o,new PublicKey(r),new PublicKey(A)).toString(),"base58"),addressTree:new PublicKey(r)}}async function w(e,n=0){let r=await os(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("user"),e instanceof He?e.toTruncatedBuffer():getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(o,new PublicKey(r),new PublicKey(A.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function mt({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(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 _A(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function xA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function vA(e,n,r){nA(r,0,255,"buffer_index");let[o]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof He?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return o}async function Le(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function be(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function b8(e){let n=await be(e);return await Le(n)}async function _8(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function H8(e){sr(e,"bundle");let n=await $o(e,true),r=await pA(n.map(getBase64EncodedWireTransaction),Gu()),o=await $o(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await BM(o.map(getBase64EncodedWireTransaction))}async function BM(e,n=Yo(),r){sr(e,"serializedTransactions");let{blockEngineUrl:o}=n,t=`${o}/bundles`,c=await lt(()=>fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})}),r);await er(c,t);let i=await tr(c);if(i.error)throw new le(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new le("No bundle ID returned from Jito");return i.result}async function V8(e,n=30,r=3e3,o=Yo()){sA(e,"bundleId");let{blockEngineUrl:t}=o,c=`${t}/getBundleStatuses`;return or(async()=>{let i=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await er(i,c);let a=await tr(i);if(a.error)throw new le(`Error getting bundle status: ${JSON.stringify(a.error,null,2)}`,e);if(!a.result?.value?.length)throw new le("Bundle not yet confirmed",e);let s=a.result.value[0];if(s.confirmation_status==="confirmed"||s.confirmation_status==="finalized"){let d=s.transactions[s.transactions.length-1];if(!d)throw new le("No transactions in confirmed bundle",e);return d}throw new le(`Bundle status: ${s.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:rA(le,De)})}async function J8({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=await ee().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(e,c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(o.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([AA(c),gA(ee(),c.instructions.flatMap(d=>d.accounts??[]))]),s=Math.ceil((Number(i)??0)*1.1);return prependTransactionMessageInstructions([...s>2e5?[getSetComputeUnitLimitInstruction({units:s})]:[],...a>0?[getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await zu()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function dH(e,n){if(n.threshold>1)throw new z("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(s=>LA(s.pubkey)===e);if(!r)throw new oe("Member",`Signer ${e} not found in settings`);let{permissions:o}=r;if(!o)throw new oe("Permissions","No permissions found for the current member");let t=we.has(o,We.InitiateTransaction),c=we.has(o,We.VoteTransaction),i=we.has(o,We.ExecuteTransaction);if(t&&c&&i)return {};if(!c||!i)throw new Nr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(s=>s.role===0);if(!a)throw new oe("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(LA(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function uH({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:o,cachedAccounts:t}){if(!n)return null;let c=await ar(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new oe("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return eh(n,c.transactionManagerUrl.value,e,o)}function eh(e,n,r,o){return {address:e,async signTransactions(t){let c=await lt(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:e.toString(),payload:t.map(a=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(a)),transactionMessageBytes:o?getBase64Decoder().decode(o):void 0,authResponses:r}))})}));if(!c.ok)throw new De(`Transaction manager request failed: ${c.statusText}`,c.status,n);let i=await c.json();if("error"in i)throw new De(`Transaction manager error: ${i.error}`,c.status,n);return i.signatures.map(a=>({[e]:getBase58Encoder().encode(a)}))}}}function LA(e){return e.keyType===$t.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function AH(e){let n=e.map(c=>qe().encode(c)),r=4+n.reduce((c,i)=>c+i.length,0),o=new Uint8Array(r),t=0;o.set(getU32Encoder().encode(e.length),t),t+=4;for(let c of n)o.set(c,t),t+=c.length;return o}function gH(e){let n=0,[r,o]=getU32Decoder().read(e,n);n=o;let t=new Array(r);for(let c=0;c<r;c++){let i=Je().read(e,n);t[c]=i[0],n=i[1];}if(n!==e.length)throw new z(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function RH({payer:e,rpId:n,origins:r,authority:o}){let t=await mt({rpId:n}),c=new N;await c.addSystemAccounts();let i=await Re(),{address:a,addressTree:s}=await w(o.address,i),d=[{address:a,tree:s,queue:s,type:"User"}],u=await te([],d),g=(await Me(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:f}=c.toAccountMetas(),S=k(u,f);return await Ha({origins:r,authorityCreationArgs:g,authority:o,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function wH({authority:e,payer:n,createUserArgs:r,domainConfig:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[];r.settings&&(i.push({address:(await ge(r.settings,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&i.push({address:(await w(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let a=i.length?await Te(i,t):[],s=await Re(),{address:d,addressTree:u}=await w(r.member,s),g=[{address:d,type:"User",tree:u,queue:u}],p=await te(a,g),f=null,S=null,I=a.filter(B=>B.type==="Settings"),x=a.filter(B=>B.type==="User");I.length&&(f=ue(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),I,J())[0]),x.length&&(S=ue(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,ne())[0]);let _=await Me(c,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),g),{remainingAccounts:E,systemOffset:C}=c.toAccountMetas(),v=k(p,C);return await Ka({payer:n,authority:e,compressedProofArgs:v,member:wt().decode(r.member.toBuffer()),credentialId:Ce(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:f?some({settingsMutArgs:f,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:_[0],domainConfig:o,remainingAccounts:E})}async function GH({payer:e}){let n=await _A();return Ya({payer:e,globalCounter:n})}async function qH({admin:e,rpId:n,disable:r}){let o=await mt({rpId:n});return Ai({domainConfig:o,admin:e,disable:r,remainingAccounts:[]})}function rh(e,n,r,o){let t=nh(e,n),c=oh(e,n)&&r!==o;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function nh(e,n){let r=e.staticAccounts.length,{numSignerAccounts:o,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=o-t,a=r-o-c;return n>=r?false:n<i?true:n>=o?n-o<a:false}function oh(e,n){return n<e.header.numSignerAccounts}async function jr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:o}){let t=Fu(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),ee()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,s]of t.staticAccounts.entries())i.push({address:s,role:rh(t,a,s,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let s=c[a.lookupTableAddress];if(!s)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.READONLY});}}for(let a of o?.filter(s=>s.address!==e)??[]){let s=i.findIndex(d=>d.address===a.address);s===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[s].role===AccountRole.READONLY||i[s].role===AccountRole.READONLY_SIGNER?i[s]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[s].role===AccountRole.WRITABLE||i[s].role===AccountRole.WRITABLE_SIGNER)&&(i[s]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}var yt=33,ft=64,is=14,Ah=2,gh=address("Secp256r1SigVerify1111111111111111111111111");function ph(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function mh(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function VA(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let o=getU8Decoder().decode(e,n);n+=1;let t=[],c=mh();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=is;let i=[];for(let a=0;a<r;a++){let s=fixDecoderSize(getBytesDecoder(),yt).decode(e,n);n+=yt;let d=fixDecoderSize(getBytesDecoder(),ft).decode(e,n);n+=ft;let u=t[a].messageDataSize,g=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:s,signature:d,message:g});}return [{numSignatures:r,padding:o,offsets:t,payload:i},n]}})}function FA(){return createEncoder({getSizeFromValue:e=>{let n=is*e.offsets.length,r=e.payload.reduce((o,t)=>o+yt+ft+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 o=ph();for(let t of e.offsets)r=o.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),yt).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),ft).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function c5(){return combineCodec(FA(),VA())}function H(e,n){let r=e.length,o=Ah+r*is,t=[];for(let s=0;s<r;s++){let{message:d}=e[s],u=o,g=u+yt,p=g+ft;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),o+=yt+ft+d.length;}let c=n?.programAddress??gh,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:FA().encode(i)}}function a5(e){return {programAddress:e.programAddress,accounts:{},data:VA().decode(e.data)}}async function GA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:o,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:s=false}){let d=await Le(e),{accountMetas:u,addressLookupTableAccounts:g}=await jr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(H(c)),p.push(s?yu({transactionBuffer:n,payer:o.address,remainingAccounts:u,settingsKey:e}):Au({transactionBuffer:n,payer:o.address,settings:e})),a&&p.push(mA({payer:o,tipAmount:a})),{instructions:p,addressLookupTableAccounts:g}}async function KA({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,additionalSigners:o,signers:t,payer:c,addressesByLookupTableAddress:i,secp256r1VerifyInput:a=[],compressed:s=false,simulateProof:d=false,cachedAccounts:u}){let g=Se(t),p=await Le(e),[{accountMetas:f,addressLookupTableAccounts:S,transactionMessage:I},{settingsMutArgs:x,proof:_,packedAccounts:E}]=await Promise.all([jr({transactionMessageBytes:r,walletAddress:p,additionalSigners:o,addressesByLookupTableAddress:i}),he(s,e,n,d,u)]);E.addPreAccounts(f);let C=[];for(let j of g)if(j instanceof M){let ce=a.length,{domainConfig:ye,verifyArgs:fe,signature:ae,publicKey:_e,message:ut}=X(j,ce);if(ut&&ae&&_e&&a.push({message:ut,signature:ae,publicKey:_e}),ye){let y=E.addPreAccounts([{address:ye,role:AccountRole.READONLY}]).get(ye)?.index;fe.__option==="Some"&&y!==void 0&&C.push({__kind:"Secp256r1",fields:[{domainConfigIndex:y,verifyArgs:fe.value}]});}}else {let ce=E.addPreAccounts([{address:j.address,role:AccountRole.READONLY_SIGNER,signer:j}]).get(j.address)?.index;ce!==void 0&&C.push({__kind:"Ed25519",fields:[ce]});}let{remainingAccounts:v,systemOffset:B}=E.toAccountMetas(),K=[];a.length>0&&K.push(H(a));let se=lh(I,f);if(s){if(!c||!x)throw new Error("Payer not found or proof args is missing.");let j=k(_,B);K.push(bu({signers:C,transactionMessage:se,settingsMutArgs:x,compressedProofArgs:j,payer:c,remainingAccounts:v}));}else K.push(Eu({signers:C,settings:e,transactionMessage:se,remainingAccounts:v}));return {instructions:K,addressLookupTableAccounts:S}}function lh(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:r.data??[]})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(o=>o.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function v5({settings:e,settingsAddressTreeIndex:n,destination:r,signers:o,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let s=Se(o),d=await Le(e),[{packedAccounts:u,proof:g,settingsMutArgs:p},{value:f}]=await Promise.all([he(a,e,n,false,t),ct(d,t)]);if((f?.lamports??0)<BigInt(c))throw new Error("Insufficient balance");let S=[],I=[];for(let C of s)if(C instanceof M){let v=S.length,{domainConfig:B,verifyArgs:K,signature:se,publicKey:j,message:ce}=X(C,v);if(ce&&se&&j&&S.push({message:ce,signature:se,publicKey:j}),B){let ye=u.addPreAccounts([{address:B,role:AccountRole.READONLY}]).get(B)?.index;K.__option==="Some"&&ye!==void 0&&I.push({__kind:"Secp256r1",fields:[{domainConfigIndex:ye,verifyArgs:K.value}]});}}else {let v=u.addPreAccounts([{address:C.address,role:AccountRole.READONLY_SIGNER,signer:C}]).get(C.address)?.index;v!==void 0&&I.push({__kind:"Ed25519",fields:[v]});}let{remainingAccounts:x,systemOffset:_}=u.toAccountMetas(),E=[];if(S.length>0&&E.push(H(S)),a){if(!i||!p)throw new Error("Payer not found or proof args is missing.");let C=k(g,_);E.push(wi({amount:c,settingsMutArgs:p,compressedProofArgs:C,payer:i,signers:I,source:d,destination:r,remainingAccounts:x}));}else E.push(ki({amount:c,signers:I,source:d,destination:r,settings:e,remainingAccounts:x}));return E}var Ih=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),Ch=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Jr=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function z5({settings:e,settingsAddressTreeIndex:n,destination:r,mint:o,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:s,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false}){let g=Se(t),p=await Le(e),f=U=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(U),getAddressEncoder().encode(Jr),getAddressEncoder().encode(o)],programAddress:Jr}),S=()=>{let U=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(o)];return d.restricted&&U.push(getUtf8Encoder().encode("restricted")),d.index>0&&U.push(getU8Encoder().encode(d.index)),U},[I,[x],_,[E],[C]]=await Promise.all([getAssociatedTokenAccountAddress(o,p,s),f(p),getAssociatedTokenAccountAddress(o,r,s),f(r),getProgramDerivedAddress({seeds:S(),programAddress:Jr})]),[v,B,K,se]=await Promise.all([ct(_,c),ct(I,c),ct(x,c),Ph(u,e,n,c)]),j=!!v.value,ce=!!B.value,ye=!!K.value,fe=ce?getTokenDecoder().decode(getBase64Encoder().encode(B.value.data[0])).amount:BigInt(0),ae=BigInt(ye?Mh(getBase64Encoder().encode(K.value.data[0]))?.amount??0:0),_e=j?_:void 0,ut=j?void 0:E,y=ce&&(fe+ae<BigInt(i)||ae>BigInt(0)||!j)||!ce&&j,Qr=!j,[me,ls]=await Promise.all([Dh(p,o,fe,ae,BigInt(i),u?3:4),Eh(y,C,c)]),re=me.reduce((U,q)=>U+q.parsed.amount.toNumber(),0);if(fe+ae+BigInt(re)<BigInt(i))throw new Error("Insufficient balance");let At=null,Oe=null,Be=new N;if(ls&&Be.addPreAccounts([{address:o,role:AccountRole.WRITABLE}]),se||me.length){await Be.addSystemAccounts();let U=[];if(me.length&&U.push(...me.map(q=>({hash:q.compressedAccount.hash,tree:q.compressedAccount.treeInfo.tree,queue:q.compressedAccount.treeInfo.queue,data:q.compressedAccount.data,address:q.compressedAccount.address}))),se&&U.push(se),Oe=await te(U,[]),se){let q=me.length;At=ue(Be,Oe.treeInfos.slice(q),Oe.leafIndices.slice(q),Oe.rootIndices.slice(q),Oe.proveByIndices.slice(q),U.slice(q),J())[0];}}let ug=me.length&&Oe?some(me.map((U,q)=>({isFrozen:U.parsed.state===AccountState.Frozen,hasDelegate:U.parsed.delegate!=null,amount:U.parsed.amount.toNumber(),merkleContext:{leafIndex:U.compressedAccount.leafIndex,merkleTreePubkeyIndex:Be.insertOrGet(U.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:Be.insertOrGet(U.compressedAccount.treeInfo.queue.toString()),proveByIndex:U.compressedAccount.proveByIndex},rootIndex:Oe.rootIndices[q],version:fA(U.compressedAccount.data?.discriminator),tlv:U.parsed.tlv?some(getArrayDecoder(Ut()).decode(U.parsed.tlv)):none()}))):none(),dr=[],$r=[];for(let U of g)if(U instanceof M){let q=dr.length,{domainConfig:en,verifyArgs:ys,signature:fs,publicKey:Ss,message:xs}=X(U,q);if(xs&&fs&&Ss&&dr.push({message:xs,signature:fs,publicKey:Ss}),en){let Is=Be.addPreAccounts([{address:en,role:AccountRole.READONLY}]).get(en)?.index;ys.__option==="Some"&&Is!==void 0&&$r.push({__kind:"Secp256r1",fields:[{domainConfigIndex:Is,verifyArgs:ys.value}]});}}else {let q=Be.addPreAccounts([{address:U.address,role:AccountRole.READONLY_SIGNER,signer:U}]).get(U.address)?.index;q!==void 0&&$r.push({__kind:"Ed25519",fields:[q]});}let{remainingAccounts:Ag,systemOffset:gg}=Be.toAccountMetas(),ur=[];dr.length>0&&ur.push(H(dr));let pg=k(Oe,gg),mg=y?C:void 0,lg=Qr?Ch:void 0,Tg=y?some(d):none(),Ts={amount:i,signers:$r,source:p,destination:r,sourceCtokenTokenAccount:x,sourceSplTokenAccount:I,destinationCtokenTokenAccount:ut,destinationSplTokenAccount:_e,mint:o,tokenProgram:s,remainingAccounts:Ag,payer:a,sourceCompressedTokenAccounts:ug,compressedProofArgs:pg,compressibleConfig:Ih,splInterfacePda:mg,rentSponsor:lg,splInterfacePdaArgs:Tg};if(u){if(!At)throw new Error("Payer not found or proof args is missing.");ur.push($i({...Ts,settingsMutArgs:At}));}else ur.push(Ki({...Ts,settings:e}));return ur}async function Eh(e,n,r){if(!e)return false;let{value:o}=await ct(n,r);return !o}async function Dh(e,n,r,o,t,c){let i=t-r-o;if(i<=0)return [];let s=(await Fe().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(n)})).items.filter(g=>!!g.compressedAccount.data?.data.length&&g.compressedAccount.owner.toString()===Jr.toString()&&!g.parsed.amount.isZero()).sort((g,p)=>p.parsed.amount.cmp(g.parsed.amount));if(s.length===0)return [];let d=BigInt(0),u=[];for(let g of s){if(u.length>=c||d>=i)break;d+=BigInt(g.parsed.amount.toNumber()),u.push(g);}if(d<i)throw u.length>=c?new Error("Transaction size limit exceeded. Consider multiple transfers to transfer full balance."):new Error("Insufficient balance.");return u}async function Ph(e,n,r,o){if(!e)return null;let{address:t}=await ge(n,r);return (await Te([{address:t,type:"Settings"}],o))[0]}function Mh(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 t6({signers:e,payer:n,changeConfigArgs:r}){let{settings:o,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:s}=r,d=Se(e),u=[],g=[];for(let x of d)if(x instanceof M){let _=g.length,{domainConfig:E,verifyArgs:C,signature:v,publicKey:B,message:K}=X(x,_);if(K&&v&&B&&g.push({message:K,signature:v,publicKey:B}),E){let se=i.addPreAccounts([{address:E,role:AccountRole.READONLY}]).get(E)?.index;C.__option==="Some"&&se!==void 0&&u.push({__kind:"Secp256r1",fields:[{domainConfigIndex:se,verifyArgs:C.value}]});}}else {let _=i.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]).get(x.address)?.index;_!==void 0&&u.push({__kind:"Ed25519",fields:[_]});}let{remainingAccounts:p,systemOffset:f}=i.toAccountMetas(),S=k(a,f),I=[];if(g.length>0&&I.push(H(g)),c){if(!s)throw new Error("Payer not found or proof args is missing.");I.push(Pa({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:s,remainingAccounts:p,signers:u}));}else I.push(ya({settings:o,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:p,signers:u}));return I}async function i6({createUserArgs:e,payer:n}){let r=new N;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:AccountRole.READONLY_SIGNER,signer:u.member})));let o=await Re(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:p}=await w(u.member.address,o);return {address:g,tree:p,queue:p,type:"User"}})),c=await te([],t),i=await Me(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:s}=r.toAccountMetas(),d=k(c,s);return await $a({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:i[g],transactionManagerUrl:u.role===0?u.transactionManagerUrl:null})),remainingAccounts:a})}async function l6({index:e,payer:n,initialMember:r,userAddressTreeIndex:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[],a=[];a.push(...await Te([{address:(await w(r.address,o)).address,type:"User"}],t));let s=await Re(),{address:d,addressTree:u}=await ge(await be(e),s);i.push({address:d,queue:u,tree:u,type:"Settings"});let g=a.length,p=await te(a,i),f=ue(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),a.filter(C=>C.type==="User"),ne())[0],I=(await Me(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),i)).find(C=>C.type==="Settings")??null,{remainingAccounts:x,systemOffset:_}=c.toAccountMetas(),E=k(p,_);if(!I)throw new Error("Settings creation args is missing.");return await _a({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:E,...I,remainingAccounts:x})}async function E6({settings:e,settingsAddressTreeIndex:n,payer:r,signers:o,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await he(true,e,n,false,t);if(!a)throw new Error("Proof args is missing");let s=Se(o),d=[],u=[];for(let I of s)if(I instanceof M){let x=d.length,{domainConfig:_,verifyArgs:E,signature:C,publicKey:v,message:B}=X(I,x);if(B&&C&&v&&d.push({message:B,signature:C,publicKey:v}),_){let K=c.addPreAccounts([{address:_,role:AccountRole.READONLY}]).get(_)?.index;E.__option==="Some"&&K!==void 0&&u.push({__kind:"Secp256r1",fields:[{domainConfigIndex:K,verifyArgs:E.value}]});}}else {let x=c.addPreAccounts([{address:I.address,role:AccountRole.READONLY_SIGNER,signer:I}]).get(I.address)?.index;x!==void 0&&u.push({__kind:"Ed25519",fields:[x]});}let{remainingAccounts:g,systemOffset:p}=c.toAccountMetas(),f=k(i,p),S=[];return d.length>0&&S.push(H(d)),S.push(si({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:f,signers:u,remainingAccounts:g})),S}async function _6({authority:e,domainConfig:n,newAuthority:r,newOrigins:o}){let t=null,c=[];if(r){let i=new N;await i.addSystemAccounts();let a=await Re(),{address:s,addressTree:d}=await w(r.address,a),u=[{address:s,tree:d,queue:d,type:"User"}],g=await te([],u),p=(await Me(i,g.treeInfos,g.roots,g.rootIndices,u))[0],f=i.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:k(g,f.systemOffset),authorityCreationArgs:p};}return yi({domainConfig:n,authority:e,newOrigins:o?some(o):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function O6({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let o=new N;await o.addSystemAccounts();let t=await Te([{address:(await w(e.address,n)).address,type:"User"}]),c=await te(t,[]),i=ue(o,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,ne())[0],{remainingAccounts:a,systemOffset:s}=o.toAccountMetas(),d=k(c,s);return Ei({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function j6({payer:e,user:n,userAddressTreeIndex:r,newDelegate:o,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:s,publicKey:d}=X(n),u=[];a&&s&&d&&u.push({message:a,signature:s,publicKey:d});let g=await ar(n instanceof M?n:n.address,r,t),p=[];p.push({address:(await w(n instanceof M?n:n.address,r)).address,type:"User"});let f,S=null,I,x=null,_=g.wallets.find(ae=>ae.isDelegate);if(_){let ae=await be(_.index);(await Kr(ae,_.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ge(ae,_.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):f=await be(_.index);}if(o){let ae=await be(o.index);(await Kr(ae,o.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ge(ae,o.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):I=await be(o.index);}let E=new N;await E.addSystemAccounts();let C=await Te(p,t),v=await te(C,[]),B=ue(E,v.treeInfos.slice(0,1),v.leafIndices.slice(0,1),v.rootIndices.slice(0,1),v.proveByIndices.slice(0,1),C.slice(0,1),ne())[0],K=S?some(ue(E,v.treeInfos.slice(S.start,S.end),v.leafIndices.slice(S.start,S.end),v.rootIndices.slice(S.start,S.end),v.proveByIndices.slice(S.start,S.end),C.slice(S.start,S.end),J())[0]):none(),se=x?some(ue(E,v.treeInfos.slice(x.start,x.end),v.leafIndices.slice(x.start,x.end),v.rootIndices.slice(x.start,x.end),v.proveByIndices.slice(x.start,x.end),C.slice(x.start,x.end),J())[0]):none(),{remainingAccounts:j,systemOffset:ce}=E.toAccountMetas(),ye=k(v,ce),fe=[];return u.length>0&&fe.push(H(u)),fe.push(bi({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:o?some(o):none(),feePayer:e,signer:n instanceof M?void 0:n,oldSettings:f,oldSettingsMutArgs:K,newSettings:I,newSettingsMutArgs:se,compressedProofArgs:ye,userMutArgs:B,remainingAccounts:j})),fe}async function iV({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:o,compressed:t=false,cachedAccounts:c}){let i=await Qc(ee(),r),a=i.data.multiWalletSettings,{packedAccounts:s,proof:d,settingsMutArgs:u}=await he(t,a,e,false,c),{remainingAccounts:g,systemOffset:p}=s.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:I,signature:x,publicKey:_}=X(n),E=[];if(I&&x&&_&&E.push(H([{message:I,signature:x,publicKey:_}])),t){if(!o||!u)throw new Error("Payer not found or proof args is missing.");let C=k(d,p);E.push(Ad({transactionBuffer:r,domainConfig:f,closer:n instanceof M?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:u,payer:o,compressedProofArgs:C,remainingAccounts:g}));}else E.push(sd({transactionBuffer:r,domainConfig:f,closer:n instanceof M?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return E}function eg({payer:e,creator:n,bufferIndex:r,settings:o,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,compressedArgs:d,expectedSigners:u}){let{domainConfig:g,verifyArgs:p,message:f,signature:S,publicKey:I}=X(n),x=[];if(f&&S&&I&&x.push(H([{message:f,signature:S,publicKey:I}])),d){let{settingsReadonlyArgs:_,compressedProofArgs:E,remainingAccounts:C}=d;x.push(Ed({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof M?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},settingsReadonlyArgs:_,compressedProofArgs:E,remainingAccounts:C}));}else x.push(yd({settings:o,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof M?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},remainingAccounts:[]}));return x}function tg({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:s}=X(e),d=[];return a&&i&&s&&d.push(H([{message:a,signature:i,publicKey:s}])),o?d.push(Ld({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,settingsMutArgs:o.settingsMutArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(bd({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,remainingAccounts:[]})),d}function rg({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:o=false}){return o?qd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Vd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function ng({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:s}=X(n),d=[];return s&&i&&a&&d.push(H([{message:s,signature:i,publicKey:a}])),o?d.push(su({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,settingsReadonlyArgs:o.settingsReadonlyArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push($d({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,remainingAccounts:[]})),d}async function XV({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:o,compressed:t=false}){let c=await _h(r),i=new N,a=null,s=null,d=[];if(c.length||t){let g=await vh({packedAccounts:i,userAccounts:c,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:o});a=g.proof,s=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await Uh({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:s,packedAccounts:i,compressed:t}}async function _h(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}}return n}async function vh({packedAccounts:e,userAccounts:n,compressed:r,settings:o,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let f=(await ge(o,t)).address;i.push({address:f,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await Te(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let s=await te(a,[]),d=[],u=[];for(let f of a)f.type==="Settings"?d.push(f):f.type==="User"&&u.push(f);let g,p=[];if(r&&s&&(g=ue(e,s.treeInfos.slice(0,1),s.leafIndices.slice(0,1),s.rootIndices.slice(0,1),s.proveByIndices.slice(0,1),d,J())[0]),u.length&&s){let f=r?1:0;p=ue(e,s.treeInfos.slice(f),s.leafIndices.slice(f),s.rootIndices.slice(f),s.proveByIndices.slice(f),u,ne());}return {proof:s,settingsMutArgs:g,userMutArgs:p}}async function Uh({configActionsArgs:e,userMutArgs:n}){let r=[];for(let o of e)switch(o.type){case "AddMembers":{let t=[];for(let c of o.members){let i=await w(c.member,c.userAddressTreeIndex).then(a=>n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(a.address)))));if(!i)throw new Error("Unable to find user account");t.push(Lh({permissionArgs:c.permissions,userMutArgs:i,pubkey:c.member}));}r.push({__kind:o.type,fields:[t]});break}case "RemoveMembers":{let t=await Promise.all(o.members.map(c=>w(c.member,c.userAddressTreeIndex).then(i=>{let a=n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(i.address))));if(!a)throw new Error("Unable to find user account");return Wh({pubkey:c.member,userMutArgs:a})})));r.push({__kind:o.type,fields:[t]});break}case "EditPermissions":{let t=o.members.map(c=>kh({permissionArgs:c.permissions,pubkey:c.member}));r.push({__kind:o.type,fields:[t]});break}default:r.push({__kind:o.type,fields:[o.threshold]});}return r}function kh({pubkey:e,permissionArgs:n}){return {memberKey:Pe(e),permissions:ag(n)}}function Wh({pubkey:e,userMutArgs:n}){let r=n.data.role;if(r===2)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:Pe(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function Lh({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===2)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===0&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:Pe(e),permissions:ag(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function ag(e){let n=[];return e.initiate&&n.push(We.InitiateTransaction),e.vote&&n.push(We.VoteTransaction),e.execute&&n.push(We.ExecuteTransaction),we.fromPermissions(n)}async function sF({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:p=Math.ceil(o.length/2),cachedAccounts:f}){let S=Math.floor(Math.random()*255),I=await vA(n,t instanceof M?t:t.address,S),x=[],_=[];for(let re=0;re<o.length;re+=p){let At=o.subarray(re,re+p);x.push(At),_.push(sha256(At));}let E=sha256(o),{settingsReadonlyArgs:C,settingsMutArgs:v,proof:B,packedAccounts:K}=await he(d,n,r,false,f),{remainingAccounts:se,systemOffset:j}=K.toAccountMetas(),ce=B&&C&&v?{settingsReadonlyArgs:C,settingsMutArgs:v,compressedProofArgs:k(B,j),remainingAccounts:se,payer:e}:null,ye=Se([t,...c?[c]:[],...u]).map(re=>({memberKey:Pe(re),messageHash:re instanceof M?Xo(re.authResponse):null})),fe=eg({finalBufferHash:E,finalBufferSize:o.length,bufferIndex:S,payer:e,transactionBufferAddress:I,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:_,compressedArgs:ce,expectedSigners:ye}),ae=x.map(re=>rg({transactionMessageBytes:re,transactionBufferAddress:I,settings:n,compressed:d})),_e=u.map(re=>ng({voter:re,transactionBufferAddress:I,settings:n,compressedArgs:ce})),ut=tg({compressedArgs:ce,settings:n,executor:c,transactionBufferAddress:I}),{instructions:y,addressLookupTableAccounts:Qr}=await GA({compressed:d,settings:n,transactionMessageBytes:o,transactionBufferAddress:I,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s}),me=re=>({payer:e,instructions:re,addressesByLookupTableAddress:Qr});return [me(fe),...ae.map(re=>me([re])),..._e.length?[me(_e.flat())]:[],me(ut),me(y)]}var Zr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let o=new Map,t=i=>{let a=o.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},o.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let s=t(a.address);s.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,o)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),o=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),c=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+o.length,numReadonlySignerAccounts:o.length,numReadonlyNonSignerAccounts:c.length};if(r.length===0)throw new Error("Expected at least one writable signer key");let[a]=r[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let s=[...r.map(([d])=>d),...o.map(([d])=>d),...t.map(([d])=>d),...c.map(([d])=>d)];return [i,s]}extractTableLookup(n){let[r,o]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(n,r){let o=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,s=n.findIndex(d=>d===a);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),t.push(a),this.keyMetaMap.delete(c);}}return [o,t]}};var Xr=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 o=new Map;this.keySegments().flat().forEach((c,i)=>{o.set(c,i);});let t=c=>{let i=o.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function dg({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:o}){let t=Zr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(o??{});for(let p of a){let f=t.extractTableLookup(p);if(f!==void 0){let{addressTableLookup:S,drainedKeys:I}=f;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),i.writable.push(...I.writable),i.readonly.push(...I.readonly);}}let[s,d]=t.getMessageComponents(),g=new Xr(d,i).compileInstructions(r);return {version:0,header:s,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function fF({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=dg({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(Vu(o))}async function EF({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,signers:t,additionalSigners:c,secp256r1VerifyInput:i,addressesByLookupTableAddress:a,cachedAccounts:s,compressed:d=false,simulateProof:u=false}){let{instructions:g,addressLookupTableAccounts:p}=await KA({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,additionalSigners:c,transactionMessageBytes:o,secp256r1VerifyInput:i,compressed:d,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:s});return {payer:e,instructions:g,addressesByLookupTableAddress:p}}export{aa as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,AP as AdditionalSignersSchema,Bu as AuthenticationContextSchema,Nu as BaseResponseSchema,Ca as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,ma as CHANGE_CONFIG_DISCRIMINATOR,Ra as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,Na as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Ga as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,qa as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Xa as CREATE_USER_ACCOUNTS_DISCRIMINATOR,Cw as CompleteMessageRequestSchema,Dw as CompleteSendTransactionRequestSchema,Ew as CompleteTransactionRequestSchema,ri as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,ii as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Cs as DOMAIN_CONFIG_DISCRIMINATOR,li as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,xi as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,Mi as EDIT_USER_DELEGATE_DISCRIMINATOR,Rs as GLOBAL_COUNTER_DISCRIMINATOR,$t as KeyType,iD as MULTI_WALLET_ERROR__ALREADY_DELEGATED,NE as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,eP as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,RD as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,_D as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,vD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,QD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,dP as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,VE as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,HE as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,QE as MULTI_WALLET_ERROR__EMPTY_MEMBERS,BD as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,YE as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,wE as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,qE as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,yD as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,fD as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,SD as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,OD as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,AD as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,dD as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,uD as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,nD as MULTI_WALLET_ERROR__INVALID_ACCOUNT,XD as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,WD as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,ZE as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,sD as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,TD as MULTI_WALLET_ERROR__INVALID_BUFFER,ND as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,gD as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,rD as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,zE as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,UE as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,LE as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,vE as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,WE as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,hD as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,PD as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,eD as MULTI_WALLET_ERROR__INVALID_THRESHOLD,JD as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,JE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,jE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,tD as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,nP as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,oD as MULTI_WALLET_ERROR__INVALID_USER_ROLE,rP as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,qD as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,OE as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,ED as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,UD as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,VD as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,ZD as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,cD as MULTI_WALLET_ERROR__MISSING_ACCOUNT,wD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,zD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,oP as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,jD as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,HD as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,aD as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,aP as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,cP as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,LD as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,sP as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,KD as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,DD as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,$D as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,iP as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,mD as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,XE as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,GE as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,KE as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,kD as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,GD as MULTI_WALLET_ERROR__PAYER_MISMATCH,FE as MULTI_WALLET_ERROR__PERMANENT_MEMBER,CD as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,BE as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,FD as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,kE as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,MD as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,YD as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,$E as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,xD as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,ID as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,bD as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,lD as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,tP as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,pD as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,RE as MultiWalletAccount,bE as MultiWalletInstruction,Oi as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,vi as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,We as Permission,we as Permissions,Gc as SETTINGS_DISCRIMINATOR,He as Secp256r1Key,M as SignedSecp256r1Key,Lu as StartMessageRequestSchema,Ou as StartTransactionRequestSchema,Xi as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Gi as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,id as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,rd as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,xd as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,md as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Yc as TRANSACTION_BUFFER_DISCRIMINATOR,Ud as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Md as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,zd as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Nd as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,ru as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Zd as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,mu as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,iu as TRANSACTION_EXECUTE_DISCRIMINATOR,Mu as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,xu as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Wu as TransactionActionTypeSchema,gP as TransactionDetailsSchema,Iw as TransactionPayloadSchema,uP as TransactionPayloadWithBase64MessageBytesSchema,So as Transports,Ne as UserRole,ta as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,pw as addWhitelistedAddressTrees,Ce as base64URLStringToBuffer,l2 as bufferToBase64URLString,t6 as changeConfig,iV as closeTransactionBuffer,GR as configAction,f2 as convertBase64StringToJWK,y2 as convertJWKToBase64String,LA as convertMemberKeyToString,d2 as convertPubkeyCompressedToCose,i2 as convertPubkeyCoseToCompressed,g2 as createClientAuthorizationCompleteRequestChallenge,A2 as createClientAuthorizationStartRequestChallenge,RH as createDomainConfig,wH as createDomainUserAccounts,GH as createGlobalCounter,p2 as createMessageChallenge,eg as createTransactionBuffer,m2 as createTransactionChallenge,eh as createTransactionManagerSigner,i6 as createUserAccounts,l6 as createWallet,Ds as decodeDomainConfig,_s as decodeGlobalCounter,zc as decodeSettings,Xc as decodeTransactionBuffer,na as decodeWhitelistedAddressTree,E6 as decompressSettingsAccount,gH as deserializeConfigActions,qH as disableDomainConfig,_6 as editDomainConfig,O6 as editTransactionManagerUrl,j6 as editUserDelegate,GA as executeTransaction,tg as executeTransactionBuffer,KA as executeTransactionSync,rg as extendTransactionBuffer,ab as extensionStruct,Hh as fetchAllDomainConfig,qh as fetchAllGlobalCounter,_g as fetchAllMaybeDomainConfig,jg as fetchAllMaybeGlobalCounter,L1 as fetchAllMaybeSettings,tf as fetchAllMaybeTransactionBuffer,Cf as fetchAllMaybeWhitelistedAddressTree,UU as fetchAllSettings,T8 as fetchAllSettingsAccountByMember,NU as fetchAllTransactionBuffer,GU as fetchAllWhitelistedAddressTree,SA as fetchCompressedAccount,Ps as fetchDomainConfig,jh as fetchGlobalCounter,bg as fetchMaybeDomainConfig,Kg as fetchMaybeGlobalCounter,xo as fetchMaybeSettings,_M as fetchMaybeSettingsAccountData,ef as fetchMaybeTransactionBuffer,bM as fetchMaybeUserAccountData,If as fetchMaybeWhitelistedAddressTree,vU as fetchSettings,Kr as fetchSettingsAccountData,Qc as fetchTransactionBuffer,l8 as fetchUserAccountByFilters,ar as fetchUserAccountData,oa as fetchWhitelistedAddressTree,tR as getAddMemberArgsCodec,on as getAddMemberArgsDecoder,nn as getAddMemberArgsEncoder,ck as getAddWhitelistedAddressTreesDiscriminatorBytes,ik as getAddWhitelistedAddressTreesInstruction,da as getAddWhitelistedAddressTreesInstructionAsync,ak as getAddWhitelistedAddressTreesInstructionDataCodec,ia as getAddWhitelistedAddressTreesInstructionDataDecoder,Ro as getAddWhitelistedAddressTreesInstructionDataEncoder,Xh as getAdditionalMetadataCodec,rn as getAdditionalMetadataDecoder,tn as getAdditionalMetadataEncoder,Pk as getChangeConfigCompressedDiscriminatorBytes,Pa as getChangeConfigCompressedInstruction,Mk as getChangeConfigCompressedInstructionDataCodec,Da as getChangeConfigCompressedInstructionDataDecoder,Ea as getChangeConfigCompressedInstructionDataEncoder,Tk as getChangeConfigDiscriminatorBytes,ya as getChangeConfigInstruction,yk as getChangeConfigInstructionDataCodec,Ta as getChangeConfigInstructionDataDecoder,la as getChangeConfigInstructionDataEncoder,Zo as getClientAndDeviceHash,oR as getCompiledInstructionCodec,cn as getCompiledInstructionDecoder,sn as getCompiledInstructionEncoder,iR as getCompressedAccountMetaCodec,Ct as getCompressedAccountMetaDecoder,It as getCompressedAccountMetaEncoder,gR as getCompressedAccountMetaReadOnlyCodec,Mt as getCompressedAccountMetaReadOnlyDecoder,Pt as getCompressedAccountMetaReadOnlyEncoder,lR as getCompressedOnlyExtensionCodec,dn as getCompressedOnlyExtensionDecoder,an as getCompressedOnlyExtensionEncoder,fR as getCompressedProofCodec,ln as getCompressedProofDecoder,mn as getCompressedProofEncoder,ge as getCompressedSettingsAddress,CR as getCompressedSettingsCodec,MR as getCompressedSettingsDataCodec,yn as getCompressedSettingsDataDecoder,Tn as getCompressedSettingsDataEncoder,J as getCompressedSettingsDecoder,ht as getCompressedSettingsEncoder,_R as getCompressedTokenArgsCodec,vt as getCompressedTokenArgsDecoder,_t as getCompressedTokenArgsEncoder,WR as getCompressibleExtensionCodec,Dn as getCompressibleExtensionDecoder,En as getCompressibleExtensionEncoder,NR as getCompressionInfoCodec,Mn as getCompressionInfoDecoder,Pn as getCompressionInfoEncoder,FR as getConfigActionCodec,Je as getConfigActionDecoder,qe as getConfigActionEncoder,Wk as getCreateCompressedWalletDiscriminatorBytes,Ok as getCreateCompressedWalletInstruction,_a as getCreateCompressedWalletInstructionAsync,Lk as getCreateCompressedWalletInstructionDataCodec,ba as getCreateCompressedWalletInstructionDataDecoder,bo as getCreateCompressedWalletInstructionDataEncoder,zk as getCreateDomainConfigDiscriminatorBytes,jk as getCreateDomainConfigInstruction,Ha as getCreateDomainConfigInstructionAsync,Kk as getCreateDomainConfigInstructionDataCodec,wa as getCreateDomainConfigInstructionDataDecoder,vo as getCreateDomainConfigInstructionDataEncoder,eW as getCreateDomainUserAccountDiscriminatorBytes,rW as getCreateDomainUserAccountInstruction,Ka as getCreateDomainUserAccountInstructionAsync,tW as getCreateDomainUserAccountInstructionDataCodec,za as getCreateDomainUserAccountInstructionDataDecoder,Uo as getCreateDomainUserAccountInstructionDataEncoder,dW as getCreateGlobalCounterDiscriminatorBytes,AW as getCreateGlobalCounterInstruction,Ya as getCreateGlobalCounterInstructionAsync,uW as getCreateGlobalCounterInstructionDataCodec,Ja as getCreateGlobalCounterInstructionDataDecoder,Wo as getCreateGlobalCounterInstructionDataEncoder,JR as getCreateUserAccountArgsCodec,Nn as getCreateUserAccountArgsDecoder,Bn as getCreateUserAccountArgsEncoder,SW as getCreateUserAccountsDiscriminatorBytes,IW as getCreateUserAccountsInstruction,$a as getCreateUserAccountsInstructionAsync,xW as getCreateUserAccountsInstructionDataCodec,Qa as getCreateUserAccountsInstructionDataDecoder,Oo as getCreateUserAccountsInstructionDataEncoder,bW as getDecompressSettingsAccountDiscriminatorBytes,si as getDecompressSettingsAccountInstruction,_W as getDecompressSettingsAccountInstructionDataCodec,oi as getDecompressSettingsAccountInstructionDataDecoder,ni as getDecompressSettingsAccountInstructionDataEncoder,BW as getDisableDomainConfigDiscriminatorBytes,Ai as getDisableDomainConfigInstruction,NW as getDisableDomainConfigInstructionDataCodec,ui as getDisableDomainConfigInstructionDataDecoder,di as getDisableDomainConfigInstructionDataEncoder,mt as getDomainConfigAddress,wh as getDomainConfigCodec,Es as getDomainConfigDecoder,Nh as getDomainConfigDiscriminatorBytes,Rg as getDomainConfigEncoder,Vh as getDomainConfigSize,jW as getEditDomainConfigDiscriminatorBytes,yi as getEditDomainConfigInstruction,JW as getEditDomainConfigInstructionAsync,qW as getEditDomainConfigInstructionDataCodec,Ti as getEditDomainConfigInstructionDataDecoder,No as getEditDomainConfigInstructionDataEncoder,QR as getEditMemberArgsCodec,Wn as getEditMemberArgsDecoder,kn as getEditMemberArgsEncoder,rL as getEditTransactionManagerUrlDiscriminatorBytes,Ei as getEditTransactionManagerUrlInstruction,nL as getEditTransactionManagerUrlInstructionDataCodec,Ci as getEditTransactionManagerUrlInstructionDataDecoder,Ii as getEditTransactionManagerUrlInstructionDataEncoder,AL as getEditUserDelegateDiscriminatorBytes,bi as getEditUserDelegateInstruction,gL as getEditUserDelegateInstructionDataCodec,Ri as getEditUserDelegateInstructionDataDecoder,hi as getEditUserDelegateInstructionDataEncoder,rb as getExpectedSignerCodec,Wt as getExpectedSignerDecoder,kt as getExpectedSignerEncoder,cb as getExtensionStructCodec,Ut as getExtensionStructDecoder,fn as getExtensionStructEncoder,_A as getGlobalCounterAddress,Kh as getGlobalCounterCodec,bs as getGlobalCounterDecoder,zh as getGlobalCounterDiscriminatorBytes,zg as getGlobalCounterEncoder,Jh as getGlobalCounterSize,Yo as getJitoTipsConfig,_8 as getLightCpiSigner,Fe as getLightProtocolRpc,gb as getLinkWalletArgsCodec,Zn as getLinkWalletArgsDecoder,Yn as getLinkWalletArgsEncoder,Tb as getMemberCodec,bt as getMemberDecoder,Rt as getMemberEncoder,Sb as getMemberKeyCodec,ie as getMemberKeyDecoder,V as getMemberKeyEncoder,tw as getMultiWalletErrorMessage,_L as getNativeTransferIntentCompressedDiscriminatorBytes,wi as getNativeTransferIntentCompressedInstruction,vL as getNativeTransferIntentCompressedInstructionDataCodec,Ni as getNativeTransferIntentCompressedInstructionDataDecoder,Bi as getNativeTransferIntentCompressedInstructionDataEncoder,xL as getNativeTransferIntentDiscriminatorBytes,ki as getNativeTransferIntentInstruction,CL as getNativeTransferIntentInstructionAsync,IL as getNativeTransferIntentInstructionDataCodec,Ui as getNativeTransferIntentInstructionDataDecoder,wo as getNativeTransferIntentInstructionDataEncoder,Eb as getNewAuthorityArgsCodec,eo as getNewAuthorityArgsDecoder,$n as getNewAuthorityArgsEncoder,T2 as getOriginIndex,Mb as getPackedAddressTreeInfoCodec,Nt as getPackedAddressTreeInfoDecoder,Bt as getPackedAddressTreeInfoEncoder,bb as getPackedMerkleContextCodec,xn as getPackedMerkleContextDecoder,Sn as getPackedMerkleContextEncoder,Ub as getPackedStateTreeInfoCodec,Dt as getPackedStateTreeInfoDecoder,Et as getPackedStateTreeInfoEncoder,Lb as getPausableAccountExtensionCodec,Hn as getPausableAccountExtensionDecoder,wn as getPausableAccountExtensionEncoder,Nb as getPermanentDelegateAccountExtensionCodec,Fn as getPermanentDelegateAccountExtensionDecoder,Vn as getPermanentDelegateAccountExtensionEncoder,Vb as getPermissionsCodec,ze as getPermissionsDecoder,Ge as getPermissionsEncoder,Kb as getProofArgsCodec,P as getProofArgsDecoder,D as getProofArgsEncoder,Yb as getRemoveMemberArgsCodec,On as getRemoveMemberArgsDecoder,Ln as getRemoveMemberArgsEncoder,Qb as getRentConfigCodec,_n as getRentConfigDecoder,bn as getRentConfigEncoder,Xo as getSecp256r1MessageHash,t_ as getSecp256r1PubkeyCodec,wt as getSecp256r1PubkeyDecoder,no as getSecp256r1PubkeyEncoder,mh as getSecp256r1SignatureOffsetsDataDecoder,ph as getSecp256r1SignatureOffsetsDataEncoder,o_ as getSecp256r1VerifyArgsCodec,G as getSecp256r1VerifyArgsDecoder,F as getSecp256r1VerifyArgsEncoder,i_ as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,so as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,oo as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,H as getSecp256r1VerifyInstruction,c5 as getSecp256r1VerifyInstructionDataCodec,VA as getSecp256r1VerifyInstructionDataDecoder,FA as getSecp256r1VerifyInstructionDataEncoder,zu as getSendAndConfirmTransaction,_U as getSettingsCodec,hr as getSettingsDecoder,bU as getSettingsDiscriminatorBytes,W1 as getSettingsEncoder,be as getSettingsFromIndex,m_ as getSettingsIndexWithAddressAndDelegateInfoCodec,uo as getSettingsIndexWithAddressAndDelegateInfoDecoder,io as getSettingsIndexWithAddressAndDelegateInfoEncoder,A_ as getSettingsIndexWithAddressCodec,ao as getSettingsIndexWithAddressDecoder,co as getSettingsIndexWithAddressEncoder,f_ as getSettingsMutArgsCodec,Z as getSettingsMutArgsDecoder,Y as getSettingsMutArgsEncoder,C_ as getSettingsReadonlyArgsCodec,Vt as getSettingsReadonlyArgsDecoder,Ht as getSettingsReadonlyArgsEncoder,u2 as getSignedSecp256r1Key,uH as getSignedTransactionManager,ee as getSolanaRpc,Gu as getSolanaRpcEndpoint,P_ as getSplInterfacePdaArgsCodec,Gt as getSplInterfacePdaArgsDecoder,Ft as getSplInterfacePdaArgsEncoder,b_ as getTokenMetadataCodec,zn as getTokenMetadataDecoder,Gn as getTokenMetadataEncoder,YL as getTokenTransferIntentCompressedDiscriminatorBytes,$i as getTokenTransferIntentCompressedInstruction,XL as getTokenTransferIntentCompressedInstructionAsync,ZL as getTokenTransferIntentCompressedInstructionDataCodec,Qi as getTokenTransferIntentCompressedInstructionDataDecoder,Go as getTokenTransferIntentCompressedInstructionDataEncoder,wL as getTokenTransferIntentDiscriminatorBytes,Ki as getTokenTransferIntentInstruction,VL as getTokenTransferIntentInstructionAsync,HL as getTokenTransferIntentInstructionDataCodec,zi as getTokenTransferIntentInstructionDataDecoder,Fo as getTokenTransferIntentInstructionDataEncoder,vA as getTransactionBufferAddress,mO as getTransactionBufferCloseCompressedDiscriminatorBytes,Ad as getTransactionBufferCloseCompressedInstruction,lO as getTransactionBufferCloseCompressedInstructionDataCodec,ud as getTransactionBufferCloseCompressedInstructionDataDecoder,dd as getTransactionBufferCloseCompressedInstructionDataEncoder,sO as getTransactionBufferCloseDiscriminatorBytes,sd as getTransactionBufferCloseInstruction,cO as getTransactionBufferCloseInstructionDataCodec,od as getTransactionBufferCloseInstructionDataDecoder,nd as getTransactionBufferCloseInstructionDataEncoder,BU as getTransactionBufferCodec,k_ as getTransactionBufferCreateArgsCodec,Kt as getTransactionBufferCreateArgsDecoder,zt as getTransactionBufferCreateArgsEncoder,UO as getTransactionBufferCreateCompressedDiscriminatorBytes,Ed as getTransactionBufferCreateCompressedInstruction,kO as getTransactionBufferCreateCompressedInstructionDataCodec,Cd as getTransactionBufferCreateCompressedInstructionDataDecoder,Id as getTransactionBufferCreateCompressedInstructionDataEncoder,EO as getTransactionBufferCreateDiscriminatorBytes,yd as getTransactionBufferCreateInstruction,DO as getTransactionBufferCreateInstructionDataCodec,Td as getTransactionBufferCreateInstructionDataDecoder,ld as getTransactionBufferCreateInstructionDataEncoder,Zc as getTransactionBufferDecoder,OU as getTransactionBufferDiscriminatorBytes,$1 as getTransactionBufferEncoder,ZO as getTransactionBufferExecuteCompressedDiscriminatorBytes,Ld as getTransactionBufferExecuteCompressedInstruction,XO as getTransactionBufferExecuteCompressedInstructionDataCodec,Wd as getTransactionBufferExecuteCompressedInstructionDataDecoder,kd as getTransactionBufferExecuteCompressedInstructionDataEncoder,VO as getTransactionBufferExecuteDiscriminatorBytes,bd as getTransactionBufferExecuteInstruction,FO as getTransactionBufferExecuteInstructionDataCodec,Rd as getTransactionBufferExecuteInstructionDataDecoder,hd as getTransactionBufferExecuteInstructionDataEncoder,gB as getTransactionBufferExtendCompressedDiscriminatorBytes,qd as getTransactionBufferExtendCompressedInstruction,pB as getTransactionBufferExtendCompressedInstructionDataCodec,jd as getTransactionBufferExtendCompressedInstructionDataDecoder,Kd as getTransactionBufferExtendCompressedInstructionDataEncoder,oB as getTransactionBufferExtendDiscriminatorBytes,Vd as getTransactionBufferExtendInstruction,sB as getTransactionBufferExtendInstructionDataCodec,Hd as getTransactionBufferExtendInstructionDataDecoder,wd as getTransactionBufferExtendInstructionDataEncoder,_B as getTransactionBufferVoteCompressedDiscriminatorBytes,su as getTransactionBufferVoteCompressedInstruction,vB as getTransactionBufferVoteCompressedInstructionDataCodec,ou as getTransactionBufferVoteCompressedInstructionDataDecoder,nu as getTransactionBufferVoteCompressedInstructionDataEncoder,IB as getTransactionBufferVoteDiscriminatorBytes,$d as getTransactionBufferVoteInstruction,CB as getTransactionBufferVoteInstructionDataCodec,Qd as getTransactionBufferVoteInstructionDataDecoder,Xd as getTransactionBufferVoteInstructionDataEncoder,jB as getTransactionExecuteCompressedDiscriminatorBytes,yu as getTransactionExecuteCompressedInstruction,qB as getTransactionExecuteCompressedInstructionDataCodec,Tu as getTransactionExecuteCompressedInstructionDataDecoder,lu as getTransactionExecuteCompressedInstructionDataEncoder,NB as getTransactionExecuteDiscriminatorBytes,Au as getTransactionExecuteInstruction,wB as getTransactionExecuteInstructionDataCodec,uu as getTransactionExecuteInstructionDataDecoder,du as getTransactionExecuteInstructionDataEncoder,uN as getTransactionExecuteSyncCompressedDiscriminatorBytes,bu as getTransactionExecuteSyncCompressedInstruction,AN as getTransactionExecuteSyncCompressedInstructionDataCodec,Ru as getTransactionExecuteSyncCompressedInstructionDataDecoder,hu as getTransactionExecuteSyncCompressedInstructionDataEncoder,tN as getTransactionExecuteSyncDiscriminatorBytes,Eu as getTransactionExecuteSyncInstruction,rN as getTransactionExecuteSyncInstructionDataCodec,Cu as getTransactionExecuteSyncInstructionDataDecoder,Iu as getTransactionExecuteSyncInstructionDataEncoder,H_ as getTransactionMessageAddressTableLookupCodec,fo as getTransactionMessageAddressTableLookupDecoder,yo as getTransactionMessageAddressTableLookupEncoder,B_ as getTransactionMessageCodec,qt as getTransactionMessageDecoder,jt as getTransactionMessageEncoder,z_ as getTransactionSyncSignersCodec,$ as getTransactionSyncSignersDecoder,Q as getTransactionSyncSignersEncoder,Y_ as getTransferFeeAccountExtensionCodec,jn as getTransferFeeAccountExtensionDecoder,Kn as getTransferFeeAccountExtensionEncoder,Q_ as getTransferHookAccountExtensionCodec,Jn as getTransferHookAccountExtensionDecoder,qn as getTransferHookAccountExtensionEncoder,tv as getTransportsCodec,Yt as getTransportsDecoder,Jt as getTransportsEncoder,w as getUserAccountAddress,sv as getUserCodec,dv as getUserCreationArgsCodec,Ue as getUserCreationArgsDecoder,ve as getUserCreationArgsEncoder,ne as getUserDecoder,Zt as getUserEncoder,pv as getUserMutArgsCodec,rt as getUserMutArgsDecoder,tt as getUserMutArgsEncoder,yv as getUserReadOnlyArgsCodec,Ot as getUserReadOnlyArgsDecoder,Lt as getUserReadOnlyArgsEncoder,Iv as getUserReadOnlyOrMutateArgsCodec,je as getUserReadOnlyOrMutateArgsDecoder,Ke as getUserReadOnlyOrMutateArgsEncoder,Mv as getUserRoleCodec,Ze as getUserRoleDecoder,Ye as getUserRoleEncoder,b8 as getWalletAddressFromIndex,Le as getWalletAddressFromSettings,FU as getWhitelistedAddressTreeCodec,ra as getWhitelistedAddressTreeDecoder,VU as getWhitelistedAddressTreeDiscriminatorBytes,xf as getWhitelistedAddressTreeEncoder,os as getWhitelistedAddressTreeFromIndex,y8 as getWhitelistedAddressTreeIndexFromAddress,xA as getWhitelistedAddressTreesAddress,JN as identifyMultiWalletAccount,YN as identifyMultiWalletInstruction,qw as initialize,zR as isConfigAction,ib as isExtensionStruct,rw as isMultiWalletError,j_ as isTransactionSyncSigners,Ev as isUserReadOnlyOrMutateArgs,v5 as nativeTransferIntent,dk as parseAddWhitelistedAddressTreesInstruction,hk as parseChangeConfigCompressedInstruction,fk as parseChangeConfigInstruction,Bk as parseCreateCompressedWalletInstruction,qk as parseCreateDomainConfigInstruction,nW as parseCreateDomainUserAccountInstruction,gW as parseCreateGlobalCounterInstruction,CW as parseCreateUserAccountsInstruction,vW as parseDecompressSettingsAccountInstruction,wW as parseDisableDomainConfigInstruction,YW as parseEditDomainConfigInstruction,oL as parseEditTransactionManagerUrlInstruction,pL as parseEditUserDelegateInstruction,UL as parseNativeTransferIntentCompressedInstruction,EL as parseNativeTransferIntentInstruction,a5 as parseSecp256r1VerifyInstruction,QL as parseTokenTransferIntentCompressedInstruction,FL as parseTokenTransferIntentInstruction,TO as parseTransactionBufferCloseCompressedInstruction,aO as parseTransactionBufferCloseInstruction,WO as parseTransactionBufferCreateCompressedInstruction,PO as parseTransactionBufferCreateInstruction,QO as parseTransactionBufferExecuteCompressedInstruction,GO as parseTransactionBufferExecuteInstruction,mB as parseTransactionBufferExtendCompressedInstruction,cB as parseTransactionBufferExtendInstruction,UB as parseTransactionBufferVoteCompressedInstruction,EB as parseTransactionBufferVoteInstruction,JB as parseTransactionExecuteCompressedInstruction,HB as parseTransactionExecuteInstruction,gN as parseTransactionExecuteSyncCompressedInstruction,nN as parseTransactionExecuteSyncInstruction,V8 as pollJitoBundleConfirmation,XV as prepareChangeConfigArgs,sF as prepareTransactionBundle,fF as prepareTransactionMessage,EF as prepareTransactionSync,dH as retrieveTransactionManager,BM as sendJitoBundle,AH as serializeConfigActions,H8 as signAndSendBundledTransactions,J8 as signAndSendTransaction,z5 as tokenTransferIntent,K_ as transactionSyncSigners,Cv as userReadOnlyOrMutateArgs,Fu as vaultTransactionMessageDeserialize,Vu as vaultTransactionMessageSerialize,ng as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|