@revibase/core 0.0.52 → 0.0.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
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,deriveAddressSeedV2,createBN254,deriveAddressV2,encodeBN254toBase58,getLightSystemAccountMetasV2,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import T from'zod';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 fs=new Uint8Array([201,232,212,229,59,241,106,197]);function nM(){return fixEncoderSize(getBytesEncoder(),8).encode(fs)}function ug(){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:fs}))}function Ss(){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 oM(){return combineCodec(ug(),Ss())}function xs(e){return decodeAccount(e,Ss())}async function Is(e,n,r){let o=await Ag(e,n,r);return assertAccountExists(o),o}async function Ag(e,n,r){let o=await fetchEncodedAccount(e,n,r);return xs(o)}async function sM(e,n,r){let o=await gg(e,n,r);return assertAccountsExist(o),o}async function gg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>xs(t))}function cM(){return 846}var Ds=new Uint8Array([42,206,176,58,175,129,130,233]);function dM(){return fixEncoderSize(getBytesEncoder(),8).encode(Ds)}function hg(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Ds}))}function Ps(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function uM(){return combineCodec(hg(),Ps())}function hs(e){return decodeAccount(e,Ps())}async function AM(e,n,r){let o=await Mg(e,n,r);return assertAccountExists(o),o}async function Mg(e,n,r){let o=await fetchEncodedAccount(e,n,r);return hs(o)}async function gM(e,n,r){let o=await Rg(e,n,r);return assertAccountsExist(o),o}async function Rg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>hs(t))}function pM(){return 24}function en(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function tn(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function lM(){return combineCodec(en(),tn())}function rn(){return getStructEncoder([["memberKey",H()],["permissions",He()],["userArgs",Ge()]])}function nn(){return getStructDecoder([["memberKey",oe()],["permissions",Fe()],["userArgs",ze()]])}function xM(){return combineCodec(rn(),nn())}function on(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function sn(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function EM(){return combineCodec(on(),sn())}function xt(){return getStructEncoder([["treeInfo",Ct()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function It(){return getStructDecoder([["treeInfo",Et()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function MM(){return combineCodec(xt(),It())}function Dt(){return getStructEncoder([["treeInfo",Ct()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function Pt(){return getStructDecoder([["treeInfo",Et()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function vM(){return combineCodec(Dt(),Pt())}function cn(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function an(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function WM(){return combineCodec(cn(),an())}function pn(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function mn(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function BM(){return combineCodec(pn(),mn())}function ht(){return getStructEncoder([["data",getOptionEncoder(yn())]])}function K(){return getStructDecoder([["data",getOptionDecoder(ln())]])}function HM(){return combineCodec(ht(),K())}function yn(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(Mt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function ln(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(Rt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function KM(){return combineCodec(yn(),ln())}function bt(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",fn()],["tlv",getOptionEncoder(getArrayEncoder(Tn()))],["hasDelegate",getBooleanEncoder()],["isFrozen",getBooleanEncoder()]])}function _t(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",Sn()],["tlv",getOptionDecoder(getArrayDecoder(vt()))],["hasDelegate",getBooleanDecoder()],["isFrozen",getBooleanDecoder()]])}function YM(){return combineCodec(bt(),_t())}function Cn(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",Dn()]])}function En(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",Pn()]])}function $M(){return combineCodec(Cn(),En())}function Dn(){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",Rn()]])}function Pn(){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",bn()]])}function nR(){return combineCodec(Dn(),Pn())}function Ke(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Un())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(rn())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Wn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function je(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(kn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(nn())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Ln())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function aR(){return combineCodec(Ke(),je())}function iR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function dR(e,n){return n.__kind===e}function On(){return getStructEncoder([["member",getAddressEncoder()],["role",qe()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",be()]])}function Bn(){return getStructDecoder([["member",getAddressDecoder()],["role",Je()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",_e()]])}function pR(){return combineCodec(On(),Bn())}function Un(){return getStructEncoder([["memberKey",H()],["permissions",He()]])}function kn(){return getStructDecoder([["memberKey",oe()],["permissions",Fe()]])}function TR(){return combineCodec(Un(),kn())}function Ut(){return getStructEncoder([["memberKey",H()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function kt(){return getStructDecoder([["memberKey",oe()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function IR(){return combineCodec(Ut(),kt())}function Tn(){return getDiscriminatedUnionEncoder([["Placeholder0",getUnitEncoder()],["Placeholder1",getUnitEncoder()],["Placeholder2",getUnitEncoder()],["Placeholder3",getUnitEncoder()],["Placeholder4",getUnitEncoder()],["Placeholder5",getUnitEncoder()],["Placeholder6",getUnitEncoder()],["Placeholder7",getUnitEncoder()],["Placeholder8",getUnitEncoder()],["Placeholder9",getUnitEncoder()],["Placeholder10",getUnitEncoder()],["Placeholder11",getUnitEncoder()],["Placeholder12",getUnitEncoder()],["Placeholder13",getUnitEncoder()],["Placeholder14",getUnitEncoder()],["Placeholder15",getUnitEncoder()],["Placeholder16",getUnitEncoder()],["Placeholder17",getUnitEncoder()],["Placeholder18",getUnitEncoder()],["TokenMetadata",getStructEncoder([["fields",getTupleEncoder([Fn()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([Nn()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([Vn()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([zn()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([jn()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([cn()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([Cn()])]])]])}function vt(){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([Gn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([wn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([Hn()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([Kn()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([qn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([an()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([En()])]])]])}function PR(){return combineCodec(Tn(),vt())}function hR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function MR(e,n){return n.__kind===e}function Jn(){return getStructEncoder([["settingsMutArgs",j()],["transactionManager",getOptionEncoder(Wt())]])}function Yn(){return getStructDecoder([["settingsMutArgs",q()],["transactionManager",getOptionDecoder(Lt())]])}function vR(){return combineCodec(Jn(),Yn())}function Mt(){return getStructEncoder([["pubkey",H()],["role",getU8Encoder()],["permissions",He()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function Rt(){return getStructDecoder([["pubkey",oe()],["role",getU8Decoder()],["permissions",Fe()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function LR(){return combineCodec(Mt(),Rt())}function H(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function oe(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function NR(){return combineCodec(H(),oe())}function Qn(){return getStructEncoder([["authorityCreationArgs",be()],["compressedProofArgs",D()]])}function $n(){return getStructDecoder([["authorityCreationArgs",_e()],["compressedProofArgs",P()]])}function FR(){return combineCodec(Qn(),$n())}function Ot(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function Bt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function KR(){return combineCodec(Ot(),Bt())}function fn(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function Sn(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function JR(){return combineCodec(fn(),Sn())}function Ct(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function Et(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function XR(){return combineCodec(Ct(),Et())}function Nn(){return getStructEncoder([])}function wn(){return getStructDecoder([])}function eb(){return combineCodec(Nn(),wn())}function Vn(){return getStructEncoder([])}function Hn(){return getStructDecoder([])}function nb(){return combineCodec(Vn(),Hn())}function He(){return getStructEncoder([["mask",getU8Encoder()]])}function Fe(){return getStructDecoder([["mask",getU8Decoder()]])}function cb(){return combineCodec(He(),Fe())}function D(){return getStructEncoder([["proof",getOptionEncoder(pn())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function P(){return getStructDecoder([["proof",getOptionDecoder(mn())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function ub(){return combineCodec(D(),P())}function Wn(){return getStructEncoder([["memberKey",H()],["userArgs",Ge()]])}function Ln(){return getStructDecoder([["memberKey",oe()],["userArgs",ze()]])}function mb(){return combineCodec(Wn(),Ln())}function Rn(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function bn(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function Tb(){return combineCodec(Rn(),bn())}function ro(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Nt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function xb(){return combineCodec(ro(),Nt())}function F(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function G(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function Eb(){return combineCodec(F(),G())}function Z(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",F()]])}function X(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",G()]])}function Mb(){return combineCodec(Z(),X())}function no(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function oo(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function _b(){return combineCodec(no(),oo())}function so(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function co(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function kb(){return combineCodec(so(),co())}function j(){return getStructEncoder([["accountMeta",xt()],["data",ht()]])}function q(){return getStructDecoder([["accountMeta",It()],["data",K()]])}function Bb(){return combineCodec(j(),q())}function wt(){return getStructEncoder([["accountMeta",Dt()],["data",ht()]])}function Vt(){return getStructDecoder([["accountMeta",Pt()],["data",K()]])}function Hb(){return combineCodec(wt(),Vt())}function Ht(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function Ft(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function zb(){return combineCodec(Ht(),Ft())}function Fn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(en())]])}function Gn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(tn())]])}function Jb(){return combineCodec(Fn(),Gn())}function Gt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getArrayEncoder(Ut())]])}function zt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getArrayDecoder(kt())]])}function Qb(){return combineCodec(Gt(),zt())}function Kt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(on())],["addressTableLookups",getArrayEncoder(mo())]])}function jt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(sn())],["addressTableLookups",getArrayDecoder(yo())]])}function r_(){return combineCodec(Kt(),jt())}function mo(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function yo(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function s_(){return combineCodec(mo(),yo())}function zn(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function Kn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function i_(){return combineCodec(zn(),Kn())}function jn(){return getStructEncoder([["transferring",getU8Encoder()]])}function qn(){return getStructDecoder([["transferring",getU8Decoder()]])}function A_(){return combineCodec(jn(),qn())}var lo=(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))(lo||{});function qt(){return getEnumEncoder(lo)}function Jt(){return getEnumDecoder(lo)}function m_(){return combineCodec(qt(),Jt())}function Yt(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",H()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(qt()))],["wallets",getArrayEncoder(so())],["role",qe()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function te(){return getStructDecoder([["domainConfig",getOptionDecoder(getAddressDecoder())],["member",oe()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(Jt()))],["wallets",getArrayDecoder(co())],["role",Je()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function f_(){return combineCodec(Yt(),te())}function be(){return getStructEncoder([["addressTreeInfo",Ot()],["outputStateTreeIndex",getU8Encoder()]])}function _e(){return getStructDecoder([["addressTreeInfo",Bt()],["outputStateTreeIndex",getU8Decoder()]])}function C_(){return combineCodec(be(),_e())}function $e(){return getStructEncoder([["accountMeta",xt()],["data",Yt()]])}function et(){return getStructDecoder([["accountMeta",It()],["data",te()]])}function h_(){return combineCodec($e(),et())}function Wt(){return getStructEncoder([["accountMeta",Dt()],["data",Yt()]])}function Lt(){return getStructDecoder([["accountMeta",Pt()],["data",te()]])}function __(){return combineCodec(Wt(),Lt())}function Ge(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Wt()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([$e()])]])]])}function ze(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Lt()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([et()])]])]])}function W_(){return combineCodec(Ge(),ze())}function L_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function O_(e,n){return n.__kind===e}var Oe=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(Oe||{});function qe(){return getEnumEncoder(Oe)}function Je(){return getEnumDecoder(Oe)}function w_(){return combineCodec(qe(),Je())}var Lc=new Uint8Array([223,179,163,190,177,224,67,173]);function Hv(){return fixEncoderSize(getBytesEncoder(),8).encode(Lc)}function d1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(Mt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:Lc}))}function hr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(Rt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function Fv(){return combineCodec(d1(),hr())}function Oc(e){return decodeAccount(e,hr())}async function Gv(e,n,r){let o=await To(e,n,r);return assertAccountExists(o),o}async function To(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Oc(o)}async function zv(e,n,r){let o=await u1(e,n,r);return assertAccountsExist(o),o}async function u1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Oc(t))}var Hc=new Uint8Array([90,36,35,219,93,225,110,96]);function Jv(){return fixEncoderSize(getBytesEncoder(),8).encode(Hc)}function R1(){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())],["expectedSecp256r1Signers",getArrayEncoder(Ut())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Hc}))}function Fc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multiWalletSettings",getAddressDecoder()],["multiWalletBump",getU8Decoder()],["canExecute",getBooleanDecoder()],["preauthorizeExecution",getBooleanDecoder()],["validTill",getU64Decoder()],["payer",getAddressDecoder()],["bump",getU8Decoder()],["bufferIndex",getU8Decoder()],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["creator",oe()],["executor",oe()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(oe())],["expectedSecp256r1Signers",getArrayDecoder(kt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Yv(){return combineCodec(R1(),Fc())}function Gc(e){return decodeAccount(e,Fc())}async function zc(e,n,r){let o=await b1(e,n,r);return assertAccountExists(o),o}async function b1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Gc(o)}async function Zv(e,n,r){let o=await _1(e,n,r);return assertAccountsExist(o),o}async function _1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Gc(t))}var qc=new Uint8Array([105,23,173,2,197,255,80,87]);function $v(){return fixEncoderSize(getBytesEncoder(),8).encode(qc)}function J1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:qc}))}function Jc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function eU(){return combineCodec(J1(),Jc())}function Yc(e){return decodeAccount(e,Jc())}async function Zc(e,n,r){let o=await Y1(e,n,r);return assertAccountExists(o),o}async function Y1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Yc(o)}async function tU(e,n,r){let o=await Z1(e,n,r);return assertAccountsExist(o),o}async function Z1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Yc(t))}function m({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function O(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function y(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:Xc(r.value)?upgradeRoleToSigner(o):o,...Xc(r.value)?{signer:r.value}:{}})}}function Xc(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var $c=new Uint8Array([8]);function fU(){return fixEncoderSize(getBytesEncoder(),1).encode($c)}function Po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:$c}))}function ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function SU(){return combineCodec(Po(),ea())}async function ta(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Po().encode(c),programAddress:r})}function xU(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Po().encode(c),programAddress:r})}function IU(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:ea().decode(e.data)}}var ca=new Uint8Array([9]);function RU(){return fixEncoderSize(getBytesEncoder(),1).encode(ca)}function aa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(Ke())],["secp256r1VerifyArgs",getArrayEncoder(Z())],["compressedProofArgs",getOptionEncoder(D())]]),e=>({...e,discriminator:ca}))}function ia(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(je())],["secp256r1VerifyArgs",getArrayDecoder(X())],["compressedProofArgs",getOptionDecoder(P())]])}function bU(){return combineCodec(aa(),ia())}function da(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:aa().encode(c),programAddress:r})}function _U(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:ia().decode(e.data)}}var ma=new Uint8Array([19]);function BU(){return fixEncoderSize(getBytesEncoder(),1).encode(ma)}function ya(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(Ke())],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:ma}))}function la(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(je())],["secp256r1VerifyArgs",getArrayDecoder(X())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function NU(){return combineCodec(ya(),la())}function Ta(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:ya().encode(c),programAddress:r})}function wU(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:la().decode(e.data)}}var xa=new Uint8Array([18]);function jU(){return fixEncoderSize(getBytesEncoder(),1).encode(xa)}function ho(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["addressTreeInfo",Ot()],["outputStateTreeIndex",getU8Encoder()],["userArgs",Ge()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:xa}))}function Ia(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",P()],["addressTreeInfo",Bt()],["outputStateTreeIndex",getU8Decoder()],["userArgs",ze()],["settingsIndex",getU128Decoder()]])}function qU(){return combineCodec(ho(),Ia())}async function Ca(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:ho().encode(c),programAddress:r})}function JU(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:ho().encode(c),programAddress:r})}function YU(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:Ia().decode(e.data)}}var _a=new Uint8Array([0]);function rk(){return fixEncoderSize(getBytesEncoder(),1).encode(_a)}function Ro(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",be()],["compressedProofArgs",D()]]),e=>({...e,discriminator:_a}))}function va(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",_e()],["compressedProofArgs",P()]])}function nk(){return combineCodec(Ro(),va())}async function Ua(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Ro().encode(c),programAddress:r})}function ok(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Ro().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:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:va().decode(e.data)}}var La=new Uint8Array([4]);function gk(){return fixEncoderSize(getBytesEncoder(),1).encode(La)}function bo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["member",ro()],["role",qe()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(qt())],["userAccountCreationArgs",be()],["linkWalletArgs",getOptionEncoder(Jn())]]),e=>({...e,discriminator:La}))}function Oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",P()],["member",Nt()],["role",Je()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Jt())],["userAccountCreationArgs",_e()],["linkWalletArgs",getOptionDecoder(Yn())]])}function pk(){return combineCodec(bo(),Oa())}async function Ba(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:bo().encode(c),programAddress:r})}function mk(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a=m({args:c}),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:bo().encode(c),programAddress:r})}function yk(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:Oa().decode(e.data)}}var wa=new Uint8Array([3]);function Ik(){return fixEncoderSize(getBytesEncoder(),1).encode(wa)}function vo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:wa}))}function Va(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function Ck(){return combineCodec(vo(),Va())}async function Ha(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=y(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:vo().encode({}),programAddress:r})}function Ek(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=y(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:vo().encode({}),programAddress:r})}function Dk(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:Va().decode(e.data)}}var Ga=new Uint8Array([5]);function vk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ga)}function ko(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["createUserArgs",getArrayEncoder(On())]]),e=>({...e,discriminator:Ga}))}function za(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",P()],["createUserArgs",getArrayDecoder(Bn())]])}function Uk(){return combineCodec(ko(),za())}async function Ka(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:ko().encode(c),programAddress:r})}function kk(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:ko().encode(c),programAddress:r})}function Wk(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:za().decode(e.data)}}var Ja=new Uint8Array([17]);function Hk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ja)}function Ya(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",j()],["compressedProofArgs",D()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:Ja}))}function Za(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",q()],["compressedProofArgs",P()],["secp256r1VerifyArgs",getArrayDecoder(X())]])}function Fk(){return combineCodec(Ya(),Za())}function Xa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Ya().encode(c),programAddress:r})}function Gk(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:Za().decode(e.data)}}var ei=new Uint8Array([2]);function Yk(){return fixEncoderSize(getBytesEncoder(),1).encode(ei)}function ti(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:ei}))}function ri(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function Zk(){return combineCodec(ti(),ri())}function ni(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=m({args:c}),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.admin),...a],data:ti().encode(c),programAddress:r})}function Xk(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:ri().decode(e.data)}}var ai=new Uint8Array([1]);function oW(){return fixEncoderSize(getBytesEncoder(),1).encode(ai)}function Lo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Qn())]]),e=>({...e,discriminator:ai}))}function ii(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder($n())]])}function sW(){return combineCodec(Lo(),ii())}async function cW(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Lo().encode(c),programAddress:r})}function di(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Lo().encode(c),programAddress:r})}function aW(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:ii().decode(e.data)}}var gi=new Uint8Array([6]);function mW(){return fixEncoderSize(getBytesEncoder(),1).encode(gi)}function pi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",$e()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",D()]]),e=>({...e,discriminator:gi}))}function mi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",et()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",P()]])}function yW(){return combineCodec(pi(),mi())}function yi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=m({args:c}),s=y(r);return Object.freeze({accounts:[s(t.authority),...a],data:pi().encode(c),programAddress:r})}function lW(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:mi().decode(e.data)}}var fi=new Uint8Array([7]);function EW(){return fixEncoderSize(getBytesEncoder(),1).encode(fi)}function Si(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",$e()],["secp256r1VerifyArgs",getOptionEncoder(F())],["delegateTo",getOptionEncoder(no())],["oldSettingsMutArgs",getOptionEncoder(j())],["newSettingsMutArgs",getOptionEncoder(j())],["compressedProofArgs",D()]]),e=>({...e,discriminator:fi}))}function xi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",et()],["secp256r1VerifyArgs",getOptionDecoder(G())],["delegateTo",getOptionDecoder(oo())],["oldSettingsMutArgs",getOptionDecoder(q())],["newSettingsMutArgs",getOptionDecoder(q())],["compressedProofArgs",P()]])}function DW(){return combineCodec(Si(),xi())}function Ii(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.feePayer),s(t.signer),s(t.oldSettings),s(t.newSettings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.domainConfig),...a],data:Si().encode(c),programAddress:r})}function PW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},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:xi().decode(e.data)}}var Ei=new Uint8Array([29]);function UW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ei)}function Oo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:Ei}))}function Di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(X())]])}function kW(){return combineCodec(Oo(),Di())}async function WW(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(O(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Oo().encode(c),programAddress:r})}function Pi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Oo().encode(c),programAddress:r})}function LW(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:Di().decode(e.data)}}var Ri=new Uint8Array([27]);function FW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ri)}function bi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Ri}))}function _i(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(X())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function GW(){return combineCodec(bi(),_i())}function vi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:bi().encode(c),programAddress:r})}function zW(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:_i().decode(e.data)}}var Li=new Uint8Array([30]);function XW(){return fixEncoderSize(getBytesEncoder(),1).encode(Li)}function wo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Ht())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(bt()))],["compressedProofArgs",getOptionEncoder(D())],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:Li}))}function Oi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Ft())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(_t()))],["compressedProofArgs",getOptionDecoder(P())],["secp256r1VerifyArgs",getArrayDecoder(X())]])}function QW(){return combineCodec(wo(),Oi())}async function $W(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(O(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:wo().encode(c),programAddress:r})}function Bi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:wo().encode(c),programAddress:r})}function eL(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},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:Oi().decode(e.data)}}var Gi=new Uint8Array([28]);function aL(){return fixEncoderSize(getBytesEncoder(),1).encode(Gi)}function Vo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Ht())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(bt()))],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Gi}))}function zi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Ft())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(_t()))],["secp256r1VerifyArgs",getArrayDecoder(X())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function iL(){return combineCodec(Vo(),zi())}async function dL(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Vo().encode(c),programAddress:r})}function Ki(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Vo().encode(c),programAddress:r})}function uL(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},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:zi().decode(e.data)}}var Ji=new Uint8Array([13]);function TL(){return fixEncoderSize(getBytesEncoder(),1).encode(Ji)}function Yi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Ji}))}function Zi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function fL(){return combineCodec(Yi(),Zi())}function Xi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Yi().encode(c),programAddress:r})}function SL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},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:Zi().decode(e.data)}}var ed=new Uint8Array([23]);function hL(){return fixEncoderSize(getBytesEncoder(),1).encode(ed)}function td(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:ed}))}function rd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function ML(){return combineCodec(td(),rd())}function nd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.rentCollector),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:td().encode(c),programAddress:r})}function RL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},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:rd().decode(e.data)}}var cd=new Uint8Array([10]);function LL(){return fixEncoderSize(getBytesEncoder(),1).encode(cd)}function ad(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Gt()],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:cd}))}function id(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",zt()],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function OL(){return combineCodec(ad(),id())}function dd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:ad().encode(c),programAddress:r})}function BL(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},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:id().decode(e.data)}}var gd=new Uint8Array([20]);function zL(){return fixEncoderSize(getBytesEncoder(),1).encode(gd)}function pd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Gt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",wt()],["compressedProofArgs",D()]]),e=>({...e,discriminator:gd}))}function md(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",zt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Vt()],["compressedProofArgs",P()]])}function KL(){return combineCodec(pd(),md())}function yd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:pd().encode(c),programAddress:r})}function jL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},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:md().decode(e.data)}}var fd=new Uint8Array([14]);function $L(){return fixEncoderSize(getBytesEncoder(),1).encode(fd)}function Sd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:fd}))}function xd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function eO(){return combineCodec(Sd(),xd())}function Id(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Sd().encode(c),programAddress:r})}function tO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},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:xd().decode(e.data)}}var Dd=new Uint8Array([24]);function iO(){return fixEncoderSize(getBytesEncoder(),1).encode(Dd)}function Pd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Dd}))}function hd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function dO(){return combineCodec(Pd(),hd())}function Md(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Pd().encode(c),programAddress:r})}function uO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},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:hd().decode(e.data)}}var _d=new Uint8Array([12]);function lO(){return fixEncoderSize(getBytesEncoder(),1).encode(_d)}function vd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:_d}))}function Ud(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function TO(){return combineCodec(vd(),Ud())}function kd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.transactionBuffer),...a],data:vd().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:Ud().decode(e.data)}}var Od=new Uint8Array([22]);function DO(){return fixEncoderSize(getBytesEncoder(),1).encode(Od)}function Bd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Od}))}function Nd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function PO(){return combineCodec(Bd(),Nd())}function wd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),s=y(r);return Object.freeze({accounts:[s(t.transactionBuffer),...a],data:Bd().encode(c),programAddress:r})}function hO(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:Nd().decode(e.data)}}var Fd=new Uint8Array([11]);function kO(){return fixEncoderSize(getBytesEncoder(),1).encode(Fd)}function Gd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Fd}))}function zd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function WO(){return combineCodec(Gd(),zd())}function Kd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Gd().encode(c),programAddress:r})}function LO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:zd().decode(e.data)}}var Jd=new Uint8Array([21]);function FO(){return fixEncoderSize(getBytesEncoder(),1).encode(Jd)}function Yd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",wt()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Jd}))}function Zd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Vt()],["compressedProofArgs",P()]])}function GO(){return combineCodec(Yd(),Zd())}function Xd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Yd().encode(c),programAddress:r})}function zO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},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:Zd().decode(e.data)}}var eu=new Uint8Array([15]);function ZO(){return fixEncoderSize(getBytesEncoder(),1).encode(eu)}function tu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:eu}))}function ru(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function XO(){return combineCodec(tu(),ru())}function nu(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=m({}),a=y(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:tu().encode({}),programAddress:r})}function QO(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:ru().decode(e.data)}}var cu=new Uint8Array([25]);function oB(){return fixEncoderSize(getBytesEncoder(),1).encode(cu)}function au(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:cu}))}function iu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function sB(){return combineCodec(au(),iu())}function du(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.transactionBuffer),...a],data:au().encode(c),programAddress:r})}function cB(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:iu().decode(e.data)}}var gu=new Uint8Array([16]);function pB(){return fixEncoderSize(getBytesEncoder(),1).encode(gu)}function pu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Kt()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:gu}))}function mu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",jt()],["secp256r1VerifyArgs",getArrayDecoder(X())]])}function mB(){return combineCodec(pu(),mu())}function yu(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:pu().encode(c),programAddress:r})}function yB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:mu().decode(e.data)}}var fu=new Uint8Array([26]);function CB(){return fixEncoderSize(getBytesEncoder(),1).encode(fu)}function Su(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Kt()],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:fu}))}function xu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",jt()],["secp256r1VerifyArgs",getArrayDecoder(X())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function EB(){return combineCodec(Su(),xu())}function Iu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Su().encode(c),programAddress:r})}function DB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:xu().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",nE=(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))(nE||{});function cN(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 oE=(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))(oE||{});function aN(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 cE=6e3,aE=6001,iE=6002,dE=6003,uE=6004,AE=6005,gE=6006,pE=6007,mE=6008,yE=6009,lE=6010,TE=6011,fE=6012,SE=6013,xE=6014,IE=6015,CE=6016,EE=6017,DE=6018,PE=6019,hE=6020,ME=6021,RE=6022,bE=6023,_E=6024,vE=6025,UE=6026,kE=6027,WE=6028,LE=6029,OE=6030,BE=6031,NE=6032,wE=6033,VE=6034,HE=6035,FE=6036,GE=6037,zE=6038,KE=6039,jE=6040,qE=6041,JE=6042,YE=6043,ZE=6044,XE=6045,QE=6046,$E=6047,eD=6048,tD=6049,rD=6050,nD=6051,oD=6052,sD=6053,cD=6054,aD=6055,iD=6056,dD=6057,uD=6058,AD=6059,gD=6060,pD=6061,mD=6062,yD=6063,lD=6064,TD=6065,fD=6066,SD=6067,xD=6068,ID=6069,CD=6070,ED=6071,DD=6072,PD=6073,hD=6074,MD=6075,RD=6076,bD=6077,_D=6078,vD=6079,UD=6080,kD=6081,WD=6082,LD=6083,OD=6084,BD=6085,ND=6086,Cu;process.env.NODE_ENV!=="production"&&(Cu={[BE]:"This member is already delegated to another wallet.",[pE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[bD]:"Clock sysvar access failed. This may indicate a system error.",[nD]:"Missing credential id.",[sD]:"The domain configuration account is disabled. Please contact support or try again later.",[cD]:"Missing domain configuration account.",[MD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[ND]:"Duplicate address tree detected. This address tree is already in the whitelist.",[lE]:"Duplicate public keys detected among members. Each member must have a unique key.",[yE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[ME]:"No members provided. A multisig wallet must contain at least one member.",[gD]:"Slot numbers list is empty. At least one slot number is required for validation.",[DE]:"Expected a User with Administrator role for this instruction.",[mE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[CE]:"Expected a User with Transaction Manager role for this instruction.",[jE]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[qE]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[JE]:"Declared buffer size does not match the actual serialized size.",[AD]:"Failed to compute hash. This may indicate a system error.",[VE]:"Not enough members with vote permission to meet the approval threshold.",[NE]:"At least one signer with execute permission is required to proceed.",[wE]:"At least one signer with initiate permission is required to perform this action.",[UE]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[hD]:"Invalid account index in transaction message. The account index is out of bounds.",[dD]:"Address Tree supplied is not part of the whitelisted address trees.",[PE]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[WE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[KE]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[pD]:"Member key conversion failed. The provided key format is invalid.",[HE]:"Only delegated members are allowed for this transaction.",[vE]:"Unexpected number of accounts provided for this instruction.",[SE]:"User with Permanent Member role must have a delegated wallet.",[aE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[uE]:"The extracted public key has an invalid length or encoding.",[cE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[dE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[rD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[eD]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[bE]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[ED]:"Invalid source type for token transfer. The source account type is not supported.",[EE]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[IE]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[_E]:"Malformed transaction message: structure or formatting does not match the expected layout.",[UD]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[kE]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[vD]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[CD]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[AE]:"The extracted WebAuthn signed message payload is malformed.",[QE]:"An input string exceeds the maximum allowed character length.",[aD]:"This member is not registered under the provided domain configuration.",[lD]:"Member not found in settings. Cannot remove a member that does not exist.",[PD]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[LE]:"A required account is missing from the instruction context.",[mD]:"Compressed proof arguments are missing. Required for compressed account operations.",[SD]:"Missing compressed token account. Required for token transfer operations.",[kD]:"Missing destination token account. Required for token transfer operations.",[ID]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[yD]:"Light CPI accounts are missing. Required for compressed account operations.",[OE]:"User mutation arguments are required when performing add or remove delegate operations.",[OD]:"Missing new authority account. Required for domain configuration updates.",[LD]:"Missing settings account. Required for delegate operations on compressed wallets.",[uD]:"Compressed settings data is missing. The settings account must be initialized with data.",[WD]:"Missing source token account. Required for token transfer operations.",[xD]:"Missing SPL interface PDA. Required for token transfer operations.",[$E]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[RD]:"User account address is missing. Required for secp256r1 signature verification.",[BD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[GE]:"No valid signer found in this transaction.",[hE]:"Only one administrator is allowed per wallet.",[fE]:"Only one permanent member is allowed per wallet.",[xE]:"Only one transaction manager is allowed per wallet.",[iD]:"The given origin index is not in the whitelisted origins.",[fD]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[TE]:"Permanent members cannot be removed from a wallet.",[XE]:"Writable CPI calls to protected accounts are not permitted.",[gE]:"The rpIdHash extracted from the signed message does not match the expected value.",[TD]:"Settings key mismatch. The provided settings key does not match the expected value.",[iE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[tD]:"The specified slot number was not found in the provided slot history.",[DD]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[RE]:"Too many members: a maximum of 4 members are supported.",[YE]:"This transaction has expired. It must be executed within 3 minutes of approval.",[ZE]:"This transaction has not yet reached the required approval threshold.",[oD]:"Missing transports.",[zE]:"Only the transaction creator or rent payer may close this transaction buffer.",[_D]:"Unauthorized: Only the admin account is allowed to perform this action.",[FE]:"Member is not part of the expected signers for this transaction."});function pN(e){return process.env.NODE_ENV!=="production"?Cu[e]:"Error message not available in production bundles."}function mN(e,n,r){return isProgramError(e,n,A,r)}async function PN({admin:e,addressTree:n}){return ta({payer:e,addressTree:n,remainingAccounts:[]})}var Go=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Eu="https://mainnet.block-engine.jito.wtf/api/v1",Du="https://bundles.jito.wtf/api/v1/bundles/tip_floor",Pu="landed_tips_75th_percentile";var ve=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);}},tt=class extends ve{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},re=class extends ve{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},z=class extends ve{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},Ce=class extends ve{constructor(r,o,t){super(r,"NETWORK_ERROR",{statusCode:o,url:t});this.statusCode=o;this.url=t;}};var me=class extends ve{constructor(r,o,t){super(r,"BUNDLE_ERROR",{bundleId:o,attempt:t});this.bundleId=o;this.attempt=t;}},Or=class extends ve{constructor(r,o,t){super(`Operation "${r}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=o;this.lastError=t;}},Br=class extends ve{constructor(r,o,t){super(r,"PERMISSION_ERROR",{required:o,actual:t});this.required=o;this.actual=t;}};var Qt={Ed25519:1,Secp256r1:2};var hu=T.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),kN=T.object({transactionActionType:hu,transactionAddress:T.string(),transactionMessageBytes:T.array(T.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),wD=T.object({transactionActionType:hu,transactionAddress:T.string(),transactionMessageBytes:T.base64()}).strict(),Mu=T.object({phase:T.literal("start"),redirectOrigin:T.url(),signer:T.string().optional(),rid:T.string(),validTill:T.number(),data:T.object({type:T.literal("message"),payload:T.string()}).strict()}).strict(),Ru=T.object({phase:T.literal("start"),redirectOrigin:T.url(),signer:T.string().optional(),rid:T.string(),validTill:T.number(),data:T.object({type:T.literal("transaction"),payload:wD,sendTx:T.boolean()}).strict()}).strict(),bu=T.object({startRequest:T.union([Mu,Ru]),authResponse:T.custom(),client:T.object({clientOrigin:T.url(),jws:T.string()}).strict(),device:T.object({jwk:T.base64(),jws:T.string()}).strict(),authProvider:T.object({jwk:T.base64(),jws:T.string()}).strict().optional()}).strict(),_u=T.object({signer:T.string(),userAddressTreeIndex:T.number().optional(),additionalInfo:T.looseObject({}).optional()}).strict(),VD=T.object({slotHash:T.string(),slotNumber:T.string(),originIndex:T.number(),crossOrigin:T.boolean()}).strict(),WN=T.object({phase:T.literal("complete"),data:T.object({type:T.literal("message"),payload:_u.extend(bu.shape).extend({id:T.string().optional(),client:T.object({clientOrigin:T.url()}).strict()})}).strict()}).strict(),LN=T.object({phase:T.literal("complete"),data:T.object({type:T.literal("transaction"),payload:_u.extend(bu.shape).extend(VD.shape).extend({client:T.object({clientOrigin:T.url()}).strict()})}).strict()}).strict(),ON=T.object({phase:T.literal("complete"),data:T.object({type:T.literal("transaction"),payload:T.object({startRequest:T.union([Ru,Mu]),txSig:T.string()})}).strict()}).strict();var Ue={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Be=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(Ue).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var zo=33,Ne=class{_bn;constructor(n){typeof n=="string"?this._bn=new Uint8Array(getBase58Encoder().encode(n)):this._bn=new Uint8Array(n),this.validateKeyLength(this._bn);}validateKeyLength(n){if(n.length!==zo)throw new Error(`Invalid public key length, expected ${zo} 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===zo)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()}},E=class extends Ne{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(n,r){super(n),this.verifyArgs=r.verifyArgs,this.domainConfig=r.domainConfig,this.authData=r.authData,this.signature=r.signature,this.originIndex=r.originIndex,this.crossOrigin=r.crossOrigin,this.clientAndDeviceHash=r.clientAndDeviceHash,this.authResponse=r.authResponse;}};function GD(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function zD(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var Uu=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(GD())],["addressTableLookups",getArrayCodec(zD())]]);function ku(e){return Uu.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 Wu(e){let n=Uu.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 de={};function Lu(){if(!de.solanaRpcEndpoint)throw new tt("RPC endpoint");return de.solanaRpcEndpoint}function Ve(){if(!de.lightProtocolRpc)throw new tt("Light Protocol RPC");return de.lightProtocolRpc}function Q(){if(!de.solanaRpc)throw new tt("Solana RPC");return de.solanaRpc}function Ou(){if(!de.sendAndConfirm)throw new tt("Send and confirm transaction function");return de.sendAndConfirm}function jo(){return de.jitoTipsConfig?de.jitoTipsConfig:{blockEngineUrl:Eu,getJitoTipsUrl:Du,priority:Pu}}function sw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:o}){de.solanaRpcEndpoint=e,de.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});de.solanaRpc=t,de.sendAndConfirm=c,de.jitoTipsConfig=o??null;}async function $t(e,n){if(!e.ok)throw new Ce(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function er(e){try{return await e.json()}catch(n){throw new Ce(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function xw(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 Iw(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 Cw(e){let{authenticatorData:n,clientDataJSON:r,signature:o}=e.authResponse.response,t=xe(n),c=JSON.parse(getUtf8Decoder().decode(xe(r))),i=Vu(c),a=Fu(xe(o)),s=await gt({rpIdHash:t.subarray(0,32)});return new E(e.signer.toString(),{verifyArgs:{clientDataJson:xe(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:qo(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:s,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function qo(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(n),...getBase64Encoder().encode(r)]))}function Ew(e){return sha256(getUtf8Encoder().encode(JSON.stringify(e)))}function Dw(e){return Jo(e.data.payload.authResponse)}function Pw(e,n,r,o){let t=qo(n,r,o);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...t]))}async function hw(e,n,r,o,t,c){let i;if(!t||!c){let u=(await Q().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!u)throw new re("Slot sysvar","Unable to fetch slot sysvar data");let g=getBase64Encoder().encode(u[0]);c=getU64Decoder().decode(g.subarray(0,8)).toString(),i=g.subarray(8,40),t=getBase58Decoder().decode(i);}else i=getBase58Encoder().encode(t);let a=sha256(typeof e.transactionMessageBytes=="string"?getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),s=qo(n,r,o),d=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...a,...i,...s]));return {slotNumber:c,slotHash:t,challenge:d}}function Jo(e){let n=Vr(e);return sha256(n)}function Mw(e){let n="";for(let o of e)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function xe(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,o=n.padEnd(n.length+r,"="),t=atob(o),c=new ArrayBuffer(t.length),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}async function Rw(e,n){let{data:r}=await Is(Q(),e),t=Hu(r.origins,r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new re("Origin","Origin not found in domain config");return t}function bw(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function _w(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 eP(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 Vu(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 Hu(e,n){let r=[],o=0,t=new TextDecoder;for(let c=0;c<n;c++){if(o+2>e.length)throw new Error("MaxLengthExceeded");let i=e[o]|e[o+1]<<8;if(o+=2,o+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(o,o+i),s=t.decode(a);r.push(s),o+=i;}return r}function Fu(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 i=e[r+1],a=r+2,s=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=s[0]===0&&s.length>32?s.slice(1):s;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let p=p256.Point.CURVE().n>>1n,f=BigInt("0x"+wr(u)),I=(f>p?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=eP(I);return new Uint8Array([...g,...x])}function Vr(e){let n=xe(e.response.clientDataJSON),r=xe(e.response.authenticatorData),o=sha256(n);return new Uint8Array([...r,...o])}var cP={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true,initialDelayMs:500,maxRetries:3};function aP(e,n,r,o){let t=n*Math.pow(r,e-1);return Math.min(t,o)}function iP(e){return new Promise(n=>setTimeout(n,e))}async function nr(e,n){let{maxRetries:r,initialDelayMs:o,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...cP,...n},a;for(let s=1;s<=r;s++)try{return await e()}catch(d){if(a=d,i&&!i(d,s))throw d;if(s>=r)break;let u=aP(s,o,t,c);await iP(u);}throw new Or(e.name||"retryWithBackoff",r,a)}async function pt(e,n){let r=(o,t)=>t>(n?.maxRetries??3)?false:o instanceof Response?o.status===429?n?.retryOnRateLimit??true:o.status>=400&&o.status<500?false:o.status>=500:o instanceof TypeError||o instanceof Error;return nr(e,{...n,shouldRetry:n?.shouldRetry??r})}function ju(e,n,r,o){if(e<n||e>r)throw new z(`${o} must be between ${n} and ${r} (inclusive), got ${e}`)}function qu(e,n){if(e<0)throw new z(`${n} must be non-negative, got ${e}`)}function or(e,n){if(e.length===0)throw new z(`${n} cannot be empty`)}function Ju(e,n){if(e.trim().length===0)throw new z(`${n} cannot be empty`)}async function Zo(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await Q().getLatestBlockhash().send()).value;return await Promise.all(e.map(async o=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(o.instructions,c),c=>setTransactionMessageFeePayerSigner(o.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>o.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,o.addressesByLookupTableAddress):c,async c=>{let i=Math.ceil((o.unitsConsumed??0)*1.1);return i>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:i})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function eA(e){let n=prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:8e5}),getSetComputeUnitPriceInstruction({microLamports:1e4})],e),r=getBase64EncodedWireTransaction(compileTransaction(n));if(r.length>1644)throw new z(`Transaction exceeds maximum length of ${1644} bytes (actual: ${r.length} bytes)`);let o=await Q().simulateTransaction(r,{encoding:"base64"}).send();if(o.value.err){if(o.value.logs){let c=["Transaction simulation failed:","",...o.value.logs].join(`
|
|
1
|
+
import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getU64Encoder,getU64Decoder,getOptionEncoder,getOptionDecoder,getArrayEncoder,getArrayDecoder,getU16Encoder,getBooleanEncoder,getU16Decoder,getBooleanDecoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getUnitEncoder,getUnitDecoder,getEnumEncoder,getEnumDecoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64Encoder,getBase64Decoder,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,getBlockhashDecoder,compileTransaction,getTransactionEncoder,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {TreeType,batchCpiContext1,batchQueue1,batchMerkleTree1,batchCpiContext2,batchQueue2,batchMerkleTree2,batchCpiContext3,batchQueue3,batchMerkleTree3,batchCpiContext4,batchQueue4,batchMerkleTree4,batchCpiContext5,batchQueue5,batchMerkleTree5,createRpc,rpcRequest,versionedEndpoint,encodeBN254toBase58,featureFlags,jsonRpcResultAndContext,CompressedAccountResultV2,CompressedAccountResult,getStateTreeInfoByPubkey,createCompressedAccountWithMerkleContextLegacy,createMerkleContextLegacy,bn as bn$1,parseAccountData,deriveAddressSeedV2,createBN254,deriveAddressV2,getLightSystemAccountMetasV2,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey,SolanaJSONRPCError}from'@solana/web3.js';import T 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 Ss=new Uint8Array([201,232,212,229,59,241,106,197]);function PM(){return fixEncoderSize(getBytesEncoder(),8).encode(Ss)}function xg(){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 xs(){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 hM(){return combineCodec(xg(),xs())}function Is(e){return decodeAccount(e,xs())}async function Cs(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 Is(o)}async function MM(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=>Is(t))}function RM(){return 846}var Ps=new Uint8Array([42,206,176,58,175,129,130,233]);function vM(){return fixEncoderSize(getBytesEncoder(),8).encode(Ps)}function Og(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Ps}))}function hs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function UM(){return combineCodec(Og(),hs())}function Ms(e){return decodeAccount(e,hs())}async function kM(e,n,r){let o=await Bg(e,n,r);return assertAccountExists(o),o}async function Bg(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Ms(o)}async function WM(e,n,r){let o=await Ng(e,n,r);return assertAccountsExist(o),o}async function Ng(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ms(t))}function LM(){return 24}function en(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function tn(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function NM(){return combineCodec(en(),tn())}function rn(){return getStructEncoder([["memberKey",H()],["permissions",He()],["userArgs",Ge()]])}function nn(){return getStructDecoder([["memberKey",oe()],["permissions",Fe()],["userArgs",ze()]])}function FM(){return combineCodec(rn(),nn())}function on(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function sn(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function KM(){return combineCodec(on(),sn())}function xt(){return getStructEncoder([["treeInfo",Ct()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function It(){return getStructDecoder([["treeInfo",Et()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function YM(){return combineCodec(xt(),It())}function Dt(){return getStructEncoder([["treeInfo",Ct()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function Pt(){return getStructDecoder([["treeInfo",Et()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function $M(){return combineCodec(Dt(),Pt())}function cn(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function an(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function rR(){return combineCodec(cn(),an())}function pn(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function mn(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function sR(){return combineCodec(pn(),mn())}function ht(){return getStructEncoder([["data",getOptionEncoder(ln())]])}function K(){return getStructDecoder([["data",getOptionDecoder(yn())]])}function dR(){return combineCodec(ht(),K())}function ln(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(Mt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function yn(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(Rt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function pR(){return combineCodec(ln(),yn())}function bt(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",fn()],["tlv",getOptionEncoder(getArrayEncoder(Tn()))],["hasDelegate",getBooleanEncoder()],["isFrozen",getBooleanEncoder()]])}function _t(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",Sn()],["tlv",getOptionDecoder(getArrayDecoder(vt()))],["hasDelegate",getBooleanDecoder()],["isFrozen",getBooleanDecoder()]])}function TR(){return combineCodec(bt(),_t())}function Cn(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",Dn()]])}function En(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",Pn()]])}function IR(){return combineCodec(Cn(),En())}function Dn(){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",Rn()]])}function Pn(){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",bn()]])}function PR(){return combineCodec(Dn(),Pn())}function Ke(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Un())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(rn())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Wn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function je(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(kn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(nn())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Ln())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function bR(){return combineCodec(Ke(),je())}function _R(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function vR(e,n){return n.__kind===e}function On(){return getStructEncoder([["member",getAddressEncoder()],["role",qe()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",be()]])}function Bn(){return getStructDecoder([["member",getAddressDecoder()],["role",Je()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",_e()]])}function LR(){return combineCodec(On(),Bn())}function Un(){return getStructEncoder([["memberKey",H()],["permissions",He()]])}function kn(){return getStructDecoder([["memberKey",oe()],["permissions",Fe()]])}function wR(){return combineCodec(Un(),kn())}function Ut(){return getStructEncoder([["memberKey",H()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function kt(){return getStructDecoder([["memberKey",oe()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function GR(){return combineCodec(Ut(),kt())}function Tn(){return getDiscriminatedUnionEncoder([["Placeholder0",getUnitEncoder()],["Placeholder1",getUnitEncoder()],["Placeholder2",getUnitEncoder()],["Placeholder3",getUnitEncoder()],["Placeholder4",getUnitEncoder()],["Placeholder5",getUnitEncoder()],["Placeholder6",getUnitEncoder()],["Placeholder7",getUnitEncoder()],["Placeholder8",getUnitEncoder()],["Placeholder9",getUnitEncoder()],["Placeholder10",getUnitEncoder()],["Placeholder11",getUnitEncoder()],["Placeholder12",getUnitEncoder()],["Placeholder13",getUnitEncoder()],["Placeholder14",getUnitEncoder()],["Placeholder15",getUnitEncoder()],["Placeholder16",getUnitEncoder()],["Placeholder17",getUnitEncoder()],["Placeholder18",getUnitEncoder()],["TokenMetadata",getStructEncoder([["fields",getTupleEncoder([Fn()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([Nn()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([Vn()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([zn()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([jn()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([cn()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([Cn()])]])]])}function vt(){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([Gn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([wn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([Hn()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([Kn()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([qn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([an()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([En()])]])]])}function qR(){return combineCodec(Tn(),vt())}function JR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function YR(e,n){return n.__kind===e}function Jn(){return getStructEncoder([["settingsMutArgs",j()],["transactionManager",getOptionEncoder(Wt())]])}function Yn(){return getStructDecoder([["settingsMutArgs",q()],["transactionManager",getOptionDecoder(Lt())]])}function $R(){return combineCodec(Jn(),Yn())}function Mt(){return getStructEncoder([["pubkey",H()],["role",getU8Encoder()],["permissions",He()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function Rt(){return getStructDecoder([["pubkey",oe()],["role",getU8Decoder()],["permissions",Fe()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function nb(){return combineCodec(Mt(),Rt())}function H(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function oe(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function cb(){return combineCodec(H(),oe())}function Qn(){return getStructEncoder([["authorityCreationArgs",be()],["compressedProofArgs",D()]])}function $n(){return getStructDecoder([["authorityCreationArgs",_e()],["compressedProofArgs",P()]])}function ub(){return combineCodec(Qn(),$n())}function Ot(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function Bt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function pb(){return combineCodec(Ot(),Bt())}function fn(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function Sn(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function yb(){return combineCodec(fn(),Sn())}function Ct(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function Et(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function Sb(){return combineCodec(Ct(),Et())}function Nn(){return getStructEncoder([])}function wn(){return getStructDecoder([])}function Cb(){return combineCodec(Nn(),wn())}function Vn(){return getStructEncoder([])}function Hn(){return getStructDecoder([])}function Pb(){return combineCodec(Vn(),Hn())}function He(){return getStructEncoder([["mask",getU8Encoder()]])}function Fe(){return getStructDecoder([["mask",getU8Decoder()]])}function Rb(){return combineCodec(He(),Fe())}function D(){return getStructEncoder([["proof",getOptionEncoder(pn())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function P(){return getStructDecoder([["proof",getOptionDecoder(mn())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function Ub(){return combineCodec(D(),P())}function Wn(){return getStructEncoder([["memberKey",H()],["userArgs",Ge()]])}function Ln(){return getStructDecoder([["memberKey",oe()],["userArgs",ze()]])}function Ob(){return combineCodec(Wn(),Ln())}function Rn(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function bn(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function wb(){return combineCodec(Rn(),bn())}function ro(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Nt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function Fb(){return combineCodec(ro(),Nt())}function F(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function G(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function Kb(){return combineCodec(F(),G())}function Z(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",F()]])}function X(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",G()]])}function Yb(){return combineCodec(Z(),X())}function no(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function oo(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function Qb(){return combineCodec(no(),oo())}function so(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function co(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function t_(){return combineCodec(so(),co())}function j(){return getStructEncoder([["accountMeta",xt()],["data",ht()]])}function q(){return getStructDecoder([["accountMeta",It()],["data",K()]])}function s_(){return combineCodec(j(),q())}function wt(){return getStructEncoder([["accountMeta",Dt()],["data",ht()]])}function Vt(){return getStructDecoder([["accountMeta",Pt()],["data",K()]])}function d_(){return combineCodec(wt(),Vt())}function Ht(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function Ft(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function g_(){return combineCodec(Ht(),Ft())}function Fn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(en())]])}function Gn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(tn())]])}function y_(){return combineCodec(Fn(),Gn())}function Gt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getArrayEncoder(Ut())]])}function zt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getArrayDecoder(kt())]])}function x_(){return combineCodec(Gt(),zt())}function Kt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(on())],["addressTableLookups",getArrayEncoder(mo())]])}function jt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(sn())],["addressTableLookups",getArrayDecoder(lo())]])}function D_(){return combineCodec(Kt(),jt())}function mo(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function lo(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function M_(){return combineCodec(mo(),lo())}function zn(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function Kn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function __(){return combineCodec(zn(),Kn())}function jn(){return getStructEncoder([["transferring",getU8Encoder()]])}function qn(){return getStructDecoder([["transferring",getU8Decoder()]])}function k_(){return combineCodec(jn(),qn())}var yo=(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))(yo||{});function qt(){return getEnumEncoder(yo)}function Jt(){return getEnumDecoder(yo)}function O_(){return combineCodec(qt(),Jt())}function Yt(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",H()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(qt()))],["wallets",getArrayEncoder(so())],["role",qe()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function te(){return getStructDecoder([["domainConfig",getOptionDecoder(getAddressDecoder())],["member",oe()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(Jt()))],["wallets",getArrayDecoder(co())],["role",Je()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function V_(){return combineCodec(Yt(),te())}function be(){return getStructEncoder([["addressTreeInfo",Ot()],["outputStateTreeIndex",getU8Encoder()]])}function _e(){return getStructDecoder([["addressTreeInfo",Bt()],["outputStateTreeIndex",getU8Decoder()]])}function z_(){return combineCodec(be(),_e())}function $e(){return getStructEncoder([["accountMeta",xt()],["data",Yt()]])}function et(){return getStructDecoder([["accountMeta",It()],["data",te()]])}function J_(){return combineCodec($e(),et())}function Wt(){return getStructEncoder([["accountMeta",Dt()],["data",Yt()]])}function Lt(){return getStructDecoder([["accountMeta",Pt()],["data",te()]])}function Q_(){return combineCodec(Wt(),Lt())}function Ge(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Wt()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([$e()])]])]])}function ze(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Lt()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([et()])]])]])}function rv(){return combineCodec(Ge(),ze())}function nv(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function ov(e,n){return n.__kind===e}var Oe=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(Oe||{});function qe(){return getEnumEncoder(Oe)}function Je(){return getEnumDecoder(Oe)}function av(){return combineCodec(qe(),Je())}var Oc=new Uint8Array([223,179,163,190,177,224,67,173]);function dU(){return fixEncoderSize(getBytesEncoder(),8).encode(Oc)}function S1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(Mt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:Oc}))}function hr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(Rt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function uU(){return combineCodec(S1(),hr())}function Bc(e){return decodeAccount(e,hr())}async function AU(e,n,r){let o=await To(e,n,r);return assertAccountExists(o),o}async function To(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Bc(o)}async function gU(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=>Bc(t))}var Fc=new Uint8Array([90,36,35,219,93,225,110,96]);function yU(){return fixEncoderSize(getBytesEncoder(),8).encode(Fc)}function N1(){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())],["expectedSecp256r1Signers",getArrayEncoder(Ut())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Fc}))}function Gc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multiWalletSettings",getAddressDecoder()],["multiWalletBump",getU8Decoder()],["canExecute",getBooleanDecoder()],["preauthorizeExecution",getBooleanDecoder()],["validTill",getU64Decoder()],["payer",getAddressDecoder()],["bump",getU8Decoder()],["bufferIndex",getU8Decoder()],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["creator",oe()],["executor",oe()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(oe())],["expectedSecp256r1Signers",getArrayDecoder(kt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function TU(){return combineCodec(N1(),Gc())}function zc(e){return decodeAccount(e,Gc())}async function Kc(e,n,r){let o=await w1(e,n,r);return assertAccountExists(o),o}async function w1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return zc(o)}async function fU(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=>zc(t))}var Jc=new Uint8Array([105,23,173,2,197,255,80,87]);function IU(){return fixEncoderSize(getBytesEncoder(),8).encode(Jc)}function of(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Jc}))}function Yc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function CU(){return combineCodec(of(),Yc())}function Zc(e){return decodeAccount(e,Yc())}async function Xc(e,n,r){let o=await sf(e,n,r);return assertAccountExists(o),o}async function sf(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Zc(o)}async function EU(e,n,r){let o=await cf(e,n,r);return assertAccountsExist(o),o}async function cf(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Zc(t))}function m({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function O(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function l(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let o=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:O(r.value),role:Qc(r.value)?upgradeRoleToSigner(o):o,...Qc(r.value)?{signer:r.value}:{}})}}function Qc(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var ea=new Uint8Array([8]);function VU(){return fixEncoderSize(getBytesEncoder(),1).encode(ea)}function Po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:ea}))}function ta(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function HU(){return combineCodec(Po(),ta())}async function ra(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Po().encode(c),programAddress:r})}function FU(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Po().encode(c),programAddress:r})}function GU(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:ta().decode(e.data)}}var aa=new Uint8Array([9]);function ZU(){return fixEncoderSize(getBytesEncoder(),1).encode(aa)}function ia(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(Ke())],["secp256r1VerifyArgs",getArrayEncoder(Z())],["compressedProofArgs",getOptionEncoder(D())]]),e=>({...e,discriminator:aa}))}function da(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(je())],["secp256r1VerifyArgs",getArrayDecoder(X())],["compressedProofArgs",getOptionDecoder(P())]])}function XU(){return combineCodec(ia(),da())}function ua(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:ia().encode(c),programAddress:r})}function QU(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:da().decode(e.data)}}var la=new Uint8Array([19]);function sk(){return fixEncoderSize(getBytesEncoder(),1).encode(la)}function ya(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(Ke())],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:la}))}function Ta(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(je())],["secp256r1VerifyArgs",getArrayDecoder(X())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function ck(){return combineCodec(ya(),Ta())}function fa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:ya().encode(c),programAddress:r})}function ak(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:Ta().decode(e.data)}}var Ia=new Uint8Array([18]);function mk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ia)}function ho(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["addressTreeInfo",Ot()],["outputStateTreeIndex",getU8Encoder()],["userArgs",Ge()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Ia}))}function Ca(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",P()],["addressTreeInfo",Bt()],["outputStateTreeIndex",getU8Decoder()],["userArgs",ze()],["settingsIndex",getU128Decoder()]])}function lk(){return combineCodec(ho(),Ca())}async function Ea(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:ho().encode(c),programAddress:r})}function yk(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:ho().encode(c),programAddress:r})}function Tk(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:Ca().decode(e.data)}}var va=new Uint8Array([0]);function Dk(){return fixEncoderSize(getBytesEncoder(),1).encode(va)}function Ro(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",be()],["compressedProofArgs",D()]]),e=>({...e,discriminator:va}))}function Ua(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",_e()],["compressedProofArgs",P()]])}function Pk(){return combineCodec(Ro(),Ua())}async function ka(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Ro().encode(c),programAddress:r})}function hk(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Ro().encode(c),programAddress:r})}function Mk(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:Ua().decode(e.data)}}var Oa=new Uint8Array([4]);function Wk(){return fixEncoderSize(getBytesEncoder(),1).encode(Oa)}function bo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["member",ro()],["role",qe()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(qt())],["userAccountCreationArgs",be()],["linkWalletArgs",getOptionEncoder(Jn())]]),e=>({...e,discriminator:Oa}))}function Ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",P()],["member",Nt()],["role",Je()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Jt())],["userAccountCreationArgs",_e()],["linkWalletArgs",getOptionDecoder(Yn())]])}function Lk(){return combineCodec(bo(),Ba())}async function Na(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:bo().encode(c),programAddress:r})}function Ok(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:bo().encode(c),programAddress:r})}function Bk(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:Ba().decode(e.data)}}var Va=new Uint8Array([3]);function Gk(){return fixEncoderSize(getBytesEncoder(),1).encode(Va)}function vo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Va}))}function Ha(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function zk(){return combineCodec(vo(),Ha())}async function Fa(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=l(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:vo().encode({}),programAddress:r})}function Kk(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=l(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:vo().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:Ha().decode(e.data)}}var za=new Uint8Array([5]);function $k(){return fixEncoderSize(getBytesEncoder(),1).encode(za)}function ko(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["createUserArgs",getArrayEncoder(On())]]),e=>({...e,discriminator:za}))}function Ka(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",P()],["createUserArgs",getArrayDecoder(Bn())]])}function eW(){return combineCodec(ko(),Ka())}async function ja(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:ko().encode(c),programAddress:r})}function tW(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:ko().encode(c),programAddress:r})}function rW(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:Ka().decode(e.data)}}var Ya=new Uint8Array([17]);function dW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ya)}function Za(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",j()],["compressedProofArgs",D()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:Ya}))}function Xa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",q()],["compressedProofArgs",P()],["secp256r1VerifyArgs",getArrayDecoder(X())]])}function uW(){return combineCodec(Za(),Xa())}function Qa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Za().encode(c),programAddress:r})}function AW(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:Xa().decode(e.data)}}var ti=new Uint8Array([2]);function TW(){return fixEncoderSize(getBytesEncoder(),1).encode(ti)}function ri(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:ti}))}function ni(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function fW(){return combineCodec(ri(),ni())}function oi(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.admin),...a],data:ri().encode(c),programAddress:r})}function SW(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:ni().decode(e.data)}}var ii=new Uint8Array([1]);function hW(){return fixEncoderSize(getBytesEncoder(),1).encode(ii)}function Lo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Qn())]]),e=>({...e,discriminator:ii}))}function di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder($n())]])}function MW(){return combineCodec(Lo(),di())}async function RW(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Lo().encode(c),programAddress:r})}function ui(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Lo().encode(c),programAddress:r})}function bW(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:di().decode(e.data)}}var pi=new Uint8Array([6]);function OW(){return fixEncoderSize(getBytesEncoder(),1).encode(pi)}function mi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",$e()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",D()]]),e=>({...e,discriminator:pi}))}function li(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",et()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",P()]])}function BW(){return combineCodec(mi(),li())}function yi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.authority),...a],data:mi().encode(c),programAddress:r})}function NW(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:li().decode(e.data)}}var Si=new Uint8Array([7]);function KW(){return fixEncoderSize(getBytesEncoder(),1).encode(Si)}function xi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",$e()],["secp256r1VerifyArgs",getOptionEncoder(F())],["delegateTo",getOptionEncoder(no())],["oldSettingsMutArgs",getOptionEncoder(j())],["newSettingsMutArgs",getOptionEncoder(j())],["compressedProofArgs",D()]]),e=>({...e,discriminator:Si}))}function Ii(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",et()],["secp256r1VerifyArgs",getOptionDecoder(G())],["delegateTo",getOptionDecoder(oo())],["oldSettingsMutArgs",getOptionDecoder(q())],["newSettingsMutArgs",getOptionDecoder(q())],["compressedProofArgs",P()]])}function jW(){return combineCodec(xi(),Ii())}function Ci(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.feePayer),s(t.signer),s(t.oldSettings),s(t.newSettings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.domainConfig),...a],data:xi().encode(c),programAddress:r})}function qW(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:Ii().decode(e.data)}}var Di=new Uint8Array([29]);function eL(){return fixEncoderSize(getBytesEncoder(),1).encode(Di)}function Oo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:Di}))}function Pi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(X())]])}function tL(){return combineCodec(Oo(),Pi())}async function rL(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(O(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Oo().encode(c),programAddress:r})}function hi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Oo().encode(c),programAddress:r})}function nL(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:Pi().decode(e.data)}}var bi=new Uint8Array([27]);function uL(){return fixEncoderSize(getBytesEncoder(),1).encode(bi)}function _i(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:bi}))}function vi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(X())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function AL(){return combineCodec(_i(),vi())}function Ui(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:_i().encode(c),programAddress:r})}function gL(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:vi().decode(e.data)}}var Oi=new Uint8Array([30]);function SL(){return fixEncoderSize(getBytesEncoder(),1).encode(Oi)}function wo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Ht())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(bt()))],["compressedProofArgs",getOptionEncoder(D())],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:Oi}))}function Bi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Ft())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(_t()))],["compressedProofArgs",getOptionDecoder(P())],["secp256r1VerifyArgs",getArrayDecoder(X())]])}function xL(){return combineCodec(wo(),Bi())}async function IL(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(O(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:wo().encode(c),programAddress:r})}function Ni(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:wo().encode(c),programAddress:r})}function CL(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:Bi().decode(e.data)}}var zi=new Uint8Array([28]);function bL(){return fixEncoderSize(getBytesEncoder(),1).encode(zi)}function Vo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Ht())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(bt()))],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:zi}))}function Ki(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Ft())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(_t()))],["secp256r1VerifyArgs",getArrayDecoder(X())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function _L(){return combineCodec(Vo(),Ki())}async function vL(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Vo().encode(c),programAddress:r})}function ji(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Vo().encode(c),programAddress:r})}function UL(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},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:Ki().decode(e.data)}}var Yi=new Uint8Array([13]);function wL(){return fixEncoderSize(getBytesEncoder(),1).encode(Yi)}function Zi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Yi}))}function Xi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function VL(){return combineCodec(Zi(),Xi())}function Qi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Zi().encode(c),programAddress:r})}function HL(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:Xi().decode(e.data)}}var td=new Uint8Array([23]);function JL(){return fixEncoderSize(getBytesEncoder(),1).encode(td)}function rd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:td}))}function nd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function YL(){return combineCodec(rd(),nd())}function od(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.rentCollector),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:rd().encode(c),programAddress:r})}function ZL(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:nd().decode(e.data)}}var ad=new Uint8Array([10]);function nO(){return fixEncoderSize(getBytesEncoder(),1).encode(ad)}function id(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Gt()],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:ad}))}function dd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",zt()],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function oO(){return combineCodec(id(),dd())}function ud(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:id().encode(c),programAddress:r})}function sO(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:dd().decode(e.data)}}var pd=new Uint8Array([20]);function gO(){return fixEncoderSize(getBytesEncoder(),1).encode(pd)}function md(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Gt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",wt()],["compressedProofArgs",D()]]),e=>({...e,discriminator:pd}))}function ld(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",zt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Vt()],["compressedProofArgs",P()]])}function pO(){return combineCodec(md(),ld())}function yd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:md().encode(c),programAddress:r})}function mO(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:ld().decode(e.data)}}var Sd=new Uint8Array([14]);function IO(){return fixEncoderSize(getBytesEncoder(),1).encode(Sd)}function xd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Sd}))}function Id(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function CO(){return combineCodec(xd(),Id())}function Cd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:xd().encode(c),programAddress:r})}function EO(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:Id().decode(e.data)}}var Pd=new Uint8Array([24]);function _O(){return fixEncoderSize(getBytesEncoder(),1).encode(Pd)}function hd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Pd}))}function Md(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function vO(){return combineCodec(hd(),Md())}function Rd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:hd().encode(c),programAddress:r})}function UO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},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:Md().decode(e.data)}}var vd=new Uint8Array([12]);function NO(){return fixEncoderSize(getBytesEncoder(),1).encode(vd)}function Ud(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:vd}))}function kd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function wO(){return combineCodec(Ud(),kd())}function Wd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.transactionBuffer),...a],data:Ud().encode(c),programAddress:r})}function VO(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:kd().decode(e.data)}}var Bd=new Uint8Array([22]);function jO(){return fixEncoderSize(getBytesEncoder(),1).encode(Bd)}function Nd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Bd}))}function wd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function qO(){return combineCodec(Nd(),wd())}function Vd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.transactionBuffer),...a],data:Nd().encode(c),programAddress:r})}function JO(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:wd().decode(e.data)}}var Gd=new Uint8Array([11]);function tB(){return fixEncoderSize(getBytesEncoder(),1).encode(Gd)}function zd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Gd}))}function Kd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function rB(){return combineCodec(zd(),Kd())}function jd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:zd().encode(c),programAddress:r})}function nB(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:Kd().decode(e.data)}}var Yd=new Uint8Array([21]);function uB(){return fixEncoderSize(getBytesEncoder(),1).encode(Yd)}function Zd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",wt()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Yd}))}function Xd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Vt()],["compressedProofArgs",P()]])}function AB(){return combineCodec(Zd(),Xd())}function Qd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Zd().encode(c),programAddress:r})}function gB(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:Xd().decode(e.data)}}var tu=new Uint8Array([15]);function fB(){return fixEncoderSize(getBytesEncoder(),1).encode(tu)}function ru(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:tu}))}function nu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function SB(){return combineCodec(ru(),nu())}function ou(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=m({}),a=l(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:ru().encode({}),programAddress:r})}function xB(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:nu().decode(e.data)}}var au=new Uint8Array([25]);function hB(){return fixEncoderSize(getBytesEncoder(),1).encode(au)}function iu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:au}))}function du(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function MB(){return combineCodec(iu(),du())}function uu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.transactionBuffer),...a],data:iu().encode(c),programAddress:r})}function RB(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:du().decode(e.data)}}var pu=new Uint8Array([16]);function LB(){return fixEncoderSize(getBytesEncoder(),1).encode(pu)}function mu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Kt()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:pu}))}function lu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",jt()],["secp256r1VerifyArgs",getArrayDecoder(X())]])}function OB(){return combineCodec(mu(),lu())}function yu(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:mu().encode(c),programAddress:r})}function BB(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:lu().decode(e.data)}}var Su=new Uint8Array([26]);function zB(){return fixEncoderSize(getBytesEncoder(),1).encode(Su)}function xu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Kt()],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Su}))}function Iu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",jt()],["secp256r1VerifyArgs",getArrayDecoder(X())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function KB(){return combineCodec(xu(),Iu())}function Cu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:xu().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:Iu().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",pE=(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))(pE||{});function RN(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 mE=(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))(mE||{});function bN(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 yE=6e3,TE=6001,fE=6002,SE=6003,xE=6004,IE=6005,CE=6006,EE=6007,DE=6008,PE=6009,hE=6010,ME=6011,RE=6012,bE=6013,_E=6014,vE=6015,UE=6016,kE=6017,WE=6018,LE=6019,OE=6020,BE=6021,NE=6022,wE=6023,VE=6024,HE=6025,FE=6026,GE=6027,zE=6028,KE=6029,jE=6030,qE=6031,JE=6032,YE=6033,ZE=6034,XE=6035,QE=6036,$E=6037,eD=6038,tD=6039,rD=6040,nD=6041,oD=6042,sD=6043,cD=6044,aD=6045,iD=6046,dD=6047,uD=6048,AD=6049,gD=6050,pD=6051,mD=6052,lD=6053,yD=6054,TD=6055,fD=6056,SD=6057,xD=6058,ID=6059,CD=6060,ED=6061,DD=6062,PD=6063,hD=6064,MD=6065,RD=6066,bD=6067,_D=6068,vD=6069,UD=6070,kD=6071,WD=6072,LD=6073,OD=6074,BD=6075,ND=6076,wD=6077,VD=6078,HD=6079,FD=6080,GD=6081,zD=6082,KD=6083,jD=6084,qD=6085,JD=6086,Eu;process.env.NODE_ENV!=="production"&&(Eu={[qE]:"This member is already delegated to another wallet.",[EE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[wD]:"Clock sysvar access failed. This may indicate a system error.",[pD]:"Missing credential id.",[lD]:"The domain configuration account is disabled. Please contact support or try again later.",[yD]:"Missing domain configuration account.",[BD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[JD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[hE]:"Duplicate public keys detected among members. Each member must have a unique key.",[PE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[BE]:"No members provided. A multisig wallet must contain at least one member.",[CD]:"Slot numbers list is empty. At least one slot number is required for validation.",[WE]:"Expected a User with Administrator role for this instruction.",[DE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[UE]:"Expected a User with Transaction Manager role for this instruction.",[rD]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[nD]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[oD]:"Declared buffer size does not match the actual serialized size.",[ID]:"Failed to compute hash. This may indicate a system error.",[ZE]:"Not enough members with vote permission to meet the approval threshold.",[JE]:"At least one signer with execute permission is required to proceed.",[YE]:"At least one signer with initiate permission is required to perform this action.",[FE]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[OD]:"Invalid account index in transaction message. The account index is out of bounds.",[SD]:"Address Tree supplied is not part of the whitelisted address trees.",[LE]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[zE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[tD]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[ED]:"Member key conversion failed. The provided key format is invalid.",[XE]:"Only delegated members are allowed for this transaction.",[HE]:"Unexpected number of accounts provided for this instruction.",[bE]:"User with Permanent Member role must have a delegated wallet.",[TE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[xE]:"The extracted public key has an invalid length or encoding.",[yE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[SE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[gD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[uD]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[wE]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[kD]:"Invalid source type for token transfer. The source account type is not supported.",[kE]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[vE]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[VE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[FD]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[GE]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[HD]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[UD]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[IE]:"The extracted WebAuthn signed message payload is malformed.",[iD]:"An input string exceeds the maximum allowed character length.",[TD]:"This member is not registered under the provided domain configuration.",[hD]:"Member not found in settings. Cannot remove a member that does not exist.",[LD]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[KE]:"A required account is missing from the instruction context.",[DD]:"Compressed proof arguments are missing. Required for compressed account operations.",[bD]:"Missing compressed token account. Required for token transfer operations.",[GD]:"Missing destination token account. Required for token transfer operations.",[vD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[PD]:"Light CPI accounts are missing. Required for compressed account operations.",[jE]:"User mutation arguments are required when performing add or remove delegate operations.",[jD]:"Missing new authority account. Required for domain configuration updates.",[KD]:"Missing settings account. Required for delegate operations on compressed wallets.",[xD]:"Compressed settings data is missing. The settings account must be initialized with data.",[zD]:"Missing source token account. Required for token transfer operations.",[_D]:"Missing SPL interface PDA. Required for token transfer operations.",[dD]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[ND]:"User account address is missing. Required for secp256r1 signature verification.",[qD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[$E]:"No valid signer found in this transaction.",[OE]:"Only one administrator is allowed per wallet.",[RE]:"Only one permanent member is allowed per wallet.",[_E]:"Only one transaction manager is allowed per wallet.",[fD]:"The given origin index is not in the whitelisted origins.",[RD]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[ME]:"Permanent members cannot be removed from a wallet.",[aD]:"Writable CPI calls to protected accounts are not permitted.",[CE]:"The rpIdHash extracted from the signed message does not match the expected value.",[MD]:"Settings key mismatch. The provided settings key does not match the expected value.",[fE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[AD]:"The specified slot number was not found in the provided slot history.",[WD]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[NE]:"Too many members: a maximum of 4 members are supported.",[sD]:"This transaction has expired. It must be executed within 3 minutes of approval.",[cD]:"This transaction has not yet reached the required approval threshold.",[mD]:"Missing transports.",[eD]:"Only the transaction creator or rent payer may close this transaction buffer.",[VD]:"Unauthorized: Only the admin account is allowed to perform this action.",[QE]:"Member is not part of the expected signers for this transaction."});function LN(e){return process.env.NODE_ENV!=="production"?Eu[e]:"Error message not available in production bundles."}function ON(e,n,r){return isProgramError(e,n,A,r)}async function qN({admin:e,addressTree:n}){return ra({payer:e,addressTree:n,remainingAccounts:[]})}var Go=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Du="https://mainnet.block-engine.jito.wtf/api/v1",Pu="https://bundles.jito.wtf/api/v1/bundles/tip_floor",hu="landed_tips_75th_percentile";var ve=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);}},tt=class extends ve{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},re=class extends ve{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},z=class extends ve{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},Ce=class extends ve{constructor(r,o,t){super(r,"NETWORK_ERROR",{statusCode:o,url:t});this.statusCode=o;this.url=t;}};var me=class extends ve{constructor(r,o,t){super(r,"BUNDLE_ERROR",{bundleId:o,attempt:t});this.bundleId=o;this.attempt=t;}},Or=class extends ve{constructor(r,o,t){super(`Operation "${r}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=o;this.lastError=t;}},Br=class extends ve{constructor(r,o,t){super(r,"PERMISSION_ERROR",{required:o,actual:t});this.required=o;this.actual=t;}};var Qt={Ed25519:1,Secp256r1:2};var Mu=T.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),tw=T.object({transactionActionType:Mu,transactionAddress:T.string(),transactionMessageBytes:T.array(T.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),YD=T.object({transactionActionType:Mu,transactionAddress:T.string(),transactionMessageBytes:T.base64()}).strict(),Ru=T.object({phase:T.literal("start"),redirectOrigin:T.url(),signer:T.string().optional(),rid:T.string(),validTill:T.number(),data:T.object({type:T.literal("message"),payload:T.string()}).strict()}).strict(),bu=T.object({phase:T.literal("start"),redirectOrigin:T.url(),signer:T.string().optional(),rid:T.string(),validTill:T.number(),data:T.object({type:T.literal("transaction"),payload:YD,sendTx:T.boolean()}).strict()}).strict(),_u=T.object({startRequest:T.union([Ru,bu]),authResponse:T.custom(),client:T.object({clientOrigin:T.url(),jws:T.string()}).strict(),device:T.object({jwk:T.base64(),jws:T.string()}).strict(),authProvider:T.object({jwk:T.base64(),jws:T.string()}).strict().optional()}).strict(),vu=T.object({signer:T.string(),userAddressTreeIndex:T.number().optional(),additionalInfo:T.looseObject({}).optional()}).strict(),ZD=T.object({slotHash:T.string(),slotNumber:T.string(),originIndex:T.number(),crossOrigin:T.boolean()}).strict(),rw=T.object({phase:T.literal("complete"),data:T.object({type:T.literal("message"),payload:vu.extend(_u.shape).extend({id:T.string().optional(),client:T.object({clientOrigin:T.url()}).strict()})}).strict()}).strict(),nw=T.object({phase:T.literal("complete"),data:T.object({type:T.literal("transaction"),payload:vu.extend(_u.shape).extend(ZD.shape).extend({client:T.object({clientOrigin:T.url()}).strict()})}).strict()}).strict(),ow=T.object({phase:T.literal("complete"),data:T.object({type:T.literal("transaction"),payload:T.object({startRequest:T.union([bu,Ru]),txSig:T.string()})}).strict()}).strict();var Ue={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Be=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(Ue).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var zo=33,Ne=class{_bn;constructor(n){typeof n=="string"?this._bn=new Uint8Array(getBase58Encoder().encode(n)):this._bn=new Uint8Array(n),this.validateKeyLength(this._bn);}validateKeyLength(n){if(n.length!==zo)throw new Error(`Invalid public key length, expected ${zo} 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===zo)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()}},E=class extends Ne{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(n,r){super(n),this.verifyArgs=r.verifyArgs,this.domainConfig=r.domainConfig,this.authData=r.authData,this.signature=r.signature,this.originIndex=r.originIndex,this.crossOrigin=r.crossOrigin,this.clientAndDeviceHash=r.clientAndDeviceHash,this.authResponse=r.authResponse;}};function $D(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function eP(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var ku=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec($D())],["addressTableLookups",getArrayCodec(eP())]]);function Wu(e){return ku.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 Lu(e){let n=ku.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 de={};function Ou(){if(!de.solanaRpcEndpoint)throw new tt("RPC endpoint");return de.solanaRpcEndpoint}function Ve(){if(!de.lightProtocolRpc)throw new tt("Light Protocol RPC");return de.lightProtocolRpc}function Q(){if(!de.solanaRpc)throw new tt("Solana RPC");return de.solanaRpc}function Bu(){if(!de.sendAndConfirm)throw new tt("Send and confirm transaction function");return de.sendAndConfirm}function jo(){return de.jitoTipsConfig?de.jitoTipsConfig:{blockEngineUrl:Du,getJitoTipsUrl:Pu,priority:hu}}function Mw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:o}){de.solanaRpcEndpoint=e,de.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});de.solanaRpc=t,de.sendAndConfirm=c,de.jitoTipsConfig=o??null;}async function $t(e,n){if(!e.ok)throw new Ce(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function er(e){try{return await e.json()}catch(n){throw new Ce(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function Fw(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 Gw(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 zw(e){let{authenticatorData:n,clientDataJSON:r,signature:o}=e.authResponse.response,t=xe(n),c=JSON.parse(getUtf8Decoder().decode(xe(r))),i=Hu(c),a=Gu(xe(o)),s=await gt({rpIdHash:t.subarray(0,32)});return new E(e.signer.toString(),{verifyArgs:{clientDataJson:xe(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:qo(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:s,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function qo(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(n),...getBase64Encoder().encode(r)]))}function Kw(e){return sha256(getUtf8Encoder().encode(JSON.stringify(e)))}function jw(e){return Jo(e.data.payload.authResponse)}function qw(e,n,r,o){let t=qo(n,r,o);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...t]))}async function Jw(e,n,r,o,t,c){let i;if(!t||!c){let u=(await Q().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!u)throw new re("Slot sysvar","Unable to fetch slot sysvar data");let g=getBase64Encoder().encode(u[0]);c=getU64Decoder().decode(g.subarray(0,8)).toString(),i=g.subarray(8,40),t=getBase58Decoder().decode(i);}else i=getBase58Encoder().encode(t);let a=sha256(typeof e.transactionMessageBytes=="string"?getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),s=qo(n,r,o),d=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...a,...i,...s]));return {slotNumber:c,slotHash:t,challenge:d}}function Jo(e){let n=Vr(e);return sha256(n)}function Yw(e){let n="";for(let o of e)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function xe(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,o=n.padEnd(n.length+r,"="),t=atob(o),c=new ArrayBuffer(t.length),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}async function Zw(e,n){let{data:r}=await Cs(Q(),e),t=Fu(r.origins,r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new re("Origin","Origin not found in domain config");return t}function Xw(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function Qw(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 uP(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 Hu(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 Fu(e,n){let r=[],o=0,t=new TextDecoder;for(let c=0;c<n;c++){if(o+2>e.length)throw new Error("MaxLengthExceeded");let i=e[o]|e[o+1]<<8;if(o+=2,o+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(o,o+i),s=t.decode(a);r.push(s),o+=i;}return r}function Gu(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 i=e[r+1],a=r+2,s=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=s[0]===0&&s.length>32?s.slice(1):s;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let p=p256.Point.CURVE().n>>1n,f=BigInt("0x"+wr(u)),I=(f>p?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=uP(I);return new Uint8Array([...g,...x])}function Vr(e){let n=xe(e.response.clientDataJSON),r=xe(e.response.authenticatorData),o=sha256(n);return new Uint8Array([...r,...o])}var ju={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true,initialDelayMs:500,maxRetries:3};function qu(e){return e===429}function Ju(e){return e>=500}function TP(e){return e>=400&&e<500}function fP(e){return qu(e)||Ju(e)}function SP(e,n,r){return e instanceof Response?qu(e.status)?r.retryOnRateLimit??true:TP(e.status)?false:Ju(e.status):e instanceof TypeError||e instanceof Error}function xP(e,n,r,o){let t=n*Math.pow(r,e-1);return Math.min(t,o)}function IP(e){return new Promise(n=>setTimeout(n,e))}async function nr(e,n){let{maxRetries:r,initialDelayMs:o,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...ju,...n},a;for(let s=1;s<=r;s++)try{return await e()}catch(d){if(a=d,i&&!i(d,s))throw d;if(s>=r)break;let u=xP(s,o,t,c);await IP(u);}throw new Or(e.name||"retryWithBackoff",r,a)}async function pt(e,n){let r={...ju,...n},o=(c,i)=>SP(c,i,r);return nr(async()=>{let c=await e();if(!c.ok&&fP(c.status))throw c;return c},{...r,shouldRetry:n?.shouldRetry??o})}function Yu(...e){return n=>e.some(r=>n instanceof r)}function Zu(e,n,r,o){if(e<n||e>r)throw new z(`${o} must be between ${n} and ${r} (inclusive), got ${e}`)}function Xu(e,n){if(e<0)throw new z(`${n} must be non-negative, got ${e}`)}function or(e,n){if(e.length===0)throw new z(`${n} cannot be empty`)}function Qu(e,n){if(e.trim().length===0)throw new z(`${n} cannot be empty`)}async function Zo(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await Q().getLatestBlockhash().send()).value;return await Promise.all(e.map(async o=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(o.instructions,c),c=>setTransactionMessageFeePayerSigner(o.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>o.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,o.addressesByLookupTableAddress):c,async c=>{let i=Math.ceil((o.unitsConsumed??0)*1.1);return i>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:i})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function oA(e){let n=prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:8e5}),getSetComputeUnitPriceInstruction({microLamports:1e4})],e),r=getBase64EncodedWireTransaction(compileTransaction(n));if(r.length>1644)throw new z(`Transaction exceeds maximum length of ${1644} bytes (actual: ${r.length} bytes)`);let o=await Q().simulateTransaction(r,{encoding:"base64"}).send();if(o.value.err){if(o.value.logs){let c=["Transaction simulation failed:","",...o.value.logs].join(`
|
|
2
2
|
`);throw new Error(c)}let t=["Transaction simulation failed:","",o.value.err.toString()].join(`
|
|
3
|
-
`);throw new Error(t)}return o.value.unitsConsumed}async function tA(e,n){let o=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===AccountRole.WRITABLE||c.role===AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));o.sort((c,i)=>c-i);let t=Math.floor(o.length/2);return o.length%2===0?Math.round((o[t-1]+o[t])/2):o[t]}async function rA(e,n){or(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new z(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await pt(()=>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 $t(r,n);let o=await er(r);if(!o.result||o.error)throw new me(`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 me(`Simulation failed: ${c}`)}return o.result.value.transactionResults.map(t=>t.unitsConsumed)}function J(e,n=0){let r=e instanceof E?e:void 0,o=r?.verifyArgs&&n!==-1?some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs.clientDataJson?Vr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:o,signature:c,message:i,publicKey:a}}function Ee(e){if(e instanceof Ne)return {keyType:Qt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Qt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function Zu(e){return e instanceof E?e.toString():e.address.toString()}function Te(e){let n=new Set,r=[];for(let t of e)n.has(Zu(t))||(r.push(t),n.add(Zu(t)));let o=r.filter(t=>t instanceof E);if(o.length>1)throw new z(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return r}function nA({payer:e,tipAmount:n}){let r=Go[Math.floor(Math.random()*Go.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function oA(e){return typeof e=="string"?e:e.toString()}function sA(e){return e.toString()}async function Xo(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 HP=[{tree:new PublicKey(batchMerkleTree1),queue:new PublicKey(batchQueue1),cpiContext:new PublicKey(batchCpiContext1),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree2),queue:new PublicKey(batchQueue2),cpiContext:new PublicKey(batchCpiContext2),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree3),queue:new PublicKey(batchQueue3),cpiContext:new PublicKey(batchCpiContext3),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree4),queue:new PublicKey(batchQueue4),cpiContext:new PublicKey(batchCpiContext4),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree5),queue:new PublicKey(batchQueue5),cpiContext:new PublicKey(batchCpiContext5),nextTreeInfo:null,treeType:TreeType.StateV2}],N=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:r?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(A.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let o=this.nextIndex++,t={address:address(n),role:r};this.map.set(n,{index:o,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=selectStateTreeInfo(HP);return this.packOutputTreeIndex(n)}packTreeInfos(n,r){let o=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());o.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let s=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(s);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:o.length>0?{packedTreeInfos:o,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,o)=>r[1].index-o[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,o]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:o}}};async function Fr(e,n){let r=oA(e);return Xo(n,r,()=>Ve().getCompressedAccount(e))}async function ot(e,n){let r=sA(e);return Xo(n,r,()=>Q().getAccountInfo(e,{encoding:"base64"}).send())}async function ye(e,n){let r=(await Promise.all(e.map(o=>Fr(o.address,n)))).filter(o=>o!==null).filter(o=>o.data!==null&&o.address!==null);if(r.length!==e.length)throw new re("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((o,t)=>({...o,type:e[t].type,tree:o.treeInfo.tree,queue:o.treeInfo.queue}))}function k(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function De(e,n,r,o,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:o[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function ae(e,n,r,o,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:o[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let s=e.packTreeInfos(a,[]).stateTrees;if(!s)throw new z("Unable to parse state tree data");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:s.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:s.outputTreeIndex}}))}async function Pe(e,n,r,o,t){let c=null,i=null,a=null,s=new N;if(e){await s.addSystemAccounts();let{address:d}=await ue(n,r),u=(await ye([{address:d,type:"Settings"}],t))[0];o?a={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:a=await $([u],[]);let g=s.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!g)throw new z("Unable to parse state tree data");c={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0]},data:K().decode(u.data?.data)},i={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:K().decode(u.data?.data)};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:s,settingsMutArgs:i}}async function $(e,n){return nr(()=>Ve().getValidityProofV0(e,n))}async function he(){return (await Gr()).length-1}var Qo;async function Gr(){if(!Qo){let{data:e}=await Zc(Q(),await iA());Qo=e.whitelistedAddressTrees;}return Qo}function aA(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 cr(e,n,r){let o=await KP(e,n,r);if(!o)throw new re("User account");return o}async function KP(e,n,r){let{address:o}=await w(e,n),t=await Fr(o,r);return t?.data?.data?te().decode(t.data.data):null}async function E2(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(Ee(n)))}});else if(r)o.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(xe(r))}});else return null;let t=await Ve().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:o});return t.items.filter(c=>!!c.data).length?t.items.map(c=>te().decode(c.data?.data))[0]:null}async function zr(e,n,r){let o=await jP(e,n,r);if(!o)throw new re("Settings account");return o}async function jP(e,n,r){try{let{address:o}=await ue(e,n),t=await Fr(o,r);if(!t?.data?.data)throw new re("Compressed settings account");let c=K().decode(t.data.data);if(c.data.__option==="None")throw new re("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let o=await To(Q(),e);return o.exists?{...o.data,isCompressed:false}:null}}async function D2(e,n,r){let o=await cr(e,n,r);if(o.role===1||o.role===0){let t=[],[c,i]=await Promise.all([Ve().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:getBase58Decoder().decode(H().encode(Ee(e)))}}]}),Q().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(H().encode(Ee(e)))}}]}).send()]);return c.items.forEach(a=>{if(a.data?.data){let s=K().decode(a.data.data);s.data.__option==="Some"&&t.push({...s.data.value,isCompressed:true});}}),i.forEach(a=>{let s=hr().decode(getBase64Encoder().encode(a.account.data[0]));t.push({...s,isCompressed:false});}),t}else return await Promise.all(o.wallets.map(async t=>zr(await Me(t.index),t.settingsAddressTreeIndex,r)))}async function es(e){qu(e,"index");let n=await Gr();if(e>=n.length)throw new z(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function P2(e){let r=(await Gr()).findIndex(o=>o.toString()===e);if(r===-1)throw new re("Address tree",`Address ${e} not found in whitelist`);return r}async function ue(e,n=0){let r=await es(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(o,new PublicKey(r),new PublicKey(A)).toString(),"base58"),addressTree:new PublicKey(r)}}async function w(e,n=0){let r=await es(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("user"),e instanceof Ne?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 gt({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(getUtf8Encoder().encode(n));else throw new z("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function pA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function iA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function mA(e,n,r){ju(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 Ne?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return o}async function ke(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function Me(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function B2(e){let n=await Me(e);return await ke(n)}async function N2(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function J2(e){or(e,"bundle");let n=await Zo(e,true),r=await rA(n.map(getBase64EncodedWireTransaction),Lu()),o=await Zo(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await $P(o.map(getBase64EncodedWireTransaction))}async function $P(e,n=jo(),r){or(e,"serializedTransactions");let{blockEngineUrl:o}=n,t=`${o}/bundles`,c=await pt(()=>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 $t(c,t);let i=await er(c);if(i.error)throw new me(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new me("No bundle ID returned from Jito");return i.result}async function Y2(e,n=30,r=3e3,o=jo()){Ju(e,"bundleId");let{blockEngineUrl:t}=o,c=`${t}/getBundleStatuses`;return nr(async()=>{let i=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await $t(i,c);let a=await er(i);if(a.error)throw new me(`Error getting bundle status: ${JSON.stringify(a.error,null,2)}`,e);if(!a.result?.value?.length)throw new me("Bundle not yet confirmed",e);let s=a.result.value[0];if(s.confirmation_status==="confirmed"||s.confirmation_status==="finalized"){let d=s.transactions[s.transactions.length-1];if(!d)throw new me("No transactions in confirmed bundle",e);return d}throw new me(`Bundle status: ${s.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:i=>i instanceof me||i instanceof Ce})}async function r6({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=await Q().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(e,c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(o.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([eA(c),tA(Q(),c.instructions.flatMap(d=>d.accounts??[]))]),s=Math.ceil((Number(i)??0)*1.1);return prependTransactionMessageInstructions([...s>2e5?[getSetComputeUnitLimitInstruction({units:s})]:[],...a>0?[getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await Ou()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function T6(e,n){if(n.threshold>1)throw new z("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(s=>fA(s.pubkey)===e);if(!r)throw new re("Member",`Signer ${e} not found in settings`);let{permissions:o}=r;if(!o)throw new re("Permissions","No permissions found for the current member");let t=Be.has(o,Ue.InitiateTransaction),c=Be.has(o,Ue.VoteTransaction),i=Be.has(o,Ue.ExecuteTransaction);if(t&&c&&i)return {};if(!c||!i)throw new Br("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(s=>s.role===0);if(!a)throw new re("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(fA(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function f6({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:o,cachedAccounts:t}){if(!n)return null;let c=await cr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new re("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return lh(n,c.transactionManagerUrl.value,e,o)}function lh(e,n,r,o){return {address:e,async signTransactions(t){let c=await pt(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:e.toString(),payload:t.map(a=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(a)),transactionMessageBytes:o?getBase64Decoder().decode(o):void 0,authResponses:r}))})}));if(!c.ok)throw new Ce(`Transaction manager request failed: ${c.statusText}`,c.status,n);let i=await c.json();if("error"in i)throw new Ce(`Transaction manager error: ${i.error}`,c.status,n);return i.signatures.map(a=>({[e]:getBase58Encoder().encode(a)}))}}}function fA(e){return e.keyType===Qt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function S6(e){let n=e.map(c=>Ke().encode(c)),r=4+n.reduce((c,i)=>c+i.length,0),o=new Uint8Array(r),t=0;o.set(getU32Encoder().encode(e.length),t),t+=4;for(let c of n)o.set(c,t),t+=c.length;return o}function x6(e){let n=0,[r,o]=getU32Decoder().read(e,n);n=o;let t=new Array(r);for(let c=0;c<r;c++){let i=je().read(e,n);t[c]=i[0],n=i[1];}if(n!==e.length)throw new z(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function O6({payer:e,rpId:n,origins:r,authority:o}){let t=await gt({rpId:n}),c=new N;await c.addSystemAccounts();let i=await he(),{address:a,addressTree:s}=await w(o.address,i),d=[{address:a,tree:s,queue:s,type:"User"}],u=await $([],d),g=(await De(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:f}=c.toAccountMetas(),S=k(u,f);return await Ua({origins:r,authorityCreationArgs:g,authority:o,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function q6({authority:e,payer:n,createUserArgs:r,domainConfig:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[];r.settings&&(i.push({address:(await ue(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 ye(i,t):[],s=await he(),{address:d,addressTree:u}=await w(r.member,s),g=[{address:d,type:"User",tree:u,queue:u}],p=await $(a,g),f=null,S=null,I=a.filter(B=>B.type==="Settings"),x=a.filter(B=>B.type==="User");I.length&&(f=ae(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),I,K())[0]),x.length&&(S=ae(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,te())[0]);let b=await De(c,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),g),{remainingAccounts:C,systemOffset:_}=c.toAccountMetas(),v=k(p,_);return await Ba({payer:n,authority:e,compressedProofArgs:v,member:Nt().decode(r.member.toBuffer()),credentialId:xe(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:C})}async function X6({payer:e}){let n=await pA();return Ha({payer:e,globalCounter:n})}async function t5({admin:e,rpId:n,disable:r}){let o=await gt({rpId:n});return ni({domainConfig:o,admin:e,disable:r,remainingAccounts:[]})}function fh(e,n,r,o){let t=Sh(e,n),c=xh(e,n)&&r!==o;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function Sh(e,n){let r=e.staticAccounts.length,{numSignerAccounts:o,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=o-t,a=r-o-c;return n>=r?false:n<i?true:n>=o?n-o<a:false}function xh(e,n){return n<e.header.numSignerAccounts}async function Kr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:o}){let t=Wu(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),Q()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,s]of t.staticAccounts.entries())i.push({address:s,role:fh(t,a,s,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let s=c[a.lookupTableAddress];if(!s)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.READONLY});}}for(let a of o?.filter(s=>s.address!==e)??[]){let s=i.findIndex(d=>d.address===a.address);s===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[s].role===AccountRole.READONLY||i[s].role===AccountRole.READONLY_SIGNER?i[s]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[s].role===AccountRole.WRITABLE||i[s].role===AccountRole.WRITABLE_SIGNER)&&(i[s]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}var yt=33,lt=64,os=14,Mh=2,Rh=address("Secp256r1SigVerify1111111111111111111111111");function bh(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function _h(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function DA(){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=_h();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=os;let i=[];for(let a=0;a<r;a++){let s=fixDecoderSize(getBytesDecoder(),yt).decode(e,n);n+=yt;let d=fixDecoderSize(getBytesDecoder(),lt).decode(e,n);n+=lt;let u=t[a].messageDataSize,g=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:s,signature:d,message:g});}return [{numSignatures:r,padding:o,offsets:t,payload:i},n]}})}function PA(){return createEncoder({getSizeFromValue:e=>{let n=os*e.offsets.length,r=e.payload.reduce((o,t)=>o+yt+lt+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=bh();for(let t of e.offsets)r=o.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),yt).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),lt).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function m5(){return combineCodec(PA(),DA())}function V(e,n){let r=e.length,o=Mh+r*os,t=[];for(let s=0;s<r;s++){let{message:d}=e[s],u=o,g=u+yt,p=g+lt;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),o+=yt+lt+d.length;}let c=n?.programAddress??Rh,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:PA().encode(i)}}function y5(e){return {programAddress:e.programAddress,accounts:{},data:DA().decode(e.data)}}async function hA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:o,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:s=false}){let d=await ke(e),{accountMetas:u,addressLookupTableAccounts:g}=await Kr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(V(c)),p.push(s?du({transactionBuffer:n,payer:o.address,remainingAccounts:u,settingsKey:e}):nu({transactionBuffer:n,payer:o.address,settings:e})),a&&p.push(nA({payer:o,tipAmount:a})),{instructions:p,addressLookupTableAccounts:g}}async function MA({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:o,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:i=[],compressed:a=false,simulateProof:s=false,cachedAccounts:d}){let u=Te(o),g=await ke(e),[{accountMetas:p,addressLookupTableAccounts:f,transactionMessage:S},{settingsMutArgs:I,proof:x,packedAccounts:b}]=await Promise.all([Kr({transactionMessageBytes:r,walletAddress:g,additionalSigners:u.filter(ee=>!(ee instanceof E)),addressesByLookupTableAddress:c}),Pe(a,e,n,s,d)]);b.addPreAccounts(p);let C=u.filter(ee=>ee instanceof E),{secp256r1VerifyArgs:_}=Uh(C,i,b),{remainingAccounts:v,systemOffset:B}=b.toAccountMetas();return {instructions:kh({secp256r1VerifyInput:i,transactionMessage:S,accountMetas:p,compressed:a,payer:t,settingsMutArgs:I,proof:x,systemOffset:B,secp256r1VerifyArgs:_,settings:e,remainingAccounts:v}),addressLookupTableAccounts:f}}function Uh(e,n,r){let o=[];for(let t of e){let c=n.length,{domainConfig:i,verifyArgs:a,signature:s,publicKey:d,message:u}=J(t,c);u&&s&&d&&n.push({message:u,signature:s,publicKey:d}),i&&(r.addPreAccounts([{address:i,role:AccountRole.READONLY}]),a.__option==="Some"&&o.push({domainConfigKey:i,verifyArgs:a.value}));}return {secp256r1VerifyArgs:o}}function kh({secp256r1VerifyInput:e,transactionMessage:n,accountMetas:r,compressed:o,payer:t,settingsMutArgs:c,proof:i,systemOffset:a,secp256r1VerifyArgs:s,settings:d,remainingAccounts:u}){let g=[];e.length>0&&g.push(V(e));let p=Wh(n,r);if(o){if(!t||!c)throw new Error("Payer not found or proof args is missing.");let f=k(i,a);g.push(Iu({secp256r1VerifyArgs:s,transactionMessage:p,settingsMutArgs:c,compressedProofArgs:f,payer:t,remainingAccounts:u}));}else g.push(yu({secp256r1VerifyArgs:s,settings:d,transactionMessage:p,remainingAccounts:u}));return g}function Wh(e,n){if(e.version==="legacy")throw new Error("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:r.data??[]})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(o=>o.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function w5({settings:e,settingsAddressTreeIndex:n,destination:r,signers:o,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let s=Te(o),d=await ke(e),[{packedAccounts:u,proof:g,settingsMutArgs:p},{value:f}]=await Promise.all([Pe(a,e,n,false,t),ot(d,t)]);if((f?.lamports??0)<BigInt(c))throw new Error("Insufficient balance");let S=[],I=[];for(let _ of s)if(_ instanceof E){let v=S.length,{domainConfig:B,verifyArgs:se,signature:ee,publicKey:ie,message:le}=J(_,v);le&&ee&&ie&&S.push({message:le,signature:ee,publicKey:ie}),B&&(u.addPreAccounts([{address:B,role:AccountRole.READONLY}]),se.__option==="Some"&&I.push({domainConfigKey:B,verifyArgs:se.value}));}else u.addPreAccounts([{address:_.address,role:AccountRole.READONLY_SIGNER,signer:_}]);let{remainingAccounts:x,systemOffset:b}=u.toAccountMetas(),C=[];if(S.length>0&&C.push(V(S)),a){if(!i||!p)throw new Error("Payer not found or proof args is missing.");let _=k(g,b);C.push(vi({amount:c,settingsMutArgs:p,compressedProofArgs:_,payer:i,secp256r1VerifyArgs:I,source:d,destination:r,remainingAccounts:x}));}else C.push(Pi({amount:c,secp256r1VerifyArgs:I,source:d,destination:r,settings:e,remainingAccounts:x}));return C}var Vh=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),Hh=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),qr=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function Q5({settings:e,settingsAddressTreeIndex:n,destination:r,mint:o,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:s,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false}){let g=Te(t),p=await ke(e),f=U=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(U),getAddressEncoder().encode(qr),getAddressEncoder().encode(o)],programAddress:qr}),S=()=>{let U=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(o)];return d.restricted&&U.push(getUtf8Encoder().encode("restricted")),d.index>0&&U.push(getU8Encoder().encode(d.index)),U},[I,[x],b,[C],[_]]=await Promise.all([getAssociatedTokenAccountAddress(o,p,s),f(p),getAssociatedTokenAccountAddress(o,r,s),f(r),getProgramDerivedAddress({seeds:S(),programAddress:qr})]),[v,B,se,ee]=await Promise.all([ot(b,c),ot(I,c),ot(x,c),zh(u,e,n,c)]),ie=!!v.value,le=!!B.value,Tt=!!se.value,Re=le?getTokenDecoder().decode(getBase64Encoder().encode(B.value.data[0])).amount:BigInt(0),Ae=BigInt(Tt?Kh(getBase64Encoder().encode(se.value.data[0]))?.amount??0:0),it=ie?b:void 0,Xr=ie?void 0:C,l=le&&(Re+Ae<BigInt(i)||Ae>BigInt(0)||!ie)||!le&&ie,Qr=!ie,[pe,As]=await Promise.all([Gh(p,o,Re,Ae,BigInt(i),u?3:4),Fh(l,_,c)]),Y=pe.reduce((U,ne)=>U+ne.parsed.amount.toNumber(),0);if(Re+Ae+BigInt(Y)<BigInt(i))throw new Error("Insufficient balance");let dt=null,We=null,Le=new N;if(As&&Le.addPreAccounts([{address:o,role:AccountRole.WRITABLE}]),ee||pe.length){await Le.addSystemAccounts();let U=[];if(pe.length&&U.push(...pe.map(ne=>({hash:ne.compressedAccount.hash,tree:ne.compressedAccount.treeInfo.tree,queue:ne.compressedAccount.treeInfo.queue,data:ne.compressedAccount.data,address:ne.compressedAccount.address}))),ee&&U.push(ee),We=await $(U,[]),ee){let ne=pe.length;dt=ae(Le,We.treeInfos.slice(ne),We.leafIndices.slice(ne),We.rootIndices.slice(ne),We.proveByIndices.slice(ne),U.slice(ne),K())[0];}}let jA=pe.length&&We?some(pe.map((U,ne)=>({isFrozen:U.parsed.state===AccountState.Frozen,hasDelegate:U.parsed.delegate!=null,amount:U.parsed.amount.toNumber(),merkleContext:{leafIndex:U.compressedAccount.leafIndex,merkleTreePubkeyIndex:Le.insertOrGet(U.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:Le.insertOrGet(U.compressedAccount.treeInfo.queue.toString()),proveByIndex:U.compressedAccount.proveByIndex},rootIndex:We.rootIndices[ne],version:aA(U.compressedAccount.data?.discriminator),tlv:U.parsed.tlv?some(getArrayDecoder(vt()).decode(U.parsed.tlv)):none()}))):none(),ir=[],gs=[];for(let U of g)if(U instanceof E){let ne=ir.length,{domainConfig:$r,verifyArgs:ms,signature:ys,publicKey:ls,message:Ts}=J(U,ne);Ts&&ys&&ls&&ir.push({message:Ts,signature:ys,publicKey:ls}),$r&&(Le.addPreAccounts([{address:$r,role:AccountRole.READONLY}]),ms.__option==="Some"&&gs.push({domainConfigKey:$r,verifyArgs:ms.value}));}else Le.addPreAccounts([{address:U.address,role:AccountRole.READONLY_SIGNER,signer:U}]);let{remainingAccounts:qA,systemOffset:JA}=Le.toAccountMetas(),dr=[];ir.length>0&&dr.push(V(ir));let YA=k(We,JA),ZA=l?_:void 0,XA=Qr?Hh:void 0,QA=l?some(d):none(),ps={amount:i,secp256r1VerifyArgs:gs,source:p,destination:r,sourceCtokenTokenAccount:x,sourceSplTokenAccount:I,destinationCtokenTokenAccount:Xr,destinationSplTokenAccount:it,mint:o,tokenProgram:s,remainingAccounts:qA,payer:a,sourceCompressedTokenAccounts:jA,compressedProofArgs:YA,compressibleConfig:Vh,splInterfacePda:ZA,rentSponsor:XA,splInterfacePdaArgs:QA};if(u){if(!dt)throw new Error("Payer not found or proof args is missing.");dr.push(Ki({...ps,settingsMutArgs:dt}));}else dr.push(Bi({...ps,settings:e}));return dr}async function Fh(e,n,r){if(!e)return false;let{value:o}=await ot(n,r);return !o}async function Gh(e,n,r,o,t,c){let i=t-r-o;if(i<=0)return [];let s=(await Ve().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(n)})).items.filter(g=>!!g.compressedAccount.data?.data.length&&g.compressedAccount.owner.toString()===qr.toString()&&!g.parsed.amount.isZero()).sort((g,p)=>p.parsed.amount.cmp(g.parsed.amount));if(s.length===0)return [];let d=BigInt(0),u=[];for(let g of s){if(u.length>=c||d>=i)break;d+=BigInt(g.parsed.amount.toNumber()),u.push(g);}if(d<i)throw u.length>=c?new Error("Transaction size limit exceeded. Consider multiple transfers to transfer full balance."):new Error("Insufficient balance.");return u}async function zh(e,n,r,o){if(!e)return null;let{address:t}=await ue(n,r);return (await ye([{address:t,type:"Settings"}],o))[0]}function Kh(e){if(!e||e.length===0)return null;try{return {amount:getU64Decoder().decode(e.slice(64,72))}}catch(n){return console.error("Token data parsing error:",n),null}}async function dV({signers:e,payer:n,changeConfigArgs:r}){let{settings:o,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:s}=r,d=Te(e),u=d.filter(C=>!(C instanceof E));i.addPreAccounts(u.map(C=>({address:C.address,role:AccountRole.READONLY_SIGNER,signer:C})));let g=d.filter(C=>C instanceof E),p=[],f=[];for(let C of g){let _=f.length,{domainConfig:v,verifyArgs:B,signature:se,publicKey:ee,message:ie}=J(C,_);ie&&se&&ee&&f.push({message:ie,signature:se,publicKey:ee}),v&&(i.addPreAccounts([{address:v,role:AccountRole.READONLY}]),B.__option==="Some"&&p.push({domainConfigKey:v,verifyArgs:B.value}));}let{remainingAccounts:S,systemOffset:I}=i.toAccountMetas(),x=k(a,I),b=[];if(f.length>0&&b.push(V(f)),c){if(!s)throw new Error("Payer not found or proof args is missing.");b.push(Ta({configActions:t,payer:n,compressedProofArgs:x,settingsMutArgs:s,remainingAccounts:S,secp256r1VerifyArgs:p}));}else b.push(da({settings:o,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:S,secp256r1VerifyArgs:p}));return b}async function lV({createUserArgs:e,payer:n}){let r=new N;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:AccountRole.READONLY_SIGNER,signer:u.member})));let o=await he(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:p}=await w(u.member.address,o);return {address:g,tree:p,queue:p,type:"User"}})),c=await $([],t),i=await De(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:s}=r.toAccountMetas(),d=k(c,s);return await Ka({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:i[g],transactionManagerUrl:u.role===0?u.transactionManagerUrl:null})),remainingAccounts:a})}async function EV({index:e,payer:n,initialMember:r,userAddressTreeIndex:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[],a=[];a.push(...await ye([{address:(await w(r.address,o)).address,type:"User"}],t));let s=await he(),{address:d,addressTree:u}=await ue(await Me(e),s);i.push({address:d,queue:u,tree:u,type:"Settings"});let g=a.length,p=await $(a,i),f=ae(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),a.filter(_=>_.type==="User"),te())[0],I=(await De(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),i)).find(_=>_.type==="Settings")??null,{remainingAccounts:x,systemOffset:b}=c.toAccountMetas(),C=k(p,b);if(!I)throw new Error("Settings creation args is missing.");return await Ca({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:C,...I,remainingAccounts:x})}async function vV({settings:e,settingsAddressTreeIndex:n,payer:r,signers:o,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await Pe(true,e,n,false,t);if(!a)throw new Error("Proof args is missing");let s=Te(o),d=s.filter(x=>x instanceof E),u=[],g=[];for(let x of d){let b=u.length,{domainConfig:C,verifyArgs:_,signature:v,publicKey:B,message:se}=J(x,b);se&&v&&B&&u.push({message:se,signature:v,publicKey:B}),C&&(c.addPreAccounts([{address:C,role:AccountRole.READONLY}]),_.__option==="Some"&&g.push({domainConfigKey:C,verifyArgs:_.value}));}c.addPreAccounts(s.filter(x=>"address"in x).map(x=>({address:x.address,role:AccountRole.READONLY_SIGNER,signer:x})));let{remainingAccounts:p,systemOffset:f}=c.toAccountMetas(),S=k(i,f),I=[];return u.length>0&&I.push(V(u)),I.push(Xa({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:S,secp256r1VerifyArgs:g,remainingAccounts:p})),I}async function NV({authority:e,domainConfig:n,newAuthority:r,newOrigins:o}){let t=null,c=[];if(r){let i=new N;await i.addSystemAccounts();let a=await he(),{address:s,addressTree:d}=await w(r.address,a),u=[{address:s,tree:d,queue:d,type:"User"}],g=await $([],u),p=(await De(i,g.treeInfos,g.roots,g.rootIndices,u))[0],f=i.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:k(g,f.systemOffset),authorityCreationArgs:p};}return di({domainConfig:n,authority:e,newOrigins:o?some(o):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function zV({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let o=new N;await o.addSystemAccounts();let t=await ye([{address:(await w(e.address,n)).address,type:"User"}]),c=await $(t,[]),i=ae(o,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,te())[0],{remainingAccounts:a,systemOffset:s}=o.toAccountMetas(),d=k(c,s);return yi({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function e8({payer:e,user:n,userAddressTreeIndex:r,newDelegate:o,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:s,publicKey:d}=J(n),u=[];a&&s&&d&&u.push({message:a,signature:s,publicKey:d});let g=await cr(n instanceof E?n:n.address,r,t),p=[];p.push({address:(await w(n instanceof E?n:n.address,r)).address,type:"User"});let f,S=null,I,x=null,b=g.wallets.find(Ae=>Ae.isDelegate);if(b){let Ae=await Me(b.index);(await zr(Ae,b.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ue(Ae,b.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):f=await Me(b.index);}if(o){let Ae=await Me(o.index);(await zr(Ae,o.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ue(Ae,o.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):I=await Me(o.index);}let C=new N;await C.addSystemAccounts();let _=await ye(p,t),v=await $(_,[]),B=ae(C,v.treeInfos.slice(0,1),v.leafIndices.slice(0,1),v.rootIndices.slice(0,1),v.proveByIndices.slice(0,1),_.slice(0,1),te())[0],se=S?some(ae(C,v.treeInfos.slice(S.start,S.end),v.leafIndices.slice(S.start,S.end),v.rootIndices.slice(S.start,S.end),v.proveByIndices.slice(S.start,S.end),_.slice(S.start,S.end),K())[0]):none(),ee=x?some(ae(C,v.treeInfos.slice(x.start,x.end),v.leafIndices.slice(x.start,x.end),v.rootIndices.slice(x.start,x.end),v.proveByIndices.slice(x.start,x.end),_.slice(x.start,x.end),K())[0]):none(),{remainingAccounts:ie,systemOffset:le}=C.toAccountMetas(),Tt=k(v,le),Re=[];return u.length>0&&Re.push(V(u)),Re.push(Ii({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:o?some(o):none(),feePayer:e,signer:n instanceof E?void 0:n,oldSettings:f,oldSettingsMutArgs:se,newSettings:I,newSettingsMutArgs:ee,compressedProofArgs:Tt,userMutArgs:B,remainingAccounts:ie})),Re}async function l8({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:o,compressed:t=false,cachedAccounts:c}){let i=await zc(Q(),r),a=i.data.multiWalletSettings,{packedAccounts:s,proof:d,settingsMutArgs:u}=await Pe(t,a,e,false,c),{remainingAccounts:g,systemOffset:p}=s.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:I,signature:x,publicKey:b}=J(n),C=[];if(I&&x&&b&&C.push(V([{message:I,signature:x,publicKey:b}])),t){if(!o||!u)throw new Error("Payer not found or proof args is missing.");let _=k(d,p);C.push(nd({transactionBuffer:r,domainConfig:f,closer:n instanceof E?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:u,payer:o,compressedProofArgs:_,remainingAccounts:g}));}else C.push(Xi({transactionBuffer:r,domainConfig:f,closer:n instanceof E?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return C}function OA({payer:e,creator:n,bufferIndex:r,settings:o,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:p,message:f,signature:S,publicKey:I}=J(n),x=[];if(f&&S&&I&&x.push(V([{message:f,signature:S,publicKey:I}])),d){let{settingsReadonlyArgs:b,compressedProofArgs:C,remainingAccounts:_}=d;x.push(yd({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof E?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSecp256r1Signers:u},settingsReadonlyArgs:b,compressedProofArgs:C,remainingAccounts:_}));}else x.push(dd({settings:o,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof E?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSecp256r1Signers:u},remainingAccounts:[]}));return x}function BA({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:s}=J(e),d=[];return a&&i&&s&&d.push(V([{message:a,signature:i,publicKey:s}])),o?d.push(Md({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof E?void 0:e,settingsMutArgs:o.settingsMutArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(Id({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof E?void 0:e,remainingAccounts:[]})),d}function NA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:o=false}){return o?wd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):kd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function wA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:s}=J(n),d=[];return s&&i&&a&&d.push(V([{message:s,signature:i,publicKey:a}])),o?d.push(Xd({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof E?void 0:n,settingsReadonlyArgs:o.settingsReadonlyArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(Kd({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof E?void 0:n,remainingAccounts:[]})),d}async function sH({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:o,compressed:t=false}){let c=await Yh(r),i=new N,a=null,s=null,d=[];if(c.length||t){let g=await Zh({packedAccounts:i,userAccounts:c,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:o});a=g.proof,s=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await Xh({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:s,packedAccounts:i,compressed:t}}async function Yh(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}}return n}async function Zh({packedAccounts:e,userAccounts:n,compressed:r,settings:o,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let f=(await ue(o,t)).address;i.push({address:f,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await ye(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let s=await $(a,[]),d=[],u=[];for(let f of a)f.type==="Settings"?d.push(f):f.type==="User"&&u.push(f);let g,p=[];if(r&&s&&(g=ae(e,s.treeInfos.slice(0,1),s.leafIndices.slice(0,1),s.rootIndices.slice(0,1),s.proveByIndices.slice(0,1),d,K())[0]),u.length&&s){let f=r?1:0;p=ae(e,s.treeInfos.slice(f),s.leafIndices.slice(f),s.rootIndices.slice(f),s.proveByIndices.slice(f),u,te());}return {proof:s,settingsMutArgs:g,userMutArgs:p}}async function Xh({configActionsArgs:e,userMutArgs:n}){let r=[];for(let o of e)switch(o.type){case "AddMembers":{let t=[];for(let c of o.members){let i=await w(c.member,c.userAddressTreeIndex).then(a=>n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(a.address)))));if(!i)throw new Error("Unable to find user account");t.push(eM({permissionArgs:c.permissions,userMutArgs:i,pubkey:c.member}));}r.push({__kind:o.type,fields:[t]});break}case "RemoveMembers":{let t=await Promise.all(o.members.map(c=>w(c.member,c.userAddressTreeIndex).then(i=>{let a=n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(i.address))));if(!a)throw new Error("Unable to find user account");return $h({pubkey:c.member,userMutArgs:a})})));r.push({__kind:o.type,fields:[t]});break}case "EditPermissions":{let t=o.members.map(c=>Qh({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 Qh({pubkey:e,permissionArgs:n}){return {memberKey:Ee(e),permissions:GA(n)}}function $h({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:Ee(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function eM({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:Ee(e),permissions:GA(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function GA(e){let n=[];return e.initiate&&n.push(Ue.InitiateTransaction),e.vote&&n.push(Ue.VoteTransaction),e.execute&&n.push(Ue.ExecuteTransaction),Be.fromPermissions(n)}async function pH({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:p=Math.ceil(o.length/2),cachedAccounts:f}){let S=Math.floor(Math.random()*255),I=await mA(n,t instanceof E?t:t.address,S),x=[],b=[];for(let Y=0;Y<o.length;Y+=p){let dt=o.subarray(Y,Y+p);x.push(dt),b.push(sha256(dt));}let C=sha256(o),{settingsReadonlyArgs:_,settingsMutArgs:v,proof:B,packedAccounts:se}=await Pe(d,n,r,false,f),{remainingAccounts:ee,systemOffset:ie}=se.toAccountMetas(),le=B&&_&&v?{settingsReadonlyArgs:_,settingsMutArgs:v,compressedProofArgs:k(B,ie),remainingAccounts:ee,payer:e}:null,Tt=Te([t,...c?[c]:[],...u]).filter(Y=>Y instanceof E).map(Y=>({memberKey:Ee(Y),messageHash:Jo(Y.authResponse)})),Re=OA({finalBufferHash:C,finalBufferSize:o.length,bufferIndex:S,payer:e,transactionBufferAddress:I,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:b,compressedArgs:le,expectedSecp256r1Signers:Tt}),Ae=x.map(Y=>NA({transactionMessageBytes:Y,transactionBufferAddress:I,settings:n,compressed:d})),it=u.map(Y=>wA({voter:Y,transactionBufferAddress:I,settings:n,compressedArgs:le})),Xr=BA({compressedArgs:le,settings:n,executor:c,transactionBufferAddress:I}),{instructions:l,addressLookupTableAccounts:Qr}=await hA({compressed:d,settings:n,transactionMessageBytes:o,transactionBufferAddress:I,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s}),pe=Y=>({payer:e,instructions:Y,addressesByLookupTableAddress:Qr});return [pe(Re),...Ae.map(Y=>pe([Y])),...it.length?[pe(it.flat())]:[],pe(Xr),pe(l)]}var Yr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let o=new Map,t=i=>{let a=o.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},o.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let s=t(a.address);s.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,o)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),o=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),c=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+o.length,numReadonlySignerAccounts:o.length,numReadonlyNonSignerAccounts:c.length};if(r.length===0)throw new Error("Expected at least one writable signer key");let[a]=r[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let s=[...r.map(([d])=>d),...o.map(([d])=>d),...t.map(([d])=>d),...c.map(([d])=>d)];return [i,s]}extractTableLookup(n){let[r,o]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(n,r){let o=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,s=n.findIndex(d=>d===a);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),t.push(a),this.keyMetaMap.delete(c);}}return [o,t]}};var Zr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let o=new Map;this.keySegments().flat().forEach((c,i)=>{o.set(c,i);});let t=c=>{let i=o.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function KA({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:o}){let t=Yr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(o??{});for(let p of a){let f=t.extractTableLookup(p);if(f!==void 0){let{addressTableLookup:S,drainedKeys:I}=f;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),i.writable.push(...I.writable),i.readonly.push(...I.readonly);}}let[s,d]=t.getMessageComponents(),g=new Zr(d,i).compileInstructions(r);return {version:0,header:s,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function hH({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=KA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(ku(o))}async function vH({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i,cachedAccounts:a,compressed:s=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await MA({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:o,secp256r1VerifyInput:c,compressed:s,addressesByLookupTableAddress:i,simulateProof:d,cachedAccounts:a});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}export{$c as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,bu as AuthenticationContextSchema,_u as BaseResponseSchema,ma as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,ca as CHANGE_CONFIG_DISCRIMINATOR,xa as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,_a as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,La as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,wa as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Ga as CREATE_USER_ACCOUNTS_DISCRIMINATOR,WN as CompleteMessageRequestSchema,ON as CompleteSendTransactionRequestSchema,LN as CompleteTransactionRequestSchema,Ja as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,ei as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,fs as DOMAIN_CONFIG_DISCRIMINATOR,ai as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,gi as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,fi as EDIT_USER_DELEGATE_DISCRIMINATOR,Ds as GLOBAL_COUNTER_DISCRIMINATOR,Qt as KeyType,BE as MULTI_WALLET_ERROR__ALREADY_DELEGATED,pE as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,bD as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,nD as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,sD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,cD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,MD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,ND as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,lE as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,yE as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,ME as MULTI_WALLET_ERROR__EMPTY_MEMBERS,gD as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,DE as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,mE as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,CE as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,jE as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,qE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,JE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,AD as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,VE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,NE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,wE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,UE as MULTI_WALLET_ERROR__INVALID_ACCOUNT,hD as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,dD as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,PE as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,WE as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,KE as MULTI_WALLET_ERROR__INVALID_BUFFER,pD as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,HE as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,vE as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,SE as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,aE as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,uE as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,cE as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,dE as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,rD as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,eD as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,bE as MULTI_WALLET_ERROR__INVALID_THRESHOLD,ED as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,EE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,IE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,_E as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,UD as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,kE as MULTI_WALLET_ERROR__INVALID_USER_ROLE,vD as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,CD as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,AE as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,QE as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,aD as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,lD as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,PD as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,LE as MULTI_WALLET_ERROR__MISSING_ACCOUNT,mD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,SD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,kD as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,ID as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,yD as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,OE as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,OD as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,LD as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,uD as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,WD as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,xD as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,$E as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,RD as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,BD as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,GE as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,hE as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,fE as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,xE as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,iD as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,fD as MULTI_WALLET_ERROR__PAYER_MISMATCH,TE as MULTI_WALLET_ERROR__PERMANENT_MEMBER,XE as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,gE as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,TD as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,iE as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,tD as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,DD as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,RE as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,YE as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,ZE as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,oD as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,zE as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,_D as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,FE as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,nE as MultiWalletAccount,oE as MultiWalletInstruction,Ri as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Ei as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Ue as Permission,Be as Permissions,Lc as SETTINGS_DISCRIMINATOR,Ne as Secp256r1Key,E as SignedSecp256r1Key,Mu as StartMessageRequestSchema,Ru as StartTransactionRequestSchema,Gi as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Li as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,ed as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,Ji as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,gd as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,cd as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Hc as TRANSACTION_BUFFER_DISCRIMINATOR,Dd as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,fd as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Od as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,_d as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Jd as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Fd as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,cu as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,eu as TRANSACTION_EXECUTE_DISCRIMINATOR,fu as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,gu as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,hu as TransactionActionTypeSchema,VD as TransactionDetailsSchema,kN as TransactionPayloadSchema,wD as TransactionPayloadWithBase64MessageBytesSchema,lo as Transports,Oe as UserRole,qc as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,PN as addWhitelistedAddressTrees,xe as base64URLStringToBuffer,Mw as bufferToBase64URLString,dV as changeConfig,l8 as closeTransactionBuffer,iR as configAction,_w as convertBase64StringToJWK,bw as convertJWKToBase64String,fA as convertMemberKeyToString,Iw as convertPubkeyCompressedToCose,xw as convertPubkeyCoseToCompressed,Dw as createClientAuthorizationCompleteRequestChallenge,Ew as createClientAuthorizationStartRequestChallenge,O6 as createDomainConfig,q6 as createDomainUserAccounts,X6 as createGlobalCounter,Pw as createMessageChallenge,OA as createTransactionBuffer,hw as createTransactionChallenge,lh as createTransactionManagerSigner,lV as createUserAccounts,EV as createWallet,xs as decodeDomainConfig,hs as decodeGlobalCounter,Oc as decodeSettings,Gc as decodeTransactionBuffer,Yc as decodeWhitelistedAddressTree,vV as decompressSettingsAccount,x6 as deserializeConfigActions,t5 as disableDomainConfig,NV as editDomainConfig,zV as editTransactionManagerUrl,e8 as editUserDelegate,hA as executeTransaction,BA as executeTransactionBuffer,MA as executeTransactionSync,NA as extendTransactionBuffer,hR as extensionStruct,sM as fetchAllDomainConfig,gM as fetchAllGlobalCounter,gg as fetchAllMaybeDomainConfig,Rg as fetchAllMaybeGlobalCounter,u1 as fetchAllMaybeSettings,_1 as fetchAllMaybeTransactionBuffer,Z1 as fetchAllMaybeWhitelistedAddressTree,zv as fetchAllSettings,D2 as fetchAllSettingsAccountByMember,Zv as fetchAllTransactionBuffer,tU as fetchAllWhitelistedAddressTree,Is as fetchDomainConfig,AM as fetchGlobalCounter,Ag as fetchMaybeDomainConfig,Mg as fetchMaybeGlobalCounter,To as fetchMaybeSettings,jP as fetchMaybeSettingsAccountData,b1 as fetchMaybeTransactionBuffer,KP as fetchMaybeUserAccountData,Y1 as fetchMaybeWhitelistedAddressTree,Gv as fetchSettings,zr as fetchSettingsAccountData,zc as fetchTransactionBuffer,E2 as fetchUserAccountByFilters,cr as fetchUserAccountData,Zc as fetchWhitelistedAddressTree,xM as getAddMemberArgsCodec,nn as getAddMemberArgsDecoder,rn as getAddMemberArgsEncoder,fU as getAddWhitelistedAddressTreesDiscriminatorBytes,xU as getAddWhitelistedAddressTreesInstruction,ta as getAddWhitelistedAddressTreesInstructionAsync,SU as getAddWhitelistedAddressTreesInstructionDataCodec,ea as getAddWhitelistedAddressTreesInstructionDataDecoder,Po as getAddWhitelistedAddressTreesInstructionDataEncoder,lM as getAdditionalMetadataCodec,tn as getAdditionalMetadataDecoder,en as getAdditionalMetadataEncoder,BU as getChangeConfigCompressedDiscriminatorBytes,Ta as getChangeConfigCompressedInstruction,NU as getChangeConfigCompressedInstructionDataCodec,la as getChangeConfigCompressedInstructionDataDecoder,ya as getChangeConfigCompressedInstructionDataEncoder,RU as getChangeConfigDiscriminatorBytes,da as getChangeConfigInstruction,bU as getChangeConfigInstructionDataCodec,ia as getChangeConfigInstructionDataDecoder,aa as getChangeConfigInstructionDataEncoder,qo as getClientAndDeviceHash,EM as getCompiledInstructionCodec,sn as getCompiledInstructionDecoder,on as getCompiledInstructionEncoder,MM as getCompressedAccountMetaCodec,It as getCompressedAccountMetaDecoder,xt as getCompressedAccountMetaEncoder,vM as getCompressedAccountMetaReadOnlyCodec,Pt as getCompressedAccountMetaReadOnlyDecoder,Dt as getCompressedAccountMetaReadOnlyEncoder,WM as getCompressedOnlyExtensionCodec,an as getCompressedOnlyExtensionDecoder,cn as getCompressedOnlyExtensionEncoder,BM as getCompressedProofCodec,mn as getCompressedProofDecoder,pn as getCompressedProofEncoder,ue as getCompressedSettingsAddress,HM as getCompressedSettingsCodec,KM as getCompressedSettingsDataCodec,ln as getCompressedSettingsDataDecoder,yn as getCompressedSettingsDataEncoder,K as getCompressedSettingsDecoder,ht as getCompressedSettingsEncoder,YM as getCompressedTokenArgsCodec,_t as getCompressedTokenArgsDecoder,bt as getCompressedTokenArgsEncoder,$M as getCompressibleExtensionCodec,En as getCompressibleExtensionDecoder,Cn as getCompressibleExtensionEncoder,nR as getCompressionInfoCodec,Pn as getCompressionInfoDecoder,Dn as getCompressionInfoEncoder,aR as getConfigActionCodec,je as getConfigActionDecoder,Ke as getConfigActionEncoder,jU as getCreateCompressedWalletDiscriminatorBytes,JU as getCreateCompressedWalletInstruction,Ca as getCreateCompressedWalletInstructionAsync,qU as getCreateCompressedWalletInstructionDataCodec,Ia as getCreateCompressedWalletInstructionDataDecoder,ho as getCreateCompressedWalletInstructionDataEncoder,rk as getCreateDomainConfigDiscriminatorBytes,ok as getCreateDomainConfigInstruction,Ua as getCreateDomainConfigInstructionAsync,nk as getCreateDomainConfigInstructionDataCodec,va as getCreateDomainConfigInstructionDataDecoder,Ro as getCreateDomainConfigInstructionDataEncoder,gk as getCreateDomainUserAccountDiscriminatorBytes,mk as getCreateDomainUserAccountInstruction,Ba as getCreateDomainUserAccountInstructionAsync,pk as getCreateDomainUserAccountInstructionDataCodec,Oa as getCreateDomainUserAccountInstructionDataDecoder,bo as getCreateDomainUserAccountInstructionDataEncoder,Ik as getCreateGlobalCounterDiscriminatorBytes,Ek as getCreateGlobalCounterInstruction,Ha as getCreateGlobalCounterInstructionAsync,Ck as getCreateGlobalCounterInstructionDataCodec,Va as getCreateGlobalCounterInstructionDataDecoder,vo as getCreateGlobalCounterInstructionDataEncoder,pR as getCreateUserAccountArgsCodec,Bn as getCreateUserAccountArgsDecoder,On as getCreateUserAccountArgsEncoder,vk as getCreateUserAccountsDiscriminatorBytes,kk as getCreateUserAccountsInstruction,Ka as getCreateUserAccountsInstructionAsync,Uk as getCreateUserAccountsInstructionDataCodec,za as getCreateUserAccountsInstructionDataDecoder,ko as getCreateUserAccountsInstructionDataEncoder,Hk as getDecompressSettingsAccountDiscriminatorBytes,Xa as getDecompressSettingsAccountInstruction,Fk as getDecompressSettingsAccountInstructionDataCodec,Za as getDecompressSettingsAccountInstructionDataDecoder,Ya as getDecompressSettingsAccountInstructionDataEncoder,Yk as getDisableDomainConfigDiscriminatorBytes,ni as getDisableDomainConfigInstruction,Zk as getDisableDomainConfigInstructionDataCodec,ri as getDisableDomainConfigInstructionDataDecoder,ti as getDisableDomainConfigInstructionDataEncoder,gt as getDomainConfigAddress,oM as getDomainConfigCodec,Ss as getDomainConfigDecoder,nM as getDomainConfigDiscriminatorBytes,ug as getDomainConfigEncoder,cM as getDomainConfigSize,oW as getEditDomainConfigDiscriminatorBytes,di as getEditDomainConfigInstruction,cW as getEditDomainConfigInstructionAsync,sW as getEditDomainConfigInstructionDataCodec,ii as getEditDomainConfigInstructionDataDecoder,Lo as getEditDomainConfigInstructionDataEncoder,TR as getEditMemberArgsCodec,kn as getEditMemberArgsDecoder,Un as getEditMemberArgsEncoder,mW as getEditTransactionManagerUrlDiscriminatorBytes,yi as getEditTransactionManagerUrlInstruction,yW as getEditTransactionManagerUrlInstructionDataCodec,mi as getEditTransactionManagerUrlInstructionDataDecoder,pi as getEditTransactionManagerUrlInstructionDataEncoder,EW as getEditUserDelegateDiscriminatorBytes,Ii as getEditUserDelegateInstruction,DW as getEditUserDelegateInstructionDataCodec,xi as getEditUserDelegateInstructionDataDecoder,Si as getEditUserDelegateInstructionDataEncoder,IR as getExpectedSecp256r1SignersCodec,kt as getExpectedSecp256r1SignersDecoder,Ut as getExpectedSecp256r1SignersEncoder,PR as getExtensionStructCodec,vt as getExtensionStructDecoder,Tn as getExtensionStructEncoder,pA as getGlobalCounterAddress,uM as getGlobalCounterCodec,Ps as getGlobalCounterDecoder,dM as getGlobalCounterDiscriminatorBytes,hg as getGlobalCounterEncoder,pM as getGlobalCounterSize,jo as getJitoTipsConfig,N2 as getLightCpiSigner,Ve as getLightProtocolRpc,vR as getLinkWalletArgsCodec,Yn as getLinkWalletArgsDecoder,Jn as getLinkWalletArgsEncoder,LR as getMemberCodec,Rt as getMemberDecoder,Mt as getMemberEncoder,NR as getMemberKeyCodec,oe as getMemberKeyDecoder,H as getMemberKeyEncoder,pN as getMultiWalletErrorMessage,FW as getNativeTransferIntentCompressedDiscriminatorBytes,vi as getNativeTransferIntentCompressedInstruction,GW as getNativeTransferIntentCompressedInstructionDataCodec,_i as getNativeTransferIntentCompressedInstructionDataDecoder,bi as getNativeTransferIntentCompressedInstructionDataEncoder,UW as getNativeTransferIntentDiscriminatorBytes,Pi as getNativeTransferIntentInstruction,WW as getNativeTransferIntentInstructionAsync,kW as getNativeTransferIntentInstructionDataCodec,Di as getNativeTransferIntentInstructionDataDecoder,Oo as getNativeTransferIntentInstructionDataEncoder,FR as getNewAuthorityArgsCodec,$n as getNewAuthorityArgsDecoder,Qn as getNewAuthorityArgsEncoder,Rw as getOriginIndex,KR as getPackedAddressTreeInfoCodec,Bt as getPackedAddressTreeInfoDecoder,Ot as getPackedAddressTreeInfoEncoder,JR as getPackedMerkleContextCodec,Sn as getPackedMerkleContextDecoder,fn as getPackedMerkleContextEncoder,XR as getPackedStateTreeInfoCodec,Et as getPackedStateTreeInfoDecoder,Ct as getPackedStateTreeInfoEncoder,eb as getPausableAccountExtensionCodec,wn as getPausableAccountExtensionDecoder,Nn as getPausableAccountExtensionEncoder,nb as getPermanentDelegateAccountExtensionCodec,Hn as getPermanentDelegateAccountExtensionDecoder,Vn as getPermanentDelegateAccountExtensionEncoder,cb as getPermissionsCodec,Fe as getPermissionsDecoder,He as getPermissionsEncoder,ub as getProofArgsCodec,P as getProofArgsDecoder,D as getProofArgsEncoder,mb as getRemoveMemberArgsCodec,Ln as getRemoveMemberArgsDecoder,Wn as getRemoveMemberArgsEncoder,Tb as getRentConfigCodec,bn as getRentConfigDecoder,Rn as getRentConfigEncoder,Jo as getSecp256r1MessageHash,xb as getSecp256r1PubkeyCodec,Nt as getSecp256r1PubkeyDecoder,ro as getSecp256r1PubkeyEncoder,_h as getSecp256r1SignatureOffsetsDataDecoder,bh as getSecp256r1SignatureOffsetsDataEncoder,Eb as getSecp256r1VerifyArgsCodec,G as getSecp256r1VerifyArgsDecoder,F as getSecp256r1VerifyArgsEncoder,Mb as getSecp256r1VerifyArgsWithDomainAddressCodec,X as getSecp256r1VerifyArgsWithDomainAddressDecoder,Z as getSecp256r1VerifyArgsWithDomainAddressEncoder,V as getSecp256r1VerifyInstruction,m5 as getSecp256r1VerifyInstructionDataCodec,DA as getSecp256r1VerifyInstructionDataDecoder,PA as getSecp256r1VerifyInstructionDataEncoder,Ou as getSendAndConfirmTransaction,Fv as getSettingsCodec,hr as getSettingsDecoder,Hv as getSettingsDiscriminatorBytes,d1 as getSettingsEncoder,Me as getSettingsFromIndex,kb as getSettingsIndexWithAddressAndDelegateInfoCodec,co as getSettingsIndexWithAddressAndDelegateInfoDecoder,so as getSettingsIndexWithAddressAndDelegateInfoEncoder,_b as getSettingsIndexWithAddressCodec,oo as getSettingsIndexWithAddressDecoder,no as getSettingsIndexWithAddressEncoder,Bb as getSettingsMutArgsCodec,q as getSettingsMutArgsDecoder,j as getSettingsMutArgsEncoder,Hb as getSettingsReadonlyArgsCodec,Vt as getSettingsReadonlyArgsDecoder,wt as getSettingsReadonlyArgsEncoder,Cw as getSignedSecp256r1Key,f6 as getSignedTransactionManager,Q as getSolanaRpc,Lu as getSolanaRpcEndpoint,zb as getSplInterfacePdaArgsCodec,Ft as getSplInterfacePdaArgsDecoder,Ht as getSplInterfacePdaArgsEncoder,Jb as getTokenMetadataCodec,Gn as getTokenMetadataDecoder,Fn as getTokenMetadataEncoder,aL as getTokenTransferIntentCompressedDiscriminatorBytes,Ki as getTokenTransferIntentCompressedInstruction,dL as getTokenTransferIntentCompressedInstructionAsync,iL as getTokenTransferIntentCompressedInstructionDataCodec,zi as getTokenTransferIntentCompressedInstructionDataDecoder,Vo as getTokenTransferIntentCompressedInstructionDataEncoder,XW as getTokenTransferIntentDiscriminatorBytes,Bi as getTokenTransferIntentInstruction,$W as getTokenTransferIntentInstructionAsync,QW as getTokenTransferIntentInstructionDataCodec,Oi as getTokenTransferIntentInstructionDataDecoder,wo as getTokenTransferIntentInstructionDataEncoder,mA as getTransactionBufferAddress,hL as getTransactionBufferCloseCompressedDiscriminatorBytes,nd as getTransactionBufferCloseCompressedInstruction,ML as getTransactionBufferCloseCompressedInstructionDataCodec,rd as getTransactionBufferCloseCompressedInstructionDataDecoder,td as getTransactionBufferCloseCompressedInstructionDataEncoder,TL as getTransactionBufferCloseDiscriminatorBytes,Xi as getTransactionBufferCloseInstruction,fL as getTransactionBufferCloseInstructionDataCodec,Zi as getTransactionBufferCloseInstructionDataDecoder,Yi as getTransactionBufferCloseInstructionDataEncoder,Yv as getTransactionBufferCodec,Qb as getTransactionBufferCreateArgsCodec,zt as getTransactionBufferCreateArgsDecoder,Gt as getTransactionBufferCreateArgsEncoder,zL as getTransactionBufferCreateCompressedDiscriminatorBytes,yd as getTransactionBufferCreateCompressedInstruction,KL as getTransactionBufferCreateCompressedInstructionDataCodec,md as getTransactionBufferCreateCompressedInstructionDataDecoder,pd as getTransactionBufferCreateCompressedInstructionDataEncoder,LL as getTransactionBufferCreateDiscriminatorBytes,dd as getTransactionBufferCreateInstruction,OL as getTransactionBufferCreateInstructionDataCodec,id as getTransactionBufferCreateInstructionDataDecoder,ad as getTransactionBufferCreateInstructionDataEncoder,Fc as getTransactionBufferDecoder,Jv as getTransactionBufferDiscriminatorBytes,R1 as getTransactionBufferEncoder,iO as getTransactionBufferExecuteCompressedDiscriminatorBytes,Md as getTransactionBufferExecuteCompressedInstruction,dO as getTransactionBufferExecuteCompressedInstructionDataCodec,hd as getTransactionBufferExecuteCompressedInstructionDataDecoder,Pd as getTransactionBufferExecuteCompressedInstructionDataEncoder,$L as getTransactionBufferExecuteDiscriminatorBytes,Id as getTransactionBufferExecuteInstruction,eO as getTransactionBufferExecuteInstructionDataCodec,xd as getTransactionBufferExecuteInstructionDataDecoder,Sd as getTransactionBufferExecuteInstructionDataEncoder,DO as getTransactionBufferExtendCompressedDiscriminatorBytes,wd as getTransactionBufferExtendCompressedInstruction,PO as getTransactionBufferExtendCompressedInstructionDataCodec,Nd as getTransactionBufferExtendCompressedInstructionDataDecoder,Bd as getTransactionBufferExtendCompressedInstructionDataEncoder,lO as getTransactionBufferExtendDiscriminatorBytes,kd as getTransactionBufferExtendInstruction,TO as getTransactionBufferExtendInstructionDataCodec,Ud as getTransactionBufferExtendInstructionDataDecoder,vd as getTransactionBufferExtendInstructionDataEncoder,FO as getTransactionBufferVoteCompressedDiscriminatorBytes,Xd as getTransactionBufferVoteCompressedInstruction,GO as getTransactionBufferVoteCompressedInstructionDataCodec,Zd as getTransactionBufferVoteCompressedInstructionDataDecoder,Yd as getTransactionBufferVoteCompressedInstructionDataEncoder,kO as getTransactionBufferVoteDiscriminatorBytes,Kd as getTransactionBufferVoteInstruction,WO as getTransactionBufferVoteInstructionDataCodec,zd as getTransactionBufferVoteInstructionDataDecoder,Gd as getTransactionBufferVoteInstructionDataEncoder,oB as getTransactionExecuteCompressedDiscriminatorBytes,du as getTransactionExecuteCompressedInstruction,sB as getTransactionExecuteCompressedInstructionDataCodec,iu as getTransactionExecuteCompressedInstructionDataDecoder,au as getTransactionExecuteCompressedInstructionDataEncoder,ZO as getTransactionExecuteDiscriminatorBytes,nu as getTransactionExecuteInstruction,XO as getTransactionExecuteInstructionDataCodec,ru as getTransactionExecuteInstructionDataDecoder,tu as getTransactionExecuteInstructionDataEncoder,CB as getTransactionExecuteSyncCompressedDiscriminatorBytes,Iu as getTransactionExecuteSyncCompressedInstruction,EB as getTransactionExecuteSyncCompressedInstructionDataCodec,xu as getTransactionExecuteSyncCompressedInstructionDataDecoder,Su as getTransactionExecuteSyncCompressedInstructionDataEncoder,pB as getTransactionExecuteSyncDiscriminatorBytes,yu as getTransactionExecuteSyncInstruction,mB as getTransactionExecuteSyncInstructionDataCodec,mu as getTransactionExecuteSyncInstructionDataDecoder,pu as getTransactionExecuteSyncInstructionDataEncoder,s_ as getTransactionMessageAddressTableLookupCodec,yo as getTransactionMessageAddressTableLookupDecoder,mo as getTransactionMessageAddressTableLookupEncoder,r_ as getTransactionMessageCodec,jt as getTransactionMessageDecoder,Kt as getTransactionMessageEncoder,i_ as getTransferFeeAccountExtensionCodec,Kn as getTransferFeeAccountExtensionDecoder,zn as getTransferFeeAccountExtensionEncoder,A_ as getTransferHookAccountExtensionCodec,qn as getTransferHookAccountExtensionDecoder,jn as getTransferHookAccountExtensionEncoder,m_ as getTransportsCodec,Jt as getTransportsDecoder,qt as getTransportsEncoder,w as getUserAccountAddress,f_ as getUserCodec,C_ as getUserCreationArgsCodec,_e as getUserCreationArgsDecoder,be as getUserCreationArgsEncoder,te as getUserDecoder,Yt as getUserEncoder,h_ as getUserMutArgsCodec,et as getUserMutArgsDecoder,$e as getUserMutArgsEncoder,__ as getUserReadOnlyArgsCodec,Lt as getUserReadOnlyArgsDecoder,Wt as getUserReadOnlyArgsEncoder,W_ as getUserReadOnlyOrMutateArgsCodec,ze as getUserReadOnlyOrMutateArgsDecoder,Ge as getUserReadOnlyOrMutateArgsEncoder,w_ as getUserRoleCodec,Je as getUserRoleDecoder,qe as getUserRoleEncoder,B2 as getWalletAddressFromIndex,ke as getWalletAddressFromSettings,eU as getWhitelistedAddressTreeCodec,Jc as getWhitelistedAddressTreeDecoder,$v as getWhitelistedAddressTreeDiscriminatorBytes,J1 as getWhitelistedAddressTreeEncoder,es as getWhitelistedAddressTreeFromIndex,P2 as getWhitelistedAddressTreeIndexFromAddress,iA as getWhitelistedAddressTreesAddress,cN as identifyMultiWalletAccount,aN as identifyMultiWalletInstruction,sw as initialize,dR as isConfigAction,MR as isExtensionStruct,mN as isMultiWalletError,O_ as isUserReadOnlyOrMutateArgs,w5 as nativeTransferIntent,IU as parseAddWhitelistedAddressTreesInstruction,wU as parseChangeConfigCompressedInstruction,_U as parseChangeConfigInstruction,YU as parseCreateCompressedWalletInstruction,sk as parseCreateDomainConfigInstruction,yk as parseCreateDomainUserAccountInstruction,Dk as parseCreateGlobalCounterInstruction,Wk as parseCreateUserAccountsInstruction,Gk as parseDecompressSettingsAccountInstruction,Xk as parseDisableDomainConfigInstruction,aW as parseEditDomainConfigInstruction,lW as parseEditTransactionManagerUrlInstruction,PW as parseEditUserDelegateInstruction,zW as parseNativeTransferIntentCompressedInstruction,LW as parseNativeTransferIntentInstruction,y5 as parseSecp256r1VerifyInstruction,uL as parseTokenTransferIntentCompressedInstruction,eL as parseTokenTransferIntentInstruction,RL as parseTransactionBufferCloseCompressedInstruction,SL as parseTransactionBufferCloseInstruction,jL as parseTransactionBufferCreateCompressedInstruction,BL as parseTransactionBufferCreateInstruction,uO as parseTransactionBufferExecuteCompressedInstruction,tO as parseTransactionBufferExecuteInstruction,hO as parseTransactionBufferExtendCompressedInstruction,fO as parseTransactionBufferExtendInstruction,zO as parseTransactionBufferVoteCompressedInstruction,LO as parseTransactionBufferVoteInstruction,cB as parseTransactionExecuteCompressedInstruction,QO as parseTransactionExecuteInstruction,DB as parseTransactionExecuteSyncCompressedInstruction,yB as parseTransactionExecuteSyncInstruction,Y2 as pollJitoBundleConfirmation,sH as prepareChangeConfigArgs,pH as prepareTransactionBundle,hH as prepareTransactionMessage,vH as prepareTransactionSync,T6 as retrieveTransactionManager,$P as sendJitoBundle,S6 as serializeConfigActions,J2 as signAndSendBundledTransactions,r6 as signAndSendTransaction,Q5 as tokenTransferIntent,L_ as userReadOnlyOrMutateArgs,Wu as vaultTransactionMessageDeserialize,ku as vaultTransactionMessageSerialize,wA as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
3
|
+
`);throw new Error(t)}return o.value.unitsConsumed}async function sA(e,n){let o=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===AccountRole.WRITABLE||c.role===AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));o.sort((c,i)=>c-i);let t=Math.floor(o.length/2);return o.length%2===0?Math.round((o[t-1]+o[t])/2):o[t]}async function cA(e,n){or(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new z(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await pt(()=>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 $t(r,n);let o=await er(r);if(!o.result||o.error)throw new me(`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 me(`Simulation failed: ${c}`)}return o.result.value.transactionResults.map(t=>t.unitsConsumed)}function J(e,n=0){let r=e instanceof E?e:void 0,o=r?.verifyArgs&&n!==-1?some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs.clientDataJson?Vr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:o,signature:c,message:i,publicKey:a}}function Ee(e){if(e instanceof Ne)return {keyType:Qt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Qt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function eA(e){return e instanceof E?e.toString():e.address.toString()}function Te(e){let n=new Set,r=[];for(let t of e)n.has(eA(t))||(r.push(t),n.add(eA(t)));let o=r.filter(t=>t instanceof E);if(o.length>1)throw new z(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return r}function aA({payer:e,tipAmount:n}){let r=Go[Math.floor(Math.random()*Go.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function iA(e){return typeof e=="string"?e:e.toString()}function dA(e){return e.toString()}async function Xo(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 Qo=[{tree:new PublicKey(batchMerkleTree1),queue:new PublicKey(batchQueue1),cpiContext:new PublicKey(batchCpiContext1),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree2),queue:new PublicKey(batchQueue2),cpiContext:new PublicKey(batchCpiContext2),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree3),queue:new PublicKey(batchQueue3),cpiContext:new PublicKey(batchCpiContext3),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree4),queue:new PublicKey(batchQueue4),cpiContext:new PublicKey(batchCpiContext4),nextTreeInfo:null,treeType:TreeType.StateV2},{tree:new PublicKey(batchMerkleTree5),queue:new PublicKey(batchQueue5),cpiContext:new PublicKey(batchCpiContext5),nextTreeInfo:null,treeType:TreeType.StateV2}],N=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:r?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(A.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let o=this.nextIndex++,t={address:address(n),role:r};this.map.set(n,{index:o,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=selectStateTreeInfo(Qo);return this.packOutputTreeIndex(n)}packTreeInfos(n,r){let o=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());o.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let s=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(s);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:o.length>0?{packedTreeInfos:o,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,o)=>r[1].index-o[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,o]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:o}}};async function Fr(e,n){let r=iA(e);return Xo(n,r,()=>gA(e))}async function ot(e,n){let r=dA(e);return Xo(n,r,()=>Q().getAccountInfo(e,{encoding:"base64"}).send())}async function le(e,n){let r=(await Promise.all(e.map(o=>Fr(o.address,n)))).filter(o=>o!==null).filter(o=>o.data!==null&&o.address!==null);if(r.length!==e.length)throw new re("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((o,t)=>({...o,type:e[t].type,tree:o.treeInfo.tree,queue:o.treeInfo.queue}))}function k(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function De(e,n,r,o,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:o[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function ae(e,n,r,o,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:o[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let s=e.packTreeInfos(a,[]).stateTrees;if(!s)throw new z("Unable to parse state tree data");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:s.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:s.outputTreeIndex}}))}async function Pe(e,n,r,o,t){let c=null,i=null,a=null,s=new N;if(e){await s.addSystemAccounts();let{address:d}=await ue(n,r),u=(await le([{address:d,type:"Settings"}],t))[0];o?a={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:a=await $([u],[]);let g=s.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!g)throw new z("Unable to parse state tree data");c={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0]},data:K().decode(u.data?.data)},i={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:K().decode(u.data?.data)};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:s,settingsMutArgs:i}}async function $(e,n){return nr(()=>Ve().getValidityProofV0(e,n))}async function he(){return (await Gr()).length-1}var $o;async function Gr(){if(!$o){let{data:e}=await Xc(Q(),await pA());$o=e.whitelistedAddressTrees;}return $o}function AA(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 cr(e,n,r){let o=await ph(e,n,r);if(!o)throw new re("User account");return o}async function ph(e,n,r){let{address:o}=await w(e,n),t=await Fr(o,r);return t?.data?.data?te().decode(t.data.data):null}async function Y2(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(Ee(n)))}});else if(r)o.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(xe(r))}});else return null;let t=await Ve().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:o});return t.items.filter(c=>!!c.data).length?t.items.map(c=>te().decode(c.data?.data))[0]:null}async function zr(e,n,r){let o=await mh(e,n,r);if(!o)throw new re("Settings account");return o}async function mh(e,n,r){try{let{address:o}=await ue(e,n),t=await Fr(o,r);if(!t?.data?.data)throw new re("Compressed settings account");let c=K().decode(t.data.data);if(c.data.__option==="None")throw new re("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let o=await To(Q(),e);return o.exists?{...o.data,isCompressed:false}:null}}async function Z2(e,n,r){let o=await cr(e,n,r);if(o.role===1||o.role===0){let t=[],[c,i]=await Promise.all([Ve().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:getBase58Decoder().decode(H().encode(Ee(e)))}}]}),Q().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(H().encode(Ee(e)))}}]}).send()]);return c.items.forEach(a=>{if(a.data?.data){let s=K().decode(a.data.data);s.data.__option==="Some"&&t.push({...s.data.value,isCompressed:true});}}),i.forEach(a=>{let s=hr().decode(getBase64Encoder().encode(a.account.data[0]));t.push({...s,isCompressed:false});}),t}else return await Promise.all(o.wallets.map(async t=>zr(await Me(t.index),t.settingsAddressTreeIndex,r)))}async function ts(e){Xu(e,"index");let n=await Gr();if(e>=n.length)throw new z(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function X2(e){let r=(await Gr()).findIndex(o=>o.toString()===e);if(r===-1)throw new re("Address tree",`Address ${e} not found in whitelist`);return r}async function gA(e,n){if(!n&&!e)throw new Error("Either hash or address must be provided");if(n&&e)throw new Error("Only one of hash or address must be provided");let r=await rpcRequest(Ve().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(Qo,t),i=o.result.value;return createCompressedAccountWithMerkleContextLegacy(createMerkleContextLegacy(c,i.hash,i.leafIndex),i.owner,bn$1(i.lamports),i.data?parseAccountData(i.data):void 0,i.address||void 0)}async function ue(e,n=0){let r=await ts(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(o,new PublicKey(r),new PublicKey(A)).toString(),"base58"),addressTree:new PublicKey(r)}}async function w(e,n=0){let r=await ts(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("user"),e instanceof Ne?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 gt({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(getUtf8Encoder().encode(n));else throw new z("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function EA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function pA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function DA(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 Ne?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return o}async function ke(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function Me(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function d6(e){let n=await Me(e);return await ke(n)}async function u6(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function x6(e){or(e,"bundle");let n=await Zo(e,true),r=await cA(n.map(getBase64EncodedWireTransaction),Ou()),o=await Zo(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await Ih(o.map(getBase64EncodedWireTransaction))}async function Ih(e,n=jo(),r){or(e,"serializedTransactions");let{blockEngineUrl:o}=n,t=`${o}/bundles`,c=await pt(()=>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 $t(c,t);let i=await er(c);if(i.error)throw new me(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new me("No bundle ID returned from Jito");return i.result}async function I6(e,n=30,r=3e3,o=jo()){Qu(e,"bundleId");let{blockEngineUrl:t}=o,c=`${t}/getBundleStatuses`;return nr(async()=>{let i=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await $t(i,c);let a=await er(i);if(a.error)throw new me(`Error getting bundle status: ${JSON.stringify(a.error,null,2)}`,e);if(!a.result?.value?.length)throw new me("Bundle not yet confirmed",e);let s=a.result.value[0];if(s.confirmation_status==="confirmed"||s.confirmation_status==="finalized"){let d=s.transactions[s.transactions.length-1];if(!d)throw new me("No transactions in confirmed bundle",e);return d}throw new me(`Bundle status: ${s.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:Yu(me,Ce)})}async function R6({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=await Q().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(e,c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(o.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([oA(c),sA(Q(),c.instructions.flatMap(d=>d.accounts??[]))]),s=Math.ceil((Number(i)??0)*1.1);return prependTransactionMessageInstructions([...s>2e5?[getSetComputeUnitLimitInstruction({units:s})]:[],...a>0?[getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await Bu()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function G6(e,n){if(n.threshold>1)throw new z("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(s=>RA(s.pubkey)===e);if(!r)throw new re("Member",`Signer ${e} not found in settings`);let{permissions:o}=r;if(!o)throw new re("Permissions","No permissions found for the current member");let t=Be.has(o,Ue.InitiateTransaction),c=Be.has(o,Ue.VoteTransaction),i=Be.has(o,Ue.ExecuteTransaction);if(t&&c&&i)return {};if(!c||!i)throw new Br("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(s=>s.role===0);if(!a)throw new re("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(RA(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function z6({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:o,cachedAccounts:t}){if(!n)return null;let c=await cr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new re("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return Nh(n,c.transactionManagerUrl.value,e,o)}function Nh(e,n,r,o){return {address:e,async signTransactions(t){let c=await pt(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:e.toString(),payload:t.map(a=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(a)),transactionMessageBytes:o?getBase64Decoder().decode(o):void 0,authResponses:r}))})}));if(!c.ok)throw new Ce(`Transaction manager request failed: ${c.statusText}`,c.status,n);let i=await c.json();if("error"in i)throw new Ce(`Transaction manager error: ${i.error}`,c.status,n);return i.signatures.map(a=>({[e]:getBase58Encoder().encode(a)}))}}}function RA(e){return e.keyType===Qt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function K6(e){let n=e.map(c=>Ke().encode(c)),r=4+n.reduce((c,i)=>c+i.length,0),o=new Uint8Array(r),t=0;o.set(getU32Encoder().encode(e.length),t),t+=4;for(let c of n)o.set(c,t),t+=c.length;return o}function j6(e){let n=0,[r,o]=getU32Decoder().read(e,n);n=o;let t=new Array(r);for(let c=0;c<r;c++){let i=je().read(e,n);t[c]=i[0],n=i[1];}if(n!==e.length)throw new z(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function i5({payer:e,rpId:n,origins:r,authority:o}){let t=await gt({rpId:n}),c=new N;await c.addSystemAccounts();let i=await he(),{address:a,addressTree:s}=await w(o.address,i),d=[{address:a,tree:s,queue:s,type:"User"}],u=await $([],d),g=(await De(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:f}=c.toAccountMetas(),S=k(u,f);return await ka({origins:r,authorityCreationArgs:g,authority:o,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function S5({authority:e,payer:n,createUserArgs:r,domainConfig:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[];r.settings&&(i.push({address:(await ue(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 le(i,t):[],s=await he(),{address:d,addressTree:u}=await w(r.member,s),g=[{address:d,type:"User",tree:u,queue:u}],p=await $(a,g),f=null,S=null,I=a.filter(B=>B.type==="Settings"),x=a.filter(B=>B.type==="User");I.length&&(f=ae(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),I,K())[0]),x.length&&(S=ae(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,te())[0]);let b=await De(c,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),g),{remainingAccounts:C,systemOffset:_}=c.toAccountMetas(),v=k(p,_);return await Na({payer:n,authority:e,compressedProofArgs:v,member:Nt().decode(r.member.toBuffer()),credentialId:xe(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:C})}async function E5({payer:e}){let n=await EA();return Fa({payer:e,globalCounter:n})}async function M5({admin:e,rpId:n,disable:r}){let o=await gt({rpId:n});return oi({domainConfig:o,admin:e,disable:r,remainingAccounts:[]})}function Vh(e,n,r,o){let t=Hh(e,n),c=Fh(e,n)&&r!==o;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function Hh(e,n){let r=e.staticAccounts.length,{numSignerAccounts:o,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=o-t,a=r-o-c;return n>=r?false:n<i?true:n>=o?n-o<a:false}function Fh(e,n){return n<e.header.numSignerAccounts}async function Kr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:o}){let t=Lu(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),Q()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,s]of t.staticAccounts.entries())i.push({address:s,role:Vh(t,a,s,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let s=c[a.lookupTableAddress];if(!s)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.READONLY});}}for(let a of o?.filter(s=>s.address!==e)??[]){let s=i.findIndex(d=>d.address===a.address);s===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[s].role===AccountRole.READONLY||i[s].role===AccountRole.READONLY_SIGNER?i[s]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[s].role===AccountRole.WRITABLE||i[s].role===AccountRole.WRITABLE_SIGNER)&&(i[s]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}var lt=33,yt=64,ss=14,Yh=2,Zh=address("Secp256r1SigVerify1111111111111111111111111");function Xh(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function Qh(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function WA(){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=Qh();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=ss;let i=[];for(let a=0;a<r;a++){let s=fixDecoderSize(getBytesDecoder(),lt).decode(e,n);n+=lt;let d=fixDecoderSize(getBytesDecoder(),yt).decode(e,n);n+=yt;let u=t[a].messageDataSize,g=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:s,signature:d,message:g});}return [{numSignatures:r,padding:o,offsets:t,payload:i},n]}})}function LA(){return createEncoder({getSizeFromValue:e=>{let n=ss*e.offsets.length,r=e.payload.reduce((o,t)=>o+lt+yt+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=Xh();for(let t of e.offsets)r=o.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),lt).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),yt).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function V5(){return combineCodec(LA(),WA())}function V(e,n){let r=e.length,o=Yh+r*ss,t=[];for(let s=0;s<r;s++){let{message:d}=e[s],u=o,g=u+lt,p=g+yt;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),o+=lt+yt+d.length;}let c=n?.programAddress??Zh,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:LA().encode(i)}}function H5(e){return {programAddress:e.programAddress,accounts:{},data:WA().decode(e.data)}}async function OA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:o,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:s=false}){let d=await ke(e),{accountMetas:u,addressLookupTableAccounts:g}=await Kr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(V(c)),p.push(s?uu({transactionBuffer:n,payer:o.address,remainingAccounts:u,settingsKey:e}):ou({transactionBuffer:n,payer:o.address,settings:e})),a&&p.push(aA({payer:o,tipAmount:a})),{instructions:p,addressLookupTableAccounts:g}}async function BA({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:o,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:i=[],compressed:a=false,simulateProof:s=false,cachedAccounts:d}){let u=Te(o),g=await ke(e),[{accountMetas:p,addressLookupTableAccounts:f,transactionMessage:S},{settingsMutArgs:I,proof:x,packedAccounts:b}]=await Promise.all([Kr({transactionMessageBytes:r,walletAddress:g,additionalSigners:u.filter(ee=>!(ee instanceof E)),addressesByLookupTableAddress:c}),Pe(a,e,n,s,d)]);b.addPreAccounts(p);let C=u.filter(ee=>ee instanceof E),{secp256r1VerifyArgs:_}=eM(C,i,b),{remainingAccounts:v,systemOffset:B}=b.toAccountMetas();return {instructions:tM({secp256r1VerifyInput:i,transactionMessage:S,accountMetas:p,compressed:a,payer:t,settingsMutArgs:I,proof:x,systemOffset:B,secp256r1VerifyArgs:_,settings:e,remainingAccounts:v}),addressLookupTableAccounts:f}}function eM(e,n,r){let o=[];for(let t of e){let c=n.length,{domainConfig:i,verifyArgs:a,signature:s,publicKey:d,message:u}=J(t,c);u&&s&&d&&n.push({message:u,signature:s,publicKey:d}),i&&(r.addPreAccounts([{address:i,role:AccountRole.READONLY}]),a.__option==="Some"&&o.push({domainConfigKey:i,verifyArgs:a.value}));}return {secp256r1VerifyArgs:o}}function tM({secp256r1VerifyInput:e,transactionMessage:n,accountMetas:r,compressed:o,payer:t,settingsMutArgs:c,proof:i,systemOffset:a,secp256r1VerifyArgs:s,settings:d,remainingAccounts:u}){let g=[];e.length>0&&g.push(V(e));let p=rM(n,r);if(o){if(!t||!c)throw new Error("Payer not found or proof args is missing.");let f=k(i,a);g.push(Cu({secp256r1VerifyArgs:s,transactionMessage:p,settingsMutArgs:c,compressedProofArgs:f,payer:t,remainingAccounts:u}));}else g.push(yu({secp256r1VerifyArgs:s,settings:d,transactionMessage:p,remainingAccounts:u}));return g}function rM(e,n){if(e.version==="legacy")throw new Error("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:r.data??[]})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(o=>o.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function AV({settings:e,settingsAddressTreeIndex:n,destination:r,signers:o,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let s=Te(o),d=await ke(e),[{packedAccounts:u,proof:g,settingsMutArgs:p},{value:f}]=await Promise.all([Pe(a,e,n,false,t),ot(d,t)]);if((f?.lamports??0)<BigInt(c))throw new Error("Insufficient balance");let S=[],I=[];for(let _ of s)if(_ instanceof E){let v=S.length,{domainConfig:B,verifyArgs:se,signature:ee,publicKey:ie,message:ye}=J(_,v);ye&&ee&&ie&&S.push({message:ye,signature:ee,publicKey:ie}),B&&(u.addPreAccounts([{address:B,role:AccountRole.READONLY}]),se.__option==="Some"&&I.push({domainConfigKey:B,verifyArgs:se.value}));}else u.addPreAccounts([{address:_.address,role:AccountRole.READONLY_SIGNER,signer:_}]);let{remainingAccounts:x,systemOffset:b}=u.toAccountMetas(),C=[];if(S.length>0&&C.push(V(S)),a){if(!i||!p)throw new Error("Payer not found or proof args is missing.");let _=k(g,b);C.push(Ui({amount:c,settingsMutArgs:p,compressedProofArgs:_,payer:i,secp256r1VerifyArgs:I,source:d,destination:r,remainingAccounts:x}));}else C.push(hi({amount:c,secp256r1VerifyArgs:I,source:d,destination:r,settings:e,remainingAccounts:x}));return C}var iM=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),dM=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),qr=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function DV({settings:e,settingsAddressTreeIndex:n,destination:r,mint:o,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:s,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false}){let g=Te(t),p=await ke(e),f=U=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(U),getAddressEncoder().encode(qr),getAddressEncoder().encode(o)],programAddress:qr}),S=()=>{let U=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(o)];return d.restricted&&U.push(getUtf8Encoder().encode("restricted")),d.index>0&&U.push(getU8Encoder().encode(d.index)),U},[I,[x],b,[C],[_]]=await Promise.all([getAssociatedTokenAccountAddress(o,p,s),f(p),getAssociatedTokenAccountAddress(o,r,s),f(r),getProgramDerivedAddress({seeds:S(),programAddress:qr})]),[v,B,se,ee]=await Promise.all([ot(b,c),ot(I,c),ot(x,c),gM(u,e,n,c)]),ie=!!v.value,ye=!!B.value,Tt=!!se.value,Re=ye?getTokenDecoder().decode(getBase64Encoder().encode(B.value.data[0])).amount:BigInt(0),Ae=BigInt(Tt?pM(getBase64Encoder().encode(se.value.data[0]))?.amount??0:0),it=ie?b:void 0,Xr=ie?void 0:C,y=ye&&(Re+Ae<BigInt(i)||Ae>BigInt(0)||!ie)||!ye&&ie,Qr=!ie,[pe,gs]=await Promise.all([AM(p,o,Re,Ae,BigInt(i),u?3:4),uM(y,_,c)]),Y=pe.reduce((U,ne)=>U+ne.parsed.amount.toNumber(),0);if(Re+Ae+BigInt(Y)<BigInt(i))throw new Error("Insufficient balance");let dt=null,We=null,Le=new N;if(gs&&Le.addPreAccounts([{address:o,role:AccountRole.WRITABLE}]),ee||pe.length){await Le.addSystemAccounts();let U=[];if(pe.length&&U.push(...pe.map(ne=>({hash:ne.compressedAccount.hash,tree:ne.compressedAccount.treeInfo.tree,queue:ne.compressedAccount.treeInfo.queue,data:ne.compressedAccount.data,address:ne.compressedAccount.address}))),ee&&U.push(ee),We=await $(U,[]),ee){let ne=pe.length;dt=ae(Le,We.treeInfos.slice(ne),We.leafIndices.slice(ne),We.rootIndices.slice(ne),We.proveByIndices.slice(ne),U.slice(ne),K())[0];}}let rg=pe.length&&We?some(pe.map((U,ne)=>({isFrozen:U.parsed.state===AccountState.Frozen,hasDelegate:U.parsed.delegate!=null,amount:U.parsed.amount.toNumber(),merkleContext:{leafIndex:U.compressedAccount.leafIndex,merkleTreePubkeyIndex:Le.insertOrGet(U.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:Le.insertOrGet(U.compressedAccount.treeInfo.queue.toString()),proveByIndex:U.compressedAccount.proveByIndex},rootIndex:We.rootIndices[ne],version:AA(U.compressedAccount.data?.discriminator),tlv:U.parsed.tlv?some(getArrayDecoder(vt()).decode(U.parsed.tlv)):none()}))):none(),ir=[],ps=[];for(let U of g)if(U instanceof E){let ne=ir.length,{domainConfig:$r,verifyArgs:ls,signature:ys,publicKey:Ts,message:fs}=J(U,ne);fs&&ys&&Ts&&ir.push({message:fs,signature:ys,publicKey:Ts}),$r&&(Le.addPreAccounts([{address:$r,role:AccountRole.READONLY}]),ls.__option==="Some"&&ps.push({domainConfigKey:$r,verifyArgs:ls.value}));}else Le.addPreAccounts([{address:U.address,role:AccountRole.READONLY_SIGNER,signer:U}]);let{remainingAccounts:ng,systemOffset:og}=Le.toAccountMetas(),dr=[];ir.length>0&&dr.push(V(ir));let sg=k(We,og),cg=y?_:void 0,ag=Qr?dM:void 0,ig=y?some(d):none(),ms={amount:i,secp256r1VerifyArgs:ps,source:p,destination:r,sourceCtokenTokenAccount:x,sourceSplTokenAccount:I,destinationCtokenTokenAccount:Xr,destinationSplTokenAccount:it,mint:o,tokenProgram:s,remainingAccounts:ng,payer:a,sourceCompressedTokenAccounts:rg,compressedProofArgs:sg,compressibleConfig:iM,splInterfacePda:cg,rentSponsor:ag,splInterfacePdaArgs:ig};if(u){if(!dt)throw new Error("Payer not found or proof args is missing.");dr.push(ji({...ms,settingsMutArgs:dt}));}else dr.push(Ni({...ms,settings:e}));return dr}async function uM(e,n,r){if(!e)return false;let{value:o}=await ot(n,r);return !o}async function AM(e,n,r,o,t,c){let i=t-r-o;if(i<=0)return [];let s=(await Ve().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(n)})).items.filter(g=>!!g.compressedAccount.data?.data.length&&g.compressedAccount.owner.toString()===qr.toString()&&!g.parsed.amount.isZero()).sort((g,p)=>p.parsed.amount.cmp(g.parsed.amount));if(s.length===0)return [];let d=BigInt(0),u=[];for(let g of s){if(u.length>=c||d>=i)break;d+=BigInt(g.parsed.amount.toNumber()),u.push(g);}if(d<i)throw u.length>=c?new Error("Transaction size limit exceeded. Consider multiple transfers to transfer full balance."):new Error("Insufficient balance.");return u}async function gM(e,n,r,o){if(!e)return null;let{address:t}=await ue(n,r);return (await le([{address:t,type:"Settings"}],o))[0]}function pM(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 LV({signers:e,payer:n,changeConfigArgs:r}){let{settings:o,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:s}=r,d=Te(e),u=d.filter(C=>!(C instanceof E));i.addPreAccounts(u.map(C=>({address:C.address,role:AccountRole.READONLY_SIGNER,signer:C})));let g=d.filter(C=>C instanceof E),p=[],f=[];for(let C of g){let _=f.length,{domainConfig:v,verifyArgs:B,signature:se,publicKey:ee,message:ie}=J(C,_);ie&&se&&ee&&f.push({message:ie,signature:se,publicKey:ee}),v&&(i.addPreAccounts([{address:v,role:AccountRole.READONLY}]),B.__option==="Some"&&p.push({domainConfigKey:v,verifyArgs:B.value}));}let{remainingAccounts:S,systemOffset:I}=i.toAccountMetas(),x=k(a,I),b=[];if(f.length>0&&b.push(V(f)),c){if(!s)throw new Error("Payer not found or proof args is missing.");b.push(fa({configActions:t,payer:n,compressedProofArgs:x,settingsMutArgs:s,remainingAccounts:S,secp256r1VerifyArgs:p}));}else b.push(ua({settings:o,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:S,secp256r1VerifyArgs:p}));return b}async function FV({createUserArgs:e,payer:n}){let r=new N;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:AccountRole.READONLY_SIGNER,signer:u.member})));let o=await he(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:p}=await w(u.member.address,o);return {address:g,tree:p,queue:p,type:"User"}})),c=await $([],t),i=await De(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:s}=r.toAccountMetas(),d=k(c,s);return await ja({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:i[g],transactionManagerUrl:u.role===0?u.transactionManagerUrl:null})),remainingAccounts:a})}async function YV({index:e,payer:n,initialMember:r,userAddressTreeIndex:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[],a=[];a.push(...await le([{address:(await w(r.address,o)).address,type:"User"}],t));let s=await he(),{address:d,addressTree:u}=await ue(await Me(e),s);i.push({address:d,queue:u,tree:u,type:"Settings"});let g=a.length,p=await $(a,i),f=ae(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),a.filter(_=>_.type==="User"),te())[0],I=(await De(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),i)).find(_=>_.type==="Settings")??null,{remainingAccounts:x,systemOffset:b}=c.toAccountMetas(),C=k(p,b);if(!I)throw new Error("Settings creation args is missing.");return await Ea({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:C,...I,remainingAccounts:x})}async function n8({settings:e,settingsAddressTreeIndex:n,payer:r,signers:o,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await Pe(true,e,n,false,t);if(!a)throw new Error("Proof args is missing");let s=Te(o),d=s.filter(x=>x instanceof E),u=[],g=[];for(let x of d){let b=u.length,{domainConfig:C,verifyArgs:_,signature:v,publicKey:B,message:se}=J(x,b);se&&v&&B&&u.push({message:se,signature:v,publicKey:B}),C&&(c.addPreAccounts([{address:C,role:AccountRole.READONLY}]),_.__option==="Some"&&g.push({domainConfigKey:C,verifyArgs:_.value}));}c.addPreAccounts(s.filter(x=>"address"in x).map(x=>({address:x.address,role:AccountRole.READONLY_SIGNER,signer:x})));let{remainingAccounts:p,systemOffset:f}=c.toAccountMetas(),S=k(i,f),I=[];return u.length>0&&I.push(V(u)),I.push(Qa({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:S,secp256r1VerifyArgs:g,remainingAccounts:p})),I}async function u8({authority:e,domainConfig:n,newAuthority:r,newOrigins:o}){let t=null,c=[];if(r){let i=new N;await i.addSystemAccounts();let a=await he(),{address:s,addressTree:d}=await w(r.address,a),u=[{address:s,tree:d,queue:d,type:"User"}],g=await $([],u),p=(await De(i,g.treeInfos,g.roots,g.rootIndices,u))[0],f=i.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:k(g,f.systemOffset),authorityCreationArgs:p};}return ui({domainConfig:n,authority:e,newOrigins:o?some(o):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function y8({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let o=new N;await o.addSystemAccounts();let t=await le([{address:(await w(e.address,n)).address,type:"User"}]),c=await $(t,[]),i=ae(o,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,te())[0],{remainingAccounts:a,systemOffset:s}=o.toAccountMetas(),d=k(c,s);return yi({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function h8({payer:e,user:n,userAddressTreeIndex:r,newDelegate:o,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:s,publicKey:d}=J(n),u=[];a&&s&&d&&u.push({message:a,signature:s,publicKey:d});let g=await cr(n instanceof E?n:n.address,r,t),p=[];p.push({address:(await w(n instanceof E?n:n.address,r)).address,type:"User"});let f,S=null,I,x=null,b=g.wallets.find(Ae=>Ae.isDelegate);if(b){let Ae=await Me(b.index);(await zr(Ae,b.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ue(Ae,b.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):f=await Me(b.index);}if(o){let Ae=await Me(o.index);(await zr(Ae,o.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ue(Ae,o.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):I=await Me(o.index);}let C=new N;await C.addSystemAccounts();let _=await le(p,t),v=await $(_,[]),B=ae(C,v.treeInfos.slice(0,1),v.leafIndices.slice(0,1),v.rootIndices.slice(0,1),v.proveByIndices.slice(0,1),_.slice(0,1),te())[0],se=S?some(ae(C,v.treeInfos.slice(S.start,S.end),v.leafIndices.slice(S.start,S.end),v.rootIndices.slice(S.start,S.end),v.proveByIndices.slice(S.start,S.end),_.slice(S.start,S.end),K())[0]):none(),ee=x?some(ae(C,v.treeInfos.slice(x.start,x.end),v.leafIndices.slice(x.start,x.end),v.rootIndices.slice(x.start,x.end),v.proveByIndices.slice(x.start,x.end),_.slice(x.start,x.end),K())[0]):none(),{remainingAccounts:ie,systemOffset:ye}=C.toAccountMetas(),Tt=k(v,ye),Re=[];return u.length>0&&Re.push(V(u)),Re.push(Ci({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:o?some(o):none(),feePayer:e,signer:n instanceof E?void 0:n,oldSettings:f,oldSettingsMutArgs:se,newSettings:I,newSettingsMutArgs:ee,compressedProofArgs:Tt,userMutArgs:B,remainingAccounts:ie})),Re}async function F8({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:o,compressed:t=false,cachedAccounts:c}){let i=await Kc(Q(),r),a=i.data.multiWalletSettings,{packedAccounts:s,proof:d,settingsMutArgs:u}=await Pe(t,a,e,false,c),{remainingAccounts:g,systemOffset:p}=s.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:I,signature:x,publicKey:b}=J(n),C=[];if(I&&x&&b&&C.push(V([{message:I,signature:x,publicKey:b}])),t){if(!o||!u)throw new Error("Payer not found or proof args is missing.");let _=k(d,p);C.push(od({transactionBuffer:r,domainConfig:f,closer:n instanceof E?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:u,payer:o,compressedProofArgs:_,remainingAccounts:g}));}else C.push(Qi({transactionBuffer:r,domainConfig:f,closer:n instanceof E?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return C}function jA({payer:e,creator:n,bufferIndex:r,settings:o,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:p,message:f,signature:S,publicKey:I}=J(n),x=[];if(f&&S&&I&&x.push(V([{message:f,signature:S,publicKey:I}])),d){let{settingsReadonlyArgs:b,compressedProofArgs:C,remainingAccounts:_}=d;x.push(yd({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof E?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSecp256r1Signers:u},settingsReadonlyArgs:b,compressedProofArgs:C,remainingAccounts:_}));}else x.push(ud({settings:o,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof E?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSecp256r1Signers:u},remainingAccounts:[]}));return x}function qA({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:s}=J(e),d=[];return a&&i&&s&&d.push(V([{message:a,signature:i,publicKey:s}])),o?d.push(Rd({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof E?void 0:e,settingsMutArgs:o.settingsMutArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(Cd({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof E?void 0:e,remainingAccounts:[]})),d}function JA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:o=false}){return o?Vd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Wd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function YA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:s}=J(n),d=[];return s&&i&&a&&d.push(V([{message:s,signature:i,publicKey:a}])),o?d.push(Qd({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof E?void 0:n,settingsReadonlyArgs:o.settingsReadonlyArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(jd({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof E?void 0:n,remainingAccounts:[]})),d}async function vH({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:o,compressed:t=false}){let c=await TM(r),i=new N,a=null,s=null,d=[];if(c.length||t){let g=await fM({packedAccounts:i,userAccounts:c,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:o});a=g.proof,s=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await SM({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:s,packedAccounts:i,compressed:t}}async function TM(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}}return n}async function fM({packedAccounts:e,userAccounts:n,compressed:r,settings:o,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let f=(await ue(o,t)).address;i.push({address:f,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await le(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let s=await $(a,[]),d=[],u=[];for(let f of a)f.type==="Settings"?d.push(f):f.type==="User"&&u.push(f);let g,p=[];if(r&&s&&(g=ae(e,s.treeInfos.slice(0,1),s.leafIndices.slice(0,1),s.rootIndices.slice(0,1),s.proveByIndices.slice(0,1),d,K())[0]),u.length&&s){let f=r?1:0;p=ae(e,s.treeInfos.slice(f),s.leafIndices.slice(f),s.rootIndices.slice(f),s.proveByIndices.slice(f),u,te());}return {proof:s,settingsMutArgs:g,userMutArgs:p}}async function SM({configActionsArgs:e,userMutArgs:n}){let r=[];for(let o of e)switch(o.type){case "AddMembers":{let t=[];for(let c of o.members){let i=await w(c.member,c.userAddressTreeIndex).then(a=>n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(a.address)))));if(!i)throw new Error("Unable to find user account");t.push(CM({permissionArgs:c.permissions,userMutArgs:i,pubkey:c.member}));}r.push({__kind:o.type,fields:[t]});break}case "RemoveMembers":{let t=await Promise.all(o.members.map(c=>w(c.member,c.userAddressTreeIndex).then(i=>{let a=n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(i.address))));if(!a)throw new Error("Unable to find user account");return IM({pubkey:c.member,userMutArgs:a})})));r.push({__kind:o.type,fields:[t]});break}case "EditPermissions":{let t=o.members.map(c=>xM({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 xM({pubkey:e,permissionArgs:n}){return {memberKey:Ee(e),permissions:$A(n)}}function IM({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:Ee(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function CM({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:Ee(e),permissions:$A(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function $A(e){let n=[];return e.initiate&&n.push(Ue.InitiateTransaction),e.vote&&n.push(Ue.VoteTransaction),e.execute&&n.push(Ue.ExecuteTransaction),Be.fromPermissions(n)}async function wH({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:p=Math.ceil(o.length/2),cachedAccounts:f}){let S=Math.floor(Math.random()*255),I=await DA(n,t instanceof E?t:t.address,S),x=[],b=[];for(let Y=0;Y<o.length;Y+=p){let dt=o.subarray(Y,Y+p);x.push(dt),b.push(sha256(dt));}let C=sha256(o),{settingsReadonlyArgs:_,settingsMutArgs:v,proof:B,packedAccounts:se}=await Pe(d,n,r,false,f),{remainingAccounts:ee,systemOffset:ie}=se.toAccountMetas(),ye=B&&_&&v?{settingsReadonlyArgs:_,settingsMutArgs:v,compressedProofArgs:k(B,ie),remainingAccounts:ee,payer:e}:null,Tt=Te([t,...c?[c]:[],...u]).filter(Y=>Y instanceof E).map(Y=>({memberKey:Ee(Y),messageHash:Jo(Y.authResponse)})),Re=jA({finalBufferHash:C,finalBufferSize:o.length,bufferIndex:S,payer:e,transactionBufferAddress:I,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:b,compressedArgs:ye,expectedSecp256r1Signers:Tt}),Ae=x.map(Y=>JA({transactionMessageBytes:Y,transactionBufferAddress:I,settings:n,compressed:d})),it=u.map(Y=>YA({voter:Y,transactionBufferAddress:I,settings:n,compressedArgs:ye})),Xr=qA({compressedArgs:ye,settings:n,executor:c,transactionBufferAddress:I}),{instructions:y,addressLookupTableAccounts:Qr}=await OA({compressed:d,settings:n,transactionMessageBytes:o,transactionBufferAddress:I,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s}),pe=Y=>({payer:e,instructions:Y,addressesByLookupTableAddress:Qr});return [pe(Re),...Ae.map(Y=>pe([Y])),...it.length?[pe(it.flat())]:[],pe(Xr),pe(y)]}var Yr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let o=new Map,t=i=>{let a=o.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},o.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let s=t(a.address);s.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,o)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),o=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),c=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+o.length,numReadonlySignerAccounts:o.length,numReadonlyNonSignerAccounts:c.length};if(r.length===0)throw new Error("Expected at least one writable signer key");let[a]=r[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let s=[...r.map(([d])=>d),...o.map(([d])=>d),...t.map(([d])=>d),...c.map(([d])=>d)];return [i,s]}extractTableLookup(n){let[r,o]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(n,r){let o=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,s=n.findIndex(d=>d===a);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),t.push(a),this.keyMetaMap.delete(c);}}return [o,t]}};var Zr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let o=new Map;this.keySegments().flat().forEach((c,i)=>{o.set(c,i);});let t=c=>{let i=o.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function tg({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:o}){let t=Yr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(o??{});for(let p of a){let f=t.extractTableLookup(p);if(f!==void 0){let{addressTableLookup:S,drainedKeys:I}=f;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),i.writable.push(...I.writable),i.readonly.push(...I.readonly);}}let[s,d]=t.getMessageComponents(),g=new Zr(d,i).compileInstructions(r);return {version:0,header:s,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function QH({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=tg({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(Wu(o))}async function nF({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i,cachedAccounts:a,compressed:s=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await BA({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:o,secp256r1VerifyInput:c,compressed:s,addressesByLookupTableAddress:i,simulateProof:d,cachedAccounts:a});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}export{ea as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,_u as AuthenticationContextSchema,vu as BaseResponseSchema,la as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,aa as CHANGE_CONFIG_DISCRIMINATOR,Ia as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,va as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Oa as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Va as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,za as CREATE_USER_ACCOUNTS_DISCRIMINATOR,rw as CompleteMessageRequestSchema,ow as CompleteSendTransactionRequestSchema,nw as CompleteTransactionRequestSchema,Ya as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,ti as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Ss as DOMAIN_CONFIG_DISCRIMINATOR,ii as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,pi as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,Si as EDIT_USER_DELEGATE_DISCRIMINATOR,Ps as GLOBAL_COUNTER_DISCRIMINATOR,Qt as KeyType,qE as MULTI_WALLET_ERROR__ALREADY_DELEGATED,EE as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,wD as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,pD as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,lD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,yD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,BD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,JD as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,hE as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,PE as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,BE as MULTI_WALLET_ERROR__EMPTY_MEMBERS,CD as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,WE as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,DE as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,UE as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,rD as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,nD as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,oD as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,ID as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,ZE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,JE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,YE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,FE as MULTI_WALLET_ERROR__INVALID_ACCOUNT,OD as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,SD as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,LE as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,zE as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,tD as MULTI_WALLET_ERROR__INVALID_BUFFER,ED as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,XE as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,HE as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,bE as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,TE as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,xE as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,yE as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,SE as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,gD as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,uD as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,wE as MULTI_WALLET_ERROR__INVALID_THRESHOLD,kD as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,kE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,vE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,VE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,FD as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,GE as MULTI_WALLET_ERROR__INVALID_USER_ROLE,HD as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,UD as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,IE as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,iD as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,TD as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,hD as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,LD as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,KE as MULTI_WALLET_ERROR__MISSING_ACCOUNT,DD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,bD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,GD as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,vD as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,PD as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,jE as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,jD as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,KD as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,xD as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,zD as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,_D as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,dD as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,ND as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,qD as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,$E as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,OE as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,RE as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,_E as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,fD as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,RD as MULTI_WALLET_ERROR__PAYER_MISMATCH,ME as MULTI_WALLET_ERROR__PERMANENT_MEMBER,aD as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,CE as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,MD as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,fE as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,AD as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,WD as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,NE as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,sD as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,cD as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,mD as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,eD as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,VD as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,QE as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,pE as MultiWalletAccount,mE as MultiWalletInstruction,bi as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Di as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Ue as Permission,Be as Permissions,Oc as SETTINGS_DISCRIMINATOR,Ne as Secp256r1Key,E as SignedSecp256r1Key,Ru as StartMessageRequestSchema,bu as StartTransactionRequestSchema,zi as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Oi as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,td as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,Yi as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,pd as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,ad as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Fc as TRANSACTION_BUFFER_DISCRIMINATOR,Pd as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Sd as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Bd as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,vd as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Yd as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Gd as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,au as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,tu as TRANSACTION_EXECUTE_DISCRIMINATOR,Su as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,pu as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Mu as TransactionActionTypeSchema,ZD as TransactionDetailsSchema,tw as TransactionPayloadSchema,YD as TransactionPayloadWithBase64MessageBytesSchema,yo as Transports,Oe as UserRole,Jc as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,qN as addWhitelistedAddressTrees,xe as base64URLStringToBuffer,Yw as bufferToBase64URLString,LV as changeConfig,F8 as closeTransactionBuffer,_R as configAction,Qw as convertBase64StringToJWK,Xw as convertJWKToBase64String,RA as convertMemberKeyToString,Gw as convertPubkeyCompressedToCose,Fw as convertPubkeyCoseToCompressed,jw as createClientAuthorizationCompleteRequestChallenge,Kw as createClientAuthorizationStartRequestChallenge,i5 as createDomainConfig,S5 as createDomainUserAccounts,E5 as createGlobalCounter,qw as createMessageChallenge,jA as createTransactionBuffer,Jw as createTransactionChallenge,Nh as createTransactionManagerSigner,FV as createUserAccounts,YV as createWallet,Is as decodeDomainConfig,Ms as decodeGlobalCounter,Bc as decodeSettings,zc as decodeTransactionBuffer,Zc as decodeWhitelistedAddressTree,n8 as decompressSettingsAccount,j6 as deserializeConfigActions,M5 as disableDomainConfig,u8 as editDomainConfig,y8 as editTransactionManagerUrl,h8 as editUserDelegate,OA as executeTransaction,qA as executeTransactionBuffer,BA as executeTransactionSync,JA as extendTransactionBuffer,JR as extensionStruct,MM as fetchAllDomainConfig,WM as fetchAllGlobalCounter,Cg as fetchAllMaybeDomainConfig,Ng as fetchAllMaybeGlobalCounter,x1 as fetchAllMaybeSettings,V1 as fetchAllMaybeTransactionBuffer,cf as fetchAllMaybeWhitelistedAddressTree,gU as fetchAllSettings,Z2 as fetchAllSettingsAccountByMember,fU as fetchAllTransactionBuffer,EU as fetchAllWhitelistedAddressTree,gA as fetchCompressedAccount,Cs as fetchDomainConfig,kM as fetchGlobalCounter,Ig as fetchMaybeDomainConfig,Bg as fetchMaybeGlobalCounter,To as fetchMaybeSettings,mh as fetchMaybeSettingsAccountData,w1 as fetchMaybeTransactionBuffer,ph as fetchMaybeUserAccountData,sf as fetchMaybeWhitelistedAddressTree,AU as fetchSettings,zr as fetchSettingsAccountData,Kc as fetchTransactionBuffer,Y2 as fetchUserAccountByFilters,cr as fetchUserAccountData,Xc as fetchWhitelistedAddressTree,FM as getAddMemberArgsCodec,nn as getAddMemberArgsDecoder,rn as getAddMemberArgsEncoder,VU as getAddWhitelistedAddressTreesDiscriminatorBytes,FU as getAddWhitelistedAddressTreesInstruction,ra as getAddWhitelistedAddressTreesInstructionAsync,HU as getAddWhitelistedAddressTreesInstructionDataCodec,ta as getAddWhitelistedAddressTreesInstructionDataDecoder,Po as getAddWhitelistedAddressTreesInstructionDataEncoder,NM as getAdditionalMetadataCodec,tn as getAdditionalMetadataDecoder,en as getAdditionalMetadataEncoder,sk as getChangeConfigCompressedDiscriminatorBytes,fa as getChangeConfigCompressedInstruction,ck as getChangeConfigCompressedInstructionDataCodec,Ta as getChangeConfigCompressedInstructionDataDecoder,ya as getChangeConfigCompressedInstructionDataEncoder,ZU as getChangeConfigDiscriminatorBytes,ua as getChangeConfigInstruction,XU as getChangeConfigInstructionDataCodec,da as getChangeConfigInstructionDataDecoder,ia as getChangeConfigInstructionDataEncoder,qo as getClientAndDeviceHash,KM as getCompiledInstructionCodec,sn as getCompiledInstructionDecoder,on as getCompiledInstructionEncoder,YM as getCompressedAccountMetaCodec,It as getCompressedAccountMetaDecoder,xt as getCompressedAccountMetaEncoder,$M as getCompressedAccountMetaReadOnlyCodec,Pt as getCompressedAccountMetaReadOnlyDecoder,Dt as getCompressedAccountMetaReadOnlyEncoder,rR as getCompressedOnlyExtensionCodec,an as getCompressedOnlyExtensionDecoder,cn as getCompressedOnlyExtensionEncoder,sR as getCompressedProofCodec,mn as getCompressedProofDecoder,pn as getCompressedProofEncoder,ue as getCompressedSettingsAddress,dR as getCompressedSettingsCodec,pR as getCompressedSettingsDataCodec,yn as getCompressedSettingsDataDecoder,ln as getCompressedSettingsDataEncoder,K as getCompressedSettingsDecoder,ht as getCompressedSettingsEncoder,TR as getCompressedTokenArgsCodec,_t as getCompressedTokenArgsDecoder,bt as getCompressedTokenArgsEncoder,IR as getCompressibleExtensionCodec,En as getCompressibleExtensionDecoder,Cn as getCompressibleExtensionEncoder,PR as getCompressionInfoCodec,Pn as getCompressionInfoDecoder,Dn as getCompressionInfoEncoder,bR as getConfigActionCodec,je as getConfigActionDecoder,Ke as getConfigActionEncoder,mk as getCreateCompressedWalletDiscriminatorBytes,yk as getCreateCompressedWalletInstruction,Ea as getCreateCompressedWalletInstructionAsync,lk as getCreateCompressedWalletInstructionDataCodec,Ca as getCreateCompressedWalletInstructionDataDecoder,ho as getCreateCompressedWalletInstructionDataEncoder,Dk as getCreateDomainConfigDiscriminatorBytes,hk as getCreateDomainConfigInstruction,ka as getCreateDomainConfigInstructionAsync,Pk as getCreateDomainConfigInstructionDataCodec,Ua as getCreateDomainConfigInstructionDataDecoder,Ro as getCreateDomainConfigInstructionDataEncoder,Wk as getCreateDomainUserAccountDiscriminatorBytes,Ok as getCreateDomainUserAccountInstruction,Na as getCreateDomainUserAccountInstructionAsync,Lk as getCreateDomainUserAccountInstructionDataCodec,Ba as getCreateDomainUserAccountInstructionDataDecoder,bo as getCreateDomainUserAccountInstructionDataEncoder,Gk as getCreateGlobalCounterDiscriminatorBytes,Kk as getCreateGlobalCounterInstruction,Fa as getCreateGlobalCounterInstructionAsync,zk as getCreateGlobalCounterInstructionDataCodec,Ha as getCreateGlobalCounterInstructionDataDecoder,vo as getCreateGlobalCounterInstructionDataEncoder,LR as getCreateUserAccountArgsCodec,Bn as getCreateUserAccountArgsDecoder,On as getCreateUserAccountArgsEncoder,$k as getCreateUserAccountsDiscriminatorBytes,tW as getCreateUserAccountsInstruction,ja as getCreateUserAccountsInstructionAsync,eW as getCreateUserAccountsInstructionDataCodec,Ka as getCreateUserAccountsInstructionDataDecoder,ko as getCreateUserAccountsInstructionDataEncoder,dW as getDecompressSettingsAccountDiscriminatorBytes,Qa as getDecompressSettingsAccountInstruction,uW as getDecompressSettingsAccountInstructionDataCodec,Xa as getDecompressSettingsAccountInstructionDataDecoder,Za as getDecompressSettingsAccountInstructionDataEncoder,TW as getDisableDomainConfigDiscriminatorBytes,oi as getDisableDomainConfigInstruction,fW as getDisableDomainConfigInstructionDataCodec,ni as getDisableDomainConfigInstructionDataDecoder,ri as getDisableDomainConfigInstructionDataEncoder,gt as getDomainConfigAddress,hM as getDomainConfigCodec,xs as getDomainConfigDecoder,PM as getDomainConfigDiscriminatorBytes,xg as getDomainConfigEncoder,RM as getDomainConfigSize,hW as getEditDomainConfigDiscriminatorBytes,ui as getEditDomainConfigInstruction,RW as getEditDomainConfigInstructionAsync,MW as getEditDomainConfigInstructionDataCodec,di as getEditDomainConfigInstructionDataDecoder,Lo as getEditDomainConfigInstructionDataEncoder,wR as getEditMemberArgsCodec,kn as getEditMemberArgsDecoder,Un as getEditMemberArgsEncoder,OW as getEditTransactionManagerUrlDiscriminatorBytes,yi as getEditTransactionManagerUrlInstruction,BW as getEditTransactionManagerUrlInstructionDataCodec,li as getEditTransactionManagerUrlInstructionDataDecoder,mi as getEditTransactionManagerUrlInstructionDataEncoder,KW as getEditUserDelegateDiscriminatorBytes,Ci as getEditUserDelegateInstruction,jW as getEditUserDelegateInstructionDataCodec,Ii as getEditUserDelegateInstructionDataDecoder,xi as getEditUserDelegateInstructionDataEncoder,GR as getExpectedSecp256r1SignersCodec,kt as getExpectedSecp256r1SignersDecoder,Ut as getExpectedSecp256r1SignersEncoder,qR as getExtensionStructCodec,vt as getExtensionStructDecoder,Tn as getExtensionStructEncoder,EA as getGlobalCounterAddress,UM as getGlobalCounterCodec,hs as getGlobalCounterDecoder,vM as getGlobalCounterDiscriminatorBytes,Og as getGlobalCounterEncoder,LM as getGlobalCounterSize,jo as getJitoTipsConfig,u6 as getLightCpiSigner,Ve as getLightProtocolRpc,$R as getLinkWalletArgsCodec,Yn as getLinkWalletArgsDecoder,Jn as getLinkWalletArgsEncoder,nb as getMemberCodec,Rt as getMemberDecoder,Mt as getMemberEncoder,cb as getMemberKeyCodec,oe as getMemberKeyDecoder,H as getMemberKeyEncoder,LN as getMultiWalletErrorMessage,uL as getNativeTransferIntentCompressedDiscriminatorBytes,Ui as getNativeTransferIntentCompressedInstruction,AL as getNativeTransferIntentCompressedInstructionDataCodec,vi as getNativeTransferIntentCompressedInstructionDataDecoder,_i as getNativeTransferIntentCompressedInstructionDataEncoder,eL as getNativeTransferIntentDiscriminatorBytes,hi as getNativeTransferIntentInstruction,rL as getNativeTransferIntentInstructionAsync,tL as getNativeTransferIntentInstructionDataCodec,Pi as getNativeTransferIntentInstructionDataDecoder,Oo as getNativeTransferIntentInstructionDataEncoder,ub as getNewAuthorityArgsCodec,$n as getNewAuthorityArgsDecoder,Qn as getNewAuthorityArgsEncoder,Zw as getOriginIndex,pb as getPackedAddressTreeInfoCodec,Bt as getPackedAddressTreeInfoDecoder,Ot as getPackedAddressTreeInfoEncoder,yb as getPackedMerkleContextCodec,Sn as getPackedMerkleContextDecoder,fn as getPackedMerkleContextEncoder,Sb as getPackedStateTreeInfoCodec,Et as getPackedStateTreeInfoDecoder,Ct as getPackedStateTreeInfoEncoder,Cb as getPausableAccountExtensionCodec,wn as getPausableAccountExtensionDecoder,Nn as getPausableAccountExtensionEncoder,Pb as getPermanentDelegateAccountExtensionCodec,Hn as getPermanentDelegateAccountExtensionDecoder,Vn as getPermanentDelegateAccountExtensionEncoder,Rb as getPermissionsCodec,Fe as getPermissionsDecoder,He as getPermissionsEncoder,Ub as getProofArgsCodec,P as getProofArgsDecoder,D as getProofArgsEncoder,Ob as getRemoveMemberArgsCodec,Ln as getRemoveMemberArgsDecoder,Wn as getRemoveMemberArgsEncoder,wb as getRentConfigCodec,bn as getRentConfigDecoder,Rn as getRentConfigEncoder,Jo as getSecp256r1MessageHash,Fb as getSecp256r1PubkeyCodec,Nt as getSecp256r1PubkeyDecoder,ro as getSecp256r1PubkeyEncoder,Qh as getSecp256r1SignatureOffsetsDataDecoder,Xh as getSecp256r1SignatureOffsetsDataEncoder,Kb as getSecp256r1VerifyArgsCodec,G as getSecp256r1VerifyArgsDecoder,F as getSecp256r1VerifyArgsEncoder,Yb as getSecp256r1VerifyArgsWithDomainAddressCodec,X as getSecp256r1VerifyArgsWithDomainAddressDecoder,Z as getSecp256r1VerifyArgsWithDomainAddressEncoder,V as getSecp256r1VerifyInstruction,V5 as getSecp256r1VerifyInstructionDataCodec,WA as getSecp256r1VerifyInstructionDataDecoder,LA as getSecp256r1VerifyInstructionDataEncoder,Bu as getSendAndConfirmTransaction,uU as getSettingsCodec,hr as getSettingsDecoder,dU as getSettingsDiscriminatorBytes,S1 as getSettingsEncoder,Me as getSettingsFromIndex,t_ as getSettingsIndexWithAddressAndDelegateInfoCodec,co as getSettingsIndexWithAddressAndDelegateInfoDecoder,so as getSettingsIndexWithAddressAndDelegateInfoEncoder,Qb as getSettingsIndexWithAddressCodec,oo as getSettingsIndexWithAddressDecoder,no as getSettingsIndexWithAddressEncoder,s_ as getSettingsMutArgsCodec,q as getSettingsMutArgsDecoder,j as getSettingsMutArgsEncoder,d_ as getSettingsReadonlyArgsCodec,Vt as getSettingsReadonlyArgsDecoder,wt as getSettingsReadonlyArgsEncoder,zw as getSignedSecp256r1Key,z6 as getSignedTransactionManager,Q as getSolanaRpc,Ou as getSolanaRpcEndpoint,g_ as getSplInterfacePdaArgsCodec,Ft as getSplInterfacePdaArgsDecoder,Ht as getSplInterfacePdaArgsEncoder,y_ as getTokenMetadataCodec,Gn as getTokenMetadataDecoder,Fn as getTokenMetadataEncoder,bL as getTokenTransferIntentCompressedDiscriminatorBytes,ji as getTokenTransferIntentCompressedInstruction,vL as getTokenTransferIntentCompressedInstructionAsync,_L as getTokenTransferIntentCompressedInstructionDataCodec,Ki as getTokenTransferIntentCompressedInstructionDataDecoder,Vo as getTokenTransferIntentCompressedInstructionDataEncoder,SL as getTokenTransferIntentDiscriminatorBytes,Ni as getTokenTransferIntentInstruction,IL as getTokenTransferIntentInstructionAsync,xL as getTokenTransferIntentInstructionDataCodec,Bi as getTokenTransferIntentInstructionDataDecoder,wo as getTokenTransferIntentInstructionDataEncoder,DA as getTransactionBufferAddress,JL as getTransactionBufferCloseCompressedDiscriminatorBytes,od as getTransactionBufferCloseCompressedInstruction,YL as getTransactionBufferCloseCompressedInstructionDataCodec,nd as getTransactionBufferCloseCompressedInstructionDataDecoder,rd as getTransactionBufferCloseCompressedInstructionDataEncoder,wL as getTransactionBufferCloseDiscriminatorBytes,Qi as getTransactionBufferCloseInstruction,VL as getTransactionBufferCloseInstructionDataCodec,Xi as getTransactionBufferCloseInstructionDataDecoder,Zi as getTransactionBufferCloseInstructionDataEncoder,TU as getTransactionBufferCodec,x_ as getTransactionBufferCreateArgsCodec,zt as getTransactionBufferCreateArgsDecoder,Gt as getTransactionBufferCreateArgsEncoder,gO as getTransactionBufferCreateCompressedDiscriminatorBytes,yd as getTransactionBufferCreateCompressedInstruction,pO as getTransactionBufferCreateCompressedInstructionDataCodec,ld as getTransactionBufferCreateCompressedInstructionDataDecoder,md as getTransactionBufferCreateCompressedInstructionDataEncoder,nO as getTransactionBufferCreateDiscriminatorBytes,ud as getTransactionBufferCreateInstruction,oO as getTransactionBufferCreateInstructionDataCodec,dd as getTransactionBufferCreateInstructionDataDecoder,id as getTransactionBufferCreateInstructionDataEncoder,Gc as getTransactionBufferDecoder,yU as getTransactionBufferDiscriminatorBytes,N1 as getTransactionBufferEncoder,_O as getTransactionBufferExecuteCompressedDiscriminatorBytes,Rd as getTransactionBufferExecuteCompressedInstruction,vO as getTransactionBufferExecuteCompressedInstructionDataCodec,Md as getTransactionBufferExecuteCompressedInstructionDataDecoder,hd as getTransactionBufferExecuteCompressedInstructionDataEncoder,IO as getTransactionBufferExecuteDiscriminatorBytes,Cd as getTransactionBufferExecuteInstruction,CO as getTransactionBufferExecuteInstructionDataCodec,Id as getTransactionBufferExecuteInstructionDataDecoder,xd as getTransactionBufferExecuteInstructionDataEncoder,jO as getTransactionBufferExtendCompressedDiscriminatorBytes,Vd as getTransactionBufferExtendCompressedInstruction,qO as getTransactionBufferExtendCompressedInstructionDataCodec,wd as getTransactionBufferExtendCompressedInstructionDataDecoder,Nd as getTransactionBufferExtendCompressedInstructionDataEncoder,NO as getTransactionBufferExtendDiscriminatorBytes,Wd as getTransactionBufferExtendInstruction,wO as getTransactionBufferExtendInstructionDataCodec,kd as getTransactionBufferExtendInstructionDataDecoder,Ud as getTransactionBufferExtendInstructionDataEncoder,uB as getTransactionBufferVoteCompressedDiscriminatorBytes,Qd as getTransactionBufferVoteCompressedInstruction,AB as getTransactionBufferVoteCompressedInstructionDataCodec,Xd as getTransactionBufferVoteCompressedInstructionDataDecoder,Zd as getTransactionBufferVoteCompressedInstructionDataEncoder,tB as getTransactionBufferVoteDiscriminatorBytes,jd as getTransactionBufferVoteInstruction,rB as getTransactionBufferVoteInstructionDataCodec,Kd as getTransactionBufferVoteInstructionDataDecoder,zd as getTransactionBufferVoteInstructionDataEncoder,hB as getTransactionExecuteCompressedDiscriminatorBytes,uu as getTransactionExecuteCompressedInstruction,MB as getTransactionExecuteCompressedInstructionDataCodec,du as getTransactionExecuteCompressedInstructionDataDecoder,iu as getTransactionExecuteCompressedInstructionDataEncoder,fB as getTransactionExecuteDiscriminatorBytes,ou as getTransactionExecuteInstruction,SB as getTransactionExecuteInstructionDataCodec,nu as getTransactionExecuteInstructionDataDecoder,ru as getTransactionExecuteInstructionDataEncoder,zB as getTransactionExecuteSyncCompressedDiscriminatorBytes,Cu as getTransactionExecuteSyncCompressedInstruction,KB as getTransactionExecuteSyncCompressedInstructionDataCodec,Iu as getTransactionExecuteSyncCompressedInstructionDataDecoder,xu as getTransactionExecuteSyncCompressedInstructionDataEncoder,LB as getTransactionExecuteSyncDiscriminatorBytes,yu as getTransactionExecuteSyncInstruction,OB as getTransactionExecuteSyncInstructionDataCodec,lu as getTransactionExecuteSyncInstructionDataDecoder,mu as getTransactionExecuteSyncInstructionDataEncoder,M_ as getTransactionMessageAddressTableLookupCodec,lo as getTransactionMessageAddressTableLookupDecoder,mo as getTransactionMessageAddressTableLookupEncoder,D_ as getTransactionMessageCodec,jt as getTransactionMessageDecoder,Kt as getTransactionMessageEncoder,__ as getTransferFeeAccountExtensionCodec,Kn as getTransferFeeAccountExtensionDecoder,zn as getTransferFeeAccountExtensionEncoder,k_ as getTransferHookAccountExtensionCodec,qn as getTransferHookAccountExtensionDecoder,jn as getTransferHookAccountExtensionEncoder,O_ as getTransportsCodec,Jt as getTransportsDecoder,qt as getTransportsEncoder,w as getUserAccountAddress,V_ as getUserCodec,z_ as getUserCreationArgsCodec,_e as getUserCreationArgsDecoder,be as getUserCreationArgsEncoder,te as getUserDecoder,Yt as getUserEncoder,J_ as getUserMutArgsCodec,et as getUserMutArgsDecoder,$e as getUserMutArgsEncoder,Q_ as getUserReadOnlyArgsCodec,Lt as getUserReadOnlyArgsDecoder,Wt as getUserReadOnlyArgsEncoder,rv as getUserReadOnlyOrMutateArgsCodec,ze as getUserReadOnlyOrMutateArgsDecoder,Ge as getUserReadOnlyOrMutateArgsEncoder,av as getUserRoleCodec,Je as getUserRoleDecoder,qe as getUserRoleEncoder,d6 as getWalletAddressFromIndex,ke as getWalletAddressFromSettings,CU as getWhitelistedAddressTreeCodec,Yc as getWhitelistedAddressTreeDecoder,IU as getWhitelistedAddressTreeDiscriminatorBytes,of as getWhitelistedAddressTreeEncoder,ts as getWhitelistedAddressTreeFromIndex,X2 as getWhitelistedAddressTreeIndexFromAddress,pA as getWhitelistedAddressTreesAddress,RN as identifyMultiWalletAccount,bN as identifyMultiWalletInstruction,Mw as initialize,vR as isConfigAction,YR as isExtensionStruct,ON as isMultiWalletError,ov as isUserReadOnlyOrMutateArgs,AV as nativeTransferIntent,GU as parseAddWhitelistedAddressTreesInstruction,ak as parseChangeConfigCompressedInstruction,QU as parseChangeConfigInstruction,Tk as parseCreateCompressedWalletInstruction,Mk as parseCreateDomainConfigInstruction,Bk as parseCreateDomainUserAccountInstruction,jk as parseCreateGlobalCounterInstruction,rW as parseCreateUserAccountsInstruction,AW as parseDecompressSettingsAccountInstruction,SW as parseDisableDomainConfigInstruction,bW as parseEditDomainConfigInstruction,NW as parseEditTransactionManagerUrlInstruction,qW as parseEditUserDelegateInstruction,gL as parseNativeTransferIntentCompressedInstruction,nL as parseNativeTransferIntentInstruction,H5 as parseSecp256r1VerifyInstruction,UL as parseTokenTransferIntentCompressedInstruction,CL as parseTokenTransferIntentInstruction,ZL as parseTransactionBufferCloseCompressedInstruction,HL as parseTransactionBufferCloseInstruction,mO as parseTransactionBufferCreateCompressedInstruction,sO as parseTransactionBufferCreateInstruction,UO as parseTransactionBufferExecuteCompressedInstruction,EO as parseTransactionBufferExecuteInstruction,JO as parseTransactionBufferExtendCompressedInstruction,VO as parseTransactionBufferExtendInstruction,gB as parseTransactionBufferVoteCompressedInstruction,nB as parseTransactionBufferVoteInstruction,RB as parseTransactionExecuteCompressedInstruction,xB as parseTransactionExecuteInstruction,jB as parseTransactionExecuteSyncCompressedInstruction,BB as parseTransactionExecuteSyncInstruction,I6 as pollJitoBundleConfirmation,vH as prepareChangeConfigArgs,wH as prepareTransactionBundle,QH as prepareTransactionMessage,nF as prepareTransactionSync,G6 as retrieveTransactionManager,Ih as sendJitoBundle,K6 as serializeConfigActions,x6 as signAndSendBundledTransactions,R6 as signAndSendTransaction,DV as tokenTransferIntent,nv as userReadOnlyOrMutateArgs,Lu as vaultTransactionMessageDeserialize,Wu as vaultTransactionMessageSerialize,YA as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|