@revibase/core 0.0.60 → 0.1.0
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/README.md +35 -18
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -477
- package/dist/index.d.ts +42 -477
- package/dist/index.js +3 -3
- 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 p 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 ds=new Uint8Array([201,232,212,229,59,241,106,197]);function xM(){return fixEncoderSize(getBytesEncoder(),8).encode(ds)}function og(){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:ds}))}function us(){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 IM(){return combineCodec(og(),us())}function As(e){return decodeAccount(e,us())}async function gs(e,n,r){let o=await sg(e,n,r);return assertAccountExists(o),o}async function sg(e,n,r){let o=await fetchEncodedAccount(e,n,r);return As(o)}async function CM(e,n,r){let o=await cg(e,n,r);return assertAccountsExist(o),o}async function cg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>As(t))}function EM(){return 846}var ls=new Uint8Array([42,206,176,58,175,129,130,233]);function hM(){return fixEncoderSize(getBytesEncoder(),8).encode(ls)}function xg(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:ls}))}function Ts(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function MM(){return combineCodec(xg(),Ts())}function ys(e){return decodeAccount(e,Ts())}async function RM(e,n,r){let o=await Ig(e,n,r);return assertAccountExists(o),o}async function Ig(e,n,r){let o=await fetchEncodedAccount(e,n,r);return ys(o)}async function bM(e,n,r){let o=await Cg(e,n,r);return assertAccountsExist(o),o}async function Cg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ys(t))}function _M(){return 24}function Jr(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Yr(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function kM(){return combineCodec(Jr(),Yr())}function Zr(){return getStructEncoder([["memberKey",H()],["permissions",Ne()],["userArgs",He()]])}function Xr(){return getStructDecoder([["memberKey",$()],["permissions",we()],["userArgs",Ve()]])}function BM(){return combineCodec(Zr(),Xr())}function Qr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function $r(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function HM(){return combineCodec(Qr(),$r())}function Tt(){return getStructEncoder([["treeInfo",ft()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function yt(){return getStructDecoder([["treeInfo",St()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function zM(){return combineCodec(Tt(),yt())}function xt(){return getStructEncoder([["treeInfo",ft()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function It(){return getStructDecoder([["treeInfo",St()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function JM(){return combineCodec(xt(),It())}function en(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function tn(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function XM(){return combineCodec(en(),tn())}function cn(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function an(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function eR(){return combineCodec(cn(),an())}function Ct(){return getStructEncoder([["data",getOptionEncoder(dn())]])}function j(){return getStructDecoder([["data",getOptionDecoder(un())]])}function oR(){return combineCodec(Ct(),j())}function dn(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(Et())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function un(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(Dt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function iR(){return combineCodec(dn(),un())}function Pt(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",gn()],["tlv",getOptionEncoder(getArrayEncoder(An()))],["hasDelegate",getBooleanEncoder()],["isFrozen",getBooleanEncoder()]])}function ht(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",pn()],["tlv",getOptionDecoder(getArrayDecoder(Mt()))],["hasDelegate",getBooleanDecoder()],["isFrozen",getBooleanDecoder()]])}function gR(){return combineCodec(Pt(),ht())}function Tn(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",fn()]])}function yn(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",Sn()]])}function TR(){return combineCodec(Tn(),yn())}function fn(){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",Cn()]])}function Sn(){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",En()]])}function xR(){return combineCodec(fn(),Sn())}function Fe(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(hn())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Zr())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Rn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Ge(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Mn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Xr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(bn())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function DR(){return combineCodec(Fe(),Ge())}function PR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function hR(e,n){return n.__kind===e}function _n(){return getStructEncoder([["member",getAddressEncoder()],["role",ze()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Pe()]])}function vn(){return getStructDecoder([["member",getAddressDecoder()],["role",Ke()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",he()]])}function _R(){return combineCodec(_n(),vn())}function hn(){return getStructEncoder([["memberKey",H()],["permissions",Ne()]])}function Mn(){return getStructDecoder([["memberKey",$()],["permissions",we()]])}function WR(){return combineCodec(hn(),Mn())}function Rt(){return getStructEncoder([["memberKey",H()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function bt(){return getStructDecoder([["memberKey",$()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function NR(){return combineCodec(Rt(),bt())}function An(){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([On()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([Un()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([Wn()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([Nn()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([Hn()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([en()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([Tn()])]])]])}function Mt(){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([Bn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([kn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([Ln()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([wn()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([Vn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([tn()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([yn()])]])]])}function FR(){return combineCodec(An(),Mt())}function GR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function zR(e,n){return n.__kind===e}function Fn(){return getStructEncoder([["settingsMutArgs",z()],["transactionManager",getOptionEncoder(_t())]])}function Gn(){return getStructDecoder([["settingsMutArgs",K()],["transactionManager",getOptionDecoder(vt())]])}function JR(){return combineCodec(Fn(),Gn())}function Et(){return getStructEncoder([["pubkey",H()],["role",getU8Encoder()],["permissions",Ne()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function Dt(){return getStructDecoder([["pubkey",$()],["role",getU8Decoder()],["permissions",we()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function QR(){return combineCodec(Et(),Dt())}function H(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function $(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function tb(){return combineCodec(H(),$())}function jn(){return getStructEncoder([["authorityCreationArgs",Pe()],["compressedProofArgs",E()]])}function qn(){return getStructDecoder([["authorityCreationArgs",he()],["compressedProofArgs",D()]])}function sb(){return combineCodec(jn(),qn())}function Ut(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function kt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function ib(){return combineCodec(Ut(),kt())}function gn(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function pn(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function Ab(){return combineCodec(gn(),pn())}function ft(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function St(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function mb(){return combineCodec(ft(),St())}function Un(){return getStructEncoder([])}function kn(){return getStructDecoder([])}function yb(){return combineCodec(Un(),kn())}function Wn(){return getStructEncoder([])}function Ln(){return getStructDecoder([])}function xb(){return combineCodec(Wn(),Ln())}function Ne(){return getStructEncoder([["mask",getU8Encoder()]])}function we(){return getStructDecoder([["mask",getU8Decoder()]])}function Eb(){return combineCodec(Ne(),we())}function E(){return getStructEncoder([["proof",getOptionEncoder(cn())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function D(){return getStructDecoder([["proof",getOptionDecoder(an())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function Mb(){return combineCodec(E(),D())}function Rn(){return getStructEncoder([["memberKey",H()],["userArgs",He()]])}function bn(){return getStructDecoder([["memberKey",$()],["userArgs",Ve()]])}function vb(){return combineCodec(Rn(),bn())}function Cn(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function En(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function Wb(){return combineCodec(Cn(),En())}function Zn(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Wt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function Bb(){return combineCodec(Zn(),Wt())}function V(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function F(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function Hb(){return combineCodec(V(),F())}function Xn(){return getStructEncoder([["verifyArgs",V()],["domainConfigIndex",getU8Encoder()]])}function Qn(){return getStructDecoder([["verifyArgs",F()],["domainConfigIndex",getU8Decoder()]])}function zb(){return combineCodec(Xn(),Qn())}function $n(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function eo(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function qb(){return combineCodec($n(),eo())}function to(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function ro(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function Zb(){return combineCodec(to(),ro())}function z(){return getStructEncoder([["accountMeta",Tt()],["data",Ct()]])}function K(){return getStructDecoder([["accountMeta",yt()],["data",j()]])}function e_(){return combineCodec(z(),K())}function Lt(){return getStructEncoder([["accountMeta",xt()],["data",Ct()]])}function Ot(){return getStructDecoder([["accountMeta",It()],["data",j()]])}function o_(){return combineCodec(Lt(),Ot())}function Bt(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function Nt(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function a_(){return combineCodec(Bt(),Nt())}function On(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(Jr())]])}function Bn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(Yr())]])}function A_(){return combineCodec(On(),Bn())}function wt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(Rt())]])}function Ht(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(bt())]])}function l_(){return combineCodec(wt(),Ht())}function Vt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(Qr())],["addressTableLookups",getArrayEncoder(uo())]])}function Ft(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder($r())],["addressTableLookups",getArrayDecoder(Ao())]])}function S_(){return combineCodec(Vt(),Ft())}function uo(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Ao(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function C_(){return combineCodec(uo(),Ao())}function q(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([Xn()])]])]])}function J(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([Qn()])]])]])}function h_(){return combineCodec(q(),J())}function M_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function R_(e,n){return n.__kind===e}function Nn(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function wn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function v_(){return combineCodec(Nn(),wn())}function Hn(){return getStructEncoder([["transferring",getU8Encoder()]])}function Vn(){return getStructDecoder([["transferring",getU8Decoder()]])}function W_(){return combineCodec(Hn(),Vn())}var go=(i=>(i[i.Ble=0]="Ble",i[i.Cable=1]="Cable",i[i.Hybrid=2]="Hybrid",i[i.Internal=3]="Internal",i[i.Nfc=4]="Nfc",i[i.SmartCard=5]="SmartCard",i[i.Usb=6]="Usb",i))(go||{});function Gt(){return getEnumEncoder(go)}function zt(){return getEnumDecoder(go)}function B_(){return combineCodec(Gt(),zt())}function Kt(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",H()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(Gt()))],["wallets",getArrayEncoder(to())],["role",ze()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function X(){return getStructDecoder([["domainConfig",getOptionDecoder(getAddressDecoder())],["member",$()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(zt()))],["wallets",getArrayDecoder(ro())],["role",Ke()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function V_(){return combineCodec(Kt(),X())}function Pe(){return getStructEncoder([["addressTreeInfo",Ut()],["outputStateTreeIndex",getU8Encoder()]])}function he(){return getStructDecoder([["addressTreeInfo",kt()],["outputStateTreeIndex",getU8Decoder()]])}function K_(){return combineCodec(Pe(),he())}function Ze(){return getStructEncoder([["accountMeta",Tt()],["data",Kt()]])}function Xe(){return getStructDecoder([["accountMeta",yt()],["data",X()]])}function Y_(){return combineCodec(Ze(),Xe())}function _t(){return getStructEncoder([["accountMeta",xt()],["data",Kt()]])}function vt(){return getStructDecoder([["accountMeta",It()],["data",X()]])}function $_(){return combineCodec(_t(),vt())}function He(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([_t()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([Ze()])]])]])}function Ve(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([vt()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([Xe()])]])]])}function nv(){return combineCodec(He(),Ve())}function ov(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function sv(e,n){return n.__kind===e}var _e=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(_e||{});function ze(){return getEnumEncoder(_e)}function Ke(){return getEnumDecoder(_e)}function iv(){return combineCodec(ze(),Ke())}var _c=new Uint8Array([223,179,163,190,177,224,67,173]);function AU(){return fixEncoderSize(getBytesEncoder(),8).encode(_c)}function u1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(Et())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:_c}))}function Ir(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(Dt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function gU(){return combineCodec(u1(),Ir())}function vc(e){return decodeAccount(e,Ir())}async function pU(e,n,r){let o=await po(e,n,r);return assertAccountExists(o),o}async function po(e,n,r){let o=await fetchEncodedAccount(e,n,r);return vc(o)}async function mU(e,n,r){let o=await A1(e,n,r);return assertAccountsExist(o),o}async function A1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>vc(t))}var Oc=new Uint8Array([90,36,35,219,93,225,110,96]);function fU(){return fixEncoderSize(getBytesEncoder(),8).encode(Oc)}function b1(){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",H()],["executor",H()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(H())],["expectedSigners",getArrayEncoder(Rt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Oc}))}function Bc(){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",$()],["executor",$()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder($())],["expectedSigners",getArrayDecoder(bt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function SU(){return combineCodec(b1(),Bc())}function Nc(e){return decodeAccount(e,Bc())}async function wc(e,n,r){let o=await _1(e,n,r);return assertAccountExists(o),o}async function _1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Nc(o)}async function xU(e,n,r){let o=await v1(e,n,r);return assertAccountsExist(o),o}async function v1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Nc(t))}var Fc=new Uint8Array([105,23,173,2,197,255,80,87]);function EU(){return fixEncoderSize(getBytesEncoder(),8).encode(Fc)}function Y1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Fc}))}function Gc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function DU(){return combineCodec(Y1(),Gc())}function zc(e){return decodeAccount(e,Gc())}async function Kc(e,n,r){let o=await Z1(e,n,r);return assertAccountExists(o),o}async function Z1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return zc(o)}async function PU(e,n,r){let o=await X1(e,n,r);return assertAccountsExist(o),o}async function X1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>zc(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:jc(r.value)?upgradeRoleToSigner(o):o,...jc(r.value)?{signer:r.value}:{}})}}function jc(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Jc=new Uint8Array([8]);function FU(){return fixEncoderSize(getBytesEncoder(),1).encode(Jc)}function Io(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Jc}))}function Yc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function GU(){return combineCodec(Io(),Yc())}async function Zc(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...i],data:Io().encode(c),programAddress:r})}function zU(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...i],data:Io().encode(c),programAddress:r})}function KU(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:Yc().decode(e.data)}}var ta=new Uint8Array([9]);function QU(){return fixEncoderSize(getBytesEncoder(),1).encode(ta)}function ra(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(Fe())],["signers",getArrayEncoder(q())],["compressedProofArgs",getOptionEncoder(E())]]),e=>({...e,discriminator:ta}))}function na(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Ge())],["signers",getArrayDecoder(J())],["compressedProofArgs",getOptionDecoder(D())]])}function $U(){return combineCodec(ra(),na())}function oa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...i],data:ra().encode(c),programAddress:r})}function ek(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:na().decode(e.data)}}var da=new Uint8Array([19]);function ak(){return fixEncoderSize(getBytesEncoder(),1).encode(da)}function ua(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(Fe())],["signers",getArrayEncoder(q())],["settingsMutArgs",z()],["compressedProofArgs",E()]]),e=>({...e,discriminator:da}))}function Aa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Ge())],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",D()]])}function ik(){return combineCodec(ua(),Aa())}function ga(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...i],data:ua().encode(c),programAddress:r})}function dk(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:Aa().decode(e.data)}}var la=new Uint8Array([18]);function Tk(){return fixEncoderSize(getBytesEncoder(),1).encode(la)}function Co(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",E()],["addressTreeInfo",Ut()],["outputStateTreeIndex",getU8Encoder()],["userArgs",He()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:la}))}function Ta(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["addressTreeInfo",kt()],["outputStateTreeIndex",getU8Decoder()],["userArgs",Ve()],["settingsIndex",getU128Decoder()]])}function yk(){return combineCodec(Co(),Ta())}async function ya(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...i],data:Co().encode(c),programAddress:r})}function fk(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...i],data:Co().encode(c),programAddress:r})}function Sk(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:Ta().decode(e.data)}}var Pa=new Uint8Array([0]);function hk(){return fixEncoderSize(getBytesEncoder(),1).encode(Pa)}function Do(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",Pe()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Pa}))}function ha(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",he()],["compressedProofArgs",D()]])}function Mk(){return combineCodec(Do(),ha())}async function Ma(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...i],data:Do().encode(c),programAddress:r})}function Rk(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...i],data:Do().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:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:ha().decode(e.data)}}var _a=new Uint8Array([4]);function Ok(){return fixEncoderSize(getBytesEncoder(),1).encode(_a)}function Po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",E()],["member",Zn()],["role",ze()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(Gt())],["userAccountCreationArgs",Pe()],["linkWalletArgs",getOptionEncoder(Fn())]]),e=>({...e,discriminator:_a}))}function va(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["member",Wt()],["role",Ke()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(zt())],["userAccountCreationArgs",he()],["linkWalletArgs",getOptionDecoder(Gn())]])}function Bk(){return combineCodec(Po(),va())}async function Ua(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...i],data:Po().encode(c),programAddress:r})}function Nk(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=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...i],data:Po().encode(c),programAddress:r})}function wk(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:va().decode(e.data)}}var Wa=new Uint8Array([3]);function Kk(){return fixEncoderSize(getBytesEncoder(),1).encode(Wa)}function Mo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Wa}))}function La(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function jk(){return combineCodec(Mo(),La())}async function Oa(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(c),i=T(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Mo().encode({}),programAddress:r})}function qk(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(c),i=T(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Mo().encode({}),programAddress:r})}function Jk(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:La().decode(e.data)}}var Na=new Uint8Array([5]);function tW(){return fixEncoderSize(getBytesEncoder(),1).encode(Na)}function bo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",E()],["createUserArgs",getArrayEncoder(_n())]]),e=>({...e,discriminator:Na}))}function wa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["createUserArgs",getArrayDecoder(vn())]])}function rW(){return combineCodec(bo(),wa())}async function Ha(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...i],data:bo().encode(c),programAddress:r})}function nW(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...i],data:bo().encode(c),programAddress:r})}function oW(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:wa().decode(e.data)}}var Ga=new Uint8Array([17]);function AW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ga)}function za(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",z()],["compressedProofArgs",E()],["signers",getArrayEncoder(q())]]),e=>({...e,discriminator:Ga}))}function Ka(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",K()],["compressedProofArgs",D()],["signers",getArrayDecoder(J())]])}function gW(){return combineCodec(za(),Ka())}function ja(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...i],data:za().encode(c),programAddress:r})}function pW(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},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:Ka().decode(e.data)}}var Ya=new Uint8Array([2]);function SW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ya)}function Za(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:Ya}))}function Xa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function xW(){return combineCodec(Za(),Xa())}function Qa(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.admin),...i],data:Za().encode(c),programAddress:r})}function IW(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:Xa().decode(e.data)}}var ri=new Uint8Array([1]);function RW(){return fixEncoderSize(getBytesEncoder(),1).encode(ri)}function vo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(jn())]]),e=>({...e,discriminator:ri}))}function ni(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(qn())]])}function bW(){return combineCodec(vo(),ni())}async function _W(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...i],data:vo().encode(c),programAddress:r})}function oi(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...i],data:vo().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:{domainConfig:r(),authority:r(),newAuthority:o(),whitelistedAddressTrees:o(),systemProgram:r()},data:ni().decode(e.data)}}var ai=new Uint8Array([6]);function NW(){return fixEncoderSize(getBytesEncoder(),1).encode(ai)}function ii(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Ze()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",E()]]),e=>({...e,discriminator:ai}))}function di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Xe()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",D()]])}function wW(){return combineCodec(ii(),di())}function ui(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.authority),...i],data:ii().encode(c),programAddress:r})}function HW(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:di().decode(e.data)}}var pi=new Uint8Array([7]);function qW(){return fixEncoderSize(getBytesEncoder(),1).encode(pi)}function mi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Ze()],["secp256r1VerifyArgs",getOptionEncoder(V())],["delegateTo",getOptionEncoder($n())],["oldSettingsMutArgs",getOptionEncoder(z())],["newSettingsMutArgs",getOptionEncoder(z())],["compressedProofArgs",E()]]),e=>({...e,discriminator:pi}))}function li(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Xe()],["secp256r1VerifyArgs",getOptionDecoder(F())],["delegateTo",getOptionDecoder(eo())],["oldSettingsMutArgs",getOptionDecoder(K())],["newSettingsMutArgs",getOptionDecoder(K())],["compressedProofArgs",D()]])}function JW(){return combineCodec(mi(),li())}function Ti(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=l(a),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),...i],data:mi().encode(c),programAddress:r})}function YW(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:li().decode(e.data)}}var fi=new Uint8Array([29]);function rL(){return fixEncoderSize(getBytesEncoder(),1).encode(fi)}function Uo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(q())]]),e=>({...e,discriminator:fi}))}function Si(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())]])}function nL(){return combineCodec(Uo(),Si())}async function oL(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(O(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(a),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),...i],data:Uo().encode(c),programAddress:r})}function xi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(a),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),...i],data:Uo().encode(c),programAddress:r})}function sL(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:Si().decode(e.data)}}var Ei=new Uint8Array([27]);function gL(){return fixEncoderSize(getBytesEncoder(),1).encode(Ei)}function Di(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(q())],["settingsMutArgs",z()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ei}))}function Pi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",D()]])}function pL(){return combineCodec(Di(),Pi())}function hi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(a),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),...i],data:Di().encode(c),programAddress:r})}function mL(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:Pi().decode(e.data)}}var _i=new Uint8Array([30]);function IL(){return fixEncoderSize(getBytesEncoder(),1).encode(_i)}function Lo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Bt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(Pt()))],["compressedProofArgs",getOptionEncoder(E())],["signers",getArrayEncoder(q())]]),e=>({...e,discriminator:_i}))}function vi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Nt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(ht()))],["compressedProofArgs",getOptionDecoder(D())],["signers",getArrayDecoder(J())]])}function CL(){return combineCodec(Lo(),vi())}async function EL(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(O(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=l(a),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),...i],data:Lo().encode(c),programAddress:r})}function Ui(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=l(a),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),...i],data:Lo().encode(c),programAddress:r})}function DL(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:vi().decode(e.data)}}var Ni=new Uint8Array([28]);function vL(){return fixEncoderSize(getBytesEncoder(),1).encode(Ni)}function Oo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Bt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(Pt()))],["signers",getArrayEncoder(q())],["settingsMutArgs",z()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ni}))}function wi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Nt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(ht()))],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",D()]])}function UL(){return combineCodec(Oo(),wi())}async function kL(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=l(a),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),...i],data:Oo().encode(c),programAddress:r})}function Hi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=l(a),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),...i],data:Oo().encode(c),programAddress:r})}function WL(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:wi().decode(e.data)}}var Gi=new Uint8Array([13]);function VL(){return fixEncoderSize(getBytesEncoder(),1).encode(Gi)}function zi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:Gi}))}function Ki(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function FL(){return combineCodec(zi(),Ki())}function ji(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=l(a),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),...i],data:zi().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:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:Ki().decode(e.data)}}var Yi=new Uint8Array([23]);function ZL(){return fixEncoderSize(getBytesEncoder(),1).encode(Yi)}function Zi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsMutArgs",z()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Yi}))}function Xi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())],["settingsMutArgs",K()],["compressedProofArgs",D()]])}function XL(){return combineCodec(Zi(),Xi())}function Qi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=l(a),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),...i],data:Zi().encode(c),programAddress:r})}function QL(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:Xi().decode(e.data)}}var td=new Uint8Array([10]);function sO(){return fixEncoderSize(getBytesEncoder(),1).encode(td)}function rd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",wt()],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:td}))}function nd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Ht()],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function cO(){return combineCodec(rd(),nd())}function od(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=l(a),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),...i],data:rd().encode(c),programAddress:r})}function aO(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:nd().decode(e.data)}}var ad=new Uint8Array([20]);function mO(){return fixEncoderSize(getBytesEncoder(),1).encode(ad)}function id(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",wt()],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsReadonlyArgs",Lt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:ad}))}function dd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Ht()],["secp256r1VerifyArgs",getOptionDecoder(F())],["settingsReadonlyArgs",Ot()],["compressedProofArgs",D()]])}function lO(){return combineCodec(id(),dd())}function ud(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=l(a),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),...i],data:id().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(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:dd().decode(e.data)}}var pd=new Uint8Array([14]);function EO(){return fixEncoderSize(getBytesEncoder(),1).encode(pd)}function md(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:pd}))}function ld(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function DO(){return combineCodec(md(),ld())}function Td(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=l(a),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),...i],data:md().encode(c),programAddress:r})}function PO(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:ld().decode(e.data)}}var Sd=new Uint8Array([24]);function UO(){return fixEncoderSize(getBytesEncoder(),1).encode(Sd)}function xd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsMutArgs",z()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Sd}))}function Id(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())],["settingsMutArgs",K()],["compressedProofArgs",D()]])}function kO(){return combineCodec(xd(),Id())}function Cd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=l(a),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),...i],data:xd().encode(c),programAddress:r})}function WO(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:Id().decode(e.data)}}var Pd=new Uint8Array([12]);function HO(){return fixEncoderSize(getBytesEncoder(),1).encode(Pd)}function hd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Pd}))}function Md(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function VO(){return combineCodec(hd(),Md())}function Rd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.transactionBuffer),...i],data:hd().encode(c),programAddress:r})}function FO(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:Md().decode(e.data)}}var vd=new Uint8Array([22]);function JO(){return fixEncoderSize(getBytesEncoder(),1).encode(vd)}function Ud(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:vd}))}function kd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function YO(){return combineCodec(Ud(),kd())}function Wd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.transactionBuffer),...i],data:Ud().encode(c),programAddress:r})}function ZO(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:kd().decode(e.data)}}var Bd=new Uint8Array([11]);function nB(){return fixEncoderSize(getBytesEncoder(),1).encode(Bd)}function Nd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:Bd}))}function wd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function oB(){return combineCodec(Nd(),wd())}function Hd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=l(a),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),...i],data:Nd().encode(c),programAddress:r})}function sB(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:wd().decode(e.data)}}var Gd=new Uint8Array([21]);function gB(){return fixEncoderSize(getBytesEncoder(),1).encode(Gd)}function zd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsReadonlyArgs",Lt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Gd}))}function Kd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())],["settingsReadonlyArgs",Ot()],["compressedProofArgs",D()]])}function pB(){return combineCodec(zd(),Kd())}function jd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=l(a),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),...i],data:zd().encode(c),programAddress:r})}function mB(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:Kd().decode(e.data)}}var Yd=new Uint8Array([15]);function xB(){return fixEncoderSize(getBytesEncoder(),1).encode(Yd)}function Zd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Yd}))}function Xd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function IB(){return combineCodec(Zd(),Xd())}function Qd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=l({}),i=T(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:Zd().encode({}),programAddress:r})}function CB(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:Xd().decode(e.data)}}var tu=new Uint8Array([25]);function RB(){return fixEncoderSize(getBytesEncoder(),1).encode(tu)}function ru(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:tu}))}function nu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function bB(){return combineCodec(ru(),nu())}function ou(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.transactionBuffer),...i],data:ru().encode(c),programAddress:r})}function _B(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:nu().decode(e.data)}}var au=new Uint8Array([16]);function BB(){return fixEncoderSize(getBytesEncoder(),1).encode(au)}function iu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Vt()],["signers",getArrayEncoder(q())]]),e=>({...e,discriminator:au}))}function du(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Ft()],["signers",getArrayDecoder(J())]])}function NB(){return combineCodec(iu(),du())}function uu(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),...i],data:iu().encode(c),programAddress:r})}function wB(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:du().decode(e.data)}}var pu=new Uint8Array([26]);function jB(){return fixEncoderSize(getBytesEncoder(),1).encode(pu)}function mu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Vt()],["signers",getArrayEncoder(q())],["settingsMutArgs",z()],["compressedProofArgs",E()]]),e=>({...e,discriminator:pu}))}function lu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Ft()],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",D()]])}function qB(){return combineCodec(mu(),lu())}function Tu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=l(a),s=T(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...i],data:mu().encode(c),programAddress:r})}function JB(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:lu().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",oE=(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))(oE||{});function _N(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 sE=(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))(sE||{});function vN(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 aE=6e3,iE=6001,dE=6002,uE=6003,AE=6004,gE=6005,pE=6006,mE=6007,lE=6008,TE=6009,yE=6010,fE=6011,SE=6012,xE=6013,IE=6014,CE=6015,EE=6016,DE=6017,PE=6018,hE=6019,ME=6020,RE=6021,bE=6022,_E=6023,vE=6024,UE=6025,kE=6026,WE=6027,LE=6028,OE=6029,BE=6030,NE=6031,wE=6032,HE=6033,VE=6034,FE=6035,GE=6036,zE=6037,KE=6038,jE=6039,qE=6040,JE=6041,YE=6042,ZE=6043,XE=6044,QE=6045,$E=6046,eD=6047,tD=6048,rD=6049,nD=6050,oD=6051,sD=6052,cD=6053,aD=6054,iD=6055,dD=6056,uD=6057,AD=6058,gD=6059,pD=6060,mD=6061,lD=6062,TD=6063,yD=6064,fD=6065,SD=6066,xD=6067,ID=6068,CD=6069,ED=6070,DD=6071,PD=6072,hD=6073,MD=6074,RD=6075,bD=6076,_D=6077,vD=6078,UD=6079,kD=6080,WD=6081,LD=6082,OD=6083,BD=6084,ND=6085,wD=6086,yu;process.env.NODE_ENV!=="production"&&(yu={[NE]:"This member is already delegated to another wallet.",[mE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[_D]:"Clock sysvar access failed. This may indicate a system error.",[oD]:"Missing credential id.",[cD]:"The domain configuration account is disabled. Please contact support or try again later.",[aD]:"Missing domain configuration account.",[RD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[wD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[yE]:"Duplicate public keys detected among members. Each member must have a unique key.",[TE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[RE]:"No members provided. A multisig wallet must contain at least one member.",[pD]:"Slot numbers list is empty. At least one slot number is required for validation.",[PE]:"Expected a User with Administrator role for this instruction.",[lE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[EE]:"Expected a User with Transaction Manager role for this instruction.",[qE]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[JE]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[YE]:"Declared buffer size does not match the actual serialized size.",[gD]:"Failed to compute hash. This may indicate a system error.",[VE]:"Not enough members with vote permission to meet the approval threshold.",[wE]:"At least one signer with execute permission is required to proceed.",[HE]:"At least one signer with initiate permission is required to perform this action.",[kE]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[MD]:"Invalid account index in transaction message. The account index is out of bounds.",[uD]:"Address Tree supplied is not part of the whitelisted address trees.",[hE]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[LE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[jE]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[mD]:"Member key conversion failed. The provided key format is invalid.",[FE]:"Only delegated members are allowed for this transaction.",[UE]:"Unexpected number of accounts provided for this instruction.",[xE]:"User with Permanent Member role must have a delegated wallet.",[iE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[AE]:"The extracted public key has an invalid length or encoding.",[aE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[uE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[nD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[tD]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[_E]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[DD]:"Invalid source type for token transfer. The source account type is not supported.",[DE]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[CE]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[vE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[kD]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[WE]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[UD]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[ED]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[gE]:"The extracted WebAuthn signed message payload is malformed.",[$E]:"An input string exceeds the maximum allowed character length.",[iD]:"This member is not registered under the provided domain configuration.",[yD]:"Member not found in settings. Cannot remove a member that does not exist.",[hD]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[OE]:"A required account is missing from the instruction context.",[lD]:"Compressed proof arguments are missing. Required for compressed account operations.",[xD]:"Missing compressed token account. Required for token transfer operations.",[WD]:"Missing destination token account. Required for token transfer operations.",[CD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[TD]:"Light CPI accounts are missing. Required for compressed account operations.",[BE]:"User mutation arguments are required when performing add or remove delegate operations.",[BD]:"Missing new authority account. Required for domain configuration updates.",[OD]:"Missing settings account. Required for delegate operations on compressed wallets.",[AD]:"Compressed settings data is missing. The settings account must be initialized with data.",[LD]:"Missing source token account. Required for token transfer operations.",[ID]:"Missing SPL interface PDA. Required for token transfer operations.",[eD]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[bD]:"User account address is missing. Required for secp256r1 signature verification.",[ND]:"Missing whitelisted address trees account. Required for domain configuration updates.",[zE]:"No valid signer found in this transaction.",[ME]:"Only one administrator is allowed per wallet.",[SE]:"Only one permanent member is allowed per wallet.",[IE]:"Only one transaction manager is allowed per wallet.",[dD]:"The given origin index is not in the whitelisted origins.",[SD]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[fE]:"Permanent members cannot be removed from a wallet.",[QE]:"Writable CPI calls to protected accounts are not permitted.",[pE]:"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.",[dE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[rD]:"The specified slot number was not found in the provided slot history.",[PD]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[bE]:"Too many members: a maximum of 4 members are supported.",[ZE]:"This transaction has expired. It must be executed within 3 minutes of approval.",[XE]:"This transaction has not yet reached the required approval threshold.",[sD]:"Missing transports.",[KE]:"Only the transaction creator or rent payer may close this transaction buffer.",[vD]:"Unauthorized: Only the admin account is allowed to perform this action.",[GE]:"Member is not part of the expected signers for this transaction."});function BN(e){return process.env.NODE_ENV!=="production"?yu[e]:"Error message not available in production bundles."}function NN(e,n,r){return isProgramError(e,n,A,r)}async function YN({admin:e,addressTree:n}){return Zc({payer:e,addressTree:n,remainingAccounts:[]})}var Me=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);}},Qe=class extends Me{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},Q=class extends Me{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},I=class extends Me{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},ye=class extends Me{constructor(r,o,t){super(r,"NETWORK_ERROR",{statusCode:o,url:t});this.statusCode=o;this.url=t;}};var ae=class extends Me{constructor(r,o,t){super(r,"BUNDLE_ERROR",{bundleId:o,attempt:t});this.bundleId=o;this.attempt=t;}},vr=class extends Me{constructor(r,o,t){super(`Operation "${r}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=o;this.lastError=t;}},Ur=class extends Me{constructor(r,o,t){super(r,"PERMISSION_ERROR",{required:o,actual:t});this.required=o;this.actual=t;}};var Jt={Ed25519:1,Secp256r1:2};var HD=p.looseObject({publicKey:p.string(),walletAddress:p.string(),settingsIndexWithAddress:p.object({index:p.union([p.number(),p.bigint()]),settingsAddressTreeIndex:p.number()}),username:p.string().optional(),profilePictureUrl:p.string().optional()}),fu=p.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),rw=p.object({transactionActionType:fu,transactionAddress:p.string(),transactionMessageBytes:p.array(p.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),VD=p.object({transactionActionType:fu,transactionAddress:p.string(),transactionMessageBytes:p.base64()}).strict(),FD=p.union([p.object({type:p.literal("Ephemeral"),secretKey:p.string()}),p.object({type:p.literal("Default"),publickey:p.string(),endpoint:p.string()})]).array().optional(),Su=p.object({phase:p.literal("start"),redirectOrigin:p.url(),signer:p.string().optional(),rid:p.string(),validTill:p.number(),data:p.object({type:p.literal("message"),payload:p.string()}).strict()}).strict(),xu=p.object({phase:p.literal("start"),redirectOrigin:p.url(),signer:p.string().optional(),rid:p.string(),validTill:p.number(),data:p.object({type:p.literal("transaction"),payload:VD,sendTx:p.boolean(),additionalSigners:FD}).strict()}).strict(),Iu=p.object({startRequest:p.union([Su,xu]),authResponse:p.custom(),client:p.object({clientOrigin:p.url(),jws:p.string()}).strict(),device:p.object({jwk:p.base64(),jws:p.string()}).strict(),authProvider:p.object({jwk:p.base64(),jws:p.string()}).strict().optional()}).strict(),Cu=p.object({signer:p.string(),userAddressTreeIndex:p.number().optional(),additionalInfo:p.looseObject({}).optional()}).strict(),GD=p.object({slotHash:p.string(),slotNumber:p.string(),originIndex:p.number(),crossOrigin:p.boolean()}).strict(),nw=p.object({phase:p.literal("complete"),data:p.object({type:p.literal("message"),payload:Cu.extend(Iu.shape).extend({id:p.string().optional(),client:p.object({clientOrigin:p.url()}).strict()})}).strict()}).strict(),ow=p.object({phase:p.literal("complete"),data:p.object({type:p.literal("transaction"),payload:Cu.extend(Iu.shape).extend(GD.shape).extend({client:p.object({clientOrigin:p.url()}).strict()})}).strict()}).strict(),sw=p.object({phase:p.literal("complete"),data:p.object({type:p.literal("transaction"),payload:p.object({startRequest:p.union([xu,Su]),txSig:p.string(),user:HD})}).strict()}).strict();var Re={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},ve=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(Re).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var wo=33,Ue=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!==wo)throw new Error(`Invalid public key length, expected ${wo} 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===wo)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()}},_=class extends Ue{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(n,r){super(n),this.verifyArgs=r.verifyArgs,this.domainConfig=r.domainConfig,this.authData=r.authData,this.signature=r.signature,this.originIndex=r.originIndex,this.crossOrigin=r.crossOrigin,this.clientAndDeviceHash=r.clientAndDeviceHash,this.authResponse=r.authResponse;}};function jD(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function qD(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var Du=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(jD())],["addressTableLookups",getArrayCodec(qD())]]);function Pu(e){return Du.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 hu(e){let n=Du.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 Vo=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Mu="https://mainnet.block-engine.jito.wtf/api/v1",Ru="https://bundles.jito.wtf/api/v1/bundles/tip_floor",bu="landed_tips_75th_percentile";var ne={};function _u(){if(!ne.solanaRpcEndpoint)throw new Qe("RPC endpoint");return ne.solanaRpcEndpoint}function We(){if(!ne.lightProtocolRpc)throw new Qe("Light Protocol RPC");return ne.lightProtocolRpc}function Y(){if(!ne.solanaRpc)throw new Qe("Solana RPC");return ne.solanaRpc}function vu(){if(!ne.sendAndConfirm)throw new Qe("Send and confirm transaction function");return ne.sendAndConfirm}function Fo(){return ne.jitoTipsConfig?ne.jitoTipsConfig:{blockEngineUrl:Mu,getJitoTipsUrl:Ru,priority:bu}}function bw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:o}){ne.solanaRpcEndpoint=e,ne.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});ne.solanaRpc=t,ne.sendAndConfirm=c,ne.jitoTipsConfig=o??null;}async function Yt(e,n){if(!e.ok)throw new ye(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function Zt(e){try{return await e.json()}catch(n){throw new ye(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function zw(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Wr(n.get(-2))),y:BigInt("0x"+Wr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function Kw(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 jw(e){let{authenticatorData:n,clientDataJSON:r,signature:o}=e.authResponse.response,t=me(n),c=JSON.parse(getUtf8Decoder().decode(me(r))),a=Lu(c),i=Bu(me(o)),s=await dt({rpIdHash:t.subarray(0,32)});return new _(e.signer.toString(),{verifyArgs:{clientDataJson:me(r),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:Go(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:s,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function Go(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(n),...getBase64Encoder().encode(r)]))}function qw(e){return sha256(getUtf8Encoder().encode(JSON.stringify(e)))}function Jw(e){return zo(e.data.payload.authResponse)}function Yw(e,n,r,o){let t=Go(n,r,o);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...t]))}async function Zw(e,n,r,o,t,c){let a;if(!t||!c){let u=(await Y().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!u)throw new Q("Slot sysvar","Unable to fetch slot sysvar data");let g=getBase64Encoder().encode(u[0]);c=getU64Decoder().decode(g.subarray(0,8)).toString(),a=g.subarray(8,40),t=getBase58Decoder().decode(a);}else a=getBase58Encoder().encode(t);let i=sha256(typeof e.transactionMessageBytes=="string"?getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),s=Go(n,r,o),d=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...i,...a,...s]));return {slotNumber:c,slotHash:t,challenge:d}}function zo(e){let n=Lr(e);return sha256(n)}function Xw(e){let n="";for(let o of e)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function me(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),a=new Uint8Array(c);for(let i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return a}async function Qw(e,n){let{data:r}=await gs(Y(),e),t=Ou(r.origins,r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Q("Origin","Origin not found in domain config");return t}function $w(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function e2(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}function Wr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function nP(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 Lu(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 Ou(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 a=e[o]|e[o+1]<<8;if(o+=2,o+a>e.length)throw new Error("MaxLengthExceeded");let i=e.slice(o,o+a),s=t.decode(i);r.push(s),o+=a;}return r}function Bu(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 b=n&127;r+=b;}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 a=e[r+1],i=r+2,s=e.slice(i,i+a),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 m=p256.Point.CURVE().n>>1n,f=BigInt("0x"+Wr(u)),C=(f>m?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=nP(C);return new Uint8Array([...g,...x])}function Lr(e){let n=me(e.response.clientDataJSON),r=me(e.response.authenticatorData),o=sha256(n);return new Uint8Array([...r,...o])}var oP=400,sP=429,wu=500,cP=3,aP=500,iP=2,dP=3e4,Hu={backoffBase:iP,maxDelayMs:dP,retryOnRateLimit:true,initialDelayMs:aP,maxRetries:cP};function Vu(e){return e===sP}function Fu(e){return e>=wu}function uP(e){return e>=oP&&e<wu}function AP(e){return Vu(e)||Fu(e)}function gP(e,n,r){return e instanceof Response?Vu(e.status)?r.retryOnRateLimit??true:uP(e.status)?false:Fu(e.status):e instanceof TypeError||e instanceof Error}function pP(e,n,r,o){let t=n*Math.pow(r,e-1);return Math.min(t,o)}function mP(e){return new Promise(n=>setTimeout(n,e))}async function $t(e,n){let{maxRetries:r,initialDelayMs:o,backoffBase:t,maxDelayMs:c,shouldRetry:a}={...Hu,...n},i;for(let s=1;s<=r;s++)try{return await e()}catch(d){if(i=d,a&&!a(d,s))throw d;if(s>=r)break;let u=pP(s,o,t,c);await mP(u);}throw new vr(e.name||"retryWithBackoff",r,i)}async function ut(e,n){let r={...Hu,...n},o=(c,a)=>gP(c,a,r);return $t(async()=>{let c=await e();if(!c.ok&&AP(c.status))throw c;return c},{...r,shouldRetry:n?.shouldRetry??o})}function Gu(...e){return n=>e.some(r=>n instanceof r)}function zu(e,n,r,o){if(e<n||e>r)throw new I(`${o} must be between ${n} and ${r} (inclusive), got ${e}`)}function Ku(e,n){if(e<0)throw new I(`${n} must be non-negative, got ${e}`)}function er(e,n){if(e.length===0)throw new I(`${n} cannot be empty`)}function ju(e,n){if(e.trim().length===0)throw new I(`${n} cannot be empty`)}async function jo(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await Y().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 a=Math.ceil((o.unitsConsumed??0)*1.1);return a>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:a})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function Xu(e){let n=prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:8e5}),getSetComputeUnitPriceInstruction({microLamports:1e4})],e),r=getBase64EncodedWireTransaction(compileTransaction(n));if(r.length>1644)throw new I(`Transaction exceeds maximum length of ${1644} bytes (actual: ${r.length} bytes)`);let o=await Y().simulateTransaction(r,{encoding:"base64"}).send();if(o.value.err){if(o.value.logs){let c=["Transaction simulation failed:","",...o.value.logs].join(`
|
|
2
|
-
`);throw new Error(
|
|
3
|
-
`);throw new Error(t)}return o.value.unitsConsumed}async function Qu(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,a)=>c-a);let t=Math.floor(o.length/2);return o.length%2===0?Math.round((o[t-1]+o[t])/2):o[t]}async function $u(e,n){er(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new I(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await ut(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})}));await Yt(r,n);let o=await Zt(r);if(!o.result||o.error)throw new ae(`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 ae(`Simulation failed: ${c}`)}return o.result.value.transactionResults.map(t=>t.unitsConsumed)}function ie(e,n=0){let r=e instanceof _?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,a=r?.authData&&r.verifyArgs.clientDataJson?Lr(r.authResponse):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:o,signature:c,message:a,publicKey:i}}function Le(e,n,r=[]){let o=[];for(let t of e)if(t instanceof _){let c=r.length,{domainConfig:a,verifyArgs:i,signature:s,publicKey:d,message:u}=ie(t,c);if(u&&s&&d&&r.push({message:u,signature:s,publicKey:d}),a){let g=n.addPreAccounts([{address:a,role:AccountRole.READONLY}]).get(a)?.index;i.__option==="Some"&&g!==void 0&&o.push({__kind:"Secp256r1",fields:[{domainConfigIndex:g,verifyArgs:i.value}]});}}else {let c=n.addPreAccounts([{address:t.address,role:AccountRole.READONLY_SIGNER,signer:t}]).get(t.address)?.index;c!==void 0&&o.push({__kind:"Ed25519",fields:[c]});}return {secp256r1VerifyInput:r,transactionSyncSigners:o}}function fe(e){if(e instanceof Ue)return {keyType:Jt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Jt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function qu(e){return e instanceof _?e.toString():e.address.toString()}function ue(e){let n=new Set,r=[];for(let t of e)n.has(qu(t))||(r.push(t),n.add(qu(t)));let o=r.filter(t=>t instanceof _);if(o.length>1)throw new I(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return r}function eA({payer:e,tipAmount:n}){let r=Vo[Math.floor(Math.random()*Vo.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function tA(e){return typeof e=="string"?e:e.toString()}function rA(e){return e.toString()}async function qo(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 Jo=[{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}],B=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(Jo);return this.packOutputTreeIndex(n)}packTreeInfos(n,r){let o=[],t=[];for(let c of n){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());o.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:a,queuePubkeyIndex:i,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 a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:a,addressQueuePubkeyIndex:i});}return {stateTrees: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 Nr(e,n){let r=tA(e);return qo(n,r,()=>sA(e))}async function tt(e,n){let r=rA(e);return qo(n,r,()=>Y().getAccountInfo(e,{encoding:"base64"}).send())}async function de(e,n){let r=(await Promise.all(e.map(o=>Nr(o.address,n)))).filter(o=>o!==null).filter(o=>o.data!==null&&o.address!==null);if(r.length!==e.length)throw new Q("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 v(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function Se(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:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:a[u],outputStateTreeIndex:i,address:d.address,type:d.type}))}function re(e,n,r,o,t,c,a){let i=[];for(let u=0;u<n.length;u++)i.push({treeInfo:n[u],rootIndex:o[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let s=e.packTreeInfos(i,[]).stateTrees;if(!s)throw new I("Unable to parse state tree data");return c.map((u,g)=>({data:a.decode(u.data.data),accountMeta:{treeInfo:s.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:s.outputTreeIndex}}))}async function xe(e,n,r,o,t){let c=null,a=null,i=null,s=new B;if(e){await s.addSystemAccounts();let{address:d}=await oe(n,r),u=(await de([{address:d,type:"Settings"}],t))[0];o?i={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:i=await Z([u],[]);let g=s.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!g)throw new I("Unable to parse state tree data");let m=j().decode(u.data?.data);c={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0]},data:m},a={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:m};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:s,settingsMutArgs:a}}async function Z(e,n){return $t(()=>We().getValidityProofV0(e,n))}async function Ie(){return (await wr()).length-1}var Yo;async function wr(){if(!Yo){let{data:e}=await Kc(Y(),await cA());Yo=e.whitelistedAddressTrees;}return Yo}function oA(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 rr(e,n,r){let o=await ch(e,n,r);if(!o)throw new Q("User account");return o}async function ch(e,n,r){let{address:o}=await N(e,n),t=await Nr(o,r);return t?.data?.data?X().decode(t.data.data):null}async function Z2(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(H().encode(fe(n)))}});else if(r)o.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(me(r))}});else return null;let t=await We().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:o});return t.items.filter(c=>!!c.data).length?t.items.map(c=>X().decode(c.data?.data))[0]:null}async function Hr(e,n,r){let o=await ah(e,n,r);if(!o)throw new Q("Settings account");return o}async function ah(e,n,r){try{let{address:o}=await oe(e,n),t=await Nr(o,r);if(!t?.data?.data)throw new Q("Compressed settings account");let c=j().decode(t.data.data);if(c.data.__option==="None")throw new Q("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let o=await po(Y(),e);return o.exists?{...o.data,isCompressed:false}:null}}async function X2(e,n,r){let o=await rr(e,n,r);if(o.role===1||o.role===0){let t=[],[c,a]=await Promise.all([We().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:getBase58Decoder().decode(H().encode(fe(e)))}}]}),Y().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(H().encode(fe(e)))}}]}).send()]);return c.items.forEach(i=>{if(i.data?.data){let s=j().decode(i.data.data);s.data.__option==="Some"&&t.push({...s.data.value,isCompressed:true});}}),a.forEach(i=>{let s=Ir().decode(getBase64Encoder().encode(i.account.data[0]));t.push({...s,isCompressed:false});}),t}else return await Promise.all(o.wallets.map(async t=>Hr(await Ce(t.index),t.settingsAddressTreeIndex,r)))}async function Xo(e){Ku(e,"index");let n=await wr();if(e>=n.length)throw new I(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function Q2(e){let r=(await wr()).findIndex(o=>o.toString()===e);if(r===-1)throw new Q("Address tree",`Address ${e} not found in whitelist`);return r}async function sA(e,n){if(!n&&!e)throw new I("Either hash or address must be provided to fetchCompressedAccount.");if(n&&e)throw new I("Only one of hash or address must be provided to fetchCompressedAccount.");let r=await rpcRequest(We().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(Jo,t),a=o.result.value;return createCompressedAccountWithMerkleContextLegacy(createMerkleContextLegacy(c,a.hash,a.leafIndex),a.owner,bn$1(a.lamports),a.data?parseAccountData(a.data):void 0,a.address||void 0)}async function oe(e,n=0){let r=await Xo(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 N(e,n=0){let r=await Xo(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("user"),e instanceof Ue?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 dt({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(getUtf8Encoder().encode(n));else throw new I("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function TA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function cA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function yA(e,n,r){zu(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 Ue?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return o}async function be(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function Ce(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function d8(e){let n=await Ce(e);return await be(n)}async function u8(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function S8(e){er(e,"bundle");let n=await jo(e,true),r=await $u(n.map(getBase64EncodedWireTransaction),_u()),o=await jo(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await Ah(o.map(getBase64EncodedWireTransaction))}async function Ah(e,n=Fo(),r){er(e,"serializedTransactions");let{blockEngineUrl:o}=n,t=`${o}/bundles`,c=await ut(()=>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 Yt(c,t);let a=await Zt(c);if(a.error)throw new ae(`Error sending bundles: ${JSON.stringify(a.error,null,2)}`);if(!a.result)throw new ae("No bundle ID returned from Jito");return a.result}async function x8(e,n=30,r=3e3,o=Fo()){ju(e,"bundleId");let{blockEngineUrl:t}=o,c=`${t}/getBundleStatuses`;return $t(async()=>{let a=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await Yt(a,c);let i=await Zt(a);if(i.error)throw new ae(`Error getting bundle status: ${JSON.stringify(i.error,null,2)}`,e);if(!i.result?.value?.length)throw new ae("Bundle not yet confirmed",e);let s=i.result.value[0];if(s.confirmation_status==="confirmed"||s.confirmation_status==="finalized"){let d=s.transactions[s.transactions.length-1];if(!d)throw new ae("No transactions in confirmed bundle",e);return d}throw new ae(`Bundle status: ${s.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:Gu(ae,ye)})}async function M8({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=await Y().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[a,i]=await Promise.all([Xu(c),Qu(Y(),c.instructions.flatMap(d=>d.accounts??[]))]),s=Math.ceil((Number(a)??0)*1.1);return prependTransactionMessageInstructions([...s>2e5?[getSetComputeUnitLimitInstruction({units:s})]:[],...i>0?[getSetComputeUnitPriceInstruction({microLamports:i})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await vu()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function F8(e,n){if(n.threshold>1)throw new I("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(s=>IA(s.pubkey)===e);if(!r)throw new Q("Member",`Signer ${e} not found in settings`);let{permissions:o}=r;if(!o)throw new Q("Permissions","No permissions found for the current member");let t=ve.has(o,Re.InitiateTransaction),c=ve.has(o,Re.VoteTransaction),a=ve.has(o,Re.ExecuteTransaction);if(t&&c&&a)return {};if(!c||!a)throw new Ur("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,a?"ExecuteTransaction":void 0].filter(Boolean));let i=n.members.find(s=>s.role===0);if(!i)throw new Q("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(IA(i.pubkey)),userAddressTreeIndex:i.userAddressTreeIndex}}async function G8({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:o,cachedAccounts:t}){if(!n)return null;let c=await rr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Q("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return Rh(n,c.transactionManagerUrl.value,e,o)}function Rh(e,n,r,o){return {address:e,async signTransactions(t){let c=await ut(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:e.toString(),payload:t.map(i=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(i)),transactionMessageBytes:o?getBase64Decoder().decode(o):void 0,authResponses:r}))})}));if(!c.ok)throw new ye(`Transaction manager request failed: ${c.statusText}`,c.status,n);let a=await c.json();if("error"in a)throw new ye(`Transaction manager error: ${a.error}`,c.status,n);return a.signatures.map(i=>({[e]:getBase58Encoder().encode(i)}))}}}function IA(e){return e.keyType===Jt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function z8(e){let n=e.map(c=>Fe().encode(c)),r=4+n.reduce((c,a)=>c+a.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 K8(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 a=Ge().read(e,n);t[c]=a[0],n=a[1];}if(n!==e.length)throw new I(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function aH({payer:e,rpId:n,origins:r,authority:o}){let t=await dt({rpId:n}),c=new B;await c.addSystemAccounts();let a=await Ie(),{address:i,addressTree:s}=await N(o.address,a),d=[{address:i,tree:s,queue:s,type:"User"}],u=await Z([],d),g=(await Se(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:m,systemOffset:f}=c.toAccountMetas(),S=v(u,f);return await Ma({origins:r,authorityCreationArgs:g,authority:o,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:m})}async function fH({authority:e,payer:n,createUserArgs:r,domainConfig:o,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let a=[];r.settings&&(a.push({address:(await oe(r.settings,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await N(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await de(a,t):[],s=await Ie(),{address:d,addressTree:u}=await N(r.member,s),g=[{address:d,type:"User",tree:u,queue:u}],m=await Z(i,g),f=null,S=null,C=i.filter(G=>G.type==="Settings"),x=i.filter(G=>G.type==="User");C.length&&(f=re(c,m.treeInfos.slice(0,1),m.leafIndices.slice(0,1),m.rootIndices.slice(0,1),m.proveByIndices.slice(0,1),C,j())[0]),x.length&&(S=re(c,m.treeInfos.slice(1,2),m.leafIndices.slice(1,2),m.rootIndices.slice(1,2),m.proveByIndices.slice(1,2),x,X())[0]);let b=await Se(c,m.treeInfos.slice(i.length),m.roots.slice(i.length),m.rootIndices.slice(i.length),g),{remainingAccounts:P,systemOffset:U}=c.toAccountMetas(),k=v(m,U);return await Ua({payer:n,authority:e,compressedProofArgs:k,member:Wt().decode(r.member.toBuffer()),credentialId:me(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:f?some({settingsMutArgs:f,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:b[0],domainConfig:o,remainingAccounts:P})}async function CH({payer:e}){let n=await TA();return Oa({payer:e,globalCounter:n})}async function hH({admin:e,rpId:n,disable:r}){let o=await dt({rpId:n});return Qa({domainConfig:o,admin:e,disable:r,remainingAccounts:[]})}function _h(e,n,r,o){let t=vh(e,n),c=Uh(e,n)&&r!==o;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function vh(e,n){let r=e.staticAccounts.length,{numSignerAccounts:o,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,a=o-t,i=r-o-c;return n>=r?false:n<a?true:n>=o?n-o<i:false}function Uh(e,n){return n<e.header.numSignerAccounts}async function Vr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:o}){let t=hu(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(i=>i.lookupTableAddress),Y()):{}),a=[];a.push(...t.addressTableLookups?.map(i=>({role:AccountRole.READONLY,address:i.lookupTableAddress}))??[]);for(let[i,s]of t.staticAccounts.entries())a.push({address:s,role:_h(t,i,s,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let s=c[i.lookupTableAddress];if(!s)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let d of i.writableIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:u,role:AccountRole.WRITABLE});}for(let d of i.readonlyIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:u,role:AccountRole.READONLY});}}for(let i of o?.filter(s=>s.address!==e)??[]){let s=a.findIndex(d=>d.address===i.address);s===-1?a.push({address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}):a[s].role===AccountRole.READONLY||a[s].role===AccountRole.READONLY_SIGNER?a[s]={address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}:(a[s].role===AccountRole.WRITABLE||a[s].role===AccountRole.WRITABLE_SIGNER)&&(a[s]={address:i.address,role:AccountRole.WRITABLE_SIGNER,signer:i});}return {accountMetas:a,addressLookupTableAccounts:c,transactionMessage:t}}var gt=33,pt=64,ts=14,wh=2,Hh=address("Secp256r1SigVerify1111111111111111111111111");function Vh(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function Fh(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function MA(){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=Fh();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=ts;let a=[];for(let i=0;i<r;i++){let s=fixDecoderSize(getBytesDecoder(),gt).decode(e,n);n+=gt;let d=fixDecoderSize(getBytesDecoder(),pt).decode(e,n);n+=pt;let u=t[i].messageDataSize,g=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,a.push({publicKey:s,signature:d,message:g});}return [{numSignatures:r,padding:o,offsets:t,payload:a},n]}})}function RA(){return createEncoder({getSizeFromValue:e=>{let n=ts*e.offsets.length,r=e.payload.reduce((o,t)=>o+gt+pt+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=Vh();for(let t of e.offsets)r=o.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),gt).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),pt).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function wH(){return combineCodec(RA(),MA())}function w(e,n){let r=e.length,o=wh+r*ts,t=[];for(let s=0;s<r;s++){let{message:d}=e[s],u=o,g=u+gt,m=g+pt;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:m,messageDataSize:d.length,messageInstructionIndex:65535}),o+=gt+pt+d.length;}let c=n?.programAddress??Hh,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:RA().encode(a)}}function HH(e){return {programAddress:e.programAddress,accounts:{},data:MA().decode(e.data)}}async function bA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:o,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:s=false}){let d=await be(e),{accountMetas:u,addressLookupTableAccounts:g}=await Vr({transactionMessageBytes:r,walletAddress:d,additionalSigners:a,addressesByLookupTableAddress:t}),m=[];return c.length>0&&m.push(w(c)),m.push(s?ou({transactionBuffer:n,payer:o.address,remainingAccounts:u,settingsKey:e}):Qd({transactionBuffer:n,payer:o.address,settings:e})),i&&m.push(eA({payer:o,tipAmount:i})),{instructions:m,addressLookupTableAccounts:g}}async function _A({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,additionalSigners:o,signers:t,payer:c,addressesByLookupTableAddress:a,secp256r1VerifyInput:i=[],compressed:s=false,simulateProof:d=false,cachedAccounts:u}){let g=ue(t),m=await be(e),[{accountMetas:f,addressLookupTableAccounts:S,transactionMessage:C},{settingsMutArgs:x,proof:b,packedAccounts:P}]=await Promise.all([Vr({transactionMessageBytes:r,walletAddress:m,additionalSigners:o,addressesByLookupTableAddress:a}),xe(s,e,n,d,u)]);P.addPreAccounts(f);let{secp256r1VerifyInput:U,transactionSyncSigners:k}=Le(g,P,i),{remainingAccounts:G,systemOffset:le}=P.toAccountMetas(),se=[];U.length>0&&se.push(w(U));let Ee=Gh(C,f);if(s){if(!c||!x)throw new I("Payer not found or proof args are missing for executeTransactionSync.");let De=v(b,le);se.push(Tu({signers:k,transactionMessage:Ee,settingsMutArgs:x,compressedProofArgs:De,payer:c,remainingAccounts:G}));}else se.push(uu({signers:k,settings:e,transactionMessage:Ee,remainingAccounts:G}));return {instructions:se,addressLookupTableAccounts:S}}function Gh(e,n){if(e.version==="legacy")throw new I("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 l5({settings:e,settingsAddressTreeIndex:n,destination:r,signers:o,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let s=ue(o),d=await be(e),[{packedAccounts:u,proof:g,settingsMutArgs:m},{value:f}]=await Promise.all([xe(i,e,n,false,t),tt(d,t)]);if((f?.lamports??0)<BigInt(c))throw new I("Insufficient balance for native transfer.");let{secp256r1VerifyInput:S,transactionSyncSigners:C}=Le(s,u),{remainingAccounts:x,systemOffset:b}=u.toAccountMetas(),P=[];if(S.length>0&&P.push(w(S)),i){if(!a||!m)throw new Error("Payer not found or proof args is missing.");let U=v(g,b);P.push(hi({amount:c,settingsMutArgs:m,compressedProofArgs:U,payer:a,signers:C,source:d,destination:r,remainingAccounts:x}));}else P.push(xi({amount:c,signers:C,source:d,destination:r,settings:e,remainingAccounts:x}));return P}var Zh=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),Xh=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Gr=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function _5({settings:e,settingsAddressTreeIndex:n,destination:r,mint:o,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:s,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false,useDestinationSplAccount:g=false}){let m=ue(t),f=await be(e),S=await Qh(o,r,f,s,d),[C,x]=await Promise.all([$h(S,c),aM(u,e,n,c)]),b=eM(C,S,a,g),[P,U]=await Promise.all([cM(f,o,b.splBalance,b.cTokenBalance,BigInt(a),u?3:4),sM(b.requireSplInterface,S.splInterfacePda,c)]),k=P.reduce((Be,as)=>Be+as.parsed.amount.toNumber(),0);if(b.splBalance+b.cTokenBalance+BigInt(k)<BigInt(a))throw new I("Insufficient balance for token transfer.");let G=new B;U&&G.addPreAccounts([{address:o,role:AccountRole.WRITABLE}]);let le=tM(P,x),{proof:se,settingsMutArgs:Ee}=await rM(G,le,P.length,x),De=nM(P,se,G),{secp256r1VerifyInput:st,transactionSyncSigners:Oe}=Le(m,G),{remainingAccounts:ge,systemOffset:ct}=G.toAccountMetas(),qr=v(se,ct),y=[];st.length>0&&y.push(w(st));let or=oM({amount:a,transactionSyncSigners:Oe,walletAddress:f,destination:r,addresses:S,balances:b,mint:o,tokenProgram:s,remainingAccounts:ge,payer:i,sourceCompressedTokenAccounts:De,compressedProofArgs:qr,splInterfacePdaArgs:d});if(u){if(!Ee)throw new Error("Payer not found or proof args is missing.");y.push(Hi({...or,settingsMutArgs:Ee}));}else y.push(Ui({...or,settings:e}));return y}async function Qh(e,n,r,o,t){let c=m=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(m),getAddressEncoder().encode(Gr),getAddressEncoder().encode(e)],programAddress:Gr}),a=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(e)];t.restricted&&a.push(getUtf8Encoder().encode("restricted")),t.index>0&&a.push(getU8Encoder().encode(t.index));let[i,[s],d,[u],[g]]=await Promise.all([getAssociatedTokenAccountAddress(e,r,o),c(r),getAssociatedTokenAccountAddress(e,n,o),c(n),getProgramDerivedAddress({seeds:a,programAddress:Gr})]);return {sourceSplAta:i,sourceCtokenAta:s,destinationSplAta:d,destinationCTokenAta:u,splInterfacePda:g}}async function $h(e,n){let[r,o,t]=await Promise.all([tt(e.destinationSplAta,n),tt(e.sourceSplAta,n),tt(e.sourceCtokenAta,n)]);return {destinationSplAtaInfo:r,sourceSplAtaInfo:o,sourceCTokenAtaInfo:t}}function eM(e,n,r,o){let t=!!e.destinationSplAtaInfo.value,c=!!e.sourceSplAtaInfo.value,a=!!e.sourceCTokenAtaInfo.value,i=c?getTokenDecoder().decode(getBase64Encoder().encode(e.sourceSplAtaInfo.value.data[0])).amount:BigInt(0),s=BigInt(a?iM(getBase64Encoder().encode(e.sourceCTokenAtaInfo.value.data[0]))?.amount??0:0),d=t||o?n.destinationSplAta:void 0,u=t||o?void 0:n.destinationCTokenAta,g=c&&(i+s<BigInt(r)||s>BigInt(0)||!t)||!c&&t;return {splBalance:i,cTokenBalance:s,destinationSplTokenAccount:d,destinationCtokenTokenAccount:u,requireSplInterface:g,requireRentSponsor:!t}}function tM(e,n){let r=[];return e.length&&r.push(...e.map(o=>({hash:o.compressedAccount.hash,tree:o.compressedAccount.treeInfo.tree,queue:o.compressedAccount.treeInfo.queue,data:o.compressedAccount.data,address:o.compressedAccount.address}))),n&&r.push(n),r}async function rM(e,n,r,o){let t=null,c=null;if(n.length===0)return {proof:c,settingsMutArgs:t};if(await e.addSystemAccounts(),c=await Z(n,[]),o){let a=r;t=re(e,c.treeInfos.slice(a),c.leafIndices.slice(a),c.rootIndices.slice(a),c.proveByIndices.slice(a),n.slice(a),j())[0];}return {proof:c,settingsMutArgs:t}}function nM(e,n,r){return !e.length||!n?none():some(e.map((o,t)=>({isFrozen:o.parsed.state===AccountState.Frozen,hasDelegate:o.parsed.delegate!=null,amount:o.parsed.amount.toNumber(),merkleContext:{leafIndex:o.compressedAccount.leafIndex,merkleTreePubkeyIndex:r.insertOrGet(o.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:r.insertOrGet(o.compressedAccount.treeInfo.queue.toString()),proveByIndex:o.compressedAccount.proveByIndex},rootIndex:n.rootIndices[t],version:oA(o.compressedAccount.data?.discriminator),tlv:o.parsed.tlv?some(getArrayDecoder(Mt()).decode(o.parsed.tlv)):none()})))}function oM({amount:e,transactionSyncSigners:n,walletAddress:r,destination:o,addresses:t,balances:c,mint:a,tokenProgram:i,remainingAccounts:s,payer:d,sourceCompressedTokenAccounts:u,compressedProofArgs:g,splInterfacePdaArgs:m}){return {amount:e,signers:n,source:r,destination:o,sourceCtokenTokenAccount:t.sourceCtokenAta,sourceSplTokenAccount:t.sourceSplAta,destinationCtokenTokenAccount:c.destinationCtokenTokenAccount,destinationSplTokenAccount:c.destinationSplTokenAccount,mint:a,tokenProgram:i,remainingAccounts:s,payer:d,sourceCompressedTokenAccounts:u,compressedProofArgs:g,compressibleConfig:Zh,splInterfacePda:c.requireSplInterface?t.splInterfacePda:void 0,rentSponsor:c.requireRentSponsor?Xh:void 0,splInterfacePdaArgs:c.requireSplInterface?some(m):none()}}async function sM(e,n,r){if(!e)return false;let{value:o}=await tt(n,r);return !o}async function cM(e,n,r,o,t,c){let a=t-r-o;if(a<=0)return [];let s=(await We().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(n)})).items.filter(g=>!!g.compressedAccount.data?.data.length&&g.compressedAccount.owner.toString()===Gr.toString()&&!g.parsed.amount.isZero()).sort((g,m)=>m.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>=a)break;d+=BigInt(g.parsed.amount.toNumber()),u.push(g);}if(d<a)throw u.length>=c?new I("Transaction size limit exceeded. Consider multiple transfers to transfer full balance."):new I("Insufficient compressed balance.");return u}async function aM(e,n,r,o){if(!e)return null;let{address:t}=await oe(n,r);return (await de([{address:t,type:"Settings"}],o))[0]??null}function iM(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 F5({signers:e,payer:n,changeConfigArgs:r}){let{settings:o,configActions:t,compressed:c,packedAccounts:a,proof:i,settingsMutArgs:s}=r,d=ue(e),u=[],g=[];for(let x of d)if(x instanceof _){let b=g.length,{domainConfig:P,verifyArgs:U,signature:k,publicKey:G,message:le}=ie(x,b);if(le&&k&&G&&g.push({message:le,signature:k,publicKey:G}),P){let se=a.addPreAccounts([{address:P,role:AccountRole.READONLY}]).get(P)?.index;U.__option==="Some"&&se!==void 0&&u.push({__kind:"Secp256r1",fields:[{domainConfigIndex:se,verifyArgs:U.value}]});}}else {let b=a.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]).get(x.address)?.index;b!==void 0&&u.push({__kind:"Ed25519",fields:[b]});}let{remainingAccounts:m,systemOffset:f}=a.toAccountMetas(),S=v(i,f),C=[];if(g.length>0&&C.push(w(g)),c){if(!s)throw new I("Proof args are missing for compressed changeConfig.");C.push(ga({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:s,remainingAccounts:m,signers:u}));}else C.push(oa({settings:o,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:m,signers:u}));return C}async function Y5({createUserArgs:e,payer:n}){let r=new B;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:AccountRole.READONLY_SIGNER,signer:u.member})));let o=await Ie(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:m}=await N(u.member.address,o);return {address:g,tree:m,queue:m,type:"User"}})),c=await Z([],t),a=await Se(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:s}=r.toAccountMetas(),d=v(c,s);return await Ha({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:a[g],transactionManagerUrl:u.role===0?u.transactionManagerUrl:null})),remainingAccounts:i})}async function r6({index:e,payer:n,initialMember:r,userAddressTreeIndex:o,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let a=[],i=[];i.push(...await de([{address:(await N(r.address,o)).address,type:"User"}],t));let s=await Ie(),{address:d,addressTree:u}=await oe(await Ce(e),s);a.push({address:d,queue:u,tree:u,type:"Settings"});let g=i.length,m=await Z(i,a),f=re(c,m.treeInfos.slice(0,g),m.leafIndices.slice(0,g),m.rootIndices.slice(0,g),m.proveByIndices.slice(0,g),i.filter(U=>U.type==="User"),X())[0],C=(await Se(c,m.treeInfos.slice(g),m.roots.slice(g),m.rootIndices.slice(g),a)).find(U=>U.type==="Settings")??null,{remainingAccounts:x,systemOffset:b}=c.toAccountMetas(),P=v(m,b);if(!C)throw new Error("Settings creation args is missing.");return await ya({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:P,...C,remainingAccounts:x})}async function g6({settings:e,settingsAddressTreeIndex:n,payer:r,signers:o,cachedAccounts:t}){let{packedAccounts:c,proof:a,settingsMutArgs:i}=await xe(true,e,n,false,t);if(!i)throw new I("Proof args are missing for settings account.");let s=ue(o),{secp256r1VerifyInput:d,transactionSyncSigners:u}=Le(s,c),{remainingAccounts:g,systemOffset:m}=c.toAccountMetas(),f=v(a,m),S=[];return d.length>0&&S.push(w(d)),S.push(ja({settings:e,payer:r,settingsMutArgs:i,compressedProofArgs:f,signers:u,remainingAccounts:g})),S}async function S6({authority:e,domainConfig:n,newAuthority:r,newOrigins:o}){let t=null,c=[];if(r){let a=new B;await a.addSystemAccounts();let i=await Ie(),{address:s,addressTree:d}=await N(r.address,i),u=[{address:s,tree:d,queue:d,type:"User"}],g=await Z([],u),m=(await Se(a,g.treeInfos,g.roots,g.rootIndices,u))[0],f=a.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:v(g,f.systemOffset),authorityCreationArgs:m};}return oi({domainConfig:n,authority:e,newOrigins:o?some(o):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function P6({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let o=new B;await o.addSystemAccounts();let t=await de([{address:(await N(e.address,n)).address,type:"User"}]),c=await Z(t,[]),a=re(o,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:i,systemOffset:s}=o.toAccountMetas(),d=v(c,s);return ui({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:a,remainingAccounts:i})}async function L6({payer:e,user:n,userAddressTreeIndex:r,newDelegate:o,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:a,message:i,signature:s,publicKey:d}=ie(n),u=[];i&&s&&d&&u.push({message:i,signature:s,publicKey:d});let g=await rr(n instanceof _?n:n.address,r,t),m=[];m.push({address:(await N(n instanceof _?n:n.address,r)).address,type:"User"});let f,S=null,C,x=null,b=g.wallets.find(ge=>ge.isDelegate);if(b){let ge=await Ce(b.index);(await Hr(ge,b.settingsAddressTreeIndex,t)).isCompressed?(m.push({address:(await oe(ge,b.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:m.length-1,end:m.length}):f=await Ce(b.index);}if(o){let ge=await Ce(o.index);(await Hr(ge,o.settingsAddressTreeIndex,t)).isCompressed?(m.push({address:(await oe(ge,o.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:m.length-1,end:m.length}):C=await Ce(o.index);}let P=new B;await P.addSystemAccounts();let U=await de(m,t),k=await Z(U,[]),G=re(P,k.treeInfos.slice(0,1),k.leafIndices.slice(0,1),k.rootIndices.slice(0,1),k.proveByIndices.slice(0,1),U.slice(0,1),X())[0],le=S?some(re(P,k.treeInfos.slice(S.start,S.end),k.leafIndices.slice(S.start,S.end),k.rootIndices.slice(S.start,S.end),k.proveByIndices.slice(S.start,S.end),U.slice(S.start,S.end),j())[0]):none(),se=x?some(re(P,k.treeInfos.slice(x.start,x.end),k.leafIndices.slice(x.start,x.end),k.rootIndices.slice(x.start,x.end),k.proveByIndices.slice(x.start,x.end),U.slice(x.start,x.end),j())[0]):none(),{remainingAccounts:Ee,systemOffset:De}=P.toAccountMetas(),st=v(k,De),Oe=[];return u.length>0&&Oe.push(w(u)),Oe.push(Ti({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:o?some(o):none(),feePayer:e,signer:n instanceof _?void 0:n,oldSettings:f,oldSettingsMutArgs:le,newSettings:C,newSettingsMutArgs:se,compressedProofArgs:st,userMutArgs:G,remainingAccounts:Ee})),Oe}async function Q6({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:o,compressed:t=false,cachedAccounts:c}){let a=await wc(Y(),r),i=a.data.multiWalletSettings,{packedAccounts:s,proof:d,settingsMutArgs:u}=await xe(t,i,e,false,c),{remainingAccounts:g,systemOffset:m}=s.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:C,signature:x,publicKey:b}=ie(n),P=[];if(C&&x&&b&&P.push(w([{message:C,signature:x,publicKey:b}])),t){if(!o||!u)throw new I("Payer not found or proof args are missing for closing buffer.");let U=v(d,m);P.push(Qi({transactionBuffer:r,domainConfig:f,closer:n instanceof _?void 0:n,rentCollector:a.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:u,payer:o,compressedProofArgs:U,remainingAccounts:g}));}else P.push(ji({transactionBuffer:r,domainConfig:f,closer:n instanceof _?void 0:n,settings:i,payer:a.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return P}function BA({payer:e,creator:n,bufferIndex:r,settings:o,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:s,compressedArgs:d,expectedSigners:u}){let{domainConfig:g,verifyArgs:m,message:f,signature:S,publicKey:C}=ie(n),x=[];if(f&&S&&C&&x.push(w([{message:f,signature:S,publicKey:C}])),d){let{settingsReadonlyArgs:b,compressedProofArgs:P,remainingAccounts:U}=d;x.push(ud({transactionBuffer:t,payer:e,secp256r1VerifyArgs:m,creator:n instanceof _?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:s,preauthorizeExecution:i,expectedSigners:u},settingsReadonlyArgs:b,compressedProofArgs:P,remainingAccounts:U}));}else x.push(od({settings:o,transactionBuffer:t,payer:e,secp256r1VerifyArgs:m,creator:n instanceof _?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:s,preauthorizeExecution:i,expectedSigners:u},remainingAccounts:[]}));return x}function NA({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:s}=ie(e),d=[];return i&&a&&s&&d.push(w([{message:i,signature:a,publicKey:s}])),o?d.push(Cd({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof _?void 0:e,settingsMutArgs:o.settingsMutArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(Td({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof _?void 0:e,remainingAccounts:[]})),d}function wA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:o=false}){return o?Wd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Rd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function HA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:s}=ie(n),d=[];return s&&a&&i&&d.push(w([{message:s,signature:a,publicKey:i}])),o?d.push(jd({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof _?void 0:n,settingsReadonlyArgs:o.settingsReadonlyArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(Hd({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof _?void 0:n,remainingAccounts:[]})),d}async function VV({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:o,compressed:t=false}){let c=await gM(r),a=new B,i=null,s=null,d=[];if(c.length||t){let g=await pM({packedAccounts:a,userAccounts:c,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:o});i=g.proof,s=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await mM({configActionsArgs:r,userMutArgs:d}),settings:e,proof:i,settingsMutArgs:s,packedAccounts:a,compressed:t}}async function gM(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let o=await Promise.all(r.members.map(t=>N(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=>N(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}}return n}async function pM({packedAccounts:e,userAccounts:n,compressed:r,settings:o,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let a=[];if(r){let f=(await oe(o,t)).address;a.push({address:f,type:"Settings"});}n.length&&a.push(...n);let i=a.length?await de(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let s=await Z(i,[]),d=[],u=[];for(let f of i)f.type==="Settings"?d.push(f):f.type==="User"&&u.push(f);let g,m=[];if(r&&s&&(g=re(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;m=re(e,s.treeInfos.slice(f),s.leafIndices.slice(f),s.rootIndices.slice(f),s.proveByIndices.slice(f),u,X());}return {proof:s,settingsMutArgs:g,userMutArgs:m}}async function mM({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 a=await N(c.member,c.userAddressTreeIndex).then(i=>n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(i.address)))));if(!a)throw new Error("Unable to find user account");t.push(yM({permissionArgs:c.permissions,userMutArgs:a,pubkey:c.member}));}r.push({__kind:o.type,fields:[t]});break}case "RemoveMembers":{let t=await Promise.all(o.members.map(c=>N(c.member,c.userAddressTreeIndex).then(a=>{let i=n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(a.address))));if(!i)throw new Error("Unable to find user account");return TM({pubkey:c.member,userMutArgs:i})})));r.push({__kind:o.type,fields:[t]});break}case "EditPermissions":{let t=o.members.map(c=>lM({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 lM({pubkey:e,permissionArgs:n}){return {memberKey:fe(e),permissions:zA(n)}}function TM({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:fe(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function yM({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:fe(e),permissions:zA(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function zA(e){let n=[];return e.initiate&&n.push(Re.InitiateTransaction),e.vote&&n.push(Re.VoteTransaction),e.execute&&n.push(Re.ExecuteTransaction),ve.fromPermissions(n)}async function YV({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:s,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:m=Math.ceil(o.length/2),cachedAccounts:f}){let S=Math.floor(Math.random()*255),C=await yA(n,t instanceof _?t:t.address,S),x=[],b=[];for(let ee=0;ee<o.length;ee+=m){let is=o.subarray(ee,ee+m);x.push(is),b.push(sha256(is));}let P=sha256(o),{settingsReadonlyArgs:U,settingsMutArgs:k,proof:G,packedAccounts:le}=await xe(d,n,r,false,f),{remainingAccounts:se,systemOffset:Ee}=le.toAccountMetas(),De=G&&U&&k?{settingsReadonlyArgs:U,settingsMutArgs:k,compressedProofArgs:v(G,Ee),remainingAccounts:se,payer:e}:null,st=ue([t,...c?[c]:[],...u]).map(ee=>({memberKey:fe(ee),messageHash:ee instanceof _?zo(ee.authResponse):null})),Oe=BA({finalBufferHash:P,finalBufferSize:o.length,bufferIndex:S,payer:e,transactionBufferAddress:C,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:b,compressedArgs:De,expectedSigners:st}),ge=x.map(ee=>wA({transactionMessageBytes:ee,transactionBufferAddress:C,settings:n,compressed:d})),ct=u.map(ee=>HA({voter:ee,transactionBufferAddress:C,settings:n,compressedArgs:De})),qr=NA({compressedArgs:De,settings:n,executor:c,transactionBufferAddress:C}),{instructions:y,addressLookupTableAccounts:or}=await bA({compressed:d,settings:n,transactionMessageBytes:o,transactionBufferAddress:C,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:s}),Be=ee=>({payer:e,instructions:ee,addressesByLookupTableAddress:or});return [Be(Oe),...ge.map(ee=>Be([ee])),...ct.length?[Be(ct.flat())]:[],Be(qr),Be(y)]}var Kr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let o=new Map,t=a=>{let i=o.get(a);return i===void 0&&(i={isSigner:false,isWritable:false,isInvoked:false},o.set(a,i)),i},c=t(r);c.isSigner=true,c.isWritable=true;for(let a of n){t(a.programAddress).isInvoked=false;for(let i of a.accounts??[]){let s=t(i.address);s.isSigner||=i.role===AccountRole.READONLY_SIGNER||i.role===AccountRole.WRITABLE_SIGNER,s.isWritable||=i.role===AccountRole.WRITABLE||i.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),a={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[i]=r[0];if(i!==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 [a,s]}extractTableLookup(n){let[r,o]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&a.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&!a.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(n,r){let o=new Array,t=new Array;for(let[c,a]of this.keyMetaMap.entries())if(r(a)){let i=c,s=n.findIndex(d=>d===i);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),t.push(i),this.keyMetaMap.delete(c);}}return [o,t]}};var jr=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,a)=>{o.set(c,a);});let t=c=>{let a=o.get(c);if(a===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return a};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(a=>t(a.address))??[],data:c.data}))}};function jA({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:o}){let t=Kr.compile(r,e),c=new Array,a={writable:[],readonly:[]},i=Object.entries(o??{});for(let m of i){let f=t.extractTableLookup(m);if(f!==void 0){let{addressTableLookup:S,drainedKeys:C}=f;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),a.writable.push(...C.writable),a.readonly.push(...C.readonly);}}let[s,d]=t.getMessageComponents(),g=new jr(d,a).compileInstructions(r);return {version:0,header:s,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function i0({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=jA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(Pu(o))}async function p0({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,signers:t,additionalSigners:c,secp256r1VerifyInput:a,addressesByLookupTableAddress:i,cachedAccounts:s,compressed:d=false,simulateProof:u=false}){let{instructions:g,addressLookupTableAccounts:m}=await _A({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,additionalSigners:c,transactionMessageBytes:o,secp256r1VerifyInput:a,compressed:d,addressesByLookupTableAddress:i,simulateProof:u,cachedAccounts:s});return {payer:e,instructions:g,addressesByLookupTableAddress:m}}export{Jc as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,FD as AdditionalSignersSchema,Iu as AuthenticationContextSchema,Cu as BaseResponseSchema,da as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,ta as CHANGE_CONFIG_DISCRIMINATOR,la as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,Pa as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,_a as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Wa as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Na as CREATE_USER_ACCOUNTS_DISCRIMINATOR,nw as CompleteMessageRequestSchema,sw as CompleteSendTransactionRequestSchema,ow as CompleteTransactionRequestSchema,Ga as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Ya as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,ds as DOMAIN_CONFIG_DISCRIMINATOR,ri as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,ai as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,pi as EDIT_USER_DELEGATE_DISCRIMINATOR,ls as GLOBAL_COUNTER_DISCRIMINATOR,Jt as KeyType,NE as MULTI_WALLET_ERROR__ALREADY_DELEGATED,mE as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,_D as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,oD as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,cD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,aD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,RD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,wD as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,yE as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,TE as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,RE as MULTI_WALLET_ERROR__EMPTY_MEMBERS,pD as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,PE as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,lE as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,EE as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,qE as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,JE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,YE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,gD as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,VE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,wE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,HE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,kE as MULTI_WALLET_ERROR__INVALID_ACCOUNT,MD as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,uD as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,hE as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,LE as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,jE as MULTI_WALLET_ERROR__INVALID_BUFFER,mD as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,FE as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,UE as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,xE as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,iE as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,AE as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,aE as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,uE as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,nD as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,tD as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,_E as MULTI_WALLET_ERROR__INVALID_THRESHOLD,DD as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,DE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,CE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,vE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,kD as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,WE as MULTI_WALLET_ERROR__INVALID_USER_ROLE,UD as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,ED as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,gE as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,$E as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,iD as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,yD as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,hD as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,OE as MULTI_WALLET_ERROR__MISSING_ACCOUNT,lD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,xD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,WD as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,CD as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,TD as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,BE as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,BD as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,OD as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,AD as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,LD as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,ID as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,eD as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,bD as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,ND as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,zE as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,ME as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,SE as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,IE as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,dD as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,SD as MULTI_WALLET_ERROR__PAYER_MISMATCH,fE as MULTI_WALLET_ERROR__PERMANENT_MEMBER,QE as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,pE as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,fD as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,dE as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,rD as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,PD as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,bE as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,ZE as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,XE as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,sD as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,KE as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,vD as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,GE as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,oE as MultiWalletAccount,sE as MultiWalletInstruction,Ei as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,fi as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Re as Permission,ve as Permissions,_c as SETTINGS_DISCRIMINATOR,Ue as Secp256r1Key,_ as SignedSecp256r1Key,Su as StartMessageRequestSchema,xu as StartTransactionRequestSchema,Ni as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,_i as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Yi as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,Gi as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,ad as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,td as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Oc as TRANSACTION_BUFFER_DISCRIMINATOR,Sd as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,pd as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,vd as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Pd as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Gd as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Bd as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,tu as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,Yd as TRANSACTION_EXECUTE_DISCRIMINATOR,pu as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,au as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,fu as TransactionActionTypeSchema,GD as TransactionDetailsSchema,rw as TransactionPayloadSchema,VD as TransactionPayloadWithBase64MessageBytesSchema,go as Transports,HD as UserInfoSchema,_e as UserRole,Fc as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,YN as addWhitelistedAddressTrees,me as base64URLStringToBuffer,Xw as bufferToBase64URLString,F5 as changeConfig,Q6 as closeTransactionBuffer,PR as configAction,e2 as convertBase64StringToJWK,$w as convertJWKToBase64String,IA as convertMemberKeyToString,Kw as convertPubkeyCompressedToCose,zw as convertPubkeyCoseToCompressed,Jw as createClientAuthorizationCompleteRequestChallenge,qw as createClientAuthorizationStartRequestChallenge,aH as createDomainConfig,fH as createDomainUserAccounts,CH as createGlobalCounter,Yw as createMessageChallenge,BA as createTransactionBuffer,Zw as createTransactionChallenge,Rh as createTransactionManagerSigner,Y5 as createUserAccounts,r6 as createWallet,As as decodeDomainConfig,ys as decodeGlobalCounter,vc as decodeSettings,Nc as decodeTransactionBuffer,zc as decodeWhitelistedAddressTree,g6 as decompressSettingsAccount,K8 as deserializeConfigActions,hH as disableDomainConfig,S6 as editDomainConfig,P6 as editTransactionManagerUrl,L6 as editUserDelegate,bA as executeTransaction,NA as executeTransactionBuffer,_A as executeTransactionSync,wA as extendTransactionBuffer,GR as extensionStruct,CM as fetchAllDomainConfig,bM as fetchAllGlobalCounter,cg as fetchAllMaybeDomainConfig,Cg as fetchAllMaybeGlobalCounter,A1 as fetchAllMaybeSettings,v1 as fetchAllMaybeTransactionBuffer,X1 as fetchAllMaybeWhitelistedAddressTree,mU as fetchAllSettings,X2 as fetchAllSettingsAccountByMember,xU as fetchAllTransactionBuffer,PU as fetchAllWhitelistedAddressTree,sA as fetchCompressedAccount,gs as fetchDomainConfig,RM as fetchGlobalCounter,sg as fetchMaybeDomainConfig,Ig as fetchMaybeGlobalCounter,po as fetchMaybeSettings,ah as fetchMaybeSettingsAccountData,_1 as fetchMaybeTransactionBuffer,ch as fetchMaybeUserAccountData,Z1 as fetchMaybeWhitelistedAddressTree,pU as fetchSettings,Hr as fetchSettingsAccountData,wc as fetchTransactionBuffer,Z2 as fetchUserAccountByFilters,rr as fetchUserAccountData,Kc as fetchWhitelistedAddressTree,BM as getAddMemberArgsCodec,Xr as getAddMemberArgsDecoder,Zr as getAddMemberArgsEncoder,FU as getAddWhitelistedAddressTreesDiscriminatorBytes,zU as getAddWhitelistedAddressTreesInstruction,Zc as getAddWhitelistedAddressTreesInstructionAsync,GU as getAddWhitelistedAddressTreesInstructionDataCodec,Yc as getAddWhitelistedAddressTreesInstructionDataDecoder,Io as getAddWhitelistedAddressTreesInstructionDataEncoder,kM as getAdditionalMetadataCodec,Yr as getAdditionalMetadataDecoder,Jr as getAdditionalMetadataEncoder,ak as getChangeConfigCompressedDiscriminatorBytes,ga as getChangeConfigCompressedInstruction,ik as getChangeConfigCompressedInstructionDataCodec,Aa as getChangeConfigCompressedInstructionDataDecoder,ua as getChangeConfigCompressedInstructionDataEncoder,QU as getChangeConfigDiscriminatorBytes,oa as getChangeConfigInstruction,$U as getChangeConfigInstructionDataCodec,na as getChangeConfigInstructionDataDecoder,ra as getChangeConfigInstructionDataEncoder,Go as getClientAndDeviceHash,HM as getCompiledInstructionCodec,$r as getCompiledInstructionDecoder,Qr as getCompiledInstructionEncoder,zM as getCompressedAccountMetaCodec,yt as getCompressedAccountMetaDecoder,Tt as getCompressedAccountMetaEncoder,JM as getCompressedAccountMetaReadOnlyCodec,It as getCompressedAccountMetaReadOnlyDecoder,xt as getCompressedAccountMetaReadOnlyEncoder,XM as getCompressedOnlyExtensionCodec,tn as getCompressedOnlyExtensionDecoder,en as getCompressedOnlyExtensionEncoder,eR as getCompressedProofCodec,an as getCompressedProofDecoder,cn as getCompressedProofEncoder,oe as getCompressedSettingsAddress,oR as getCompressedSettingsCodec,iR as getCompressedSettingsDataCodec,un as getCompressedSettingsDataDecoder,dn as getCompressedSettingsDataEncoder,j as getCompressedSettingsDecoder,Ct as getCompressedSettingsEncoder,gR as getCompressedTokenArgsCodec,ht as getCompressedTokenArgsDecoder,Pt as getCompressedTokenArgsEncoder,TR as getCompressibleExtensionCodec,yn as getCompressibleExtensionDecoder,Tn as getCompressibleExtensionEncoder,xR as getCompressionInfoCodec,Sn as getCompressionInfoDecoder,fn as getCompressionInfoEncoder,DR as getConfigActionCodec,Ge as getConfigActionDecoder,Fe as getConfigActionEncoder,Tk as getCreateCompressedWalletDiscriminatorBytes,fk as getCreateCompressedWalletInstruction,ya as getCreateCompressedWalletInstructionAsync,yk as getCreateCompressedWalletInstructionDataCodec,Ta as getCreateCompressedWalletInstructionDataDecoder,Co as getCreateCompressedWalletInstructionDataEncoder,hk as getCreateDomainConfigDiscriminatorBytes,Rk as getCreateDomainConfigInstruction,Ma as getCreateDomainConfigInstructionAsync,Mk as getCreateDomainConfigInstructionDataCodec,ha as getCreateDomainConfigInstructionDataDecoder,Do as getCreateDomainConfigInstructionDataEncoder,Ok as getCreateDomainUserAccountDiscriminatorBytes,Nk as getCreateDomainUserAccountInstruction,Ua as getCreateDomainUserAccountInstructionAsync,Bk as getCreateDomainUserAccountInstructionDataCodec,va as getCreateDomainUserAccountInstructionDataDecoder,Po as getCreateDomainUserAccountInstructionDataEncoder,Kk as getCreateGlobalCounterDiscriminatorBytes,qk as getCreateGlobalCounterInstruction,Oa as getCreateGlobalCounterInstructionAsync,jk as getCreateGlobalCounterInstructionDataCodec,La as getCreateGlobalCounterInstructionDataDecoder,Mo as getCreateGlobalCounterInstructionDataEncoder,_R as getCreateUserAccountArgsCodec,vn as getCreateUserAccountArgsDecoder,_n as getCreateUserAccountArgsEncoder,tW as getCreateUserAccountsDiscriminatorBytes,nW as getCreateUserAccountsInstruction,Ha as getCreateUserAccountsInstructionAsync,rW as getCreateUserAccountsInstructionDataCodec,wa as getCreateUserAccountsInstructionDataDecoder,bo as getCreateUserAccountsInstructionDataEncoder,AW as getDecompressSettingsAccountDiscriminatorBytes,ja as getDecompressSettingsAccountInstruction,gW as getDecompressSettingsAccountInstructionDataCodec,Ka as getDecompressSettingsAccountInstructionDataDecoder,za as getDecompressSettingsAccountInstructionDataEncoder,SW as getDisableDomainConfigDiscriminatorBytes,Qa as getDisableDomainConfigInstruction,xW as getDisableDomainConfigInstructionDataCodec,Xa as getDisableDomainConfigInstructionDataDecoder,Za as getDisableDomainConfigInstructionDataEncoder,dt as getDomainConfigAddress,IM as getDomainConfigCodec,us as getDomainConfigDecoder,xM as getDomainConfigDiscriminatorBytes,og as getDomainConfigEncoder,EM as getDomainConfigSize,RW as getEditDomainConfigDiscriminatorBytes,oi as getEditDomainConfigInstruction,_W as getEditDomainConfigInstructionAsync,bW as getEditDomainConfigInstructionDataCodec,ni as getEditDomainConfigInstructionDataDecoder,vo as getEditDomainConfigInstructionDataEncoder,WR as getEditMemberArgsCodec,Mn as getEditMemberArgsDecoder,hn as getEditMemberArgsEncoder,NW as getEditTransactionManagerUrlDiscriminatorBytes,ui as getEditTransactionManagerUrlInstruction,wW as getEditTransactionManagerUrlInstructionDataCodec,di as getEditTransactionManagerUrlInstructionDataDecoder,ii as getEditTransactionManagerUrlInstructionDataEncoder,qW as getEditUserDelegateDiscriminatorBytes,Ti as getEditUserDelegateInstruction,JW as getEditUserDelegateInstructionDataCodec,li as getEditUserDelegateInstructionDataDecoder,mi as getEditUserDelegateInstructionDataEncoder,NR as getExpectedSignerCodec,bt as getExpectedSignerDecoder,Rt as getExpectedSignerEncoder,FR as getExtensionStructCodec,Mt as getExtensionStructDecoder,An as getExtensionStructEncoder,TA as getGlobalCounterAddress,MM as getGlobalCounterCodec,Ts as getGlobalCounterDecoder,hM as getGlobalCounterDiscriminatorBytes,xg as getGlobalCounterEncoder,_M as getGlobalCounterSize,Fo as getJitoTipsConfig,u8 as getLightCpiSigner,We as getLightProtocolRpc,JR as getLinkWalletArgsCodec,Gn as getLinkWalletArgsDecoder,Fn as getLinkWalletArgsEncoder,QR as getMemberCodec,Dt as getMemberDecoder,Et as getMemberEncoder,tb as getMemberKeyCodec,$ as getMemberKeyDecoder,H as getMemberKeyEncoder,BN as getMultiWalletErrorMessage,gL as getNativeTransferIntentCompressedDiscriminatorBytes,hi as getNativeTransferIntentCompressedInstruction,pL as getNativeTransferIntentCompressedInstructionDataCodec,Pi as getNativeTransferIntentCompressedInstructionDataDecoder,Di as getNativeTransferIntentCompressedInstructionDataEncoder,rL as getNativeTransferIntentDiscriminatorBytes,xi as getNativeTransferIntentInstruction,oL as getNativeTransferIntentInstructionAsync,nL as getNativeTransferIntentInstructionDataCodec,Si as getNativeTransferIntentInstructionDataDecoder,Uo as getNativeTransferIntentInstructionDataEncoder,sb as getNewAuthorityArgsCodec,qn as getNewAuthorityArgsDecoder,jn as getNewAuthorityArgsEncoder,Qw as getOriginIndex,ib as getPackedAddressTreeInfoCodec,kt as getPackedAddressTreeInfoDecoder,Ut as getPackedAddressTreeInfoEncoder,Ab as getPackedMerkleContextCodec,pn as getPackedMerkleContextDecoder,gn as getPackedMerkleContextEncoder,mb as getPackedStateTreeInfoCodec,St as getPackedStateTreeInfoDecoder,ft as getPackedStateTreeInfoEncoder,yb as getPausableAccountExtensionCodec,kn as getPausableAccountExtensionDecoder,Un as getPausableAccountExtensionEncoder,xb as getPermanentDelegateAccountExtensionCodec,Ln as getPermanentDelegateAccountExtensionDecoder,Wn as getPermanentDelegateAccountExtensionEncoder,Eb as getPermissionsCodec,we as getPermissionsDecoder,Ne as getPermissionsEncoder,Mb as getProofArgsCodec,D as getProofArgsDecoder,E as getProofArgsEncoder,vb as getRemoveMemberArgsCodec,bn as getRemoveMemberArgsDecoder,Rn as getRemoveMemberArgsEncoder,Wb as getRentConfigCodec,En as getRentConfigDecoder,Cn as getRentConfigEncoder,zo as getSecp256r1MessageHash,Bb as getSecp256r1PubkeyCodec,Wt as getSecp256r1PubkeyDecoder,Zn as getSecp256r1PubkeyEncoder,Fh as getSecp256r1SignatureOffsetsDataDecoder,Vh as getSecp256r1SignatureOffsetsDataEncoder,Hb as getSecp256r1VerifyArgsCodec,F as getSecp256r1VerifyArgsDecoder,V as getSecp256r1VerifyArgsEncoder,zb as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,Qn as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,Xn as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,w as getSecp256r1VerifyInstruction,wH as getSecp256r1VerifyInstructionDataCodec,MA as getSecp256r1VerifyInstructionDataDecoder,RA as getSecp256r1VerifyInstructionDataEncoder,vu as getSendAndConfirmTransaction,gU as getSettingsCodec,Ir as getSettingsDecoder,AU as getSettingsDiscriminatorBytes,u1 as getSettingsEncoder,Ce as getSettingsFromIndex,Zb as getSettingsIndexWithAddressAndDelegateInfoCodec,ro as getSettingsIndexWithAddressAndDelegateInfoDecoder,to as getSettingsIndexWithAddressAndDelegateInfoEncoder,qb as getSettingsIndexWithAddressCodec,eo as getSettingsIndexWithAddressDecoder,$n as getSettingsIndexWithAddressEncoder,e_ as getSettingsMutArgsCodec,K as getSettingsMutArgsDecoder,z as getSettingsMutArgsEncoder,o_ as getSettingsReadonlyArgsCodec,Ot as getSettingsReadonlyArgsDecoder,Lt as getSettingsReadonlyArgsEncoder,jw as getSignedSecp256r1Key,G8 as getSignedTransactionManager,Y as getSolanaRpc,_u as getSolanaRpcEndpoint,a_ as getSplInterfacePdaArgsCodec,Nt as getSplInterfacePdaArgsDecoder,Bt as getSplInterfacePdaArgsEncoder,A_ as getTokenMetadataCodec,Bn as getTokenMetadataDecoder,On as getTokenMetadataEncoder,vL as getTokenTransferIntentCompressedDiscriminatorBytes,Hi as getTokenTransferIntentCompressedInstruction,kL as getTokenTransferIntentCompressedInstructionAsync,UL as getTokenTransferIntentCompressedInstructionDataCodec,wi as getTokenTransferIntentCompressedInstructionDataDecoder,Oo as getTokenTransferIntentCompressedInstructionDataEncoder,IL as getTokenTransferIntentDiscriminatorBytes,Ui as getTokenTransferIntentInstruction,EL as getTokenTransferIntentInstructionAsync,CL as getTokenTransferIntentInstructionDataCodec,vi as getTokenTransferIntentInstructionDataDecoder,Lo as getTokenTransferIntentInstructionDataEncoder,yA as getTransactionBufferAddress,ZL as getTransactionBufferCloseCompressedDiscriminatorBytes,Qi as getTransactionBufferCloseCompressedInstruction,XL as getTransactionBufferCloseCompressedInstructionDataCodec,Xi as getTransactionBufferCloseCompressedInstructionDataDecoder,Zi as getTransactionBufferCloseCompressedInstructionDataEncoder,VL as getTransactionBufferCloseDiscriminatorBytes,ji as getTransactionBufferCloseInstruction,FL as getTransactionBufferCloseInstructionDataCodec,Ki as getTransactionBufferCloseInstructionDataDecoder,zi as getTransactionBufferCloseInstructionDataEncoder,SU as getTransactionBufferCodec,l_ as getTransactionBufferCreateArgsCodec,Ht as getTransactionBufferCreateArgsDecoder,wt as getTransactionBufferCreateArgsEncoder,mO as getTransactionBufferCreateCompressedDiscriminatorBytes,ud as getTransactionBufferCreateCompressedInstruction,lO as getTransactionBufferCreateCompressedInstructionDataCodec,dd as getTransactionBufferCreateCompressedInstructionDataDecoder,id as getTransactionBufferCreateCompressedInstructionDataEncoder,sO as getTransactionBufferCreateDiscriminatorBytes,od as getTransactionBufferCreateInstruction,cO as getTransactionBufferCreateInstructionDataCodec,nd as getTransactionBufferCreateInstructionDataDecoder,rd as getTransactionBufferCreateInstructionDataEncoder,Bc as getTransactionBufferDecoder,fU as getTransactionBufferDiscriminatorBytes,b1 as getTransactionBufferEncoder,UO as getTransactionBufferExecuteCompressedDiscriminatorBytes,Cd as getTransactionBufferExecuteCompressedInstruction,kO as getTransactionBufferExecuteCompressedInstructionDataCodec,Id as getTransactionBufferExecuteCompressedInstructionDataDecoder,xd as getTransactionBufferExecuteCompressedInstructionDataEncoder,EO as getTransactionBufferExecuteDiscriminatorBytes,Td as getTransactionBufferExecuteInstruction,DO as getTransactionBufferExecuteInstructionDataCodec,ld as getTransactionBufferExecuteInstructionDataDecoder,md as getTransactionBufferExecuteInstructionDataEncoder,JO as getTransactionBufferExtendCompressedDiscriminatorBytes,Wd as getTransactionBufferExtendCompressedInstruction,YO as getTransactionBufferExtendCompressedInstructionDataCodec,kd as getTransactionBufferExtendCompressedInstructionDataDecoder,Ud as getTransactionBufferExtendCompressedInstructionDataEncoder,HO as getTransactionBufferExtendDiscriminatorBytes,Rd as getTransactionBufferExtendInstruction,VO as getTransactionBufferExtendInstructionDataCodec,Md as getTransactionBufferExtendInstructionDataDecoder,hd as getTransactionBufferExtendInstructionDataEncoder,gB as getTransactionBufferVoteCompressedDiscriminatorBytes,jd as getTransactionBufferVoteCompressedInstruction,pB as getTransactionBufferVoteCompressedInstructionDataCodec,Kd as getTransactionBufferVoteCompressedInstructionDataDecoder,zd as getTransactionBufferVoteCompressedInstructionDataEncoder,nB as getTransactionBufferVoteDiscriminatorBytes,Hd as getTransactionBufferVoteInstruction,oB as getTransactionBufferVoteInstructionDataCodec,wd as getTransactionBufferVoteInstructionDataDecoder,Nd as getTransactionBufferVoteInstructionDataEncoder,RB as getTransactionExecuteCompressedDiscriminatorBytes,ou as getTransactionExecuteCompressedInstruction,bB as getTransactionExecuteCompressedInstructionDataCodec,nu as getTransactionExecuteCompressedInstructionDataDecoder,ru as getTransactionExecuteCompressedInstructionDataEncoder,xB as getTransactionExecuteDiscriminatorBytes,Qd as getTransactionExecuteInstruction,IB as getTransactionExecuteInstructionDataCodec,Xd as getTransactionExecuteInstructionDataDecoder,Zd as getTransactionExecuteInstructionDataEncoder,jB as getTransactionExecuteSyncCompressedDiscriminatorBytes,Tu as getTransactionExecuteSyncCompressedInstruction,qB as getTransactionExecuteSyncCompressedInstructionDataCodec,lu as getTransactionExecuteSyncCompressedInstructionDataDecoder,mu as getTransactionExecuteSyncCompressedInstructionDataEncoder,BB as getTransactionExecuteSyncDiscriminatorBytes,uu as getTransactionExecuteSyncInstruction,NB as getTransactionExecuteSyncInstructionDataCodec,du as getTransactionExecuteSyncInstructionDataDecoder,iu as getTransactionExecuteSyncInstructionDataEncoder,C_ as getTransactionMessageAddressTableLookupCodec,Ao as getTransactionMessageAddressTableLookupDecoder,uo as getTransactionMessageAddressTableLookupEncoder,S_ as getTransactionMessageCodec,Ft as getTransactionMessageDecoder,Vt as getTransactionMessageEncoder,h_ as getTransactionSyncSignersCodec,J as getTransactionSyncSignersDecoder,q as getTransactionSyncSignersEncoder,v_ as getTransferFeeAccountExtensionCodec,wn as getTransferFeeAccountExtensionDecoder,Nn as getTransferFeeAccountExtensionEncoder,W_ as getTransferHookAccountExtensionCodec,Vn as getTransferHookAccountExtensionDecoder,Hn as getTransferHookAccountExtensionEncoder,B_ as getTransportsCodec,zt as getTransportsDecoder,Gt as getTransportsEncoder,N as getUserAccountAddress,V_ as getUserCodec,K_ as getUserCreationArgsCodec,he as getUserCreationArgsDecoder,Pe as getUserCreationArgsEncoder,X as getUserDecoder,Kt as getUserEncoder,Y_ as getUserMutArgsCodec,Xe as getUserMutArgsDecoder,Ze as getUserMutArgsEncoder,$_ as getUserReadOnlyArgsCodec,vt as getUserReadOnlyArgsDecoder,_t as getUserReadOnlyArgsEncoder,nv as getUserReadOnlyOrMutateArgsCodec,Ve as getUserReadOnlyOrMutateArgsDecoder,He as getUserReadOnlyOrMutateArgsEncoder,iv as getUserRoleCodec,Ke as getUserRoleDecoder,ze as getUserRoleEncoder,d8 as getWalletAddressFromIndex,be as getWalletAddressFromSettings,DU as getWhitelistedAddressTreeCodec,Gc as getWhitelistedAddressTreeDecoder,EU as getWhitelistedAddressTreeDiscriminatorBytes,Y1 as getWhitelistedAddressTreeEncoder,Xo as getWhitelistedAddressTreeFromIndex,Q2 as getWhitelistedAddressTreeIndexFromAddress,cA as getWhitelistedAddressTreesAddress,_N as identifyMultiWalletAccount,vN as identifyMultiWalletInstruction,bw as initialize,hR as isConfigAction,zR as isExtensionStruct,NN as isMultiWalletError,R_ as isTransactionSyncSigners,sv as isUserReadOnlyOrMutateArgs,l5 as nativeTransferIntent,KU as parseAddWhitelistedAddressTreesInstruction,dk as parseChangeConfigCompressedInstruction,ek as parseChangeConfigInstruction,Sk as parseCreateCompressedWalletInstruction,bk as parseCreateDomainConfigInstruction,wk as parseCreateDomainUserAccountInstruction,Jk as parseCreateGlobalCounterInstruction,oW as parseCreateUserAccountsInstruction,pW as parseDecompressSettingsAccountInstruction,IW as parseDisableDomainConfigInstruction,vW as parseEditDomainConfigInstruction,HW as parseEditTransactionManagerUrlInstruction,YW as parseEditUserDelegateInstruction,mL as parseNativeTransferIntentCompressedInstruction,sL as parseNativeTransferIntentInstruction,HH as parseSecp256r1VerifyInstruction,WL as parseTokenTransferIntentCompressedInstruction,DL as parseTokenTransferIntentInstruction,QL as parseTransactionBufferCloseCompressedInstruction,GL as parseTransactionBufferCloseInstruction,TO as parseTransactionBufferCreateCompressedInstruction,aO as parseTransactionBufferCreateInstruction,WO as parseTransactionBufferExecuteCompressedInstruction,PO as parseTransactionBufferExecuteInstruction,ZO as parseTransactionBufferExtendCompressedInstruction,FO as parseTransactionBufferExtendInstruction,mB as parseTransactionBufferVoteCompressedInstruction,sB as parseTransactionBufferVoteInstruction,_B as parseTransactionExecuteCompressedInstruction,CB as parseTransactionExecuteInstruction,JB as parseTransactionExecuteSyncCompressedInstruction,wB as parseTransactionExecuteSyncInstruction,x8 as pollJitoBundleConfirmation,VV as prepareChangeConfigArgs,YV as prepareTransactionBundle,i0 as prepareTransactionMessage,p0 as prepareTransactionSync,F8 as retrieveTransactionManager,Ah as sendJitoBundle,z8 as serializeConfigActions,S8 as signAndSendBundledTransactions,M8 as signAndSendTransaction,_5 as tokenTransferIntent,M_ as transactionSyncSigners,ov as userReadOnlyOrMutateArgs,hu as vaultTransactionMessageDeserialize,Pu as vaultTransactionMessageSerialize,HA as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
1
|
+
import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getOptionEncoder,getOptionDecoder,getArrayEncoder,getU64Encoder,getArrayDecoder,getU64Decoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getU16Encoder,getU16Decoder,getBooleanEncoder,getBooleanDecoder,getEnumEncoder,getEnumDecoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64Encoder,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 g from'zod';import {create,nullable}from'superstruct';import {getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTokenDecoder,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 ss=new Uint8Array([201,232,212,229,59,241,106,197]);function dD(){return fixEncoderSize(getBytesEncoder(),8).encode(ss)}function Du(){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:ss}))}function os(){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 uD(){return combineCodec(Du(),os())}function cs(e){return decodeAccount(e,os())}async function as(e,n,r){let s=await Mu(e,n,r);return assertAccountExists(s),s}async function Mu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return cs(s)}async function AD(e,n,r){let s=await Ru(e,n,r);return assertAccountsExist(s),s}async function Ru(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>cs(t))}function gD(){return 846}var us=new Uint8Array([42,206,176,58,175,129,130,233]);function TD(){return fixEncoderSize(getBytesEncoder(),8).encode(us)}function Hu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:us}))}function As(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function mD(){return combineCodec(Hu(),As())}function gs(e){return decodeAccount(e,As())}async function lD(e,n,r){let s=await Vu(e,n,r);return assertAccountExists(s),s}async function Vu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return gs(s)}async function fD(e,n,r){let s=await Gu(e,n,r);return assertAccountsExist(s),s}async function Gu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>gs(t))}function SD(){return 24}function _r(){return getStructEncoder([["memberKey",B()],["permissions",_e()],["userArgs",Ue()]])}function vr(){return getStructDecoder([["memberKey",J()],["permissions",ve()],["userArgs",Le()]])}function CD(){return combineCodec(_r(),vr())}function Ur(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Lr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function RD(){return combineCodec(Ur(),Lr())}function ct(){return getStructEncoder([["treeInfo",it()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function at(){return getStructDecoder([["treeInfo",dt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function _D(){return combineCodec(ct(),at())}function ut(){return getStructEncoder([["treeInfo",it()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function At(){return getStructDecoder([["treeInfo",dt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function WD(){return combineCodec(ut(),At())}function wr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function kr(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function ND(){return combineCodec(wr(),kr())}function gt(){return getStructEncoder([["data",getOptionEncoder(Hr())]])}function Y(){return getStructDecoder([["data",getOptionDecoder(Vr())]])}function VD(){return combineCodec(gt(),Y())}function Hr(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(yt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function Vr(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(pt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function KD(){return combineCodec(Hr(),Vr())}function We(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(zr())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(_r())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(jr())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Oe(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Kr())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(vr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(qr())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function YD(){return combineCodec(We(),Oe())}function XD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function ZD(e,n){return n.__kind===e}function Jr(){return getStructEncoder([["member",getAddressEncoder()],["role",Be()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Se()]])}function Yr(){return getStructDecoder([["member",getAddressDecoder()],["role",Ne()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",xe()]])}function tM(){return combineCodec(Jr(),Yr())}function zr(){return getStructEncoder([["memberKey",B()],["permissions",_e()]])}function Kr(){return getStructDecoder([["memberKey",J()],["permissions",ve()]])}function oM(){return combineCodec(zr(),Kr())}function Tt(){return getStructEncoder([["memberKey",B()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function mt(){return getStructDecoder([["memberKey",J()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function dM(){return combineCodec(Tt(),mt())}function Xr(){return getStructEncoder([["settingsMutArgs",k()],["transactionManager",getOptionEncoder(lt())]])}function Zr(){return getStructDecoder([["settingsMutArgs",H()],["transactionManager",getOptionDecoder(ft())]])}function yM(){return combineCodec(Xr(),Zr())}function yt(){return getStructEncoder([["pubkey",B()],["role",getU8Encoder()],["permissions",_e()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function pt(){return getStructDecoder([["pubkey",J()],["role",getU8Decoder()],["permissions",ve()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function lM(){return combineCodec(yt(),pt())}function B(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function J(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function xM(){return combineCodec(B(),J())}function en(){return getStructEncoder([["authorityCreationArgs",Se()],["compressedProofArgs",R()]])}function tn(){return getStructDecoder([["authorityCreationArgs",xe()],["compressedProofArgs",h()]])}function DM(){return combineCodec(en(),tn())}function St(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function xt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function hM(){return combineCodec(St(),xt())}function it(){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 _M(){return combineCodec(it(),dt())}function _e(){return getStructEncoder([["mask",getU8Encoder()]])}function ve(){return getStructDecoder([["mask",getU8Decoder()]])}function LM(){return combineCodec(_e(),ve())}function R(){return getStructEncoder([["proof",getOptionEncoder(wr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function h(){return getStructDecoder([["proof",getOptionDecoder(kr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function NM(){return combineCodec(R(),h())}function jr(){return getStructEncoder([["memberKey",B()],["userArgs",Ue()]])}function qr(){return getStructDecoder([["memberKey",J()],["userArgs",Le()]])}function VM(){return combineCodec(jr(),qr())}function rn(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function It(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function zM(){return combineCodec(rn(),It())}function N(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function w(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function qM(){return combineCodec(N(),w())}function nn(){return getStructEncoder([["verifyArgs",N()],["domainConfigIndex",getU8Encoder()]])}function sn(){return getStructDecoder([["verifyArgs",w()],["domainConfigIndex",getU8Decoder()]])}function ZM(){return combineCodec(nn(),sn())}function on(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function cn(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function eR(){return combineCodec(on(),cn())}function an(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function dn(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function nR(){return combineCodec(an(),dn())}function k(){return getStructEncoder([["accountMeta",ct()],["data",gt()]])}function H(){return getStructDecoder([["accountMeta",at()],["data",Y()]])}function aR(){return combineCodec(k(),H())}function Et(){return getStructEncoder([["accountMeta",ut()],["data",gt()]])}function Ct(){return getStructDecoder([["accountMeta",At()],["data",Y()]])}function AR(){return combineCodec(Et(),Ct())}function Dt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(Tt())]])}function Mt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(mt())]])}function TR(){return combineCodec(Dt(),Mt())}function Rt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(Ur())],["addressTableLookups",getArrayEncoder(un())]])}function ht(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Lr())],["addressTableLookups",getArrayDecoder(An())]])}function SR(){return combineCodec(Rt(),ht())}function un(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function An(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function ER(){return combineCodec(un(),An())}function G(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([nn()])]])]])}function F(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([sn()])]])]])}function RR(){return combineCodec(G(),F())}function hR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function PR(e,n){return n.__kind===e}var gn=(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))(gn||{});function Pt(){return getEnumEncoder(gn)}function bt(){return getEnumDecoder(gn)}function vR(){return combineCodec(Pt(),bt())}function _t(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",B()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(Pt()))],["wallets",getArrayEncoder(an())],["role",Be()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function K(){return getStructDecoder([["domainConfig",getOptionDecoder(getAddressDecoder())],["member",J()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(bt()))],["wallets",getArrayDecoder(dn())],["role",Ne()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function OR(){return combineCodec(_t(),K())}function Se(){return getStructEncoder([["addressTreeInfo",St()],["outputStateTreeIndex",getU8Encoder()]])}function xe(){return getStructDecoder([["addressTreeInfo",xt()],["outputStateTreeIndex",getU8Decoder()]])}function kR(){return combineCodec(Se(),xe())}function we(){return getStructEncoder([["accountMeta",ct()],["data",_t()]])}function ke(){return getStructDecoder([["accountMeta",at()],["data",K()]])}function FR(){return combineCodec(we(),ke())}function lt(){return getStructEncoder([["accountMeta",ut()],["data",_t()]])}function ft(){return getStructDecoder([["accountMeta",At()],["data",K()]])}function qR(){return combineCodec(lt(),ft())}function Ue(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([lt()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([we()])]])]])}function Le(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([ft()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([ke()])]])]])}function ZR(){return combineCodec(Ue(),Le())}function $R(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function QR(e,n){return n.__kind===e}var De=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(De||{});function Be(){return getEnumEncoder(De)}function Ne(){return getEnumDecoder(De)}function rh(){return combineCodec(Be(),Ne())}var no=new Uint8Array([223,179,163,190,177,224,67,173]);function Kh(){return fixEncoderSize(getBytesEncoder(),8).encode(no)}function up(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(yt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:no}))}function or(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(pt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function jh(){return combineCodec(up(),or())}function so(e){return decodeAccount(e,or())}async function qh(e,n,r){let s=await yn(e,n,r);return assertAccountExists(s),s}async function yn(e,n,r){let s=await fetchEncodedAccount(e,n,r);return so(s)}async function Jh(e,n,r){let s=await Ap(e,n,r);return assertAccountsExist(s),s}async function Ap(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>so(t))}var uo=new Uint8Array([90,36,35,219,93,225,110,96]);function $h(){return fixEncoderSize(getBytesEncoder(),8).encode(uo)}function bp(){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",B()],["executor",B()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(B())],["expectedSigners",getArrayEncoder(Tt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:uo}))}function Ao(){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",J()],["executor",J()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(J())],["expectedSigners",getArrayDecoder(mt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Qh(){return combineCodec(bp(),Ao())}function go(e){return decodeAccount(e,Ao())}async function yo(e,n,r){let s=await _p(e,n,r);return assertAccountExists(s),s}async function _p(e,n,r){let s=await fetchEncodedAccount(e,n,r);return go(s)}async function eP(e,n,r){let s=await vp(e,n,r);return assertAccountsExist(s),s}async function vp(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>go(t))}var mo=new Uint8Array([105,23,173,2,197,255,80,87]);function nP(){return fixEncoderSize(getBytesEncoder(),8).encode(mo)}function Yp(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:mo}))}function lo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function sP(){return combineCodec(Yp(),lo())}function fo(e){return decodeAccount(e,lo())}async function So(e,n,r){let s=await Xp(e,n,r);return assertAccountExists(s),s}async function Xp(e,n,r){let s=await fetchEncodedAccount(e,n,r);return fo(s)}async function oP(e,n,r){let s=await Zp(e,n,r);return assertAccountsExist(s),s}async function Zp(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>fo(t))}function T({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 j(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 m(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let s=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:j(r.value),role:xo(r.value)?upgradeRoleToSigner(s):s,...xo(r.value)?{signer:r.value}:{}})}}function xo(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Eo=new Uint8Array([8]);function EP(){return fixEncoderSize(getBytesEncoder(),1).encode(Eo)}function In(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Eo}))}function Co(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function CP(){return combineCodec(In(),Co())}async function Do(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.whitelistedAddressTrees),c(t.payer),c(t.systemProgram),...a],data:In().encode(o),programAddress:r})}function DP(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.whitelistedAddressTrees),c(t.payer),c(t.systemProgram),...a],data:In().encode(o),programAddress:r})}function MP(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:Co().decode(e.data)}}var bo=new Uint8Array([9]);function UP(){return fixEncoderSize(getBytesEncoder(),1).encode(bo)}function _o(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(We())],["signers",getArrayEncoder(G())],["compressedProofArgs",getOptionEncoder(R())]]),e=>({...e,discriminator:bo}))}function vo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Oe())],["signers",getArrayDecoder(F())],["compressedProofArgs",getOptionDecoder(h())]])}function LP(){return combineCodec(_o(),vo())}function Uo(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.payer),c(t.systemProgram),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:_o().encode(o),programAddress:r})}function WP(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:vo().decode(e.data)}}var No=new Uint8Array([19]);function VP(){return fixEncoderSize(getBytesEncoder(),1).encode(No)}function wo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(We())],["signers",getArrayEncoder(G())],["settingsMutArgs",k()],["compressedProofArgs",R()]]),e=>({...e,discriminator:No}))}function ko(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Oe())],["signers",getArrayDecoder(F())],["settingsMutArgs",H()],["compressedProofArgs",h()]])}function GP(){return combineCodec(wo(),ko())}function Ho(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:wo().encode(o),programAddress:r})}function FP(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:ko().decode(e.data)}}var Fo=new Uint8Array([18]);function XP(){return fixEncoderSize(getBytesEncoder(),1).encode(Fo)}function En(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",R()],["addressTreeInfo",St()],["outputStateTreeIndex",getU8Encoder()],["userArgs",Ue()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Fo}))}function zo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",h()],["addressTreeInfo",xt()],["outputStateTreeIndex",getU8Decoder()],["userArgs",Le()],["settingsIndex",getU128Decoder()]])}function ZP(){return combineCodec(En(),zo())}async function Ko(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.initialMember),c(t.systemProgram),c(t.globalCounter),c(t.whitelistedAddressTrees),...a],data:En().encode(o),programAddress:r})}function $P(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.initialMember),c(t.systemProgram),c(t.globalCounter),c(t.whitelistedAddressTrees),...a],data:En().encode(o),programAddress:r})}function QP(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:zo().decode(e.data)}}var Qo=new Uint8Array([0]);function cb(){return fixEncoderSize(getBytesEncoder(),1).encode(Qo)}function Dn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",Se()],["compressedProofArgs",R()]]),e=>({...e,discriminator:Qo}))}function ec(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",xe()],["compressedProofArgs",h()]])}function ab(){return combineCodec(Dn(),ec())}async function tc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.domainConfig),c(t.payer),c(t.authority),c(t.systemProgram),c(t.whitelistedAddressTrees),...a],data:Dn().encode(o),programAddress:r})}function ib(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.domainConfig),c(t.payer),c(t.authority),c(t.systemProgram),c(t.whitelistedAddressTrees),...a],data:Dn().encode(o),programAddress:r})}function db(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:ec().decode(e.data)}}var sc=new Uint8Array([4]);function mb(){return fixEncoderSize(getBytesEncoder(),1).encode(sc)}function Mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",R()],["member",rn()],["role",Be()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(Pt())],["userAccountCreationArgs",Se()],["linkWalletArgs",getOptionEncoder(Xr())]]),e=>({...e,discriminator:sc}))}function oc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",h()],["member",It()],["role",Ne()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(bt())],["userAccountCreationArgs",xe()],["linkWalletArgs",getOptionDecoder(Zr())]])}function lb(){return combineCodec(Mn(),oc())}async function cc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.domainConfig),c(t.authority),c(t.whitelistedAddressTrees),...a],data:Mn().encode(o),programAddress:r})}function fb(e,n){let r=n?.programAddress??u,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}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.domainConfig),c(t.authority),c(t.whitelistedAddressTrees),...a],data:Mn().encode(o),programAddress:r})}function Sb(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:oc().decode(e.data)}}var ic=new Uint8Array([3]);function Mb(){return fixEncoderSize(getBytesEncoder(),1).encode(ic)}function hn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:ic}))}function dc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function Rb(){return combineCodec(hn(),dc())}async function uc(e,n){let r=n?.programAddress??u,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={};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=T(o),a=m(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:hn().encode({}),programAddress:r})}function hb(e,n){let r=n?.programAddress??u,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=T(o),a=m(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:hn().encode({}),programAddress:r})}function Pb(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:dc().decode(e.data)}}var gc=new Uint8Array([5]);function Ob(){return fixEncoderSize(getBytesEncoder(),1).encode(gc)}function bn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",R()],["createUserArgs",getArrayEncoder(Jr())]]),e=>({...e,discriminator:gc}))}function yc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",h()],["createUserArgs",getArrayDecoder(Yr())]])}function Bb(){return combineCodec(bn(),yc())}async function pc(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.systemProgram),c(t.whitelistedAddressTrees),...a],data:bn().encode(o),programAddress:r})}function Nb(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.systemProgram),c(t.whitelistedAddressTrees),...a],data:bn().encode(o),programAddress:r})}function wb(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:yc().decode(e.data)}}var lc=new Uint8Array([17]);function Kb(){return fixEncoderSize(getBytesEncoder(),1).encode(lc)}function fc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",k()],["compressedProofArgs",R()],["signers",getArrayEncoder(G())]]),e=>({...e,discriminator:lc}))}function Sc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",H()],["compressedProofArgs",h()],["signers",getArrayDecoder(F())]])}function jb(){return combineCodec(fc(),Sc())}function xc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.payer),c(t.systemProgram),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:fc().encode(o),programAddress:r})}function qb(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Sc().decode(e.data)}}var Cc=new Uint8Array([2]);function Qb(){return fixEncoderSize(getBytesEncoder(),1).encode(Cc)}function Dc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:Cc}))}function Mc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function e_(){return combineCodec(Dc(),Mc())}function Rc(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.domainConfig),c(t.admin),...a],data:Dc().encode(o),programAddress:r})}function t_(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:Mc().decode(e.data)}}var _c=new Uint8Array([1]);function i_(){return fixEncoderSize(getBytesEncoder(),1).encode(_c)}function vn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(en())]]),e=>({...e,discriminator:_c}))}function vc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(tn())]])}function d_(){return combineCodec(vn(),vc())}async function u_(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.domainConfig),c(t.authority),c(t.newAuthority),c(t.whitelistedAddressTrees),c(t.systemProgram),...a],data:vn().encode(o),programAddress:r})}function Uc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.domainConfig),c(t.authority),c(t.newAuthority),c(t.whitelistedAddressTrees),c(t.systemProgram),...a],data:vn().encode(o),programAddress:r})}function A_(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:vc().decode(e.data)}}var Oc=new Uint8Array([6]);function f_(){return fixEncoderSize(getBytesEncoder(),1).encode(Oc)}function Bc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",we()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",R()]]),e=>({...e,discriminator:Oc}))}function Nc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",ke()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",h()]])}function S_(){return combineCodec(Bc(),Nc())}function wc(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.authority),...a],data:Bc().encode(o),programAddress:r})}function x_(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Nc().decode(e.data)}}var Vc=new Uint8Array([7]);function h_(){return fixEncoderSize(getBytesEncoder(),1).encode(Vc)}function Gc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",we()],["secp256r1VerifyArgs",getOptionEncoder(N())],["delegateTo",getOptionEncoder(on())],["oldSettingsMutArgs",getOptionEncoder(k())],["newSettingsMutArgs",getOptionEncoder(k())],["compressedProofArgs",R()]]),e=>({...e,discriminator:Vc}))}function Fc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",ke()],["secp256r1VerifyArgs",getOptionDecoder(w())],["delegateTo",getOptionDecoder(cn())],["oldSettingsMutArgs",getOptionDecoder(H())],["newSettingsMutArgs",getOptionDecoder(H())],["compressedProofArgs",h()]])}function P_(){return combineCodec(Gc(),Fc())}function zc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.feePayer),c(t.signer),c(t.oldSettings),c(t.newSettings),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.domainConfig),...a],data:Gc().encode(o),programAddress:r})}function b_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:Fc().decode(e.data)}}var jc=new Uint8Array([29]);function B_(){return fixEncoderSize(getBytesEncoder(),1).encode(jc)}function Un(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(G())]]),e=>({...e,discriminator:jc}))}function qc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(F())]])}function N_(){return combineCodec(Un(),qc())}async function w_(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};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(j(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.destination),c(t.systemProgram),...a],data:Un().encode(o),programAddress:r})}function Jc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.destination),c(t.systemProgram),...a],data:Un().encode(o),programAddress:r})}function k_(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:qc().decode(e.data)}}var Zc=new Uint8Array([27]);function j_(){return fixEncoderSize(getBytesEncoder(),1).encode(Zc)}function $c(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(G())],["settingsMutArgs",k()],["compressedProofArgs",R()]]),e=>({...e,discriminator:Zc}))}function Qc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(F())],["settingsMutArgs",H()],["compressedProofArgs",h()]])}function q_(){return combineCodec($c(),Qc())}function ea(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.destination),c(t.systemProgram),...a],data:$c().encode(o),programAddress:r})}function J_(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Qc().decode(e.data)}}var ra=new Uint8Array([30]);function tv(){return fixEncoderSize(getBytesEncoder(),1).encode(ra)}function Wn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(G())]]),e=>({...e,discriminator:ra}))}function na(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(F())]])}function rv(){return combineCodec(Wn(),na())}async function sa(e,n){let r=n?.programAddress??u,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},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};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(j(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(j(t.source.value)),getAddressEncoder().encode(j(t.tokenProgram.value)),getAddressEncoder().encode(j(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(j(t.destination.value)),getAddressEncoder().encode(j(t.tokenProgram.value)),getAddressEncoder().encode(j(t.mint.value))]})),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.sourceSplTokenAccount),c(t.destination),c(t.destinationSplTokenAccount),c(t.tokenProgram),c(t.mint),c(t.associatedTokenProgram),c(t.systemProgram),...a],data:Wn().encode(o),programAddress:r})}function nv(e,n){let r=n?.programAddress??u,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},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.sourceSplTokenAccount),c(t.destination),c(t.destinationSplTokenAccount),c(t.tokenProgram),c(t.mint),c(t.associatedTokenProgram),c(t.systemProgram),...a],data:Wn().encode(o),programAddress:r})}function sv(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),destination:r(),destinationSplTokenAccount:r(),tokenProgram:r(),mint:r(),associatedTokenProgram:r(),systemProgram:r()},data:na().decode(e.data)}}var ia=new Uint8Array([28]);function Av(){return fixEncoderSize(getBytesEncoder(),1).encode(ia)}function On(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(G())],["settingsMutArgs",k()],["compressedProofArgs",R()]]),e=>({...e,discriminator:ia}))}function da(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(F())],["settingsMutArgs",H()],["compressedProofArgs",h()]])}function gv(){return combineCodec(On(),da())}async function ua(e,n){let r=n?.programAddress??u,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},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};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(j(t.source.value)),getAddressEncoder().encode(j(t.tokenProgram.value)),getAddressEncoder().encode(j(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(j(t.destination.value)),getAddressEncoder().encode(j(t.tokenProgram.value)),getAddressEncoder().encode(j(t.mint.value))]})),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.sourceSplTokenAccount),c(t.destination),c(t.destinationSplTokenAccount),c(t.tokenProgram),c(t.mint),c(t.associatedTokenProgram),c(t.systemProgram),...a],data:On().encode(o),programAddress:r})}function yv(e,n){let r=n?.programAddress??u,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},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.sourceSplTokenAccount),c(t.destination),c(t.destinationSplTokenAccount),c(t.tokenProgram),c(t.mint),c(t.associatedTokenProgram),c(t.systemProgram),...a],data:On().encode(o),programAddress:r})}function pv(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),destination:r(),destinationSplTokenAccount:r(),tokenProgram:r(),mint:r(),associatedTokenProgram:r(),systemProgram:r()},data:da().decode(e.data)}}var ya=new Uint8Array([13]);function Iv(){return fixEncoderSize(getBytesEncoder(),1).encode(ya)}function pa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:ya}))}function Ta(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Ev(){return combineCodec(pa(),Ta())}function ma(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.payer),c(t.domainConfig),c(t.transactionBuffer),c(t.closer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:pa().encode(o),programAddress:r})}function Cv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ta().decode(e.data)}}var Sa=new Uint8Array([23]);function _v(){return fixEncoderSize(getBytesEncoder(),1).encode(Sa)}function xa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())],["settingsMutArgs",k()],["compressedProofArgs",R()]]),e=>({...e,discriminator:Sa}))}function Ia(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsMutArgs",H()],["compressedProofArgs",h()]])}function vv(){return combineCodec(xa(),Ia())}function Ea(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.rentCollector),c(t.domainConfig),c(t.transactionBuffer),c(t.closer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:xa().encode(o),programAddress:r})}function Uv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ia().decode(e.data)}}var Ma=new Uint8Array([10]);function kv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ma)}function Ra(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Dt()],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:Ma}))}function ha(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Mt()],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Hv(){return combineCodec(Ra(),ha())}function Pa(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.payer),c(t.domainConfig),c(t.transactionBuffer),c(t.creator),c(t.systemProgram),c(t.instructionsSysvar),c(t.slotHashSysvar),...a],data:Ra().encode(o),programAddress:r})}function Vv(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:ha().decode(e.data)}}var va=new Uint8Array([20]);function Jv(){return fixEncoderSize(getBytesEncoder(),1).encode(va)}function Ua(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Dt()],["secp256r1VerifyArgs",getOptionEncoder(N())],["settingsReadonlyArgs",Et()],["compressedProofArgs",R()]]),e=>({...e,discriminator:va}))}function La(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Mt()],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",Ct()],["compressedProofArgs",h()]])}function Yv(){return combineCodec(Ua(),La())}function Wa(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.domainConfig),c(t.transactionBuffer),c(t.creator),c(t.systemProgram),c(t.instructionsSysvar),c(t.slotHashSysvar),...a],data:Ua().encode(o),programAddress:r})}function Xv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:La().decode(e.data)}}var Na=new Uint8Array([14]);function nU(){return fixEncoderSize(getBytesEncoder(),1).encode(Na)}function wa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:Na}))}function ka(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function sU(){return combineCodec(wa(),ka())}function Ha(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.domainConfig),c(t.executor),c(t.transactionBuffer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:wa().encode(o),programAddress:r})}function oU(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ka().decode(e.data)}}var Fa=new Uint8Array([24]);function gU(){return fixEncoderSize(getBytesEncoder(),1).encode(Fa)}function za(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())],["settingsMutArgs",k()],["compressedProofArgs",R()]]),e=>({...e,discriminator:Fa}))}function Ka(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsMutArgs",H()],["compressedProofArgs",h()]])}function yU(){return combineCodec(za(),Ka())}function ja(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.domainConfig),c(t.executor),c(t.transactionBuffer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:za().encode(o),programAddress:r})}function pU(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ka().decode(e.data)}}var Ya=new Uint8Array([12]);function xU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ya)}function Xa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Ya}))}function Za(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function IU(){return combineCodec(Xa(),Za())}function $a(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.transactionBuffer),...a],data:Xa().encode(o),programAddress:r})}function EU(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:Za().decode(e.data)}}var ti=new Uint8Array([22]);function PU(){return fixEncoderSize(getBytesEncoder(),1).encode(ti)}function ri(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:ti}))}function ni(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function bU(){return combineCodec(ri(),ni())}function si(e,n){let r=n?.programAddress??u,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.transactionBuffer),...a],data:ri().encode(o),programAddress:r})}function _U(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:ni().decode(e.data)}}var ai=new Uint8Array([11]);function NU(){return fixEncoderSize(getBytesEncoder(),1).encode(ai)}function ii(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:ai}))}function di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function wU(){return combineCodec(ii(),di())}function ui(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.domainConfig),c(t.transactionBuffer),c(t.voter),c(t.systemProgram),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:ii().encode(o),programAddress:r})}function kU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:di().decode(e.data)}}var yi=new Uint8Array([21]);function jU(){return fixEncoderSize(getBytesEncoder(),1).encode(yi)}function pi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())],["settingsReadonlyArgs",Et()],["compressedProofArgs",R()]]),e=>({...e,discriminator:yi}))}function Ti(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",Ct()],["compressedProofArgs",h()]])}function qU(){return combineCodec(pi(),Ti())}function mi(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.domainConfig),c(t.transactionBuffer),c(t.voter),c(t.systemProgram),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:pi().encode(o),programAddress:r})}function JU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ti().decode(e.data)}}var Si=new Uint8Array([15]);function eL(){return fixEncoderSize(getBytesEncoder(),1).encode(Si)}function xi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Si}))}function Ii(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function tL(){return combineCodec(xi(),Ii())}function Ei(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=T({}),a=m(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:xi().encode({}),programAddress:r})}function rL(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:Ii().decode(e.data)}}var Mi=new Uint8Array([25]);function iL(){return fixEncoderSize(getBytesEncoder(),1).encode(Mi)}function Ri(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Mi}))}function hi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function dL(){return combineCodec(Ri(),hi())}function Pi(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.transactionBuffer),...a],data:Ri().encode(o),programAddress:r})}function uL(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:hi().decode(e.data)}}var vi=new Uint8Array([16]);function lL(){return fixEncoderSize(getBytesEncoder(),1).encode(vi)}function Ui(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Rt()],["signers",getArrayEncoder(G())]]),e=>({...e,discriminator:vi}))}function Li(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",ht()],["signers",getArrayDecoder(F())]])}function fL(){return combineCodec(Ui(),Li())}function Wi(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:Ui().encode(o),programAddress:r})}function SL(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Li().decode(e.data)}}var Ni=new Uint8Array([26]);function RL(){return fixEncoderSize(getBytesEncoder(),1).encode(Ni)}function wi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Rt()],["signers",getArrayEncoder(G())],["settingsMutArgs",k()],["compressedProofArgs",R()]]),e=>({...e,discriminator:Ni}))}function ki(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",ht()],["signers",getArrayDecoder(F())],["settingsMutArgs",H()],["compressedProofArgs",h()]])}function hL(){return combineCodec(wi(),ki())}function Hi(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:wi().encode(o),programAddress:r})}function PL(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:ki().decode(e.data)}}var u="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",ix=(o=>(o[o.DomainConfig=0]="DomainConfig",o[o.GlobalCounter=1]="GlobalCounter",o[o.Settings=2]="Settings",o[o.TransactionBuffer=3]="TransactionBuffer",o[o.WhitelistedAddressTree=4]="WhitelistedAddressTree",o))(ix||{});function uW(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 dx=(l=>(l[l.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",l[l.ChangeConfig=1]="ChangeConfig",l[l.ChangeConfigCompressed=2]="ChangeConfigCompressed",l[l.CreateCompressedWallet=3]="CreateCompressedWallet",l[l.CreateDomainConfig=4]="CreateDomainConfig",l[l.CreateDomainUserAccount=5]="CreateDomainUserAccount",l[l.CreateGlobalCounter=6]="CreateGlobalCounter",l[l.CreateUserAccounts=7]="CreateUserAccounts",l[l.DecompressSettingsAccount=8]="DecompressSettingsAccount",l[l.DisableDomainConfig=9]="DisableDomainConfig",l[l.EditDomainConfig=10]="EditDomainConfig",l[l.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",l[l.EditUserDelegate=12]="EditUserDelegate",l[l.NativeTransferIntent=13]="NativeTransferIntent",l[l.NativeTransferIntentCompressed=14]="NativeTransferIntentCompressed",l[l.TokenTransferIntent=15]="TokenTransferIntent",l[l.TokenTransferIntentCompressed=16]="TokenTransferIntentCompressed",l[l.TransactionBufferClose=17]="TransactionBufferClose",l[l.TransactionBufferCloseCompressed=18]="TransactionBufferCloseCompressed",l[l.TransactionBufferCreate=19]="TransactionBufferCreate",l[l.TransactionBufferCreateCompressed=20]="TransactionBufferCreateCompressed",l[l.TransactionBufferExecute=21]="TransactionBufferExecute",l[l.TransactionBufferExecuteCompressed=22]="TransactionBufferExecuteCompressed",l[l.TransactionBufferExtend=23]="TransactionBufferExtend",l[l.TransactionBufferExtendCompressed=24]="TransactionBufferExtendCompressed",l[l.TransactionBufferVote=25]="TransactionBufferVote",l[l.TransactionBufferVoteCompressed=26]="TransactionBufferVoteCompressed",l[l.TransactionExecute=27]="TransactionExecute",l[l.TransactionExecuteCompressed=28]="TransactionExecuteCompressed",l[l.TransactionExecuteSync=29]="TransactionExecuteSync",l[l.TransactionExecuteSyncCompressed=30]="TransactionExecuteSyncCompressed",l))(dx||{});function AW(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 Ax=6e3,gx=6001,yx=6002,px=6003,Tx=6004,mx=6005,lx=6006,fx=6007,Sx=6008,xx=6009,Ix=6010,Ex=6011,Cx=6012,Dx=6013,Mx=6014,Rx=6015,hx=6016,Px=6017,bx=6018,_x=6019,vx=6020,Ux=6021,Lx=6022,Wx=6023,Ox=6024,Bx=6025,Nx=6026,wx=6027,kx=6028,Hx=6029,Vx=6030,Gx=6031,Fx=6032,zx=6033,Kx=6034,jx=6035,qx=6036,Jx=6037,Yx=6038,Xx=6039,Zx=6040,$x=6041,Qx=6042,eI=6043,tI=6044,rI=6045,nI=6046,sI=6047,oI=6048,cI=6049,aI=6050,iI=6051,dI=6052,uI=6053,AI=6054,gI=6055,yI=6056,pI=6057,TI=6058,mI=6059,lI=6060,fI=6061,SI=6062,xI=6063,II=6064,EI=6065,CI=6066,DI=6067,MI=6068,RI=6069,hI=6070,PI=6071,bI=6072,_I=6073,vI=6074,UI=6075,LI=6076,WI=6077,OI=6078,BI=6079,NI=6080,wI=6081,kI=6082,HI=6083,VI=6084,GI=6085,FI=6086,Vi;process.env.NODE_ENV!=="production"&&(Vi={[Gx]:"This member is already delegated to another wallet.",[fx]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[WI]:"Clock sysvar access failed. This may indicate a system error.",[iI]:"Missing credential id.",[uI]:"The domain configuration account is disabled. Please contact support or try again later.",[AI]:"Missing domain configuration account.",[UI]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[FI]:"Duplicate address tree detected. This address tree is already in the whitelist.",[Ix]:"Duplicate public keys detected among members. Each member must have a unique key.",[xx]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[Ux]:"No members provided. A multisig wallet must contain at least one member.",[lI]:"Slot numbers list is empty. At least one slot number is required for validation.",[bx]:"Expected a User with Administrator role for this instruction.",[Sx]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[hx]:"Expected a User with Transaction Manager role for this instruction.",[Zx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[$x]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Qx]:"Declared buffer size does not match the actual serialized size.",[mI]:"Failed to compute hash. This may indicate a system error.",[Kx]:"Not enough members with vote permission to meet the approval threshold.",[Fx]:"At least one signer with execute permission is required to proceed.",[zx]:"At least one signer with initiate permission is required to perform this action.",[Nx]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[vI]:"Invalid account index in transaction message. The account index is out of bounds.",[pI]:"Address Tree supplied is not part of the whitelisted address trees.",[_x]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[kx]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Xx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[fI]:"Member key conversion failed. The provided key format is invalid.",[jx]:"Only delegated members are allowed for this transaction.",[Bx]:"Unexpected number of accounts provided for this instruction.",[Dx]:"User with Permanent Member role must have a delegated wallet.",[gx]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[Tx]:"The extracted public key has an invalid length or encoding.",[Ax]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[px]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[aI]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[oI]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[Wx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[PI]:"Invalid source type for token transfer. The source account type is not supported.",[Px]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[Rx]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[Ox]:"Malformed transaction message: structure or formatting does not match the expected layout.",[NI]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[wx]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[BI]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[hI]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[mx]:"The extracted WebAuthn signed message payload is malformed.",[nI]:"An input string exceeds the maximum allowed character length.",[gI]:"This member is not registered under the provided domain configuration.",[II]:"Member not found in settings. Cannot remove a member that does not exist.",[_I]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[Hx]:"A required account is missing from the instruction context.",[SI]:"Compressed proof arguments are missing. Required for compressed account operations.",[DI]:"Missing compressed token account. Required for token transfer operations.",[wI]:"Missing destination token account. Required for token transfer operations.",[RI]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[xI]:"Light CPI accounts are missing. Required for compressed account operations.",[Vx]:"User mutation arguments are required when performing add or remove delegate operations.",[VI]:"Missing new authority account. Required for domain configuration updates.",[HI]:"Missing settings account. Required for delegate operations on compressed wallets.",[TI]:"Compressed settings data is missing. The settings account must be initialized with data.",[kI]:"Missing source token account. Required for token transfer operations.",[MI]:"Missing SPL interface PDA. Required for token transfer operations.",[sI]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[LI]:"User account address is missing. Required for secp256r1 signature verification.",[GI]:"Missing whitelisted address trees account. Required for domain configuration updates.",[Jx]:"No valid signer found in this transaction.",[vx]:"Only one administrator is allowed per wallet.",[Cx]:"Only one permanent member is allowed per wallet.",[Mx]:"Only one transaction manager is allowed per wallet.",[yI]:"The given origin index is not in the whitelisted origins.",[CI]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[Ex]:"Permanent members cannot be removed from a wallet.",[rI]:"Writable CPI calls to protected accounts are not permitted.",[lx]:"The rpIdHash extracted from the signed message does not match the expected value.",[EI]:"Settings key mismatch. The provided settings key does not match the expected value.",[yx]:"The signature index provided is out of bounds for the secp256r1 instruction.",[cI]:"The specified slot number was not found in the provided slot history.",[bI]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[Lx]:"Too many members: a maximum of 4 members are supported.",[eI]:"This transaction has expired. It must be executed within 3 minutes of approval.",[tI]:"This transaction has not yet reached the required approval threshold.",[dI]:"Missing transports.",[Yx]:"Only the transaction creator or rent payer may close this transaction buffer.",[OI]:"Unauthorized: Only the admin account is allowed to perform this action.",[qx]:"Member is not part of the expected signers for this transaction."});function lW(e){return process.env.NODE_ENV!=="production"?Vi[e]:"Error message not available in production bundles."}function fW(e,n,r){return isProgramError(e,n,u,r)}async function bW({admin:e,addressTree:n}){return Do({payer:e,addressTree:n,remainingAccounts:[]})}var Ie=class extends Error{constructor(r,s,t){super(r);this.code=s;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},Ve=class extends Ie{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},q=class extends Ie{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},M=class extends Ie{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},ye=class extends Ie{constructor(r,s,t){super(r,"NETWORK_ERROR",{statusCode:s,url:t});this.statusCode=s;this.url=t;}};var oe=class extends Ie{constructor(r,s,t){super(r,"BUNDLE_ERROR",{bundleId:s,attempt:t});this.bundleId=s;this.attempt=t;}},pr=class extends Ie{constructor(r,s,t){super(`Operation "${r}" failed after ${s} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=s;this.lastError=t;}},Tr=class extends Ie{constructor(r,s,t){super(r,"PERMISSION_ERROR",{required:s,actual:t});this.required=s;this.actual=t;}};var Ut={Ed25519:1,Secp256r1:2};var zI=g.looseObject({publicKey:g.string(),walletAddress:g.string(),settingsIndexWithAddress:g.object({index:g.union([g.number(),g.bigint()]),settingsAddressTreeIndex:g.number()}),username:g.string().optional(),profilePictureUrl:g.string().optional()}),Gi=g.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),BW=g.object({transactionActionType:Gi,transactionAddress:g.string(),transactionMessageBytes:g.array(g.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),KI=g.object({transactionActionType:Gi,transactionAddress:g.string(),transactionMessageBytes:g.base64()}).strict(),jI=g.union([g.object({type:g.literal("Ephemeral"),secretKey:g.string()}),g.object({type:g.literal("Default"),publickey:g.string(),endpoint:g.string()})]).array().optional(),Fi=g.object({phase:g.literal("start"),redirectOrigin:g.url(),signer:g.string().optional(),rid:g.string(),validTill:g.number(),data:g.object({type:g.literal("message"),payload:g.string()}).strict()}).strict(),zi=g.object({phase:g.literal("start"),redirectOrigin:g.url(),signer:g.string().optional(),rid:g.string(),validTill:g.number(),data:g.object({type:g.literal("transaction"),payload:KI,sendTx:g.boolean(),additionalSigners:jI}).strict()}).strict(),Ki=g.object({startRequest:g.union([Fi,zi]),authResponse:g.custom(),client:g.object({clientOrigin:g.url(),jws:g.string()}).strict(),device:g.object({jwk:g.base64(),jws:g.string()}).strict(),authProvider:g.object({jwk:g.base64(),jws:g.string()}).strict().optional()}).strict(),ji=g.object({signer:g.string(),userAddressTreeIndex:g.number().optional(),additionalInfo:g.looseObject({}).optional()}).strict(),qI=g.object({slotHash:g.string(),slotNumber:g.string(),originIndex:g.number(),crossOrigin:g.boolean()}).strict(),NW=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("message"),payload:ji.extend(Ki.shape).extend({id:g.string().optional(),client:g.object({clientOrigin:g.url()}).strict()})}).strict()}).strict(),wW=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("transaction"),payload:ji.extend(Ki.shape).extend(qI.shape).extend({client:g.object({clientOrigin:g.url()}).strict()})}).strict()}).strict(),kW=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("transaction"),payload:g.object({startRequest:g.union([zi,Fi]),txSig:g.string(),user:zI})}).strict()}).strict();var Ee={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Me=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(Ee).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var wn=33,Re=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!==wn)throw new Error(`Invalid public key length, expected ${wn} 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===wn)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()}},b=class extends Re{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 XI(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function ZI(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var Ji=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(XI())],["addressTableLookups",getArrayCodec(ZI())]]);function Yi(e){return Ji.encode({numSigners:e.header.numSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,accountKeys:e.staticAccounts,instructions:e.instructions.map(r=>({programAddressIndex:r.programAddressIndex,accountIndices:r.accountIndices??[],data:Array.from(r.data??[])})),addressTableLookups:e.version!=="legacy"?e.addressTableLookups?.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes,writableIndexes:r.writableIndexes}))??[]:[]})}function Xi(e){let n=Ji.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:u,staticAccounts:n.accountKeys,version:0}}var Hn=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Zi="https://mainnet.block-engine.jito.wtf/api/v1",$i="https://bundles.jito.wtf/api/v1/bundles/tip_floor",Qi="landed_tips_75th_percentile";var ee={};function ed(){if(!ee.solanaRpcEndpoint)throw new Ve("RPC endpoint");return ee.solanaRpcEndpoint}function Ye(){if(!ee.lightProtocolRpc)throw new Ve("Light Protocol RPC");return ee.lightProtocolRpc}function z(){if(!ee.solanaRpc)throw new Ve("Solana RPC");return ee.solanaRpc}function td(){if(!ee.sendAndConfirm)throw new Ve("Send and confirm transaction function");return ee.sendAndConfirm}function Vn(){return ee.jitoTipsConfig?ee.jitoTipsConfig:{blockEngineUrl:Zi,getJitoTipsUrl:$i,priority:Qi}}function dO({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){ee.solanaRpcEndpoint=e,ee.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:o}=createSolanaClient({urlOrMoniker:e});ee.solanaRpc=t,ee.sendAndConfirm=o,ee.jitoTipsConfig=s??null;}async function Lt(e,n){if(!e.ok)throw new ye(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function Wt(e){try{return await e.json()}catch(n){throw new ye(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function DO(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+lr(n.get(-2))),y:BigInt("0x"+lr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function MO(e){let r=p256.Point.fromBytes(getBase58Encoder().encode(e)).toBytes(false),s=new Map;return s.set(1,2),s.set(3,-7),s.set(-1,1),s.set(-2,r.slice(1,33)),s.set(-3,r.slice(33,65)),new Uint8Array(encodeCBOR(s))}async function RO(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=Ae(n),o=JSON.parse(getUtf8Decoder().decode(Ae(r))),i=od(o),a=ad(Ae(s)),c=await Ze({rpIdHash:t.subarray(0,32)});return new b(e.signer.toString(),{verifyArgs:{clientDataJson:Ae(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:Gn(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:c,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function Gn(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(n),...getBase64Encoder().encode(r)]))}function hO(e){return sha256(getUtf8Encoder().encode(JSON.stringify(e)))}function PO(e){return Fn(e.data.payload.authResponse)}function bO(e,n,r,s){let t=Gn(n,r,s);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...t]))}async function _O(e,n,r,s,t,o){let i;if(!t||!o){let A=(await z().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!A)throw new q("Slot sysvar","Unable to fetch slot sysvar data");let y=getBase64Encoder().encode(A[0]);o=getU64Decoder().decode(y.subarray(0,8)).toString(),i=y.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),c=Gn(n,r,s),d=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...a,...i,...c]));return {slotNumber:o,slotHash:t,challenge:d}}function Fn(e){let n=fr(e);return sha256(n)}function vO(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ae(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),o=new ArrayBuffer(t.length),i=new Uint8Array(o);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}async function UO(e,n){let{data:r}=await as(z(),e),t=cd(r.origins,r.numOrigins).findIndex(o=>o===n);if(t===-1)throw new q("Origin","Origin not found in domain config");return t}function LO(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function WO(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}function lr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function aE(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 od(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let s=JSON.stringify(r);return new TextEncoder().encode(s.slice(1,-1))}function cd(e,n){let r=[],s=0,t=new TextDecoder;for(let o=0;o<n;o++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let i=e[s]|e[s+1]<<8;if(s+=2,s+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(s,s+i),c=t.decode(a);r.push(c),s+=i;}return r}function ad(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let _=n&127;r+=_;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,o=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,c=e.slice(a,a+i),d=o[0]===0&&o.length>32?o.slice(1):o,A=c[0]===0&&c.length>32?c.slice(1):c;if(d.length>32||A.length>32)throw new Error("r or s length > 32 bytes");let y=new Uint8Array(32);y.set(d,32-d.length);let p=p256.Point.CURVE().n>>1n,f=BigInt("0x"+lr(A)),I=(f>p?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=aE(I);return new Uint8Array([...y,...x])}function fr(e){let n=Ae(e.response.clientDataJSON),r=Ae(e.response.authenticatorData),s=sha256(n);return new Uint8Array([...r,...s])}var iE=400,dE=429,dd=500,uE=3,AE=500,gE=2,yE=3e4,ud={backoffBase:gE,maxDelayMs:yE,retryOnRateLimit:true,initialDelayMs:AE,maxRetries:uE};function Ad(e){return e===dE}function gd(e){return e>=dd}function pE(e){return e>=iE&&e<dd}function TE(e){return Ad(e)||gd(e)}function mE(e,n,r){return e instanceof Response?Ad(e.status)?r.retryOnRateLimit??true:pE(e.status)?false:gd(e.status):e instanceof TypeError||e instanceof Error}function lE(e,n,r,s){let t=n*Math.pow(r,e-1);return Math.min(t,s)}function fE(e){return new Promise(n=>setTimeout(n,e))}async function Nt(e,n){let{maxRetries:r,initialDelayMs:s,backoffBase:t,maxDelayMs:o,shouldRetry:i}={...ud,...n},a;for(let c=1;c<=r;c++)try{return await e()}catch(d){if(a=d,i&&!i(d,c))throw d;if(c>=r)break;let A=lE(c,s,t,o);await fE(A);}throw new pr(e.name||"retryWithBackoff",r,a)}async function $e(e,n){let r={...ud,...n},s=(o,i)=>mE(o,i,r);return Nt(async()=>{let o=await e();if(!o.ok&&TE(o.status))throw o;return o},{...r,shouldRetry:n?.shouldRetry??s})}function yd(...e){return n=>e.some(r=>n instanceof r)}function pd(e,n,r,s){if(e<n||e>r)throw new M(`${s} must be between ${n} and ${r} (inclusive), got ${e}`)}function Td(e,n){if(e<0)throw new M(`${n} must be non-negative, got ${e}`)}function wt(e,n){if(e.length===0)throw new M(`${n} cannot be empty`)}function md(e,n){if(e.trim().length===0)throw new M(`${n} cannot be empty`)}async function Kn(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await z().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),o=>appendTransactionMessageInstructions(s.instructions,o),o=>setTransactionMessageFeePayerSigner(s.payer,o),o=>setTransactionMessageLifetimeUsingBlockhash(r,o),o=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(o,s.addressesByLookupTableAddress):o,async o=>{let i=Math.ceil((s.unitsConsumed??0)*1.1);return i>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:i})],o):o},async o=>n?compileTransaction(await o):await signTransactionMessageWithSigners(await o))))}async function Id(e){let n=prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:8e5}),getSetComputeUnitPriceInstruction({microLamports:1e4})],e),r=getBase64EncodedWireTransaction(compileTransaction(n));if(r.length>1644)throw new M(`Transaction exceeds maximum length of ${1644} bytes (actual: ${r.length} bytes)`);let s=await z().simulateTransaction(r,{encoding:"base64"}).send();if(s.value.err){if(s.value.logs){let o=["Transaction simulation failed:","",...s.value.logs].join(`
|
|
2
|
+
`);throw new Error(o)}let t=["Transaction simulation failed:","",s.value.err.toString()].join(`
|
|
3
|
+
`);throw new Error(t)}return s.value.unitsConsumed}async function Ed(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(o=>o.role===AccountRole.WRITABLE||o.role===AccountRole.WRITABLE_SIGNER).map(o=>o.address)).send()).map(o=>Number(o.prioritizationFee));s.sort((o,i)=>o-i);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function Cd(e,n){wt(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new M(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await $e(()=>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 Lt(r,n);let s=await Wt(r);if(!s.result||s.error)throw new oe(`Unable to simulate bundle: ${JSON.stringify(s.error??s.result)}`);if(typeof s.result.value.summary!="string"&&s.result.value.summary.failed){let{TransactionFailure:t}=s.result.value.summary.failed.error,[,o]=t;throw new oe(`Simulation failed: ${o}`)}return s.result.value.transactionResults.map(t=>t.unitsConsumed)}function ce(e,n=0){let r=e instanceof b?e:void 0,s=r?.verifyArgs&&n!==-1?some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):none(),t=r?.domainConfig?r.domainConfig:void 0,o=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs.clientDataJson?fr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:o,message:i,publicKey:a}}function Pe(e,n,r=[]){let s=[];for(let t of e)if(t instanceof b){let o=r.length,{domainConfig:i,verifyArgs:a,signature:c,publicKey:d,message:A}=ce(t,o);if(A&&c&&d&&r.push({message:A,signature:c,publicKey:d}),i){let y=n.addPreAccounts([{address:i,role:AccountRole.READONLY}]).get(i)?.index;a.__option==="Some"&&y!==void 0&&s.push({__kind:"Secp256r1",fields:[{domainConfigIndex:y,verifyArgs:a.value}]});}}else {let o=n.addPreAccounts([{address:t.address,role:AccountRole.READONLY_SIGNER,signer:t}]).get(t.address)?.index;o!==void 0&&s.push({__kind:"Ed25519",fields:[o]});}return {secp256r1VerifyInput:r,transactionSyncSigners:s}}function pe(e){if(e instanceof Re)return {keyType:Ut.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Ut.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function ld(e){return e instanceof b?e.toString():e.address.toString()}function ie(e){let n=new Set,r=[];for(let t of e)n.has(ld(t))||(r.push(t),n.add(ld(t)));let s=r.filter(t=>t instanceof b);if(s.length>1)throw new M(`More than 1 Secp256r1 signers in an instruction is not supported (found ${s.length})`);return r}function Dd({payer:e,tipAmount:n}){let r=Hn[Math.floor(Math.random()*Hn.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function Md(e){return typeof e=="string"?e:e.toString()}function Rd(e){return e.toString()}async function jn(e,n,r){let s=e?.get(n);if(s)return s;let t=await r();return t&&e&&e.set(n,t),t}var qn=[{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}],V=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(u.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n,r={address:address(n),role:AccountRole.WRITABLE},s=true){let t=s?this.packedMap:this.preMap;if(!t.has(n)){let o=s?this.nextPackedIndex++:this.nextPreIndex++;t.set(n,{index:o,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(qn);return this.packOutputTreeIndex(n)}packTreeInfos(n,r){let s=[],t=[];for(let o of n){let i=this.insertOrGet(o.treeInfo.tree.toString()),a=this.insertOrGet(o.treeInfo.queue.toString());s.push({rootIndex:o.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:o.leafIndex,proveByIndex:o.proveByIndex});let c=o.treeInfo.nextTreeInfo??o.treeInfo,d=this.packOutputTreeIndex(c);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let o of r){let i=this.insertOrGet(o.treeInfo.tree.toString()),a=this.insertOrGet(o.treeInfo.queue.toString());t.push({rootIndex:o.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(n){return Array.from(n.entries()).sort((s,t)=>s[1].index-t[1].index).map(([,{accountMeta:s}])=>({...s}))}getOffsets(n){let r=n,s=r+this.systemAccounts.length;return [r,s]}toAccountMetas(){let n=this.hashSetAccountsToMetas(this.preMap),r=this.hashSetAccountsToMetas(this.packedMap),[s,t]=this.getOffsets(n.length);return {remainingAccounts:[...n,...this.systemAccounts,...r],systemOffset:s,packedOffset:t}}};async function Ir(e,n){let r=Md(e);return jn(n,r,()=>Pd(e))}async function Er(e,n){let r=Rd(e);return jn(n,r,()=>z().getAccountInfo(e,{encoding:"base64"}).send())}async function ge(e,n){let r=(await Promise.all(e.map(s=>Ir(s.address,n)))).filter(s=>s!==null).filter(s=>s.data!==null&&s.address!==null);if(r.length!==e.length)throw new q("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((s,t)=>({...s,type:e[t].type,tree:s.treeInfo.tree,queue:s.treeInfo.queue}))}function U(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 Te(e,n,r,s,t){if(t.length===0)return [];let o=t.map((d,A)=>({treeInfo:n[A],root:r[A],rootIndex:s[A],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],o),a=await e.getOutputTreeIndex();return t.map((d,A)=>({addressTreeInfo:i[A],outputStateTreeIndex:a,address:d.address,type:d.type}))}function te(e,n,r,s,t,o,i){let a=[];for(let A=0;A<n.length;A++)a.push({treeInfo:n[A],rootIndex:s[A],leafIndex:r[A],proveByIndex:t[A],hash:o[A].hash});let c=e.packTreeInfos(a,[]).stateTrees;if(!c)throw new M("Unable to parse state tree data");return o.map((A,y)=>({data:i.decode(A.data.data),accountMeta:{treeInfo:c.packedTreeInfos[y],address:new Uint8Array(A.address),outputStateTreeIndex:c.outputTreeIndex}}))}async function de(e,n,r,s,t){let o=null,i=null,a=null,c=new V;if(e){await c.addSystemAccounts();let{address:d}=await ae(n,r),A=(await ge([{address:d,type:"Settings"}],t))[0];s?a={rootIndices:[0],roots:[],leafIndices:[A.leafIndex],leaves:[],treeInfos:[A.treeInfo],proveByIndices:[A.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:a=await X([A],[]);let y=c.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:A.hash}],[]).stateTrees;if(!y)throw new M("Unable to parse state tree data");let p=Y().decode(A.data?.data);o={accountMeta:{address:new Uint8Array(A.address),treeInfo:y.packedTreeInfos[0]},data:p},i={accountMeta:{address:new Uint8Array(A.address),treeInfo:y.packedTreeInfos[0],outputStateTreeIndex:y.outputTreeIndex},data:p};}return {settingsReadonlyArgs:o,proof:a,packedAccounts:c,settingsMutArgs:i}}async function X(e,n){return Nt(()=>Ye().getValidityProofV0(e,n))}async function me(){return (await Cr()).length-1}var Jn;async function Cr(){if(!Jn){let{data:e}=await So(z(),await bd());Jn=e.whitelistedAddressTrees;}return Jn}async function Ht(e,n,r){let s=await uC(e,n,r);if(!s)throw new q("User account");return s}async function uC(e,n,r){let{address:s}=await W(e,n),t=await Ir(s,r);return t?.data?.data?K().decode(t.data.data):null}async function _B(e,{member:n,credentialId:r}){let s=[{memcmp:{offset:1,encoding:"base58",bytes:e}}];if(n)s.push({memcmp:{offset:33,encoding:"base58",bytes:getBase58Decoder().decode(B().encode(pe(n)))}});else if(r)s.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(Ae(r))}});else return null;let t=await Ye().getCompressedAccountsByOwner(new PublicKey(u.toString()),{filters:s});return t.items.filter(o=>!!o.data).length?t.items.map(o=>K().decode(o.data?.data))[0]:null}async function Dr(e,n,r){let s=await AC(e,n,r);if(!s)throw new q("Settings account");return s}async function AC(e,n,r){try{let{address:s}=await ae(e,n),t=await Ir(s,r);if(!t?.data?.data)throw new q("Compressed settings account");let o=Y().decode(t.data.data);if(o.data.__option==="None")throw new q("Compressed settings account");return {...o.data.value,isCompressed:!0}}catch{let s=await yn(z(),e);return s.exists?{...s.data,isCompressed:false}:null}}async function vB(e,n,r){let s=await Ht(e,n,r);if(s.role===1||s.role===0){let t=[],[o,i]=await Promise.all([Ye().getCompressedAccountsByOwner(new PublicKey(u.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:getBase58Decoder().decode(B().encode(pe(e)))}}]}),z().getProgramAccounts(u,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(B().encode(pe(e)))}}]}).send()]);return o.items.forEach(a=>{if(a.data?.data){let c=Y().decode(a.data.data);c.data.__option==="Some"&&t.push({...c.data.value,isCompressed:true});}}),i.forEach(a=>{let c=or().decode(getBase64Encoder().encode(a.account.data[0]));t.push({...c,isCompressed:false});}),t}else return await Promise.all(s.wallets.map(async t=>Dr(await le(t.index),t.settingsAddressTreeIndex,r)))}async function Xn(e){Td(e,"index");let n=await Cr();if(e>=n.length)throw new M(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function UB(e){let r=(await Cr()).findIndex(s=>s.toString()===e);if(r===-1)throw new q("Address tree",`Address ${e} not found in whitelist`);return r}async function Pd(e,n){if(!n&&!e)throw new M("Either hash or address must be provided to fetchCompressedAccount.");if(n&&e)throw new M("Only one of hash or address must be provided to fetchCompressedAccount.");let r=await rpcRequest(Ye().compressionApiEndpoint,versionedEndpoint("getCompressedAccount"),{hash:n?encodeBN254toBase58(n):void 0,address:e?encodeBN254toBase58(e):void 0}),s;if(featureFlags.isV2()?s=create(r,jsonRpcResultAndContext(nullable(CompressedAccountResultV2))):s=create(r,jsonRpcResultAndContext(nullable(CompressedAccountResult))),"error"in s)throw new SolanaJSONRPCError(s.error,`failed to get info for compressed account ${n?n.toString():e?e.toString():""}`);if(s.result.value===null)return null;let t=featureFlags.isV2()?s.result.value.merkleContext.tree:s.result.value.tree,o=getStateTreeInfoByPubkey(qn,t),i=s.result.value;return createCompressedAccountWithMerkleContextLegacy(createMerkleContextLegacy(o,i.hash,i.leafIndex),i.owner,bn$1(i.lamports),i.data?parseAccountData(i.data):void 0,i.address||void 0)}async function ae(e,n=0){let r=await Xn(n),s=deriveAddressSeedV2([getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(u)).toString(),"base58"),addressTree:new PublicKey(r)}}async function W(e,n=0){let r=await Xn(n),s=deriveAddressSeedV2([getUtf8Encoder().encode("user"),e instanceof Re?e.toTruncatedBuffer():getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(u.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function Ze({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(getUtf8Encoder().encode(n));else throw new M("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function kd(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function bd(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Hd(e,n,r){pd(r,0,255,"buffer_index");let[s]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof Re?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function Ce(e){let[n]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function le(e){let[n]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function FB(e){let n=await le(e);return await Ce(n)}async function zB(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function QB(e){wt(e,"bundle");let n=await Kn(e,true),r=await Cd(n.map(getBase64EncodedWireTransaction),ed()),s=await Kn(e.map((o,i)=>({...o,unitsConsumed:r[i]})));return await TC(s.map(getBase64EncodedWireTransaction))}async function TC(e,n=Vn(),r){wt(e,"serializedTransactions");let{blockEngineUrl:s}=n,t=`${s}/bundles`,o=await $e(()=>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 Lt(o,t);let i=await Wt(o);if(i.error)throw new oe(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new oe("No bundle ID returned from Jito");return i.result}async function eN(e,n=30,r=3e3,s=Vn()){md(e,"bundleId");let{blockEngineUrl:t}=s,o=`${t}/getBundleStatuses`;return Nt(async()=>{let i=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await Lt(i,o);let a=await Wt(i);if(a.error)throw new oe(`Error getting bundle status: ${JSON.stringify(a.error,null,2)}`,e);if(!a.result?.value?.length)throw new oe("Bundle not yet confirmed",e);let c=a.result.value[0];if(c.confirmation_status==="confirmed"||c.confirmation_status==="finalized"){let d=c.transactions[c.transactions.length-1];if(!d)throw new oe("No transactions in confirmed bundle",e);return d}throw new oe(`Bundle status: ${c.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:yd(oe,ye)})}async function aN({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await z().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),o=>appendTransactionMessageInstructions(e,o),o=>setTransactionMessageFeePayerSigner(n,o),o=>setTransactionMessageLifetimeUsingBlockhash(s.value,o),o=>r?compressTransactionMessageUsingAddressLookupTables(o,r):o,async o=>{let[i,a]=await Promise.all([Id(o),Ed(z(),o.instructions.flatMap(d=>d.accounts??[]))]),c=Math.ceil((Number(i)??0)*1.1);return prependTransactionMessageInstructions([...c>2e5?[getSetComputeUnitLimitInstruction({units:c})]:[],...a>0?[getSetComputeUnitPriceInstruction({microLamports:a})]:[]],o)},async o=>await signTransactionMessageWithSigners(await o));return await td()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function EN(e,n){if(n.threshold>1)throw new M("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(c=>zd(c.pubkey)===e);if(!r)throw new q("Member",`Signer ${e} not found in settings`);let{permissions:s}=r;if(!s)throw new q("Permissions","No permissions found for the current member");let t=Me.has(s,Ee.InitiateTransaction),o=Me.has(s,Ee.VoteTransaction),i=Me.has(s,Ee.ExecuteTransaction);if(t&&o&&i)return {};if(!o||!i)throw new Tr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[o?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(c=>c.role===0);if(!a)throw new q("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(zd(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function CN({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let o=await Ht(n,r,t);if(o.transactionManagerUrl.__option==="None")throw new q("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return UC(n,o.transactionManagerUrl.value,e,s)}function UC(e,n,r,s){return {address:e,async signTransactions(t){let o=await $e(()=>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:s?getBase64Decoder().decode(s):void 0,authResponses:r}))})}));if(!o.ok)throw new ye(`Transaction manager request failed: ${o.statusText}`,o.status,n);let i=await o.json();if("error"in i)throw new ye(`Transaction manager error: ${i.error}`,o.status,n);return i.signatures.map(a=>({[e]:getBase58Encoder().encode(a)}))}}}function zd(e){return e.keyType===Ut.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function DN(e){let n=e.map(o=>We().encode(o)),r=4+n.reduce((o,i)=>o+i.length,0),s=new Uint8Array(r),t=0;s.set(getU32Encoder().encode(e.length),t),t+=4;for(let o of n)s.set(o,t),t+=o.length;return s}function MN(e){let n=0,[r,s]=getU32Decoder().read(e,n);n=s;let t=new Array(r);for(let o=0;o<r;o++){let i=Oe().read(e,n);t[o]=i[0],n=i[1];}if(n!==e.length)throw new M(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function VN({payer:e,rpId:n,origins:r,authority:s}){let t=await Ze({rpId:n}),o=new V;await o.addSystemAccounts();let i=await me(),{address:a,addressTree:c}=await W(s.address,i),d=[{address:a,tree:c,queue:c,type:"User"}],A=await X([],d),y=(await Te(o,A.treeInfos,A.roots,A.rootIndices,d))[0],{remainingAccounts:p,systemOffset:f}=o.toAccountMetas(),S=U(A,f);return await tc({origins:r,authorityCreationArgs:y,authority:s,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function $N({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let o=new V;await o.addSystemAccounts();let i=[];r.settings&&(i.push({address:(await ae(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 ge(i,t):[],c=await me(),{address:d,addressTree:A}=await W(r.member,c),y=[{address:d,type:"User",tree:A,queue:A}],p=await X(a,y),f=null,S=null,I=a.filter(Z=>Z.type==="Settings"),x=a.filter(Z=>Z.type==="User");I.length&&(f=te(o,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),I,Y())[0]),x.length&&(S=te(o,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,K())[0]);let _=await Te(o,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),y),{remainingAccounts:P,systemOffset:v}=o.toAccountMetas(),L=U(p,v);return await cc({payer:n,authority:e,compressedProofArgs:L,member:It().decode(r.member.toBuffer()),credentialId:Ae(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:f?some({settingsMutArgs:f,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:_[0],domainConfig:s,remainingAccounts:P})}async function rw({payer:e}){let n=await kd();return uc({payer:e,globalCounter:n})}async function cw({admin:e,rpId:n,disable:r}){let s=await Ze({rpId:n});return Rc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}function WC(e,n,r,s){let t=OC(e,n),o=BC(e,n)&&r!==s;return t&&o?AccountRole.WRITABLE_SIGNER:t&&!o?AccountRole.WRITABLE:!t&&o?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function OC(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:o}=e.header,i=s-t,a=r-s-o;return n>=r?false:n<i?true:n>=s?n-s<a:false}function BC(e,n){return n<e.header.numSignerAccounts}async function Mr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Xi(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let o=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),z()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,c]of t.staticAccounts.entries())i.push({address:c,role:WC(t,a,c,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let c=o[a.lookupTableAddress];if(!c)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let A=c[d];if(!A)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:A,role:AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let A=c[d];if(!A)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:A,role:AccountRole.READONLY});}}for(let a of s?.filter(c=>c.address!==e)??[]){let c=i.findIndex(d=>d.address===a.address);c===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[c].role===AccountRole.READONLY||i[c].role===AccountRole.READONLY_SIGNER?i[c]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[c].role===AccountRole.WRITABLE||i[c].role===AccountRole.WRITABLE_SIGNER)&&(i[c]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:o,transactionMessage:t}}var et=33,tt=64,es=14,FC=2,zC=address("Secp256r1SigVerify1111111111111111111111111");function KC(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function jC(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function Xd(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let s=getU8Decoder().decode(e,n);n+=1;let t=[],o=jC();for(let a=0;a<r;a++)t.push(o.decode(e,n)),n+=es;let i=[];for(let a=0;a<r;a++){let c=fixDecoderSize(getBytesDecoder(),et).decode(e,n);n+=et;let d=fixDecoderSize(getBytesDecoder(),tt).decode(e,n);n+=tt;let A=t[a].messageDataSize,y=fixDecoderSize(getBytesDecoder(),A).decode(e,n);n+=A,i.push({publicKey:c,signature:d,message:y});}return [{numSignatures:r,padding:s,offsets:t,payload:i},n]}})}function Zd(){return createEncoder({getSizeFromValue:e=>{let n=es*e.offsets.length,r=e.payload.reduce((s,t)=>s+et+tt+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=getU8Encoder().write(e.numSignatures,n,r),r=getU8Encoder().write(e.padding,n,r);let s=KC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),et).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),tt).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function Sw(){return combineCodec(Zd(),Xd())}function O(e,n){let r=e.length,s=FC+r*es,t=[];for(let c=0;c<r;c++){let{message:d}=e[c],A=s,y=A+et,p=y+tt;t.push({publicKeyOffset:A,publicKeyInstructionIndex:65535,signatureOffset:y,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),s+=et+tt+d.length;}let o=n?.programAddress??zC,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:o,data:Zd().encode(i)}}function xw(e){return {programAddress:e.programAddress,accounts:{},data:Xd().decode(e.data)}}async function $d({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:o=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:c=false}){let d=await Ce(e),{accountMetas:A,addressLookupTableAccounts:y}=await Mr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return o.length>0&&p.push(O(o)),p.push(c?Pi({transactionBuffer:n,payer:s.address,remainingAccounts:A,settingsKey:e}):Ei({transactionBuffer:n,payer:s.address,settings:e})),a&&p.push(Dd({payer:s,tipAmount:a})),{instructions:p,addressLookupTableAccounts:y}}async function Qd({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,additionalSigners:s,signers:t,payer:o,addressesByLookupTableAddress:i,secp256r1VerifyInput:a=[],compressed:c=false,simulateProof:d=false,cachedAccounts:A}){let y=ie(t),p=await Ce(e),[{accountMetas:f,addressLookupTableAccounts:S,transactionMessage:I},{settingsMutArgs:x,proof:_,packedAccounts:P}]=await Promise.all([Mr({transactionMessageBytes:r,walletAddress:p,additionalSigners:s,addressesByLookupTableAddress:i}),de(c,e,n,d,A)]);P.addPreAccounts(f);let{secp256r1VerifyInput:v,transactionSyncSigners:L}=Pe(y,P,a),{remainingAccounts:Z,systemOffset:ne}=P.toAccountMetas(),se=[];v.length>0&&se.push(O(v));let qe=qC(I,f);if(c){if(!o||!x)throw new M("Payer not found or proof args are missing for executeTransactionSync.");let be=U(_,ne);se.push(Hi({signers:L,transactionMessage:qe,settingsMutArgs:x,compressedProofArgs:be,payer:o,remainingAccounts:Z}));}else se.push(Wi({signers:L,settings:e,transactionMessage:qe,remainingAccounts:Z}));return {instructions:se,addressLookupTableAccounts:S}}function qC(e,n){if(e.version==="legacy")throw new M("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(s=>s.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function Yw({settings:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:o,payer:i,compressed:a=false}){let c=ie(s),d=await Ce(e),[{packedAccounts:A,proof:y,settingsMutArgs:p},{value:f}]=await Promise.all([de(a,e,n,false,t),Er(d,t)]);if((f?.lamports??0)<BigInt(o))throw new M("Insufficient balance for native transfer.");let{secp256r1VerifyInput:S,transactionSyncSigners:I}=Pe(c,A),{remainingAccounts:x,systemOffset:_}=A.toAccountMetas(),P=[];if(S.length>0&&P.push(O(S)),a){if(!i||!p)throw new Error("Payer not found or proof args is missing.");let v=U(y,_);P.push(ea({amount:o,settingsMutArgs:p,compressedProofArgs:v,payer:i,signers:I,source:d,destination:r,remainingAccounts:x}));}else P.push(Jc({amount:o,signers:I,source:d,destination:r,settings:e,remainingAccounts:x}));return P}async function ak({settings:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:o,amount:i,payer:a,tokenProgram:c,compressed:d=false}){let A=ie(t),y=await Ce(e),p=await getAssociatedTokenAccountAddress(s,y,c),[{packedAccounts:f,proof:S,settingsMutArgs:I},{value:x}]=await Promise.all([de(d,e,n,false,o),Er(p,o)]);if((x?getTokenDecoder().decode(getBase64Encoder().encode(x.data[0])).amount:0)<i)throw new M("Insufficient balance for token transfer.");let{secp256r1VerifyInput:P,transactionSyncSigners:v}=Pe(A,f),{remainingAccounts:L,systemOffset:Z}=f.toAccountMetas(),ne=[];if(P.length>0&&ne.push(O(P)),d){if(!a||!I)throw new Error("Payer not found or proof args is missing.");let se=U(S,Z);ne.push(await ua({amount:i,settingsMutArgs:I,compressedProofArgs:se,payer:a,signers:v,source:y,destination:r,remainingAccounts:L,sourceSplTokenAccount:p,tokenProgram:c,mint:s}));}else ne.push(await sa({amount:i,signers:v,source:y,destination:r,settings:e,remainingAccounts:L,sourceSplTokenAccount:p,tokenProgram:c,mint:s}));return ne}async function Sk({signers:e,payer:n,changeConfigArgs:r}){let{settings:s,configActions:t,compressed:o,packedAccounts:i,proof:a,settingsMutArgs:c}=r,d=ie(e),A=[],y=[];for(let x of d)if(x instanceof b){let _=y.length,{domainConfig:P,verifyArgs:v,signature:L,publicKey:Z,message:ne}=ce(x,_);if(ne&&L&&Z&&y.push({message:ne,signature:L,publicKey:Z}),P){let se=i.addPreAccounts([{address:P,role:AccountRole.READONLY}]).get(P)?.index;v.__option==="Some"&&se!==void 0&&A.push({__kind:"Secp256r1",fields:[{domainConfigIndex:se,verifyArgs:v.value}]});}}else {let _=i.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]).get(x.address)?.index;_!==void 0&&A.push({__kind:"Ed25519",fields:[_]});}let{remainingAccounts:p,systemOffset:f}=i.toAccountMetas(),S=U(a,f),I=[];if(y.length>0&&I.push(O(y)),o){if(!c)throw new M("Proof args are missing for compressed changeConfig.");I.push(Ho({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:c,remainingAccounts:p,signers:A}));}else I.push(Uo({settings:s,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:p,signers:A}));return I}async function Rk({createUserArgs:e,payer:n}){let r=new V;await r.addSystemAccounts(),r.addPreAccounts(e.map(A=>({address:A.member.address,role:AccountRole.READONLY_SIGNER,signer:A.member})));let s=await me(),t=await Promise.all(e.map(async A=>{let{address:y,addressTree:p}=await W(A.member.address,s);return {address:y,tree:p,queue:p,type:"User"}})),o=await X([],t),i=await Te(r,o.treeInfos,o.roots,o.rootIndices,t),{remainingAccounts:a,systemOffset:c}=r.toAccountMetas(),d=U(o,c);return await pc({compressedProofArgs:d,payer:n,createUserArgs:e.map((A,y)=>({member:A.member.address,role:A.role,userCreationArgs:i[y],transactionManagerUrl:A.role===0?A.transactionManagerUrl:null})),remainingAccounts:a})}async function Lk({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let o=new V;await o.addSystemAccounts();let i=[],a=[];a.push(...await ge([{address:(await W(r.address,s)).address,type:"User"}],t));let c=await me(),{address:d,addressTree:A}=await ae(await le(e),c);i.push({address:d,queue:A,tree:A,type:"Settings"});let y=a.length,p=await X(a,i),f=te(o,p.treeInfos.slice(0,y),p.leafIndices.slice(0,y),p.rootIndices.slice(0,y),p.proveByIndices.slice(0,y),a.filter(v=>v.type==="User"),K())[0],I=(await Te(o,p.treeInfos.slice(y),p.roots.slice(y),p.rootIndices.slice(y),i)).find(v=>v.type==="Settings")??null,{remainingAccounts:x,systemOffset:_}=o.toAccountMetas(),P=U(p,_);if(!I)throw new Error("Settings creation args is missing.");return await Ko({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:P,...I,remainingAccounts:x})}async function Fk({settings:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:o,proof:i,settingsMutArgs:a}=await de(true,e,n,false,t);if(!a)throw new M("Proof args are missing for settings account.");let c=ie(s),{secp256r1VerifyInput:d,transactionSyncSigners:A}=Pe(c,o),{remainingAccounts:y,systemOffset:p}=o.toAccountMetas(),f=U(i,p),S=[];return d.length>0&&S.push(O(d)),S.push(xc({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:f,signers:A,remainingAccounts:y})),S}async function Xk({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,o=[];if(r){let i=new V;await i.addSystemAccounts();let a=await me(),{address:c,addressTree:d}=await W(r.address,a),A=[{address:c,tree:d,queue:d,type:"User"}],y=await X([],A),p=(await Te(i,y.treeInfos,y.roots,y.rootIndices,A))[0],f=i.toAccountMetas();o=f.remainingAccounts,t={compressedProofArgs:U(y,f.systemOffset),authorityCreationArgs:p};}return Uc({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:o})}async function r2({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new V;await s.addSystemAccounts();let t=await ge([{address:(await W(e.address,n)).address,type:"User"}]),o=await X(t,[]),i=te(s,o.treeInfos,o.leafIndices,o.rootIndices,o.proveByIndices,t,K())[0],{remainingAccounts:a,systemOffset:c}=s.toAccountMetas(),d=U(o,c);return wc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function g2({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:o,verifyArgs:i,message:a,signature:c,publicKey:d}=ce(n),A=[];a&&c&&d&&A.push({message:a,signature:c,publicKey:d});let y=await Ht(n instanceof b?n:n.address,r,t),p=[];p.push({address:(await W(n instanceof b?n:n.address,r)).address,type:"User"});let f,S=null,I,x=null,_=y.wallets.find(fe=>fe.isDelegate);if(_){let fe=await le(_.index);(await Dr(fe,_.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(fe,_.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):f=await le(_.index);}if(s){let fe=await le(s.index);(await Dr(fe,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(fe,s.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):I=await le(s.index);}let P=new V;await P.addSystemAccounts();let v=await ge(p,t),L=await X(v,[]),Z=te(P,L.treeInfos.slice(0,1),L.leafIndices.slice(0,1),L.rootIndices.slice(0,1),L.proveByIndices.slice(0,1),v.slice(0,1),K())[0],ne=S?some(te(P,L.treeInfos.slice(S.start,S.end),L.leafIndices.slice(S.start,S.end),L.rootIndices.slice(S.start,S.end),L.proveByIndices.slice(S.start,S.end),v.slice(S.start,S.end),Y())[0]):none(),se=x?some(te(P,L.treeInfos.slice(x.start,x.end),L.leafIndices.slice(x.start,x.end),L.rootIndices.slice(x.start,x.end),L.proveByIndices.slice(x.start,x.end),v.slice(x.start,x.end),Y())[0]):none(),{remainingAccounts:qe,systemOffset:be}=P.toAccountMetas(),br=U(L,be),rt=[];return A.length>0&&rt.push(O(A)),rt.push(zc({secp256r1VerifyArgs:i,domainConfig:o,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof b?void 0:n,oldSettings:f,oldSettingsMutArgs:ne,newSettings:I,newSettingsMutArgs:se,compressedProofArgs:br,userMutArgs:Z,remainingAccounts:qe})),rt}async function b2({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:s,compressed:t=false,cachedAccounts:o}){let i=await yo(z(),r),a=i.data.multiWalletSettings,{packedAccounts:c,proof:d,settingsMutArgs:A}=await de(t,a,e,false,o),{remainingAccounts:y,systemOffset:p}=c.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:I,signature:x,publicKey:_}=ce(n),P=[];if(I&&x&&_&&P.push(O([{message:I,signature:x,publicKey:_}])),t){if(!s||!A)throw new M("Payer not found or proof args are missing for closing buffer.");let v=U(d,p);P.push(Ea({transactionBuffer:r,domainConfig:f,closer:n instanceof b?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:A,payer:s,compressedProofArgs:v,remainingAccounts:y}));}else P.push(ma({transactionBuffer:r,domainConfig:f,closer:n instanceof b?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return P}function tu({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:o,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:c,compressedArgs:d,expectedSigners:A}){let{domainConfig:y,verifyArgs:p,message:f,signature:S,publicKey:I}=ce(n),x=[];if(f&&S&&I&&x.push(O([{message:f,signature:S,publicKey:I}])),d){let{settingsReadonlyArgs:_,compressedProofArgs:P,remainingAccounts:v}=d;x.push(Wa({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof b?void 0:n,domainConfig:y,args:{bufferIndex:r,finalBufferHash:o,finalBufferSize:i,bufferExtendHashes:c,preauthorizeExecution:a,expectedSigners:A},settingsReadonlyArgs:_,compressedProofArgs:P,remainingAccounts:v}));}else x.push(Pa({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof b?void 0:n,domainConfig:y,args:{bufferIndex:r,finalBufferHash:o,finalBufferSize:i,bufferExtendHashes:c,preauthorizeExecution:a,expectedSigners:A},remainingAccounts:[]}));return x}function ru({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:o,signature:i,message:a,publicKey:c}=ce(e),d=[];return a&&i&&c&&d.push(O([{message:a,signature:i,publicKey:c}])),s?d.push(ja({transactionBuffer:n,secp256r1VerifyArgs:o,domainConfig:t,executor:e instanceof b?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Ha({settings:r,transactionBuffer:n,secp256r1VerifyArgs:o,domainConfig:t,executor:e instanceof b?void 0:e,remainingAccounts:[]})),d}function nu({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?si({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):$a({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function su({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:o,signature:i,publicKey:a,message:c}=ce(n),d=[];return c&&i&&a&&d.push(O([{message:c,signature:i,publicKey:a}])),s?d.push(mi({transactionBuffer:r,secp256r1VerifyArgs:o,domainConfig:t,voter:n instanceof b?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(ui({settings:e,transactionBuffer:r,secp256r1VerifyArgs:o,domainConfig:t,voter:n instanceof b?void 0:n,remainingAccounts:[]})),d}async function f8({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let o=await eD(r),i=new V,a=null,c=null,d=[];if(o.length||t){let y=await tD({packedAccounts:i,userAccounts:o,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:s});a=y.proof,c=y.settingsMutArgs??null,d=y.userMutArgs??[];}return {configActions:await rD({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:c,packedAccounts:i,compressed:t}}async function eD(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>W(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let s=await Promise.all(r.members.map(t=>W(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function tD({packedAccounts:e,userAccounts:n,compressed:r,settings:s,settingsAddressTreeIndex:t,cachedAccounts:o}){await e.addSystemAccounts();let i=[];if(r){let f=(await ae(s,t)).address;i.push({address:f,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await ge(i,o):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let c=await X(a,[]),d=[],A=[];for(let f of a)f.type==="Settings"?d.push(f):f.type==="User"&&A.push(f);let y,p=[];if(r&&c&&(y=te(e,c.treeInfos.slice(0,1),c.leafIndices.slice(0,1),c.rootIndices.slice(0,1),c.proveByIndices.slice(0,1),d,Y())[0]),A.length&&c){let f=r?1:0;p=te(e,c.treeInfos.slice(f),c.leafIndices.slice(f),c.rootIndices.slice(f),c.proveByIndices.slice(f),A,K());}return {proof:c,settingsMutArgs:y,userMutArgs:p}}async function rD({configActionsArgs:e,userMutArgs:n}){let r=[];for(let s of e)switch(s.type){case "AddMembers":{let t=[];for(let o of s.members){let i=await W(o.member,o.userAddressTreeIndex).then(a=>n.find(c=>equalBytes(c.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(a.address)))));if(!i)throw new Error("Unable to find user account");t.push(oD({permissionArgs:o.permissions,userMutArgs:i,pubkey:o.member}));}r.push({__kind:s.type,fields:[t]});break}case "RemoveMembers":{let t=await Promise.all(s.members.map(o=>W(o.member,o.userAddressTreeIndex).then(i=>{let a=n.find(c=>equalBytes(c.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(i.address))));if(!a)throw new Error("Unable to find user account");return sD({pubkey:o.member,userMutArgs:a})})));r.push({__kind:s.type,fields:[t]});break}case "EditPermissions":{let t=s.members.map(o=>nD({permissionArgs:o.permissions,pubkey:o.member}));r.push({__kind:s.type,fields:[t]});break}default:r.push({__kind:s.type,fields:[s.threshold]});}return r}function nD({pubkey:e,permissionArgs:n}){return {memberKey:pe(e),permissions:iu(n)}}function sD({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 oD({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:iu(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function iu(e){let n=[];return e.initiate&&n.push(Ee.InitiateTransaction),e.vote&&n.push(Ee.VoteTransaction),e.execute&&n.push(Ee.ExecuteTransaction),Me.fromPermissions(n)}async function R8({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:o,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:c,compressed:d=false,additionalVoters:A=[],additionalSigners:y=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:f}){let S=Math.floor(Math.random()*255),I=await Hd(n,t instanceof b?t:t.address,S),x=[],_=[];for(let $=0;$<s.length;$+=p){let ns=s.subarray($,$+p);x.push(ns),_.push(sha256(ns));}let P=sha256(s),{settingsReadonlyArgs:v,settingsMutArgs:L,proof:Z,packedAccounts:ne}=await de(d,n,r,false,f),{remainingAccounts:se,systemOffset:qe}=ne.toAccountMetas(),be=Z&&v&&L?{settingsReadonlyArgs:v,settingsMutArgs:L,compressedProofArgs:U(Z,qe),remainingAccounts:se,payer:e}:null,br=ie([t,...o?[o]:[],...A]).map($=>({memberKey:pe($),messageHash:$ instanceof b?Fn($.authResponse):null})),rt=tu({finalBufferHash:P,finalBufferSize:s.length,bufferIndex:S,payer:e,transactionBufferAddress:I,settings:n,creator:t,preauthorizeExecution:!o,bufferExtendHashes:_,compressedArgs:be,expectedSigners:br}),fe=x.map($=>nu({transactionMessageBytes:$,transactionBufferAddress:I,settings:n,compressed:d})),Gt=A.map($=>su({voter:$,transactionBufferAddress:I,settings:n,compressedArgs:be})),Au=ru({compressedArgs:be,settings:n,executor:o,transactionBufferAddress:I}),{instructions:l,addressLookupTableAccounts:gu}=await $d({compressed:d,settings:n,transactionMessageBytes:s,transactionBufferAddress:I,payer:e,additionalSigners:y,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:c}),nt=$=>({payer:e,instructions:$,addressesByLookupTableAddress:gu});return [nt(rt),...fe.map($=>nt([$])),...Gt.length?[nt(Gt.flat())]:[],nt(Au),nt(l)]}var hr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=i=>{let a=s.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},s.set(i,a)),a},o=t(r);o.isSigner=true,o.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let c=t(a.address);c.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,c.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),s=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),o=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:o.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 c=[...r.map(([d])=>d),...s.map(([d])=>d),...t.map(([d])=>d),...o.map(([d])=>d)];return [i,c]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,o]=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:s,readonly:o}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[o,i]of this.keyMetaMap.entries())if(r(i)){let a=o,c=n.findIndex(d=>d===a);if(c>=0){if(c>=256)throw new Error("Max lookup table index exceeded");s.push(c),t.push(a),this.keyMetaMap.delete(o);}}return [s,t]}};var Pr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((o,i)=>{s.set(o,i);});let t=o=>{let i=s.get(o);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(o=>({programAddressIndex:t(o.programAddress),accountIndices:o.accounts?.map(i=>t(i.address))??[],data:o.data}))}};function uu({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=hr.compile(r,e),o=new Array,i={writable:[],readonly:[]},a=Object.entries(s??{});for(let p of a){let f=t.extractTableLookup(p);if(f!==void 0){let{addressTableLookup:S,drainedKeys:I}=f;o.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[c,d]=t.getMessageComponents(),y=new Pr(d,i).compileInstructions(r);return {version:0,header:c,instructions:y,lifetimeToken:n,staticAccounts:d,addressTableLookups:o}}function k8({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=uu({instructions:e,payer:n,recentBlockhash:u,addressesByLookupTableAddress:r});return new Uint8Array(Yi(s))}async function z8({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,additionalSigners:o,secp256r1VerifyInput:i,addressesByLookupTableAddress:a,cachedAccounts:c,compressed:d=false,simulateProof:A=false}){let{instructions:y,addressLookupTableAccounts:p}=await Qd({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,additionalSigners:o,transactionMessageBytes:s,secp256r1VerifyInput:i,compressed:d,addressesByLookupTableAddress:a,simulateProof:A,cachedAccounts:c});return {payer:e,instructions:y,addressesByLookupTableAddress:p}}export{Eo as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,jI as AdditionalSignersSchema,Ki as AuthenticationContextSchema,ji as BaseResponseSchema,No as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,bo as CHANGE_CONFIG_DISCRIMINATOR,Fo as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,Qo as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,sc as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,ic as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,gc as CREATE_USER_ACCOUNTS_DISCRIMINATOR,NW as CompleteMessageRequestSchema,kW as CompleteSendTransactionRequestSchema,wW as CompleteTransactionRequestSchema,lc as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Cc as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,ss as DOMAIN_CONFIG_DISCRIMINATOR,_c as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,Oc as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,Vc as EDIT_USER_DELEGATE_DISCRIMINATOR,us as GLOBAL_COUNTER_DISCRIMINATOR,Ut as KeyType,Gx as MULTI_WALLET_ERROR__ALREADY_DELEGATED,fx as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,WI as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,iI as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,uI as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,AI as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,UI as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,FI as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,Ix as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,xx as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,Ux as MULTI_WALLET_ERROR__EMPTY_MEMBERS,lI as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,bx as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,Sx as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,hx as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,Zx as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,$x as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,Qx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,mI as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,Kx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,Fx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,zx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,Nx as MULTI_WALLET_ERROR__INVALID_ACCOUNT,vI as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,pI as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,_x as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,kx as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,Xx as MULTI_WALLET_ERROR__INVALID_BUFFER,fI as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,jx as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,Bx as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,Dx as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,gx as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,Tx as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,Ax as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,px as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,aI as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,oI as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,Wx as MULTI_WALLET_ERROR__INVALID_THRESHOLD,PI as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,Px as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,Rx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,Ox as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,NI as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,wx as MULTI_WALLET_ERROR__INVALID_USER_ROLE,BI as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,hI as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,mx as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,nI as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,gI as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,II as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,_I as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,Hx as MULTI_WALLET_ERROR__MISSING_ACCOUNT,SI as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,DI as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,wI as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,RI as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,xI as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,Vx as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,VI as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,HI as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,TI as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,kI as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,MI as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,sI as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,LI as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,GI as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,Jx as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,vx as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,Cx as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,Mx as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,yI as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,CI as MULTI_WALLET_ERROR__PAYER_MISMATCH,Ex as MULTI_WALLET_ERROR__PERMANENT_MEMBER,rI as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,lx as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,EI as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,yx as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,cI as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,bI as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,Lx as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,eI as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,tI as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,dI as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,Yx as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,OI as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,qx as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,u as MULTI_WALLET_PROGRAM_ADDRESS,ix as MultiWalletAccount,dx as MultiWalletInstruction,Zc as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,jc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Ee as Permission,Me as Permissions,no as SETTINGS_DISCRIMINATOR,Re as Secp256r1Key,b as SignedSecp256r1Key,Fi as StartMessageRequestSchema,zi as StartTransactionRequestSchema,ia as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,ra as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Sa as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,ya as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,va as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,Ma as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,uo as TRANSACTION_BUFFER_DISCRIMINATOR,Fa as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Na as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,ti as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Ya as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,yi as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,ai as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,Mi as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,Si as TRANSACTION_EXECUTE_DISCRIMINATOR,Ni as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,vi as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Gi as TransactionActionTypeSchema,qI as TransactionDetailsSchema,BW as TransactionPayloadSchema,KI as TransactionPayloadWithBase64MessageBytesSchema,gn as Transports,zI as UserInfoSchema,De as UserRole,mo as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,bW as addWhitelistedAddressTrees,Ae as base64URLStringToBuffer,vO as bufferToBase64URLString,Sk as changeConfig,b2 as closeTransactionBuffer,XD as configAction,WO as convertBase64StringToJWK,LO as convertJWKToBase64String,zd as convertMemberKeyToString,MO as convertPubkeyCompressedToCose,DO as convertPubkeyCoseToCompressed,PO as createClientAuthorizationCompleteRequestChallenge,hO as createClientAuthorizationStartRequestChallenge,VN as createDomainConfig,$N as createDomainUserAccounts,rw as createGlobalCounter,bO as createMessageChallenge,tu as createTransactionBuffer,_O as createTransactionChallenge,UC as createTransactionManagerSigner,Rk as createUserAccounts,Lk as createWallet,cs as decodeDomainConfig,gs as decodeGlobalCounter,so as decodeSettings,go as decodeTransactionBuffer,fo as decodeWhitelistedAddressTree,Fk as decompressSettingsAccount,MN as deserializeConfigActions,cw as disableDomainConfig,Xk as editDomainConfig,r2 as editTransactionManagerUrl,g2 as editUserDelegate,$d as executeTransaction,ru as executeTransactionBuffer,Qd as executeTransactionSync,nu as extendTransactionBuffer,AD as fetchAllDomainConfig,fD as fetchAllGlobalCounter,Ru as fetchAllMaybeDomainConfig,Gu as fetchAllMaybeGlobalCounter,Ap as fetchAllMaybeSettings,vp as fetchAllMaybeTransactionBuffer,Zp as fetchAllMaybeWhitelistedAddressTree,Jh as fetchAllSettings,vB as fetchAllSettingsAccountByMember,eP as fetchAllTransactionBuffer,oP as fetchAllWhitelistedAddressTree,Pd as fetchCompressedAccount,as as fetchDomainConfig,lD as fetchGlobalCounter,Mu as fetchMaybeDomainConfig,Vu as fetchMaybeGlobalCounter,yn as fetchMaybeSettings,AC as fetchMaybeSettingsAccountData,_p as fetchMaybeTransactionBuffer,uC as fetchMaybeUserAccountData,Xp as fetchMaybeWhitelistedAddressTree,qh as fetchSettings,Dr as fetchSettingsAccountData,yo as fetchTransactionBuffer,_B as fetchUserAccountByFilters,Ht as fetchUserAccountData,So as fetchWhitelistedAddressTree,CD as getAddMemberArgsCodec,vr as getAddMemberArgsDecoder,_r as getAddMemberArgsEncoder,EP as getAddWhitelistedAddressTreesDiscriminatorBytes,DP as getAddWhitelistedAddressTreesInstruction,Do as getAddWhitelistedAddressTreesInstructionAsync,CP as getAddWhitelistedAddressTreesInstructionDataCodec,Co as getAddWhitelistedAddressTreesInstructionDataDecoder,In as getAddWhitelistedAddressTreesInstructionDataEncoder,VP as getChangeConfigCompressedDiscriminatorBytes,Ho as getChangeConfigCompressedInstruction,GP as getChangeConfigCompressedInstructionDataCodec,ko as getChangeConfigCompressedInstructionDataDecoder,wo as getChangeConfigCompressedInstructionDataEncoder,UP as getChangeConfigDiscriminatorBytes,Uo as getChangeConfigInstruction,LP as getChangeConfigInstructionDataCodec,vo as getChangeConfigInstructionDataDecoder,_o as getChangeConfigInstructionDataEncoder,Gn as getClientAndDeviceHash,RD as getCompiledInstructionCodec,Lr as getCompiledInstructionDecoder,Ur as getCompiledInstructionEncoder,_D as getCompressedAccountMetaCodec,at as getCompressedAccountMetaDecoder,ct as getCompressedAccountMetaEncoder,WD as getCompressedAccountMetaReadOnlyCodec,At as getCompressedAccountMetaReadOnlyDecoder,ut as getCompressedAccountMetaReadOnlyEncoder,ND as getCompressedProofCodec,kr as getCompressedProofDecoder,wr as getCompressedProofEncoder,ae as getCompressedSettingsAddress,VD as getCompressedSettingsCodec,KD as getCompressedSettingsDataCodec,Vr as getCompressedSettingsDataDecoder,Hr as getCompressedSettingsDataEncoder,Y as getCompressedSettingsDecoder,gt as getCompressedSettingsEncoder,YD as getConfigActionCodec,Oe as getConfigActionDecoder,We as getConfigActionEncoder,XP as getCreateCompressedWalletDiscriminatorBytes,$P as getCreateCompressedWalletInstruction,Ko as getCreateCompressedWalletInstructionAsync,ZP as getCreateCompressedWalletInstructionDataCodec,zo as getCreateCompressedWalletInstructionDataDecoder,En as getCreateCompressedWalletInstructionDataEncoder,cb as getCreateDomainConfigDiscriminatorBytes,ib as getCreateDomainConfigInstruction,tc as getCreateDomainConfigInstructionAsync,ab as getCreateDomainConfigInstructionDataCodec,ec as getCreateDomainConfigInstructionDataDecoder,Dn as getCreateDomainConfigInstructionDataEncoder,mb as getCreateDomainUserAccountDiscriminatorBytes,fb as getCreateDomainUserAccountInstruction,cc as getCreateDomainUserAccountInstructionAsync,lb as getCreateDomainUserAccountInstructionDataCodec,oc as getCreateDomainUserAccountInstructionDataDecoder,Mn as getCreateDomainUserAccountInstructionDataEncoder,Mb as getCreateGlobalCounterDiscriminatorBytes,hb as getCreateGlobalCounterInstruction,uc as getCreateGlobalCounterInstructionAsync,Rb as getCreateGlobalCounterInstructionDataCodec,dc as getCreateGlobalCounterInstructionDataDecoder,hn as getCreateGlobalCounterInstructionDataEncoder,tM as getCreateUserAccountArgsCodec,Yr as getCreateUserAccountArgsDecoder,Jr as getCreateUserAccountArgsEncoder,Ob as getCreateUserAccountsDiscriminatorBytes,Nb as getCreateUserAccountsInstruction,pc as getCreateUserAccountsInstructionAsync,Bb as getCreateUserAccountsInstructionDataCodec,yc as getCreateUserAccountsInstructionDataDecoder,bn as getCreateUserAccountsInstructionDataEncoder,Kb as getDecompressSettingsAccountDiscriminatorBytes,xc as getDecompressSettingsAccountInstruction,jb as getDecompressSettingsAccountInstructionDataCodec,Sc as getDecompressSettingsAccountInstructionDataDecoder,fc as getDecompressSettingsAccountInstructionDataEncoder,Qb as getDisableDomainConfigDiscriminatorBytes,Rc as getDisableDomainConfigInstruction,e_ as getDisableDomainConfigInstructionDataCodec,Mc as getDisableDomainConfigInstructionDataDecoder,Dc as getDisableDomainConfigInstructionDataEncoder,Ze as getDomainConfigAddress,uD as getDomainConfigCodec,os as getDomainConfigDecoder,dD as getDomainConfigDiscriminatorBytes,Du as getDomainConfigEncoder,gD as getDomainConfigSize,i_ as getEditDomainConfigDiscriminatorBytes,Uc as getEditDomainConfigInstruction,u_ as getEditDomainConfigInstructionAsync,d_ as getEditDomainConfigInstructionDataCodec,vc as getEditDomainConfigInstructionDataDecoder,vn as getEditDomainConfigInstructionDataEncoder,oM as getEditMemberArgsCodec,Kr as getEditMemberArgsDecoder,zr as getEditMemberArgsEncoder,f_ as getEditTransactionManagerUrlDiscriminatorBytes,wc as getEditTransactionManagerUrlInstruction,S_ as getEditTransactionManagerUrlInstructionDataCodec,Nc as getEditTransactionManagerUrlInstructionDataDecoder,Bc as getEditTransactionManagerUrlInstructionDataEncoder,h_ as getEditUserDelegateDiscriminatorBytes,zc as getEditUserDelegateInstruction,P_ as getEditUserDelegateInstructionDataCodec,Fc as getEditUserDelegateInstructionDataDecoder,Gc as getEditUserDelegateInstructionDataEncoder,dM as getExpectedSignerCodec,mt as getExpectedSignerDecoder,Tt as getExpectedSignerEncoder,kd as getGlobalCounterAddress,mD as getGlobalCounterCodec,As as getGlobalCounterDecoder,TD as getGlobalCounterDiscriminatorBytes,Hu as getGlobalCounterEncoder,SD as getGlobalCounterSize,Vn as getJitoTipsConfig,zB as getLightCpiSigner,Ye as getLightProtocolRpc,yM as getLinkWalletArgsCodec,Zr as getLinkWalletArgsDecoder,Xr as getLinkWalletArgsEncoder,lM as getMemberCodec,pt as getMemberDecoder,yt as getMemberEncoder,xM as getMemberKeyCodec,J as getMemberKeyDecoder,B as getMemberKeyEncoder,lW as getMultiWalletErrorMessage,j_ as getNativeTransferIntentCompressedDiscriminatorBytes,ea as getNativeTransferIntentCompressedInstruction,q_ as getNativeTransferIntentCompressedInstructionDataCodec,Qc as getNativeTransferIntentCompressedInstructionDataDecoder,$c as getNativeTransferIntentCompressedInstructionDataEncoder,B_ as getNativeTransferIntentDiscriminatorBytes,Jc as getNativeTransferIntentInstruction,w_ as getNativeTransferIntentInstructionAsync,N_ as getNativeTransferIntentInstructionDataCodec,qc as getNativeTransferIntentInstructionDataDecoder,Un as getNativeTransferIntentInstructionDataEncoder,DM as getNewAuthorityArgsCodec,tn as getNewAuthorityArgsDecoder,en as getNewAuthorityArgsEncoder,UO as getOriginIndex,hM as getPackedAddressTreeInfoCodec,xt as getPackedAddressTreeInfoDecoder,St as getPackedAddressTreeInfoEncoder,_M as getPackedStateTreeInfoCodec,dt as getPackedStateTreeInfoDecoder,it as getPackedStateTreeInfoEncoder,LM as getPermissionsCodec,ve as getPermissionsDecoder,_e as getPermissionsEncoder,NM as getProofArgsCodec,h as getProofArgsDecoder,R as getProofArgsEncoder,VM as getRemoveMemberArgsCodec,qr as getRemoveMemberArgsDecoder,jr as getRemoveMemberArgsEncoder,Fn as getSecp256r1MessageHash,zM as getSecp256r1PubkeyCodec,It as getSecp256r1PubkeyDecoder,rn as getSecp256r1PubkeyEncoder,jC as getSecp256r1SignatureOffsetsDataDecoder,KC as getSecp256r1SignatureOffsetsDataEncoder,qM as getSecp256r1VerifyArgsCodec,w as getSecp256r1VerifyArgsDecoder,N as getSecp256r1VerifyArgsEncoder,ZM as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,sn as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,nn as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,O as getSecp256r1VerifyInstruction,Sw as getSecp256r1VerifyInstructionDataCodec,Xd as getSecp256r1VerifyInstructionDataDecoder,Zd as getSecp256r1VerifyInstructionDataEncoder,td as getSendAndConfirmTransaction,jh as getSettingsCodec,or as getSettingsDecoder,Kh as getSettingsDiscriminatorBytes,up as getSettingsEncoder,le as getSettingsFromIndex,nR as getSettingsIndexWithAddressAndDelegateInfoCodec,dn as getSettingsIndexWithAddressAndDelegateInfoDecoder,an as getSettingsIndexWithAddressAndDelegateInfoEncoder,eR as getSettingsIndexWithAddressCodec,cn as getSettingsIndexWithAddressDecoder,on as getSettingsIndexWithAddressEncoder,aR as getSettingsMutArgsCodec,H as getSettingsMutArgsDecoder,k as getSettingsMutArgsEncoder,AR as getSettingsReadonlyArgsCodec,Ct as getSettingsReadonlyArgsDecoder,Et as getSettingsReadonlyArgsEncoder,RO as getSignedSecp256r1Key,CN as getSignedTransactionManager,z as getSolanaRpc,ed as getSolanaRpcEndpoint,Av as getTokenTransferIntentCompressedDiscriminatorBytes,yv as getTokenTransferIntentCompressedInstruction,ua as getTokenTransferIntentCompressedInstructionAsync,gv as getTokenTransferIntentCompressedInstructionDataCodec,da as getTokenTransferIntentCompressedInstructionDataDecoder,On as getTokenTransferIntentCompressedInstructionDataEncoder,tv as getTokenTransferIntentDiscriminatorBytes,nv as getTokenTransferIntentInstruction,sa as getTokenTransferIntentInstructionAsync,rv as getTokenTransferIntentInstructionDataCodec,na as getTokenTransferIntentInstructionDataDecoder,Wn as getTokenTransferIntentInstructionDataEncoder,Hd as getTransactionBufferAddress,_v as getTransactionBufferCloseCompressedDiscriminatorBytes,Ea as getTransactionBufferCloseCompressedInstruction,vv as getTransactionBufferCloseCompressedInstructionDataCodec,Ia as getTransactionBufferCloseCompressedInstructionDataDecoder,xa as getTransactionBufferCloseCompressedInstructionDataEncoder,Iv as getTransactionBufferCloseDiscriminatorBytes,ma as getTransactionBufferCloseInstruction,Ev as getTransactionBufferCloseInstructionDataCodec,Ta as getTransactionBufferCloseInstructionDataDecoder,pa as getTransactionBufferCloseInstructionDataEncoder,Qh as getTransactionBufferCodec,TR as getTransactionBufferCreateArgsCodec,Mt as getTransactionBufferCreateArgsDecoder,Dt as getTransactionBufferCreateArgsEncoder,Jv as getTransactionBufferCreateCompressedDiscriminatorBytes,Wa as getTransactionBufferCreateCompressedInstruction,Yv as getTransactionBufferCreateCompressedInstructionDataCodec,La as getTransactionBufferCreateCompressedInstructionDataDecoder,Ua as getTransactionBufferCreateCompressedInstructionDataEncoder,kv as getTransactionBufferCreateDiscriminatorBytes,Pa as getTransactionBufferCreateInstruction,Hv as getTransactionBufferCreateInstructionDataCodec,ha as getTransactionBufferCreateInstructionDataDecoder,Ra as getTransactionBufferCreateInstructionDataEncoder,Ao as getTransactionBufferDecoder,$h as getTransactionBufferDiscriminatorBytes,bp as getTransactionBufferEncoder,gU as getTransactionBufferExecuteCompressedDiscriminatorBytes,ja as getTransactionBufferExecuteCompressedInstruction,yU as getTransactionBufferExecuteCompressedInstructionDataCodec,Ka as getTransactionBufferExecuteCompressedInstructionDataDecoder,za as getTransactionBufferExecuteCompressedInstructionDataEncoder,nU as getTransactionBufferExecuteDiscriminatorBytes,Ha as getTransactionBufferExecuteInstruction,sU as getTransactionBufferExecuteInstructionDataCodec,ka as getTransactionBufferExecuteInstructionDataDecoder,wa as getTransactionBufferExecuteInstructionDataEncoder,PU as getTransactionBufferExtendCompressedDiscriminatorBytes,si as getTransactionBufferExtendCompressedInstruction,bU as getTransactionBufferExtendCompressedInstructionDataCodec,ni as getTransactionBufferExtendCompressedInstructionDataDecoder,ri as getTransactionBufferExtendCompressedInstructionDataEncoder,xU as getTransactionBufferExtendDiscriminatorBytes,$a as getTransactionBufferExtendInstruction,IU as getTransactionBufferExtendInstructionDataCodec,Za as getTransactionBufferExtendInstructionDataDecoder,Xa as getTransactionBufferExtendInstructionDataEncoder,jU as getTransactionBufferVoteCompressedDiscriminatorBytes,mi as getTransactionBufferVoteCompressedInstruction,qU as getTransactionBufferVoteCompressedInstructionDataCodec,Ti as getTransactionBufferVoteCompressedInstructionDataDecoder,pi as getTransactionBufferVoteCompressedInstructionDataEncoder,NU as getTransactionBufferVoteDiscriminatorBytes,ui as getTransactionBufferVoteInstruction,wU as getTransactionBufferVoteInstructionDataCodec,di as getTransactionBufferVoteInstructionDataDecoder,ii as getTransactionBufferVoteInstructionDataEncoder,iL as getTransactionExecuteCompressedDiscriminatorBytes,Pi as getTransactionExecuteCompressedInstruction,dL as getTransactionExecuteCompressedInstructionDataCodec,hi as getTransactionExecuteCompressedInstructionDataDecoder,Ri as getTransactionExecuteCompressedInstructionDataEncoder,eL as getTransactionExecuteDiscriminatorBytes,Ei as getTransactionExecuteInstruction,tL as getTransactionExecuteInstructionDataCodec,Ii as getTransactionExecuteInstructionDataDecoder,xi as getTransactionExecuteInstructionDataEncoder,RL as getTransactionExecuteSyncCompressedDiscriminatorBytes,Hi as getTransactionExecuteSyncCompressedInstruction,hL as getTransactionExecuteSyncCompressedInstructionDataCodec,ki as getTransactionExecuteSyncCompressedInstructionDataDecoder,wi as getTransactionExecuteSyncCompressedInstructionDataEncoder,lL as getTransactionExecuteSyncDiscriminatorBytes,Wi as getTransactionExecuteSyncInstruction,fL as getTransactionExecuteSyncInstructionDataCodec,Li as getTransactionExecuteSyncInstructionDataDecoder,Ui as getTransactionExecuteSyncInstructionDataEncoder,ER as getTransactionMessageAddressTableLookupCodec,An as getTransactionMessageAddressTableLookupDecoder,un as getTransactionMessageAddressTableLookupEncoder,SR as getTransactionMessageCodec,ht as getTransactionMessageDecoder,Rt as getTransactionMessageEncoder,RR as getTransactionSyncSignersCodec,F as getTransactionSyncSignersDecoder,G as getTransactionSyncSignersEncoder,vR as getTransportsCodec,bt as getTransportsDecoder,Pt as getTransportsEncoder,W as getUserAccountAddress,OR as getUserCodec,kR as getUserCreationArgsCodec,xe as getUserCreationArgsDecoder,Se as getUserCreationArgsEncoder,K as getUserDecoder,_t as getUserEncoder,FR as getUserMutArgsCodec,ke as getUserMutArgsDecoder,we as getUserMutArgsEncoder,qR as getUserReadOnlyArgsCodec,ft as getUserReadOnlyArgsDecoder,lt as getUserReadOnlyArgsEncoder,ZR as getUserReadOnlyOrMutateArgsCodec,Le as getUserReadOnlyOrMutateArgsDecoder,Ue as getUserReadOnlyOrMutateArgsEncoder,rh as getUserRoleCodec,Ne as getUserRoleDecoder,Be as getUserRoleEncoder,FB as getWalletAddressFromIndex,Ce as getWalletAddressFromSettings,sP as getWhitelistedAddressTreeCodec,lo as getWhitelistedAddressTreeDecoder,nP as getWhitelistedAddressTreeDiscriminatorBytes,Yp as getWhitelistedAddressTreeEncoder,Xn as getWhitelistedAddressTreeFromIndex,UB as getWhitelistedAddressTreeIndexFromAddress,bd as getWhitelistedAddressTreesAddress,uW as identifyMultiWalletAccount,AW as identifyMultiWalletInstruction,dO as initialize,ZD as isConfigAction,fW as isMultiWalletError,PR as isTransactionSyncSigners,QR as isUserReadOnlyOrMutateArgs,Yw as nativeTransferIntent,MP as parseAddWhitelistedAddressTreesInstruction,FP as parseChangeConfigCompressedInstruction,WP as parseChangeConfigInstruction,QP as parseCreateCompressedWalletInstruction,db as parseCreateDomainConfigInstruction,Sb as parseCreateDomainUserAccountInstruction,Pb as parseCreateGlobalCounterInstruction,wb as parseCreateUserAccountsInstruction,qb as parseDecompressSettingsAccountInstruction,t_ as parseDisableDomainConfigInstruction,A_ as parseEditDomainConfigInstruction,x_ as parseEditTransactionManagerUrlInstruction,b_ as parseEditUserDelegateInstruction,J_ as parseNativeTransferIntentCompressedInstruction,k_ as parseNativeTransferIntentInstruction,xw as parseSecp256r1VerifyInstruction,pv as parseTokenTransferIntentCompressedInstruction,sv as parseTokenTransferIntentInstruction,Uv as parseTransactionBufferCloseCompressedInstruction,Cv as parseTransactionBufferCloseInstruction,Xv as parseTransactionBufferCreateCompressedInstruction,Vv as parseTransactionBufferCreateInstruction,pU as parseTransactionBufferExecuteCompressedInstruction,oU as parseTransactionBufferExecuteInstruction,_U as parseTransactionBufferExtendCompressedInstruction,EU as parseTransactionBufferExtendInstruction,JU as parseTransactionBufferVoteCompressedInstruction,kU as parseTransactionBufferVoteInstruction,uL as parseTransactionExecuteCompressedInstruction,rL as parseTransactionExecuteInstruction,PL as parseTransactionExecuteSyncCompressedInstruction,SL as parseTransactionExecuteSyncInstruction,eN as pollJitoBundleConfirmation,f8 as prepareChangeConfigArgs,R8 as prepareTransactionBundle,k8 as prepareTransactionMessage,z8 as prepareTransactionSync,EN as retrieveTransactionManager,TC as sendJitoBundle,DN as serializeConfigActions,QB as signAndSendBundledTransactions,aN as signAndSendTransaction,ak as tokenTransferIntent,hR as transactionSyncSigners,$R as userReadOnlyOrMutateArgs,Xi as vaultTransactionMessageDeserialize,Yi as vaultTransactionMessageSerialize,su as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|