@revibase/core 0.0.48 → 0.0.49
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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,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 {createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,encodeBN254toBase58,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import f from'zod';import {estimateComputeUnitLimitFactory,getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTokenDecoder,AccountState,getTransferSolInstruction}from'gill/programs';import {p256}from'@noble/curves/nist.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {canonicalize}from'json-canonicalize';import {equalBytes}from'@noble/curves/utils.js';var xo=new Uint8Array([201,232,212,229,59,241,106,197]);function Sh(){return fixEncoderSize(getBytesEncoder(),8).encode(xo)}function Eg(){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:xo}))}function Io(){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 xh(){return combineCodec(Eg(),Io())}function Co(e){return decodeAccount(e,Io())}async function Eo(e,n,r){let s=await Dg(e,n,r);return assertAccountExists(s),s}async function Dg(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Co(s)}async function Ih(e,n,r){let s=await Pg(e,n,r);return assertAccountsExist(s),s}async function Pg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Co(t))}function Ch(){return 846}var Mo=new Uint8Array([42,206,176,58,175,129,130,233]);function Ph(){return fixEncoderSize(getBytesEncoder(),8).encode(Mo)}function wg(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Mo}))}function ho(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function Mh(){return combineCodec(wg(),ho())}function Ro(e){return decodeAccount(e,ho())}async function hh(e,n,r){let s=await Vg(e,n,r);return assertAccountExists(s),s}async function Vg(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Ro(s)}async function Rh(e,n,r){let s=await Hg(e,n,r);return assertAccountsExist(s),s}async function Hg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ro(t))}function bh(){return 24}function rn(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function nn(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Uh(){return combineCodec(rn(),nn())}function sn(){return getStructEncoder([["memberKey",H()],["permissions",Fe()],["userArgs",ze()]])}function on(){return getStructDecoder([["memberKey",ce()],["permissions",Ge()],["userArgs",Ke()]])}function Oh(){return combineCodec(sn(),on())}function cn(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function an(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function wh(){return combineCodec(cn(),an())}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 Gh(){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 Jh(){return combineCodec(Dt(),Pt())}function dn(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function un(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function Zh(){return combineCodec(dn(),un())}function yn(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function ln(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function $h(){return combineCodec(yn(),ln())}function Mt(){return getStructEncoder([["data",getOptionEncoder(ht())]])}function K(){return getStructDecoder([["data",getOptionDecoder(Rt())]])}function nR(){return combineCodec(Mt(),K())}function ht(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(bt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function Rt(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(_t())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function aR(){return combineCodec(ht(),Rt())}function vt(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",fn()],["tlv",getOptionEncoder(getArrayEncoder(Tn()))],["hasDelegate",getBooleanEncoder()],["isFrozen",getBooleanEncoder()]])}function Ut(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",Sn()],["tlv",getOptionDecoder(getArrayDecoder(Wt()))],["hasDelegate",getBooleanDecoder()],["isFrozen",getBooleanDecoder()]])}function AR(){return combineCodec(vt(),Ut())}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 yR(){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 SR(){return combineCodec(Dn(),Pn())}function je(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Un())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(sn())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(kn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Je(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Wn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(on())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Ln())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function ER(){return combineCodec(je(),Je())}function DR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function PR(e,n){return n.__kind===e}function On(){return getStructEncoder([["member",getAddressEncoder()],["role",qe()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",xe()]])}function Bn(){return getStructDecoder([["member",getAddressDecoder()],["role",Ye()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",Ie()]])}function bR(){return combineCodec(On(),Bn())}function Un(){return getStructEncoder([["memberKey",H()],["permissions",Fe()]])}function Wn(){return getStructDecoder([["memberKey",ce()],["permissions",Ge()]])}function WR(){return combineCodec(Un(),Wn())}function kt(){return getStructEncoder([["memberKey",H()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function Lt(){return getStructDecoder([["memberKey",ce()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function BR(){return combineCodec(kt(),Lt())}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([dn()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([Cn()])]])]])}function Wt(){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([Jn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([un()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([En()])]])]])}function HR(){return combineCodec(Tn(),Wt())}function FR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function GR(e,n){return n.__kind===e}function qn(){return getStructEncoder([["settingsMutArgs",j()],["transactionManager",getOptionEncoder(Ot())]])}function Yn(){return getStructDecoder([["settingsMutArgs",J()],["transactionManager",getOptionDecoder(Bt())]])}function JR(){return combineCodec(qn(),Yn())}function bt(){return getStructEncoder([["pubkey",H()],["role",getU8Encoder()],["permissions",Fe()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function _t(){return getStructDecoder([["pubkey",ce()],["role",getU8Decoder()],["permissions",Ge()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function XR(){return combineCodec(bt(),_t())}function H(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function ce(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function eb(){return combineCodec(H(),ce())}function Qn(){return getStructEncoder([["authorityCreationArgs",xe()],["compressedProofArgs",C()]])}function $n(){return getStructDecoder([["authorityCreationArgs",Ie()],["compressedProofArgs",E()]])}function sb(){return combineCodec(Qn(),$n())}function Nt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function wt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function ab(){return combineCodec(Nt(),wt())}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 ub(){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 pb(){return combineCodec(Ct(),Et())}function Nn(){return getStructEncoder([])}function wn(){return getStructDecoder([])}function lb(){return combineCodec(Nn(),wn())}function Vn(){return getStructEncoder([])}function Hn(){return getStructDecoder([])}function Sb(){return combineCodec(Vn(),Hn())}function Fe(){return getStructEncoder([["mask",getU8Encoder()]])}function Ge(){return getStructDecoder([["mask",getU8Decoder()]])}function Cb(){return combineCodec(Fe(),Ge())}function C(){return getStructEncoder([["proof",getOptionEncoder(yn())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function E(){return getStructDecoder([["proof",getOptionDecoder(ln())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function Mb(){return combineCodec(C(),E())}function kn(){return getStructEncoder([["memberKey",H()],["userArgs",ze()]])}function Ln(){return getStructDecoder([["memberKey",ce()],["userArgs",Ke()]])}function _b(){return combineCodec(kn(),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 rs(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Vt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function Ob(){return combineCodec(rs(),Vt())}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 wb(){return combineCodec(F(),G())}function $(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",F()]])}function ee(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",G()]])}function Gb(){return combineCodec($(),ee())}function Ht(){return getStructEncoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",getU8Encoder()]])}function Ft(){return getStructDecoder([["addressTreeInfo",wt()],["outputStateTreeIndex",getU8Decoder()]])}function Jb(){return combineCodec(Ht(),Ft())}function ns(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function ss(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function Zb(){return combineCodec(ns(),ss())}function os(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function cs(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function $b(){return combineCodec(os(),cs())}function j(){return getStructEncoder([["accountMeta",xt()],["data",Mt()]])}function J(){return getStructDecoder([["accountMeta",It()],["data",K()]])}function n_(){return combineCodec(j(),J())}function Gt(){return getStructEncoder([["accountMeta",Dt()],["data",Mt()]])}function zt(){return getStructDecoder([["accountMeta",Pt()],["data",K()]])}function a_(){return combineCodec(Gt(),zt())}function Kt(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function jt(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function u_(){return combineCodec(Kt(),jt())}function Fn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(rn())]])}function Gn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(nn())]])}function m_(){return combineCodec(Fn(),Gn())}function Jt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getArrayEncoder(kt())]])}function qt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getArrayDecoder(Lt())]])}function f_(){return combineCodec(Jt(),qt())}function Yt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(cn())],["addressTableLookups",getArrayEncoder(ps())]])}function Zt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(an())],["addressTableLookups",getArrayDecoder(ms())]])}function C_(){return combineCodec(Yt(),Zt())}function ps(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function ms(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function P_(){return combineCodec(ps(),ms())}function zn(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function Kn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function R_(){return combineCodec(zn(),Kn())}function jn(){return getStructEncoder([["transferring",getU8Encoder()]])}function Jn(){return getStructDecoder([["transferring",getU8Decoder()]])}function v_(){return combineCodec(jn(),Jn())}var ys=(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))(ys||{});function Xt(){return getEnumEncoder(ys)}function Qt(){return getEnumDecoder(ys)}function k_(){return combineCodec(Xt(),Qt())}function et(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",H()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(Xt()))],["wallets",getArrayEncoder(os())],["role",qe()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function q(){return getStructDecoder([["domainConfig",getOptionDecoder(getAddressDecoder())],["member",ce()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(Qt()))],["wallets",getArrayDecoder(cs())],["role",Ye()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function N_(){return combineCodec(et(),q())}function xe(){return getStructEncoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",getU8Encoder()]])}function Ie(){return getStructDecoder([["addressTreeInfo",wt()],["outputStateTreeIndex",getU8Decoder()]])}function F_(){return combineCodec(xe(),Ie())}function tt(){return getStructEncoder([["accountMeta",xt()],["data",et()]])}function rt(){return getStructDecoder([["accountMeta",It()],["data",q()]])}function j_(){return combineCodec(tt(),rt())}function Ot(){return getStructEncoder([["accountMeta",Dt()],["data",et()]])}function Bt(){return getStructDecoder([["accountMeta",Pt()],["data",q()]])}function Z_(){return combineCodec(Ot(),Bt())}function ze(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Ot()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([tt()])]])]])}function Ke(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Bt()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([rt()])]])]])}function ev(){return combineCodec(ze(),Ke())}function tv(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function rv(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 Ye(){return getEnumDecoder(Oe)}function ov(){return combineCodec(qe(),Ye())}var Bc=new Uint8Array([223,179,163,190,177,224,67,173]);function iU(){return fixEncoderSize(getBytesEncoder(),8).encode(Bc)}function hT(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(bt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:Bc}))}function br(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(_t())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function dU(){return combineCodec(hT(),br())}function Nc(e){return decodeAccount(e,br())}async function uU(e,n,r){let s=await ls(e,n,r);return assertAccountExists(s),s}async function ls(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Nc(s)}async function AU(e,n,r){let s=await RT(e,n,r);return assertAccountsExist(s),s}async function RT(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Nc(t))}var Gc=new Uint8Array([90,36,35,219,93,225,110,96]);function yU(){return fixEncoderSize(getBytesEncoder(),8).encode(Gc)}function jT(){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(kt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Gc}))}function zc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multiWalletSettings",getAddressDecoder()],["multiWalletBump",getU8Decoder()],["canExecute",getBooleanDecoder()],["preauthorizeExecution",getBooleanDecoder()],["validTill",getU64Decoder()],["payer",getAddressDecoder()],["bump",getU8Decoder()],["bufferIndex",getU8Decoder()],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["creator",ce()],["executor",ce()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(ce())],["expectedSecp256r1Signers",getArrayDecoder(Lt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function lU(){return combineCodec(jT(),zc())}function Kc(e){return decodeAccount(e,zc())}async function jc(e,n,r){let s=await JT(e,n,r);return assertAccountExists(s),s}async function JT(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Kc(s)}async function TU(e,n,r){let s=await qT(e,n,r);return assertAccountsExist(s),s}async function qT(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Kc(t))}var Yc=new Uint8Array([105,23,173,2,197,255,80,87]);function xU(){return fixEncoderSize(getBytesEncoder(),8).encode(Yc)}function pf(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Yc}))}function Zc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function IU(){return combineCodec(pf(),Zc())}function Xc(e){return decodeAccount(e,Zc())}async function Qc(e,n,r){let s=await mf(e,n,r);return assertAccountExists(s),s}async function mf(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Xc(s)}async function CU(e,n,r){let s=await yf(e,n,r);return assertAccountsExist(s),s}async function yf(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Xc(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 ea(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function O(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function y(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let s=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:O(r.value),role:$c(r.value)?upgradeRoleToSigner(s):s,...$c(r.value)?{signer:r.value}:{}})}}function $c(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var ra=new Uint8Array([8]);function wU(){return fixEncoderSize(getBytesEncoder(),1).encode(ra)}function Ds(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:ra}))}function na(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function VU(){return combineCodec(Ds(),na())}async function sa(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),o=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:Ds().encode(c),programAddress:r})}function HU(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),o=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:Ds().encode(c),programAddress:r})}function FU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:na().decode(e.data)}}var da=new Uint8Array([9]);function YU(){return fixEncoderSize(getBytesEncoder(),1).encode(da)}function Ms(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(je())],["secp256r1VerifyArgs",getArrayEncoder($())],["compressedProofArgs",getOptionEncoder(C())]]),e=>({...e,discriminator:da}))}function ua(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(Je())],["secp256r1VerifyArgs",getArrayDecoder(ee())],["compressedProofArgs",getOptionDecoder(E())]])}function ZU(){return combineCodec(Ms(),ua())}async function Aa(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.settings.value||(t.settings.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getU128Encoder().encode(ea(c.settingsIndex))]})),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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ms().encode(c),programAddress:r})}function XU(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ms().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},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:ua().decode(e.data)}}var la=new Uint8Array([19]);function oW(){return fixEncoderSize(getBytesEncoder(),1).encode(la)}function Ta(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(je())],["secp256r1VerifyArgs",getArrayEncoder($())],["settingsMutArgs",j()],["compressedProofArgs",C()]]),e=>({...e,discriminator:la}))}function fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Je())],["secp256r1VerifyArgs",getArrayDecoder(ee())],["settingsMutArgs",J()],["compressedProofArgs",E()]])}function cW(){return combineCodec(Ta(),fa())}function Sa(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ta().encode(c),programAddress:r})}function aW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:fa().decode(e.data)}}var Ca=new Uint8Array([18]);function mW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ca)}function hs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["settingsCreation",Ht()],["userArgs",ze()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Ca}))}function Ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["settingsCreation",Ft()],["userArgs",Ke()],["settingsIndex",getU128Decoder()]])}function yW(){return combineCodec(hs(),Ea())}async function Da(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:hs().encode(c),programAddress:r})}function lW(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:hs().encode(c),programAddress:r})}function TW(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:Ea().decode(e.data)}}var Ua=new Uint8Array([0]);function DW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ua)}function bs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",xe()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ua}))}function Wa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",Ie()],["compressedProofArgs",E()]])}function PW(){return combineCodec(bs(),Wa())}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),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:bs().encode(c),programAddress:r})}function MW(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),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:bs().encode(c),programAddress:r})}function hW(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Wa().decode(e.data)}}var Ba=new Uint8Array([4]);function kW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ba)}function _s(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["member",rs()],["role",qe()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(Xt())],["userAccountCreationArgs",xe()],["linkWalletArgs",getOptionEncoder(qn())]]),e=>({...e,discriminator:Ba}))}function Na(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["member",Vt()],["role",Ye()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Qt())],["userAccountCreationArgs",Ie()],["linkWalletArgs",getOptionDecoder(Yn())]])}function LW(){return combineCodec(_s(),Na())}async function wa(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:_s().encode(c),programAddress:r})}function OW(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}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:_s().encode(c),programAddress:r})}function BW(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:Na().decode(e.data)}}var Ha=new Uint8Array([3]);function GW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ha)}function Us(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Ha}))}function Fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function zW(){return combineCodec(Us(),Fa())}async function Ga(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:Us().encode({}),programAddress:r})}function KW(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:Us().encode({}),programAddress:r})}function jW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:Fa().decode(e.data)}}var Ka=new Uint8Array([5]);function $W(){return fixEncoderSize(getBytesEncoder(),1).encode(Ka)}function ks(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["createUserArgs",getArrayEncoder(On())]]),e=>({...e,discriminator:Ka}))}function ja(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["createUserArgs",getArrayDecoder(Bn())]])}function ek(){return combineCodec(ks(),ja())}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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:ks().encode(c),programAddress:r})}function tk(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:ks().encode(c),programAddress:r})}function rk(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:ja().decode(e.data)}}var Za=new Uint8Array([17]);function dk(){return fixEncoderSize(getBytesEncoder(),1).encode(Za)}function Xa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",j()],["compressedProofArgs",C()],["secp256r1VerifyArgs",getArrayEncoder($())]]),e=>({...e,discriminator:Za}))}function Qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",J()],["compressedProofArgs",E()],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function uk(){return combineCodec(Xa(),Qa())}function $a(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Xa().encode(c),programAddress:r})}function Ak(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Qa().decode(e.data)}}var ri=new Uint8Array([2]);function Tk(){return fixEncoderSize(getBytesEncoder(),1).encode(ri)}function ni(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:ri}))}function si(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function fk(){return combineCodec(ni(),si())}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}),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...a],data:ni().encode(c),programAddress:r})}function Sk(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:si().decode(e.data)}}var di=new Uint8Array([1]);function Mk(){return fixEncoderSize(getBytesEncoder(),1).encode(di)}function Os(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Qn())]]),e=>({...e,discriminator:di}))}function ui(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder($n())]])}function hk(){return combineCodec(Os(),ui())}async function Rk(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),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:Os().encode(c),programAddress:r})}function Ai(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),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:Os().encode(c),programAddress:r})}function bk(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:ui().decode(e.data)}}var mi=new Uint8Array([6]);function Ok(){return fixEncoderSize(getBytesEncoder(),1).encode(mi)}function yi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",tt()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",C()]]),e=>({...e,discriminator:mi}))}function li(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",rt()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",E()]])}function Bk(){return combineCodec(yi(),li())}function Ti(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.authority),...a],data:yi().encode(c),programAddress:r})}function Nk(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:li().decode(e.data)}}var xi=new Uint8Array([7]);function Kk(){return fixEncoderSize(getBytesEncoder(),1).encode(xi)}function Ii(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",tt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["delegateTo",getOptionEncoder(ns())],["oldSettingsMutArgs",getOptionEncoder(j())],["newSettingsMutArgs",getOptionEncoder(j())],["compressedProofArgs",C()]]),e=>({...e,discriminator:xi}))}function Ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",rt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["delegateTo",getOptionDecoder(ss())],["oldSettingsMutArgs",getOptionDecoder(J())],["newSettingsMutArgs",getOptionDecoder(J())],["compressedProofArgs",E()]])}function jk(){return combineCodec(Ii(),Ci())}function Ei(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),o=y(r);return Object.freeze({accounts:[o(t.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...a],data:Ii().encode(c),programAddress:r})}function Jk(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:Ci().decode(e.data)}}var Mi=new Uint8Array([32]);function eL(){return fixEncoderSize(getBytesEncoder(),1).encode(Mi)}function hi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",ht()],["compressedProofArgs",C()],["settingsCreationArgs",Ht()]]),e=>({...e,discriminator:Mi}))}function Ri(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Rt()],["compressedProofArgs",E()],["settingsCreationArgs",Ft()]])}function tL(){return combineCodec(hi(),Ri())}function bi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.authority),...a],data:hi().encode(c),programAddress:r})}function rL(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Ri().decode(e.data)}}var Ui=new Uint8Array([31]);function dL(){return fixEncoderSize(getBytesEncoder(),1).encode(Ui)}function Wi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",et()],["compressedProofArgs",C()],["userCreationArgs",xe()]]),e=>({...e,discriminator:Ui}))}function ki(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",q()],["compressedProofArgs",E()],["userCreationArgs",Ie()]])}function uL(){return combineCodec(Wi(),ki())}function Li(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.authority),...a],data:Wi().encode(c),programAddress:r})}function AL(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:ki().decode(e.data)}}var Bi=new Uint8Array([29]);function fL(){return fixEncoderSize(getBytesEncoder(),1).encode(Bi)}function Bs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder($())]]),e=>({...e,discriminator:Bi}))}function Ni(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function SL(){return combineCodec(Bs(),Ni())}async function xL(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:Bs().encode(c),programAddress:r})}function wi(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:Bs().encode(c),programAddress:r})}function IL(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Ni().decode(e.data)}}var Fi=new Uint8Array([27]);function RL(){return fixEncoderSize(getBytesEncoder(),1).encode(Fi)}function Gi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder($())],["settingsMutArgs",j()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Fi}))}function zi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(ee())],["settingsMutArgs",J()],["compressedProofArgs",E()]])}function bL(){return combineCodec(Gi(),zi())}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: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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:Gi().encode(c),programAddress:r})}function _L(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:zi().decode(e.data)}}var Yi=new Uint8Array([30]);function BL(){return fixEncoderSize(getBytesEncoder(),1).encode(Yi)}function Vs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Kt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(vt()))],["compressedProofArgs",getOptionEncoder(C())],["secp256r1VerifyArgs",getArrayEncoder($())]]),e=>({...e,discriminator:Yi}))}function Zi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(jt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(Ut()))],["compressedProofArgs",getOptionDecoder(E())],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function NL(){return combineCodec(Vs(),Zi())}async function wL(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...a],data:Vs().encode(c),programAddress:r})}function Xi(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...a],data:Vs().encode(c),programAddress:r})}function VL(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:Zi().decode(e.data)}}var nd=new Uint8Array([28]);function JL(){return fixEncoderSize(getBytesEncoder(),1).encode(nd)}function Hs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Kt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(vt()))],["secp256r1VerifyArgs",getArrayEncoder($())],["settingsMutArgs",j()],["compressedProofArgs",C()]]),e=>({...e,discriminator:nd}))}function sd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(jt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(Ut()))],["secp256r1VerifyArgs",getArrayDecoder(ee())],["settingsMutArgs",J()],["compressedProofArgs",E()]])}function qL(){return combineCodec(Hs(),sd())}async function YL(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...a],data:Hs().encode(c),programAddress:r})}function od(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...a],data:Hs().encode(c),programAddress:r})}function ZL(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:sd().decode(e.data)}}var id=new Uint8Array([13]);function nO(){return fixEncoderSize(getBytesEncoder(),1).encode(id)}function dd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:id}))}function ud(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function sO(){return combineCodec(dd(),ud())}function Ad(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:dd().encode(c),programAddress:r})}function oO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ud().decode(e.data)}}var md=new Uint8Array([23]);function gO(){return fixEncoderSize(getBytesEncoder(),1).encode(md)}function yd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",j()],["compressedProofArgs",C()]]),e=>({...e,discriminator:md}))}function ld(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",J()],["compressedProofArgs",E()]])}function pO(){return combineCodec(yd(),ld())}function Td(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:yd().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},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ld().decode(e.data)}}var xd=new Uint8Array([10]);function IO(){return fixEncoderSize(getBytesEncoder(),1).encode(xd)}function Id(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Jt()],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:xd}))}function Cd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",qt()],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function CO(){return combineCodec(Id(),Cd())}function Ed(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...a],data:Id().encode(c),programAddress:r})}function EO(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Cd().decode(e.data)}}var Md=new Uint8Array([20]);function _O(){return fixEncoderSize(getBytesEncoder(),1).encode(Md)}function hd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Jt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",Gt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Md}))}function Rd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",qt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",zt()],["compressedProofArgs",E()]])}function vO(){return combineCodec(hd(),Rd())}function bd(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...a],data:hd().encode(c),programAddress:r})}function UO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Rd().decode(e.data)}}var Ud=new Uint8Array([14]);function wO(){return fixEncoderSize(getBytesEncoder(),1).encode(Ud)}function Wd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Ud}))}function kd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function VO(){return combineCodec(Wd(),kd())}function Ld(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Wd().encode(c),programAddress:r})}function HO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:kd().decode(e.data)}}var Nd=new Uint8Array([24]);function qO(){return fixEncoderSize(getBytesEncoder(),1).encode(Nd)}function wd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",j()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Nd}))}function Vd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",J()],["compressedProofArgs",E()]])}function YO(){return combineCodec(wd(),Vd())}function Hd(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:wd().encode(c),programAddress:r})}function ZO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Vd().decode(e.data)}}var zd=new Uint8Array([12]);function rB(){return fixEncoderSize(getBytesEncoder(),1).encode(zd)}function Kd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:zd}))}function jd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function nB(){return combineCodec(Kd(),jd())}function Jd(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}),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...a],data:Kd().encode(c),programAddress:r})}function sB(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:jd().decode(e.data)}}var Zd=new Uint8Array([22]);function uB(){return fixEncoderSize(getBytesEncoder(),1).encode(Zd)}function Xd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Zd}))}function Qd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function AB(){return combineCodec(Xd(),Qd())}function $d(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.transactionBuffer),...a],data:Xd().encode(c),programAddress:r})}function gB(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:Qd().decode(e.data)}}var ru=new Uint8Array([11]);function SB(){return fixEncoderSize(getBytesEncoder(),1).encode(ru)}function nu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:ru}))}function su(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function xB(){return combineCodec(nu(),su())}function ou(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:nu().encode(c),programAddress:r})}function IB(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:su().decode(e.data)}}var iu=new Uint8Array([21]);function RB(){return fixEncoderSize(getBytesEncoder(),1).encode(iu)}function du(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",Gt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:iu}))}function uu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",zt()],["compressedProofArgs",E()]])}function bB(){return combineCodec(du(),uu())}function Au(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:du().encode(c),programAddress:r})}function _B(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:uu().decode(e.data)}}var mu=new Uint8Array([15]);function OB(){return fixEncoderSize(getBytesEncoder(),1).encode(mu)}function yu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:mu}))}function lu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function BB(){return combineCodec(yu(),lu())}function Tu(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:yu().encode({}),programAddress:r})}function NB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:lu().decode(e.data)}}var xu=new Uint8Array([25]);function zB(){return fixEncoderSize(getBytesEncoder(),1).encode(xu)}function Iu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:xu}))}function Cu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function KB(){return combineCodec(Iu(),Cu())}function Eu(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}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...a],data:Iu().encode(c),programAddress:r})}function jB(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:Cu().decode(e.data)}}var Mu=new Uint8Array([16]);function $B(){return fixEncoderSize(getBytesEncoder(),1).encode(Mu)}function hu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Yt()],["secp256r1VerifyArgs",getArrayEncoder($())]]),e=>({...e,discriminator:Mu}))}function Ru(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Zt()],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function eN(){return combineCodec(hu(),Ru())}function bu(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:hu().encode(c),programAddress:r})}function tN(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Ru().decode(e.data)}}var Uu=new Uint8Array([26]);function iN(){return fixEncoderSize(getBytesEncoder(),1).encode(Uu)}function Wu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Yt()],["secp256r1VerifyArgs",getArrayEncoder($())],["settingsMutArgs",j()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Uu}))}function ku(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Zt()],["secp256r1VerifyArgs",getArrayDecoder(ee())],["settingsMutArgs",J()],["compressedProofArgs",E()]])}function dN(){return combineCodec(Wu(),ku())}function Lu(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Wu().encode(c),programAddress:r})}function uN(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:ku().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",WE=(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))(WE||{});function qN(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([201,232,212,229,59,241,106,197])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([42,206,176,58,175,129,130,233])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([223,179,163,190,177,224,67,173])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([90,36,35,219,93,225,110,96])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([105,23,173,2,197,255,80,87])),0))return 4;throw new Error("The provided account could not be identified as a multiWallet account.")}var kE=(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.MigrateCompressedSettings=13]="MigrateCompressedSettings",l[l.MigrateCompressedUsers=14]="MigrateCompressedUsers",l[l.NativeTransferIntent=15]="NativeTransferIntent",l[l.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",l[l.TokenTransferIntent=17]="TokenTransferIntent",l[l.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",l[l.TransactionBufferClose=19]="TransactionBufferClose",l[l.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",l[l.TransactionBufferCreate=21]="TransactionBufferCreate",l[l.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",l[l.TransactionBufferExecute=23]="TransactionBufferExecute",l[l.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",l[l.TransactionBufferExtend=25]="TransactionBufferExtend",l[l.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",l[l.TransactionBufferVote=27]="TransactionBufferVote",l[l.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",l[l.TransactionExecute=29]="TransactionExecute",l[l.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",l[l.TransactionExecuteSync=31]="TransactionExecuteSync",l[l.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",l))(kE||{});function YN(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 4;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 5;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 6;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 7;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 8;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 9;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 10;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 11;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 12;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([32])),0))return 13;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([31])),0))return 14;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 15;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 16;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 17;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 18;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 19;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 20;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 21;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 22;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 23;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 24;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 25;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 26;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 27;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 28;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 29;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 30;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 31;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 32;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var OE=6e3,BE=6001,NE=6002,wE=6003,VE=6004,HE=6005,FE=6006,GE=6007,zE=6008,KE=6009,jE=6010,JE=6011,qE=6012,YE=6013,ZE=6014,XE=6015,QE=6016,$E=6017,eD=6018,tD=6019,rD=6020,nD=6021,sD=6022,oD=6023,cD=6024,aD=6025,iD=6026,dD=6027,uD=6028,AD=6029,gD=6030,pD=6031,mD=6032,yD=6033,lD=6034,TD=6035,fD=6036,SD=6037,xD=6038,ID=6039,CD=6040,ED=6041,DD=6042,PD=6043,MD=6044,hD=6045,RD=6046,bD=6047,_D=6048,vD=6049,UD=6050,WD=6051,kD=6052,LD=6053,OD=6054,BD=6055,ND=6056,wD=6057,VD=6058,HD=6059,FD=6060,GD=6061,zD=6062,KD=6063,jD=6064,JD=6065,qD=6066,YD=6067,ZD=6068,XD=6069,QD=6070,$D=6071,eP=6072,tP=6073,rP=6074,nP=6075,sP=6076,oP=6077,cP=6078,aP=6079,iP=6080,dP=6081,uP=6082,AP=6083,gP=6084,pP=6085,mP=6086,Ou;process.env.NODE_ENV!=="production"&&(Ou={[pD]:"This member is already delegated to another wallet.",[GE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[oP]:"Clock sysvar access failed. This may indicate a system error.",[WD]:"Missing credential id.",[LD]:"The domain configuration account is disabled. Please contact support or try again later.",[OD]:"Missing domain configuration account.",[nP]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[mP]:"Duplicate address tree detected. This address tree is already in the whitelist.",[jE]:"Duplicate public keys detected among members. Each member must have a unique key.",[KE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[nD]:"No members provided. A multisig wallet must contain at least one member.",[FD]:"Slot numbers list is empty. At least one slot number is required for validation.",[eD]:"Expected a User with Administrator role for this instruction.",[zE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[QE]:"Expected a User with Transaction Manager role for this instruction.",[CD]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[ED]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[DD]:"Declared buffer size does not match the actual serialized size.",[HD]:"Failed to compute hash. This may indicate a system error.",[lD]:"Not enough members with vote permission to meet the approval threshold.",[mD]:"At least one signer with execute permission is required to proceed.",[yD]:"At least one signer with initiate permission is required to perform this action.",[iD]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[rP]:"Invalid account index in transaction message. The account index is out of bounds.",[wD]:"Address Tree supplied is not part of the whitelisted address trees.",[tD]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[uD]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[ID]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[GD]:"Member key conversion failed. The provided key format is invalid.",[TD]:"Only delegated members are allowed for this transaction.",[aD]:"Unexpected number of accounts provided for this instruction.",[YE]:"User with Permanent Member role must have a delegated wallet.",[BE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[VE]:"The extracted public key has an invalid length or encoding.",[OE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[wE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[UD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[_D]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[oD]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[$D]:"Invalid source type for token transfer. The source account type is not supported.",[$E]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[XE]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[cD]:"Malformed transaction message: structure or formatting does not match the expected layout.",[iP]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[dD]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[aP]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[QD]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[HE]:"The extracted WebAuthn signed message payload is malformed.",[RD]:"An input string exceeds the maximum allowed character length.",[BD]:"This member is not registered under the provided domain configuration.",[jD]:"Member not found in settings. Cannot remove a member that does not exist.",[tP]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[AD]:"A required account is missing from the instruction context.",[zD]:"Compressed proof arguments are missing. Required for compressed account operations.",[YD]:"Missing compressed token account. Required for token transfer operations.",[dP]:"Missing destination token account. Required for token transfer operations.",[XD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[KD]:"Light CPI accounts are missing. Required for compressed account operations.",[gD]:"User mutation arguments are required when performing add or remove delegate operations.",[gP]:"Missing new authority account. Required for domain configuration updates.",[AP]:"Missing settings account. Required for delegate operations on compressed wallets.",[VD]:"Compressed settings data is missing. The settings account must be initialized with data.",[uP]:"Missing source token account. Required for token transfer operations.",[ZD]:"Missing SPL interface PDA. Required for token transfer operations.",[bD]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[sP]:"User account address is missing. Required for secp256r1 signature verification.",[pP]:"Missing whitelisted address trees account. Required for domain configuration updates.",[SD]:"No valid signer found in this transaction.",[rD]:"Only one administrator is allowed per wallet.",[qE]:"Only one permanent member is allowed per wallet.",[ZE]:"Only one transaction manager is allowed per wallet.",[ND]:"The given origin index is not in the whitelisted origins.",[qD]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[JE]:"Permanent members cannot be removed from a wallet.",[hD]:"Writable CPI calls to protected accounts are not permitted.",[FE]:"The rpIdHash extracted from the signed message does not match the expected value.",[JD]:"Settings key mismatch. The provided settings key does not match the expected value.",[NE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[vD]:"The specified slot number was not found in the provided slot history.",[eP]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[sD]:"Too many members: a maximum of 4 members are supported.",[PD]:"This transaction has expired. It must be executed within 3 minutes of approval.",[MD]:"This transaction has not yet reached the required approval threshold.",[kD]:"Missing transports.",[xD]:"Only the transaction creator or rent payer may close this transaction buffer.",[cP]:"Unauthorized: Only the admin account is allowed to perform this action.",[fD]:"Member is not part of the expected signers for this transaction."});function tw(e){return process.env.NODE_ENV!=="production"?Ou[e]:"Error message not available in production bundles."}function rw(e,n,r){return isProgramError(e,n,A,r)}async function pw({admin:e,addressTree:n}){return sa({payer:e,addressTree:n,remainingAccounts:[]})}var zs=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Bu="https://mainnet.block-engine.jito.wtf/api/v1",Nu="https://bundles.jito.wtf/api/v1/bundles/tip_floor",wu="landed_tips_75th_percentile";var ve=class extends Error{constructor(r,s,t){super(r);this.code=s;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},Be=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");}},Y=class extends ve{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},Pe=class extends ve{constructor(r,s,t){super(r,"NETWORK_ERROR",{statusCode:s,url:t});this.statusCode=s;this.url=t;}};var me=class extends ve{constructor(r,s,t){super(r,"BUNDLE_ERROR",{bundleId:s,attempt:t});this.bundleId=s;this.attempt=t;}},wr=class extends ve{constructor(r,s,t){super(`Operation "${r}" failed after ${s} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=s;this.lastError=t;}},Vr=class extends ve{constructor(r,s,t){super(r,"PERMISSION_ERROR",{required:s,actual:t});this.required=s;this.actual=t;}};var tr={Ed25519:1,Secp256r1:2};var Vu=f.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),Iw=f.object({transactionActionType:Vu,transactionAddress:f.string(),transactionMessageBytes:f.array(f.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),Hu=f.object({transactionActionType:Vu,transactionAddress:f.string(),transactionMessageBytes:f.base64()}).strict(),Fu=f.object({authResponse:f.custom(),nonce:f.base64(),client:f.object({clientOrigin:f.url(),jws:f.base64()}).strict(),device:f.object({jwk:f.base64(),jws:f.base64()}).strict(),authProvider:f.object({jwk:f.base64(),jws:f.base64()}).strict().optional()}).strict(),Gu=f.object({signer:f.string(),userAddressTreeIndex:f.number().optional(),additionalInfo:f.looseObject({}).optional()}).strict(),yP=f.object({transactionPayload:Hu,slotHash:f.string(),slotNumber:f.string(),originIndex:f.number(),crossOrigin:f.boolean()}).strict(),Cw=f.object({phase:f.literal("start"),redirectOrigin:f.url(),signer:f.string().optional(),data:f.object({type:f.literal("message"),payload:f.string().optional()}).strict()}).strict(),Ew=f.object({phase:f.literal("start"),redirectOrigin:f.url(),signer:f.string().optional(),data:f.object({type:f.literal("transaction"),payload:Hu}).strict()}).strict(),Dw=f.object({phase:f.literal("complete"),data:f.object({type:f.literal("message"),payload:Gu.extend(Fu.shape).extend({id:f.string().optional(),message:f.string(),client:f.object({clientOrigin:f.url()}).strict()})}).strict()}).strict(),Pw=f.object({phase:f.literal("complete"),data:f.object({type:f.literal("transaction"),payload:Gu.extend(Fu.shape).extend(yP.shape).extend({client:f.object({clientOrigin:f.url()}).strict()})}).strict()}).strict();var Ue={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Ne=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(Ue).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var Ks=33,we=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!==Ks)throw new Error(`Invalid public key length, expected ${Ks} 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===Ks)return n;throw new Error("Invalid public key input")}toBytes(){let n=this.toBuffer();return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}toString(){return this.toBase58()}toJSON(){return this.toBase58()}},P=class extends we{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 fP(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function SP(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var Ku=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(fP())],["addressTableLookups",getArrayCodec(SP())]]);function ju(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 Ju(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 ne={};function qu(){if(!ne.solanaRpcEndpoint)throw new Be("RPC endpoint");return ne.solanaRpcEndpoint}function Me(){if(!ne.lightProtocolRpc)throw new Be("Light Protocol RPC");return ne.lightProtocolRpc}function se(){if(!ne.solanaRpc)throw new Be("Solana RPC");return ne.solanaRpc}function Yu(){if(!ne.sendAndConfirm)throw new Be("Send and confirm transaction function");return ne.sendAndConfirm}function Zu(){if(!ne.computeEstimate)throw new Be("Compute budget estimate function");return ne.computeEstimate}function Js(){return ne.jitoTipsConfig?ne.jitoTipsConfig:{blockEngineUrl:Bu,getJitoTipsUrl:Nu,priority:wu}}function Yw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){ne.solanaRpcEndpoint=e,ne.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});ne.solanaRpc=t,ne.sendAndConfirm=c,ne.computeEstimate=estimateComputeUnitLimitFactory({rpc:t}),ne.jitoTipsConfig=s??null;}async function rr(e,n){if(!e.ok)throw new Pe(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function nr(e){try{return await e.json()}catch(n){throw new Pe(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function u2(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Fr(n.get(-2))),y:BigInt("0x"+Fr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function A2(e){let r=p256.Point.fromBytes(getBase58Encoder().encode(e)).toBytes(false),s=new Map;return s.set(1,2),s.set(3,-7),s.set(-1,1),s.set(-2,r.slice(1,33)),s.set(-3,r.slice(33,65)),new Uint8Array(encodeCBOR(s))}async function g2(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=Ee(n),c=JSON.parse(getUtf8Decoder().decode(Ee(r))),i=eA(c),a=rA(Ee(s)),o=await gt({rpIdHash:t.subarray(0,32)});return new P(e.signer.toString(),{verifyArgs:{clientDataJson:Ee(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:qs(e.client.clientOrigin,e.device.jwk,e.nonce),domainConfig:o,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function qs(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(n),...getBase64Encoder().encode(r)]))}function p2(e){return sha256(getUtf8Encoder().encode(JSON.stringify(e)))}function m2(e){return Ys(e.data.payload.authResponse)}function y2(e,n,r,s){let t=qs(n,r,s);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...t]))}async function l2(e,n,r,s,t,c){let i;if(!t||!c){let u=(await se().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),o=qs(n,r,s),d=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...a,...i,...o]));return {slotNumber:c,slotHash:t,challenge:d}}function Ys(e){let n=Gr(e);return sha256(n)}function T2(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ee(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}async function f2(e,n){let{data:r}=await Eo(se(),e),t=tA(r.origins,r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new re("Origin","Origin not found in domain config");return t}function S2(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function x2(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}function Fr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function _P(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 eA(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let s=JSON.stringify(r);return new TextEncoder().encode(s.slice(1,-1))}function tA(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let i=e[s]|e[s+1]<<8;if(s+=2,s+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(s,s+i),o=t.decode(a);r.push(o),s+=i;}return r}function rA(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let I=n&127;r+=I;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,o=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let p=p256.Point.CURVE().n>>1n,T=BigInt("0x"+Fr(u)),b=(T>p?p256.Point.CURVE().n-T:T).toString(16).padStart(64,"0"),x=_P(b);return new Uint8Array([...g,...x])}function Gr(e){let n=Ee(e.response.clientDataJSON),r=Ee(e.response.authenticatorData),s=sha256(n);return new Uint8Array([...r,...s])}var OP={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true,initialDelayMs:500,maxRetries:3};function BP(e,n,r,s){let t=n*Math.pow(r,e-1);return Math.min(t,s)}function NP(e){return new Promise(n=>setTimeout(n,e))}async function cr(e,n){let{maxRetries:r,initialDelayMs:s,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...OP,...n},a;for(let o=1;o<=r;o++)try{return await e()}catch(d){if(a=d,i&&!i(d,o))throw d;if(o>=r)break;let u=BP(o,s,t,c);await NP(u);}throw new wr(e.name||"retryWithBackoff",r,a)}async function pt(e,n){let r=(s,t)=>t>(n?.maxRetries??3)?false:s instanceof Response?s.status===429?n?.retryOnRateLimit??true:s.status>=400&&s.status<500?false:s.status>=500:s instanceof TypeError||s instanceof Error;return cr(e,{...n,shouldRetry:n?.shouldRetry??r})}function cA(e,n,r,s){if(e<n||e>r)throw new Y(`${s} must be between ${n} and ${r} (inclusive), got ${e}`)}function aA(e,n){if(e<0)throw new Y(`${n} must be non-negative, got ${e}`)}function ar(e,n){if(e.length===0)throw new Y(`${n} cannot be empty`)}function iA(e,n){if(e.trim().length===0)throw new Y(`${n} cannot be empty`)}async function Xs(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await se().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(s.instructions,c),c=>setTransactionMessageFeePayerSigner(s.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let i=Math.ceil((s.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 gA(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===AccountRole.WRITABLE||c.role===AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,i)=>c-i);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function pA(e,n){ar(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new Y(`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 rr(r,n);let s=await nr(r);if(!s.result||s.error)throw new me(`Unable to simulate bundle: ${JSON.stringify(s.error??s.result)}`);if(typeof s.result.value.summary!="string"&&s.result.value.summary.failed){let{TransactionFailure:t}=s.result.value.summary.failed.error,[,c]=t;throw new me(`Simulation failed: ${c}`)}return s.result.value.transactionResults.map(t=>t.unitsConsumed)}function Z(e,n=0){let r=e instanceof P?e:void 0,s=r?.verifyArgs&&n!==-1?some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs.clientDataJson?Gr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:i,publicKey:a}}function he(e){if(e instanceof we)return {keyType:tr.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:tr.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function AA(e){return e instanceof P?e.toString():e.address.toString()}function fe(e){let n=new Set,r=[];for(let t of e)n.has(AA(t))||(r.push(t),n.add(AA(t)));let s=r.filter(t=>t instanceof P);if(s.length>1)throw new Y(`More than 1 Secp256r1 signers in an instruction is not supported (found ${s.length})`);return r}function mA({payer:e,tipAmount:n}){let r=zs[Math.floor(Math.random()*zs.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function yA(e){return typeof e=="string"?e:e.toString()}function lA(e){return e.toString()}async function Qs(e,n,r){let s=e?.get(n);if(s)return s;let t=await r();return t&&e&&e.set(n,t),t}var B=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:r?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(A.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await Me().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let 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:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function zr(e,n){let r=yA(e);return Qs(n,r,()=>Me().getCompressedAccount(e))}async function st(e,n){let r=lA(e);return Qs(n,r,()=>se().getAccountInfo(e,{encoding:"base64"}).send())}async function ye(e,n){let r=(await Promise.all(e.map(s=>zr(s.address,n)))).filter(s=>s!==null).filter(s=>s.data!==null&&s.address!==null);if(r.length!==e.length)throw new re("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((s,t)=>({...s,type:e[t].type,tree:s.treeInfo.tree,queue:s.treeInfo.queue}))}function U(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function Ae(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:s[u],address:d.address.toArray()})),{addressTrees: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 de(e,n,r,s,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:s[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let o=e.packTreeInfos(a,[]).stateTrees;if(!o)throw new Y("Unable to parse state tree data");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Re(e,n,r,s,t){let c=null,i=null,a=null,o=new B;if(e){await o.addSystemAccounts();let{address:d}=await ae(n,r),u=(await ye([{address:d,type:"Settings"}],t))[0];s?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 w([u],[]);let g=o.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 Y("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:o,settingsMutArgs:i}}async function w(e,n){return cr(()=>Me().getValidityProofV0(e,n))}async function be(){return (await Kr()).length-1}var $s;async function Kr(){if(!$s){let{data:e}=await Qc(se(),await xA());$s=e.whitelistedAddressTrees;}return $s}function SA(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 dr(e,n,r){let s=await aM(e,n,r);if(!s)throw new re("User account");return s}async function aM(e,n,r){let{address:s}=await N(e,n),t=await zr(s,r);return t?.data?.data?q().decode(t.data.data):null}async function y5(e,{member:n,credentialId:r}){let s=[{memcmp:{offset:1,encoding:"base58",bytes:e}}];if(n)s.push({memcmp:{offset:33,encoding:"base58",bytes:getBase58Decoder().decode(H().encode(he(n)))}});else if(r)s.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(Ee(r))}});else return null;let t=await Me().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:s});return t.items.filter(c=>!!c.data).length?t.items.map(c=>q().decode(c.data?.data))[0]:null}async function jr(e,n,r){let s=await iM(e,n,r);if(!s)throw new re("Settings account");return s}async function iM(e,n,r){try{let{address:s}=await ae(e,n),t=await zr(s,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 s=await ls(se(),await ue(e));return s.exists?{...s.data,isCompressed:false}:null}}async function l5(e,n,r){let s=await dr(e,n,r);if(s.role===1||s.role===0){let t=[],[c,i]=await Promise.all([Me().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:getBase58Decoder().decode(H().encode(he(e)))}}]}),se().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(H().encode(he(e)))}}]}).send()]);return c.items.forEach(a=>{if(a.data?.data){let o=K().decode(a.data.data);o.data.__option==="Some"&&t.push({...o.data.value,isCompressed:true});}}),i.forEach(a=>{let o=br().decode(getBase64Encoder().encode(a.account.data[0]));t.push({...o,isCompressed:false});}),t}else return await Promise.all(s.wallets.map(t=>jr(t.index,t.settingsAddressTreeIndex,r)))}async function to(e){aA(e,"index");let n=await Kr();if(e>=n.length)throw new Y(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function T5(e){let r=(await Kr()).findIndex(s=>s.toString()===e);if(r===-1)throw new re("Address tree",`Address ${e} not found in whitelist`);return r}async function ae(e,n=0){let r=await to(n),s=deriveAddressSeedV2([getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(A)).toString(),"base58"),addressTree:new PublicKey(r)}}async function N(e,n=0){let r=await to(n),s=deriveAddressSeedV2([getUtf8Encoder().encode("user"),e instanceof we?e.toTruncatedBuffer():getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(A.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function gt({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(getUtf8Encoder().encode(n));else throw new Y("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function MA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function xA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function hA(e,n,r){cA(r,0,255,"buffer_index");let[s]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof we?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function We(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function ue(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function b5(e){let n=await ue(e);return await We(n)}async function _5(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function V5(e){ar(e,"bundle");let n=await Xs(e,true),r=await pA(n.map(getBase64EncodedWireTransaction),qu()),s=await Xs(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await mM(s.map(getBase64EncodedWireTransaction))}async function mM(e,n=Js(),r){ar(e,"serializedTransactions");let{blockEngineUrl:s}=n,t=`${s}/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 rr(c,t);let i=await nr(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 H5(e,n=30,r=3e3,s=Js()){iA(e,"bundleId");let{blockEngineUrl:t}=s,c=`${t}/getBundleStatuses`;return cr(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 rr(i,c);let a=await nr(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 o=a.result.value[0];if(o.confirmation_status==="confirmed"||o.confirmation_status==="finalized"){let d=o.transactions[o.transactions.length-1];if(!d)throw new me("No transactions in confirmed bundle",e);return d}throw new me(`Bundle status: ${o.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:i=>i instanceof me||i instanceof Pe})}async function q5({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await se().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(e,c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([Zu()(c),gA(se(),c.instructions.flatMap(d=>d.accounts??[]))]),o=Math.ceil(i*1.1);return prependTransactionMessageInstructions([...o>2e5?[getSetComputeUnitLimitInstruction({units:o})]:[],...a>0?[getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await Yu()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function d6(e,n){if(n.threshold>1)throw new Y("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(o=>vA(o.pubkey)===e);if(!r)throw new re("Member",`Signer ${e} not found in settings`);let{permissions:s}=r;if(!s)throw new re("Permissions","No permissions found for the current member");let t=Ne.has(s,Ue.InitiateTransaction),c=Ne.has(s,Ue.VoteTransaction),i=Ne.has(s,Ue.ExecuteTransaction);if(t&&c&&i)return {};if(!c||!i)throw new Vr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(o=>o.role===0);if(!a)throw new re("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(vA(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function u6({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await dr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new re("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return UM(n,c.transactionManagerUrl.value,e,s)}function UM(e,n,r,s){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:s?getBase64Decoder().decode(s):void 0,authResponses:r}))})}));if(!c.ok)throw new Pe(`Transaction manager request failed: ${c.statusText}`,c.status,n);let i=await c.json();if("error"in i)throw new Pe(`Transaction manager error: ${i.error}`,c.status,n);return i.signatures.map(a=>({[e]:getBase58Encoder().encode(a)}))}}}function vA(e){return e.keyType===tr.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function A6(e){let n=e.map(c=>je().encode(c)),r=4+n.reduce((c,i)=>c+i.length,0),s=new Uint8Array(r),t=0;s.set(getU32Encoder().encode(e.length),t),t+=4;for(let c of n)s.set(c,t),t+=c.length;return s}function g6(e){let n=0,[r,s]=getU32Decoder().read(e,n);n=s;let t=new Array(r);for(let c=0;c<r;c++){let i=Je().read(e,n);t[c]=i[0],n=i[1];}if(n!==e.length)throw new Y(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function R6({payer:e,rpId:n,origins:r,authority:s}){let t=await gt({rpId:n}),c=new B;await c.addSystemAccounts();let i=await be(),{address:a,addressTree:o}=await N(s.address,i),d=[{address:a,tree:o,queue:o,type:"User"}],u=await w([],d),g=(await Ae(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:T}=c.toAccountMetas(),S=U(u,T);return await ka({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function w6({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let i=[];r.index&&(i.push({address:(await ae(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&i.push({address:(await N(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let a=i.length?await ye(i,t):[],o=await be(),{address:d,addressTree:u}=await N(r.member,o),g=[{address:d,type:"User",tree:u,queue:u}],p=await w(a,g),T=null,S=null,b=a.filter(z=>z.type==="Settings"),x=a.filter(z=>z.type==="User");b.length&&(T=de(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),b,K())[0]),x.length&&(S=de(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,q())[0]);let I=await Ae(c,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),g),{remainingAccounts:_,systemOffset:v}=c.toAccountMetas(),D=U(p,v);return await wa({payer:n,authority:e,compressedProofArgs:D,member:Vt().decode(r.member.toBuffer()),credentialId:Ee(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:T?some({settingsMutArgs:T,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:I[0],domainConfig:s,remainingAccounts:_})}async function G6({payer:e}){let n=await MA();return Ga({payer:e,globalCounter:n})}async function J6({admin:e,rpId:n,disable:r}){let s=await gt({rpId:n});return oi({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function eV({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:i}=await ae(r,s),a=[{address:c,tree:i,queue:i,type:"Settings"}],o=await w([],a),d=(await Ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),p=U(o,g);return bi({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function aV({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:i}=await N(r,s),a=[{address:c,tree:i,queue:i,type:"User"}],o=await w([],a),d=(await Ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),p=U(o,g);return Li({compressedProofArgs:p,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}function kM(e,n,r,s){let t=LM(e,n),c=OM(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function LM(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=s-t,a=r-s-c;return n>=r?false:n<i?true:n>=s?n-s<a:false}function OM(e,n){return n<e.header.numSignerAccounts}async function qr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Ju(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),se()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,o]of t.staticAccounts.entries())i.push({address:o,role:kM(t,a,o,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let o=c[a.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=o[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=o[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 s?.filter(o=>o.address!==e)??[]){let o=i.findIndex(d=>d.address===a.address);o===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[o].role===AccountRole.READONLY||i[o].role===AccountRole.READONLY_SIGNER?i[o]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[o].role===AccountRole.WRITABLE||i[o].role===AccountRole.WRITABLE_SIGNER)&&(i[o]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}var yt=33,lt=64,oo=14,GM=2,zM=address("Secp256r1SigVerify1111111111111111111111111");function KM(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function jM(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function BA(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let s=getU8Decoder().decode(e,n);n+=1;let t=[],c=jM();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=oo;let i=[];for(let a=0;a<r;a++){let o=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:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:i},n]}})}function NA(){return createEncoder({getSizeFromValue:e=>{let n=oo*e.offsets.length,r=e.payload.reduce((s,t)=>s+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 s=KM();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),yt).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),lt).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function CV(){return combineCodec(NA(),BA())}function V(e,n){let r=e.length,s=GM+r*oo,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,g=u+yt,p=g+lt;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),s+=yt+lt+d.length;}let c=n?.programAddress??zM,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:NA().encode(i)}}function EV(e){return {programAddress:e.programAddress,accounts:{},data:BA().decode(e.data)}}async function wA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:o=false}){let d=await We(e),{accountMetas:u,addressLookupTableAccounts:g}=await qr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(V(c)),p.push(o?Eu({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):Tu({transactionBuffer:n,payer:s.address,settings:e})),a&&p.push(mA({payer:s,tipAmount:a})),{instructions:p,addressLookupTableAccounts:g}}async function VA({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:i=[],compressed:a=false,simulateProof:o=false,cachedAccounts:d}){let u=fe(s),g=await ue(e),p=await We(g),[{accountMetas:T,addressLookupTableAccounts:S,transactionMessage:b},{settingsMutArgs:x,proof:I,packedAccounts:_}]=await Promise.all([qr({transactionMessageBytes:r,walletAddress:p,additionalSigners:u.filter(te=>!(te instanceof P)),addressesByLookupTableAddress:c}),Re(a,e,n,o,d)]);_.addPreAccounts(T);let v=u.filter(te=>te instanceof P),{secp256r1VerifyArgs:D}=qM(v,i,_),{remainingAccounts:z,systemOffset:X}=_.toAccountMetas();return {instructions:YM({secp256r1VerifyInput:i,transactionMessage:b,accountMetas:T,compressed:a,payer:t,settingsMutArgs:x,proof:I,systemOffset:X,secp256r1VerifyArgs:D,settings:g,remainingAccounts:z}),addressLookupTableAccounts:S}}function qM(e,n,r){let s=[];for(let t of e){let c=n.length,{domainConfig:i,verifyArgs:a,signature:o,publicKey:d,message:u}=Z(t,c);u&&o&&d&&n.push({message:u,signature:o,publicKey:d}),i&&(r.addPreAccounts([{address:i,role:AccountRole.READONLY}]),a.__option==="Some"&&s.push({domainConfigKey:i,verifyArgs:a.value}));}return {secp256r1VerifyArgs:s}}function YM({secp256r1VerifyInput:e,transactionMessage:n,accountMetas:r,compressed:s,payer:t,settingsMutArgs:c,proof:i,systemOffset:a,secp256r1VerifyArgs:o,settings:d,remainingAccounts:u}){let g=[];e.length>0&&g.push(V(e));let p=ZM(n,r);if(s){if(!t||!c)throw new Error("Payer not found or proof args is missing.");let T=U(i,a);g.push(Lu({secp256r1VerifyArgs:o,transactionMessage:p,settingsMutArgs:c,compressedProofArgs:T,payer:t,remainingAccounts:u}));}else g.push(bu({secp256r1VerifyArgs:o,settings:d,transactionMessage:p,remainingAccounts:u}));return g}function ZM(e,n){if(e.version==="legacy")throw new Error("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:new Uint8Array(r.data??[])})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(s=>s.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function JV({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let o=fe(s),d=await ue(e),u=await We(d),[{packedAccounts:g,proof:p,settingsMutArgs:T},{value:S}]=await Promise.all([Re(a,e,n,false,t),st(u,t)]);if((S?.lamports??0)<BigInt(c))throw new Error("Insufficient balance");let b=[],x=[];for(let D of o)if(D instanceof P){let z=b.length,{domainConfig:X,verifyArgs:ie,signature:te,publicKey:le,message:Te}=Z(D,z);Te&&te&&le&&b.push({message:Te,signature:te,publicKey:le}),X&&(g.addPreAccounts([{address:X,role:AccountRole.READONLY}]),ie.__option==="Some"&&x.push({domainConfigKey:X,verifyArgs:ie.value}));}else g.addPreAccounts([{address:D.address,role:AccountRole.READONLY_SIGNER,signer:D}]);let{remainingAccounts:I,systemOffset:_}=g.toAccountMetas(),v=[];if(b.length>0&&v.push(V(b)),a){if(!i||!T)throw new Error("Payer not found or proof args is missing.");let D=U(p,_);v.push(Ki({amount:c,settingsMutArgs:T,compressedProofArgs:D,payer:i,secp256r1VerifyArgs:x,source:u,destination:r,remainingAccounts:I}));}else v.push(wi({amount:c,secp256r1VerifyArgs:x,source:u,destination:r,settings:d,remainingAccounts:I}));return v}var rh=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),nh=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Zr=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function c8({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:o,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false}){let g=fe(t),p=await ue(e),T=await We(p),S=W=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(W),getAddressEncoder().encode(Zr),getAddressEncoder().encode(s)],programAddress:Zr}),b=()=>{let W=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(s)];return d.restricted&&W.push(getUtf8Encoder().encode("restricted")),d.index>0&&W.push(getU8Encoder().encode(d.index)),W},[x,[I],_,[v],[D]]=await Promise.all([getAssociatedTokenAccountAddress(s,T,o),S(T),getAssociatedTokenAccountAddress(s,r,o),S(r),getProgramDerivedAddress({seeds:b(),programAddress:Zr})]),[z,X,ie,te]=await Promise.all([st(_,c),st(x,c),st(I,c),ch(u,e,n,c)]),le=!!z.value,Te=!!X.value,He=!!ie.value,_e=Te?getTokenDecoder().decode(getBase64Encoder().encode(X.value.data[0])).amount:BigInt(0),it=BigInt(He?ah(getBase64Encoder().encode(ie.value.data[0]))?.amount??0:0),ur=le?_:void 0,en=le?void 0:v,Tt=Te&&(_e+it<BigInt(i)||it>BigInt(0)||!le)||!Te&&le,l=!le,[pe,po]=await Promise.all([oh(T,s,_e,it,BigInt(i),u?3:4),sh(Tt,D,c)]),Q=pe.reduce((W,oe)=>W+oe.parsed.amount.toNumber(),0);if(_e+it+BigInt(Q)<BigInt(i))throw new Error("Insufficient balance");let dt=null,ke=null,Le=new B;if(po&&Le.addPreAccounts([{address:s,role:AccountRole.WRITABLE}]),te||pe.length){await Le.addSystemAccounts();let W=[];if(pe.length&&W.push(...pe.map(oe=>({hash:oe.compressedAccount.hash,tree:oe.compressedAccount.treeInfo.tree,queue:oe.compressedAccount.treeInfo.queue,data:oe.compressedAccount.data,address:oe.compressedAccount.address}))),te&&W.push(te),ke=await w(W,[]),te){let oe=pe.length;dt=de(Le,ke.treeInfos.slice(oe),ke.leafIndices.slice(oe),ke.rootIndices.slice(oe),ke.proveByIndices.slice(oe),W.slice(oe),K())[0];}}let og=pe.length&&ke?some(pe.map((W,oe)=>({isFrozen:W.parsed.state===AccountState.Frozen,hasDelegate:W.parsed.delegate!=null,amount:W.parsed.amount.toNumber(),merkleContext:{leafIndex:W.compressedAccount.leafIndex,merkleTreePubkeyIndex:Le.insertOrGet(W.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:Le.insertOrGet(W.compressedAccount.treeInfo.queue.toString()),proveByIndex:W.compressedAccount.proveByIndex},rootIndex:ke.rootIndices[oe],version:SA(W.compressedAccount.data?.discriminator),tlv:W.parsed.tlv?some(getArrayDecoder(Wt()).decode(W.parsed.tlv)):none()}))):none(),Ar=[],mo=[];for(let W of g)if(W instanceof P){let oe=Ar.length,{domainConfig:tn,verifyArgs:lo,signature:To,publicKey:fo,message:So}=Z(W,oe);So&&To&&fo&&Ar.push({message:So,signature:To,publicKey:fo}),tn&&(Le.addPreAccounts([{address:tn,role:AccountRole.READONLY}]),lo.__option==="Some"&&mo.push({domainConfigKey:tn,verifyArgs:lo.value}));}else Le.addPreAccounts([{address:W.address,role:AccountRole.READONLY_SIGNER,signer:W}]);let{remainingAccounts:cg,systemOffset:ag}=Le.toAccountMetas(),gr=[];Ar.length>0&&gr.push(V(Ar));let ig=U(ke,ag),dg=Tt?D:void 0,ug=l?nh:void 0,Ag=Tt?some(d):none(),yo={amount:i,secp256r1VerifyArgs:mo,source:T,destination:r,sourceCtokenTokenAccount:I,sourceSplTokenAccount:x,destinationCtokenTokenAccount:en,destinationSplTokenAccount:ur,mint:s,tokenProgram:o,remainingAccounts:cg,payer:a,sourceCompressedTokenAccounts:og,compressedProofArgs:ig,compressibleConfig:rh,splInterfacePda:dg,rentSponsor:ug,splInterfacePdaArgs:Ag};if(u){if(!dt)throw new Error("Payer not found or proof args is missing.");gr.push(od({...yo,settingsMutArgs:dt}));}else gr.push(Xi({...yo,settings:p}));return gr}async function sh(e,n,r){if(!e)return false;let{value:s}=await st(n,r);return !s}async function oh(e,n,r,s,t,c){let i=t-r-s;if(i<=0)return [];let o=(await Me().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(n)})).items.filter(g=>!!g.compressedAccount.data?.data.length&&g.compressedAccount.owner.toString()===Zr.toString()&&!g.parsed.amount.isZero()).sort((g,p)=>p.parsed.amount.cmp(g.parsed.amount));if(o.length===0)return [];let d=BigInt(0),u=[];for(let g of o){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 ch(e,n,r,s){if(!e)return null;let{address:t}=await ae(n,r);return (await ye([{address:t,type:"Settings"}],s))[0]}function ah(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 T8({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:o}=r,d=fe(e),u=d.filter(_=>!(_ instanceof P));i.addPreAccounts(u.map(_=>({address:_.address,role:AccountRole.READONLY_SIGNER,signer:_})));let g=d.filter(_=>_ instanceof P),p=[],T=[];for(let _ of g){let v=T.length,{domainConfig:D,verifyArgs:z,signature:X,publicKey:ie,message:te}=Z(_,v);te&&X&&ie&&T.push({message:te,signature:X,publicKey:ie}),D&&(i.addPreAccounts([{address:D,role:AccountRole.READONLY}]),z.__option==="Some"&&p.push({domainConfigKey:D,verifyArgs:z.value}));}let{remainingAccounts:S,systemOffset:b}=i.toAccountMetas(),x=U(a,b),I=[];if(T.length>0&&I.push(V(T)),c){if(!o)throw new Error("Payer not found or proof args is missing.");I.push(Sa({configActions:t,payer:n,compressedProofArgs:x,settingsMutArgs:o,remainingAccounts:S,secp256r1VerifyArgs:p}));}else I.push(await Aa({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:S,secp256r1VerifyArgs:p}));return I}async function D8({createUserArgs:e,payer:n}){let r=new B;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:AccountRole.READONLY_SIGNER,signer:u.member})));let s=await be(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:p}=await N(u.member.address,s);return {address:g,tree:p,queue:p,type:"User"}})),c=await w([],t),i=await Ae(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:o}=r.toAccountMetas(),d=U(c,o);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 v8({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let i=[],a=[];a.push(...await ye([{address:(await N(r.address,s)).address,type:"User"}],t));let o=await be(),{address:d,addressTree:u}=await ae(e,o);i.push({address:d,queue:u,tree:u,type:"Settings"});let g=a.length,p=await w(a,i),T=de(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),a.filter(v=>v.type==="User"),q())[0],b=(await Ae(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),i)).find(v=>v.type==="Settings")??null,{remainingAccounts:x,systemOffset:I}=c.toAccountMetas(),_=U(p,I);if(!b)throw new Error("Settings creation args is missing.");return await Da({settingsIndex:e,payer:n,initialMember:r,userArgs:T.data.role===3?{__kind:"Mutate",fields:[T]}:{__kind:"Read",fields:[T]},compressedProofArgs:_,settingsCreation:b,remainingAccounts:x})}async function V8({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await Re(true,e,n,false,t);if(!a)throw new Error("Proof args is missing");let o=fe(s),d=o.filter(I=>I instanceof P),u=[],g=[];for(let I of d){let _=u.length,{domainConfig:v,verifyArgs:D,signature:z,publicKey:X,message:ie}=Z(I,_);ie&&z&&X&&u.push({message:ie,signature:z,publicKey:X}),v&&(c.addPreAccounts([{address:v,role:AccountRole.READONLY}]),D.__option==="Some"&&g.push({domainConfigKey:v,verifyArgs:D.value}));}c.addPreAccounts(o.filter(I=>"address"in I).map(I=>({address:I.address,role:AccountRole.READONLY_SIGNER,signer:I})));let{remainingAccounts:p,systemOffset:T}=c.toAccountMetas(),S=U(i,T),b=[];u.length>0&&b.push(V(u));let x=await ue(e);return b.push($a({settings:x,payer:r,settingsMutArgs:a,compressedProofArgs:S,secp256r1VerifyArgs:g,remainingAccounts:p})),b}async function J8({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let i=new B;await i.addSystemAccounts();let a=await be(),{address:o,addressTree:d}=await N(r.address,a),u=[{address:o,tree:d,queue:d,type:"User"}],g=await w([],u),p=(await Ae(i,g.treeInfos,g.roots,g.rootIndices,u))[0],T=i.toAccountMetas();c=T.remainingAccounts,t={compressedProofArgs:U(g,T.systemOffset),authorityCreationArgs:p};}return Ai({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function $8({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new B;await s.addSystemAccounts();let t=await ye([{address:(await N(e.address,n)).address,type:"User"}]),c=await w(t,[]),i=de(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,q())[0],{remainingAccounts:a,systemOffset:o}=s.toAccountMetas(),d=U(c,o);return Ti({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function dH({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:o,publicKey:d}=Z(n),u=[];a&&o&&d&&u.push({message:a,signature:o,publicKey:d});let g=await dr(n instanceof P?n:n.address,r,t),p=[];p.push({address:(await N(n instanceof P?n:n.address,r)).address,type:"User"});let T,S=null,b,x=null,I=g.wallets.find(_e=>_e.isDelegate);I&&((await jr(I.index,I.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(I.index,I.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):T=await ue(I.index)),s&&((await jr(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):b=await ue(s.index));let _=new B;await _.addSystemAccounts();let v=await ye(p,t),D=await w(v,[]),z=de(_,D.treeInfos.slice(0,1),D.leafIndices.slice(0,1),D.rootIndices.slice(0,1),D.proveByIndices.slice(0,1),v.slice(0,1),q())[0],X=S?some(de(_,D.treeInfos.slice(S.start,S.end),D.leafIndices.slice(S.start,S.end),D.rootIndices.slice(S.start,S.end),D.proveByIndices.slice(S.start,S.end),v.slice(S.start,S.end),K())[0]):none(),ie=x?some(de(_,D.treeInfos.slice(x.start,x.end),D.leafIndices.slice(x.start,x.end),D.rootIndices.slice(x.start,x.end),D.proveByIndices.slice(x.start,x.end),v.slice(x.start,x.end),K())[0]):none(),{remainingAccounts:te,systemOffset:le}=_.toAccountMetas(),Te=U(D,le),He=[];return u.length>0&&He.push(V(u)),He.push(Ei({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof P?void 0:n,oldSettings:T,oldSettingsMutArgs:X,newSettings:b,newSettingsMutArgs:ie,compressedProofArgs:Te,userMutArgs:z,remainingAccounts:te})),He}async function PH({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:i}){let a=await jc(se(),s),o=a.data.multiWalletSettings,{packedAccounts:d,proof:u,settingsMutArgs:g}=await Re(c,e,n,false,i),{remainingAccounts:p,systemOffset:T}=d.toAccountMetas(),{domainConfig:S,verifyArgs:b,message:x,signature:I,publicKey:_}=Z(r),v=[];if(x&&I&&_&&v.push(V([{message:x,signature:I,publicKey:_}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let D=U(u,T);v.push(Td({transactionBuffer:s,domainConfig:S,closer:r instanceof P?void 0:r,rentCollector:a.data.payer,secp256r1VerifyArgs:b,settingsMutArgs:g,payer:t,compressedProofArgs:D,remainingAccounts:p}));}else v.push(Ad({transactionBuffer:s,domainConfig:S,closer:r instanceof P?void 0:r,settings:o,payer:a.data.payer,secp256r1VerifyArgs:b,remainingAccounts:[]}));return v}function YA({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:p,message:T,signature:S,publicKey:b}=Z(n),x=[];if(T&&S&&b&&x.push(V([{message:T,signature:S,publicKey:b}])),d){let{settingsReadonlyArgs:I,compressedProofArgs:_,remainingAccounts:v}=d;x.push(bd({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},settingsReadonlyArgs:I,compressedProofArgs:_,remainingAccounts:v}));}else x.push(Ed({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},remainingAccounts:[]}));return x}function ZA({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:o}=Z(e),d=[];return a&&i&&o&&d.push(V([{message:a,signature:i,publicKey:o}])),s?d.push(Hd({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof P?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Ld({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof P?void 0:e,remainingAccounts:[]})),d}function XA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?$d({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Jd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function QA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:o}=Z(n),d=[];return o&&i&&a&&d.push(V([{message:o,signature:i,publicKey:a}])),s?d.push(Au({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof P?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(ou({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof P?void 0:n,remainingAccounts:[]})),d}async function mF({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await Ah(r),i=new B,a=null,o=null,d=[];if(c.length||t){let g=await gh({packedAccounts:i,userAccounts:c,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:s});a=g.proof,o=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await ph({configActionsArgs:r,userMutArgs:d,index:e}),index:e,proof:a,settingsMutArgs:o,packedAccounts:i,compressed:t}}async function Ah(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>N(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let s=await Promise.all(r.members.map(t=>N(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function gh({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let T=(await ae(s,t)).address;i.push({address:T,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 o=await w(a,[]),d=[],u=[];for(let T of a)T.type==="Settings"?d.push(T):T.type==="User"&&u.push(T);let g,p=[];if(r&&o&&(g=de(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),d,K())[0]),u.length&&o){let T=r?1:0;p=de(e,o.treeInfos.slice(T),o.leafIndices.slice(T),o.rootIndices.slice(T),o.proveByIndices.slice(T),u,q());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function ph({index:e,configActionsArgs:n,userMutArgs:r}){let s=[];for(let t of n)switch(t.type){case "AddMembers":{let c=[];for(let i of t.members){let a=await N(i.member,i.userAddressTreeIndex).then(o=>r.find(d=>equalBytes(d.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(o.address)))));if(!a)throw new Error("Unable to find user account");c.push(lh({permissionArgs:i.permissions,userMutArgs:a,pubkey:i.member}));}s.push({__kind:t.type,fields:[c]});break}case "RemoveMembers":{let c=await Promise.all(t.members.map(i=>N(i.member,i.userAddressTreeIndex).then(a=>{let o=r.find(d=>equalBytes(d.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(a.address))));if(!o)throw new Error("Unable to find user account");return yh({pubkey:i.member,userMutArgs:o})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(i=>mh({permissionArgs:i.permissions,pubkey:i.member}));s.push({__kind:t.type,fields:[c]});break}default:s.push({__kind:t.type,fields:[t.threshold]});}return s}function mh({pubkey:e,permissionArgs:n}){return {memberKey:he(e),permissions:rg(n)}}function yh({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:he(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function lh({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===2)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===0&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:he(e),permissions:rg(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function rg(e){let n=[];return e.initiate&&n.push(Ue.InitiateTransaction),e.vote&&n.push(Ue.VoteTransaction),e.execute&&n.push(Ue.ExecuteTransaction),Ne.fromPermissions(n)}async function CF({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:T}){let S=await ue(n),b=Math.floor(Math.random()*255),x=await hA(S,t instanceof P?t:t.address,b),I=[],_=[];for(let Q=0;Q<s.length;Q+=p){let dt=s.subarray(Q,Q+p);I.push(dt),_.push(sha256(dt));}let v=sha256(s),{settingsReadonlyArgs:D,settingsMutArgs:z,proof:X,packedAccounts:ie}=await Re(d,n,r,false,T),{remainingAccounts:te,systemOffset:le}=ie.toAccountMetas(),Te=X&&D&&z?{settingsReadonlyArgs:D,settingsMutArgs:z,compressedProofArgs:U(X,le),remainingAccounts:te,payer:e}:null,He=fe([t,...c?[c]:[],...u]).filter(Q=>Q instanceof P).map(Q=>({memberKey:he(Q),messageHash:Ys(Q.authResponse)})),_e=YA({finalBufferHash:v,finalBufferSize:s.length,bufferIndex:b,payer:e,transactionBufferAddress:x,settings:S,creator:t,preauthorizeExecution:!c,bufferExtendHashes:_,compressedArgs:Te,expectedSecp256r1Signers:He}),it=I.map(Q=>XA({transactionMessageBytes:Q,transactionBufferAddress:x,settings:S,compressed:d})),ur=u.map(Q=>QA({voter:Q,transactionBufferAddress:x,settings:S,compressedArgs:Te})),en=ZA({compressedArgs:Te,settings:S,executor:c,transactionBufferAddress:x}),{instructions:Tt,addressLookupTableAccounts:l}=await wA({compressed:d,settings:S,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o}),pe=Q=>({payer:e,instructions:Q,addressesByLookupTableAddress:l});return [pe(_e),...it.map(Q=>pe([Q])),...ur.length?[pe(ur.flat())]:[],pe(en),pe(Tt)]}var Qr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=i=>{let a=s.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},s.set(i,a)),a},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 o=t(a.address);o.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,o.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),s=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),c=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};if(r.length===0)throw new Error("Expected at least one writable signer key");let[a]=r[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let o=[...r.map(([d])=>d),...s.map(([d])=>d),...t.map(([d])=>d),...c.map(([d])=>d)];return [i,o]}extractTableLookup(n){let[r,s]=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:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,o=n.findIndex(d=>d===a);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(a),this.keyMetaMap.delete(c);}}return [s,t]}};var $r=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,i)=>{s.set(c,i);});let t=c=>{let i=s.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 sg({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Qr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(s??{});for(let p of a){let T=t.extractTableLookup(p);if(T!==void 0){let{addressTableLookup:S,drainedKeys:b}=T;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),i.writable.push(...b.writable),i.readonly.push(...b.readonly);}}let[o,d]=t.getMessageComponents(),g=new $r(d,i).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function LF({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=sg({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return ju(s)}async function VF({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i,cachedAccounts:a,compressed:o=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await VA({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:i,simulateProof:d,cachedAccounts:a});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}
|
|
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 {createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,encodeBN254toBase58,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import f from'zod';import {estimateComputeUnitLimitFactory,getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTokenDecoder,AccountState,getTransferSolInstruction}from'gill/programs';import {p256}from'@noble/curves/nist.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {canonicalize}from'json-canonicalize';import {equalBytes}from'@noble/curves/utils.js';var xo=new Uint8Array([201,232,212,229,59,241,106,197]);function Sh(){return fixEncoderSize(getBytesEncoder(),8).encode(xo)}function Eg(){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:xo}))}function Io(){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 xh(){return combineCodec(Eg(),Io())}function Co(e){return decodeAccount(e,Io())}async function Eo(e,n,r){let s=await Dg(e,n,r);return assertAccountExists(s),s}async function Dg(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Co(s)}async function Ih(e,n,r){let s=await Pg(e,n,r);return assertAccountsExist(s),s}async function Pg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Co(t))}function Ch(){return 846}var Mo=new Uint8Array([42,206,176,58,175,129,130,233]);function Ph(){return fixEncoderSize(getBytesEncoder(),8).encode(Mo)}function wg(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Mo}))}function ho(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function Mh(){return combineCodec(wg(),ho())}function Ro(e){return decodeAccount(e,ho())}async function hh(e,n,r){let s=await Vg(e,n,r);return assertAccountExists(s),s}async function Vg(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Ro(s)}async function Rh(e,n,r){let s=await Hg(e,n,r);return assertAccountsExist(s),s}async function Hg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ro(t))}function bh(){return 24}function rn(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function nn(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Uh(){return combineCodec(rn(),nn())}function sn(){return getStructEncoder([["memberKey",H()],["permissions",Fe()],["userArgs",ze()]])}function on(){return getStructDecoder([["memberKey",ce()],["permissions",Ge()],["userArgs",Ke()]])}function Oh(){return combineCodec(sn(),on())}function cn(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function an(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function wh(){return combineCodec(cn(),an())}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 Gh(){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 Jh(){return combineCodec(Dt(),Pt())}function dn(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function un(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function Zh(){return combineCodec(dn(),un())}function yn(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function ln(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function $h(){return combineCodec(yn(),ln())}function Mt(){return getStructEncoder([["data",getOptionEncoder(ht())]])}function K(){return getStructDecoder([["data",getOptionDecoder(Rt())]])}function nR(){return combineCodec(Mt(),K())}function ht(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(bt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function Rt(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(_t())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function aR(){return combineCodec(ht(),Rt())}function vt(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",fn()],["tlv",getOptionEncoder(getArrayEncoder(Tn()))],["hasDelegate",getBooleanEncoder()],["isFrozen",getBooleanEncoder()]])}function Ut(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",Sn()],["tlv",getOptionDecoder(getArrayDecoder(Wt()))],["hasDelegate",getBooleanDecoder()],["isFrozen",getBooleanDecoder()]])}function AR(){return combineCodec(vt(),Ut())}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 yR(){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 SR(){return combineCodec(Dn(),Pn())}function je(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Un())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(sn())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(kn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Je(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Wn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(on())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Ln())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function ER(){return combineCodec(je(),Je())}function DR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function PR(e,n){return n.__kind===e}function On(){return getStructEncoder([["member",getAddressEncoder()],["role",qe()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",xe()]])}function Bn(){return getStructDecoder([["member",getAddressDecoder()],["role",Ye()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",Ie()]])}function bR(){return combineCodec(On(),Bn())}function Un(){return getStructEncoder([["memberKey",H()],["permissions",Fe()]])}function Wn(){return getStructDecoder([["memberKey",ce()],["permissions",Ge()]])}function WR(){return combineCodec(Un(),Wn())}function kt(){return getStructEncoder([["memberKey",H()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function Lt(){return getStructDecoder([["memberKey",ce()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function BR(){return combineCodec(kt(),Lt())}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([dn()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([Cn()])]])]])}function Wt(){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([Jn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([un()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([En()])]])]])}function HR(){return combineCodec(Tn(),Wt())}function FR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function GR(e,n){return n.__kind===e}function qn(){return getStructEncoder([["settingsMutArgs",j()],["transactionManager",getOptionEncoder(Ot())]])}function Yn(){return getStructDecoder([["settingsMutArgs",J()],["transactionManager",getOptionDecoder(Bt())]])}function JR(){return combineCodec(qn(),Yn())}function bt(){return getStructEncoder([["pubkey",H()],["role",getU8Encoder()],["permissions",Fe()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function _t(){return getStructDecoder([["pubkey",ce()],["role",getU8Decoder()],["permissions",Ge()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function XR(){return combineCodec(bt(),_t())}function H(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function ce(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function eb(){return combineCodec(H(),ce())}function Qn(){return getStructEncoder([["authorityCreationArgs",xe()],["compressedProofArgs",C()]])}function $n(){return getStructDecoder([["authorityCreationArgs",Ie()],["compressedProofArgs",E()]])}function sb(){return combineCodec(Qn(),$n())}function Nt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function wt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function ab(){return combineCodec(Nt(),wt())}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 ub(){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 pb(){return combineCodec(Ct(),Et())}function Nn(){return getStructEncoder([])}function wn(){return getStructDecoder([])}function lb(){return combineCodec(Nn(),wn())}function Vn(){return getStructEncoder([])}function Hn(){return getStructDecoder([])}function Sb(){return combineCodec(Vn(),Hn())}function Fe(){return getStructEncoder([["mask",getU8Encoder()]])}function Ge(){return getStructDecoder([["mask",getU8Decoder()]])}function Cb(){return combineCodec(Fe(),Ge())}function C(){return getStructEncoder([["proof",getOptionEncoder(yn())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function E(){return getStructDecoder([["proof",getOptionDecoder(ln())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function Mb(){return combineCodec(C(),E())}function kn(){return getStructEncoder([["memberKey",H()],["userArgs",ze()]])}function Ln(){return getStructDecoder([["memberKey",ce()],["userArgs",Ke()]])}function _b(){return combineCodec(kn(),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 rs(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Vt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function Ob(){return combineCodec(rs(),Vt())}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 wb(){return combineCodec(F(),G())}function $(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",F()]])}function ee(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",G()]])}function Gb(){return combineCodec($(),ee())}function Ht(){return getStructEncoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",getU8Encoder()]])}function Ft(){return getStructDecoder([["addressTreeInfo",wt()],["outputStateTreeIndex",getU8Decoder()]])}function Jb(){return combineCodec(Ht(),Ft())}function ns(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function ss(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function Zb(){return combineCodec(ns(),ss())}function os(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function cs(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function $b(){return combineCodec(os(),cs())}function j(){return getStructEncoder([["accountMeta",xt()],["data",Mt()]])}function J(){return getStructDecoder([["accountMeta",It()],["data",K()]])}function n_(){return combineCodec(j(),J())}function Gt(){return getStructEncoder([["accountMeta",Dt()],["data",Mt()]])}function zt(){return getStructDecoder([["accountMeta",Pt()],["data",K()]])}function a_(){return combineCodec(Gt(),zt())}function Kt(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function jt(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function u_(){return combineCodec(Kt(),jt())}function Fn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(rn())]])}function Gn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(nn())]])}function m_(){return combineCodec(Fn(),Gn())}function Jt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getArrayEncoder(kt())]])}function qt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getArrayDecoder(Lt())]])}function f_(){return combineCodec(Jt(),qt())}function Yt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(cn())],["addressTableLookups",getArrayEncoder(ps())]])}function Zt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(an())],["addressTableLookups",getArrayDecoder(ms())]])}function C_(){return combineCodec(Yt(),Zt())}function ps(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function ms(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function P_(){return combineCodec(ps(),ms())}function zn(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function Kn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function R_(){return combineCodec(zn(),Kn())}function jn(){return getStructEncoder([["transferring",getU8Encoder()]])}function Jn(){return getStructDecoder([["transferring",getU8Decoder()]])}function v_(){return combineCodec(jn(),Jn())}var ys=(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))(ys||{});function Xt(){return getEnumEncoder(ys)}function Qt(){return getEnumDecoder(ys)}function k_(){return combineCodec(Xt(),Qt())}function et(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",H()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(Xt()))],["wallets",getArrayEncoder(os())],["role",qe()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function q(){return getStructDecoder([["domainConfig",getOptionDecoder(getAddressDecoder())],["member",ce()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(Qt()))],["wallets",getArrayDecoder(cs())],["role",Ye()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function N_(){return combineCodec(et(),q())}function xe(){return getStructEncoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",getU8Encoder()]])}function Ie(){return getStructDecoder([["addressTreeInfo",wt()],["outputStateTreeIndex",getU8Decoder()]])}function F_(){return combineCodec(xe(),Ie())}function tt(){return getStructEncoder([["accountMeta",xt()],["data",et()]])}function rt(){return getStructDecoder([["accountMeta",It()],["data",q()]])}function j_(){return combineCodec(tt(),rt())}function Ot(){return getStructEncoder([["accountMeta",Dt()],["data",et()]])}function Bt(){return getStructDecoder([["accountMeta",Pt()],["data",q()]])}function Z_(){return combineCodec(Ot(),Bt())}function ze(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Ot()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([tt()])]])]])}function Ke(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Bt()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([rt()])]])]])}function ev(){return combineCodec(ze(),Ke())}function tv(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function rv(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 Ye(){return getEnumDecoder(Oe)}function ov(){return combineCodec(qe(),Ye())}var Bc=new Uint8Array([223,179,163,190,177,224,67,173]);function iU(){return fixEncoderSize(getBytesEncoder(),8).encode(Bc)}function hT(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(bt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:Bc}))}function br(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(_t())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function dU(){return combineCodec(hT(),br())}function Nc(e){return decodeAccount(e,br())}async function uU(e,n,r){let s=await ls(e,n,r);return assertAccountExists(s),s}async function ls(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Nc(s)}async function AU(e,n,r){let s=await RT(e,n,r);return assertAccountsExist(s),s}async function RT(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Nc(t))}var Gc=new Uint8Array([90,36,35,219,93,225,110,96]);function yU(){return fixEncoderSize(getBytesEncoder(),8).encode(Gc)}function jT(){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(kt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Gc}))}function zc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multiWalletSettings",getAddressDecoder()],["multiWalletBump",getU8Decoder()],["canExecute",getBooleanDecoder()],["preauthorizeExecution",getBooleanDecoder()],["validTill",getU64Decoder()],["payer",getAddressDecoder()],["bump",getU8Decoder()],["bufferIndex",getU8Decoder()],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["creator",ce()],["executor",ce()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(ce())],["expectedSecp256r1Signers",getArrayDecoder(Lt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function lU(){return combineCodec(jT(),zc())}function Kc(e){return decodeAccount(e,zc())}async function jc(e,n,r){let s=await JT(e,n,r);return assertAccountExists(s),s}async function JT(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Kc(s)}async function TU(e,n,r){let s=await qT(e,n,r);return assertAccountsExist(s),s}async function qT(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Kc(t))}var Yc=new Uint8Array([105,23,173,2,197,255,80,87]);function xU(){return fixEncoderSize(getBytesEncoder(),8).encode(Yc)}function pf(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Yc}))}function Zc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function IU(){return combineCodec(pf(),Zc())}function Xc(e){return decodeAccount(e,Zc())}async function Qc(e,n,r){let s=await mf(e,n,r);return assertAccountExists(s),s}async function mf(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Xc(s)}async function CU(e,n,r){let s=await yf(e,n,r);return assertAccountsExist(s),s}async function yf(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Xc(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 ea(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function O(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function y(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let s=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:O(r.value),role:$c(r.value)?upgradeRoleToSigner(s):s,...$c(r.value)?{signer:r.value}:{}})}}function $c(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var ra=new Uint8Array([8]);function wU(){return fixEncoderSize(getBytesEncoder(),1).encode(ra)}function Ds(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:ra}))}function na(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function VU(){return combineCodec(Ds(),na())}async function sa(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),o=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:Ds().encode(c),programAddress:r})}function HU(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),o=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:Ds().encode(c),programAddress:r})}function FU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:na().decode(e.data)}}var da=new Uint8Array([9]);function YU(){return fixEncoderSize(getBytesEncoder(),1).encode(da)}function Ms(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(je())],["secp256r1VerifyArgs",getArrayEncoder($())],["compressedProofArgs",getOptionEncoder(C())]]),e=>({...e,discriminator:da}))}function ua(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(Je())],["secp256r1VerifyArgs",getArrayDecoder(ee())],["compressedProofArgs",getOptionDecoder(E())]])}function ZU(){return combineCodec(Ms(),ua())}async function Aa(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.settings.value||(t.settings.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getU128Encoder().encode(ea(c.settingsIndex))]})),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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ms().encode(c),programAddress:r})}function XU(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ms().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},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:ua().decode(e.data)}}var la=new Uint8Array([19]);function oW(){return fixEncoderSize(getBytesEncoder(),1).encode(la)}function Ta(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(je())],["secp256r1VerifyArgs",getArrayEncoder($())],["settingsMutArgs",j()],["compressedProofArgs",C()]]),e=>({...e,discriminator:la}))}function fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Je())],["secp256r1VerifyArgs",getArrayDecoder(ee())],["settingsMutArgs",J()],["compressedProofArgs",E()]])}function cW(){return combineCodec(Ta(),fa())}function Sa(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ta().encode(c),programAddress:r})}function aW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:fa().decode(e.data)}}var Ca=new Uint8Array([18]);function mW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ca)}function hs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["settingsCreation",Ht()],["userArgs",ze()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Ca}))}function Ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["settingsCreation",Ft()],["userArgs",Ke()],["settingsIndex",getU128Decoder()]])}function yW(){return combineCodec(hs(),Ea())}async function Da(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:hs().encode(c),programAddress:r})}function lW(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:hs().encode(c),programAddress:r})}function TW(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:Ea().decode(e.data)}}var Ua=new Uint8Array([0]);function DW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ua)}function bs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",xe()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ua}))}function Wa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",Ie()],["compressedProofArgs",E()]])}function PW(){return combineCodec(bs(),Wa())}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),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:bs().encode(c),programAddress:r})}function MW(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),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:bs().encode(c),programAddress:r})}function hW(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Wa().decode(e.data)}}var Ba=new Uint8Array([4]);function kW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ba)}function _s(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["member",rs()],["role",qe()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(Xt())],["userAccountCreationArgs",xe()],["linkWalletArgs",getOptionEncoder(qn())]]),e=>({...e,discriminator:Ba}))}function Na(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["member",Vt()],["role",Ye()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Qt())],["userAccountCreationArgs",Ie()],["linkWalletArgs",getOptionDecoder(Yn())]])}function LW(){return combineCodec(_s(),Na())}async function wa(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:_s().encode(c),programAddress:r})}function OW(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}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:_s().encode(c),programAddress:r})}function BW(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:Na().decode(e.data)}}var Ha=new Uint8Array([3]);function GW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ha)}function Us(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Ha}))}function Fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function zW(){return combineCodec(Us(),Fa())}async function Ga(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:Us().encode({}),programAddress:r})}function KW(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:Us().encode({}),programAddress:r})}function jW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:Fa().decode(e.data)}}var Ka=new Uint8Array([5]);function $W(){return fixEncoderSize(getBytesEncoder(),1).encode(Ka)}function ks(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["createUserArgs",getArrayEncoder(On())]]),e=>({...e,discriminator:Ka}))}function ja(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["createUserArgs",getArrayDecoder(Bn())]])}function ek(){return combineCodec(ks(),ja())}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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:ks().encode(c),programAddress:r})}function tk(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:ks().encode(c),programAddress:r})}function rk(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:ja().decode(e.data)}}var Za=new Uint8Array([17]);function dk(){return fixEncoderSize(getBytesEncoder(),1).encode(Za)}function Xa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",j()],["compressedProofArgs",C()],["secp256r1VerifyArgs",getArrayEncoder($())]]),e=>({...e,discriminator:Za}))}function Qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",J()],["compressedProofArgs",E()],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function uk(){return combineCodec(Xa(),Qa())}function $a(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Xa().encode(c),programAddress:r})}function Ak(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Qa().decode(e.data)}}var ri=new Uint8Array([2]);function Tk(){return fixEncoderSize(getBytesEncoder(),1).encode(ri)}function ni(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:ri}))}function si(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function fk(){return combineCodec(ni(),si())}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}),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...a],data:ni().encode(c),programAddress:r})}function Sk(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:si().decode(e.data)}}var di=new Uint8Array([1]);function Mk(){return fixEncoderSize(getBytesEncoder(),1).encode(di)}function Os(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Qn())]]),e=>({...e,discriminator:di}))}function ui(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder($n())]])}function hk(){return combineCodec(Os(),ui())}async function Rk(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),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:Os().encode(c),programAddress:r})}function Ai(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),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:Os().encode(c),programAddress:r})}function bk(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:ui().decode(e.data)}}var mi=new Uint8Array([6]);function Ok(){return fixEncoderSize(getBytesEncoder(),1).encode(mi)}function yi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",tt()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",C()]]),e=>({...e,discriminator:mi}))}function li(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",rt()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",E()]])}function Bk(){return combineCodec(yi(),li())}function Ti(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.authority),...a],data:yi().encode(c),programAddress:r})}function Nk(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:li().decode(e.data)}}var xi=new Uint8Array([7]);function Kk(){return fixEncoderSize(getBytesEncoder(),1).encode(xi)}function Ii(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",tt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["delegateTo",getOptionEncoder(ns())],["oldSettingsMutArgs",getOptionEncoder(j())],["newSettingsMutArgs",getOptionEncoder(j())],["compressedProofArgs",C()]]),e=>({...e,discriminator:xi}))}function Ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",rt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["delegateTo",getOptionDecoder(ss())],["oldSettingsMutArgs",getOptionDecoder(J())],["newSettingsMutArgs",getOptionDecoder(J())],["compressedProofArgs",E()]])}function jk(){return combineCodec(Ii(),Ci())}function Ei(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),o=y(r);return Object.freeze({accounts:[o(t.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...a],data:Ii().encode(c),programAddress:r})}function Jk(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:Ci().decode(e.data)}}var Mi=new Uint8Array([32]);function eL(){return fixEncoderSize(getBytesEncoder(),1).encode(Mi)}function hi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",ht()],["compressedProofArgs",C()],["settingsCreationArgs",Ht()]]),e=>({...e,discriminator:Mi}))}function Ri(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Rt()],["compressedProofArgs",E()],["settingsCreationArgs",Ft()]])}function tL(){return combineCodec(hi(),Ri())}function bi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.authority),...a],data:hi().encode(c),programAddress:r})}function rL(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Ri().decode(e.data)}}var Ui=new Uint8Array([31]);function dL(){return fixEncoderSize(getBytesEncoder(),1).encode(Ui)}function Wi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",et()],["compressedProofArgs",C()],["userCreationArgs",xe()]]),e=>({...e,discriminator:Ui}))}function ki(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",q()],["compressedProofArgs",E()],["userCreationArgs",Ie()]])}function uL(){return combineCodec(Wi(),ki())}function Li(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.authority),...a],data:Wi().encode(c),programAddress:r})}function AL(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:ki().decode(e.data)}}var Bi=new Uint8Array([29]);function fL(){return fixEncoderSize(getBytesEncoder(),1).encode(Bi)}function Bs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder($())]]),e=>({...e,discriminator:Bi}))}function Ni(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function SL(){return combineCodec(Bs(),Ni())}async function xL(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:Bs().encode(c),programAddress:r})}function wi(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:Bs().encode(c),programAddress:r})}function IL(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Ni().decode(e.data)}}var Fi=new Uint8Array([27]);function RL(){return fixEncoderSize(getBytesEncoder(),1).encode(Fi)}function Gi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder($())],["settingsMutArgs",j()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Fi}))}function zi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(ee())],["settingsMutArgs",J()],["compressedProofArgs",E()]])}function bL(){return combineCodec(Gi(),zi())}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: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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:Gi().encode(c),programAddress:r})}function _L(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:zi().decode(e.data)}}var Yi=new Uint8Array([30]);function BL(){return fixEncoderSize(getBytesEncoder(),1).encode(Yi)}function Vs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Kt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(vt()))],["compressedProofArgs",getOptionEncoder(C())],["secp256r1VerifyArgs",getArrayEncoder($())]]),e=>({...e,discriminator:Yi}))}function Zi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(jt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(Ut()))],["compressedProofArgs",getOptionDecoder(E())],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function NL(){return combineCodec(Vs(),Zi())}async function wL(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...a],data:Vs().encode(c),programAddress:r})}function Xi(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...a],data:Vs().encode(c),programAddress:r})}function VL(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:Zi().decode(e.data)}}var nd=new Uint8Array([28]);function JL(){return fixEncoderSize(getBytesEncoder(),1).encode(nd)}function Hs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Kt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(vt()))],["secp256r1VerifyArgs",getArrayEncoder($())],["settingsMutArgs",j()],["compressedProofArgs",C()]]),e=>({...e,discriminator:nd}))}function sd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(jt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(Ut()))],["secp256r1VerifyArgs",getArrayDecoder(ee())],["settingsMutArgs",J()],["compressedProofArgs",E()]])}function qL(){return combineCodec(Hs(),sd())}async function YL(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...a],data:Hs().encode(c),programAddress:r})}function od(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...a],data:Hs().encode(c),programAddress:r})}function ZL(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:sd().decode(e.data)}}var id=new Uint8Array([13]);function nO(){return fixEncoderSize(getBytesEncoder(),1).encode(id)}function dd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:id}))}function ud(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function sO(){return combineCodec(dd(),ud())}function Ad(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:dd().encode(c),programAddress:r})}function oO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ud().decode(e.data)}}var md=new Uint8Array([23]);function gO(){return fixEncoderSize(getBytesEncoder(),1).encode(md)}function yd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",j()],["compressedProofArgs",C()]]),e=>({...e,discriminator:md}))}function ld(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",J()],["compressedProofArgs",E()]])}function pO(){return combineCodec(yd(),ld())}function Td(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:yd().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},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ld().decode(e.data)}}var xd=new Uint8Array([10]);function IO(){return fixEncoderSize(getBytesEncoder(),1).encode(xd)}function Id(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Jt()],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:xd}))}function Cd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",qt()],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function CO(){return combineCodec(Id(),Cd())}function Ed(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...a],data:Id().encode(c),programAddress:r})}function EO(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Cd().decode(e.data)}}var Md=new Uint8Array([20]);function _O(){return fixEncoderSize(getBytesEncoder(),1).encode(Md)}function hd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Jt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",Gt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Md}))}function Rd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",qt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",zt()],["compressedProofArgs",E()]])}function vO(){return combineCodec(hd(),Rd())}function bd(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...a],data:hd().encode(c),programAddress:r})}function UO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Rd().decode(e.data)}}var Ud=new Uint8Array([14]);function wO(){return fixEncoderSize(getBytesEncoder(),1).encode(Ud)}function Wd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Ud}))}function kd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function VO(){return combineCodec(Wd(),kd())}function Ld(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Wd().encode(c),programAddress:r})}function HO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:kd().decode(e.data)}}var Nd=new Uint8Array([24]);function qO(){return fixEncoderSize(getBytesEncoder(),1).encode(Nd)}function wd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",j()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Nd}))}function Vd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",J()],["compressedProofArgs",E()]])}function YO(){return combineCodec(wd(),Vd())}function Hd(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:wd().encode(c),programAddress:r})}function ZO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Vd().decode(e.data)}}var zd=new Uint8Array([12]);function rB(){return fixEncoderSize(getBytesEncoder(),1).encode(zd)}function Kd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:zd}))}function jd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function nB(){return combineCodec(Kd(),jd())}function Jd(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}),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...a],data:Kd().encode(c),programAddress:r})}function sB(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:jd().decode(e.data)}}var Zd=new Uint8Array([22]);function uB(){return fixEncoderSize(getBytesEncoder(),1).encode(Zd)}function Xd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Zd}))}function Qd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function AB(){return combineCodec(Xd(),Qd())}function $d(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.transactionBuffer),...a],data:Xd().encode(c),programAddress:r})}function gB(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:Qd().decode(e.data)}}var ru=new Uint8Array([11]);function SB(){return fixEncoderSize(getBytesEncoder(),1).encode(ru)}function nu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:ru}))}function su(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function xB(){return combineCodec(nu(),su())}function ou(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:nu().encode(c),programAddress:r})}function IB(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:su().decode(e.data)}}var iu=new Uint8Array([21]);function RB(){return fixEncoderSize(getBytesEncoder(),1).encode(iu)}function du(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",Gt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:iu}))}function uu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",zt()],["compressedProofArgs",E()]])}function bB(){return combineCodec(du(),uu())}function Au(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:du().encode(c),programAddress:r})}function _B(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:uu().decode(e.data)}}var mu=new Uint8Array([15]);function OB(){return fixEncoderSize(getBytesEncoder(),1).encode(mu)}function yu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:mu}))}function lu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function BB(){return combineCodec(yu(),lu())}function Tu(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:yu().encode({}),programAddress:r})}function NB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:lu().decode(e.data)}}var xu=new Uint8Array([25]);function zB(){return fixEncoderSize(getBytesEncoder(),1).encode(xu)}function Iu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:xu}))}function Cu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function KB(){return combineCodec(Iu(),Cu())}function Eu(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}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...a],data:Iu().encode(c),programAddress:r})}function jB(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:Cu().decode(e.data)}}var Mu=new Uint8Array([16]);function $B(){return fixEncoderSize(getBytesEncoder(),1).encode(Mu)}function hu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Yt()],["secp256r1VerifyArgs",getArrayEncoder($())]]),e=>({...e,discriminator:Mu}))}function Ru(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Zt()],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function eN(){return combineCodec(hu(),Ru())}function bu(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),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:hu().encode(c),programAddress:r})}function tN(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Ru().decode(e.data)}}var Uu=new Uint8Array([26]);function iN(){return fixEncoderSize(getBytesEncoder(),1).encode(Uu)}function Wu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Yt()],["secp256r1VerifyArgs",getArrayEncoder($())],["settingsMutArgs",j()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Uu}))}function ku(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Zt()],["secp256r1VerifyArgs",getArrayDecoder(ee())],["settingsMutArgs",J()],["compressedProofArgs",E()]])}function dN(){return combineCodec(Wu(),ku())}function Lu(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),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Wu().encode(c),programAddress:r})}function uN(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:ku().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",WE=(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))(WE||{});function qN(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([201,232,212,229,59,241,106,197])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([42,206,176,58,175,129,130,233])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([223,179,163,190,177,224,67,173])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([90,36,35,219,93,225,110,96])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([105,23,173,2,197,255,80,87])),0))return 4;throw new Error("The provided account could not be identified as a multiWallet account.")}var kE=(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.MigrateCompressedSettings=13]="MigrateCompressedSettings",l[l.MigrateCompressedUsers=14]="MigrateCompressedUsers",l[l.NativeTransferIntent=15]="NativeTransferIntent",l[l.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",l[l.TokenTransferIntent=17]="TokenTransferIntent",l[l.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",l[l.TransactionBufferClose=19]="TransactionBufferClose",l[l.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",l[l.TransactionBufferCreate=21]="TransactionBufferCreate",l[l.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",l[l.TransactionBufferExecute=23]="TransactionBufferExecute",l[l.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",l[l.TransactionBufferExtend=25]="TransactionBufferExtend",l[l.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",l[l.TransactionBufferVote=27]="TransactionBufferVote",l[l.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",l[l.TransactionExecute=29]="TransactionExecute",l[l.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",l[l.TransactionExecuteSync=31]="TransactionExecuteSync",l[l.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",l))(kE||{});function YN(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 4;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 5;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 6;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 7;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 8;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 9;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 10;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 11;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 12;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([32])),0))return 13;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([31])),0))return 14;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 15;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 16;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 17;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 18;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 19;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 20;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 21;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 22;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 23;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 24;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 25;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 26;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 27;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 28;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 29;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 30;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 31;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 32;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var OE=6e3,BE=6001,NE=6002,wE=6003,VE=6004,HE=6005,FE=6006,GE=6007,zE=6008,KE=6009,jE=6010,JE=6011,qE=6012,YE=6013,ZE=6014,XE=6015,QE=6016,$E=6017,eD=6018,tD=6019,rD=6020,nD=6021,sD=6022,oD=6023,cD=6024,aD=6025,iD=6026,dD=6027,uD=6028,AD=6029,gD=6030,pD=6031,mD=6032,yD=6033,lD=6034,TD=6035,fD=6036,SD=6037,xD=6038,ID=6039,CD=6040,ED=6041,DD=6042,PD=6043,MD=6044,hD=6045,RD=6046,bD=6047,_D=6048,vD=6049,UD=6050,WD=6051,kD=6052,LD=6053,OD=6054,BD=6055,ND=6056,wD=6057,VD=6058,HD=6059,FD=6060,GD=6061,zD=6062,KD=6063,jD=6064,JD=6065,qD=6066,YD=6067,ZD=6068,XD=6069,QD=6070,$D=6071,eP=6072,tP=6073,rP=6074,nP=6075,sP=6076,oP=6077,cP=6078,aP=6079,iP=6080,dP=6081,uP=6082,AP=6083,gP=6084,pP=6085,mP=6086,Ou;process.env.NODE_ENV!=="production"&&(Ou={[pD]:"This member is already delegated to another wallet.",[GE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[oP]:"Clock sysvar access failed. This may indicate a system error.",[WD]:"Missing credential id.",[LD]:"The domain configuration account is disabled. Please contact support or try again later.",[OD]:"Missing domain configuration account.",[nP]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[mP]:"Duplicate address tree detected. This address tree is already in the whitelist.",[jE]:"Duplicate public keys detected among members. Each member must have a unique key.",[KE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[nD]:"No members provided. A multisig wallet must contain at least one member.",[FD]:"Slot numbers list is empty. At least one slot number is required for validation.",[eD]:"Expected a User with Administrator role for this instruction.",[zE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[QE]:"Expected a User with Transaction Manager role for this instruction.",[CD]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[ED]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[DD]:"Declared buffer size does not match the actual serialized size.",[HD]:"Failed to compute hash. This may indicate a system error.",[lD]:"Not enough members with vote permission to meet the approval threshold.",[mD]:"At least one signer with execute permission is required to proceed.",[yD]:"At least one signer with initiate permission is required to perform this action.",[iD]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[rP]:"Invalid account index in transaction message. The account index is out of bounds.",[wD]:"Address Tree supplied is not part of the whitelisted address trees.",[tD]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[uD]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[ID]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[GD]:"Member key conversion failed. The provided key format is invalid.",[TD]:"Only delegated members are allowed for this transaction.",[aD]:"Unexpected number of accounts provided for this instruction.",[YE]:"User with Permanent Member role must have a delegated wallet.",[BE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[VE]:"The extracted public key has an invalid length or encoding.",[OE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[wE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[UD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[_D]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[oD]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[$D]:"Invalid source type for token transfer. The source account type is not supported.",[$E]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[XE]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[cD]:"Malformed transaction message: structure or formatting does not match the expected layout.",[iP]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[dD]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[aP]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[QD]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[HE]:"The extracted WebAuthn signed message payload is malformed.",[RD]:"An input string exceeds the maximum allowed character length.",[BD]:"This member is not registered under the provided domain configuration.",[jD]:"Member not found in settings. Cannot remove a member that does not exist.",[tP]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[AD]:"A required account is missing from the instruction context.",[zD]:"Compressed proof arguments are missing. Required for compressed account operations.",[YD]:"Missing compressed token account. Required for token transfer operations.",[dP]:"Missing destination token account. Required for token transfer operations.",[XD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[KD]:"Light CPI accounts are missing. Required for compressed account operations.",[gD]:"User mutation arguments are required when performing add or remove delegate operations.",[gP]:"Missing new authority account. Required for domain configuration updates.",[AP]:"Missing settings account. Required for delegate operations on compressed wallets.",[VD]:"Compressed settings data is missing. The settings account must be initialized with data.",[uP]:"Missing source token account. Required for token transfer operations.",[ZD]:"Missing SPL interface PDA. Required for token transfer operations.",[bD]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[sP]:"User account address is missing. Required for secp256r1 signature verification.",[pP]:"Missing whitelisted address trees account. Required for domain configuration updates.",[SD]:"No valid signer found in this transaction.",[rD]:"Only one administrator is allowed per wallet.",[qE]:"Only one permanent member is allowed per wallet.",[ZE]:"Only one transaction manager is allowed per wallet.",[ND]:"The given origin index is not in the whitelisted origins.",[qD]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[JE]:"Permanent members cannot be removed from a wallet.",[hD]:"Writable CPI calls to protected accounts are not permitted.",[FE]:"The rpIdHash extracted from the signed message does not match the expected value.",[JD]:"Settings key mismatch. The provided settings key does not match the expected value.",[NE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[vD]:"The specified slot number was not found in the provided slot history.",[eP]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[sD]:"Too many members: a maximum of 4 members are supported.",[PD]:"This transaction has expired. It must be executed within 3 minutes of approval.",[MD]:"This transaction has not yet reached the required approval threshold.",[kD]:"Missing transports.",[xD]:"Only the transaction creator or rent payer may close this transaction buffer.",[cP]:"Unauthorized: Only the admin account is allowed to perform this action.",[fD]:"Member is not part of the expected signers for this transaction."});function tw(e){return process.env.NODE_ENV!=="production"?Ou[e]:"Error message not available in production bundles."}function rw(e,n,r){return isProgramError(e,n,A,r)}async function pw({admin:e,addressTree:n}){return sa({payer:e,addressTree:n,remainingAccounts:[]})}var zs=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Bu="https://mainnet.block-engine.jito.wtf/api/v1",Nu="https://bundles.jito.wtf/api/v1/bundles/tip_floor",wu="landed_tips_75th_percentile";var ve=class extends Error{constructor(r,s,t){super(r);this.code=s;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},Be=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");}},Y=class extends ve{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},Pe=class extends ve{constructor(r,s,t){super(r,"NETWORK_ERROR",{statusCode:s,url:t});this.statusCode=s;this.url=t;}};var me=class extends ve{constructor(r,s,t){super(r,"BUNDLE_ERROR",{bundleId:s,attempt:t});this.bundleId=s;this.attempt=t;}},wr=class extends ve{constructor(r,s,t){super(`Operation "${r}" failed after ${s} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=s;this.lastError=t;}},Vr=class extends ve{constructor(r,s,t){super(r,"PERMISSION_ERROR",{required:s,actual:t});this.required=s;this.actual=t;}};var tr={Ed25519:1,Secp256r1:2};var Vu=f.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),Iw=f.object({transactionActionType:Vu,transactionAddress:f.string(),transactionMessageBytes:f.array(f.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),Hu=f.object({transactionActionType:Vu,transactionAddress:f.string(),transactionMessageBytes:f.base64()}).strict(),Fu=f.object({authResponse:f.custom(),nonce:f.base64(),client:f.object({clientOrigin:f.url(),jws:f.base64url()}).strict(),device:f.object({jwk:f.base64(),jws:f.base64url()}).strict(),authProvider:f.object({jwk:f.base64(),jws:f.base64url()}).strict().optional()}).strict(),Gu=f.object({signer:f.string(),userAddressTreeIndex:f.number().optional(),additionalInfo:f.looseObject({}).optional()}).strict(),yP=f.object({transactionPayload:Hu,slotHash:f.string(),slotNumber:f.string(),originIndex:f.number(),crossOrigin:f.boolean()}).strict(),Cw=f.object({phase:f.literal("start"),redirectOrigin:f.url(),signer:f.string().optional(),data:f.object({type:f.literal("message"),payload:f.string().optional()}).strict()}).strict(),Ew=f.object({phase:f.literal("start"),redirectOrigin:f.url(),signer:f.string().optional(),data:f.object({type:f.literal("transaction"),payload:Hu}).strict()}).strict(),Dw=f.object({phase:f.literal("complete"),data:f.object({type:f.literal("message"),payload:Gu.extend(Fu.shape).extend({id:f.string().optional(),message:f.string(),client:f.object({clientOrigin:f.url()}).strict()})}).strict()}).strict(),Pw=f.object({phase:f.literal("complete"),data:f.object({type:f.literal("transaction"),payload:Gu.extend(Fu.shape).extend(yP.shape).extend({client:f.object({clientOrigin:f.url()}).strict()})}).strict()}).strict();var Ue={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Ne=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(Ue).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var Ks=33,we=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!==Ks)throw new Error(`Invalid public key length, expected ${Ks} 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===Ks)return n;throw new Error("Invalid public key input")}toBytes(){let n=this.toBuffer();return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}toString(){return this.toBase58()}toJSON(){return this.toBase58()}},P=class extends we{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 fP(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function SP(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var Ku=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(fP())],["addressTableLookups",getArrayCodec(SP())]]);function ju(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 Ju(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 ne={};function qu(){if(!ne.solanaRpcEndpoint)throw new Be("RPC endpoint");return ne.solanaRpcEndpoint}function Me(){if(!ne.lightProtocolRpc)throw new Be("Light Protocol RPC");return ne.lightProtocolRpc}function se(){if(!ne.solanaRpc)throw new Be("Solana RPC");return ne.solanaRpc}function Yu(){if(!ne.sendAndConfirm)throw new Be("Send and confirm transaction function");return ne.sendAndConfirm}function Zu(){if(!ne.computeEstimate)throw new Be("Compute budget estimate function");return ne.computeEstimate}function Js(){return ne.jitoTipsConfig?ne.jitoTipsConfig:{blockEngineUrl:Bu,getJitoTipsUrl:Nu,priority:wu}}function Yw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){ne.solanaRpcEndpoint=e,ne.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});ne.solanaRpc=t,ne.sendAndConfirm=c,ne.computeEstimate=estimateComputeUnitLimitFactory({rpc:t}),ne.jitoTipsConfig=s??null;}async function rr(e,n){if(!e.ok)throw new Pe(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function nr(e){try{return await e.json()}catch(n){throw new Pe(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function u2(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Fr(n.get(-2))),y:BigInt("0x"+Fr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function A2(e){let r=p256.Point.fromBytes(getBase58Encoder().encode(e)).toBytes(false),s=new Map;return s.set(1,2),s.set(3,-7),s.set(-1,1),s.set(-2,r.slice(1,33)),s.set(-3,r.slice(33,65)),new Uint8Array(encodeCBOR(s))}async function g2(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=Ee(n),c=JSON.parse(getUtf8Decoder().decode(Ee(r))),i=eA(c),a=rA(Ee(s)),o=await gt({rpIdHash:t.subarray(0,32)});return new P(e.signer.toString(),{verifyArgs:{clientDataJson:Ee(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:qs(e.client.clientOrigin,e.device.jwk,e.nonce),domainConfig:o,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function qs(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(n),...getBase64Encoder().encode(r)]))}function p2(e){return sha256(getUtf8Encoder().encode(JSON.stringify(e)))}function m2(e){return Ys(e.data.payload.authResponse)}function y2(e,n,r,s){let t=qs(n,r,s);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...t]))}async function l2(e,n,r,s,t,c){let i;if(!t||!c){let u=(await se().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),o=qs(n,r,s),d=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...a,...i,...o]));return {slotNumber:c,slotHash:t,challenge:d}}function Ys(e){let n=Gr(e);return sha256(n)}function T2(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ee(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}async function f2(e,n){let{data:r}=await Eo(se(),e),t=tA(r.origins,r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new re("Origin","Origin not found in domain config");return t}function S2(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function x2(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}function Fr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function _P(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 eA(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let s=JSON.stringify(r);return new TextEncoder().encode(s.slice(1,-1))}function tA(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let i=e[s]|e[s+1]<<8;if(s+=2,s+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(s,s+i),o=t.decode(a);r.push(o),s+=i;}return r}function rA(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let I=n&127;r+=I;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,o=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let p=p256.Point.CURVE().n>>1n,T=BigInt("0x"+Fr(u)),b=(T>p?p256.Point.CURVE().n-T:T).toString(16).padStart(64,"0"),x=_P(b);return new Uint8Array([...g,...x])}function Gr(e){let n=Ee(e.response.clientDataJSON),r=Ee(e.response.authenticatorData),s=sha256(n);return new Uint8Array([...r,...s])}var OP={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true,initialDelayMs:500,maxRetries:3};function BP(e,n,r,s){let t=n*Math.pow(r,e-1);return Math.min(t,s)}function NP(e){return new Promise(n=>setTimeout(n,e))}async function cr(e,n){let{maxRetries:r,initialDelayMs:s,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...OP,...n},a;for(let o=1;o<=r;o++)try{return await e()}catch(d){if(a=d,i&&!i(d,o))throw d;if(o>=r)break;let u=BP(o,s,t,c);await NP(u);}throw new wr(e.name||"retryWithBackoff",r,a)}async function pt(e,n){let r=(s,t)=>t>(n?.maxRetries??3)?false:s instanceof Response?s.status===429?n?.retryOnRateLimit??true:s.status>=400&&s.status<500?false:s.status>=500:s instanceof TypeError||s instanceof Error;return cr(e,{...n,shouldRetry:n?.shouldRetry??r})}function cA(e,n,r,s){if(e<n||e>r)throw new Y(`${s} must be between ${n} and ${r} (inclusive), got ${e}`)}function aA(e,n){if(e<0)throw new Y(`${n} must be non-negative, got ${e}`)}function ar(e,n){if(e.length===0)throw new Y(`${n} cannot be empty`)}function iA(e,n){if(e.trim().length===0)throw new Y(`${n} cannot be empty`)}async function Xs(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await se().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(s.instructions,c),c=>setTransactionMessageFeePayerSigner(s.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let i=Math.ceil((s.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 gA(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===AccountRole.WRITABLE||c.role===AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,i)=>c-i);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function pA(e,n){ar(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new Y(`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 rr(r,n);let s=await nr(r);if(!s.result||s.error)throw new me(`Unable to simulate bundle: ${JSON.stringify(s.error??s.result)}`);if(typeof s.result.value.summary!="string"&&s.result.value.summary.failed){let{TransactionFailure:t}=s.result.value.summary.failed.error,[,c]=t;throw new me(`Simulation failed: ${c}`)}return s.result.value.transactionResults.map(t=>t.unitsConsumed)}function Z(e,n=0){let r=e instanceof P?e:void 0,s=r?.verifyArgs&&n!==-1?some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs.clientDataJson?Gr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:i,publicKey:a}}function he(e){if(e instanceof we)return {keyType:tr.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:tr.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function AA(e){return e instanceof P?e.toString():e.address.toString()}function fe(e){let n=new Set,r=[];for(let t of e)n.has(AA(t))||(r.push(t),n.add(AA(t)));let s=r.filter(t=>t instanceof P);if(s.length>1)throw new Y(`More than 1 Secp256r1 signers in an instruction is not supported (found ${s.length})`);return r}function mA({payer:e,tipAmount:n}){let r=zs[Math.floor(Math.random()*zs.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function yA(e){return typeof e=="string"?e:e.toString()}function lA(e){return e.toString()}async function Qs(e,n,r){let s=e?.get(n);if(s)return s;let t=await r();return t&&e&&e.set(n,t),t}var B=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:r?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(A.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await Me().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let 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:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function zr(e,n){let r=yA(e);return Qs(n,r,()=>Me().getCompressedAccount(e))}async function st(e,n){let r=lA(e);return Qs(n,r,()=>se().getAccountInfo(e,{encoding:"base64"}).send())}async function ye(e,n){let r=(await Promise.all(e.map(s=>zr(s.address,n)))).filter(s=>s!==null).filter(s=>s.data!==null&&s.address!==null);if(r.length!==e.length)throw new re("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((s,t)=>({...s,type:e[t].type,tree:s.treeInfo.tree,queue:s.treeInfo.queue}))}function U(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function Ae(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:s[u],address:d.address.toArray()})),{addressTrees: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 de(e,n,r,s,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:s[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let o=e.packTreeInfos(a,[]).stateTrees;if(!o)throw new Y("Unable to parse state tree data");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Re(e,n,r,s,t){let c=null,i=null,a=null,o=new B;if(e){await o.addSystemAccounts();let{address:d}=await ae(n,r),u=(await ye([{address:d,type:"Settings"}],t))[0];s?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 w([u],[]);let g=o.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 Y("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:o,settingsMutArgs:i}}async function w(e,n){return cr(()=>Me().getValidityProofV0(e,n))}async function be(){return (await Kr()).length-1}var $s;async function Kr(){if(!$s){let{data:e}=await Qc(se(),await xA());$s=e.whitelistedAddressTrees;}return $s}function SA(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 dr(e,n,r){let s=await aM(e,n,r);if(!s)throw new re("User account");return s}async function aM(e,n,r){let{address:s}=await N(e,n),t=await zr(s,r);return t?.data?.data?q().decode(t.data.data):null}async function y5(e,{member:n,credentialId:r}){let s=[{memcmp:{offset:1,encoding:"base58",bytes:e}}];if(n)s.push({memcmp:{offset:33,encoding:"base58",bytes:getBase58Decoder().decode(H().encode(he(n)))}});else if(r)s.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(Ee(r))}});else return null;let t=await Me().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:s});return t.items.filter(c=>!!c.data).length?t.items.map(c=>q().decode(c.data?.data))[0]:null}async function jr(e,n,r){let s=await iM(e,n,r);if(!s)throw new re("Settings account");return s}async function iM(e,n,r){try{let{address:s}=await ae(e,n),t=await zr(s,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 s=await ls(se(),await ue(e));return s.exists?{...s.data,isCompressed:false}:null}}async function l5(e,n,r){let s=await dr(e,n,r);if(s.role===1||s.role===0){let t=[],[c,i]=await Promise.all([Me().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:getBase58Decoder().decode(H().encode(he(e)))}}]}),se().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(H().encode(he(e)))}}]}).send()]);return c.items.forEach(a=>{if(a.data?.data){let o=K().decode(a.data.data);o.data.__option==="Some"&&t.push({...o.data.value,isCompressed:true});}}),i.forEach(a=>{let o=br().decode(getBase64Encoder().encode(a.account.data[0]));t.push({...o,isCompressed:false});}),t}else return await Promise.all(s.wallets.map(t=>jr(t.index,t.settingsAddressTreeIndex,r)))}async function to(e){aA(e,"index");let n=await Kr();if(e>=n.length)throw new Y(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function T5(e){let r=(await Kr()).findIndex(s=>s.toString()===e);if(r===-1)throw new re("Address tree",`Address ${e} not found in whitelist`);return r}async function ae(e,n=0){let r=await to(n),s=deriveAddressSeedV2([getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(A)).toString(),"base58"),addressTree:new PublicKey(r)}}async function N(e,n=0){let r=await to(n),s=deriveAddressSeedV2([getUtf8Encoder().encode("user"),e instanceof we?e.toTruncatedBuffer():getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(A.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function gt({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(getUtf8Encoder().encode(n));else throw new Y("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function MA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function xA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function hA(e,n,r){cA(r,0,255,"buffer_index");let[s]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof we?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function We(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function ue(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function b5(e){let n=await ue(e);return await We(n)}async function _5(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function V5(e){ar(e,"bundle");let n=await Xs(e,true),r=await pA(n.map(getBase64EncodedWireTransaction),qu()),s=await Xs(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await mM(s.map(getBase64EncodedWireTransaction))}async function mM(e,n=Js(),r){ar(e,"serializedTransactions");let{blockEngineUrl:s}=n,t=`${s}/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 rr(c,t);let i=await nr(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 H5(e,n=30,r=3e3,s=Js()){iA(e,"bundleId");let{blockEngineUrl:t}=s,c=`${t}/getBundleStatuses`;return cr(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 rr(i,c);let a=await nr(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 o=a.result.value[0];if(o.confirmation_status==="confirmed"||o.confirmation_status==="finalized"){let d=o.transactions[o.transactions.length-1];if(!d)throw new me("No transactions in confirmed bundle",e);return d}throw new me(`Bundle status: ${o.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:i=>i instanceof me||i instanceof Pe})}async function q5({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await se().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(e,c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([Zu()(c),gA(se(),c.instructions.flatMap(d=>d.accounts??[]))]),o=Math.ceil(i*1.1);return prependTransactionMessageInstructions([...o>2e5?[getSetComputeUnitLimitInstruction({units:o})]:[],...a>0?[getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await Yu()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function d6(e,n){if(n.threshold>1)throw new Y("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(o=>vA(o.pubkey)===e);if(!r)throw new re("Member",`Signer ${e} not found in settings`);let{permissions:s}=r;if(!s)throw new re("Permissions","No permissions found for the current member");let t=Ne.has(s,Ue.InitiateTransaction),c=Ne.has(s,Ue.VoteTransaction),i=Ne.has(s,Ue.ExecuteTransaction);if(t&&c&&i)return {};if(!c||!i)throw new Vr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(o=>o.role===0);if(!a)throw new re("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(vA(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function u6({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await dr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new re("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return UM(n,c.transactionManagerUrl.value,e,s)}function UM(e,n,r,s){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:s?getBase64Decoder().decode(s):void 0,authResponses:r}))})}));if(!c.ok)throw new Pe(`Transaction manager request failed: ${c.statusText}`,c.status,n);let i=await c.json();if("error"in i)throw new Pe(`Transaction manager error: ${i.error}`,c.status,n);return i.signatures.map(a=>({[e]:getBase58Encoder().encode(a)}))}}}function vA(e){return e.keyType===tr.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function A6(e){let n=e.map(c=>je().encode(c)),r=4+n.reduce((c,i)=>c+i.length,0),s=new Uint8Array(r),t=0;s.set(getU32Encoder().encode(e.length),t),t+=4;for(let c of n)s.set(c,t),t+=c.length;return s}function g6(e){let n=0,[r,s]=getU32Decoder().read(e,n);n=s;let t=new Array(r);for(let c=0;c<r;c++){let i=Je().read(e,n);t[c]=i[0],n=i[1];}if(n!==e.length)throw new Y(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function R6({payer:e,rpId:n,origins:r,authority:s}){let t=await gt({rpId:n}),c=new B;await c.addSystemAccounts();let i=await be(),{address:a,addressTree:o}=await N(s.address,i),d=[{address:a,tree:o,queue:o,type:"User"}],u=await w([],d),g=(await Ae(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:T}=c.toAccountMetas(),S=U(u,T);return await ka({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function w6({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let i=[];r.index&&(i.push({address:(await ae(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&i.push({address:(await N(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let a=i.length?await ye(i,t):[],o=await be(),{address:d,addressTree:u}=await N(r.member,o),g=[{address:d,type:"User",tree:u,queue:u}],p=await w(a,g),T=null,S=null,b=a.filter(z=>z.type==="Settings"),x=a.filter(z=>z.type==="User");b.length&&(T=de(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),b,K())[0]),x.length&&(S=de(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,q())[0]);let I=await Ae(c,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),g),{remainingAccounts:_,systemOffset:v}=c.toAccountMetas(),D=U(p,v);return await wa({payer:n,authority:e,compressedProofArgs:D,member:Vt().decode(r.member.toBuffer()),credentialId:Ee(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:T?some({settingsMutArgs:T,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:I[0],domainConfig:s,remainingAccounts:_})}async function G6({payer:e}){let n=await MA();return Ga({payer:e,globalCounter:n})}async function J6({admin:e,rpId:n,disable:r}){let s=await gt({rpId:n});return oi({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function eV({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:i}=await ae(r,s),a=[{address:c,tree:i,queue:i,type:"Settings"}],o=await w([],a),d=(await Ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),p=U(o,g);return bi({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function aV({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:i}=await N(r,s),a=[{address:c,tree:i,queue:i,type:"User"}],o=await w([],a),d=(await Ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),p=U(o,g);return Li({compressedProofArgs:p,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}function kM(e,n,r,s){let t=LM(e,n),c=OM(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function LM(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=s-t,a=r-s-c;return n>=r?false:n<i?true:n>=s?n-s<a:false}function OM(e,n){return n<e.header.numSignerAccounts}async function qr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Ju(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),se()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,o]of t.staticAccounts.entries())i.push({address:o,role:kM(t,a,o,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let o=c[a.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=o[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=o[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 s?.filter(o=>o.address!==e)??[]){let o=i.findIndex(d=>d.address===a.address);o===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[o].role===AccountRole.READONLY||i[o].role===AccountRole.READONLY_SIGNER?i[o]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[o].role===AccountRole.WRITABLE||i[o].role===AccountRole.WRITABLE_SIGNER)&&(i[o]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}var yt=33,lt=64,oo=14,GM=2,zM=address("Secp256r1SigVerify1111111111111111111111111");function KM(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function jM(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function BA(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let s=getU8Decoder().decode(e,n);n+=1;let t=[],c=jM();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=oo;let i=[];for(let a=0;a<r;a++){let o=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:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:i},n]}})}function NA(){return createEncoder({getSizeFromValue:e=>{let n=oo*e.offsets.length,r=e.payload.reduce((s,t)=>s+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 s=KM();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),yt).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),lt).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function CV(){return combineCodec(NA(),BA())}function V(e,n){let r=e.length,s=GM+r*oo,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,g=u+yt,p=g+lt;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),s+=yt+lt+d.length;}let c=n?.programAddress??zM,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:NA().encode(i)}}function EV(e){return {programAddress:e.programAddress,accounts:{},data:BA().decode(e.data)}}async function wA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:o=false}){let d=await We(e),{accountMetas:u,addressLookupTableAccounts:g}=await qr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(V(c)),p.push(o?Eu({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):Tu({transactionBuffer:n,payer:s.address,settings:e})),a&&p.push(mA({payer:s,tipAmount:a})),{instructions:p,addressLookupTableAccounts:g}}async function VA({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:i=[],compressed:a=false,simulateProof:o=false,cachedAccounts:d}){let u=fe(s),g=await ue(e),p=await We(g),[{accountMetas:T,addressLookupTableAccounts:S,transactionMessage:b},{settingsMutArgs:x,proof:I,packedAccounts:_}]=await Promise.all([qr({transactionMessageBytes:r,walletAddress:p,additionalSigners:u.filter(te=>!(te instanceof P)),addressesByLookupTableAddress:c}),Re(a,e,n,o,d)]);_.addPreAccounts(T);let v=u.filter(te=>te instanceof P),{secp256r1VerifyArgs:D}=qM(v,i,_),{remainingAccounts:z,systemOffset:X}=_.toAccountMetas();return {instructions:YM({secp256r1VerifyInput:i,transactionMessage:b,accountMetas:T,compressed:a,payer:t,settingsMutArgs:x,proof:I,systemOffset:X,secp256r1VerifyArgs:D,settings:g,remainingAccounts:z}),addressLookupTableAccounts:S}}function qM(e,n,r){let s=[];for(let t of e){let c=n.length,{domainConfig:i,verifyArgs:a,signature:o,publicKey:d,message:u}=Z(t,c);u&&o&&d&&n.push({message:u,signature:o,publicKey:d}),i&&(r.addPreAccounts([{address:i,role:AccountRole.READONLY}]),a.__option==="Some"&&s.push({domainConfigKey:i,verifyArgs:a.value}));}return {secp256r1VerifyArgs:s}}function YM({secp256r1VerifyInput:e,transactionMessage:n,accountMetas:r,compressed:s,payer:t,settingsMutArgs:c,proof:i,systemOffset:a,secp256r1VerifyArgs:o,settings:d,remainingAccounts:u}){let g=[];e.length>0&&g.push(V(e));let p=ZM(n,r);if(s){if(!t||!c)throw new Error("Payer not found or proof args is missing.");let T=U(i,a);g.push(Lu({secp256r1VerifyArgs:o,transactionMessage:p,settingsMutArgs:c,compressedProofArgs:T,payer:t,remainingAccounts:u}));}else g.push(bu({secp256r1VerifyArgs:o,settings:d,transactionMessage:p,remainingAccounts:u}));return g}function ZM(e,n){if(e.version==="legacy")throw new Error("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:new Uint8Array(r.data??[])})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(s=>s.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function JV({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let o=fe(s),d=await ue(e),u=await We(d),[{packedAccounts:g,proof:p,settingsMutArgs:T},{value:S}]=await Promise.all([Re(a,e,n,false,t),st(u,t)]);if((S?.lamports??0)<BigInt(c))throw new Error("Insufficient balance");let b=[],x=[];for(let D of o)if(D instanceof P){let z=b.length,{domainConfig:X,verifyArgs:ie,signature:te,publicKey:le,message:Te}=Z(D,z);Te&&te&&le&&b.push({message:Te,signature:te,publicKey:le}),X&&(g.addPreAccounts([{address:X,role:AccountRole.READONLY}]),ie.__option==="Some"&&x.push({domainConfigKey:X,verifyArgs:ie.value}));}else g.addPreAccounts([{address:D.address,role:AccountRole.READONLY_SIGNER,signer:D}]);let{remainingAccounts:I,systemOffset:_}=g.toAccountMetas(),v=[];if(b.length>0&&v.push(V(b)),a){if(!i||!T)throw new Error("Payer not found or proof args is missing.");let D=U(p,_);v.push(Ki({amount:c,settingsMutArgs:T,compressedProofArgs:D,payer:i,secp256r1VerifyArgs:x,source:u,destination:r,remainingAccounts:I}));}else v.push(wi({amount:c,secp256r1VerifyArgs:x,source:u,destination:r,settings:d,remainingAccounts:I}));return v}var rh=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),nh=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Zr=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function c8({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:o,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false}){let g=fe(t),p=await ue(e),T=await We(p),S=W=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(W),getAddressEncoder().encode(Zr),getAddressEncoder().encode(s)],programAddress:Zr}),b=()=>{let W=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(s)];return d.restricted&&W.push(getUtf8Encoder().encode("restricted")),d.index>0&&W.push(getU8Encoder().encode(d.index)),W},[x,[I],_,[v],[D]]=await Promise.all([getAssociatedTokenAccountAddress(s,T,o),S(T),getAssociatedTokenAccountAddress(s,r,o),S(r),getProgramDerivedAddress({seeds:b(),programAddress:Zr})]),[z,X,ie,te]=await Promise.all([st(_,c),st(x,c),st(I,c),ch(u,e,n,c)]),le=!!z.value,Te=!!X.value,He=!!ie.value,_e=Te?getTokenDecoder().decode(getBase64Encoder().encode(X.value.data[0])).amount:BigInt(0),it=BigInt(He?ah(getBase64Encoder().encode(ie.value.data[0]))?.amount??0:0),ur=le?_:void 0,en=le?void 0:v,Tt=Te&&(_e+it<BigInt(i)||it>BigInt(0)||!le)||!Te&&le,l=!le,[pe,po]=await Promise.all([oh(T,s,_e,it,BigInt(i),u?3:4),sh(Tt,D,c)]),Q=pe.reduce((W,oe)=>W+oe.parsed.amount.toNumber(),0);if(_e+it+BigInt(Q)<BigInt(i))throw new Error("Insufficient balance");let dt=null,ke=null,Le=new B;if(po&&Le.addPreAccounts([{address:s,role:AccountRole.WRITABLE}]),te||pe.length){await Le.addSystemAccounts();let W=[];if(pe.length&&W.push(...pe.map(oe=>({hash:oe.compressedAccount.hash,tree:oe.compressedAccount.treeInfo.tree,queue:oe.compressedAccount.treeInfo.queue,data:oe.compressedAccount.data,address:oe.compressedAccount.address}))),te&&W.push(te),ke=await w(W,[]),te){let oe=pe.length;dt=de(Le,ke.treeInfos.slice(oe),ke.leafIndices.slice(oe),ke.rootIndices.slice(oe),ke.proveByIndices.slice(oe),W.slice(oe),K())[0];}}let og=pe.length&&ke?some(pe.map((W,oe)=>({isFrozen:W.parsed.state===AccountState.Frozen,hasDelegate:W.parsed.delegate!=null,amount:W.parsed.amount.toNumber(),merkleContext:{leafIndex:W.compressedAccount.leafIndex,merkleTreePubkeyIndex:Le.insertOrGet(W.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:Le.insertOrGet(W.compressedAccount.treeInfo.queue.toString()),proveByIndex:W.compressedAccount.proveByIndex},rootIndex:ke.rootIndices[oe],version:SA(W.compressedAccount.data?.discriminator),tlv:W.parsed.tlv?some(getArrayDecoder(Wt()).decode(W.parsed.tlv)):none()}))):none(),Ar=[],mo=[];for(let W of g)if(W instanceof P){let oe=Ar.length,{domainConfig:tn,verifyArgs:lo,signature:To,publicKey:fo,message:So}=Z(W,oe);So&&To&&fo&&Ar.push({message:So,signature:To,publicKey:fo}),tn&&(Le.addPreAccounts([{address:tn,role:AccountRole.READONLY}]),lo.__option==="Some"&&mo.push({domainConfigKey:tn,verifyArgs:lo.value}));}else Le.addPreAccounts([{address:W.address,role:AccountRole.READONLY_SIGNER,signer:W}]);let{remainingAccounts:cg,systemOffset:ag}=Le.toAccountMetas(),gr=[];Ar.length>0&&gr.push(V(Ar));let ig=U(ke,ag),dg=Tt?D:void 0,ug=l?nh:void 0,Ag=Tt?some(d):none(),yo={amount:i,secp256r1VerifyArgs:mo,source:T,destination:r,sourceCtokenTokenAccount:I,sourceSplTokenAccount:x,destinationCtokenTokenAccount:en,destinationSplTokenAccount:ur,mint:s,tokenProgram:o,remainingAccounts:cg,payer:a,sourceCompressedTokenAccounts:og,compressedProofArgs:ig,compressibleConfig:rh,splInterfacePda:dg,rentSponsor:ug,splInterfacePdaArgs:Ag};if(u){if(!dt)throw new Error("Payer not found or proof args is missing.");gr.push(od({...yo,settingsMutArgs:dt}));}else gr.push(Xi({...yo,settings:p}));return gr}async function sh(e,n,r){if(!e)return false;let{value:s}=await st(n,r);return !s}async function oh(e,n,r,s,t,c){let i=t-r-s;if(i<=0)return [];let o=(await Me().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(n)})).items.filter(g=>!!g.compressedAccount.data?.data.length&&g.compressedAccount.owner.toString()===Zr.toString()&&!g.parsed.amount.isZero()).sort((g,p)=>p.parsed.amount.cmp(g.parsed.amount));if(o.length===0)return [];let d=BigInt(0),u=[];for(let g of o){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 ch(e,n,r,s){if(!e)return null;let{address:t}=await ae(n,r);return (await ye([{address:t,type:"Settings"}],s))[0]}function ah(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 T8({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:o}=r,d=fe(e),u=d.filter(_=>!(_ instanceof P));i.addPreAccounts(u.map(_=>({address:_.address,role:AccountRole.READONLY_SIGNER,signer:_})));let g=d.filter(_=>_ instanceof P),p=[],T=[];for(let _ of g){let v=T.length,{domainConfig:D,verifyArgs:z,signature:X,publicKey:ie,message:te}=Z(_,v);te&&X&&ie&&T.push({message:te,signature:X,publicKey:ie}),D&&(i.addPreAccounts([{address:D,role:AccountRole.READONLY}]),z.__option==="Some"&&p.push({domainConfigKey:D,verifyArgs:z.value}));}let{remainingAccounts:S,systemOffset:b}=i.toAccountMetas(),x=U(a,b),I=[];if(T.length>0&&I.push(V(T)),c){if(!o)throw new Error("Payer not found or proof args is missing.");I.push(Sa({configActions:t,payer:n,compressedProofArgs:x,settingsMutArgs:o,remainingAccounts:S,secp256r1VerifyArgs:p}));}else I.push(await Aa({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:S,secp256r1VerifyArgs:p}));return I}async function D8({createUserArgs:e,payer:n}){let r=new B;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:AccountRole.READONLY_SIGNER,signer:u.member})));let s=await be(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:p}=await N(u.member.address,s);return {address:g,tree:p,queue:p,type:"User"}})),c=await w([],t),i=await Ae(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:o}=r.toAccountMetas(),d=U(c,o);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 v8({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let i=[],a=[];a.push(...await ye([{address:(await N(r.address,s)).address,type:"User"}],t));let o=await be(),{address:d,addressTree:u}=await ae(e,o);i.push({address:d,queue:u,tree:u,type:"Settings"});let g=a.length,p=await w(a,i),T=de(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),a.filter(v=>v.type==="User"),q())[0],b=(await Ae(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),i)).find(v=>v.type==="Settings")??null,{remainingAccounts:x,systemOffset:I}=c.toAccountMetas(),_=U(p,I);if(!b)throw new Error("Settings creation args is missing.");return await Da({settingsIndex:e,payer:n,initialMember:r,userArgs:T.data.role===3?{__kind:"Mutate",fields:[T]}:{__kind:"Read",fields:[T]},compressedProofArgs:_,settingsCreation:b,remainingAccounts:x})}async function V8({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await Re(true,e,n,false,t);if(!a)throw new Error("Proof args is missing");let o=fe(s),d=o.filter(I=>I instanceof P),u=[],g=[];for(let I of d){let _=u.length,{domainConfig:v,verifyArgs:D,signature:z,publicKey:X,message:ie}=Z(I,_);ie&&z&&X&&u.push({message:ie,signature:z,publicKey:X}),v&&(c.addPreAccounts([{address:v,role:AccountRole.READONLY}]),D.__option==="Some"&&g.push({domainConfigKey:v,verifyArgs:D.value}));}c.addPreAccounts(o.filter(I=>"address"in I).map(I=>({address:I.address,role:AccountRole.READONLY_SIGNER,signer:I})));let{remainingAccounts:p,systemOffset:T}=c.toAccountMetas(),S=U(i,T),b=[];u.length>0&&b.push(V(u));let x=await ue(e);return b.push($a({settings:x,payer:r,settingsMutArgs:a,compressedProofArgs:S,secp256r1VerifyArgs:g,remainingAccounts:p})),b}async function J8({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let i=new B;await i.addSystemAccounts();let a=await be(),{address:o,addressTree:d}=await N(r.address,a),u=[{address:o,tree:d,queue:d,type:"User"}],g=await w([],u),p=(await Ae(i,g.treeInfos,g.roots,g.rootIndices,u))[0],T=i.toAccountMetas();c=T.remainingAccounts,t={compressedProofArgs:U(g,T.systemOffset),authorityCreationArgs:p};}return Ai({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function $8({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new B;await s.addSystemAccounts();let t=await ye([{address:(await N(e.address,n)).address,type:"User"}]),c=await w(t,[]),i=de(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,q())[0],{remainingAccounts:a,systemOffset:o}=s.toAccountMetas(),d=U(c,o);return Ti({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function dH({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:o,publicKey:d}=Z(n),u=[];a&&o&&d&&u.push({message:a,signature:o,publicKey:d});let g=await dr(n instanceof P?n:n.address,r,t),p=[];p.push({address:(await N(n instanceof P?n:n.address,r)).address,type:"User"});let T,S=null,b,x=null,I=g.wallets.find(_e=>_e.isDelegate);I&&((await jr(I.index,I.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(I.index,I.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):T=await ue(I.index)),s&&((await jr(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):b=await ue(s.index));let _=new B;await _.addSystemAccounts();let v=await ye(p,t),D=await w(v,[]),z=de(_,D.treeInfos.slice(0,1),D.leafIndices.slice(0,1),D.rootIndices.slice(0,1),D.proveByIndices.slice(0,1),v.slice(0,1),q())[0],X=S?some(de(_,D.treeInfos.slice(S.start,S.end),D.leafIndices.slice(S.start,S.end),D.rootIndices.slice(S.start,S.end),D.proveByIndices.slice(S.start,S.end),v.slice(S.start,S.end),K())[0]):none(),ie=x?some(de(_,D.treeInfos.slice(x.start,x.end),D.leafIndices.slice(x.start,x.end),D.rootIndices.slice(x.start,x.end),D.proveByIndices.slice(x.start,x.end),v.slice(x.start,x.end),K())[0]):none(),{remainingAccounts:te,systemOffset:le}=_.toAccountMetas(),Te=U(D,le),He=[];return u.length>0&&He.push(V(u)),He.push(Ei({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof P?void 0:n,oldSettings:T,oldSettingsMutArgs:X,newSettings:b,newSettingsMutArgs:ie,compressedProofArgs:Te,userMutArgs:z,remainingAccounts:te})),He}async function PH({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:i}){let a=await jc(se(),s),o=a.data.multiWalletSettings,{packedAccounts:d,proof:u,settingsMutArgs:g}=await Re(c,e,n,false,i),{remainingAccounts:p,systemOffset:T}=d.toAccountMetas(),{domainConfig:S,verifyArgs:b,message:x,signature:I,publicKey:_}=Z(r),v=[];if(x&&I&&_&&v.push(V([{message:x,signature:I,publicKey:_}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let D=U(u,T);v.push(Td({transactionBuffer:s,domainConfig:S,closer:r instanceof P?void 0:r,rentCollector:a.data.payer,secp256r1VerifyArgs:b,settingsMutArgs:g,payer:t,compressedProofArgs:D,remainingAccounts:p}));}else v.push(Ad({transactionBuffer:s,domainConfig:S,closer:r instanceof P?void 0:r,settings:o,payer:a.data.payer,secp256r1VerifyArgs:b,remainingAccounts:[]}));return v}function YA({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:p,message:T,signature:S,publicKey:b}=Z(n),x=[];if(T&&S&&b&&x.push(V([{message:T,signature:S,publicKey:b}])),d){let{settingsReadonlyArgs:I,compressedProofArgs:_,remainingAccounts:v}=d;x.push(bd({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},settingsReadonlyArgs:I,compressedProofArgs:_,remainingAccounts:v}));}else x.push(Ed({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},remainingAccounts:[]}));return x}function ZA({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:o}=Z(e),d=[];return a&&i&&o&&d.push(V([{message:a,signature:i,publicKey:o}])),s?d.push(Hd({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof P?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Ld({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof P?void 0:e,remainingAccounts:[]})),d}function XA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?$d({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Jd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function QA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:o}=Z(n),d=[];return o&&i&&a&&d.push(V([{message:o,signature:i,publicKey:a}])),s?d.push(Au({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof P?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(ou({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof P?void 0:n,remainingAccounts:[]})),d}async function mF({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await Ah(r),i=new B,a=null,o=null,d=[];if(c.length||t){let g=await gh({packedAccounts:i,userAccounts:c,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:s});a=g.proof,o=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await ph({configActionsArgs:r,userMutArgs:d,index:e}),index:e,proof:a,settingsMutArgs:o,packedAccounts:i,compressed:t}}async function Ah(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>N(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let s=await Promise.all(r.members.map(t=>N(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function gh({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let T=(await ae(s,t)).address;i.push({address:T,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 o=await w(a,[]),d=[],u=[];for(let T of a)T.type==="Settings"?d.push(T):T.type==="User"&&u.push(T);let g,p=[];if(r&&o&&(g=de(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),d,K())[0]),u.length&&o){let T=r?1:0;p=de(e,o.treeInfos.slice(T),o.leafIndices.slice(T),o.rootIndices.slice(T),o.proveByIndices.slice(T),u,q());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function ph({index:e,configActionsArgs:n,userMutArgs:r}){let s=[];for(let t of n)switch(t.type){case "AddMembers":{let c=[];for(let i of t.members){let a=await N(i.member,i.userAddressTreeIndex).then(o=>r.find(d=>equalBytes(d.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(o.address)))));if(!a)throw new Error("Unable to find user account");c.push(lh({permissionArgs:i.permissions,userMutArgs:a,pubkey:i.member}));}s.push({__kind:t.type,fields:[c]});break}case "RemoveMembers":{let c=await Promise.all(t.members.map(i=>N(i.member,i.userAddressTreeIndex).then(a=>{let o=r.find(d=>equalBytes(d.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(a.address))));if(!o)throw new Error("Unable to find user account");return yh({pubkey:i.member,userMutArgs:o})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(i=>mh({permissionArgs:i.permissions,pubkey:i.member}));s.push({__kind:t.type,fields:[c]});break}default:s.push({__kind:t.type,fields:[t.threshold]});}return s}function mh({pubkey:e,permissionArgs:n}){return {memberKey:he(e),permissions:rg(n)}}function yh({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:he(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function lh({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===2)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===0&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:he(e),permissions:rg(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function rg(e){let n=[];return e.initiate&&n.push(Ue.InitiateTransaction),e.vote&&n.push(Ue.VoteTransaction),e.execute&&n.push(Ue.ExecuteTransaction),Ne.fromPermissions(n)}async function CF({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:T}){let S=await ue(n),b=Math.floor(Math.random()*255),x=await hA(S,t instanceof P?t:t.address,b),I=[],_=[];for(let Q=0;Q<s.length;Q+=p){let dt=s.subarray(Q,Q+p);I.push(dt),_.push(sha256(dt));}let v=sha256(s),{settingsReadonlyArgs:D,settingsMutArgs:z,proof:X,packedAccounts:ie}=await Re(d,n,r,false,T),{remainingAccounts:te,systemOffset:le}=ie.toAccountMetas(),Te=X&&D&&z?{settingsReadonlyArgs:D,settingsMutArgs:z,compressedProofArgs:U(X,le),remainingAccounts:te,payer:e}:null,He=fe([t,...c?[c]:[],...u]).filter(Q=>Q instanceof P).map(Q=>({memberKey:he(Q),messageHash:Ys(Q.authResponse)})),_e=YA({finalBufferHash:v,finalBufferSize:s.length,bufferIndex:b,payer:e,transactionBufferAddress:x,settings:S,creator:t,preauthorizeExecution:!c,bufferExtendHashes:_,compressedArgs:Te,expectedSecp256r1Signers:He}),it=I.map(Q=>XA({transactionMessageBytes:Q,transactionBufferAddress:x,settings:S,compressed:d})),ur=u.map(Q=>QA({voter:Q,transactionBufferAddress:x,settings:S,compressedArgs:Te})),en=ZA({compressedArgs:Te,settings:S,executor:c,transactionBufferAddress:x}),{instructions:Tt,addressLookupTableAccounts:l}=await wA({compressed:d,settings:S,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o}),pe=Q=>({payer:e,instructions:Q,addressesByLookupTableAddress:l});return [pe(_e),...it.map(Q=>pe([Q])),...ur.length?[pe(ur.flat())]:[],pe(en),pe(Tt)]}var Qr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=i=>{let a=s.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},s.set(i,a)),a},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 o=t(a.address);o.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,o.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),s=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),c=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};if(r.length===0)throw new Error("Expected at least one writable signer key");let[a]=r[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let o=[...r.map(([d])=>d),...s.map(([d])=>d),...t.map(([d])=>d),...c.map(([d])=>d)];return [i,o]}extractTableLookup(n){let[r,s]=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:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,o=n.findIndex(d=>d===a);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(a),this.keyMetaMap.delete(c);}}return [s,t]}};var $r=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,i)=>{s.set(c,i);});let t=c=>{let i=s.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 sg({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Qr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(s??{});for(let p of a){let T=t.extractTableLookup(p);if(T!==void 0){let{addressTableLookup:S,drainedKeys:b}=T;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),i.writable.push(...b.writable),i.readonly.push(...b.readonly);}}let[o,d]=t.getMessageComponents(),g=new $r(d,i).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function LF({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=sg({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return ju(s)}async function VF({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i,cachedAccounts:a,compressed:o=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await VA({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:i,simulateProof:d,cachedAccounts:a});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}
|
|
2
2
|
export{ra as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,Fu as AuthenticationContextSchema,Gu as BaseResponseSchema,la as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,da as CHANGE_CONFIG_DISCRIMINATOR,Ca as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,Ua as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Ba as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Ha as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Ka as CREATE_USER_ACCOUNTS_DISCRIMINATOR,Dw as CompleteMessageRequestSchema,Pw as CompleteTransactionRequestSchema,Za as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,ri as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,xo as DOMAIN_CONFIG_DISCRIMINATOR,di as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,mi as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,xi as EDIT_USER_DELEGATE_DISCRIMINATOR,Mo as GLOBAL_COUNTER_DISCRIMINATOR,tr as KeyType,Mi as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,Ui as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,pD as MULTI_WALLET_ERROR__ALREADY_DELEGATED,GE as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,oP as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,WD as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,LD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,OD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,nP as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,mP as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,jE as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,KE as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,nD as MULTI_WALLET_ERROR__EMPTY_MEMBERS,FD as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,eD as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,zE as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,QE as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,CD as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,ED as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,DD as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,HD as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,lD as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,mD as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,yD as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,iD as MULTI_WALLET_ERROR__INVALID_ACCOUNT,rP as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,wD as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,tD as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,uD as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,ID as MULTI_WALLET_ERROR__INVALID_BUFFER,GD as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,TD as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,aD as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,YE as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,BE as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,VE as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,OE as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,wE as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,UD as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,_D as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,oD as MULTI_WALLET_ERROR__INVALID_THRESHOLD,$D as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,$E as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,XE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,cD as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,iP as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,dD as MULTI_WALLET_ERROR__INVALID_USER_ROLE,aP as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,QD as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,HE as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,RD as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,BD as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,jD as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,tP as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,AD as MULTI_WALLET_ERROR__MISSING_ACCOUNT,zD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,YD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,dP as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,XD as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,KD as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,gD as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,gP as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,AP as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,VD as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,uP as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,ZD as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,bD as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,sP as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,pP as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,SD as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,rD as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,qE as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,ZE as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,ND as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,qD as MULTI_WALLET_ERROR__PAYER_MISMATCH,JE as MULTI_WALLET_ERROR__PERMANENT_MEMBER,hD as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,FE as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,JD as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,NE as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,vD as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,eP as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,sD as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,PD as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,MD as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,kD as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,xD as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,cP as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,fD as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,WE as MultiWalletAccount,kE as MultiWalletInstruction,Fi as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Bi as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Ue as Permission,Ne as Permissions,Bc as SETTINGS_DISCRIMINATOR,we as Secp256r1Key,P as SignedSecp256r1Key,Cw as StartMessageRequestSchema,Ew as StartTransactionRequestSchema,nd as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Yi as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,md as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,id as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,Md as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,xd as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Gc as TRANSACTION_BUFFER_DISCRIMINATOR,Nd as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Ud as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Zd as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,zd as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,iu as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,ru as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,xu as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,mu as TRANSACTION_EXECUTE_DISCRIMINATOR,Uu as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,Mu as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Vu as TransactionActionTypeSchema,yP as TransactionDetailsSchema,Iw as TransactionPayloadSchema,Hu as TransactionPayloadWithBase64MessageBytesSchema,ys as Transports,Oe as UserRole,Yc as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,pw as addWhitelistedAddressTrees,Ee as base64URLStringToBuffer,T2 as bufferToBase64URLString,T8 as changeConfig,PH as closeTransactionBuffer,DR as configAction,x2 as convertBase64StringToJWK,S2 as convertJWKToBase64String,vA as convertMemberKeyToString,A2 as convertPubkeyCompressedToCose,u2 as convertPubkeyCoseToCompressed,m2 as createClientAuthorizationCompleteRequestChallenge,p2 as createClientAuthorizationStartRequestChallenge,R6 as createDomainConfig,w6 as createDomainUserAccounts,G6 as createGlobalCounter,y2 as createMessageChallenge,YA as createTransactionBuffer,l2 as createTransactionChallenge,UM as createTransactionManagerSigner,D8 as createUserAccounts,v8 as createWallet,Co as decodeDomainConfig,Ro as decodeGlobalCounter,Nc as decodeSettings,Kc as decodeTransactionBuffer,Xc as decodeWhitelistedAddressTree,V8 as decompressSettingsAccount,g6 as deserializeConfigActions,J6 as disableDomainConfig,J8 as editDomainConfig,$8 as editTransactionManagerUrl,dH as editUserDelegate,wA as executeTransaction,ZA as executeTransactionBuffer,VA as executeTransactionSync,XA as extendTransactionBuffer,FR as extensionStruct,Ih as fetchAllDomainConfig,Rh as fetchAllGlobalCounter,Pg as fetchAllMaybeDomainConfig,Hg as fetchAllMaybeGlobalCounter,RT as fetchAllMaybeSettings,qT as fetchAllMaybeTransactionBuffer,yf as fetchAllMaybeWhitelistedAddressTree,AU as fetchAllSettings,l5 as fetchAllSettingsAccountByMember,TU as fetchAllTransactionBuffer,CU as fetchAllWhitelistedAddressTree,Eo as fetchDomainConfig,hh as fetchGlobalCounter,Dg as fetchMaybeDomainConfig,Vg as fetchMaybeGlobalCounter,ls as fetchMaybeSettings,iM as fetchMaybeSettingsAccountData,JT as fetchMaybeTransactionBuffer,aM as fetchMaybeUserAccountData,mf as fetchMaybeWhitelistedAddressTree,uU as fetchSettings,jr as fetchSettingsAccountData,jc as fetchTransactionBuffer,y5 as fetchUserAccountByFilters,dr as fetchUserAccountData,Qc as fetchWhitelistedAddressTree,Oh as getAddMemberArgsCodec,on as getAddMemberArgsDecoder,sn as getAddMemberArgsEncoder,wU as getAddWhitelistedAddressTreesDiscriminatorBytes,HU as getAddWhitelistedAddressTreesInstruction,sa as getAddWhitelistedAddressTreesInstructionAsync,VU as getAddWhitelistedAddressTreesInstructionDataCodec,na as getAddWhitelistedAddressTreesInstructionDataDecoder,Ds as getAddWhitelistedAddressTreesInstructionDataEncoder,Uh as getAdditionalMetadataCodec,nn as getAdditionalMetadataDecoder,rn as getAdditionalMetadataEncoder,oW as getChangeConfigCompressedDiscriminatorBytes,Sa as getChangeConfigCompressedInstruction,cW as getChangeConfigCompressedInstructionDataCodec,fa as getChangeConfigCompressedInstructionDataDecoder,Ta as getChangeConfigCompressedInstructionDataEncoder,YU as getChangeConfigDiscriminatorBytes,XU as getChangeConfigInstruction,Aa as getChangeConfigInstructionAsync,ZU as getChangeConfigInstructionDataCodec,ua as getChangeConfigInstructionDataDecoder,Ms as getChangeConfigInstructionDataEncoder,qs as getClientAndDeviceHash,wh as getCompiledInstructionCodec,an as getCompiledInstructionDecoder,cn as getCompiledInstructionEncoder,Gh as getCompressedAccountMetaCodec,It as getCompressedAccountMetaDecoder,xt as getCompressedAccountMetaEncoder,Jh as getCompressedAccountMetaReadOnlyCodec,Pt as getCompressedAccountMetaReadOnlyDecoder,Dt as getCompressedAccountMetaReadOnlyEncoder,Zh as getCompressedOnlyExtensionCodec,un as getCompressedOnlyExtensionDecoder,dn as getCompressedOnlyExtensionEncoder,$h as getCompressedProofCodec,ln as getCompressedProofDecoder,yn as getCompressedProofEncoder,ae as getCompressedSettingsAddressFromIndex,nR as getCompressedSettingsCodec,aR as getCompressedSettingsDataCodec,Rt as getCompressedSettingsDataDecoder,ht as getCompressedSettingsDataEncoder,K as getCompressedSettingsDecoder,Mt as getCompressedSettingsEncoder,AR as getCompressedTokenArgsCodec,Ut as getCompressedTokenArgsDecoder,vt as getCompressedTokenArgsEncoder,yR as getCompressibleExtensionCodec,En as getCompressibleExtensionDecoder,Cn as getCompressibleExtensionEncoder,SR as getCompressionInfoCodec,Pn as getCompressionInfoDecoder,Dn as getCompressionInfoEncoder,Zu as getComputeBudgetEstimate,ER as getConfigActionCodec,Je as getConfigActionDecoder,je as getConfigActionEncoder,mW as getCreateCompressedWalletDiscriminatorBytes,lW as getCreateCompressedWalletInstruction,Da as getCreateCompressedWalletInstructionAsync,yW as getCreateCompressedWalletInstructionDataCodec,Ea as getCreateCompressedWalletInstructionDataDecoder,hs as getCreateCompressedWalletInstructionDataEncoder,DW as getCreateDomainConfigDiscriminatorBytes,MW as getCreateDomainConfigInstruction,ka as getCreateDomainConfigInstructionAsync,PW as getCreateDomainConfigInstructionDataCodec,Wa as getCreateDomainConfigInstructionDataDecoder,bs as getCreateDomainConfigInstructionDataEncoder,kW as getCreateDomainUserAccountDiscriminatorBytes,OW as getCreateDomainUserAccountInstruction,wa as getCreateDomainUserAccountInstructionAsync,LW as getCreateDomainUserAccountInstructionDataCodec,Na as getCreateDomainUserAccountInstructionDataDecoder,_s as getCreateDomainUserAccountInstructionDataEncoder,GW as getCreateGlobalCounterDiscriminatorBytes,KW as getCreateGlobalCounterInstruction,Ga as getCreateGlobalCounterInstructionAsync,zW as getCreateGlobalCounterInstructionDataCodec,Fa as getCreateGlobalCounterInstructionDataDecoder,Us as getCreateGlobalCounterInstructionDataEncoder,bR as getCreateUserAccountArgsCodec,Bn as getCreateUserAccountArgsDecoder,On as getCreateUserAccountArgsEncoder,$W as getCreateUserAccountsDiscriminatorBytes,tk as getCreateUserAccountsInstruction,Ja as getCreateUserAccountsInstructionAsync,ek as getCreateUserAccountsInstructionDataCodec,ja as getCreateUserAccountsInstructionDataDecoder,ks as getCreateUserAccountsInstructionDataEncoder,dk as getDecompressSettingsAccountDiscriminatorBytes,$a as getDecompressSettingsAccountInstruction,uk as getDecompressSettingsAccountInstructionDataCodec,Qa as getDecompressSettingsAccountInstructionDataDecoder,Xa as getDecompressSettingsAccountInstructionDataEncoder,Tk as getDisableDomainConfigDiscriminatorBytes,oi as getDisableDomainConfigInstruction,fk as getDisableDomainConfigInstructionDataCodec,si as getDisableDomainConfigInstructionDataDecoder,ni as getDisableDomainConfigInstructionDataEncoder,gt as getDomainConfigAddress,xh as getDomainConfigCodec,Io as getDomainConfigDecoder,Sh as getDomainConfigDiscriminatorBytes,Eg as getDomainConfigEncoder,Ch as getDomainConfigSize,Mk as getEditDomainConfigDiscriminatorBytes,Ai as getEditDomainConfigInstruction,Rk as getEditDomainConfigInstructionAsync,hk as getEditDomainConfigInstructionDataCodec,ui as getEditDomainConfigInstructionDataDecoder,Os as getEditDomainConfigInstructionDataEncoder,WR as getEditMemberArgsCodec,Wn as getEditMemberArgsDecoder,Un as getEditMemberArgsEncoder,Ok as getEditTransactionManagerUrlDiscriminatorBytes,Ti as getEditTransactionManagerUrlInstruction,Bk as getEditTransactionManagerUrlInstructionDataCodec,li as getEditTransactionManagerUrlInstructionDataDecoder,yi as getEditTransactionManagerUrlInstructionDataEncoder,Kk as getEditUserDelegateDiscriminatorBytes,Ei as getEditUserDelegateInstruction,jk as getEditUserDelegateInstructionDataCodec,Ci as getEditUserDelegateInstructionDataDecoder,Ii as getEditUserDelegateInstructionDataEncoder,BR as getExpectedSecp256r1SignersCodec,Lt as getExpectedSecp256r1SignersDecoder,kt as getExpectedSecp256r1SignersEncoder,HR as getExtensionStructCodec,Wt as getExtensionStructDecoder,Tn as getExtensionStructEncoder,MA as getGlobalCounterAddress,Mh as getGlobalCounterCodec,ho as getGlobalCounterDecoder,Ph as getGlobalCounterDiscriminatorBytes,wg as getGlobalCounterEncoder,bh as getGlobalCounterSize,Js as getJitoTipsConfig,_5 as getLightCpiSigner,Me as getLightProtocolRpc,JR as getLinkWalletArgsCodec,Yn as getLinkWalletArgsDecoder,qn as getLinkWalletArgsEncoder,XR as getMemberCodec,_t as getMemberDecoder,bt as getMemberEncoder,eb as getMemberKeyCodec,ce as getMemberKeyDecoder,H as getMemberKeyEncoder,eL as getMigrateCompressedSettingsDiscriminatorBytes,bi as getMigrateCompressedSettingsInstruction,tL as getMigrateCompressedSettingsInstructionDataCodec,Ri as getMigrateCompressedSettingsInstructionDataDecoder,hi as getMigrateCompressedSettingsInstructionDataEncoder,dL as getMigrateCompressedUsersDiscriminatorBytes,Li as getMigrateCompressedUsersInstruction,uL as getMigrateCompressedUsersInstructionDataCodec,ki as getMigrateCompressedUsersInstructionDataDecoder,Wi as getMigrateCompressedUsersInstructionDataEncoder,tw as getMultiWalletErrorMessage,RL as getNativeTransferIntentCompressedDiscriminatorBytes,Ki as getNativeTransferIntentCompressedInstruction,bL as getNativeTransferIntentCompressedInstructionDataCodec,zi as getNativeTransferIntentCompressedInstructionDataDecoder,Gi as getNativeTransferIntentCompressedInstructionDataEncoder,fL as getNativeTransferIntentDiscriminatorBytes,wi as getNativeTransferIntentInstruction,xL as getNativeTransferIntentInstructionAsync,SL as getNativeTransferIntentInstructionDataCodec,Ni as getNativeTransferIntentInstructionDataDecoder,Bs as getNativeTransferIntentInstructionDataEncoder,sb as getNewAuthorityArgsCodec,$n as getNewAuthorityArgsDecoder,Qn as getNewAuthorityArgsEncoder,f2 as getOriginIndex,ab as getPackedAddressTreeInfoCodec,wt as getPackedAddressTreeInfoDecoder,Nt as getPackedAddressTreeInfoEncoder,ub as getPackedMerkleContextCodec,Sn as getPackedMerkleContextDecoder,fn as getPackedMerkleContextEncoder,pb as getPackedStateTreeInfoCodec,Et as getPackedStateTreeInfoDecoder,Ct as getPackedStateTreeInfoEncoder,lb as getPausableAccountExtensionCodec,wn as getPausableAccountExtensionDecoder,Nn as getPausableAccountExtensionEncoder,Sb as getPermanentDelegateAccountExtensionCodec,Hn as getPermanentDelegateAccountExtensionDecoder,Vn as getPermanentDelegateAccountExtensionEncoder,Cb as getPermissionsCodec,Ge as getPermissionsDecoder,Fe as getPermissionsEncoder,Mb as getProofArgsCodec,E as getProofArgsDecoder,C as getProofArgsEncoder,_b as getRemoveMemberArgsCodec,Ln as getRemoveMemberArgsDecoder,kn as getRemoveMemberArgsEncoder,Wb as getRentConfigCodec,bn as getRentConfigDecoder,Rn as getRentConfigEncoder,Ys as getSecp256r1MessageHash,Ob as getSecp256r1PubkeyCodec,Vt as getSecp256r1PubkeyDecoder,rs as getSecp256r1PubkeyEncoder,jM as getSecp256r1SignatureOffsetsDataDecoder,KM as getSecp256r1SignatureOffsetsDataEncoder,wb as getSecp256r1VerifyArgsCodec,G as getSecp256r1VerifyArgsDecoder,F as getSecp256r1VerifyArgsEncoder,Gb as getSecp256r1VerifyArgsWithDomainAddressCodec,ee as getSecp256r1VerifyArgsWithDomainAddressDecoder,$ as getSecp256r1VerifyArgsWithDomainAddressEncoder,V as getSecp256r1VerifyInstruction,CV as getSecp256r1VerifyInstructionDataCodec,BA as getSecp256r1VerifyInstructionDataDecoder,NA as getSecp256r1VerifyInstructionDataEncoder,Yu as getSendAndConfirmTransaction,dU as getSettingsCodec,Jb as getSettingsCreationArgsCodec,Ft as getSettingsCreationArgsDecoder,Ht as getSettingsCreationArgsEncoder,br as getSettingsDecoder,iU as getSettingsDiscriminatorBytes,hT as getSettingsEncoder,ue as getSettingsFromIndex,$b as getSettingsIndexWithAddressAndDelegateInfoCodec,cs as getSettingsIndexWithAddressAndDelegateInfoDecoder,os as getSettingsIndexWithAddressAndDelegateInfoEncoder,Zb as getSettingsIndexWithAddressCodec,ss as getSettingsIndexWithAddressDecoder,ns as getSettingsIndexWithAddressEncoder,n_ as getSettingsMutArgsCodec,J as getSettingsMutArgsDecoder,j as getSettingsMutArgsEncoder,a_ as getSettingsReadonlyArgsCodec,zt as getSettingsReadonlyArgsDecoder,Gt as getSettingsReadonlyArgsEncoder,g2 as getSignedSecp256r1Key,u6 as getSignedTransactionManager,se as getSolanaRpc,qu as getSolanaRpcEndpoint,u_ as getSplInterfacePdaArgsCodec,jt as getSplInterfacePdaArgsDecoder,Kt as getSplInterfacePdaArgsEncoder,m_ as getTokenMetadataCodec,Gn as getTokenMetadataDecoder,Fn as getTokenMetadataEncoder,JL as getTokenTransferIntentCompressedDiscriminatorBytes,od as getTokenTransferIntentCompressedInstruction,YL as getTokenTransferIntentCompressedInstructionAsync,qL as getTokenTransferIntentCompressedInstructionDataCodec,sd as getTokenTransferIntentCompressedInstructionDataDecoder,Hs as getTokenTransferIntentCompressedInstructionDataEncoder,BL as getTokenTransferIntentDiscriminatorBytes,Xi as getTokenTransferIntentInstruction,wL as getTokenTransferIntentInstructionAsync,NL as getTokenTransferIntentInstructionDataCodec,Zi as getTokenTransferIntentInstructionDataDecoder,Vs as getTokenTransferIntentInstructionDataEncoder,hA as getTransactionBufferAddress,gO as getTransactionBufferCloseCompressedDiscriminatorBytes,Td as getTransactionBufferCloseCompressedInstruction,pO as getTransactionBufferCloseCompressedInstructionDataCodec,ld as getTransactionBufferCloseCompressedInstructionDataDecoder,yd as getTransactionBufferCloseCompressedInstructionDataEncoder,nO as getTransactionBufferCloseDiscriminatorBytes,Ad as getTransactionBufferCloseInstruction,sO as getTransactionBufferCloseInstructionDataCodec,ud as getTransactionBufferCloseInstructionDataDecoder,dd as getTransactionBufferCloseInstructionDataEncoder,lU as getTransactionBufferCodec,f_ as getTransactionBufferCreateArgsCodec,qt as getTransactionBufferCreateArgsDecoder,Jt as getTransactionBufferCreateArgsEncoder,_O as getTransactionBufferCreateCompressedDiscriminatorBytes,bd as getTransactionBufferCreateCompressedInstruction,vO as getTransactionBufferCreateCompressedInstructionDataCodec,Rd as getTransactionBufferCreateCompressedInstructionDataDecoder,hd as getTransactionBufferCreateCompressedInstructionDataEncoder,IO as getTransactionBufferCreateDiscriminatorBytes,Ed as getTransactionBufferCreateInstruction,CO as getTransactionBufferCreateInstructionDataCodec,Cd as getTransactionBufferCreateInstructionDataDecoder,Id as getTransactionBufferCreateInstructionDataEncoder,zc as getTransactionBufferDecoder,yU as getTransactionBufferDiscriminatorBytes,jT as getTransactionBufferEncoder,qO as getTransactionBufferExecuteCompressedDiscriminatorBytes,Hd as getTransactionBufferExecuteCompressedInstruction,YO as getTransactionBufferExecuteCompressedInstructionDataCodec,Vd as getTransactionBufferExecuteCompressedInstructionDataDecoder,wd as getTransactionBufferExecuteCompressedInstructionDataEncoder,wO as getTransactionBufferExecuteDiscriminatorBytes,Ld as getTransactionBufferExecuteInstruction,VO as getTransactionBufferExecuteInstructionDataCodec,kd as getTransactionBufferExecuteInstructionDataDecoder,Wd as getTransactionBufferExecuteInstructionDataEncoder,uB as getTransactionBufferExtendCompressedDiscriminatorBytes,$d as getTransactionBufferExtendCompressedInstruction,AB as getTransactionBufferExtendCompressedInstructionDataCodec,Qd as getTransactionBufferExtendCompressedInstructionDataDecoder,Xd as getTransactionBufferExtendCompressedInstructionDataEncoder,rB as getTransactionBufferExtendDiscriminatorBytes,Jd as getTransactionBufferExtendInstruction,nB as getTransactionBufferExtendInstructionDataCodec,jd as getTransactionBufferExtendInstructionDataDecoder,Kd as getTransactionBufferExtendInstructionDataEncoder,RB as getTransactionBufferVoteCompressedDiscriminatorBytes,Au as getTransactionBufferVoteCompressedInstruction,bB as getTransactionBufferVoteCompressedInstructionDataCodec,uu as getTransactionBufferVoteCompressedInstructionDataDecoder,du as getTransactionBufferVoteCompressedInstructionDataEncoder,SB as getTransactionBufferVoteDiscriminatorBytes,ou as getTransactionBufferVoteInstruction,xB as getTransactionBufferVoteInstructionDataCodec,su as getTransactionBufferVoteInstructionDataDecoder,nu as getTransactionBufferVoteInstructionDataEncoder,zB as getTransactionExecuteCompressedDiscriminatorBytes,Eu as getTransactionExecuteCompressedInstruction,KB as getTransactionExecuteCompressedInstructionDataCodec,Cu as getTransactionExecuteCompressedInstructionDataDecoder,Iu as getTransactionExecuteCompressedInstructionDataEncoder,OB as getTransactionExecuteDiscriminatorBytes,Tu as getTransactionExecuteInstruction,BB as getTransactionExecuteInstructionDataCodec,lu as getTransactionExecuteInstructionDataDecoder,yu as getTransactionExecuteInstructionDataEncoder,iN as getTransactionExecuteSyncCompressedDiscriminatorBytes,Lu as getTransactionExecuteSyncCompressedInstruction,dN as getTransactionExecuteSyncCompressedInstructionDataCodec,ku as getTransactionExecuteSyncCompressedInstructionDataDecoder,Wu as getTransactionExecuteSyncCompressedInstructionDataEncoder,$B as getTransactionExecuteSyncDiscriminatorBytes,bu as getTransactionExecuteSyncInstruction,eN as getTransactionExecuteSyncInstructionDataCodec,Ru as getTransactionExecuteSyncInstructionDataDecoder,hu as getTransactionExecuteSyncInstructionDataEncoder,P_ as getTransactionMessageAddressTableLookupCodec,ms as getTransactionMessageAddressTableLookupDecoder,ps as getTransactionMessageAddressTableLookupEncoder,C_ as getTransactionMessageCodec,Zt as getTransactionMessageDecoder,Yt as getTransactionMessageEncoder,R_ as getTransferFeeAccountExtensionCodec,Kn as getTransferFeeAccountExtensionDecoder,zn as getTransferFeeAccountExtensionEncoder,v_ as getTransferHookAccountExtensionCodec,Jn as getTransferHookAccountExtensionDecoder,jn as getTransferHookAccountExtensionEncoder,k_ as getTransportsCodec,Qt as getTransportsDecoder,Xt as getTransportsEncoder,N as getUserAccountAddress,N_ as getUserCodec,F_ as getUserCreationArgsCodec,Ie as getUserCreationArgsDecoder,xe as getUserCreationArgsEncoder,q as getUserDecoder,et as getUserEncoder,j_ as getUserMutArgsCodec,rt as getUserMutArgsDecoder,tt as getUserMutArgsEncoder,Z_ as getUserReadOnlyArgsCodec,Bt as getUserReadOnlyArgsDecoder,Ot as getUserReadOnlyArgsEncoder,ev as getUserReadOnlyOrMutateArgsCodec,Ke as getUserReadOnlyOrMutateArgsDecoder,ze as getUserReadOnlyOrMutateArgsEncoder,ov as getUserRoleCodec,Ye as getUserRoleDecoder,qe as getUserRoleEncoder,b5 as getWalletAddressFromIndex,We as getWalletAddressFromSettings,IU as getWhitelistedAddressTreeCodec,Zc as getWhitelistedAddressTreeDecoder,xU as getWhitelistedAddressTreeDiscriminatorBytes,pf as getWhitelistedAddressTreeEncoder,to as getWhitelistedAddressTreeFromIndex,T5 as getWhitelistedAddressTreeIndexFromAddress,xA as getWhitelistedAddressTreesAddress,qN as identifyMultiWalletAccount,YN as identifyMultiWalletInstruction,Yw as initialize,PR as isConfigAction,GR as isExtensionStruct,rw as isMultiWalletError,rv as isUserReadOnlyOrMutateArgs,eV as migrateSettings,aV as migrateUsers,JV as nativeTransferIntent,FU as parseAddWhitelistedAddressTreesInstruction,aW as parseChangeConfigCompressedInstruction,QU as parseChangeConfigInstruction,TW as parseCreateCompressedWalletInstruction,hW as parseCreateDomainConfigInstruction,BW as parseCreateDomainUserAccountInstruction,jW as parseCreateGlobalCounterInstruction,rk as parseCreateUserAccountsInstruction,Ak as parseDecompressSettingsAccountInstruction,Sk as parseDisableDomainConfigInstruction,bk as parseEditDomainConfigInstruction,Nk as parseEditTransactionManagerUrlInstruction,Jk as parseEditUserDelegateInstruction,rL as parseMigrateCompressedSettingsInstruction,AL as parseMigrateCompressedUsersInstruction,_L as parseNativeTransferIntentCompressedInstruction,IL as parseNativeTransferIntentInstruction,EV as parseSecp256r1VerifyInstruction,ZL as parseTokenTransferIntentCompressedInstruction,VL as parseTokenTransferIntentInstruction,mO as parseTransactionBufferCloseCompressedInstruction,oO as parseTransactionBufferCloseInstruction,UO as parseTransactionBufferCreateCompressedInstruction,EO as parseTransactionBufferCreateInstruction,ZO as parseTransactionBufferExecuteCompressedInstruction,HO as parseTransactionBufferExecuteInstruction,gB as parseTransactionBufferExtendCompressedInstruction,sB as parseTransactionBufferExtendInstruction,_B as parseTransactionBufferVoteCompressedInstruction,IB as parseTransactionBufferVoteInstruction,jB as parseTransactionExecuteCompressedInstruction,NB as parseTransactionExecuteInstruction,uN as parseTransactionExecuteSyncCompressedInstruction,tN as parseTransactionExecuteSyncInstruction,H5 as pollJitoBundleConfirmation,mF as prepareChangeConfigArgs,CF as prepareTransactionBundle,LF as prepareTransactionMessage,VF as prepareTransactionSync,d6 as retrieveTransactionManager,mM as sendJitoBundle,A6 as serializeConfigActions,V5 as signAndSendBundledTransactions,q5 as signAndSendTransaction,c8 as tokenTransferIntent,tv as userReadOnlyOrMutateArgs,Ju as vaultTransactionMessageDeserialize,ju as vaultTransactionMessageSerialize,QA as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|