@revibase/core 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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,getEnumEncoder,getEnumDecoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getU64Encoder,getU64Decoder,getOptionEncoder,getOptionDecoder,getArrayEncoder,getArrayDecoder,getU16Encoder,getU16Decoder,getBooleanEncoder,getBooleanDecoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getUnitEncoder,getUnitDecoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64Encoder,getBase64Decoder,getTransactionEncoder,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,TreeType,encodeBN254toBase58,getLightSystemAccountMetasV2,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import T from'zod';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {p256}from'@noble/curves/nist.js';import {canonicalize}from'json-canonicalize';import {getAssociatedTokenAccountAddress,getTokenDecoder,getTransferSolInstruction}from'gill/programs';import {equalBytes}from'@noble/curves/utils.js';var Zo=new Uint8Array([201,232,212,229,59,241,106,197]);function JP(){return fixEncoderSize(getBytesEncoder(),8).encode(Zo)}function PA(){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:Zo}))}function Xo(){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 ZP(){return combineCodec(PA(),Xo())}function Qo(e){return decodeAccount(e,Xo())}async function $o(e,n,r){let o=await MA(e,n,r);return assertAccountExists(o),o}async function MA(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Qo(o)}async function XP(e,n,r){let o=await hA(e,n,r);return assertAccountsExist(o),o}async function hA(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Qo(t))}function QP(){return 846}var rs=new Uint8Array([42,206,176,58,175,129,130,233]);function tM(){return fixEncoderSize(getBytesEncoder(),8).encode(rs)}function VA(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:rs}))}function ns(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function rM(){return combineCodec(VA(),ns())}function os(e){return decodeAccount(e,ns())}async function nM(e,n,r){let o=await FA(e,n,r);return assertAccountExists(o),o}async function FA(e,n,r){let o=await fetchEncodedAccount(e,n,r);return os(o)}async function oM(e,n,r){let o=await GA(e,n,r);return assertAccountsExist(o),o}async function GA(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>os(t))}function sM(){return 24}var Br=(r=>(r[r.Initialized=0]="Initialized",r[r.Frozen=1]="Frozen",r))(Br||{});function Nr(){return getEnumEncoder(Br)}function wr(){return getEnumDecoder(Br)}function iM(){return combineCodec(Nr(),wr())}function Hr(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Vr(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function AM(){return combineCodec(Hr(),Vr())}function Fr(){return getStructEncoder([["memberKey",V()],["permissions",Le()],["userArgs",Be()]])}function Gr(){return getStructDecoder([["memberKey",Q()],["permissions",Oe()],["userArgs",Ne()]])}function yM(){return combineCodec(Fr(),Gr())}function zr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Kr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function fM(){return combineCodec(zr(),Kr())}function pt(){return getStructEncoder([["treeInfo",yt()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function mt(){return getStructDecoder([["treeInfo",lt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function CM(){return combineCodec(pt(),mt())}function Tt(){return getStructEncoder([["treeInfo",yt()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function ft(){return getStructDecoder([["treeInfo",lt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function MM(){return combineCodec(Tt(),ft())}function qr(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function jr(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function bM(){return combineCodec(qr(),jr())}function Qr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function $r(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function UM(){return combineCodec(Qr(),$r())}function St(){return getStructEncoder([["data",getOptionEncoder(en())]])}function j(){return getStructDecoder([["data",getOptionDecoder(tn())]])}function OM(){return combineCodec(St(),j())}function en(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(xt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function tn(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(It())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function HM(){return combineCodec(en(),tn())}function Ct(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",nn()],["tlv",getOptionEncoder(getArrayEncoder(rn()))],["state",Nr()]])}function Et(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",on()],["tlv",getOptionDecoder(getArrayDecoder(Dt()))],["state",wr()]])}function zM(){return combineCodec(Ct(),Et())}function an(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",un()]])}function dn(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",An()]])}function YM(){return combineCodec(an(),dn())}function un(){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",mn()]])}function An(){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",yn()]])}function QM(){return combineCodec(un(),An())}function we(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(fn())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Fr())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(xn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function He(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Sn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Gr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(In())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function rh(){return combineCodec(we(),He())}function nh(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function oh(e,n){return n.__kind===e}function Cn(){return getStructEncoder([["member",getAddressEncoder()],["role",Ve()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Ee()]])}function En(){return getStructDecoder([["member",getAddressDecoder()],["role",Fe()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",De()]])}function ih(){return combineCodec(Cn(),En())}function fn(){return getStructEncoder([["memberKey",V()],["permissions",Le()]])}function Sn(){return getStructDecoder([["memberKey",Q()],["permissions",Oe()]])}function gh(){return combineCodec(fn(),Sn())}function Pt(){return getStructEncoder([["memberKey",V()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function Mt(){return getStructDecoder([["memberKey",Q()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function lh(){return combineCodec(Pt(),Mt())}function rn(){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([Rn()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([Dn()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([Mn()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([_n()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([Un()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([qr()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([an()])]])]])}function Dt(){return getDiscriminatedUnionDecoder([["Placeholder0",getUnitDecoder()],["Placeholder1",getUnitDecoder()],["Placeholder2",getUnitDecoder()],["Placeholder3",getUnitDecoder()],["Placeholder4",getUnitDecoder()],["Placeholder5",getUnitDecoder()],["Placeholder6",getUnitDecoder()],["Placeholder7",getUnitDecoder()],["Placeholder8",getUnitDecoder()],["Placeholder9",getUnitDecoder()],["Placeholder10",getUnitDecoder()],["Placeholder11",getUnitDecoder()],["Placeholder12",getUnitDecoder()],["Placeholder13",getUnitDecoder()],["Placeholder14",getUnitDecoder()],["Placeholder15",getUnitDecoder()],["Placeholder16",getUnitDecoder()],["Placeholder17",getUnitDecoder()],["Placeholder18",getUnitDecoder()],["TokenMetadata",getStructDecoder([["fields",getTupleDecoder([bn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([Pn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([hn()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([vn()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([kn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([jr()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([dn()])]])]])}function xh(){return combineCodec(rn(),Dt())}function Ih(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Ch(e,n){return n.__kind===e}function Wn(){return getStructEncoder([["settingsMutArgs",K()],["transactionManager",getOptionEncoder(ht())]])}function Ln(){return getStructDecoder([["settingsMutArgs",q()],["transactionManager",getOptionDecoder(Rt())]])}function Mh(){return combineCodec(Wn(),Ln())}function xt(){return getStructEncoder([["pubkey",V()],["role",getU8Encoder()],["permissions",Le()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function It(){return getStructDecoder([["pubkey",Q()],["role",getU8Decoder()],["permissions",Oe()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function _h(){return combineCodec(xt(),It())}function V(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function Q(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function kh(){return combineCodec(V(),Q())}function Nn(){return getStructEncoder([["authorityCreationArgs",Ee()],["compressedProofArgs",P()]])}function wn(){return getStructDecoder([["authorityCreationArgs",De()],["compressedProofArgs",M()]])}function Bh(){return combineCodec(Nn(),wn())}function bt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function _t(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function Hh(){return combineCodec(bt(),_t())}function nn(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function on(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function Gh(){return combineCodec(nn(),on())}function yt(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function lt(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function qh(){return combineCodec(yt(),lt())}function Dn(){return getStructEncoder([])}function Pn(){return getStructDecoder([])}function Jh(){return combineCodec(Dn(),Pn())}function Mn(){return getStructEncoder([])}function hn(){return getStructDecoder([])}function Qh(){return combineCodec(Mn(),hn())}function Le(){return getStructEncoder([["mask",getU8Encoder()]])}function Oe(){return getStructDecoder([["mask",getU8Decoder()]])}function tR(){return combineCodec(Le(),Oe())}function P(){return getStructEncoder([["proof",getOptionEncoder(Qr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function M(){return getStructDecoder([["proof",getOptionDecoder($r())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function sR(){return combineCodec(P(),M())}function xn(){return getStructEncoder([["memberKey",V()],["userArgs",Be()]])}function In(){return getStructDecoder([["memberKey",Q()],["userArgs",Ne()]])}function dR(){return combineCodec(xn(),In())}function mn(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function yn(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function gR(){return combineCodec(mn(),yn())}function Fn(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function vt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function yR(){return combineCodec(Fn(),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 fR(){return combineCodec(F(),G())}function Gn(){return getStructEncoder([["verifyArgs",F()],["domainConfigIndex",getU8Encoder()]])}function zn(){return getStructDecoder([["verifyArgs",G()],["domainConfigIndex",getU8Decoder()]])}function CR(){return combineCodec(Gn(),zn())}function Kn(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function qn(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function PR(){return combineCodec(Kn(),qn())}function jn(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function Yn(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function RR(){return combineCodec(jn(),Yn())}function K(){return getStructEncoder([["accountMeta",pt()],["data",St()]])}function q(){return getStructDecoder([["accountMeta",mt()],["data",j()]])}function UR(){return combineCodec(K(),q())}function Ut(){return getStructEncoder([["accountMeta",Tt()],["data",St()]])}function kt(){return getStructDecoder([["accountMeta",ft()],["data",j()]])}function OR(){return combineCodec(Ut(),kt())}function Wt(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function Lt(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function wR(){return combineCodec(Wt(),Lt())}function Rn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(Hr())]])}function bn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(Vr())]])}function GR(){return combineCodec(Rn(),bn())}function Ot(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(Pt())]])}function Bt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(Mt())]])}function jR(){return combineCodec(Ot(),Bt())}function Nt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(zr())],["addressTableLookups",getArrayEncoder(to())]])}function wt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Kr())],["addressTableLookups",getArrayDecoder(ro())]])}function XR(){return combineCodec(Nt(),wt())}function to(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function ro(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function eb(){return combineCodec(to(),ro())}function Y(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([Gn()])]])]])}function J(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([zn()])]])]])}function ob(){return combineCodec(Y(),J())}function sb(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function cb(e,n){return n.__kind===e}function _n(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function vn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function db(){return combineCodec(_n(),vn())}function Un(){return getStructEncoder([["transferring",getU8Encoder()]])}function kn(){return getStructDecoder([["transferring",getU8Decoder()]])}function gb(){return combineCodec(Un(),kn())}var no=(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))(no||{});function Ht(){return getEnumEncoder(no)}function Vt(){return getEnumDecoder(no)}function yb(){return combineCodec(Ht(),Vt())}function Ft(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",V()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(Ht()))],["wallets",getArrayEncoder(jn())],["role",Ve()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function X(){return getStructDecoder([["domainConfig",getOptionDecoder(getAddressDecoder())],["member",Q()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(Vt()))],["wallets",getArrayDecoder(Yn())],["role",Fe()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function Sb(){return combineCodec(Ft(),X())}function Ee(){return getStructEncoder([["addressTreeInfo",bt()],["outputStateTreeIndex",getU8Encoder()]])}function De(){return getStructDecoder([["addressTreeInfo",_t()],["outputStateTreeIndex",getU8Decoder()]])}function Eb(){return combineCodec(Ee(),De())}function je(){return getStructEncoder([["accountMeta",pt()],["data",Ft()]])}function Ye(){return getStructDecoder([["accountMeta",mt()],["data",X()]])}function hb(){return combineCodec(je(),Ye())}function ht(){return getStructEncoder([["accountMeta",Tt()],["data",Ft()]])}function Rt(){return getStructDecoder([["accountMeta",ft()],["data",X()]])}function vb(){return combineCodec(ht(),Rt())}function Be(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([ht()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([je()])]])]])}function Ne(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Rt()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([Ye()])]])]])}function Lb(){return combineCodec(Be(),Ne())}function Ob(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Bb(e,n){return n.__kind===e}var Re=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(Re||{});function Ve(){return getEnumEncoder(Re)}function Fe(){return getEnumDecoder(Re)}function Hb(){return combineCodec(Ve(),Fe())}var yc=new Uint8Array([223,179,163,190,177,224,67,173]);function z_(){return fixEncoderSize(getBytesEncoder(),8).encode(yc)}function WT(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(xt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:yc}))}function gr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(It())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function K_(){return combineCodec(WT(),gr())}function lc(e){return decodeAccount(e,gr())}async function q_(e,n,r){let o=await oo(e,n,r);return assertAccountExists(o),o}async function oo(e,n,r){let o=await fetchEncodedAccount(e,n,r);return lc(o)}async function j_(e,n,r){let o=await LT(e,n,r);return assertAccountsExist(o),o}async function LT(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>lc(t))}var Ic=new Uint8Array([90,36,35,219,93,225,110,96]);function X_(){return fixEncoderSize(getBytesEncoder(),8).encode(Ic)}function $T(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["multiWalletSettings",getAddressEncoder()],["multiWalletBump",getU8Encoder()],["canExecute",getBooleanEncoder()],["preauthorizeExecution",getBooleanEncoder()],["validTill",getU64Encoder()],["payer",getAddressEncoder()],["bump",getU8Encoder()],["bufferIndex",getU8Encoder()],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["creator",V()],["executor",V()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(V())],["expectedSigners",getArrayEncoder(Pt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Ic}))}function Cc(){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",Q()],["executor",Q()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(Q())],["expectedSigners",getArrayDecoder(Mt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Q_(){return combineCodec($T(),Cc())}function Ec(e){return decodeAccount(e,Cc())}async function Dc(e,n,r){let o=await e1(e,n,r);return assertAccountExists(o),o}async function e1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Ec(o)}async function $_(e,n,r){let o=await t1(e,n,r);return assertAccountsExist(o),o}async function t1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ec(t))}var hc=new Uint8Array([105,23,173,2,197,255,80,87]);function rv(){return fixEncoderSize(getBytesEncoder(),8).encode(hc)}function S1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:hc}))}function Rc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function nv(){return combineCodec(S1(),Rc())}function bc(e){return decodeAccount(e,Rc())}async function _c(e,n,r){let o=await x1(e,n,r);return assertAccountExists(o),o}async function x1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return bc(o)}async function ov(e,n,r){let o=await I1(e,n,r);return assertAccountsExist(o),o}async function I1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>bc(t))}function m({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function O(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function y(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let o=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:O(r.value),role:vc(r.value)?upgradeRoleToSigner(o):o,...vc(r.value)?{signer:r.value}:{}})}}function vc(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var kc=new Uint8Array([8]);function Iv(){return fixEncoderSize(getBytesEncoder(),1).encode(kc)}function po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:kc}))}function Wc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function Cv(){return combineCodec(po(),Wc())}async function Lc(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:po().encode(c),programAddress:r})}function Ev(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:po().encode(c),programAddress:r})}function Dv(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:Wc().decode(e.data)}}var Hc=new Uint8Array([9]);function vv(){return fixEncoderSize(getBytesEncoder(),1).encode(Hc)}function Vc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(we())],["signers",getArrayEncoder(Y())],["compressedProofArgs",getOptionEncoder(P())]]),e=>({...e,discriminator:Hc}))}function Fc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(He())],["signers",getArrayDecoder(J())],["compressedProofArgs",getOptionDecoder(M())]])}function Uv(){return combineCodec(Vc(),Fc())}function Gc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Vc().encode(c),programAddress:r})}function kv(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Fc().decode(e.data)}}var Yc=new Uint8Array([19]);function Hv(){return fixEncoderSize(getBytesEncoder(),1).encode(Yc)}function Jc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(we())],["signers",getArrayEncoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Yc}))}function Zc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(He())],["signers",getArrayDecoder(J())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function Vv(){return combineCodec(Jc(),Zc())}function Xc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Jc().encode(c),programAddress:r})}function Fv(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Zc().decode(e.data)}}var ea=new Uint8Array([18]);function Jv(){return fixEncoderSize(getBytesEncoder(),1).encode(ea)}function mo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["addressTreeInfo",bt()],["outputStateTreeIndex",getU8Encoder()],["userArgs",Be()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:ea}))}function ta(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["addressTreeInfo",_t()],["outputStateTreeIndex",getU8Decoder()],["userArgs",Ne()],["settingsIndex",getU128Decoder()]])}function Zv(){return combineCodec(mo(),ta())}async function ra(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:mo().encode(c),programAddress:r})}function Xv(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:mo().encode(c),programAddress:r})}function Qv(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:ta().decode(e.data)}}var ua=new Uint8Array([0]);function sU(){return fixEncoderSize(getBytesEncoder(),1).encode(ua)}function lo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",Ee()],["compressedProofArgs",P()]]),e=>({...e,discriminator:ua}))}function Aa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",De()],["compressedProofArgs",M()]])}function cU(){return combineCodec(lo(),Aa())}async function ga(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:lo().encode(c),programAddress:r})}function aU(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:lo().encode(c),programAddress:r})}function iU(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Aa().decode(e.data)}}var ya=new Uint8Array([4]);function yU(){return fixEncoderSize(getBytesEncoder(),1).encode(ya)}function To(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["member",Fn()],["role",Ve()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(Ht())],["userAccountCreationArgs",Ee()],["linkWalletArgs",getOptionEncoder(Wn())]]),e=>({...e,discriminator:ya}))}function la(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["member",vt()],["role",Fe()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Vt())],["userAccountCreationArgs",De()],["linkWalletArgs",getOptionDecoder(Ln())]])}function lU(){return combineCodec(To(),la())}async function Ta(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:To().encode(c),programAddress:r})}function TU(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a=m({args:c}),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:To().encode(c),programAddress:r})}function fU(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:la().decode(e.data)}}var Sa=new Uint8Array([3]);function DU(){return fixEncoderSize(getBytesEncoder(),1).encode(Sa)}function So(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Sa}))}function xa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function PU(){return combineCodec(So(),xa())}async function Ia(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:So().encode({}),programAddress:r})}function MU(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:So().encode({}),programAddress:r})}function hU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:xa().decode(e.data)}}var Ea=new Uint8Array([5]);function WU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ea)}function Io(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["createUserArgs",getArrayEncoder(Cn())]]),e=>({...e,discriminator:Ea}))}function Da(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayDecoder(En())]])}function LU(){return combineCodec(Io(),Da())}async function Pa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Io().encode(c),programAddress:r})}function OU(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Io().encode(c),programAddress:r})}function BU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Da().decode(e.data)}}var Ra=new Uint8Array([17]);function zU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ra)}function ba(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",K()],["compressedProofArgs",P()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:Ra}))}function _a(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",q()],["compressedProofArgs",M()],["signers",getArrayDecoder(J())]])}function KU(){return combineCodec(ba(),_a())}function va(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:ba().encode(c),programAddress:r})}function qU(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:_a().decode(e.data)}}var Wa=new Uint8Array([2]);function QU(){return fixEncoderSize(getBytesEncoder(),1).encode(Wa)}function La(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:Wa}))}function Oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function $U(){return combineCodec(La(),Oa())}function Ba(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=m({args:c}),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.admin),...a],data:La().encode(c),programAddress:r})}function ek(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:Oa().decode(e.data)}}var Va=new Uint8Array([1]);function ak(){return fixEncoderSize(getBytesEncoder(),1).encode(Va)}function Eo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Nn())]]),e=>({...e,discriminator:Va}))}function Fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(wn())]])}function ik(){return combineCodec(Eo(),Fa())}async function dk(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Eo().encode(c),programAddress:r})}function Ga(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Eo().encode(c),programAddress:r})}function uk(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:o(),whitelistedAddressTrees:o(),systemProgram:r()},data:Fa().decode(e.data)}}var qa=new Uint8Array([6]);function Tk(){return fixEncoderSize(getBytesEncoder(),1).encode(qa)}function ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",je()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",P()]]),e=>({...e,discriminator:qa}))}function Ya(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ye()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",M()]])}function fk(){return combineCodec(ja(),Ya())}function Ja(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=m({args:c}),s=y(r);return Object.freeze({accounts:[s(t.authority),...a],data:ja().encode(c),programAddress:r})}function Sk(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{authority:r()},data:Ya().decode(e.data)}}var Qa=new Uint8Array([7]);function Mk(){return fixEncoderSize(getBytesEncoder(),1).encode(Qa)}function $a(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",je()],["secp256r1VerifyArgs",getOptionEncoder(F())],["delegateTo",getOptionEncoder(Kn())],["oldSettingsMutArgs",getOptionEncoder(K())],["newSettingsMutArgs",getOptionEncoder(K())],["compressedProofArgs",P()]]),e=>({...e,discriminator:Qa}))}function ei(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ye()],["secp256r1VerifyArgs",getOptionDecoder(G())],["delegateTo",getOptionDecoder(qn())],["oldSettingsMutArgs",getOptionDecoder(q())],["newSettingsMutArgs",getOptionDecoder(q())],["compressedProofArgs",M()]])}function hk(){return combineCodec($a(),ei())}function ti(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.feePayer),s(t.signer),s(t.oldSettings),s(t.newSettings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.domainConfig),...a],data:$a().encode(c),programAddress:r})}function Rk(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:o(),oldSettings:o(),newSettings:o(),slotHashSysvar:o(),instructionsSysvar:o(),domainConfig:o()},data:ei().decode(e.data)}}var ni=new Uint8Array([29]);function Lk(){return fixEncoderSize(getBytesEncoder(),1).encode(ni)}function Do(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:ni}))}function oi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())]])}function Ok(){return combineCodec(Do(),oi())}async function Bk(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(O(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Do().encode(c),programAddress:r})}function si(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Do().encode(c),programAddress:r})}function Nk(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:oi().decode(e.data)}}var ii=new Uint8Array([27]);function Kk(){return fixEncoderSize(getBytesEncoder(),1).encode(ii)}function di(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:ii}))}function ui(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function qk(){return combineCodec(di(),ui())}function Ai(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:di().encode(c),programAddress:r})}function jk(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:ui().decode(e.data)}}var Ti=new Uint8Array([30]);function eW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ti)}function Po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Wt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(Ct())],["compressedProofArgs",getOptionEncoder(P())],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:Ti}))}function fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Lt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Et())],["compressedProofArgs",getOptionDecoder(M())],["signers",getArrayDecoder(J())]])}function tW(){return combineCodec(Po(),fi())}async function rW(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(O(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Po().encode(c),programAddress:r})}function Si(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Po().encode(c),programAddress:r})}function nW(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:fi().decode(e.data)}}var Ei=new Uint8Array([28]);function uW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ei)}function Mo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Wt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(Ct())],["signers",getArrayEncoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Ei}))}function Di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Lt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Et())],["signers",getArrayDecoder(J())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function AW(){return combineCodec(Mo(),Di())}async function gW(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Mo().encode(c),programAddress:r})}function Pi(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Mo().encode(c),programAddress:r})}function pW(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:Di().decode(e.data)}}var Ri=new Uint8Array([13]);function xW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ri)}function bi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Ri}))}function _i(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function IW(){return combineCodec(bi(),_i())}function vi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:bi().encode(c),programAddress:r})}function CW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:_i().decode(e.data)}}var Wi=new Uint8Array([23]);function bW(){return fixEncoderSize(getBytesEncoder(),1).encode(Wi)}function Li(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Wi}))}function Oi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function _W(){return combineCodec(Li(),Oi())}function Bi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.rentCollector),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Li().encode(c),programAddress:r})}function vW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:Oi().decode(e.data)}}var Hi=new Uint8Array([10]);function NW(){return fixEncoderSize(getBytesEncoder(),1).encode(Hi)}function Vi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Ot()],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Hi}))}function Fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Bt()],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function wW(){return combineCodec(Vi(),Fi())}function Gi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:Vi().encode(c),programAddress:r})}function HW(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:Fi().decode(e.data)}}var qi=new Uint8Array([20]);function jW(){return fixEncoderSize(getBytesEncoder(),1).encode(qi)}function ji(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Ot()],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",P()]]),e=>({...e,discriminator:qi}))}function Yi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Bt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",kt()],["compressedProofArgs",M()]])}function YW(){return combineCodec(ji(),Yi())}function Ji(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:ji().encode(c),programAddress:r})}function JW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:Yi().decode(e.data)}}var Qi=new Uint8Array([14]);function rL(){return fixEncoderSize(getBytesEncoder(),1).encode(Qi)}function $i(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Qi}))}function ed(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function nL(){return combineCodec($i(),ed())}function td(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:$i().encode(c),programAddress:r})}function oL(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:ed().decode(e.data)}}var od=new Uint8Array([24]);function AL(){return fixEncoderSize(getBytesEncoder(),1).encode(od)}function sd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:od}))}function cd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function gL(){return combineCodec(sd(),cd())}function ad(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:sd().encode(c),programAddress:r})}function pL(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:cd().decode(e.data)}}var ud=new Uint8Array([12]);function SL(){return fixEncoderSize(getBytesEncoder(),1).encode(ud)}function Ad(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:ud}))}function gd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function xL(){return combineCodec(Ad(),gd())}function pd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.transactionBuffer),...a],data:Ad().encode(c),programAddress:r})}function IL(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:gd().decode(e.data)}}var ld=new Uint8Array([22]);function hL(){return fixEncoderSize(getBytesEncoder(),1).encode(ld)}function Td(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:ld}))}function fd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function RL(){return combineCodec(Td(),fd())}function Sd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),s=y(r);return Object.freeze({accounts:[s(t.transactionBuffer),...a],data:Td().encode(c),programAddress:r})}function bL(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:fd().decode(e.data)}}var Cd=new Uint8Array([11]);function OL(){return fixEncoderSize(getBytesEncoder(),1).encode(Cd)}function Ed(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Cd}))}function Dd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function BL(){return combineCodec(Ed(),Dd())}function Pd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Ed().encode(c),programAddress:r})}function NL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:Dd().decode(e.data)}}var Rd=new Uint8Array([21]);function KL(){return fixEncoderSize(getBytesEncoder(),1).encode(Rd)}function bd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Rd}))}function _d(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",kt()],["compressedProofArgs",M()]])}function qL(){return combineCodec(bd(),_d())}function vd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:bd().encode(c),programAddress:r})}function jL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:_d().decode(e.data)}}var Wd=new Uint8Array([15]);function $L(){return fixEncoderSize(getBytesEncoder(),1).encode(Wd)}function Ld(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Wd}))}function Od(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function eO(){return combineCodec(Ld(),Od())}function Bd(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}},c={...e},a=m({args:c}),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.transactionBuffer),...a],data:Ld().encode({}),programAddress:r})}function tO(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:Od().decode(e.data)}}var Hd=new Uint8Array([25]);function aO(){return fixEncoderSize(getBytesEncoder(),1).encode(Hd)}function Vd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Hd}))}function Fd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function iO(){return combineCodec(Vd(),Fd())}function Gd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.transactionBuffer),...a],data:Vd().encode(c),programAddress:r})}function dO(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:Fd().decode(e.data)}}var qd=new Uint8Array([16]);function lO(){return fixEncoderSize(getBytesEncoder(),1).encode(qd)}function jd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Nt()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:qd}))}function Yd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",wt()],["signers",getArrayDecoder(J())]])}function TO(){return combineCodec(jd(),Yd())}function Jd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:jd().encode(c),programAddress:r})}function fO(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Yd().decode(e.data)}}var Qd=new Uint8Array([26]);function PO(){return fixEncoderSize(getBytesEncoder(),1).encode(Qd)}function $d(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Nt()],["signers",getArrayEncoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Qd}))}function eu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",wt()],["signers",getArrayDecoder(J())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function MO(){return combineCodec($d(),eu())}function tu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:$d().encode(c),programAddress:r})}function hO(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:eu().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",_C=(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))(_C||{});function dB(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 vC=(S=>(S[S.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",S[S.ChangeConfig=1]="ChangeConfig",S[S.ChangeConfigCompressed=2]="ChangeConfigCompressed",S[S.CreateCompressedWallet=3]="CreateCompressedWallet",S[S.CreateDomainConfig=4]="CreateDomainConfig",S[S.CreateDomainUserAccount=5]="CreateDomainUserAccount",S[S.CreateGlobalCounter=6]="CreateGlobalCounter",S[S.CreateUserAccounts=7]="CreateUserAccounts",S[S.DecompressSettingsAccount=8]="DecompressSettingsAccount",S[S.DisableDomainConfig=9]="DisableDomainConfig",S[S.EditDomainConfig=10]="EditDomainConfig",S[S.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",S[S.EditUserDelegate=12]="EditUserDelegate",S[S.NativeTransferIntent=13]="NativeTransferIntent",S[S.NativeTransferIntentCompressed=14]="NativeTransferIntentCompressed",S[S.TokenTransferIntent=15]="TokenTransferIntent",S[S.TokenTransferIntentCompressed=16]="TokenTransferIntentCompressed",S[S.TransactionBufferClose=17]="TransactionBufferClose",S[S.TransactionBufferCloseCompressed=18]="TransactionBufferCloseCompressed",S[S.TransactionBufferCreate=19]="TransactionBufferCreate",S[S.TransactionBufferCreateCompressed=20]="TransactionBufferCreateCompressed",S[S.TransactionBufferExecute=21]="TransactionBufferExecute",S[S.TransactionBufferExecuteCompressed=22]="TransactionBufferExecuteCompressed",S[S.TransactionBufferExtend=23]="TransactionBufferExtend",S[S.TransactionBufferExtendCompressed=24]="TransactionBufferExtendCompressed",S[S.TransactionBufferVote=25]="TransactionBufferVote",S[S.TransactionBufferVoteCompressed=26]="TransactionBufferVoteCompressed",S[S.TransactionExecute=27]="TransactionExecute",S[S.TransactionExecuteCompressed=28]="TransactionExecuteCompressed",S[S.TransactionExecuteSync=29]="TransactionExecuteSync",S[S.TransactionExecuteSyncCompressed=30]="TransactionExecuteSyncCompressed",S))(vC||{});function uB(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 4;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 5;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 6;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 7;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 8;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 9;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 10;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 11;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 12;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 13;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 14;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 15;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 16;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 17;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 18;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 19;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 20;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 21;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 22;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 23;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 24;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 25;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 26;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 27;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 28;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 29;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 30;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var kC=6e3,WC=6001,LC=6002,OC=6003,BC=6004,NC=6005,wC=6006,HC=6007,VC=6008,FC=6009,GC=6010,zC=6011,KC=6012,qC=6013,jC=6014,YC=6015,JC=6016,ZC=6017,XC=6018,QC=6019,$C=6020,eE=6021,tE=6022,rE=6023,nE=6024,oE=6025,sE=6026,cE=6027,aE=6028,iE=6029,dE=6030,uE=6031,AE=6032,gE=6033,pE=6034,mE=6035,yE=6036,lE=6037,TE=6038,fE=6039,SE=6040,xE=6041,IE=6042,CE=6043,EE=6044,DE=6045,PE=6046,ME=6047,hE=6048,RE=6049,bE=6050,_E=6051,vE=6052,UE=6053,kE=6054,WE=6055,LE=6056,OE=6057,BE=6058,NE=6059,wE=6060,HE=6061,VE=6062,FE=6063,GE=6064,zE=6065,KE=6066,qE=6067,jE=6068,YE=6069,JE=6070,ZE=6071,XE=6072,QE=6073,$E=6074,eD=6075,tD=6076,rD=6077,nD=6078,oD=6079,sD=6080,cD=6081,aD=6082,iD=6083,dD=6084,uD=6085,AD=6086,ru;process.env.NODE_ENV!=="production"&&(ru={[uE]:"This member is already delegated to another wallet.",[HC]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[rD]:"Clock sysvar access failed. This may indicate a system error.",[_E]:"Missing credential id.",[UE]:"The domain configuration account is disabled. Please contact support or try again later.",[kE]:"Missing domain configuration account.",[eD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[AD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[GC]:"Duplicate public keys detected among members. Each member must have a unique key.",[FC]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[eE]:"No members provided. A multisig wallet must contain at least one member.",[wE]:"Slot numbers list is empty. At least one slot number is required for validation.",[XC]:"Expected a User with Administrator role for this instruction.",[VC]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[JC]:"Expected a User with Transaction Manager role for this instruction.",[SE]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[xE]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[IE]:"Declared buffer size does not match the actual serialized size.",[NE]:"Failed to compute hash. This may indicate a system error.",[pE]:"Not enough members with vote permission to meet the approval threshold.",[AE]:"At least one signer with execute permission is required to proceed.",[gE]:"At least one signer with initiate permission is required to perform this action.",[sE]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[$E]:"Invalid account index in transaction message. The account index is out of bounds.",[OE]:"Address Tree supplied is not part of the whitelisted address trees.",[QC]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[aE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[fE]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[HE]:"Member key conversion failed. The provided key format is invalid.",[mE]:"Only delegated members are allowed for this transaction.",[oE]:"Unexpected number of accounts provided for this instruction.",[qC]:"User with Permanent Member role must have a delegated wallet.",[WC]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[BC]:"The extracted public key has an invalid length or encoding.",[kC]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[OC]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[bE]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[hE]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[rE]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[ZE]:"Invalid source type for token transfer. The source account type is not supported.",[ZC]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[YC]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[nE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[sD]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[cE]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[oD]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[JE]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[NC]:"The extracted WebAuthn signed message payload is malformed.",[PE]:"An input string exceeds the maximum allowed character length.",[WE]:"This member is not registered under the provided domain configuration.",[GE]:"Member not found in settings. Cannot remove a member that does not exist.",[QE]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[iE]:"A required account is missing from the instruction context.",[VE]:"Compressed proof arguments are missing. Required for compressed account operations.",[qE]:"Missing compressed token account. Required for token transfer operations.",[cD]:"Missing destination token account. Required for token transfer operations.",[YE]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[FE]:"Light CPI accounts are missing. Required for compressed account operations.",[dE]:"User mutation arguments are required when performing add or remove delegate operations.",[dD]:"Missing new authority account. Required for domain configuration updates.",[iD]:"Missing settings account. Required for delegate operations on compressed wallets.",[BE]:"Compressed settings data is missing. The settings account must be initialized with data.",[aD]:"Missing source token account. Required for token transfer operations.",[jE]:"Missing SPL interface PDA. Required for token transfer operations.",[ME]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[tD]:"User account address is missing. Required for secp256r1 signature verification.",[uD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[lE]:"No valid signer found in this transaction.",[$C]:"Only one administrator is allowed per wallet.",[KC]:"Only one permanent member is allowed per wallet.",[jC]:"Only one transaction manager is allowed per wallet.",[LE]:"The given origin index is not in the whitelisted origins.",[KE]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[zC]:"Permanent members cannot be removed from a wallet.",[DE]:"Writable CPI calls to protected accounts are not permitted.",[wC]:"The rpIdHash extracted from the signed message does not match the expected value.",[zE]:"Settings key mismatch. The provided settings key does not match the expected value.",[LC]:"The signature index provided is out of bounds for the secp256r1 instruction.",[RE]:"The specified slot number was not found in the provided slot history.",[XE]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[tE]:"Too many members: a maximum of 4 members are supported.",[CE]:"This transaction has expired. It must be executed within 3 minutes of approval.",[EE]:"This transaction has not yet reached the required approval threshold.",[vE]:"Missing transports.",[TE]:"Only the transaction creator or rent payer may close this transaction buffer.",[nD]:"Unauthorized: Only the admin account is allowed to perform this action.",[yE]:"Member is not part of the expected signers for this transaction."});function lB(e){return process.env.NODE_ENV!=="production"?ru[e]:"Error message not available in production bundles."}function TB(e,n,r){return isProgramError(e,n,A,r)}async function RB({admin:e,addressTree:n}){return Lc({payer:e,addressTree:n,remainingAccounts:[]})}var be=class extends Error{constructor(r,o,t){super(r);this.code=o;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},Je=class extends be{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},$=class extends be{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},v=class extends be{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},ot=class extends be{constructor(r,o,t){super(r,"NETWORK_ERROR",{statusCode:o,url:t});this.statusCode=o;this.url=t;}},Cr=class extends be{constructor(r,o,t){super(`Operation "${r}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=o;this.lastError=t;}},Er=class extends be{constructor(r,o,t){super(r,"PERMISSION_ERROR",{required:o,actual:t});this.required=o;this.actual=t;}};var Kt={Ed25519:1,Secp256r1:2};var LB=T.looseObject({publicKey:T.string(),walletAddress:T.string(),settingsIndexWithAddress:T.object({index:T.union([T.number(),T.bigint()]),settingsAddressTreeIndex:T.number()})}),nu=T.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),OB=T.object({transactionActionType:nu,transactionAddress:T.string(),transactionMessageBytes:T.array(T.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),gD=T.object({transactionActionType:nu,transactionAddress:T.string(),transactionMessageBytes:T.base64()}).strict(),ou=T.object({phase:T.literal("start"),clientOrigin:T.url(),signer:T.string().optional(),rid:T.string(),validTill:T.number(),providerOrigin:T.string(),rpId:T.string(),data:T.object({type:T.literal("message"),payload:T.string(),requireTwoFactorAuthentication:T.boolean().default(false)}).strict()}).strict(),su=T.object({phase:T.literal("start"),clientOrigin:T.url(),signer:T.string().optional(),rid:T.string(),validTill:T.number(),providerOrigin:T.string(),rpId:T.string(),data:T.object({type:T.literal("transaction"),payload:gD}).strict()}).strict(),cu=T.object({startRequest:T.union([ou,su]),authResponse:T.custom(),client:T.object({clientOrigin:T.url(),jws:T.string()}).strict(),device:T.object({jwk:T.base64(),jws:T.string()}).strict()}).strict(),au=T.object({signer:T.string(),userAddressTreeIndex:T.number().optional(),additionalInfo:T.looseObject({}).optional()}).strict(),pD=T.object({slotHash:T.string(),slotNumber:T.string(),estimatedSlotHashExpiry:T.number(),originIndex:T.number(),crossOrigin:T.boolean()}).strict(),BB=T.object({phase:T.literal("complete"),data:T.object({type:T.literal("message"),payload:au.extend(cu.shape).extend({startRequest:ou,transactionManager:T.object({publicKey:T.string(),signature:T.string()}).optional()})}).strict()}).strict(),NB=T.object({phase:T.literal("complete"),data:T.object({type:T.literal("transaction"),payload:au.extend(cu.shape).extend(pD.shape).extend({startRequest:su})}).strict()}).strict();var Pe={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},_e=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,o)=>r|o,0))}static all(){return new e(Object.values(Pe).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var bo=33,ve=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!==bo)throw new Error(`Invalid public key length, expected ${bo} 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===bo)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()}},U=class extends ve{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 lD(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function TD(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var du=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(lD())],["addressTableLookups",getArrayCodec(TD())]]);function uu(e){return du.encode({numSigners:e.header.numSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,accountKeys:e.staticAccounts,instructions:e.instructions.map(r=>({programAddressIndex:r.programAddressIndex,accountIndices:r.accountIndices??[],data:Array.from(r.data??[])})),addressTableLookups:e.version!=="legacy"?e.addressTableLookups?.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes,writableIndexes:r.writableIndexes}))??[]:[]})}function Au(e){let n=du.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}var ie={};function sN(){if(!ie.solanaRpcEndpoint)throw new Je("RPC endpoint");return ie.solanaRpcEndpoint}function le(){if(!ie.lightProtocolRpc)throw new Je("Light Protocol RPC");return ie.lightProtocolRpc}function se(){if(!ie.solanaRpc)throw new Je("Solana RPC");return ie.solanaRpc}function cN(){if(!ie.sendAndConfirm)throw new Je("Send and confirm transaction function");return ie.sendAndConfirm}function aN({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r}){ie.solanaRpcEndpoint=e,ie.lightProtocolRpc=createRpc(e,r,n);let{rpc:o,sendAndConfirmTransaction:t}=createSolanaClient({urlOrMoniker:e});ie.solanaRpc=o,ie.sendAndConfirm=t;}function Dr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function ID(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 pu(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let o=JSON.stringify(r);return new TextEncoder().encode(o.slice(1,-1))}function mu(e,n){let r=[],o=0,t=new TextDecoder;for(let c=0;c<n;c++){if(o+2>e.length)throw new Error("MaxLengthExceeded");let i=e[o]|e[o+1]<<8;if(o+=2,o+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(o,o+i),s=t.decode(a);r.push(s),o+=i;}return r}function yu(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 h=n&127;r+=h;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let o=e[r+1],t=r+2,c=e.slice(t,t+o);if(r=t+o,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,s=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=s[0]===0&&s.length>32?s.slice(1):s;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let p=new Uint8Array(32);p.set(d,32-d.length);let g=p256.Point.CURVE().n>>1n,l=BigInt("0x"+Dr(u)),C=(l>g?p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),f=ID(C);return new Uint8Array([...p,...f])}function Pr(e){let n=pe(e.response.clientDataJSON),r=pe(e.response.authenticatorData),o=sha256(n);return new Uint8Array([...r,...o])}function DN(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Dr(n.get(-2))),y:BigInt("0x"+Dr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function PN(e){let r=p256.Point.fromBytes(getBase58Encoder().encode(e)).toBytes(false),o=new Map;return o.set(1,2),o.set(3,-7),o.set(-1,1),o.set(-2,r.slice(1,33)),o.set(-3,r.slice(33,65)),new Uint8Array(encodeCBOR(o))}async function MN(e){let{authenticatorData:n,clientDataJSON:r,signature:o}=e.authResponse.response,t=pe(n),c=JSON.parse(getUtf8Decoder().decode(pe(r))),i=pu(c),a=yu(pe(o)),s=await ct({rpIdHash:t.subarray(0,32)});return new U(e.signer.toString(),{verifyArgs:{clientDataJson:pe(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:vo(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:s,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function vo(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(n),...getBase64Encoder().encode(r)]))}function hN(e){return sha256(getUtf8Encoder().encode(canonicalize(e)))}function RN(e){return Uo(e.data.payload.authResponse)}function bN(e,n,r,o){let t=vo(n,r,o);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...t]))}async function _N(e,n,r,o,t,c,i){let a;if(!t||!c||!i){let p=(await se().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!p)throw new $("Slot sysvar","Unable to fetch slot sysvar data");let g=getBase64Encoder().encode(p[0]);c=getU64Decoder().decode(g.subarray(0,8)).toString(),a=g.subarray(8,40),t=getBase58Decoder().decode(a),i=Date.now()+512*400;}else a=getBase58Encoder().encode(t);let s=sha256(typeof e.transactionMessageBytes=="string"?getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),d=vo(n,r,o),u=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...s,...a,...d]));return {slotNumber:c,slotHash:t,challenge:u,estimatedSlotHashExpiry:i}}function Uo(e){let n=Pr(e);return sha256(n)}function vN(e){let n="";for(let o of e)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function pe(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,o=n.padEnd(n.length+r,"="),t=atob(o),c=new ArrayBuffer(t.length),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}async function UN(e,n){let{data:r}=await $o(se(),e),t=mu(r.origins,r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new $("Origin","Origin not found in domain config");return t}function kN(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function WN(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}var ko=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"];function ce(e,n=0){let r=e instanceof U?e:void 0,o=r?.verifyArgs&&n!==-1?some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs.clientDataJson?Pr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:o,signature:c,message:i,publicKey:a}}function ke(e,n,r=[]){let o=[];for(let t of e)if(t instanceof U){let c=r.length,{domainConfig:i,verifyArgs:a,signature:s,publicKey:d,message:u}=ce(t,c);if(u&&s&&d&&r.push({message:u,signature:s,publicKey:d}),i){let p=n.addPreAccounts([{address:i,role:AccountRole.READONLY}]).get(i)?.index;a.__option==="Some"&&p!==void 0&&o.push({__kind:"Secp256r1",fields:[{domainConfigIndex:p,verifyArgs:a.value}]});}}else {let c=n.addPreAccounts([{address:t.address,role:AccountRole.READONLY_SIGNER,signer:t}]).get(t.address)?.index;c!==void 0&&o.push({__kind:"Ed25519",fields:[c]});}return {secp256r1VerifyInput:r,transactionSyncSigners:o}}function Te(e){if(e instanceof ve)return {keyType:Kt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Kt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function Iu(e){return e instanceof U?e.toString():e.address.toString()}function de(e){let n=new Set,r=[];for(let t of e)n.has(Iu(t))||(r.push(t),n.add(Iu(t)));let o=r.filter(t=>t instanceof U);if(o.length>1)throw new v(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return r}function Cu({payer:e,tipAmount:n}){let r=ko[Math.floor(Math.random()*ko.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function Eu(e,n,r,o){if(e<n||e>r)throw new v(`${o} must be between ${n} and ${r} (inclusive), got ${e}`)}function Du(e,n){if(e<0)throw new v(`${n} must be non-negative, got ${e}`)}function Pu(e){return typeof e=="string"?e:e.toString()}function Mu(e){return e.toString()}async function Wo(e,n,r){let o=e?.get(n);if(o)return o;let t=await r();return t&&e&&e.set(n,t),t}var UD=3,kD=500,WD=2,LD=3e4,OD={backoffBase:WD,maxDelayMs:LD,retryOnRateLimit:true,initialDelayMs:kD,maxRetries:UD};function BD(e,n,r,o){let t=n*Math.pow(r,e-1);return Math.min(t,o)}function ND(e){return new Promise(n=>setTimeout(n,e))}async function hu(e,n){let{maxRetries:r,initialDelayMs:o,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...OD,...n},a;for(let s=1;s<=r;s++)try{return await e()}catch(d){if(a=d,i&&!i(d,s))throw d;if(s>=r)break;let u=BD(s,o,t,c);await ND(u);}throw new Cr(e.name||"retryWithBackoff",r,a)}var N=class{systemAccounts;nextPreIndex;preMap;nextPackedIndex;packedMap;outputTreeIndex;constructor(){this.systemAccounts=[],this.nextPreIndex=0,this.preMap=new Map,this.nextPackedIndex=0,this.packedMap=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){for(let r of n)this.insertOrGet(r.address.toString(),r,false);return this.preMap}getAccountRole(n,r){return n?r?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:r?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(A.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n,r={address:address(n),role:AccountRole.WRITABLE},o=true){let t=o?this.packedMap:this.preMap;if(!t.has(n)){let c=o?this.nextPackedIndex++:this.nextPreIndex++;t.set(n,{index:c,accountMeta:r});}return t.get(n).index}packOutputTreeIndex(n){if(n.treeType===TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await le().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let o=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());o.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let s=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(s);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:o.length>0?{packedTreeInfos:o,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(n){return Array.from(n.entries()).sort((o,t)=>o[1].index-t[1].index).map(([,{accountMeta:o}])=>({...o}))}getOffsets(n){let r=n,o=r+this.systemAccounts.length;return [r,o]}toAccountMetas(){let n=this.hashSetAccountsToMetas(this.preMap),r=this.hashSetAccountsToMetas(this.packedMap),[o,t]=this.getOffsets(n.length);return {remainingAccounts:[...n,...this.systemAccounts,...r],systemOffset:o,packedOffset:t}}};async function hr(e,n){let r=Pu(e);return Wo(n,r,()=>le().getCompressedAccount(e))}async function Xe(e,n){let r=Mu(e);return Wo(n,r,()=>se().getAccountInfo(e,{encoding:"base64"}).send())}async function ae(e,n){let r=(await Promise.all(e.map(o=>hr(o.address,n)))).filter(o=>o!==null).filter(o=>o.data!==null&&o.address!==null);if(r.length!==e.length)throw new $("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((o,t)=>({...o,type:e[t].type,tree:o.treeInfo.tree,queue:o.treeInfo.queue}))}function k(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function fe(e,n,r,o,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:o[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function te(e,n,r,o,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:o[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let s=e.packTreeInfos(a,[]).stateTrees;if(!s)throw new v("Unable to parse state tree data");return c.map((u,p)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:s.packedTreeInfos[p],address:new Uint8Array(u.address),outputStateTreeIndex:s.outputTreeIndex}}))}async function Se(e,n,r,o,t){let c=null,i=null,a=null,s=new N;if(e){await s.addSystemAccounts();let{address:d}=await re(n,r),u=(await ae([{address:d,type:"Settings"}],t))[0];o?a={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:a=await Z([u],[]);let p=s.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!p)throw new v("Unable to parse state tree data");let g=j().decode(u.data?.data);c={accountMeta:{address:new Uint8Array(u.address),treeInfo:p.packedTreeInfos[0]},data:g},i={accountMeta:{address:new Uint8Array(u.address),treeInfo:p.packedTreeInfos[0],outputStateTreeIndex:p.outputTreeIndex},data:g};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:s,settingsMutArgs:i}}async function Z(e,n){return hu(()=>le().getValidityProofV0(e,n))}async function xe(){return (await Rr()).length-1}var Lo;async function Rr(){if(!Lo){let{data:e}=await _c(se(),await vu());Lo=e.whitelistedAddressTrees;}return Lo}function _u(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 Bo(e,n,r){let o=await KD(e,n,r);if(!o)throw new $("User account");return o}async function KD(e,n,r){let{address:o}=await w(e,n),t=await hr(o,r);return t?.data?.data?X().decode(t.data.data):null}async function Cw(e,{member:n,credentialId:r}){let o=[{memcmp:{offset:1,encoding:"base58",bytes:e}}];if(n)o.push({memcmp:{offset:33,encoding:"base58",bytes:getBase58Decoder().decode(V().encode(Te(n)))}});else if(r)o.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(pe(r))}});else return null;let t=await le().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:o});return t.items.filter(c=>!!c.data).length?t.items.map(c=>X().decode(c.data?.data))[0]:null}async function br(e,n,r){let o=await qD(e,n,r);if(!o)throw new $("Settings account");return o}async function qD(e,n,r){try{let{address:o}=await re(e,n),t=await hr(o,r);if(!t?.data?.data)throw new $("Compressed settings account");let c=j().decode(t.data.data);if(c.data.__option==="None")throw new $("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let o=await oo(se(),e);return o.exists?{...o.data,isCompressed:false}:null}}async function Ew(e,n,r){let o=await Bo(e,n,r);if(o.role===1||o.role===0){let t=[],[c,i]=await Promise.all([le().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:getBase58Decoder().decode(V().encode(Te(e)))}}]}),se().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(V().encode(Te(e)))}}]}).send()]);return c.items.forEach(a=>{if(a.data?.data){let s=j().decode(a.data.data);s.data.__option==="Some"&&t.push({...s.data.value,isCompressed:true});}}),i.forEach(a=>{let s=gr().decode(getBase64Encoder().encode(a.account.data[0]));t.push({...s,isCompressed:false});}),t}else return await Promise.all(o.wallets.map(async t=>br(await Ie(t.index),t.settingsAddressTreeIndex,r)))}async function No(e){Du(e,"index");let n=await Rr();if(e>=n.length)throw new v(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function Dw(e){let r=(await Rr()).findIndex(o=>o.toString()===e);if(r===-1)throw new $("Address tree",`Address ${e} not found in whitelist`);return r}async function re(e,n=0){let r=await No(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(o,new PublicKey(r),new PublicKey(A)).toString(),"base58"),addressTree:new PublicKey(r)}}async function w(e,n=0){let r=await No(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("user"),e instanceof ve?e.toTruncatedBuffer():getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(o,new PublicKey(r),new PublicKey(A.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function ct({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(getUtf8Encoder().encode(n));else throw new v("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function Ou(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function vu(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Bu(e,n,r){Eu(r,0,255,"buffer_index");let[o]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof ve?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return o}async function Me(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function Ie(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function Lw(e){let n=await Ie(e);return await Me(n)}async function Ow(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}function qw(e,n){if(n.threshold>1)throw new v("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(s=>Hu(s.pubkey)===e);if(!r)throw new $("Member",`Signer ${e} not found in settings`);let{permissions:o}=r;if(!o)throw new $("Permissions","No permissions found for the current member");let t=_e.has(o,Pe.InitiateTransaction),c=_e.has(o,Pe.VoteTransaction),i=_e.has(o,Pe.ExecuteTransaction);if(t&&c&&i)return null;if(!c||!i)throw new Er("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(s=>s.role===0);if(!a)throw new $("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(Hu(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}function tP(e){let n=new URL(e);return n.protocol==="https:"?n.protocol="wss:":n.protocol==="http:"&&(n.protocol="ws:"),n.toString()}function rP(e,n){return new Promise((r,o)=>{let t=new WebSocket(e),c=()=>{try{t.close();}catch{}};n.addEventListener("abort",c,{once:true}),t.onopen=()=>{n.removeEventListener("abort",c),r(t);},t.onerror=()=>{n.removeEventListener("abort",c),o(new Error("WebSocket connection failed"));};})}async function nP(e,n,r){return new Promise((o,t)=>{let c=false,i=()=>{n.removeEventListener("abort",s),e.removeEventListener("message",d),e.removeEventListener("error",u),e.removeEventListener("close",p);},a=g=>{c||(c=true,i(),g());},s=()=>{try{e.close();}catch{}};n.addEventListener("abort",s);let d=g=>{if(typeof g.data!="string")return;let l;try{l=JSON.parse(g.data);}catch{return}let x=typeof l.event=="string"?l.event:"message",C=l.data;try{r(x,C)&&a(()=>o());}catch(f){a(()=>t(f));}},u=()=>{a(()=>t(new ot("Transaction manager request failed",0,e.url)));},p=()=>{a(()=>o());};e.addEventListener("message",d),e.addEventListener("error",u),e.addEventListener("close",p);})}function wo(e="Aborted"){let n=new Error(e);return n.name="AbortError",n}var oP=(e,n)=>new Promise((r,o)=>{if(n.aborted)return o(wo());let t=setTimeout(r,e);n.addEventListener("abort",()=>{clearTimeout(t),o(wo());},{once:true});});function jw(e){let{address:n,url:r,authResponses:o,transactionMessageBytes:t,onPendingApprovalsCallback:c,onPendingApprovalsSuccess:i,abortController:a,opts:s}=e,d=a??new AbortController,u=s?.maxAttempts??10,p=s?.retryDelayMs??400;return {address:n,async signTransactions(g){let{signal:l}=d,x=tP(r),C=JSON.stringify({type:"transaction",data:{publicKey:n.toString(),payload:g.map(f=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(f)),transactionMessageBytes:t?getBase64Decoder().decode(t):void 0,authResponses:o}))}});for(let f=0;f<u;f++){if(l.aborted)throw wo();let h,E;try{E=await rP(x,l),E.send(C),await nP(E,l,(I,D)=>{if(I==="error"){let B=D&&typeof D=="object"&&typeof D.error=="string"?D.error:"Unknown error",z=new Error(B);throw z.noRetry=!0,z}return I==="signatures"?(h=D.signatures,!0):(I==="pending_transaction_approval"?c?.(D.validTill):I==="transaction_approved"&&i?.(),!1)});}catch(I){if(I&&typeof I=="object"&&I.noRetry)throw new ot(`${I.message}`);if(I&&typeof I=="object"&&I.name==="AbortError")throw I}finally{try{E?.close();}catch{}}if(h?.length)return h.map(I=>({[n]:getBase58Encoder().encode(I)}));f<u-1&&await oP(p,l);}throw new ot("Transaction manager: missing signatures")}}}function Hu(e){return e.keyType===Kt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function Yw(e){let n=e.map(c=>we().encode(c)),r=4+n.reduce((c,i)=>c+i.length,0),o=new Uint8Array(r),t=0;o.set(getU32Encoder().encode(e.length),t),t+=4;for(let c of n)o.set(c,t),t+=c.length;return o}function Jw(e){let n=0,[r,o]=getU32Decoder().read(e,n);n=o;let t=new Array(r);for(let c=0;c<r;c++){let i=He().read(e,n);t[c]=i[0],n=i[1];}if(n!==e.length)throw new v(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function u2({payer:e,rpId:n,origins:r,authority:o}){let t=await ct({rpId:n}),c=new N;await c.addSystemAccounts();let i=await xe(),{address:a,addressTree:s}=await w(o.address,i),d=[{address:a,tree:s,queue:s,type:"User"}],u=await Z([],d),p=(await fe(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:g,systemOffset:l}=c.toAccountMetas(),x=k(u,l);return await ga({origins:r,authorityCreationArgs:p,authority:o,compressedProofArgs:x,payer:e,domainConfig:t,rpId:n,remainingAccounts:g})}async function I2({authority:e,payer:n,createUserArgs:r,domainConfig:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[];r.settings&&(r.transactionManager&&i.push({address:(await w(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}),i.push({address:(await re(r.settings,r.settingsAddressTreeIndex)).address,type:"Settings"}));let a=i.length?await ae(i,t):[],s=await xe(),{address:d,addressTree:u}=await w(r.member,s),p=[{address:d,type:"User",tree:u,queue:u}],g=await Z(a,p),l=null,x=null,C=a.filter(B=>B.type==="Settings"),f=a.filter(B=>B.type==="User");if(f.length&&(x=te(c,g.treeInfos.slice(0,1),g.leafIndices.slice(0,1),g.rootIndices.slice(0,1),g.proveByIndices.slice(0,1),f,X())[0]),C.length){let B=f.length,z=B+1;l=te(c,g.treeInfos.slice(B,z),g.leafIndices.slice(B,z),g.rootIndices.slice(B,z),g.proveByIndices.slice(B,z),C,j())[0];}let h=(await fe(c,g.treeInfos.slice(a.length),g.roots.slice(a.length),g.rootIndices.slice(a.length),p))[0],{remainingAccounts:E,systemOffset:I}=c.toAccountMetas(),D=k(g,I);return await Ta({payer:n,authority:e,compressedProofArgs:D,member:vt().decode(r.member.toBuffer()),credentialId:pe(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:l?some({settingsMutArgs:l,transactionManager:x?some(x):none()}):none(),userAccountCreationArgs:h,domainConfig:o,remainingAccounts:E})}async function P2({payer:e}){let n=await Ou();return Ia({payer:e,globalCounter:n})}async function b2({admin:e,rpId:n,disable:r}){let o=await ct({rpId:n});return Ba({domainConfig:o,admin:e,disable:r,remainingAccounts:[]})}function cP(e,n,r,o){let t=aP(e,n),c=iP(e,n)&&r!==o;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function aP(e,n){let r=e.staticAccounts.length,{numSignerAccounts:o,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=o-t,a=r-o-c;return n>=r?false:n<i?true:n>=o?n-o<a:false}function iP(e,n){return n<e.header.numSignerAccounts}async function _r({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:o}){let t=Au(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,s]of t.staticAccounts.entries())i.push({address:s,role:cP(t,a,s,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let s=c[a.lookupTableAddress];if(!s)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.READONLY});}}for(let a of o?.filter(s=>s.address!==e)??[]){let s=i.findIndex(d=>d.address===a.address);s===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[s].role===AccountRole.READONLY||i[s].role===AccountRole.READONLY_SIGNER?i[s]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[s].role===AccountRole.WRITABLE||i[s].role===AccountRole.WRITABLE_SIGNER)&&(i[s]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}var it=33,dt=64,Go=14,yP=2,lP=address("Secp256r1SigVerify1111111111111111111111111");function TP(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function fP(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function qu(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let o=getU8Decoder().decode(e,n);n+=1;let t=[],c=fP();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=Go;let i=[];for(let a=0;a<r;a++){let s=fixDecoderSize(getBytesDecoder(),it).decode(e,n);n+=it;let d=fixDecoderSize(getBytesDecoder(),dt).decode(e,n);n+=dt;let u=t[a].messageDataSize,p=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:s,signature:d,message:p});}return [{numSignatures:r,padding:o,offsets:t,payload:i},n]}})}function ju(){return createEncoder({getSizeFromValue:e=>{let n=Go*e.offsets.length,r=e.payload.reduce((o,t)=>o+it+dt+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=getU8Encoder().write(e.numSignatures,n,r),r=getU8Encoder().write(e.padding,n,r);let o=TP();for(let t of e.offsets)r=o.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),it).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),dt).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function F2(){return combineCodec(ju(),qu())}function H(e,n){let r=e.length,o=yP+r*Go,t=[];for(let s=0;s<r;s++){let{message:d}=e[s],u=o,p=u+it,g=p+dt;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:p,signatureInstructionIndex:65535,messageDataOffset:g,messageDataSize:d.length,messageInstructionIndex:65535}),o+=it+dt+d.length;}let c=n?.programAddress??lP,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:ju().encode(i)}}function G2(e){return {programAddress:e.programAddress,accounts:{},data:qu().decode(e.data)}}async function Yu({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:o,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:s=false}){let d=await Me(e),{accountMetas:u,addressLookupTableAccounts:p}=await _r({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),g=[];return c.length>0&&g.push(H(c)),g.push(s?Gd({transactionBuffer:n,payer:o.address,remainingAccounts:u,settingsKey:e}):Bd({transactionBuffer:n,payer:o.address,remainingAccounts:u,settings:e})),a&&g.push(Cu({payer:o,tipAmount:a})),{instructions:g,addressLookupTableAccounts:p}}async function Ju({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,additionalSigners:o,signers:t,payer:c,addressesByLookupTableAddress:i,secp256r1VerifyInput:a=[],compressed:s=false,simulateProof:d=false,cachedAccounts:u}){let p=de(t),g=await Me(e),[{accountMetas:l,addressLookupTableAccounts:x,transactionMessage:C},{settingsMutArgs:f,proof:h,packedAccounts:E}]=await Promise.all([_r({transactionMessageBytes:r,walletAddress:g,additionalSigners:o,addressesByLookupTableAddress:i}),Se(s,e,n,d,u)]);E.addPreAccounts(l);let{secp256r1VerifyInput:I,transactionSyncSigners:D}=ke(p,E,a),{remainingAccounts:B,systemOffset:z}=E.toAccountMetas(),ne=[];I.length>0&&ne.push(H(I));let Ce=SP(C,l);if(s){if(!c||!f)throw new v("Payer not found or proof args are missing for executeTransactionSync.");let me=k(h,z);ne.push(tu({signers:D,transactionMessage:Ce,settingsMutArgs:f,compressedProofArgs:me,payer:c,remainingAccounts:B}));}else ne.push(Jd({signers:D,settings:e,transactionMessage:Ce,remainingAccounts:B}));return {instructions:ne,addressLookupTableAccounts:x}}function SP(e,n){if(e.version==="legacy")throw new v("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:r.data??[]})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(o=>o.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function f8({settings:e,settingsAddressTreeIndex:n,destination:r,signers:o,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let s=de(o),d=await Me(e),[{packedAccounts:u,proof:p,settingsMutArgs:g},{value:l}]=await Promise.all([Se(a,e,n,false,t),Xe(d,t)]);if((l?.lamports??0)<BigInt(c))throw new v("Insufficient balance for native transfer.");let{secp256r1VerifyInput:x,transactionSyncSigners:C}=ke(s,u),{remainingAccounts:f,systemOffset:h}=u.toAccountMetas(),E=[];if(x.length>0&&E.push(H(x)),a){if(!i||!g)throw new Error("Payer not found or proof args is missing.");let I=k(p,h);E.push(Ai({amount:c,settingsMutArgs:g,compressedProofArgs:I,payer:i,signers:C,source:d,destination:r,remainingAccounts:f}));}else E.push(si({amount:c,signers:C,source:d,destination:r,settings:e,remainingAccounts:f}));return E}var tA=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),rA=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Ur=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function k8({settings:e,settingsAddressTreeIndex:n,destination:r,mint:o,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:s,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false}){let p=de(t),g=await Me(e),l=await MP(o,r,g,s,d),[x,C]=await Promise.all([hP(l,c),LP(u,e,n,c)]),f=RP(x,l,i),[h,E]=await Promise.all([kP(g,o,f.splBalance,f.cTokenBalance,BigInt(i),u),UP(f.requireSplInterface,l.splInterfacePda,c)]),I=BigInt(h.reduce((S,Or)=>S+(Or.parsed.amount.toNumber()??0),0));if(f.splBalance+f.cTokenBalance+I<BigInt(i))throw new v("Insufficient balance for token transfer.");let D=new N;E&&D.addPreAccounts([{address:o,role:AccountRole.WRITABLE}]);let B=bP(h,C),{proof:z,settingsMutArgs:ne}=await _P(D,B,C),Ce=vP(h,z,D),{secp256r1VerifyInput:me,transactionSyncSigners:tt}=ke(p,D),{remainingAccounts:he,systemOffset:Ae}=D.toAccountMetas(),We=k(z,Ae),rt=[];if(me.length>0&&rt.push(H(me)),u){if(!ne)throw new Error("Payer not found or proof args is missing.");rt.push(Pi({payer:a,source:g,sourceSplTokenAccount:l.sourceSplAta,sourceCtokenTokenAccount:l.sourceCtokenAta,destination:r,destinationSplTokenAccount:f.destinationSplTokenAccount,destinationCtokenTokenAccount:f.destinationCtokenTokenAccount,tokenProgram:s,mint:o,splInterfacePda:f.requireSplInterface?l.splInterfacePda:void 0,compressibleConfig:tA,rentSponsor:f.requireRentSponsor?rA:void 0,amount:i,signers:tt,sourceCompressedTokenAccounts:Ce,compressedProofArgs:We,splInterfacePdaArgs:f.requireSplInterface?some(d):none(),settingsMutArgs:ne,remainingAccounts:he}));}else rt.push(Si({settings:e,payer:a,source:g,sourceSplTokenAccount:l.sourceSplAta,sourceCtokenTokenAccount:l.sourceCtokenAta,destination:r,destinationSplTokenAccount:f.destinationSplTokenAccount,destinationCtokenTokenAccount:f.destinationCtokenTokenAccount,tokenProgram:s,mint:o,splInterfacePda:f.requireSplInterface?l.splInterfacePda:void 0,compressibleConfig:tA,rentSponsor:f.requireRentSponsor?rA:void 0,amount:i,signers:tt,sourceCompressedTokenAccounts:Ce,compressedProofArgs:We,splInterfacePdaArgs:f.requireSplInterface?some(d):none(),remainingAccounts:he}));return rt}async function MP(e,n,r,o,t){let c=g=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(g),getAddressEncoder().encode(Ur),getAddressEncoder().encode(e)],programAddress:Ur}),i=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(e)];t.restricted&&i.push(getUtf8Encoder().encode("restricted")),t.index>0&&i.push(getU8Encoder().encode(t.index));let[a,[s],d,[u],[p]]=await Promise.all([getAssociatedTokenAccountAddress(e,r,o),c(r),getAssociatedTokenAccountAddress(e,n,o),c(n),getProgramDerivedAddress({seeds:i,programAddress:Ur})]);return {sourceSplAta:a,sourceCtokenAta:s,destinationSplAta:d,destinationCTokenAta:u,splInterfacePda:p}}async function hP(e,n){let[r,o,t]=await Promise.all([Xe(e.destinationSplAta,n),Xe(e.sourceSplAta,n),Xe(e.sourceCtokenAta,n)]);return {destinationSplAtaInfo:r,sourceSplAtaInfo:o,sourceCTokenAtaInfo:t}}function RP(e,n,r){let o=!!e.destinationSplAtaInfo.value,t=!!e.sourceSplAtaInfo.value,c=!!e.sourceCTokenAtaInfo.value,i=t?getTokenDecoder().decode(getBase64Encoder().encode(e.sourceSplAtaInfo.value.data[0])).amount:BigInt(0),a=BigInt(c?OP(getBase64Encoder().encode(e.sourceCTokenAtaInfo.value.data[0]))?.amount??0:0),s=o?n.destinationSplAta:void 0,d=o?void 0:n.destinationCTokenAta,u=t&&(i+a<BigInt(r)||a>BigInt(0)||!o)||!t&&o;return {splBalance:i,cTokenBalance:a,destinationSplTokenAccount:s,destinationCtokenTokenAccount:d,requireSplInterface:u,requireRentSponsor:i+a<BigInt(r)||!o}}function bP(e,n){let r=[];return e.forEach(o=>r.push({hash:o.compressedAccount.hash,tree:o.compressedAccount.treeInfo.tree,queue:o.compressedAccount.treeInfo.queue,data:o.compressedAccount.data,address:o.compressedAccount.address})),n&&r.push(n),r}async function _P(e,n,r){let o=null,t=null;return n.length===0?{proof:t,settingsMutArgs:o}:(await e.addSystemAccounts(),t=await Z(n,[]),r&&(o=te(e,t.treeInfos.slice(-1),t.leafIndices.slice(-1),t.rootIndices.slice(-1),t.proveByIndices.slice(-1),n.slice(-1),j())[0]),{proof:t,settingsMutArgs:o})}function vP(e,n,r){return !n||!e.length?[]:e.map(o=>({amount:o.parsed.amount.toNumber(),merkleContext:{leafIndex:o.compressedAccount.leafIndex,merkleTreePubkeyIndex:r.insertOrGet(o.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:r.insertOrGet(o.compressedAccount.treeInfo.queue.toString()),proveByIndex:o.compressedAccount.proveByIndex},rootIndex:n.rootIndices[0],version:_u(o.compressedAccount.data?.discriminator),tlv:o.parsed.tlv?some(getArrayDecoder(Dt()).decode(o.parsed.tlv)):none(),state:o.parsed.state}))}async function UP(e,n,r){if(!e)return false;let{value:o}=await Xe(n,r);return !o}async function kP(e,n,r,o,t,c){let i=t-r-o;if(i<=0)return [];let s=(await le().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(n)})).items.filter(u=>!!u.compressedAccount.data?.data.length&&u.compressedAccount.owner.toString()===Ur.toString()&&!u.parsed.amount.isZero());return s.length===0?[]:WP(s,Number(i),c?3:4,{treeType:TreeType.StateV2})}function WP(e,n,r=4,o){let t=e.filter(d=>d.compressedAccount.treeInfo.treeType===o?.treeType);if(t.length===0)throw new Error("No accounts found");let c=0,i=0,a=0,s=[];t.sort((d,u)=>u.parsed.amount.cmp(d.parsed.amount));for(let d of t){if(s.length>=r||c>=n)break;(!d.parsed.amount.isZero()||!d.compressedAccount.lamports.isZero())&&(c=c+d.parsed.amount.toNumber(),i=i+d.compressedAccount.lamports.toNumber(),s.push(d));}if(a=t.slice(0,r).reduce((d,u)=>d+u.parsed.amount.toNumber(),0),s.length===0)throw new Error("No accounts found.");if(c<n){let d=t.reduce((u,p)=>u+p.parsed.amount.toNumber(),0);throw s.length>=r?new Error(`Account limit exceeded: max ${a.toString()} (${r} accounts) per transaction. Total balance: ${d.toString()} (${t.length} accounts). Consider multiple transfers to spend full balance.`):new Error(`Insufficient balance for transfer. Required: ${n.toString()}, available: ${d.toString()}.`)}if(s.length===0)throw new Error("No accounts found.");return s}async function LP(e,n,r,o){if(!e)return null;let{address:t}=await re(n,r);return (await ae([{address:t,type:"Settings"}],o))[0]??null}function OP(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 K8({signers:e,payer:n,changeConfigArgs:r}){let{settings:o,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:s}=r,d=de(e),u=[],p=[];for(let f of d)if(f instanceof U){let h=p.length,{domainConfig:E,verifyArgs:I,signature:D,publicKey:B,message:z}=ce(f,h);if(z&&D&&B&&p.push({message:z,signature:D,publicKey:B}),E){let ne=i.addPreAccounts([{address:E,role:AccountRole.READONLY}]).get(E)?.index;I.__option==="Some"&&ne!==void 0&&u.push({__kind:"Secp256r1",fields:[{domainConfigIndex:ne,verifyArgs:I.value}]});}}else {let h=i.addPreAccounts([{address:f.address,role:AccountRole.READONLY_SIGNER,signer:f}]).get(f.address)?.index;h!==void 0&&u.push({__kind:"Ed25519",fields:[h]});}let{remainingAccounts:g,systemOffset:l}=i.toAccountMetas(),x=k(a,l),C=[];if(p.length>0&&C.push(H(p)),c){if(!s)throw new v("Proof args are missing for compressed changeConfig.");C.push(Xc({configActions:t,payer:n,compressedProofArgs:x,settingsMutArgs:s,remainingAccounts:g,signers:u}));}else C.push(Gc({settings:o,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:g,signers:u}));return C}async function Q8({createUserArgs:e,payer:n}){let r=new N;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:AccountRole.READONLY_SIGNER,signer:u.member})));let o=await xe(),t=await Promise.all(e.map(async u=>{let{address:p,addressTree:g}=await w(u.member.address,o);return {address:p,tree:g,queue:g,type:"User"}})),c=await Z([],t),i=await fe(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:s}=r.toAccountMetas(),d=k(c,s);return await Pa({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,p)=>({member:u.member.address,role:u.role,userCreationArgs:i[p],transactionManagerUrl:u.role===0?u.transactionManagerUrl:null})),remainingAccounts:a})}async function sH({index:e,payer:n,initialMember:r,userAddressTreeIndex:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[],a=[];a.push(...await ae([{address:(await w(r.address,o)).address,type:"User"}],t));let s=await xe(),{address:d,addressTree:u}=await re(await Ie(e),s);i.push({address:d,queue:u,tree:u,type:"Settings"});let p=a.length,g=await Z(a,i),l=te(c,g.treeInfos.slice(0,p),g.leafIndices.slice(0,p),g.rootIndices.slice(0,p),g.proveByIndices.slice(0,p),a.filter(I=>I.type==="User"),X())[0],C=(await fe(c,g.treeInfos.slice(p),g.roots.slice(p),g.rootIndices.slice(p),i)).find(I=>I.type==="Settings")??null,{remainingAccounts:f,systemOffset:h}=c.toAccountMetas(),E=k(g,h);if(!C)throw new Error("Settings creation args is missing.");return await ra({settingsIndex:e,payer:n,initialMember:r,userArgs:l.data.role===3?{__kind:"Mutate",fields:[l]}:{__kind:"Read",fields:[l]},compressedProofArgs:E,...C,remainingAccounts:f})}async function yH({settings:e,settingsAddressTreeIndex:n,payer:r,signers:o,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await Se(true,e,n,false,t);if(!a)throw new v("Proof args are missing for settings account.");let s=de(o),{secp256r1VerifyInput:d,transactionSyncSigners:u}=ke(s,c),{remainingAccounts:p,systemOffset:g}=c.toAccountMetas(),l=k(i,g),x=[];return d.length>0&&x.push(H(d)),x.push(va({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:l,signers:u,remainingAccounts:p})),x}async function CH({authority:e,domainConfig:n,newAuthority:r,newOrigins:o}){let t=null,c=[];if(r){let i=new N;await i.addSystemAccounts();let a=await xe(),{address:s,addressTree:d}=await w(r.address,a),u=[{address:s,tree:d,queue:d,type:"User"}],p=await Z([],u),g=(await fe(i,p.treeInfos,p.roots,p.rootIndices,u))[0],l=i.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:k(p,l.systemOffset),authorityCreationArgs:g};}return Ga({domainConfig:n,authority:e,newOrigins:o?some(o):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function RH({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let o=new N;await o.addSystemAccounts();let t=await ae([{address:(await w(e.address,n)).address,type:"User"}]),c=await Z(t,[]),i=te(o,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:a,systemOffset:s}=o.toAccountMetas(),d=k(c,s);return Ja({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function NH({payer:e,user:n,userAddressTreeIndex:r,newDelegate:o,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:s,publicKey:d}=ce(n),u=[];a&&s&&d&&u.push({message:a,signature:s,publicKey:d});let p=await Bo(n instanceof U?n:n.address,r,t),g=[];g.push({address:(await w(n instanceof U?n:n.address,r)).address,type:"User"});let l,x=null,C,f=null,h=p.wallets.find(Ae=>Ae.isDelegate);if(h){let Ae=await Ie(h.index);(await br(Ae,h.settingsAddressTreeIndex,t)).isCompressed?(g.push({address:(await re(Ae,h.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:g.length-1,end:g.length}):l=await Ie(h.index);}if(o){let Ae=await Ie(o.index);(await br(Ae,o.settingsAddressTreeIndex,t)).isCompressed?(g.push({address:(await re(Ae,o.settingsAddressTreeIndex)).address,type:"Settings"}),f={start:g.length-1,end:g.length}):C=await Ie(o.index);}let E=new N;await E.addSystemAccounts();let I=await ae(g,t),D=await Z(I,[]),B=te(E,D.treeInfos.slice(0,1),D.leafIndices.slice(0,1),D.rootIndices.slice(0,1),D.proveByIndices.slice(0,1),I.slice(0,1),X())[0],z=x?some(te(E,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),I.slice(x.start,x.end),j())[0]):none(),ne=f?some(te(E,D.treeInfos.slice(f.start,f.end),D.leafIndices.slice(f.start,f.end),D.rootIndices.slice(f.start,f.end),D.proveByIndices.slice(f.start,f.end),I.slice(f.start,f.end),j())[0]):none(),{remainingAccounts:Ce,systemOffset:me}=E.toAccountMetas(),tt=k(D,me),he=[];return u.length>0&&he.push(H(u)),he.push(ti({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:o?some(o):none(),feePayer:e,signer:n instanceof U?void 0:n,oldSettings:l,oldSettingsMutArgs:z,newSettings:C,newSettingsMutArgs:ne,compressedProofArgs:tt,userMutArgs:B,remainingAccounts:Ce})),he}async function t5({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:o,compressed:t=false,cachedAccounts:c}){let i=await Dc(se(),r),a=i.data.multiWalletSettings,{packedAccounts:s,proof:d,settingsMutArgs:u}=await Se(t,a,e,false,c),{remainingAccounts:p,systemOffset:g}=s.toAccountMetas(),{domainConfig:l,verifyArgs:x,message:C,signature:f,publicKey:h}=ce(n),E=[];if(C&&f&&h&&E.push(H([{message:C,signature:f,publicKey:h}])),t){if(!o||!u)throw new v("Payer not found or proof args are missing for closing buffer.");let I=k(d,g);E.push(Bi({transactionBuffer:r,domainConfig:l,closer:n instanceof U?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:x,settingsMutArgs:u,payer:o,compressedProofArgs:I,remainingAccounts:p}));}else E.push(vi({transactionBuffer:r,domainConfig:l,closer:n instanceof U?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:x,remainingAccounts:[]}));return E}function oA({payer:e,creator:n,bufferIndex:r,settings:o,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,compressedArgs:d,expectedSigners:u}){let{domainConfig:p,verifyArgs:g,message:l,signature:x,publicKey:C}=ce(n),f=[];if(l&&x&&C&&f.push(H([{message:l,signature:x,publicKey:C}])),d){let{settingsReadonlyArgs:h,compressedProofArgs:E,remainingAccounts:I}=d;f.push(Ji({transactionBuffer:t,payer:e,secp256r1VerifyArgs:g,creator:n instanceof U?void 0:n,domainConfig:p,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},settingsReadonlyArgs:h,compressedProofArgs:E,remainingAccounts:I}));}else f.push(Gi({settings:o,transactionBuffer:t,payer:e,secp256r1VerifyArgs:g,creator:n instanceof U?void 0:n,domainConfig:p,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},remainingAccounts:[]}));return f}function sA({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:s}=ce(e),d=[];return a&&i&&s&&d.push(H([{message:a,signature:i,publicKey:s}])),o?d.push(ad({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof U?void 0:e,settingsMutArgs:o.settingsMutArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(td({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof U?void 0:e,remainingAccounts:[]})),d}function cA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:o=false}){return o?Sd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):pd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function aA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:s}=ce(n),d=[];return s&&i&&a&&d.push(H([{message:s,signature:i,publicKey:a}])),o?d.push(vd({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof U?void 0:n,settingsReadonlyArgs:o.settingsReadonlyArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(Pd({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof U?void 0:n,remainingAccounts:[]})),d}async function z5({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:o,compressed:t=false}){let c=await HP(r),i=new N,a=null,s=null,d=[];if(c.length||t){let p=await VP({packedAccounts:i,userAccounts:c,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:o});a=p.proof,s=p.settingsMutArgs??null,d=p.userMutArgs??[];}return {configActions:await FP({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:s,packedAccounts:i,compressed:t}}async function HP(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}}return n}async function VP({packedAccounts:e,userAccounts:n,compressed:r,settings:o,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let l=(await re(o,t)).address;i.push({address:l,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await ae(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let s=await Z(a,[]),d=[],u=[];for(let l of a)l.type==="Settings"?d.push(l):l.type==="User"&&u.push(l);let p,g=[];if(r&&s&&(p=te(e,s.treeInfos.slice(0,1),s.leafIndices.slice(0,1),s.rootIndices.slice(0,1),s.proveByIndices.slice(0,1),d,j())[0]),u.length&&s){let l=r?1:0;g=te(e,s.treeInfos.slice(l),s.leafIndices.slice(l),s.rootIndices.slice(l),s.proveByIndices.slice(l),u,X());}return {proof:s,settingsMutArgs:p,userMutArgs:g}}async function FP({configActionsArgs:e,userMutArgs:n}){let r=[];for(let o of e)switch(o.type){case "AddMembers":{let t=[];for(let c of o.members){let i=await w(c.member,c.userAddressTreeIndex).then(a=>n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(a.address)))));if(!i)throw new Error("Unable to find user account");t.push(KP({permissionArgs:c.permissions,userMutArgs:i,pubkey:c.member}));}r.push({__kind:o.type,fields:[t]});break}case "RemoveMembers":{let t=await Promise.all(o.members.map(c=>w(c.member,c.userAddressTreeIndex).then(i=>{let a=n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(i.address))));if(!a)throw new Error("Unable to find user account");return zP({pubkey:c.member,userMutArgs:a})})));r.push({__kind:o.type,fields:[t]});break}case "EditPermissions":{let t=o.members.map(c=>GP({permissionArgs:c.permissions,pubkey:c.member}));r.push({__kind:o.type,fields:[t]});break}default:r.push({__kind:o.type,fields:[o.threshold]});}return r}function GP({pubkey:e,permissionArgs:n}){return {memberKey:Te(e),permissions:AA(n)}}function zP({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:Te(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function KP({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:Te(e),permissions:AA(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function AA(e){let n=[];return e.initiate&&n.push(Pe.InitiateTransaction),e.vote&&n.push(Pe.VoteTransaction),e.execute&&n.push(Pe.ExecuteTransaction),_e.fromPermissions(n)}async function Q5({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s,compressed:d=false,additionalVoters:u=[],additionalSigners:p=[],chunkSize:g=Math.ceil(o.length/2),cachedAccounts:l}){let x=Math.floor(Math.random()*255),C=await Bu(n,t instanceof U?t:t.address,x),f=[],h=[];for(let ee=0;ee<o.length;ee+=g){let Jo=o.subarray(ee,ee+g);f.push(Jo),h.push(sha256(Jo));}let E=sha256(o),{settingsReadonlyArgs:I,settingsMutArgs:D,proof:B,packedAccounts:z}=await Se(d,n,r,false,l),{remainingAccounts:ne,systemOffset:Ce}=z.toAccountMetas(),me=B&&I&&D?{settingsReadonlyArgs:I,settingsMutArgs:D,compressedProofArgs:k(B,Ce),remainingAccounts:ne,payer:e}:null,tt=de([t,...c?[c]:[],...u]).map(ee=>({memberKey:Te(ee),messageHash:ee instanceof U?Uo(ee.authResponse):null})),he=oA({finalBufferHash:E,finalBufferSize:o.length,bufferIndex:x,payer:e,transactionBufferAddress:C,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:h,compressedArgs:me,expectedSigners:tt}),Ae=f.map(ee=>cA({transactionMessageBytes:ee,transactionBufferAddress:C,settings:n,compressed:d})),We=u.map(ee=>aA({voter:ee,transactionBufferAddress:C,settings:n,compressedArgs:me})),rt=sA({compressedArgs:me,settings:n,executor:c,transactionBufferAddress:C}),{instructions:S,addressLookupTableAccounts:Or}=await Yu({compressed:d,settings:n,transactionMessageBytes:o,transactionBufferAddress:C,payer:e,additionalSigners:p,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s}),ut=ee=>({payer:e,instructions:ee,addressesByLookupTableAddress:Or});return [ut(he),...Ae.map(ee=>ut([ee])),...We.length?[ut(We.flat())]:[],ut(rt),ut(S)]}var Wr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let o=new Map,t=i=>{let a=o.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},o.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let s=t(a.address);s.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,o)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),o=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),c=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+o.length,numReadonlySignerAccounts:o.length,numReadonlyNonSignerAccounts:c.length};if(r.length===0)throw new Error("Expected at least one writable signer key");let[a]=r[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let s=[...r.map(([d])=>d),...o.map(([d])=>d),...t.map(([d])=>d),...c.map(([d])=>d)];return [i,s]}extractTableLookup(n){let[r,o]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(n,r){let o=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,s=n.findIndex(d=>d===a);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),t.push(a),this.keyMetaMap.delete(c);}}return [o,t]}};var Lr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let o=new Map;this.keySegments().flat().forEach((c,i)=>{o.set(c,i);});let t=c=>{let i=o.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function pA({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:o}){let t=Wr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(o??{});for(let g of a){let l=t.extractTableLookup(g);if(l!==void 0){let{addressTableLookup:x,drainedKeys:C}=l;c.push({readonlyIndexes:x.readonlyIndexes,readableIndices:x.readonlyIndexes,writableIndexes:x.writableIndexes,writableIndices:x.writableIndexes,lookupTableAddress:address(x.lookupTableAddress)}),i.writable.push(...C.writable),i.readonly.push(...C.readonly);}}let[s,d]=t.getMessageComponents(),p=new Lr(d,i).compileInstructions(r);return {version:0,header:s,instructions:p,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function A6({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=pA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(uu(o))}async function l6({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,signers:t,additionalSigners:c,secp256r1VerifyInput:i,addressesByLookupTableAddress:a,cachedAccounts:s,compressed:d=false,simulateProof:u=false}){let{instructions:p,addressLookupTableAccounts:g}=await Ju({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,additionalSigners:c,transactionMessageBytes:o,secp256r1VerifyInput:i,compressed:d,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:s});return {payer:e,instructions:p,addressesByLookupTableAddress:g}}
2
- export{kc as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,Br as AccountState,cu as AuthenticationContextSchema,au as BaseResponseSchema,Yc as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,Hc as CHANGE_CONFIG_DISCRIMINATOR,ea as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,ua as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,ya as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Sa as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Ea as CREATE_USER_ACCOUNTS_DISCRIMINATOR,BB as CompleteMessageRequestSchema,NB as CompleteTransactionRequestSchema,Ra as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Wa as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Zo as DOMAIN_CONFIG_DISCRIMINATOR,Va as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,qa as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,Qa as EDIT_USER_DELEGATE_DISCRIMINATOR,rs as GLOBAL_COUNTER_DISCRIMINATOR,Kt as KeyType,uE as MULTI_WALLET_ERROR__ALREADY_DELEGATED,HC as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,rD as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,_E as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,UE as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,kE as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,eD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,AD as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,GC as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,FC as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,eE as MULTI_WALLET_ERROR__EMPTY_MEMBERS,wE as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,XC as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,VC as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,JC as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,SE as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,xE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,IE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,NE as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,pE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,AE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,gE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,sE as MULTI_WALLET_ERROR__INVALID_ACCOUNT,$E as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,OE as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,QC as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,aE as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,fE as MULTI_WALLET_ERROR__INVALID_BUFFER,HE as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,mE as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,oE as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,qC as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,WC as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,BC as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,kC as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,OC as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,bE as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,hE as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,rE as MULTI_WALLET_ERROR__INVALID_THRESHOLD,ZE as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,ZC as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,YC as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,nE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,sD as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,cE as MULTI_WALLET_ERROR__INVALID_USER_ROLE,oD as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,JE as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,NC as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,PE as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,WE as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,GE as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,QE as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,iE as MULTI_WALLET_ERROR__MISSING_ACCOUNT,VE as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,qE as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,cD as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,YE as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,FE as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,dE as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,dD as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,iD as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,BE as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,aD as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,jE as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,ME as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,tD as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,uD as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,lE as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,$C as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,KC as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,jC as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,LE as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,KE as MULTI_WALLET_ERROR__PAYER_MISMATCH,zC as MULTI_WALLET_ERROR__PERMANENT_MEMBER,DE as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,wC as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,zE as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,LC as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,RE as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,XE as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,tE as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,CE as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,EE as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,vE as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,TE as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,nD as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,yE as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,_C as MultiWalletAccount,vC as MultiWalletInstruction,ii as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,ni as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Pe as Permission,_e as Permissions,yc as SETTINGS_DISCRIMINATOR,ve as Secp256r1Key,U as SignedSecp256r1Key,ou as StartMessageRequestSchema,su as StartTransactionRequestSchema,Ei as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Ti as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Wi as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,Ri as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,qi as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,Hi as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Ic as TRANSACTION_BUFFER_DISCRIMINATOR,od as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Qi as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,ld as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,ud as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Rd as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Cd as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,Hd as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,Wd as TRANSACTION_EXECUTE_DISCRIMINATOR,Qd as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,qd as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,nu as TransactionActionTypeSchema,pD as TransactionDetailsSchema,OB as TransactionPayloadSchema,gD as TransactionPayloadWithBase64MessageBytesSchema,no as Transports,LB as UserInfoSchema,Re as UserRole,hc as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,RB as addWhitelistedAddressTrees,pe as base64URLStringToBuffer,vN as bufferToBase64URLString,K8 as changeConfig,t5 as closeTransactionBuffer,nh as configAction,WN as convertBase64StringToJWK,kN as convertJWKToBase64String,Hu as convertMemberKeyToString,PN as convertPubkeyCompressedToCose,DN as convertPubkeyCoseToCompressed,RN as createClientAuthorizationCompleteRequestChallenge,hN as createClientAuthorizationStartRequestChallenge,u2 as createDomainConfig,I2 as createDomainUserAccounts,P2 as createGlobalCounter,bN as createMessageChallenge,oA as createTransactionBuffer,_N as createTransactionChallenge,jw as createTransactionManagerSigner,Q8 as createUserAccounts,sH as createWallet,Qo as decodeDomainConfig,os as decodeGlobalCounter,lc as decodeSettings,Ec as decodeTransactionBuffer,bc as decodeWhitelistedAddressTree,yH as decompressSettingsAccount,Jw as deserializeConfigActions,b2 as disableDomainConfig,CH as editDomainConfig,RH as editTransactionManagerUrl,NH as editUserDelegate,Yu as executeTransaction,sA as executeTransactionBuffer,Ju as executeTransactionSync,cA as extendTransactionBuffer,Ih as extensionStruct,XP as fetchAllDomainConfig,oM as fetchAllGlobalCounter,hA as fetchAllMaybeDomainConfig,GA as fetchAllMaybeGlobalCounter,LT as fetchAllMaybeSettings,t1 as fetchAllMaybeTransactionBuffer,I1 as fetchAllMaybeWhitelistedAddressTree,j_ as fetchAllSettings,Ew as fetchAllSettingsAccountByMember,$_ as fetchAllTransactionBuffer,ov as fetchAllWhitelistedAddressTree,$o as fetchDomainConfig,nM as fetchGlobalCounter,MA as fetchMaybeDomainConfig,FA as fetchMaybeGlobalCounter,oo as fetchMaybeSettings,qD as fetchMaybeSettingsAccountData,e1 as fetchMaybeTransactionBuffer,KD as fetchMaybeUserAccountData,x1 as fetchMaybeWhitelistedAddressTree,q_ as fetchSettings,br as fetchSettingsAccountData,Dc as fetchTransactionBuffer,Cw as fetchUserAccountByFilters,Bo as fetchUserAccountData,_c as fetchWhitelistedAddressTree,iM as getAccountStateCodec,wr as getAccountStateDecoder,Nr as getAccountStateEncoder,yM as getAddMemberArgsCodec,Gr as getAddMemberArgsDecoder,Fr as getAddMemberArgsEncoder,Iv as getAddWhitelistedAddressTreesDiscriminatorBytes,Ev as getAddWhitelistedAddressTreesInstruction,Lc as getAddWhitelistedAddressTreesInstructionAsync,Cv as getAddWhitelistedAddressTreesInstructionDataCodec,Wc as getAddWhitelistedAddressTreesInstructionDataDecoder,po as getAddWhitelistedAddressTreesInstructionDataEncoder,AM as getAdditionalMetadataCodec,Vr as getAdditionalMetadataDecoder,Hr as getAdditionalMetadataEncoder,Hv as getChangeConfigCompressedDiscriminatorBytes,Xc as getChangeConfigCompressedInstruction,Vv as getChangeConfigCompressedInstructionDataCodec,Zc as getChangeConfigCompressedInstructionDataDecoder,Jc as getChangeConfigCompressedInstructionDataEncoder,vv as getChangeConfigDiscriminatorBytes,Gc as getChangeConfigInstruction,Uv as getChangeConfigInstructionDataCodec,Fc as getChangeConfigInstructionDataDecoder,Vc as getChangeConfigInstructionDataEncoder,vo as getClientAndDeviceHash,fM as getCompiledInstructionCodec,Kr as getCompiledInstructionDecoder,zr as getCompiledInstructionEncoder,CM as getCompressedAccountMetaCodec,mt as getCompressedAccountMetaDecoder,pt as getCompressedAccountMetaEncoder,MM as getCompressedAccountMetaReadOnlyCodec,ft as getCompressedAccountMetaReadOnlyDecoder,Tt as getCompressedAccountMetaReadOnlyEncoder,bM as getCompressedOnlyExtensionCodec,jr as getCompressedOnlyExtensionDecoder,qr as getCompressedOnlyExtensionEncoder,UM as getCompressedProofCodec,$r as getCompressedProofDecoder,Qr as getCompressedProofEncoder,re as getCompressedSettingsAddress,OM as getCompressedSettingsCodec,HM as getCompressedSettingsDataCodec,tn as getCompressedSettingsDataDecoder,en as getCompressedSettingsDataEncoder,j as getCompressedSettingsDecoder,St as getCompressedSettingsEncoder,zM as getCompressedTokenArgsCodec,Et as getCompressedTokenArgsDecoder,Ct as getCompressedTokenArgsEncoder,YM as getCompressibleExtensionCodec,dn as getCompressibleExtensionDecoder,an as getCompressibleExtensionEncoder,QM as getCompressionInfoCodec,An as getCompressionInfoDecoder,un as getCompressionInfoEncoder,rh as getConfigActionCodec,He as getConfigActionDecoder,we as getConfigActionEncoder,Jv as getCreateCompressedWalletDiscriminatorBytes,Xv as getCreateCompressedWalletInstruction,ra as getCreateCompressedWalletInstructionAsync,Zv as getCreateCompressedWalletInstructionDataCodec,ta as getCreateCompressedWalletInstructionDataDecoder,mo as getCreateCompressedWalletInstructionDataEncoder,sU as getCreateDomainConfigDiscriminatorBytes,aU as getCreateDomainConfigInstruction,ga as getCreateDomainConfigInstructionAsync,cU as getCreateDomainConfigInstructionDataCodec,Aa as getCreateDomainConfigInstructionDataDecoder,lo as getCreateDomainConfigInstructionDataEncoder,yU as getCreateDomainUserAccountDiscriminatorBytes,TU as getCreateDomainUserAccountInstruction,Ta as getCreateDomainUserAccountInstructionAsync,lU as getCreateDomainUserAccountInstructionDataCodec,la as getCreateDomainUserAccountInstructionDataDecoder,To as getCreateDomainUserAccountInstructionDataEncoder,DU as getCreateGlobalCounterDiscriminatorBytes,MU as getCreateGlobalCounterInstruction,Ia as getCreateGlobalCounterInstructionAsync,PU as getCreateGlobalCounterInstructionDataCodec,xa as getCreateGlobalCounterInstructionDataDecoder,So as getCreateGlobalCounterInstructionDataEncoder,ih as getCreateUserAccountArgsCodec,En as getCreateUserAccountArgsDecoder,Cn as getCreateUserAccountArgsEncoder,WU as getCreateUserAccountsDiscriminatorBytes,OU as getCreateUserAccountsInstruction,Pa as getCreateUserAccountsInstructionAsync,LU as getCreateUserAccountsInstructionDataCodec,Da as getCreateUserAccountsInstructionDataDecoder,Io as getCreateUserAccountsInstructionDataEncoder,zU as getDecompressSettingsAccountDiscriminatorBytes,va as getDecompressSettingsAccountInstruction,KU as getDecompressSettingsAccountInstructionDataCodec,_a as getDecompressSettingsAccountInstructionDataDecoder,ba as getDecompressSettingsAccountInstructionDataEncoder,QU as getDisableDomainConfigDiscriminatorBytes,Ba as getDisableDomainConfigInstruction,$U as getDisableDomainConfigInstructionDataCodec,Oa as getDisableDomainConfigInstructionDataDecoder,La as getDisableDomainConfigInstructionDataEncoder,ct as getDomainConfigAddress,ZP as getDomainConfigCodec,Xo as getDomainConfigDecoder,JP as getDomainConfigDiscriminatorBytes,PA as getDomainConfigEncoder,QP as getDomainConfigSize,ak as getEditDomainConfigDiscriminatorBytes,Ga as getEditDomainConfigInstruction,dk as getEditDomainConfigInstructionAsync,ik as getEditDomainConfigInstructionDataCodec,Fa as getEditDomainConfigInstructionDataDecoder,Eo as getEditDomainConfigInstructionDataEncoder,gh as getEditMemberArgsCodec,Sn as getEditMemberArgsDecoder,fn as getEditMemberArgsEncoder,Tk as getEditTransactionManagerUrlDiscriminatorBytes,Ja as getEditTransactionManagerUrlInstruction,fk as getEditTransactionManagerUrlInstructionDataCodec,Ya as getEditTransactionManagerUrlInstructionDataDecoder,ja as getEditTransactionManagerUrlInstructionDataEncoder,Mk as getEditUserDelegateDiscriminatorBytes,ti as getEditUserDelegateInstruction,hk as getEditUserDelegateInstructionDataCodec,ei as getEditUserDelegateInstructionDataDecoder,$a as getEditUserDelegateInstructionDataEncoder,lh as getExpectedSignerCodec,Mt as getExpectedSignerDecoder,Pt as getExpectedSignerEncoder,xh as getExtensionStructCodec,Dt as getExtensionStructDecoder,rn as getExtensionStructEncoder,Ou as getGlobalCounterAddress,rM as getGlobalCounterCodec,ns as getGlobalCounterDecoder,tM as getGlobalCounterDiscriminatorBytes,VA as getGlobalCounterEncoder,sM as getGlobalCounterSize,Ow as getLightCpiSigner,le as getLightProtocolRpc,Mh as getLinkWalletArgsCodec,Ln as getLinkWalletArgsDecoder,Wn as getLinkWalletArgsEncoder,_h as getMemberCodec,It as getMemberDecoder,xt as getMemberEncoder,kh as getMemberKeyCodec,Q as getMemberKeyDecoder,V as getMemberKeyEncoder,lB as getMultiWalletErrorMessage,Kk as getNativeTransferIntentCompressedDiscriminatorBytes,Ai as getNativeTransferIntentCompressedInstruction,qk as getNativeTransferIntentCompressedInstructionDataCodec,ui as getNativeTransferIntentCompressedInstructionDataDecoder,di as getNativeTransferIntentCompressedInstructionDataEncoder,Lk as getNativeTransferIntentDiscriminatorBytes,si as getNativeTransferIntentInstruction,Bk as getNativeTransferIntentInstructionAsync,Ok as getNativeTransferIntentInstructionDataCodec,oi as getNativeTransferIntentInstructionDataDecoder,Do as getNativeTransferIntentInstructionDataEncoder,Bh as getNewAuthorityArgsCodec,wn as getNewAuthorityArgsDecoder,Nn as getNewAuthorityArgsEncoder,UN as getOriginIndex,Hh as getPackedAddressTreeInfoCodec,_t as getPackedAddressTreeInfoDecoder,bt as getPackedAddressTreeInfoEncoder,Gh as getPackedMerkleContextCodec,on as getPackedMerkleContextDecoder,nn as getPackedMerkleContextEncoder,qh as getPackedStateTreeInfoCodec,lt as getPackedStateTreeInfoDecoder,yt as getPackedStateTreeInfoEncoder,Jh as getPausableAccountExtensionCodec,Pn as getPausableAccountExtensionDecoder,Dn as getPausableAccountExtensionEncoder,Qh as getPermanentDelegateAccountExtensionCodec,hn as getPermanentDelegateAccountExtensionDecoder,Mn as getPermanentDelegateAccountExtensionEncoder,tR as getPermissionsCodec,Oe as getPermissionsDecoder,Le as getPermissionsEncoder,sR as getProofArgsCodec,M as getProofArgsDecoder,P as getProofArgsEncoder,dR as getRemoveMemberArgsCodec,In as getRemoveMemberArgsDecoder,xn as getRemoveMemberArgsEncoder,gR as getRentConfigCodec,yn as getRentConfigDecoder,mn as getRentConfigEncoder,Uo as getSecp256r1MessageHash,yR as getSecp256r1PubkeyCodec,vt as getSecp256r1PubkeyDecoder,Fn as getSecp256r1PubkeyEncoder,fP as getSecp256r1SignatureOffsetsDataDecoder,TP as getSecp256r1SignatureOffsetsDataEncoder,fR as getSecp256r1VerifyArgsCodec,G as getSecp256r1VerifyArgsDecoder,F as getSecp256r1VerifyArgsEncoder,CR as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,zn as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,Gn as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,H as getSecp256r1VerifyInstruction,F2 as getSecp256r1VerifyInstructionDataCodec,qu as getSecp256r1VerifyInstructionDataDecoder,ju as getSecp256r1VerifyInstructionDataEncoder,cN as getSendAndConfirmTransaction,K_ as getSettingsCodec,gr as getSettingsDecoder,z_ as getSettingsDiscriminatorBytes,WT as getSettingsEncoder,Ie as getSettingsFromIndex,RR as getSettingsIndexWithAddressAndDelegateInfoCodec,Yn as getSettingsIndexWithAddressAndDelegateInfoDecoder,jn as getSettingsIndexWithAddressAndDelegateInfoEncoder,PR as getSettingsIndexWithAddressCodec,qn as getSettingsIndexWithAddressDecoder,Kn as getSettingsIndexWithAddressEncoder,UR as getSettingsMutArgsCodec,q as getSettingsMutArgsDecoder,K as getSettingsMutArgsEncoder,OR as getSettingsReadonlyArgsCodec,kt as getSettingsReadonlyArgsDecoder,Ut as getSettingsReadonlyArgsEncoder,MN as getSignedSecp256r1Key,se as getSolanaRpc,sN as getSolanaRpcEndpoint,wR as getSplInterfacePdaArgsCodec,Lt as getSplInterfacePdaArgsDecoder,Wt as getSplInterfacePdaArgsEncoder,GR as getTokenMetadataCodec,bn as getTokenMetadataDecoder,Rn as getTokenMetadataEncoder,uW as getTokenTransferIntentCompressedDiscriminatorBytes,Pi as getTokenTransferIntentCompressedInstruction,gW as getTokenTransferIntentCompressedInstructionAsync,AW as getTokenTransferIntentCompressedInstructionDataCodec,Di as getTokenTransferIntentCompressedInstructionDataDecoder,Mo as getTokenTransferIntentCompressedInstructionDataEncoder,eW as getTokenTransferIntentDiscriminatorBytes,Si as getTokenTransferIntentInstruction,rW as getTokenTransferIntentInstructionAsync,tW as getTokenTransferIntentInstructionDataCodec,fi as getTokenTransferIntentInstructionDataDecoder,Po as getTokenTransferIntentInstructionDataEncoder,Bu as getTransactionBufferAddress,bW as getTransactionBufferCloseCompressedDiscriminatorBytes,Bi as getTransactionBufferCloseCompressedInstruction,_W as getTransactionBufferCloseCompressedInstructionDataCodec,Oi as getTransactionBufferCloseCompressedInstructionDataDecoder,Li as getTransactionBufferCloseCompressedInstructionDataEncoder,xW as getTransactionBufferCloseDiscriminatorBytes,vi as getTransactionBufferCloseInstruction,IW as getTransactionBufferCloseInstructionDataCodec,_i as getTransactionBufferCloseInstructionDataDecoder,bi as getTransactionBufferCloseInstructionDataEncoder,Q_ as getTransactionBufferCodec,jR as getTransactionBufferCreateArgsCodec,Bt as getTransactionBufferCreateArgsDecoder,Ot as getTransactionBufferCreateArgsEncoder,jW as getTransactionBufferCreateCompressedDiscriminatorBytes,Ji as getTransactionBufferCreateCompressedInstruction,YW as getTransactionBufferCreateCompressedInstructionDataCodec,Yi as getTransactionBufferCreateCompressedInstructionDataDecoder,ji as getTransactionBufferCreateCompressedInstructionDataEncoder,NW as getTransactionBufferCreateDiscriminatorBytes,Gi as getTransactionBufferCreateInstruction,wW as getTransactionBufferCreateInstructionDataCodec,Fi as getTransactionBufferCreateInstructionDataDecoder,Vi as getTransactionBufferCreateInstructionDataEncoder,Cc as getTransactionBufferDecoder,X_ as getTransactionBufferDiscriminatorBytes,$T as getTransactionBufferEncoder,AL as getTransactionBufferExecuteCompressedDiscriminatorBytes,ad as getTransactionBufferExecuteCompressedInstruction,gL as getTransactionBufferExecuteCompressedInstructionDataCodec,cd as getTransactionBufferExecuteCompressedInstructionDataDecoder,sd as getTransactionBufferExecuteCompressedInstructionDataEncoder,rL as getTransactionBufferExecuteDiscriminatorBytes,td as getTransactionBufferExecuteInstruction,nL as getTransactionBufferExecuteInstructionDataCodec,ed as getTransactionBufferExecuteInstructionDataDecoder,$i as getTransactionBufferExecuteInstructionDataEncoder,hL as getTransactionBufferExtendCompressedDiscriminatorBytes,Sd as getTransactionBufferExtendCompressedInstruction,RL as getTransactionBufferExtendCompressedInstructionDataCodec,fd as getTransactionBufferExtendCompressedInstructionDataDecoder,Td as getTransactionBufferExtendCompressedInstructionDataEncoder,SL as getTransactionBufferExtendDiscriminatorBytes,pd as getTransactionBufferExtendInstruction,xL as getTransactionBufferExtendInstructionDataCodec,gd as getTransactionBufferExtendInstructionDataDecoder,Ad as getTransactionBufferExtendInstructionDataEncoder,KL as getTransactionBufferVoteCompressedDiscriminatorBytes,vd as getTransactionBufferVoteCompressedInstruction,qL as getTransactionBufferVoteCompressedInstructionDataCodec,_d as getTransactionBufferVoteCompressedInstructionDataDecoder,bd as getTransactionBufferVoteCompressedInstructionDataEncoder,OL as getTransactionBufferVoteDiscriminatorBytes,Pd as getTransactionBufferVoteInstruction,BL as getTransactionBufferVoteInstructionDataCodec,Dd as getTransactionBufferVoteInstructionDataDecoder,Ed as getTransactionBufferVoteInstructionDataEncoder,aO as getTransactionExecuteCompressedDiscriminatorBytes,Gd as getTransactionExecuteCompressedInstruction,iO as getTransactionExecuteCompressedInstructionDataCodec,Fd as getTransactionExecuteCompressedInstructionDataDecoder,Vd as getTransactionExecuteCompressedInstructionDataEncoder,$L as getTransactionExecuteDiscriminatorBytes,Bd as getTransactionExecuteInstruction,eO as getTransactionExecuteInstructionDataCodec,Od as getTransactionExecuteInstructionDataDecoder,Ld as getTransactionExecuteInstructionDataEncoder,PO as getTransactionExecuteSyncCompressedDiscriminatorBytes,tu as getTransactionExecuteSyncCompressedInstruction,MO as getTransactionExecuteSyncCompressedInstructionDataCodec,eu as getTransactionExecuteSyncCompressedInstructionDataDecoder,$d as getTransactionExecuteSyncCompressedInstructionDataEncoder,lO as getTransactionExecuteSyncDiscriminatorBytes,Jd as getTransactionExecuteSyncInstruction,TO as getTransactionExecuteSyncInstructionDataCodec,Yd as getTransactionExecuteSyncInstructionDataDecoder,jd as getTransactionExecuteSyncInstructionDataEncoder,eb as getTransactionMessageAddressTableLookupCodec,ro as getTransactionMessageAddressTableLookupDecoder,to as getTransactionMessageAddressTableLookupEncoder,XR as getTransactionMessageCodec,wt as getTransactionMessageDecoder,Nt as getTransactionMessageEncoder,ob as getTransactionSyncSignersCodec,J as getTransactionSyncSignersDecoder,Y as getTransactionSyncSignersEncoder,db as getTransferFeeAccountExtensionCodec,vn as getTransferFeeAccountExtensionDecoder,_n as getTransferFeeAccountExtensionEncoder,gb as getTransferHookAccountExtensionCodec,kn as getTransferHookAccountExtensionDecoder,Un as getTransferHookAccountExtensionEncoder,yb as getTransportsCodec,Vt as getTransportsDecoder,Ht as getTransportsEncoder,w as getUserAccountAddress,Sb as getUserCodec,Eb as getUserCreationArgsCodec,De as getUserCreationArgsDecoder,Ee as getUserCreationArgsEncoder,X as getUserDecoder,Ft as getUserEncoder,hb as getUserMutArgsCodec,Ye as getUserMutArgsDecoder,je as getUserMutArgsEncoder,vb as getUserReadOnlyArgsCodec,Rt as getUserReadOnlyArgsDecoder,ht as getUserReadOnlyArgsEncoder,Lb as getUserReadOnlyOrMutateArgsCodec,Ne as getUserReadOnlyOrMutateArgsDecoder,Be as getUserReadOnlyOrMutateArgsEncoder,Hb as getUserRoleCodec,Fe as getUserRoleDecoder,Ve as getUserRoleEncoder,Lw as getWalletAddressFromIndex,Me as getWalletAddressFromSettings,nv as getWhitelistedAddressTreeCodec,Rc as getWhitelistedAddressTreeDecoder,rv as getWhitelistedAddressTreeDiscriminatorBytes,S1 as getWhitelistedAddressTreeEncoder,No as getWhitelistedAddressTreeFromIndex,Dw as getWhitelistedAddressTreeIndexFromAddress,vu as getWhitelistedAddressTreesAddress,dB as identifyMultiWalletAccount,uB as identifyMultiWalletInstruction,aN as initialize,oh as isConfigAction,Ch as isExtensionStruct,TB as isMultiWalletError,cb as isTransactionSyncSigners,Bb as isUserReadOnlyOrMutateArgs,f8 as nativeTransferIntent,Dv as parseAddWhitelistedAddressTreesInstruction,Fv as parseChangeConfigCompressedInstruction,kv as parseChangeConfigInstruction,Qv as parseCreateCompressedWalletInstruction,iU as parseCreateDomainConfigInstruction,fU as parseCreateDomainUserAccountInstruction,hU as parseCreateGlobalCounterInstruction,BU as parseCreateUserAccountsInstruction,qU as parseDecompressSettingsAccountInstruction,ek as parseDisableDomainConfigInstruction,uk as parseEditDomainConfigInstruction,Sk as parseEditTransactionManagerUrlInstruction,Rk as parseEditUserDelegateInstruction,jk as parseNativeTransferIntentCompressedInstruction,Nk as parseNativeTransferIntentInstruction,G2 as parseSecp256r1VerifyInstruction,pW as parseTokenTransferIntentCompressedInstruction,nW as parseTokenTransferIntentInstruction,vW as parseTransactionBufferCloseCompressedInstruction,CW as parseTransactionBufferCloseInstruction,JW as parseTransactionBufferCreateCompressedInstruction,HW as parseTransactionBufferCreateInstruction,pL as parseTransactionBufferExecuteCompressedInstruction,oL as parseTransactionBufferExecuteInstruction,bL as parseTransactionBufferExtendCompressedInstruction,IL as parseTransactionBufferExtendInstruction,jL as parseTransactionBufferVoteCompressedInstruction,NL as parseTransactionBufferVoteInstruction,dO as parseTransactionExecuteCompressedInstruction,tO as parseTransactionExecuteInstruction,hO as parseTransactionExecuteSyncCompressedInstruction,fO as parseTransactionExecuteSyncInstruction,z5 as prepareChangeConfigArgs,Q5 as prepareTransactionBundle,A6 as prepareTransactionMessage,l6 as prepareTransactionSync,qw as retrieveTransactionManager,Yw as serializeConfigActions,k8 as tokenTransferIntent,sb as transactionSyncSigners,Ob as userReadOnlyOrMutateArgs,Au as vaultTransactionMessageDeserialize,uu as vaultTransactionMessageSerialize,aA as voteTransactionBuffer};//# sourceMappingURL=index.js.map
1
+ import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,getEnumEncoder,getEnumDecoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getU64Encoder,getU64Decoder,getOptionEncoder,getOptionDecoder,getArrayEncoder,getArrayDecoder,getU16Encoder,getU16Decoder,getBooleanEncoder,getBooleanDecoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getUnitEncoder,getUnitDecoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64Encoder,getBase64Decoder,getTransactionEncoder,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,TreeType,encodeBN254toBase58,getLightSystemAccountMetasV2,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import g from'zod';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {p256}from'@noble/curves/nist.js';import {canonicalize}from'json-canonicalize';import {getAssociatedTokenAccountAddress,getTokenDecoder,getTransferSolInstruction}from'gill/programs';import {equalBytes}from'@noble/curves/utils.js';var Zo=new Uint8Array([201,232,212,229,59,241,106,197]);function ZP(){return fixEncoderSize(getBytesEncoder(),8).encode(Zo)}function PA(){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:Zo}))}function Xo(){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 XP(){return combineCodec(PA(),Xo())}function Qo(e){return decodeAccount(e,Xo())}async function $o(e,n,r){let o=await MA(e,n,r);return assertAccountExists(o),o}async function MA(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Qo(o)}async function QP(e,n,r){let o=await hA(e,n,r);return assertAccountsExist(o),o}async function hA(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Qo(t))}function $P(){return 846}var rs=new Uint8Array([42,206,176,58,175,129,130,233]);function rM(){return fixEncoderSize(getBytesEncoder(),8).encode(rs)}function VA(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:rs}))}function ns(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function nM(){return combineCodec(VA(),ns())}function os(e){return decodeAccount(e,ns())}async function oM(e,n,r){let o=await FA(e,n,r);return assertAccountExists(o),o}async function FA(e,n,r){let o=await fetchEncodedAccount(e,n,r);return os(o)}async function sM(e,n,r){let o=await GA(e,n,r);return assertAccountsExist(o),o}async function GA(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>os(t))}function cM(){return 24}var Br=(r=>(r[r.Initialized=0]="Initialized",r[r.Frozen=1]="Frozen",r))(Br||{});function Nr(){return getEnumEncoder(Br)}function wr(){return getEnumDecoder(Br)}function dM(){return combineCodec(Nr(),wr())}function Hr(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Vr(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function gM(){return combineCodec(Hr(),Vr())}function Fr(){return getStructEncoder([["memberKey",V()],["permissions",Le()],["userArgs",Be()]])}function Gr(){return getStructDecoder([["memberKey",Q()],["permissions",Oe()],["userArgs",Ne()]])}function yM(){return combineCodec(Fr(),Gr())}function zr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Kr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function SM(){return combineCodec(zr(),Kr())}function pt(){return getStructEncoder([["treeInfo",lt()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function mt(){return getStructDecoder([["treeInfo",yt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function EM(){return combineCodec(pt(),mt())}function Tt(){return getStructEncoder([["treeInfo",lt()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function ft(){return getStructDecoder([["treeInfo",yt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function hM(){return combineCodec(Tt(),ft())}function qr(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function jr(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function _M(){return combineCodec(qr(),jr())}function Qr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function $r(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function kM(){return combineCodec(Qr(),$r())}function St(){return getStructEncoder([["data",getOptionEncoder(en())]])}function j(){return getStructDecoder([["data",getOptionDecoder(tn())]])}function BM(){return combineCodec(St(),j())}function en(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(xt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function tn(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(It())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function VM(){return combineCodec(en(),tn())}function Ct(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",nn()],["tlv",getOptionEncoder(getArrayEncoder(rn()))],["state",Nr()]])}function Et(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",on()],["tlv",getOptionDecoder(getArrayDecoder(Dt()))],["state",wr()]])}function KM(){return combineCodec(Ct(),Et())}function an(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",un()]])}function dn(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",An()]])}function JM(){return combineCodec(an(),dn())}function un(){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",mn()]])}function An(){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",ln()]])}function $M(){return combineCodec(un(),An())}function we(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(fn())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Fr())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(xn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function He(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Sn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Gr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(In())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function nh(){return combineCodec(we(),He())}function oh(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function sh(e,n){return n.__kind===e}function Cn(){return getStructEncoder([["member",getAddressEncoder()],["role",Ve()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Ee()]])}function En(){return getStructDecoder([["member",getAddressDecoder()],["role",Fe()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",De()]])}function dh(){return combineCodec(Cn(),En())}function fn(){return getStructEncoder([["memberKey",V()],["permissions",Le()]])}function Sn(){return getStructDecoder([["memberKey",Q()],["permissions",Oe()]])}function ph(){return combineCodec(fn(),Sn())}function Pt(){return getStructEncoder([["memberKey",V()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function Mt(){return getStructDecoder([["memberKey",Q()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function Th(){return combineCodec(Pt(),Mt())}function rn(){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([Rn()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([Dn()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([Mn()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([_n()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([Un()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([qr()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([an()])]])]])}function Dt(){return getDiscriminatedUnionDecoder([["Placeholder0",getUnitDecoder()],["Placeholder1",getUnitDecoder()],["Placeholder2",getUnitDecoder()],["Placeholder3",getUnitDecoder()],["Placeholder4",getUnitDecoder()],["Placeholder5",getUnitDecoder()],["Placeholder6",getUnitDecoder()],["Placeholder7",getUnitDecoder()],["Placeholder8",getUnitDecoder()],["Placeholder9",getUnitDecoder()],["Placeholder10",getUnitDecoder()],["Placeholder11",getUnitDecoder()],["Placeholder12",getUnitDecoder()],["Placeholder13",getUnitDecoder()],["Placeholder14",getUnitDecoder()],["Placeholder15",getUnitDecoder()],["Placeholder16",getUnitDecoder()],["Placeholder17",getUnitDecoder()],["Placeholder18",getUnitDecoder()],["TokenMetadata",getStructDecoder([["fields",getTupleDecoder([bn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([Pn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([hn()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([vn()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([kn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([jr()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([dn()])]])]])}function Ih(){return combineCodec(rn(),Dt())}function Ch(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Eh(e,n){return n.__kind===e}function Wn(){return getStructEncoder([["settingsMutArgs",K()],["transactionManager",getOptionEncoder(ht())]])}function Ln(){return getStructDecoder([["settingsMutArgs",q()],["transactionManager",getOptionDecoder(Rt())]])}function hh(){return combineCodec(Wn(),Ln())}function xt(){return getStructEncoder([["pubkey",V()],["role",getU8Encoder()],["permissions",Le()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function It(){return getStructDecoder([["pubkey",Q()],["role",getU8Decoder()],["permissions",Oe()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function vh(){return combineCodec(xt(),It())}function V(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function Q(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function Wh(){return combineCodec(V(),Q())}function Nn(){return getStructEncoder([["authorityCreationArgs",Ee()],["compressedProofArgs",P()]])}function wn(){return getStructDecoder([["authorityCreationArgs",De()],["compressedProofArgs",M()]])}function Nh(){return combineCodec(Nn(),wn())}function bt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function _t(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function Vh(){return combineCodec(bt(),_t())}function nn(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function on(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function zh(){return combineCodec(nn(),on())}function lt(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function yt(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function jh(){return combineCodec(lt(),yt())}function Dn(){return getStructEncoder([])}function Pn(){return getStructDecoder([])}function Zh(){return combineCodec(Dn(),Pn())}function Mn(){return getStructEncoder([])}function hn(){return getStructDecoder([])}function $h(){return combineCodec(Mn(),hn())}function Le(){return getStructEncoder([["mask",getU8Encoder()]])}function Oe(){return getStructDecoder([["mask",getU8Decoder()]])}function rR(){return combineCodec(Le(),Oe())}function P(){return getStructEncoder([["proof",getOptionEncoder(Qr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function M(){return getStructDecoder([["proof",getOptionDecoder($r())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function cR(){return combineCodec(P(),M())}function xn(){return getStructEncoder([["memberKey",V()],["userArgs",Be()]])}function In(){return getStructDecoder([["memberKey",Q()],["userArgs",Ne()]])}function uR(){return combineCodec(xn(),In())}function mn(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function ln(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function pR(){return combineCodec(mn(),ln())}function Fn(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function vt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function yR(){return combineCodec(Fn(),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 SR(){return combineCodec(F(),G())}function Gn(){return getStructEncoder([["verifyArgs",F()],["domainConfigIndex",getU8Encoder()]])}function zn(){return getStructDecoder([["verifyArgs",G()],["domainConfigIndex",getU8Decoder()]])}function ER(){return combineCodec(Gn(),zn())}function Kn(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function qn(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function MR(){return combineCodec(Kn(),qn())}function jn(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function Yn(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function bR(){return combineCodec(jn(),Yn())}function K(){return getStructEncoder([["accountMeta",pt()],["data",St()]])}function q(){return getStructDecoder([["accountMeta",mt()],["data",j()]])}function kR(){return combineCodec(K(),q())}function Ut(){return getStructEncoder([["accountMeta",Tt()],["data",St()]])}function kt(){return getStructDecoder([["accountMeta",ft()],["data",j()]])}function BR(){return combineCodec(Ut(),kt())}function Wt(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function Lt(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function HR(){return combineCodec(Wt(),Lt())}function Rn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(Hr())]])}function bn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(Vr())]])}function zR(){return combineCodec(Rn(),bn())}function Ot(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(Pt())]])}function Bt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(Mt())]])}function YR(){return combineCodec(Ot(),Bt())}function Nt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(zr())],["addressTableLookups",getArrayEncoder(to())]])}function wt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Kr())],["addressTableLookups",getArrayDecoder(ro())]])}function QR(){return combineCodec(Nt(),wt())}function to(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function ro(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function tb(){return combineCodec(to(),ro())}function Y(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([Gn()])]])]])}function J(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([zn()])]])]])}function sb(){return combineCodec(Y(),J())}function cb(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function ab(e,n){return n.__kind===e}function _n(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function vn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function ub(){return combineCodec(_n(),vn())}function Un(){return getStructEncoder([["transferring",getU8Encoder()]])}function kn(){return getStructDecoder([["transferring",getU8Decoder()]])}function pb(){return combineCodec(Un(),kn())}var no=(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))(no||{});function Ht(){return getEnumEncoder(no)}function Vt(){return getEnumDecoder(no)}function yb(){return combineCodec(Ht(),Vt())}function Ft(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",V()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(Ht()))],["wallets",getArrayEncoder(jn())],["role",Ve()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function X(){return getStructDecoder([["domainConfig",getOptionDecoder(getAddressDecoder())],["member",Q()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(Vt()))],["wallets",getArrayDecoder(Yn())],["role",Fe()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function xb(){return combineCodec(Ft(),X())}function Ee(){return getStructEncoder([["addressTreeInfo",bt()],["outputStateTreeIndex",getU8Encoder()]])}function De(){return getStructDecoder([["addressTreeInfo",_t()],["outputStateTreeIndex",getU8Decoder()]])}function Db(){return combineCodec(Ee(),De())}function je(){return getStructEncoder([["accountMeta",pt()],["data",Ft()]])}function Ye(){return getStructDecoder([["accountMeta",mt()],["data",X()]])}function Rb(){return combineCodec(je(),Ye())}function ht(){return getStructEncoder([["accountMeta",Tt()],["data",Ft()]])}function Rt(){return getStructDecoder([["accountMeta",ft()],["data",X()]])}function Ub(){return combineCodec(ht(),Rt())}function Be(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([ht()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([je()])]])]])}function Ne(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Rt()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([Ye()])]])]])}function Ob(){return combineCodec(Be(),Ne())}function Bb(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Nb(e,n){return n.__kind===e}var Re=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(Re||{});function Ve(){return getEnumEncoder(Re)}function Fe(){return getEnumDecoder(Re)}function Vb(){return combineCodec(Ve(),Fe())}var lc=new Uint8Array([223,179,163,190,177,224,67,173]);function K_(){return fixEncoderSize(getBytesEncoder(),8).encode(lc)}function WT(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(xt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:lc}))}function gr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(It())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function q_(){return combineCodec(WT(),gr())}function yc(e){return decodeAccount(e,gr())}async function j_(e,n,r){let o=await oo(e,n,r);return assertAccountExists(o),o}async function oo(e,n,r){let o=await fetchEncodedAccount(e,n,r);return yc(o)}async function Y_(e,n,r){let o=await LT(e,n,r);return assertAccountsExist(o),o}async function LT(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>yc(t))}var Ic=new Uint8Array([90,36,35,219,93,225,110,96]);function Q_(){return fixEncoderSize(getBytesEncoder(),8).encode(Ic)}function $T(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["multiWalletSettings",getAddressEncoder()],["multiWalletBump",getU8Encoder()],["canExecute",getBooleanEncoder()],["preauthorizeExecution",getBooleanEncoder()],["validTill",getU64Encoder()],["payer",getAddressEncoder()],["bump",getU8Encoder()],["bufferIndex",getU8Encoder()],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["creator",V()],["executor",V()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(V())],["expectedSigners",getArrayEncoder(Pt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Ic}))}function Cc(){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",Q()],["executor",Q()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(Q())],["expectedSigners",getArrayDecoder(Mt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function $_(){return combineCodec($T(),Cc())}function Ec(e){return decodeAccount(e,Cc())}async function Dc(e,n,r){let o=await e1(e,n,r);return assertAccountExists(o),o}async function e1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Ec(o)}async function ev(e,n,r){let o=await t1(e,n,r);return assertAccountsExist(o),o}async function t1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ec(t))}var hc=new Uint8Array([105,23,173,2,197,255,80,87]);function nv(){return fixEncoderSize(getBytesEncoder(),8).encode(hc)}function S1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:hc}))}function Rc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function ov(){return combineCodec(S1(),Rc())}function bc(e){return decodeAccount(e,Rc())}async function _c(e,n,r){let o=await x1(e,n,r);return assertAccountExists(o),o}async function x1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return bc(o)}async function sv(e,n,r){let o=await I1(e,n,r);return assertAccountsExist(o),o}async function I1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>bc(t))}function l({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function O(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function y(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let o=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:O(r.value),role:vc(r.value)?upgradeRoleToSigner(o):o,...vc(r.value)?{signer:r.value}:{}})}}function vc(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var kc=new Uint8Array([8]);function Cv(){return fixEncoderSize(getBytesEncoder(),1).encode(kc)}function po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:kc}))}function Wc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function Ev(){return combineCodec(po(),Wc())}async function Lc(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:po().encode(c),programAddress:r})}function Dv(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:po().encode(c),programAddress:r})}function Pv(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:Wc().decode(e.data)}}var Hc=new Uint8Array([9]);function Uv(){return fixEncoderSize(getBytesEncoder(),1).encode(Hc)}function Vc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(we())],["signers",getArrayEncoder(Y())],["compressedProofArgs",getOptionEncoder(P())]]),e=>({...e,discriminator:Hc}))}function Fc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(He())],["signers",getArrayDecoder(J())],["compressedProofArgs",getOptionDecoder(M())]])}function kv(){return combineCodec(Vc(),Fc())}function Gc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Vc().encode(c),programAddress:r})}function Wv(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Fc().decode(e.data)}}var Yc=new Uint8Array([19]);function Vv(){return fixEncoderSize(getBytesEncoder(),1).encode(Yc)}function Jc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(we())],["signers",getArrayEncoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Yc}))}function Zc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(He())],["signers",getArrayDecoder(J())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function Fv(){return combineCodec(Jc(),Zc())}function Xc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Jc().encode(c),programAddress:r})}function Gv(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Zc().decode(e.data)}}var ea=new Uint8Array([18]);function Zv(){return fixEncoderSize(getBytesEncoder(),1).encode(ea)}function mo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["addressTreeInfo",bt()],["outputStateTreeIndex",getU8Encoder()],["userArgs",Be()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:ea}))}function ta(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["addressTreeInfo",_t()],["outputStateTreeIndex",getU8Decoder()],["userArgs",Ne()],["settingsIndex",getU128Decoder()]])}function Xv(){return combineCodec(mo(),ta())}async function ra(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:mo().encode(c),programAddress:r})}function Qv(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:mo().encode(c),programAddress:r})}function $v(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:ta().decode(e.data)}}var ua=new Uint8Array([0]);function cU(){return fixEncoderSize(getBytesEncoder(),1).encode(ua)}function yo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",Ee()],["compressedProofArgs",P()]]),e=>({...e,discriminator:ua}))}function Aa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",De()],["compressedProofArgs",M()]])}function aU(){return combineCodec(yo(),Aa())}async function ga(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:yo().encode(c),programAddress:r})}function iU(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:yo().encode(c),programAddress:r})}function dU(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Aa().decode(e.data)}}var la=new Uint8Array([4]);function yU(){return fixEncoderSize(getBytesEncoder(),1).encode(la)}function To(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["member",Fn()],["role",Ve()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(Ht())],["userAccountCreationArgs",Ee()],["linkWalletArgs",getOptionEncoder(Wn())]]),e=>({...e,discriminator:la}))}function ya(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["member",vt()],["role",Fe()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Vt())],["userAccountCreationArgs",De()],["linkWalletArgs",getOptionDecoder(Ln())]])}function TU(){return combineCodec(To(),ya())}async function Ta(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:To().encode(c),programAddress:r})}function fU(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:To().encode(c),programAddress:r})}function SU(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:ya().decode(e.data)}}var Sa=new Uint8Array([3]);function PU(){return fixEncoderSize(getBytesEncoder(),1).encode(Sa)}function So(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Sa}))}function xa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function MU(){return combineCodec(So(),xa())}async function Ia(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(c),a=y(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:So().encode({}),programAddress:r})}function hU(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(c),a=y(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:So().encode({}),programAddress:r})}function RU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:xa().decode(e.data)}}var Ea=new Uint8Array([5]);function LU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ea)}function Io(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["createUserArgs",getArrayEncoder(Cn())]]),e=>({...e,discriminator:Ea}))}function Da(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayDecoder(En())]])}function OU(){return combineCodec(Io(),Da())}async function Pa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Io().encode(c),programAddress:r})}function BU(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Io().encode(c),programAddress:r})}function NU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Da().decode(e.data)}}var Ra=new Uint8Array([17]);function KU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ra)}function ba(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",K()],["compressedProofArgs",P()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:Ra}))}function _a(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",q()],["compressedProofArgs",M()],["signers",getArrayDecoder(J())]])}function qU(){return combineCodec(ba(),_a())}function va(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:ba().encode(c),programAddress:r})}function jU(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:_a().decode(e.data)}}var Wa=new Uint8Array([2]);function $U(){return fixEncoderSize(getBytesEncoder(),1).encode(Wa)}function La(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:Wa}))}function Oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function ek(){return combineCodec(La(),Oa())}function Ba(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.admin),...a],data:La().encode(c),programAddress:r})}function tk(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:Oa().decode(e.data)}}var Va=new Uint8Array([1]);function ik(){return fixEncoderSize(getBytesEncoder(),1).encode(Va)}function Eo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Nn())]]),e=>({...e,discriminator:Va}))}function Fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(wn())]])}function dk(){return combineCodec(Eo(),Fa())}async function uk(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Eo().encode(c),programAddress:r})}function Ga(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Eo().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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:o(),whitelistedAddressTrees:o(),systemProgram:r()},data:Fa().decode(e.data)}}var qa=new Uint8Array([6]);function fk(){return fixEncoderSize(getBytesEncoder(),1).encode(qa)}function ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",je()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",P()]]),e=>({...e,discriminator:qa}))}function Ya(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ye()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",M()]])}function Sk(){return combineCodec(ja(),Ya())}function Ja(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.authority),...a],data:ja().encode(c),programAddress:r})}function xk(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{authority:r()},data:Ya().decode(e.data)}}var Qa=new Uint8Array([7]);function hk(){return fixEncoderSize(getBytesEncoder(),1).encode(Qa)}function $a(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",je()],["secp256r1VerifyArgs",getOptionEncoder(F())],["delegateTo",getOptionEncoder(Kn())],["oldSettingsMutArgs",getOptionEncoder(K())],["newSettingsMutArgs",getOptionEncoder(K())],["compressedProofArgs",P()]]),e=>({...e,discriminator:Qa}))}function ei(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ye()],["secp256r1VerifyArgs",getOptionDecoder(G())],["delegateTo",getOptionDecoder(qn())],["oldSettingsMutArgs",getOptionDecoder(q())],["newSettingsMutArgs",getOptionDecoder(q())],["compressedProofArgs",M()]])}function Rk(){return combineCodec($a(),ei())}function ti(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.feePayer),s(t.signer),s(t.oldSettings),s(t.newSettings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.domainConfig),...a],data:$a().encode(c),programAddress:r})}function bk(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:o(),oldSettings:o(),newSettings:o(),slotHashSysvar:o(),instructionsSysvar:o(),domainConfig:o()},data:ei().decode(e.data)}}var ni=new Uint8Array([29]);function Ok(){return fixEncoderSize(getBytesEncoder(),1).encode(ni)}function Do(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:ni}))}function oi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())]])}function Bk(){return combineCodec(Do(),oi())}async function Nk(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(O(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Do().encode(c),programAddress:r})}function si(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Do().encode(c),programAddress:r})}function wk(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:oi().decode(e.data)}}var ii=new Uint8Array([27]);function qk(){return fixEncoderSize(getBytesEncoder(),1).encode(ii)}function di(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:ii}))}function ui(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function jk(){return combineCodec(di(),ui())}function Ai(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:di().encode(c),programAddress:r})}function Yk(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:ui().decode(e.data)}}var Ti=new Uint8Array([30]);function tW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ti)}function Po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Wt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(Ct())],["compressedProofArgs",getOptionEncoder(P())],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:Ti}))}function fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Lt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Et())],["compressedProofArgs",getOptionDecoder(M())],["signers",getArrayDecoder(J())]])}function rW(){return combineCodec(Po(),fi())}async function nW(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(O(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Po().encode(c),programAddress:r})}function Si(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Po().encode(c),programAddress:r})}function oW(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:fi().decode(e.data)}}var Ei=new Uint8Array([28]);function AW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ei)}function Mo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Wt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(Ct())],["signers",getArrayEncoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Ei}))}function Di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Lt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Et())],["signers",getArrayDecoder(J())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function gW(){return combineCodec(Mo(),Di())}async function pW(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Mo().encode(c),programAddress:r})}function Pi(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Mo().encode(c),programAddress:r})}function mW(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:Di().decode(e.data)}}var Ri=new Uint8Array([13]);function IW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ri)}function bi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Ri}))}function _i(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function CW(){return combineCodec(bi(),_i())}function vi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:bi().encode(c),programAddress:r})}function EW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:_i().decode(e.data)}}var Wi=new Uint8Array([23]);function _W(){return fixEncoderSize(getBytesEncoder(),1).encode(Wi)}function Li(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Wi}))}function Oi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function vW(){return combineCodec(Li(),Oi())}function Bi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.rentCollector),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Li().encode(c),programAddress:r})}function UW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:Oi().decode(e.data)}}var Hi=new Uint8Array([10]);function wW(){return fixEncoderSize(getBytesEncoder(),1).encode(Hi)}function Vi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Ot()],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Hi}))}function Fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Bt()],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function HW(){return combineCodec(Vi(),Fi())}function Gi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:Vi().encode(c),programAddress:r})}function VW(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:Fi().decode(e.data)}}var qi=new Uint8Array([20]);function YW(){return fixEncoderSize(getBytesEncoder(),1).encode(qi)}function ji(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Ot()],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",P()]]),e=>({...e,discriminator:qi}))}function Yi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Bt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",kt()],["compressedProofArgs",M()]])}function JW(){return combineCodec(ji(),Yi())}function Ji(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:ji().encode(c),programAddress:r})}function ZW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:Yi().decode(e.data)}}var Qi=new Uint8Array([14]);function nL(){return fixEncoderSize(getBytesEncoder(),1).encode(Qi)}function $i(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Qi}))}function ed(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function oL(){return combineCodec($i(),ed())}function td(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:$i().encode(c),programAddress:r})}function sL(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:ed().decode(e.data)}}var od=new Uint8Array([24]);function gL(){return fixEncoderSize(getBytesEncoder(),1).encode(od)}function sd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:od}))}function cd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function pL(){return combineCodec(sd(),cd())}function ad(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:sd().encode(c),programAddress:r})}function mL(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:cd().decode(e.data)}}var ud=new Uint8Array([12]);function xL(){return fixEncoderSize(getBytesEncoder(),1).encode(ud)}function Ad(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:ud}))}function gd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function IL(){return combineCodec(Ad(),gd())}function pd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.transactionBuffer),...a],data:Ad().encode(c),programAddress:r})}function CL(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:gd().decode(e.data)}}var yd=new Uint8Array([22]);function RL(){return fixEncoderSize(getBytesEncoder(),1).encode(yd)}function Td(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:yd}))}function fd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function bL(){return combineCodec(Td(),fd())}function Sd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.transactionBuffer),...a],data:Td().encode(c),programAddress:r})}function _L(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:fd().decode(e.data)}}var Cd=new Uint8Array([11]);function BL(){return fixEncoderSize(getBytesEncoder(),1).encode(Cd)}function Ed(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Cd}))}function Dd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function NL(){return combineCodec(Ed(),Dd())}function Pd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Ed().encode(c),programAddress:r})}function wL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:Dd().decode(e.data)}}var Rd=new Uint8Array([21]);function qL(){return fixEncoderSize(getBytesEncoder(),1).encode(Rd)}function bd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Rd}))}function _d(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",kt()],["compressedProofArgs",M()]])}function jL(){return combineCodec(bd(),_d())}function vd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:bd().encode(c),programAddress:r})}function YL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:_d().decode(e.data)}}var Wd=new Uint8Array([15]);function eO(){return fixEncoderSize(getBytesEncoder(),1).encode(Wd)}function Ld(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Wd}))}function Od(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function tO(){return combineCodec(Ld(),Od())}function Bd(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}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.transactionBuffer),...a],data:Ld().encode({}),programAddress:r})}function rO(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:Od().decode(e.data)}}var Hd=new Uint8Array([25]);function iO(){return fixEncoderSize(getBytesEncoder(),1).encode(Hd)}function Vd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Hd}))}function Fd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function dO(){return combineCodec(Vd(),Fd())}function Gd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.transactionBuffer),...a],data:Vd().encode(c),programAddress:r})}function uO(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:Fd().decode(e.data)}}var qd=new Uint8Array([16]);function TO(){return fixEncoderSize(getBytesEncoder(),1).encode(qd)}function jd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Nt()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:qd}))}function Yd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",wt()],["signers",getArrayDecoder(J())]])}function fO(){return combineCodec(jd(),Yd())}function Jd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:jd().encode(c),programAddress:r})}function SO(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Yd().decode(e.data)}}var Qd=new Uint8Array([26]);function MO(){return fixEncoderSize(getBytesEncoder(),1).encode(Qd)}function $d(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Nt()],["signers",getArrayEncoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Qd}))}function eu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",wt()],["signers",getArrayDecoder(J())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function hO(){return combineCodec($d(),eu())}function tu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:$d().encode(c),programAddress:r})}function RO(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:eu().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",_C=(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))(_C||{});function uB(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 vC=(S=>(S[S.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",S[S.ChangeConfig=1]="ChangeConfig",S[S.ChangeConfigCompressed=2]="ChangeConfigCompressed",S[S.CreateCompressedWallet=3]="CreateCompressedWallet",S[S.CreateDomainConfig=4]="CreateDomainConfig",S[S.CreateDomainUserAccount=5]="CreateDomainUserAccount",S[S.CreateGlobalCounter=6]="CreateGlobalCounter",S[S.CreateUserAccounts=7]="CreateUserAccounts",S[S.DecompressSettingsAccount=8]="DecompressSettingsAccount",S[S.DisableDomainConfig=9]="DisableDomainConfig",S[S.EditDomainConfig=10]="EditDomainConfig",S[S.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",S[S.EditUserDelegate=12]="EditUserDelegate",S[S.NativeTransferIntent=13]="NativeTransferIntent",S[S.NativeTransferIntentCompressed=14]="NativeTransferIntentCompressed",S[S.TokenTransferIntent=15]="TokenTransferIntent",S[S.TokenTransferIntentCompressed=16]="TokenTransferIntentCompressed",S[S.TransactionBufferClose=17]="TransactionBufferClose",S[S.TransactionBufferCloseCompressed=18]="TransactionBufferCloseCompressed",S[S.TransactionBufferCreate=19]="TransactionBufferCreate",S[S.TransactionBufferCreateCompressed=20]="TransactionBufferCreateCompressed",S[S.TransactionBufferExecute=21]="TransactionBufferExecute",S[S.TransactionBufferExecuteCompressed=22]="TransactionBufferExecuteCompressed",S[S.TransactionBufferExtend=23]="TransactionBufferExtend",S[S.TransactionBufferExtendCompressed=24]="TransactionBufferExtendCompressed",S[S.TransactionBufferVote=25]="TransactionBufferVote",S[S.TransactionBufferVoteCompressed=26]="TransactionBufferVoteCompressed",S[S.TransactionExecute=27]="TransactionExecute",S[S.TransactionExecuteCompressed=28]="TransactionExecuteCompressed",S[S.TransactionExecuteSync=29]="TransactionExecuteSync",S[S.TransactionExecuteSyncCompressed=30]="TransactionExecuteSyncCompressed",S))(vC||{});function AB(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 4;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 5;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 6;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 7;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 8;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 9;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 10;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 11;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 12;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 13;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 14;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 15;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 16;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 17;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 18;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 19;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 20;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 21;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 22;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 23;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 24;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 25;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 26;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 27;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 28;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 29;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 30;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var kC=6e3,WC=6001,LC=6002,OC=6003,BC=6004,NC=6005,wC=6006,HC=6007,VC=6008,FC=6009,GC=6010,zC=6011,KC=6012,qC=6013,jC=6014,YC=6015,JC=6016,ZC=6017,XC=6018,QC=6019,$C=6020,eE=6021,tE=6022,rE=6023,nE=6024,oE=6025,sE=6026,cE=6027,aE=6028,iE=6029,dE=6030,uE=6031,AE=6032,gE=6033,pE=6034,mE=6035,lE=6036,yE=6037,TE=6038,fE=6039,SE=6040,xE=6041,IE=6042,CE=6043,EE=6044,DE=6045,PE=6046,ME=6047,hE=6048,RE=6049,bE=6050,_E=6051,vE=6052,UE=6053,kE=6054,WE=6055,LE=6056,OE=6057,BE=6058,NE=6059,wE=6060,HE=6061,VE=6062,FE=6063,GE=6064,zE=6065,KE=6066,qE=6067,jE=6068,YE=6069,JE=6070,ZE=6071,XE=6072,QE=6073,$E=6074,eD=6075,tD=6076,rD=6077,nD=6078,oD=6079,sD=6080,cD=6081,aD=6082,iD=6083,dD=6084,uD=6085,AD=6086,ru;process.env.NODE_ENV!=="production"&&(ru={[uE]:"This member is already delegated to another wallet.",[HC]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[rD]:"Clock sysvar access failed. This may indicate a system error.",[_E]:"Missing credential id.",[UE]:"The domain configuration account is disabled. Please contact support or try again later.",[kE]:"Missing domain configuration account.",[eD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[AD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[GC]:"Duplicate public keys detected among members. Each member must have a unique key.",[FC]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[eE]:"No members provided. A multisig wallet must contain at least one member.",[wE]:"Slot numbers list is empty. At least one slot number is required for validation.",[XC]:"Expected a User with Administrator role for this instruction.",[VC]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[JC]:"Expected a User with Transaction Manager role for this instruction.",[SE]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[xE]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[IE]:"Declared buffer size does not match the actual serialized size.",[NE]:"Failed to compute hash. This may indicate a system error.",[pE]:"Not enough members with vote permission to meet the approval threshold.",[AE]:"At least one signer with execute permission is required to proceed.",[gE]:"At least one signer with initiate permission is required to perform this action.",[sE]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[$E]:"Invalid account index in transaction message. The account index is out of bounds.",[OE]:"Address Tree supplied is not part of the whitelisted address trees.",[QC]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[aE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[fE]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[HE]:"Member key conversion failed. The provided key format is invalid.",[mE]:"Only delegated members are allowed for this transaction.",[oE]:"Unexpected number of accounts provided for this instruction.",[qC]:"User with Permanent Member role must have a delegated wallet.",[WC]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[BC]:"The extracted public key has an invalid length or encoding.",[kC]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[OC]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[bE]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[hE]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[rE]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[ZE]:"Invalid source type for token transfer. The source account type is not supported.",[ZC]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[YC]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[nE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[sD]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[cE]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[oD]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[JE]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[NC]:"The extracted WebAuthn signed message payload is malformed.",[PE]:"An input string exceeds the maximum allowed character length.",[WE]:"This member is not registered under the provided domain configuration.",[GE]:"Member not found in settings. Cannot remove a member that does not exist.",[QE]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[iE]:"A required account is missing from the instruction context.",[VE]:"Compressed proof arguments are missing. Required for compressed account operations.",[qE]:"Missing compressed token account. Required for token transfer operations.",[cD]:"Missing destination token account. Required for token transfer operations.",[YE]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[FE]:"Light CPI accounts are missing. Required for compressed account operations.",[dE]:"User mutation arguments are required when performing add or remove delegate operations.",[dD]:"Missing new authority account. Required for domain configuration updates.",[iD]:"Missing settings account. Required for delegate operations on compressed wallets.",[BE]:"Compressed settings data is missing. The settings account must be initialized with data.",[aD]:"Missing source token account. Required for token transfer operations.",[jE]:"Missing SPL interface PDA. Required for token transfer operations.",[ME]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[tD]:"User account address is missing. Required for secp256r1 signature verification.",[uD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[yE]:"No valid signer found in this transaction.",[$C]:"Only one administrator is allowed per wallet.",[KC]:"Only one permanent member is allowed per wallet.",[jC]:"Only one transaction manager is allowed per wallet.",[LE]:"The given origin index is not in the whitelisted origins.",[KE]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[zC]:"Permanent members cannot be removed from a wallet.",[DE]:"Writable CPI calls to protected accounts are not permitted.",[wC]:"The rpIdHash extracted from the signed message does not match the expected value.",[zE]:"Settings key mismatch. The provided settings key does not match the expected value.",[LC]:"The signature index provided is out of bounds for the secp256r1 instruction.",[RE]:"The specified slot number was not found in the provided slot history.",[XE]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[tE]:"Too many members: a maximum of 4 members are supported.",[CE]:"This transaction has expired. It must be executed within 3 minutes of approval.",[EE]:"This transaction has not yet reached the required approval threshold.",[vE]:"Missing transports.",[TE]:"Only the transaction creator or rent payer may close this transaction buffer.",[nD]:"Unauthorized: Only the admin account is allowed to perform this action.",[lE]:"Member is not part of the expected signers for this transaction."});function TB(e){return process.env.NODE_ENV!=="production"?ru[e]:"Error message not available in production bundles."}function fB(e,n,r){return isProgramError(e,n,A,r)}async function bB({admin:e,addressTree:n}){return Lc({payer:e,addressTree:n,remainingAccounts:[]})}var be=class extends Error{constructor(r,o,t){super(r);this.code=o;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},Je=class extends be{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},$=class extends be{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},v=class extends be{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},ot=class extends be{constructor(r,o,t){super(r,"NETWORK_ERROR",{statusCode:o,url:t});this.statusCode=o;this.url=t;}},Cr=class extends be{constructor(r,o,t){super(`Operation "${r}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=o;this.lastError=t;}},Er=class extends be{constructor(r,o,t){super(r,"PERMISSION_ERROR",{required:o,actual:t});this.required=o;this.actual=t;}};var Kt={Ed25519:1,Secp256r1:2};var OB=g.looseObject({publicKey:g.string(),walletAddress:g.string(),settingsIndexWithAddress:g.object({index:g.union([g.number(),g.bigint()]),settingsAddressTreeIndex:g.number()})}),gD=g.object({devicePublicKey:g.string(),platform:g.enum(["web","ios","android"]),userAgent:g.string().optional(),browser:g.object({name:g.string().optional(),version:g.string().optional(),major:g.string().optional(),type:g.string().optional()}).optional(),engine:g.object({name:g.string().optional(),version:g.string().optional()}).optional(),cpu:g.object({architecture:g.string().optional()}).optional(),device:g.object({type:g.string().optional(),vendor:g.string().optional(),model:g.string().optional()}).optional(),os:g.object({name:g.string().optional(),version:g.string().optional()}).optional(),app:g.object({name:g.string().optional(),version:g.string().optional(),build:g.string().optional()}).optional(),display:g.object({screenWidth:g.number().optional(),screenHeight:g.number().optional(),viewportWidth:g.number().optional(),viewportHeight:g.number().optional(),devicePixelRatio:g.number().optional()}).optional(),locale:g.string().optional(),timezone:g.string().optional(),push:g.object({provider:g.enum(["expo","fcm","apns"]),token:g.string()}).optional(),website:g.string().optional(),nativeApp:g.string().optional(),createdAt:g.iso.datetime().optional()}).strict(),nu=g.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),BB=g.object({transactionActionType:nu,transactionAddress:g.string(),transactionMessageBytes:g.array(g.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),pD=g.object({transactionActionType:nu,transactionAddress:g.string(),transactionMessageBytes:g.base64()}).strict(),ou=g.object({phase:g.literal("start"),clientOrigin:g.url(),signer:g.string().optional(),rid:g.string(),validTill:g.number(),providerOrigin:g.string(),rpId:g.string(),data:g.object({type:g.literal("message"),payload:g.string(),requireTwoFactorAuthentication:g.boolean().default(false)}).strict()}).strict(),su=g.object({phase:g.literal("start"),clientOrigin:g.url(),signer:g.string().optional(),rid:g.string(),validTill:g.number(),providerOrigin:g.string(),rpId:g.string(),data:g.object({type:g.literal("transaction"),payload:pD}).strict()}).strict(),cu=g.object({startRequest:g.union([ou,su]),authResponse:g.custom(),client:g.object({clientOrigin:g.url(),jws:g.string()}).strict(),device:g.object({jwk:g.base64(),jws:g.string(),deviceProfile:gD}).strict()}).strict(),au=g.object({signer:g.string(),userAddressTreeIndex:g.number().optional(),additionalInfo:g.looseObject({}).optional()}).strict(),mD=g.object({slotHash:g.string(),slotNumber:g.string(),estimatedSlotHashExpiry:g.number(),originIndex:g.number(),crossOrigin:g.boolean()}).strict(),NB=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("message"),payload:au.extend(cu.shape).extend({startRequest:ou,transactionManager:g.object({publicKey:g.string(),signature:g.string()}).optional()})}).strict()}).strict(),wB=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("transaction"),payload:au.extend(cu.shape).extend(mD.shape).extend({startRequest:su})}).strict()}).strict();var Pe={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},_e=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,o)=>r|o,0))}static all(){return new e(Object.values(Pe).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var bo=33,ve=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!==bo)throw new Error(`Invalid public key length, expected ${bo} 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===bo)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()}},U=class extends ve{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 TD(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function fD(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var du=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(TD())],["addressTableLookups",getArrayCodec(fD())]]);function uu(e){return du.encode({numSigners:e.header.numSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,accountKeys:e.staticAccounts,instructions:e.instructions.map(r=>({programAddressIndex:r.programAddressIndex,accountIndices:r.accountIndices??[],data:Array.from(r.data??[])})),addressTableLookups:e.version!=="legacy"?e.addressTableLookups?.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes,writableIndexes:r.writableIndexes}))??[]:[]})}function Au(e){let n=du.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}var ie={};function cN(){if(!ie.solanaRpcEndpoint)throw new Je("RPC endpoint");return ie.solanaRpcEndpoint}function ye(){if(!ie.lightProtocolRpc)throw new Je("Light Protocol RPC");return ie.lightProtocolRpc}function se(){if(!ie.solanaRpc)throw new Je("Solana RPC");return ie.solanaRpc}function aN(){if(!ie.sendAndConfirm)throw new Je("Send and confirm transaction function");return ie.sendAndConfirm}function iN({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r}){ie.solanaRpcEndpoint=e,ie.lightProtocolRpc=createRpc(e,r,n);let{rpc:o,sendAndConfirmTransaction:t}=createSolanaClient({urlOrMoniker:e});ie.solanaRpc=o,ie.sendAndConfirm=t;}function Dr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function CD(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 pu(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let o=JSON.stringify(r);return new TextEncoder().encode(o.slice(1,-1))}function mu(e,n){let r=[],o=0,t=new TextDecoder;for(let c=0;c<n;c++){if(o+2>e.length)throw new Error("MaxLengthExceeded");let i=e[o]|e[o+1]<<8;if(o+=2,o+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(o,o+i),s=t.decode(a);r.push(s),o+=i;}return r}function lu(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 h=n&127;r+=h;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let o=e[r+1],t=r+2,c=e.slice(t,t+o);if(r=t+o,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,s=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=s[0]===0&&s.length>32?s.slice(1):s;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let m=new Uint8Array(32);m.set(d,32-d.length);let p=p256.Point.CURVE().n>>1n,T=BigInt("0x"+Dr(u)),C=(T>p?p256.Point.CURVE().n-T:T).toString(16).padStart(64,"0"),f=CD(C);return new Uint8Array([...m,...f])}function Pr(e){let n=pe(e.response.clientDataJSON),r=pe(e.response.authenticatorData),o=sha256(n);return new Uint8Array([...r,...o])}function PN(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Dr(n.get(-2))),y:BigInt("0x"+Dr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function MN(e){let r=p256.Point.fromBytes(getBase58Encoder().encode(e)).toBytes(false),o=new Map;return o.set(1,2),o.set(3,-7),o.set(-1,1),o.set(-2,r.slice(1,33)),o.set(-3,r.slice(33,65)),new Uint8Array(encodeCBOR(o))}async function hN(e){let{authenticatorData:n,clientDataJSON:r,signature:o}=e.authResponse.response,t=pe(n),c=JSON.parse(getUtf8Decoder().decode(pe(r))),i=pu(c),a=lu(pe(o)),s=await ct({rpIdHash:t.subarray(0,32)});return new U(e.signer.toString(),{verifyArgs:{clientDataJson:pe(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:vo(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:s,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function vo(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(n),...getBase64Encoder().encode(r)]))}function RN(e){return sha256(getUtf8Encoder().encode(canonicalize(e)))}function bN(e){return Uo(e.data.payload.authResponse)}function _N(e,n,r,o){let t=vo(n,r,o);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...t]))}async function vN(e,n,r,o,t,c,i){let a;if(!t||!c||!i){let m=(await se().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!m)throw new $("Slot sysvar","Unable to fetch slot sysvar data");let p=getBase64Encoder().encode(m[0]);c=getU64Decoder().decode(p.subarray(0,8)).toString(),a=p.subarray(8,40),t=getBase58Decoder().decode(a),i=Date.now()+512*400;}else a=getBase58Encoder().encode(t);let s=sha256(typeof e.transactionMessageBytes=="string"?getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),d=vo(n,r,o),u=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...s,...a,...d]));return {slotNumber:c,slotHash:t,challenge:u,estimatedSlotHashExpiry:i}}function Uo(e){let n=Pr(e);return sha256(n)}function UN(e){let n="";for(let o of e)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function pe(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,o=n.padEnd(n.length+r,"="),t=atob(o),c=new ArrayBuffer(t.length),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}async function kN(e,n){let{data:r}=await $o(se(),e),t=mu(r.origins,r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new $("Origin","Origin not found in domain config");return t}function WN(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function LN(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}var ko=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"];function ce(e,n=0){let r=e instanceof U?e:void 0,o=r?.verifyArgs&&n!==-1?some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs.clientDataJson?Pr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:o,signature:c,message:i,publicKey:a}}function ke(e,n,r=[]){let o=[];for(let t of e)if(t instanceof U){let c=r.length,{domainConfig:i,verifyArgs:a,signature:s,publicKey:d,message:u}=ce(t,c);if(u&&s&&d&&r.push({message:u,signature:s,publicKey:d}),i){let m=n.addPreAccounts([{address:i,role:AccountRole.READONLY}]).get(i)?.index;a.__option==="Some"&&m!==void 0&&o.push({__kind:"Secp256r1",fields:[{domainConfigIndex:m,verifyArgs:a.value}]});}}else {let c=n.addPreAccounts([{address:t.address,role:AccountRole.READONLY_SIGNER,signer:t}]).get(t.address)?.index;c!==void 0&&o.push({__kind:"Ed25519",fields:[c]});}return {secp256r1VerifyInput:r,transactionSyncSigners:o}}function Te(e){if(e instanceof ve)return {keyType:Kt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Kt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function Iu(e){return e instanceof U?e.toString():e.address.toString()}function de(e){let n=new Set,r=[];for(let t of e)n.has(Iu(t))||(r.push(t),n.add(Iu(t)));let o=r.filter(t=>t instanceof U);if(o.length>1)throw new v(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return r}function Cu({payer:e,tipAmount:n}){let r=ko[Math.floor(Math.random()*ko.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function Eu(e,n,r,o){if(e<n||e>r)throw new v(`${o} must be between ${n} and ${r} (inclusive), got ${e}`)}function Du(e,n){if(e<0)throw new v(`${n} must be non-negative, got ${e}`)}function Pu(e){return typeof e=="string"?e:e.toString()}function Mu(e){return e.toString()}async function Wo(e,n,r){let o=e?.get(n);if(o)return o;let t=await r();return t&&e&&e.set(n,t),t}var kD=3,WD=500,LD=2,OD=3e4,BD={backoffBase:LD,maxDelayMs:OD,retryOnRateLimit:true,initialDelayMs:WD,maxRetries:kD};function ND(e,n,r,o){let t=n*Math.pow(r,e-1);return Math.min(t,o)}function wD(e){return new Promise(n=>setTimeout(n,e))}async function hu(e,n){let{maxRetries:r,initialDelayMs:o,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...BD,...n},a;for(let s=1;s<=r;s++)try{return await e()}catch(d){if(a=d,i&&!i(d,s))throw d;if(s>=r)break;let u=ND(s,o,t,c);await wD(u);}throw new Cr(e.name||"retryWithBackoff",r,a)}var N=class{systemAccounts;nextPreIndex;preMap;nextPackedIndex;packedMap;outputTreeIndex;constructor(){this.systemAccounts=[],this.nextPreIndex=0,this.preMap=new Map,this.nextPackedIndex=0,this.packedMap=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){for(let r of n)this.insertOrGet(r.address.toString(),r,false);return this.preMap}getAccountRole(n,r){return n?r?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:r?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(A.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n,r={address:address(n),role:AccountRole.WRITABLE},o=true){let t=o?this.packedMap:this.preMap;if(!t.has(n)){let c=o?this.nextPackedIndex++:this.nextPreIndex++;t.set(n,{index:c,accountMeta:r});}return t.get(n).index}packOutputTreeIndex(n){if(n.treeType===TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await ye().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let o=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());o.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let s=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(s);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:o.length>0?{packedTreeInfos:o,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(n){return Array.from(n.entries()).sort((o,t)=>o[1].index-t[1].index).map(([,{accountMeta:o}])=>({...o}))}getOffsets(n){let r=n,o=r+this.systemAccounts.length;return [r,o]}toAccountMetas(){let n=this.hashSetAccountsToMetas(this.preMap),r=this.hashSetAccountsToMetas(this.packedMap),[o,t]=this.getOffsets(n.length);return {remainingAccounts:[...n,...this.systemAccounts,...r],systemOffset:o,packedOffset:t}}};async function hr(e,n){let r=Pu(e);return Wo(n,r,()=>ye().getCompressedAccount(e))}async function Xe(e,n){let r=Mu(e);return Wo(n,r,()=>se().getAccountInfo(e,{encoding:"base64"}).send())}async function ae(e,n){let r=(await Promise.all(e.map(o=>hr(o.address,n)))).filter(o=>o!==null).filter(o=>o.data!==null&&o.address!==null);if(r.length!==e.length)throw new $("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((o,t)=>({...o,type:e[t].type,tree:o.treeInfo.tree,queue:o.treeInfo.queue}))}function k(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function fe(e,n,r,o,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:o[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function te(e,n,r,o,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:o[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let s=e.packTreeInfos(a,[]).stateTrees;if(!s)throw new v("Unable to parse state tree data");return c.map((u,m)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:s.packedTreeInfos[m],address:new Uint8Array(u.address),outputStateTreeIndex:s.outputTreeIndex}}))}async function Se(e,n,r,o,t){let c=null,i=null,a=null,s=new N;if(e){await s.addSystemAccounts();let{address:d}=await re(n,r),u=(await ae([{address:d,type:"Settings"}],t))[0];o?a={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:a=await Z([u],[]);let m=s.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!m)throw new v("Unable to parse state tree data");let p=j().decode(u.data?.data);c={accountMeta:{address:new Uint8Array(u.address),treeInfo:m.packedTreeInfos[0]},data:p},i={accountMeta:{address:new Uint8Array(u.address),treeInfo:m.packedTreeInfos[0],outputStateTreeIndex:m.outputTreeIndex},data:p};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:s,settingsMutArgs:i}}async function Z(e,n){return hu(()=>ye().getValidityProofV0(e,n))}async function xe(){return (await Rr()).length-1}var Lo;async function Rr(){if(!Lo){let{data:e}=await _c(se(),await vu());Lo=e.whitelistedAddressTrees;}return Lo}function _u(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 Bo(e,n,r){let o=await qD(e,n,r);if(!o)throw new $("User account");return o}async function qD(e,n,r){let{address:o}=await w(e,n),t=await hr(o,r);return t?.data?.data?X().decode(t.data.data):null}async function Ew(e,{member:n,credentialId:r}){let o=[{memcmp:{offset:1,encoding:"base58",bytes:e}}];if(n)o.push({memcmp:{offset:33,encoding:"base58",bytes:getBase58Decoder().decode(V().encode(Te(n)))}});else if(r)o.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(pe(r))}});else return null;let t=await ye().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:o});return t.items.filter(c=>!!c.data).length?t.items.map(c=>X().decode(c.data?.data))[0]:null}async function br(e,n,r){let o=await jD(e,n,r);if(!o)throw new $("Settings account");return o}async function jD(e,n,r){try{let{address:o}=await re(e,n),t=await hr(o,r);if(!t?.data?.data)throw new $("Compressed settings account");let c=j().decode(t.data.data);if(c.data.__option==="None")throw new $("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let o=await oo(se(),e);return o.exists?{...o.data,isCompressed:false}:null}}async function Dw(e,n,r){let o=await Bo(e,n,r);if(o.role===1||o.role===0){let t=[],[c,i]=await Promise.all([ye().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:getBase58Decoder().decode(V().encode(Te(e)))}}]}),se().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(V().encode(Te(e)))}}]}).send()]);return c.items.forEach(a=>{if(a.data?.data){let s=j().decode(a.data.data);s.data.__option==="Some"&&t.push({...s.data.value,isCompressed:true});}}),i.forEach(a=>{let s=gr().decode(getBase64Encoder().encode(a.account.data[0]));t.push({...s,isCompressed:false});}),t}else return await Promise.all(o.wallets.map(async t=>br(await Ie(t.index),t.settingsAddressTreeIndex,r)))}async function No(e){Du(e,"index");let n=await Rr();if(e>=n.length)throw new v(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function Pw(e){let r=(await Rr()).findIndex(o=>o.toString()===e);if(r===-1)throw new $("Address tree",`Address ${e} not found in whitelist`);return r}async function re(e,n=0){let r=await No(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(o,new PublicKey(r),new PublicKey(A)).toString(),"base58"),addressTree:new PublicKey(r)}}async function w(e,n=0){let r=await No(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("user"),e instanceof ve?e.toTruncatedBuffer():getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(o,new PublicKey(r),new PublicKey(A.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function ct({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(getUtf8Encoder().encode(n));else throw new v("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function Ou(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function vu(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Bu(e,n,r){Eu(r,0,255,"buffer_index");let[o]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof ve?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return o}async function Me(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function Ie(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function Ow(e){let n=await Ie(e);return await Me(n)}async function Bw(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}function jw(e,n){if(n.threshold>1)throw new v("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(s=>Hu(s.pubkey)===e);if(!r)throw new $("Member",`Signer ${e} not found in settings`);let{permissions:o}=r;if(!o)throw new $("Permissions","No permissions found for the current member");let t=_e.has(o,Pe.InitiateTransaction),c=_e.has(o,Pe.VoteTransaction),i=_e.has(o,Pe.ExecuteTransaction);if(t&&c&&i)return null;if(!c||!i)throw new Er("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(s=>s.role===0);if(!a)throw new $("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(Hu(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}function rP(e){let n=new URL(e);return n.protocol==="https:"?n.protocol="wss:":n.protocol==="http:"&&(n.protocol="ws:"),n.toString()}function nP(e,n){return new Promise((r,o)=>{let t=new WebSocket(e),c=()=>{try{t.close();}catch{}};n.addEventListener("abort",c,{once:true}),t.onopen=()=>{n.removeEventListener("abort",c),r(t);},t.onerror=()=>{n.removeEventListener("abort",c),o(new Error("WebSocket connection failed"));};})}async function oP(e,n,r){return new Promise((o,t)=>{let c=false,i=()=>{n.removeEventListener("abort",s),e.removeEventListener("message",d),e.removeEventListener("error",u),e.removeEventListener("close",m);},a=p=>{c||(c=true,i(),p());},s=()=>{try{e.close();}catch{}};n.addEventListener("abort",s);let d=p=>{if(typeof p.data!="string")return;let T;try{T=JSON.parse(p.data);}catch{return}let x=typeof T.event=="string"?T.event:"message",C=T.data;try{r(x,C)&&a(()=>o());}catch(f){a(()=>t(f));}},u=()=>{a(()=>t(new ot("Transaction manager request failed",0,e.url)));},m=()=>{a(()=>o());};e.addEventListener("message",d),e.addEventListener("error",u),e.addEventListener("close",m);})}function wo(e="Aborted"){let n=new Error(e);return n.name="AbortError",n}var sP=(e,n)=>new Promise((r,o)=>{if(n.aborted)return o(wo());let t=setTimeout(r,e);n.addEventListener("abort",()=>{clearTimeout(t),o(wo());},{once:true});});function Yw(e){let{address:n,url:r,authResponses:o,transactionMessageBytes:t,onPendingApprovalsCallback:c,onPendingApprovalsSuccess:i,abortController:a,opts:s}=e,d=a??new AbortController,u=s?.maxAttempts??10,m=s?.retryDelayMs??400;return {address:n,async signTransactions(p){let{signal:T}=d,x=rP(r),C=JSON.stringify({type:"transaction",data:{publicKey:n.toString(),payload:p.map(f=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(f)),transactionMessageBytes:t?getBase64Decoder().decode(t):void 0,authResponses:o}))}});for(let f=0;f<u;f++){if(T.aborted)throw wo();let h,E;try{E=await nP(x,T),E.send(C),await oP(E,T,(I,D)=>{if(I==="error"){let B=D&&typeof D=="object"&&typeof D.error=="string"?D.error:"Unknown error",z=new Error(B);throw z.noRetry=!0,z}return I==="signatures"?(h=D.signatures,!0):(I==="pending_transaction_approval"?c?.(D.validTill):I==="transaction_approved"&&i?.(),!1)});}catch(I){if(I&&typeof I=="object"&&I.noRetry)throw new ot(`${I.message}`);if(I&&typeof I=="object"&&I.name==="AbortError")throw I}finally{try{E?.close();}catch{}}if(h?.length)return h.map(I=>({[n]:getBase58Encoder().encode(I)}));f<u-1&&await sP(m,T);}throw new ot("Transaction manager: missing signatures")}}}function Hu(e){return e.keyType===Kt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function Jw(e){let n=e.map(c=>we().encode(c)),r=4+n.reduce((c,i)=>c+i.length,0),o=new Uint8Array(r),t=0;o.set(getU32Encoder().encode(e.length),t),t+=4;for(let c of n)o.set(c,t),t+=c.length;return o}function Zw(e){let n=0,[r,o]=getU32Decoder().read(e,n);n=o;let t=new Array(r);for(let c=0;c<r;c++){let i=He().read(e,n);t[c]=i[0],n=i[1];}if(n!==e.length)throw new v(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function A2({payer:e,rpId:n,origins:r,authority:o}){let t=await ct({rpId:n}),c=new N;await c.addSystemAccounts();let i=await xe(),{address:a,addressTree:s}=await w(o.address,i),d=[{address:a,tree:s,queue:s,type:"User"}],u=await Z([],d),m=(await fe(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:T}=c.toAccountMetas(),x=k(u,T);return await ga({origins:r,authorityCreationArgs:m,authority:o,compressedProofArgs:x,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function C2({authority:e,payer:n,createUserArgs:r,domainConfig:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[];r.settings&&(r.transactionManager&&i.push({address:(await w(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}),i.push({address:(await re(r.settings,r.settingsAddressTreeIndex)).address,type:"Settings"}));let a=i.length?await ae(i,t):[],s=await xe(),{address:d,addressTree:u}=await w(r.member,s),m=[{address:d,type:"User",tree:u,queue:u}],p=await Z(a,m),T=null,x=null,C=a.filter(B=>B.type==="Settings"),f=a.filter(B=>B.type==="User");if(f.length&&(x=te(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),f,X())[0]),C.length){let B=f.length,z=B+1;T=te(c,p.treeInfos.slice(B,z),p.leafIndices.slice(B,z),p.rootIndices.slice(B,z),p.proveByIndices.slice(B,z),C,j())[0];}let h=(await fe(c,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),m))[0],{remainingAccounts:E,systemOffset:I}=c.toAccountMetas(),D=k(p,I);return await Ta({payer:n,authority:e,compressedProofArgs:D,member:vt().decode(r.member.toBuffer()),credentialId:pe(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:T?some({settingsMutArgs:T,transactionManager:x?some(x):none()}):none(),userAccountCreationArgs:h,domainConfig:o,remainingAccounts:E})}async function M2({payer:e}){let n=await Ou();return Ia({payer:e,globalCounter:n})}async function _2({admin:e,rpId:n,disable:r}){let o=await ct({rpId:n});return Ba({domainConfig:o,admin:e,disable:r,remainingAccounts:[]})}function aP(e,n,r,o){let t=iP(e,n),c=dP(e,n)&&r!==o;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function iP(e,n){let r=e.staticAccounts.length,{numSignerAccounts:o,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=o-t,a=r-o-c;return n>=r?false:n<i?true:n>=o?n-o<a:false}function dP(e,n){return n<e.header.numSignerAccounts}async function _r({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:o}){let t=Au(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,s]of t.staticAccounts.entries())i.push({address:s,role:aP(t,a,s,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let s=c[a.lookupTableAddress];if(!s)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.READONLY});}}for(let a of o?.filter(s=>s.address!==e)??[]){let s=i.findIndex(d=>d.address===a.address);s===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[s].role===AccountRole.READONLY||i[s].role===AccountRole.READONLY_SIGNER?i[s]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[s].role===AccountRole.WRITABLE||i[s].role===AccountRole.WRITABLE_SIGNER)&&(i[s]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}var it=33,dt=64,Go=14,yP=2,TP=address("Secp256r1SigVerify1111111111111111111111111");function fP(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function SP(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function qu(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let o=getU8Decoder().decode(e,n);n+=1;let t=[],c=SP();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=Go;let i=[];for(let a=0;a<r;a++){let s=fixDecoderSize(getBytesDecoder(),it).decode(e,n);n+=it;let d=fixDecoderSize(getBytesDecoder(),dt).decode(e,n);n+=dt;let u=t[a].messageDataSize,m=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:s,signature:d,message:m});}return [{numSignatures:r,padding:o,offsets:t,payload:i},n]}})}function ju(){return createEncoder({getSizeFromValue:e=>{let n=Go*e.offsets.length,r=e.payload.reduce((o,t)=>o+it+dt+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=getU8Encoder().write(e.numSignatures,n,r),r=getU8Encoder().write(e.padding,n,r);let o=fP();for(let t of e.offsets)r=o.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),it).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),dt).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function G2(){return combineCodec(ju(),qu())}function H(e,n){let r=e.length,o=yP+r*Go,t=[];for(let s=0;s<r;s++){let{message:d}=e[s],u=o,m=u+it,p=m+dt;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:m,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),o+=it+dt+d.length;}let c=n?.programAddress??TP,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:ju().encode(i)}}function z2(e){return {programAddress:e.programAddress,accounts:{},data:qu().decode(e.data)}}async function Yu({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:o,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:s=false}){let d=await Me(e),{accountMetas:u,addressLookupTableAccounts:m}=await _r({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(H(c)),p.push(s?Gd({transactionBuffer:n,payer:o.address,remainingAccounts:u,settingsKey:e}):Bd({transactionBuffer:n,payer:o.address,remainingAccounts:u,settings:e})),a&&p.push(Cu({payer:o,tipAmount:a})),{instructions:p,addressLookupTableAccounts:m}}async function Ju({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,additionalSigners:o,signers:t,payer:c,addressesByLookupTableAddress:i,secp256r1VerifyInput:a=[],compressed:s=false,simulateProof:d=false,cachedAccounts:u}){let m=de(t),p=await Me(e),[{accountMetas:T,addressLookupTableAccounts:x,transactionMessage:C},{settingsMutArgs:f,proof:h,packedAccounts:E}]=await Promise.all([_r({transactionMessageBytes:r,walletAddress:p,additionalSigners:o,addressesByLookupTableAddress:i}),Se(s,e,n,d,u)]);E.addPreAccounts(T);let{secp256r1VerifyInput:I,transactionSyncSigners:D}=ke(m,E,a),{remainingAccounts:B,systemOffset:z}=E.toAccountMetas(),ne=[];I.length>0&&ne.push(H(I));let Ce=xP(C,T);if(s){if(!c||!f)throw new v("Payer not found or proof args are missing for executeTransactionSync.");let me=k(h,z);ne.push(tu({signers:D,transactionMessage:Ce,settingsMutArgs:f,compressedProofArgs:me,payer:c,remainingAccounts:B}));}else ne.push(Jd({signers:D,settings:e,transactionMessage:Ce,remainingAccounts:B}));return {instructions:ne,addressLookupTableAccounts:x}}function xP(e,n){if(e.version==="legacy")throw new v("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:r.data??[]})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(o=>o.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function S8({settings:e,settingsAddressTreeIndex:n,destination:r,signers:o,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let s=de(o),d=await Me(e),[{packedAccounts:u,proof:m,settingsMutArgs:p},{value:T}]=await Promise.all([Se(a,e,n,false,t),Xe(d,t)]);if((T?.lamports??0)<BigInt(c))throw new v("Insufficient balance for native transfer.");let{secp256r1VerifyInput:x,transactionSyncSigners:C}=ke(s,u),{remainingAccounts:f,systemOffset:h}=u.toAccountMetas(),E=[];if(x.length>0&&E.push(H(x)),a){if(!i||!p)throw new Error("Payer not found or proof args is missing.");let I=k(m,h);E.push(Ai({amount:c,settingsMutArgs:p,compressedProofArgs:I,payer:i,signers:C,source:d,destination:r,remainingAccounts:f}));}else E.push(si({amount:c,signers:C,source:d,destination:r,settings:e,remainingAccounts:f}));return E}var tA=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),rA=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Ur=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function W8({settings:e,settingsAddressTreeIndex:n,destination:r,mint:o,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:s,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false}){let m=de(t),p=await Me(e),T=await hP(o,r,p,s,d),[x,C]=await Promise.all([RP(T,c),OP(u,e,n,c)]),f=bP(x,T,i),[h,E]=await Promise.all([WP(p,o,f.splBalance,f.cTokenBalance,BigInt(i),u),kP(f.requireSplInterface,T.splInterfacePda,c)]),I=BigInt(h.reduce((S,Or)=>S+(Or.parsed.amount.toNumber()??0),0));if(f.splBalance+f.cTokenBalance+I<BigInt(i))throw new v("Insufficient balance for token transfer.");let D=new N;E&&D.addPreAccounts([{address:o,role:AccountRole.WRITABLE}]);let B=_P(h,C),{proof:z,settingsMutArgs:ne}=await vP(D,B,C),Ce=UP(h,z,D),{secp256r1VerifyInput:me,transactionSyncSigners:tt}=ke(m,D),{remainingAccounts:he,systemOffset:Ae}=D.toAccountMetas(),We=k(z,Ae),rt=[];if(me.length>0&&rt.push(H(me)),u){if(!ne)throw new Error("Payer not found or proof args is missing.");rt.push(Pi({payer:a,source:p,sourceSplTokenAccount:T.sourceSplAta,sourceCtokenTokenAccount:T.sourceCtokenAta,destination:r,destinationSplTokenAccount:f.destinationSplTokenAccount,destinationCtokenTokenAccount:f.destinationCtokenTokenAccount,tokenProgram:s,mint:o,splInterfacePda:f.requireSplInterface?T.splInterfacePda:void 0,compressibleConfig:tA,rentSponsor:f.requireRentSponsor?rA:void 0,amount:i,signers:tt,sourceCompressedTokenAccounts:Ce,compressedProofArgs:We,splInterfacePdaArgs:f.requireSplInterface?some(d):none(),settingsMutArgs:ne,remainingAccounts:he}));}else rt.push(Si({settings:e,payer:a,source:p,sourceSplTokenAccount:T.sourceSplAta,sourceCtokenTokenAccount:T.sourceCtokenAta,destination:r,destinationSplTokenAccount:f.destinationSplTokenAccount,destinationCtokenTokenAccount:f.destinationCtokenTokenAccount,tokenProgram:s,mint:o,splInterfacePda:f.requireSplInterface?T.splInterfacePda:void 0,compressibleConfig:tA,rentSponsor:f.requireRentSponsor?rA:void 0,amount:i,signers:tt,sourceCompressedTokenAccounts:Ce,compressedProofArgs:We,splInterfacePdaArgs:f.requireSplInterface?some(d):none(),remainingAccounts:he}));return rt}async function hP(e,n,r,o,t){let c=p=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(p),getAddressEncoder().encode(Ur),getAddressEncoder().encode(e)],programAddress:Ur}),i=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(e)];t.restricted&&i.push(getUtf8Encoder().encode("restricted")),t.index>0&&i.push(getU8Encoder().encode(t.index));let[a,[s],d,[u],[m]]=await Promise.all([getAssociatedTokenAccountAddress(e,r,o),c(r),getAssociatedTokenAccountAddress(e,n,o),c(n),getProgramDerivedAddress({seeds:i,programAddress:Ur})]);return {sourceSplAta:a,sourceCtokenAta:s,destinationSplAta:d,destinationCTokenAta:u,splInterfacePda:m}}async function RP(e,n){let[r,o,t]=await Promise.all([Xe(e.destinationSplAta,n),Xe(e.sourceSplAta,n),Xe(e.sourceCtokenAta,n)]);return {destinationSplAtaInfo:r,sourceSplAtaInfo:o,sourceCTokenAtaInfo:t}}function bP(e,n,r){let o=!!e.destinationSplAtaInfo.value,t=!!e.sourceSplAtaInfo.value,c=!!e.sourceCTokenAtaInfo.value,i=t?getTokenDecoder().decode(getBase64Encoder().encode(e.sourceSplAtaInfo.value.data[0])).amount:BigInt(0),a=BigInt(c?BP(getBase64Encoder().encode(e.sourceCTokenAtaInfo.value.data[0]))?.amount??0:0),s=o?n.destinationSplAta:void 0,d=o?void 0:n.destinationCTokenAta,u=t&&(i+a<BigInt(r)||a>BigInt(0)||!o)||!t&&o;return {splBalance:i,cTokenBalance:a,destinationSplTokenAccount:s,destinationCtokenTokenAccount:d,requireSplInterface:u,requireRentSponsor:i+a<BigInt(r)||!o}}function _P(e,n){let r=[];return e.forEach(o=>r.push({hash:o.compressedAccount.hash,tree:o.compressedAccount.treeInfo.tree,queue:o.compressedAccount.treeInfo.queue,data:o.compressedAccount.data,address:o.compressedAccount.address})),n&&r.push(n),r}async function vP(e,n,r){let o=null,t=null;return n.length===0?{proof:t,settingsMutArgs:o}:(await e.addSystemAccounts(),t=await Z(n,[]),r&&(o=te(e,t.treeInfos.slice(-1),t.leafIndices.slice(-1),t.rootIndices.slice(-1),t.proveByIndices.slice(-1),n.slice(-1),j())[0]),{proof:t,settingsMutArgs:o})}function UP(e,n,r){return !n||!e.length?[]:e.map(o=>({amount:o.parsed.amount.toNumber(),merkleContext:{leafIndex:o.compressedAccount.leafIndex,merkleTreePubkeyIndex:r.insertOrGet(o.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:r.insertOrGet(o.compressedAccount.treeInfo.queue.toString()),proveByIndex:o.compressedAccount.proveByIndex},rootIndex:n.rootIndices[0],version:_u(o.compressedAccount.data?.discriminator),tlv:o.parsed.tlv?some(getArrayDecoder(Dt()).decode(o.parsed.tlv)):none(),state:o.parsed.state}))}async function kP(e,n,r){if(!e)return false;let{value:o}=await Xe(n,r);return !o}async function WP(e,n,r,o,t,c){let i=t-r-o;if(i<=0)return [];let s=(await ye().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(n)})).items.filter(u=>!!u.compressedAccount.data?.data.length&&u.compressedAccount.owner.toString()===Ur.toString()&&!u.parsed.amount.isZero());return s.length===0?[]:LP(s,Number(i),c?3:4,{treeType:TreeType.StateV2})}function LP(e,n,r=4,o){let t=e.filter(d=>d.compressedAccount.treeInfo.treeType===o?.treeType);if(t.length===0)throw new Error("No accounts found");let c=0,i=0,a=0,s=[];t.sort((d,u)=>u.parsed.amount.cmp(d.parsed.amount));for(let d of t){if(s.length>=r||c>=n)break;(!d.parsed.amount.isZero()||!d.compressedAccount.lamports.isZero())&&(c=c+d.parsed.amount.toNumber(),i=i+d.compressedAccount.lamports.toNumber(),s.push(d));}if(a=t.slice(0,r).reduce((d,u)=>d+u.parsed.amount.toNumber(),0),s.length===0)throw new Error("No accounts found.");if(c<n){let d=t.reduce((u,m)=>u+m.parsed.amount.toNumber(),0);throw s.length>=r?new Error(`Account limit exceeded: max ${a.toString()} (${r} accounts) per transaction. Total balance: ${d.toString()} (${t.length} accounts). Consider multiple transfers to spend full balance.`):new Error(`Insufficient balance for transfer. Required: ${n.toString()}, available: ${d.toString()}.`)}if(s.length===0)throw new Error("No accounts found.");return s}async function OP(e,n,r,o){if(!e)return null;let{address:t}=await re(n,r);return (await ae([{address:t,type:"Settings"}],o))[0]??null}function BP(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 q8({signers:e,payer:n,changeConfigArgs:r}){let{settings:o,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:s}=r,d=de(e),u=[],m=[];for(let f of d)if(f instanceof U){let h=m.length,{domainConfig:E,verifyArgs:I,signature:D,publicKey:B,message:z}=ce(f,h);if(z&&D&&B&&m.push({message:z,signature:D,publicKey:B}),E){let ne=i.addPreAccounts([{address:E,role:AccountRole.READONLY}]).get(E)?.index;I.__option==="Some"&&ne!==void 0&&u.push({__kind:"Secp256r1",fields:[{domainConfigIndex:ne,verifyArgs:I.value}]});}}else {let h=i.addPreAccounts([{address:f.address,role:AccountRole.READONLY_SIGNER,signer:f}]).get(f.address)?.index;h!==void 0&&u.push({__kind:"Ed25519",fields:[h]});}let{remainingAccounts:p,systemOffset:T}=i.toAccountMetas(),x=k(a,T),C=[];if(m.length>0&&C.push(H(m)),c){if(!s)throw new v("Proof args are missing for compressed changeConfig.");C.push(Xc({configActions:t,payer:n,compressedProofArgs:x,settingsMutArgs:s,remainingAccounts:p,signers:u}));}else C.push(Gc({settings:o,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:p,signers:u}));return C}async function $8({createUserArgs:e,payer:n}){let r=new N;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:AccountRole.READONLY_SIGNER,signer:u.member})));let o=await xe(),t=await Promise.all(e.map(async u=>{let{address:m,addressTree:p}=await w(u.member.address,o);return {address:m,tree:p,queue:p,type:"User"}})),c=await Z([],t),i=await fe(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:s}=r.toAccountMetas(),d=k(c,s);return await Pa({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,m)=>({member:u.member.address,role:u.role,userCreationArgs:i[m],transactionManagerUrl:u.role===0?u.transactionManagerUrl:null})),remainingAccounts:a})}async function cH({index:e,payer:n,initialMember:r,userAddressTreeIndex:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[],a=[];a.push(...await ae([{address:(await w(r.address,o)).address,type:"User"}],t));let s=await xe(),{address:d,addressTree:u}=await re(await Ie(e),s);i.push({address:d,queue:u,tree:u,type:"Settings"});let m=a.length,p=await Z(a,i),T=te(c,p.treeInfos.slice(0,m),p.leafIndices.slice(0,m),p.rootIndices.slice(0,m),p.proveByIndices.slice(0,m),a.filter(I=>I.type==="User"),X())[0],C=(await fe(c,p.treeInfos.slice(m),p.roots.slice(m),p.rootIndices.slice(m),i)).find(I=>I.type==="Settings")??null,{remainingAccounts:f,systemOffset:h}=c.toAccountMetas(),E=k(p,h);if(!C)throw new Error("Settings creation args is missing.");return await ra({settingsIndex:e,payer:n,initialMember:r,userArgs:T.data.role===3?{__kind:"Mutate",fields:[T]}:{__kind:"Read",fields:[T]},compressedProofArgs:E,...C,remainingAccounts:f})}async function yH({settings:e,settingsAddressTreeIndex:n,payer:r,signers:o,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await Se(true,e,n,false,t);if(!a)throw new v("Proof args are missing for settings account.");let s=de(o),{secp256r1VerifyInput:d,transactionSyncSigners:u}=ke(s,c),{remainingAccounts:m,systemOffset:p}=c.toAccountMetas(),T=k(i,p),x=[];return d.length>0&&x.push(H(d)),x.push(va({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:T,signers:u,remainingAccounts:m})),x}async function EH({authority:e,domainConfig:n,newAuthority:r,newOrigins:o}){let t=null,c=[];if(r){let i=new N;await i.addSystemAccounts();let a=await xe(),{address:s,addressTree:d}=await w(r.address,a),u=[{address:s,tree:d,queue:d,type:"User"}],m=await Z([],u),p=(await fe(i,m.treeInfos,m.roots,m.rootIndices,u))[0],T=i.toAccountMetas();c=T.remainingAccounts,t={compressedProofArgs:k(m,T.systemOffset),authorityCreationArgs:p};}return Ga({domainConfig:n,authority:e,newOrigins:o?some(o):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function bH({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let o=new N;await o.addSystemAccounts();let t=await ae([{address:(await w(e.address,n)).address,type:"User"}]),c=await Z(t,[]),i=te(o,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:a,systemOffset:s}=o.toAccountMetas(),d=k(c,s);return Ja({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function wH({payer:e,user:n,userAddressTreeIndex:r,newDelegate:o,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:s,publicKey:d}=ce(n),u=[];a&&s&&d&&u.push({message:a,signature:s,publicKey:d});let m=await Bo(n instanceof U?n:n.address,r,t),p=[];p.push({address:(await w(n instanceof U?n:n.address,r)).address,type:"User"});let T,x=null,C,f=null,h=m.wallets.find(Ae=>Ae.isDelegate);if(h){let Ae=await Ie(h.index);(await br(Ae,h.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await re(Ae,h.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):T=await Ie(h.index);}if(o){let Ae=await Ie(o.index);(await br(Ae,o.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await re(Ae,o.settingsAddressTreeIndex)).address,type:"Settings"}),f={start:p.length-1,end:p.length}):C=await Ie(o.index);}let E=new N;await E.addSystemAccounts();let I=await ae(p,t),D=await Z(I,[]),B=te(E,D.treeInfos.slice(0,1),D.leafIndices.slice(0,1),D.rootIndices.slice(0,1),D.proveByIndices.slice(0,1),I.slice(0,1),X())[0],z=x?some(te(E,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),I.slice(x.start,x.end),j())[0]):none(),ne=f?some(te(E,D.treeInfos.slice(f.start,f.end),D.leafIndices.slice(f.start,f.end),D.rootIndices.slice(f.start,f.end),D.proveByIndices.slice(f.start,f.end),I.slice(f.start,f.end),j())[0]):none(),{remainingAccounts:Ce,systemOffset:me}=E.toAccountMetas(),tt=k(D,me),he=[];return u.length>0&&he.push(H(u)),he.push(ti({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:o?some(o):none(),feePayer:e,signer:n instanceof U?void 0:n,oldSettings:T,oldSettingsMutArgs:z,newSettings:C,newSettingsMutArgs:ne,compressedProofArgs:tt,userMutArgs:B,remainingAccounts:Ce})),he}async function r5({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:o,compressed:t=false,cachedAccounts:c}){let i=await Dc(se(),r),a=i.data.multiWalletSettings,{packedAccounts:s,proof:d,settingsMutArgs:u}=await Se(t,a,e,false,c),{remainingAccounts:m,systemOffset:p}=s.toAccountMetas(),{domainConfig:T,verifyArgs:x,message:C,signature:f,publicKey:h}=ce(n),E=[];if(C&&f&&h&&E.push(H([{message:C,signature:f,publicKey:h}])),t){if(!o||!u)throw new v("Payer not found or proof args are missing for closing buffer.");let I=k(d,p);E.push(Bi({transactionBuffer:r,domainConfig:T,closer:n instanceof U?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:x,settingsMutArgs:u,payer:o,compressedProofArgs:I,remainingAccounts:m}));}else E.push(vi({transactionBuffer:r,domainConfig:T,closer:n instanceof U?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:x,remainingAccounts:[]}));return E}function oA({payer:e,creator:n,bufferIndex:r,settings:o,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,compressedArgs:d,expectedSigners:u}){let{domainConfig:m,verifyArgs:p,message:T,signature:x,publicKey:C}=ce(n),f=[];if(T&&x&&C&&f.push(H([{message:T,signature:x,publicKey:C}])),d){let{settingsReadonlyArgs:h,compressedProofArgs:E,remainingAccounts:I}=d;f.push(Ji({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof U?void 0:n,domainConfig:m,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},settingsReadonlyArgs:h,compressedProofArgs:E,remainingAccounts:I}));}else f.push(Gi({settings:o,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof U?void 0:n,domainConfig:m,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},remainingAccounts:[]}));return f}function sA({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:s}=ce(e),d=[];return a&&i&&s&&d.push(H([{message:a,signature:i,publicKey:s}])),o?d.push(ad({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof U?void 0:e,settingsMutArgs:o.settingsMutArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(td({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof U?void 0:e,remainingAccounts:[]})),d}function cA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:o=false}){return o?Sd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):pd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function aA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:s}=ce(n),d=[];return s&&i&&a&&d.push(H([{message:s,signature:i,publicKey:a}])),o?d.push(vd({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof U?void 0:n,settingsReadonlyArgs:o.settingsReadonlyArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(Pd({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof U?void 0:n,remainingAccounts:[]})),d}async function K5({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:o,compressed:t=false}){let c=await VP(r),i=new N,a=null,s=null,d=[];if(c.length||t){let m=await FP({packedAccounts:i,userAccounts:c,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:o});a=m.proof,s=m.settingsMutArgs??null,d=m.userMutArgs??[];}return {configActions:await GP({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:s,packedAccounts:i,compressed:t}}async function VP(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}}return n}async function FP({packedAccounts:e,userAccounts:n,compressed:r,settings:o,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let T=(await re(o,t)).address;i.push({address:T,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await ae(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let s=await Z(a,[]),d=[],u=[];for(let T of a)T.type==="Settings"?d.push(T):T.type==="User"&&u.push(T);let m,p=[];if(r&&s&&(m=te(e,s.treeInfos.slice(0,1),s.leafIndices.slice(0,1),s.rootIndices.slice(0,1),s.proveByIndices.slice(0,1),d,j())[0]),u.length&&s){let T=r?1:0;p=te(e,s.treeInfos.slice(T),s.leafIndices.slice(T),s.rootIndices.slice(T),s.proveByIndices.slice(T),u,X());}return {proof:s,settingsMutArgs:m,userMutArgs:p}}async function GP({configActionsArgs:e,userMutArgs:n}){let r=[];for(let o of e)switch(o.type){case "AddMembers":{let t=[];for(let c of o.members){let i=await w(c.member,c.userAddressTreeIndex).then(a=>n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(a.address)))));if(!i)throw new Error("Unable to find user account");t.push(qP({permissionArgs:c.permissions,userMutArgs:i,pubkey:c.member}));}r.push({__kind:o.type,fields:[t]});break}case "RemoveMembers":{let t=await Promise.all(o.members.map(c=>w(c.member,c.userAddressTreeIndex).then(i=>{let a=n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(i.address))));if(!a)throw new Error("Unable to find user account");return KP({pubkey:c.member,userMutArgs:a})})));r.push({__kind:o.type,fields:[t]});break}case "EditPermissions":{let t=o.members.map(c=>zP({permissionArgs:c.permissions,pubkey:c.member}));r.push({__kind:o.type,fields:[t]});break}default:r.push({__kind:o.type,fields:[o.threshold]});}return r}function zP({pubkey:e,permissionArgs:n}){return {memberKey:Te(e),permissions:AA(n)}}function KP({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:Te(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function qP({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:Te(e),permissions:AA(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function AA(e){let n=[];return e.initiate&&n.push(Pe.InitiateTransaction),e.vote&&n.push(Pe.VoteTransaction),e.execute&&n.push(Pe.ExecuteTransaction),_e.fromPermissions(n)}async function $5({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s,compressed:d=false,additionalVoters:u=[],additionalSigners:m=[],chunkSize:p=Math.ceil(o.length/2),cachedAccounts:T}){let x=Math.floor(Math.random()*255),C=await Bu(n,t instanceof U?t:t.address,x),f=[],h=[];for(let ee=0;ee<o.length;ee+=p){let Jo=o.subarray(ee,ee+p);f.push(Jo),h.push(sha256(Jo));}let E=sha256(o),{settingsReadonlyArgs:I,settingsMutArgs:D,proof:B,packedAccounts:z}=await Se(d,n,r,false,T),{remainingAccounts:ne,systemOffset:Ce}=z.toAccountMetas(),me=B&&I&&D?{settingsReadonlyArgs:I,settingsMutArgs:D,compressedProofArgs:k(B,Ce),remainingAccounts:ne,payer:e}:null,tt=de([t,...c?[c]:[],...u]).map(ee=>({memberKey:Te(ee),messageHash:ee instanceof U?Uo(ee.authResponse):null})),he=oA({finalBufferHash:E,finalBufferSize:o.length,bufferIndex:x,payer:e,transactionBufferAddress:C,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:h,compressedArgs:me,expectedSigners:tt}),Ae=f.map(ee=>cA({transactionMessageBytes:ee,transactionBufferAddress:C,settings:n,compressed:d})),We=u.map(ee=>aA({voter:ee,transactionBufferAddress:C,settings:n,compressedArgs:me})),rt=sA({compressedArgs:me,settings:n,executor:c,transactionBufferAddress:C}),{instructions:S,addressLookupTableAccounts:Or}=await Yu({compressed:d,settings:n,transactionMessageBytes:o,transactionBufferAddress:C,payer:e,additionalSigners:m,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s}),ut=ee=>({payer:e,instructions:ee,addressesByLookupTableAddress:Or});return [ut(he),...Ae.map(ee=>ut([ee])),...We.length?[ut(We.flat())]:[],ut(rt),ut(S)]}var Wr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let o=new Map,t=i=>{let a=o.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},o.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let s=t(a.address);s.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,o)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),o=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),c=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+o.length,numReadonlySignerAccounts:o.length,numReadonlyNonSignerAccounts:c.length};if(r.length===0)throw new Error("Expected at least one writable signer key");let[a]=r[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let s=[...r.map(([d])=>d),...o.map(([d])=>d),...t.map(([d])=>d),...c.map(([d])=>d)];return [i,s]}extractTableLookup(n){let[r,o]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(n,r){let o=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,s=n.findIndex(d=>d===a);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),t.push(a),this.keyMetaMap.delete(c);}}return [o,t]}};var Lr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let o=new Map;this.keySegments().flat().forEach((c,i)=>{o.set(c,i);});let t=c=>{let i=o.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function pA({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:o}){let t=Wr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(o??{});for(let p of a){let T=t.extractTableLookup(p);if(T!==void 0){let{addressTableLookup:x,drainedKeys:C}=T;c.push({readonlyIndexes:x.readonlyIndexes,readableIndices:x.readonlyIndexes,writableIndexes:x.writableIndexes,writableIndices:x.writableIndexes,lookupTableAddress:address(x.lookupTableAddress)}),i.writable.push(...C.writable),i.readonly.push(...C.readonly);}}let[s,d]=t.getMessageComponents(),m=new Lr(d,i).compileInstructions(r);return {version:0,header:s,instructions:m,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function g6({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=pA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(uu(o))}async function T6({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,signers:t,additionalSigners:c,secp256r1VerifyInput:i,addressesByLookupTableAddress:a,cachedAccounts:s,compressed:d=false,simulateProof:u=false}){let{instructions:m,addressLookupTableAccounts:p}=await Ju({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,additionalSigners:c,transactionMessageBytes:o,secp256r1VerifyInput:i,compressed:d,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:s});return {payer:e,instructions:m,addressesByLookupTableAddress:p}}
2
+ export{kc as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,Br as AccountState,cu as AuthenticationContextSchema,au as BaseResponseSchema,Yc as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,Hc as CHANGE_CONFIG_DISCRIMINATOR,ea as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,ua as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,la as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Sa as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Ea as CREATE_USER_ACCOUNTS_DISCRIMINATOR,NB as CompleteMessageRequestSchema,wB as CompleteTransactionRequestSchema,Ra as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Wa as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Zo as DOMAIN_CONFIG_DISCRIMINATOR,gD as DeviceProfileSchema,Va as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,qa as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,Qa as EDIT_USER_DELEGATE_DISCRIMINATOR,rs as GLOBAL_COUNTER_DISCRIMINATOR,Kt as KeyType,uE as MULTI_WALLET_ERROR__ALREADY_DELEGATED,HC as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,rD as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,_E as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,UE as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,kE as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,eD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,AD as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,GC as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,FC as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,eE as MULTI_WALLET_ERROR__EMPTY_MEMBERS,wE as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,XC as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,VC as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,JC as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,SE as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,xE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,IE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,NE as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,pE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,AE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,gE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,sE as MULTI_WALLET_ERROR__INVALID_ACCOUNT,$E as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,OE as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,QC as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,aE as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,fE as MULTI_WALLET_ERROR__INVALID_BUFFER,HE as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,mE as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,oE as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,qC as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,WC as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,BC as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,kC as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,OC as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,bE as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,hE as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,rE as MULTI_WALLET_ERROR__INVALID_THRESHOLD,ZE as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,ZC as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,YC as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,nE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,sD as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,cE as MULTI_WALLET_ERROR__INVALID_USER_ROLE,oD as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,JE as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,NC as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,PE as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,WE as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,GE as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,QE as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,iE as MULTI_WALLET_ERROR__MISSING_ACCOUNT,VE as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,qE as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,cD as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,YE as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,FE as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,dE as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,dD as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,iD as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,BE as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,aD as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,jE as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,ME as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,tD as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,uD as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,yE as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,$C as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,KC as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,jC as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,LE as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,KE as MULTI_WALLET_ERROR__PAYER_MISMATCH,zC as MULTI_WALLET_ERROR__PERMANENT_MEMBER,DE as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,wC as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,zE as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,LC as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,RE as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,XE as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,tE as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,CE as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,EE as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,vE as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,TE as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,nD as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,lE as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,_C as MultiWalletAccount,vC as MultiWalletInstruction,ii as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,ni as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Pe as Permission,_e as Permissions,lc as SETTINGS_DISCRIMINATOR,ve as Secp256r1Key,U as SignedSecp256r1Key,ou as StartMessageRequestSchema,su as StartTransactionRequestSchema,Ei as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Ti as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Wi as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,Ri as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,qi as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,Hi as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Ic as TRANSACTION_BUFFER_DISCRIMINATOR,od as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Qi as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,yd as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,ud as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Rd as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Cd as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,Hd as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,Wd as TRANSACTION_EXECUTE_DISCRIMINATOR,Qd as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,qd as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,nu as TransactionActionTypeSchema,mD as TransactionDetailsSchema,BB as TransactionPayloadSchema,pD as TransactionPayloadWithBase64MessageBytesSchema,no as Transports,OB as UserInfoSchema,Re as UserRole,hc as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,bB as addWhitelistedAddressTrees,pe as base64URLStringToBuffer,UN as bufferToBase64URLString,q8 as changeConfig,r5 as closeTransactionBuffer,oh as configAction,LN as convertBase64StringToJWK,WN as convertJWKToBase64String,Hu as convertMemberKeyToString,MN as convertPubkeyCompressedToCose,PN as convertPubkeyCoseToCompressed,bN as createClientAuthorizationCompleteRequestChallenge,RN as createClientAuthorizationStartRequestChallenge,A2 as createDomainConfig,C2 as createDomainUserAccounts,M2 as createGlobalCounter,_N as createMessageChallenge,oA as createTransactionBuffer,vN as createTransactionChallenge,Yw as createTransactionManagerSigner,$8 as createUserAccounts,cH as createWallet,Qo as decodeDomainConfig,os as decodeGlobalCounter,yc as decodeSettings,Ec as decodeTransactionBuffer,bc as decodeWhitelistedAddressTree,yH as decompressSettingsAccount,Zw as deserializeConfigActions,_2 as disableDomainConfig,EH as editDomainConfig,bH as editTransactionManagerUrl,wH as editUserDelegate,Yu as executeTransaction,sA as executeTransactionBuffer,Ju as executeTransactionSync,cA as extendTransactionBuffer,Ch as extensionStruct,QP as fetchAllDomainConfig,sM as fetchAllGlobalCounter,hA as fetchAllMaybeDomainConfig,GA as fetchAllMaybeGlobalCounter,LT as fetchAllMaybeSettings,t1 as fetchAllMaybeTransactionBuffer,I1 as fetchAllMaybeWhitelistedAddressTree,Y_ as fetchAllSettings,Dw as fetchAllSettingsAccountByMember,ev as fetchAllTransactionBuffer,sv as fetchAllWhitelistedAddressTree,$o as fetchDomainConfig,oM as fetchGlobalCounter,MA as fetchMaybeDomainConfig,FA as fetchMaybeGlobalCounter,oo as fetchMaybeSettings,jD as fetchMaybeSettingsAccountData,e1 as fetchMaybeTransactionBuffer,qD as fetchMaybeUserAccountData,x1 as fetchMaybeWhitelistedAddressTree,j_ as fetchSettings,br as fetchSettingsAccountData,Dc as fetchTransactionBuffer,Ew as fetchUserAccountByFilters,Bo as fetchUserAccountData,_c as fetchWhitelistedAddressTree,dM as getAccountStateCodec,wr as getAccountStateDecoder,Nr as getAccountStateEncoder,yM as getAddMemberArgsCodec,Gr as getAddMemberArgsDecoder,Fr as getAddMemberArgsEncoder,Cv as getAddWhitelistedAddressTreesDiscriminatorBytes,Dv as getAddWhitelistedAddressTreesInstruction,Lc as getAddWhitelistedAddressTreesInstructionAsync,Ev as getAddWhitelistedAddressTreesInstructionDataCodec,Wc as getAddWhitelistedAddressTreesInstructionDataDecoder,po as getAddWhitelistedAddressTreesInstructionDataEncoder,gM as getAdditionalMetadataCodec,Vr as getAdditionalMetadataDecoder,Hr as getAdditionalMetadataEncoder,Vv as getChangeConfigCompressedDiscriminatorBytes,Xc as getChangeConfigCompressedInstruction,Fv as getChangeConfigCompressedInstructionDataCodec,Zc as getChangeConfigCompressedInstructionDataDecoder,Jc as getChangeConfigCompressedInstructionDataEncoder,Uv as getChangeConfigDiscriminatorBytes,Gc as getChangeConfigInstruction,kv as getChangeConfigInstructionDataCodec,Fc as getChangeConfigInstructionDataDecoder,Vc as getChangeConfigInstructionDataEncoder,vo as getClientAndDeviceHash,SM as getCompiledInstructionCodec,Kr as getCompiledInstructionDecoder,zr as getCompiledInstructionEncoder,EM as getCompressedAccountMetaCodec,mt as getCompressedAccountMetaDecoder,pt as getCompressedAccountMetaEncoder,hM as getCompressedAccountMetaReadOnlyCodec,ft as getCompressedAccountMetaReadOnlyDecoder,Tt as getCompressedAccountMetaReadOnlyEncoder,_M as getCompressedOnlyExtensionCodec,jr as getCompressedOnlyExtensionDecoder,qr as getCompressedOnlyExtensionEncoder,kM as getCompressedProofCodec,$r as getCompressedProofDecoder,Qr as getCompressedProofEncoder,re as getCompressedSettingsAddress,BM as getCompressedSettingsCodec,VM as getCompressedSettingsDataCodec,tn as getCompressedSettingsDataDecoder,en as getCompressedSettingsDataEncoder,j as getCompressedSettingsDecoder,St as getCompressedSettingsEncoder,KM as getCompressedTokenArgsCodec,Et as getCompressedTokenArgsDecoder,Ct as getCompressedTokenArgsEncoder,JM as getCompressibleExtensionCodec,dn as getCompressibleExtensionDecoder,an as getCompressibleExtensionEncoder,$M as getCompressionInfoCodec,An as getCompressionInfoDecoder,un as getCompressionInfoEncoder,nh as getConfigActionCodec,He as getConfigActionDecoder,we as getConfigActionEncoder,Zv as getCreateCompressedWalletDiscriminatorBytes,Qv as getCreateCompressedWalletInstruction,ra as getCreateCompressedWalletInstructionAsync,Xv as getCreateCompressedWalletInstructionDataCodec,ta as getCreateCompressedWalletInstructionDataDecoder,mo as getCreateCompressedWalletInstructionDataEncoder,cU as getCreateDomainConfigDiscriminatorBytes,iU as getCreateDomainConfigInstruction,ga as getCreateDomainConfigInstructionAsync,aU as getCreateDomainConfigInstructionDataCodec,Aa as getCreateDomainConfigInstructionDataDecoder,yo as getCreateDomainConfigInstructionDataEncoder,yU as getCreateDomainUserAccountDiscriminatorBytes,fU as getCreateDomainUserAccountInstruction,Ta as getCreateDomainUserAccountInstructionAsync,TU as getCreateDomainUserAccountInstructionDataCodec,ya as getCreateDomainUserAccountInstructionDataDecoder,To as getCreateDomainUserAccountInstructionDataEncoder,PU as getCreateGlobalCounterDiscriminatorBytes,hU as getCreateGlobalCounterInstruction,Ia as getCreateGlobalCounterInstructionAsync,MU as getCreateGlobalCounterInstructionDataCodec,xa as getCreateGlobalCounterInstructionDataDecoder,So as getCreateGlobalCounterInstructionDataEncoder,dh as getCreateUserAccountArgsCodec,En as getCreateUserAccountArgsDecoder,Cn as getCreateUserAccountArgsEncoder,LU as getCreateUserAccountsDiscriminatorBytes,BU as getCreateUserAccountsInstruction,Pa as getCreateUserAccountsInstructionAsync,OU as getCreateUserAccountsInstructionDataCodec,Da as getCreateUserAccountsInstructionDataDecoder,Io as getCreateUserAccountsInstructionDataEncoder,KU as getDecompressSettingsAccountDiscriminatorBytes,va as getDecompressSettingsAccountInstruction,qU as getDecompressSettingsAccountInstructionDataCodec,_a as getDecompressSettingsAccountInstructionDataDecoder,ba as getDecompressSettingsAccountInstructionDataEncoder,$U as getDisableDomainConfigDiscriminatorBytes,Ba as getDisableDomainConfigInstruction,ek as getDisableDomainConfigInstructionDataCodec,Oa as getDisableDomainConfigInstructionDataDecoder,La as getDisableDomainConfigInstructionDataEncoder,ct as getDomainConfigAddress,XP as getDomainConfigCodec,Xo as getDomainConfigDecoder,ZP as getDomainConfigDiscriminatorBytes,PA as getDomainConfigEncoder,$P as getDomainConfigSize,ik as getEditDomainConfigDiscriminatorBytes,Ga as getEditDomainConfigInstruction,uk as getEditDomainConfigInstructionAsync,dk as getEditDomainConfigInstructionDataCodec,Fa as getEditDomainConfigInstructionDataDecoder,Eo as getEditDomainConfigInstructionDataEncoder,ph as getEditMemberArgsCodec,Sn as getEditMemberArgsDecoder,fn as getEditMemberArgsEncoder,fk as getEditTransactionManagerUrlDiscriminatorBytes,Ja as getEditTransactionManagerUrlInstruction,Sk as getEditTransactionManagerUrlInstructionDataCodec,Ya as getEditTransactionManagerUrlInstructionDataDecoder,ja as getEditTransactionManagerUrlInstructionDataEncoder,hk as getEditUserDelegateDiscriminatorBytes,ti as getEditUserDelegateInstruction,Rk as getEditUserDelegateInstructionDataCodec,ei as getEditUserDelegateInstructionDataDecoder,$a as getEditUserDelegateInstructionDataEncoder,Th as getExpectedSignerCodec,Mt as getExpectedSignerDecoder,Pt as getExpectedSignerEncoder,Ih as getExtensionStructCodec,Dt as getExtensionStructDecoder,rn as getExtensionStructEncoder,Ou as getGlobalCounterAddress,nM as getGlobalCounterCodec,ns as getGlobalCounterDecoder,rM as getGlobalCounterDiscriminatorBytes,VA as getGlobalCounterEncoder,cM as getGlobalCounterSize,Bw as getLightCpiSigner,ye as getLightProtocolRpc,hh as getLinkWalletArgsCodec,Ln as getLinkWalletArgsDecoder,Wn as getLinkWalletArgsEncoder,vh as getMemberCodec,It as getMemberDecoder,xt as getMemberEncoder,Wh as getMemberKeyCodec,Q as getMemberKeyDecoder,V as getMemberKeyEncoder,TB as getMultiWalletErrorMessage,qk as getNativeTransferIntentCompressedDiscriminatorBytes,Ai as getNativeTransferIntentCompressedInstruction,jk as getNativeTransferIntentCompressedInstructionDataCodec,ui as getNativeTransferIntentCompressedInstructionDataDecoder,di as getNativeTransferIntentCompressedInstructionDataEncoder,Ok as getNativeTransferIntentDiscriminatorBytes,si as getNativeTransferIntentInstruction,Nk as getNativeTransferIntentInstructionAsync,Bk as getNativeTransferIntentInstructionDataCodec,oi as getNativeTransferIntentInstructionDataDecoder,Do as getNativeTransferIntentInstructionDataEncoder,Nh as getNewAuthorityArgsCodec,wn as getNewAuthorityArgsDecoder,Nn as getNewAuthorityArgsEncoder,kN as getOriginIndex,Vh as getPackedAddressTreeInfoCodec,_t as getPackedAddressTreeInfoDecoder,bt as getPackedAddressTreeInfoEncoder,zh as getPackedMerkleContextCodec,on as getPackedMerkleContextDecoder,nn as getPackedMerkleContextEncoder,jh as getPackedStateTreeInfoCodec,yt as getPackedStateTreeInfoDecoder,lt as getPackedStateTreeInfoEncoder,Zh as getPausableAccountExtensionCodec,Pn as getPausableAccountExtensionDecoder,Dn as getPausableAccountExtensionEncoder,$h as getPermanentDelegateAccountExtensionCodec,hn as getPermanentDelegateAccountExtensionDecoder,Mn as getPermanentDelegateAccountExtensionEncoder,rR as getPermissionsCodec,Oe as getPermissionsDecoder,Le as getPermissionsEncoder,cR as getProofArgsCodec,M as getProofArgsDecoder,P as getProofArgsEncoder,uR as getRemoveMemberArgsCodec,In as getRemoveMemberArgsDecoder,xn as getRemoveMemberArgsEncoder,pR as getRentConfigCodec,ln as getRentConfigDecoder,mn as getRentConfigEncoder,Uo as getSecp256r1MessageHash,yR as getSecp256r1PubkeyCodec,vt as getSecp256r1PubkeyDecoder,Fn as getSecp256r1PubkeyEncoder,SP as getSecp256r1SignatureOffsetsDataDecoder,fP as getSecp256r1SignatureOffsetsDataEncoder,SR as getSecp256r1VerifyArgsCodec,G as getSecp256r1VerifyArgsDecoder,F as getSecp256r1VerifyArgsEncoder,ER as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,zn as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,Gn as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,H as getSecp256r1VerifyInstruction,G2 as getSecp256r1VerifyInstructionDataCodec,qu as getSecp256r1VerifyInstructionDataDecoder,ju as getSecp256r1VerifyInstructionDataEncoder,aN as getSendAndConfirmTransaction,q_ as getSettingsCodec,gr as getSettingsDecoder,K_ as getSettingsDiscriminatorBytes,WT as getSettingsEncoder,Ie as getSettingsFromIndex,bR as getSettingsIndexWithAddressAndDelegateInfoCodec,Yn as getSettingsIndexWithAddressAndDelegateInfoDecoder,jn as getSettingsIndexWithAddressAndDelegateInfoEncoder,MR as getSettingsIndexWithAddressCodec,qn as getSettingsIndexWithAddressDecoder,Kn as getSettingsIndexWithAddressEncoder,kR as getSettingsMutArgsCodec,q as getSettingsMutArgsDecoder,K as getSettingsMutArgsEncoder,BR as getSettingsReadonlyArgsCodec,kt as getSettingsReadonlyArgsDecoder,Ut as getSettingsReadonlyArgsEncoder,hN as getSignedSecp256r1Key,se as getSolanaRpc,cN as getSolanaRpcEndpoint,HR as getSplInterfacePdaArgsCodec,Lt as getSplInterfacePdaArgsDecoder,Wt as getSplInterfacePdaArgsEncoder,zR as getTokenMetadataCodec,bn as getTokenMetadataDecoder,Rn as getTokenMetadataEncoder,AW as getTokenTransferIntentCompressedDiscriminatorBytes,Pi as getTokenTransferIntentCompressedInstruction,pW as getTokenTransferIntentCompressedInstructionAsync,gW as getTokenTransferIntentCompressedInstructionDataCodec,Di as getTokenTransferIntentCompressedInstructionDataDecoder,Mo as getTokenTransferIntentCompressedInstructionDataEncoder,tW as getTokenTransferIntentDiscriminatorBytes,Si as getTokenTransferIntentInstruction,nW as getTokenTransferIntentInstructionAsync,rW as getTokenTransferIntentInstructionDataCodec,fi as getTokenTransferIntentInstructionDataDecoder,Po as getTokenTransferIntentInstructionDataEncoder,Bu as getTransactionBufferAddress,_W as getTransactionBufferCloseCompressedDiscriminatorBytes,Bi as getTransactionBufferCloseCompressedInstruction,vW as getTransactionBufferCloseCompressedInstructionDataCodec,Oi as getTransactionBufferCloseCompressedInstructionDataDecoder,Li as getTransactionBufferCloseCompressedInstructionDataEncoder,IW as getTransactionBufferCloseDiscriminatorBytes,vi as getTransactionBufferCloseInstruction,CW as getTransactionBufferCloseInstructionDataCodec,_i as getTransactionBufferCloseInstructionDataDecoder,bi as getTransactionBufferCloseInstructionDataEncoder,$_ as getTransactionBufferCodec,YR as getTransactionBufferCreateArgsCodec,Bt as getTransactionBufferCreateArgsDecoder,Ot as getTransactionBufferCreateArgsEncoder,YW as getTransactionBufferCreateCompressedDiscriminatorBytes,Ji as getTransactionBufferCreateCompressedInstruction,JW as getTransactionBufferCreateCompressedInstructionDataCodec,Yi as getTransactionBufferCreateCompressedInstructionDataDecoder,ji as getTransactionBufferCreateCompressedInstructionDataEncoder,wW as getTransactionBufferCreateDiscriminatorBytes,Gi as getTransactionBufferCreateInstruction,HW as getTransactionBufferCreateInstructionDataCodec,Fi as getTransactionBufferCreateInstructionDataDecoder,Vi as getTransactionBufferCreateInstructionDataEncoder,Cc as getTransactionBufferDecoder,Q_ as getTransactionBufferDiscriminatorBytes,$T as getTransactionBufferEncoder,gL as getTransactionBufferExecuteCompressedDiscriminatorBytes,ad as getTransactionBufferExecuteCompressedInstruction,pL as getTransactionBufferExecuteCompressedInstructionDataCodec,cd as getTransactionBufferExecuteCompressedInstructionDataDecoder,sd as getTransactionBufferExecuteCompressedInstructionDataEncoder,nL as getTransactionBufferExecuteDiscriminatorBytes,td as getTransactionBufferExecuteInstruction,oL as getTransactionBufferExecuteInstructionDataCodec,ed as getTransactionBufferExecuteInstructionDataDecoder,$i as getTransactionBufferExecuteInstructionDataEncoder,RL as getTransactionBufferExtendCompressedDiscriminatorBytes,Sd as getTransactionBufferExtendCompressedInstruction,bL as getTransactionBufferExtendCompressedInstructionDataCodec,fd as getTransactionBufferExtendCompressedInstructionDataDecoder,Td as getTransactionBufferExtendCompressedInstructionDataEncoder,xL as getTransactionBufferExtendDiscriminatorBytes,pd as getTransactionBufferExtendInstruction,IL as getTransactionBufferExtendInstructionDataCodec,gd as getTransactionBufferExtendInstructionDataDecoder,Ad as getTransactionBufferExtendInstructionDataEncoder,qL as getTransactionBufferVoteCompressedDiscriminatorBytes,vd as getTransactionBufferVoteCompressedInstruction,jL as getTransactionBufferVoteCompressedInstructionDataCodec,_d as getTransactionBufferVoteCompressedInstructionDataDecoder,bd as getTransactionBufferVoteCompressedInstructionDataEncoder,BL as getTransactionBufferVoteDiscriminatorBytes,Pd as getTransactionBufferVoteInstruction,NL as getTransactionBufferVoteInstructionDataCodec,Dd as getTransactionBufferVoteInstructionDataDecoder,Ed as getTransactionBufferVoteInstructionDataEncoder,iO as getTransactionExecuteCompressedDiscriminatorBytes,Gd as getTransactionExecuteCompressedInstruction,dO as getTransactionExecuteCompressedInstructionDataCodec,Fd as getTransactionExecuteCompressedInstructionDataDecoder,Vd as getTransactionExecuteCompressedInstructionDataEncoder,eO as getTransactionExecuteDiscriminatorBytes,Bd as getTransactionExecuteInstruction,tO as getTransactionExecuteInstructionDataCodec,Od as getTransactionExecuteInstructionDataDecoder,Ld as getTransactionExecuteInstructionDataEncoder,MO as getTransactionExecuteSyncCompressedDiscriminatorBytes,tu as getTransactionExecuteSyncCompressedInstruction,hO as getTransactionExecuteSyncCompressedInstructionDataCodec,eu as getTransactionExecuteSyncCompressedInstructionDataDecoder,$d as getTransactionExecuteSyncCompressedInstructionDataEncoder,TO as getTransactionExecuteSyncDiscriminatorBytes,Jd as getTransactionExecuteSyncInstruction,fO as getTransactionExecuteSyncInstructionDataCodec,Yd as getTransactionExecuteSyncInstructionDataDecoder,jd as getTransactionExecuteSyncInstructionDataEncoder,tb as getTransactionMessageAddressTableLookupCodec,ro as getTransactionMessageAddressTableLookupDecoder,to as getTransactionMessageAddressTableLookupEncoder,QR as getTransactionMessageCodec,wt as getTransactionMessageDecoder,Nt as getTransactionMessageEncoder,sb as getTransactionSyncSignersCodec,J as getTransactionSyncSignersDecoder,Y as getTransactionSyncSignersEncoder,ub as getTransferFeeAccountExtensionCodec,vn as getTransferFeeAccountExtensionDecoder,_n as getTransferFeeAccountExtensionEncoder,pb as getTransferHookAccountExtensionCodec,kn as getTransferHookAccountExtensionDecoder,Un as getTransferHookAccountExtensionEncoder,yb as getTransportsCodec,Vt as getTransportsDecoder,Ht as getTransportsEncoder,w as getUserAccountAddress,xb as getUserCodec,Db as getUserCreationArgsCodec,De as getUserCreationArgsDecoder,Ee as getUserCreationArgsEncoder,X as getUserDecoder,Ft as getUserEncoder,Rb as getUserMutArgsCodec,Ye as getUserMutArgsDecoder,je as getUserMutArgsEncoder,Ub as getUserReadOnlyArgsCodec,Rt as getUserReadOnlyArgsDecoder,ht as getUserReadOnlyArgsEncoder,Ob as getUserReadOnlyOrMutateArgsCodec,Ne as getUserReadOnlyOrMutateArgsDecoder,Be as getUserReadOnlyOrMutateArgsEncoder,Vb as getUserRoleCodec,Fe as getUserRoleDecoder,Ve as getUserRoleEncoder,Ow as getWalletAddressFromIndex,Me as getWalletAddressFromSettings,ov as getWhitelistedAddressTreeCodec,Rc as getWhitelistedAddressTreeDecoder,nv as getWhitelistedAddressTreeDiscriminatorBytes,S1 as getWhitelistedAddressTreeEncoder,No as getWhitelistedAddressTreeFromIndex,Pw as getWhitelistedAddressTreeIndexFromAddress,vu as getWhitelistedAddressTreesAddress,uB as identifyMultiWalletAccount,AB as identifyMultiWalletInstruction,iN as initialize,sh as isConfigAction,Eh as isExtensionStruct,fB as isMultiWalletError,ab as isTransactionSyncSigners,Nb as isUserReadOnlyOrMutateArgs,S8 as nativeTransferIntent,Pv as parseAddWhitelistedAddressTreesInstruction,Gv as parseChangeConfigCompressedInstruction,Wv as parseChangeConfigInstruction,$v as parseCreateCompressedWalletInstruction,dU as parseCreateDomainConfigInstruction,SU as parseCreateDomainUserAccountInstruction,RU as parseCreateGlobalCounterInstruction,NU as parseCreateUserAccountsInstruction,jU as parseDecompressSettingsAccountInstruction,tk as parseDisableDomainConfigInstruction,Ak as parseEditDomainConfigInstruction,xk as parseEditTransactionManagerUrlInstruction,bk as parseEditUserDelegateInstruction,Yk as parseNativeTransferIntentCompressedInstruction,wk as parseNativeTransferIntentInstruction,z2 as parseSecp256r1VerifyInstruction,mW as parseTokenTransferIntentCompressedInstruction,oW as parseTokenTransferIntentInstruction,UW as parseTransactionBufferCloseCompressedInstruction,EW as parseTransactionBufferCloseInstruction,ZW as parseTransactionBufferCreateCompressedInstruction,VW as parseTransactionBufferCreateInstruction,mL as parseTransactionBufferExecuteCompressedInstruction,sL as parseTransactionBufferExecuteInstruction,_L as parseTransactionBufferExtendCompressedInstruction,CL as parseTransactionBufferExtendInstruction,YL as parseTransactionBufferVoteCompressedInstruction,wL as parseTransactionBufferVoteInstruction,uO as parseTransactionExecuteCompressedInstruction,rO as parseTransactionExecuteInstruction,RO as parseTransactionExecuteSyncCompressedInstruction,SO as parseTransactionExecuteSyncInstruction,K5 as prepareChangeConfigArgs,$5 as prepareTransactionBundle,g6 as prepareTransactionMessage,T6 as prepareTransactionSync,jw as retrieveTransactionManager,Jw as serializeConfigActions,W8 as tokenTransferIntent,cb as transactionSyncSigners,Bb as userReadOnlyOrMutateArgs,Au as vaultTransactionMessageDeserialize,uu as vaultTransactionMessageSerialize,aA as voteTransactionBuffer};//# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map