@revibase/core 0.4.1 → 0.4.2

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 m from'zod';import {getAssociatedTokenAccountAddress,getTokenDecoder,getTransferSolInstruction}from'gill/programs';import {p256}from'@noble/curves/nist.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {canonicalize}from'json-canonicalize';import {selectMinCompressedTokenAccountsForDecompression}from'@lightprotocol/compressed-token';import EP from'bn.js';import {equalBytes}from'@noble/curves/utils.js';var Jo=new Uint8Array([201,232,212,229,59,241,106,197]);function $P(){return fixEncoderSize(getBytesEncoder(),8).encode(Jo)}function DA(){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:Jo}))}function Zo(){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 eM(){return combineCodec(DA(),Zo())}function Xo(e){return decodeAccount(e,Zo())}async function Qo(e,n,r){let o=await PA(e,n,r);return assertAccountExists(o),o}async function PA(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Xo(o)}async function tM(e,n,r){let o=await MA(e,n,r);return assertAccountsExist(o),o}async function MA(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Xo(t))}function rM(){return 846}var ts=new Uint8Array([42,206,176,58,175,129,130,233]);function sM(){return fixEncoderSize(getBytesEncoder(),8).encode(ts)}function HA(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:ts}))}function rs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function cM(){return combineCodec(HA(),rs())}function ns(e){return decodeAccount(e,rs())}async function aM(e,n,r){let o=await VA(e,n,r);return assertAccountExists(o),o}async function VA(e,n,r){let o=await fetchEncodedAccount(e,n,r);return ns(o)}async function iM(e,n,r){let o=await FA(e,n,r);return assertAccountsExist(o),o}async function FA(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ns(t))}function dM(){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 gM(){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 yM(){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 SM(){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 CM(){return combineCodec(zr(),Kr())}function gt(){return getStructEncoder([["treeInfo",mt()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function pt(){return getStructDecoder([["treeInfo",yt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function MM(){return combineCodec(gt(),pt())}function lt(){return getStructEncoder([["treeInfo",mt()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function Tt(){return getStructDecoder([["treeInfo",yt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function _M(){return combineCodec(lt(),Tt())}function qr(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function jr(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function kM(){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 OM(){return combineCodec(Qr(),$r())}function ft(){return getStructEncoder([["data",getOptionEncoder(en())]])}function j(){return getStructDecoder([["data",getOptionDecoder(tn())]])}function HM(){return combineCodec(ft(),j())}function en(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(St())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function tn(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(xt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function zM(){return combineCodec(en(),tn())}function It(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",nn()],["tlv",getOptionEncoder(getArrayEncoder(rn()))],["state",Nr()]])}function Ct(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",on()],["tlv",getOptionDecoder(getArrayDecoder(Et()))],["state",wr()]])}function YM(){return combineCodec(It(),Ct())}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 QM(){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 rh(){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 ch(){return combineCodec(we(),He())}function ah(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function ih(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 gh(){return combineCodec(Cn(),En())}function fn(){return getStructEncoder([["memberKey",V()],["permissions",Le()]])}function Sn(){return getStructDecoder([["memberKey",Q()],["permissions",Oe()]])}function lh(){return combineCodec(fn(),Sn())}function Dt(){return getStructEncoder([["memberKey",V()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function Pt(){return getStructDecoder([["memberKey",Q()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function xh(){return combineCodec(Dt(),Pt())}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 Et(){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 Dh(){return combineCodec(rn(),Et())}function Ph(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Mh(e,n){return n.__kind===e}function Wn(){return getStructEncoder([["settingsMutArgs",z()],["transactionManager",getOptionEncoder(Mt())]])}function Ln(){return getStructDecoder([["settingsMutArgs",K()],["transactionManager",getOptionDecoder(ht())]])}function _h(){return combineCodec(Wn(),Ln())}function St(){return getStructEncoder([["pubkey",V()],["role",getU8Encoder()],["permissions",Le()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function xt(){return getStructDecoder([["pubkey",Q()],["role",getU8Decoder()],["permissions",Oe()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function Wh(){return combineCodec(St(),xt())}function V(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function Q(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function Bh(){return combineCodec(V(),Q())}function Nn(){return getStructEncoder([["authorityCreationArgs",Ee()],["compressedProofArgs",P()]])}function wn(){return getStructDecoder([["authorityCreationArgs",De()],["compressedProofArgs",M()]])}function Vh(){return combineCodec(Nn(),wn())}function Rt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function bt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function zh(){return combineCodec(Rt(),bt())}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 jh(){return combineCodec(nn(),on())}function mt(){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 Zh(){return combineCodec(mt(),yt())}function Dn(){return getStructEncoder([])}function Pn(){return getStructDecoder([])}function $h(){return combineCodec(Dn(),Pn())}function Mn(){return getStructEncoder([])}function hn(){return getStructDecoder([])}function rR(){return combineCodec(Mn(),hn())}function Le(){return getStructEncoder([["mask",getU8Encoder()]])}function Oe(){return getStructDecoder([["mask",getU8Decoder()]])}function sR(){return combineCodec(Le(),Oe())}function P(){return getStructEncoder([["proof",getOptionEncoder(Qr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function M(){return getStructDecoder([["proof",getOptionDecoder($r())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function dR(){return combineCodec(P(),M())}function xn(){return getStructEncoder([["memberKey",V()],["userArgs",Be()]])}function In(){return getStructDecoder([["memberKey",Q()],["userArgs",Ne()]])}function pR(){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 lR(){return combineCodec(mn(),yn())}function Fn(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function _t(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function SR(){return combineCodec(Fn(),_t())}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 CR(){return combineCodec(F(),G())}function Gn(){return getStructEncoder([["verifyArgs",F()],["domainConfigIndex",getU8Encoder()]])}function zn(){return getStructDecoder([["verifyArgs",G()],["domainConfigIndex",getU8Decoder()]])}function MR(){return combineCodec(Gn(),zn())}function Kn(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function qn(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function bR(){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 UR(){return combineCodec(jn(),Yn())}function z(){return getStructEncoder([["accountMeta",gt()],["data",ft()]])}function K(){return getStructDecoder([["accountMeta",pt()],["data",j()]])}function OR(){return combineCodec(z(),K())}function vt(){return getStructEncoder([["accountMeta",lt()],["data",ft()]])}function Ut(){return getStructDecoder([["accountMeta",Tt()],["data",j()]])}function HR(){return combineCodec(vt(),Ut())}function kt(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function Wt(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function GR(){return combineCodec(kt(),Wt())}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 jR(){return combineCodec(Rn(),bn())}function Lt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(Dt())]])}function Ot(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(Pt())]])}function XR(){return combineCodec(Lt(),Ot())}function Bt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(zr())],["addressTableLookups",getArrayEncoder(to())]])}function Nt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Kr())],["addressTableLookups",getArrayDecoder(ro())]])}function tb(){return combineCodec(Bt(),Nt())}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 ob(){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 ib(){return combineCodec(Y(),J())}function db(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function ub(e,n){return n.__kind===e}function _n(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function vn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function pb(){return combineCodec(_n(),vn())}function Un(){return getStructEncoder([["transferring",getU8Encoder()]])}function kn(){return getStructDecoder([["transferring",getU8Decoder()]])}function lb(){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 wt(){return getEnumEncoder(no)}function Ht(){return getEnumDecoder(no)}function Sb(){return combineCodec(wt(),Ht())}function Vt(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",V()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(wt()))],["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(Ht()))],["wallets",getArrayDecoder(Yn())],["role",Fe()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function Eb(){return combineCodec(Vt(),X())}function Ee(){return getStructEncoder([["addressTreeInfo",Rt()],["outputStateTreeIndex",getU8Encoder()]])}function De(){return getStructDecoder([["addressTreeInfo",bt()],["outputStateTreeIndex",getU8Decoder()]])}function hb(){return combineCodec(Ee(),De())}function je(){return getStructEncoder([["accountMeta",gt()],["data",Vt()]])}function Ye(){return getStructDecoder([["accountMeta",pt()],["data",X()]])}function vb(){return combineCodec(je(),Ye())}function Mt(){return getStructEncoder([["accountMeta",lt()],["data",Vt()]])}function ht(){return getStructDecoder([["accountMeta",Tt()],["data",X()]])}function Lb(){return combineCodec(Mt(),ht())}function Be(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Mt()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([je()])]])]])}function Ne(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([ht()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([Ye()])]])]])}function wb(){return combineCodec(Be(),Ne())}function Hb(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Vb(e,n){return n.__kind===e}var he=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(he||{});function Ve(){return getEnumEncoder(he)}function Fe(){return getEnumDecoder(he)}function zb(){return combineCodec(Ve(),Fe())}var mc=new Uint8Array([223,179,163,190,177,224,67,173]);function Y_(){return fixEncoderSize(getBytesEncoder(),8).encode(mc)}function kT(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(St())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:mc}))}function gr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(xt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function J_(){return combineCodec(kT(),gr())}function yc(e){return decodeAccount(e,gr())}async function Z_(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 X_(e,n,r){let o=await WT(e,n,r);return assertAccountsExist(o),o}async function WT(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>yc(t))}var xc=new Uint8Array([90,36,35,219,93,225,110,96]);function tv(){return fixEncoderSize(getBytesEncoder(),8).encode(xc)}function QT(){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(Dt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:xc}))}function Ic(){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(Pt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function rv(){return combineCodec(QT(),Ic())}function Cc(e){return decodeAccount(e,Ic())}async function Ec(e,n,r){let o=await $T(e,n,r);return assertAccountExists(o),o}async function $T(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Cc(o)}async function nv(e,n,r){let o=await e1(e,n,r);return assertAccountsExist(o),o}async function e1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Cc(t))}var Mc=new Uint8Array([105,23,173,2,197,255,80,87]);function cv(){return fixEncoderSize(getBytesEncoder(),8).encode(Mc)}function f1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Mc}))}function hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function av(){return combineCodec(f1(),hc())}function Rc(e){return decodeAccount(e,hc())}async function bc(e,n,r){let o=await S1(e,n,r);return assertAccountExists(o),o}async function S1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Rc(o)}async function iv(e,n,r){let o=await x1(e,n,r);return assertAccountsExist(o),o}async function x1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Rc(t))}function y({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 B(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function l(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let o=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:B(r.value),role:_c(r.value)?upgradeRoleToSigner(o):o,..._c(r.value)?{signer:r.value}:{}})}}function _c(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Uc=new Uint8Array([8]);function Pv(){return fixEncoderSize(getBytesEncoder(),1).encode(Uc)}function po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Uc}))}function kc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function Mv(){return combineCodec(po(),kc())}async function Wc(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:po().encode(c),programAddress:r})}function hv(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:po().encode(c),programAddress:r})}function Rv(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:kc().decode(e.data)}}var wc=new Uint8Array([9]);function Lv(){return fixEncoderSize(getBytesEncoder(),1).encode(wc)}function Hc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(we())],["signers",getArrayEncoder(Y())],["compressedProofArgs",getOptionEncoder(P())]]),e=>({...e,discriminator:wc}))}function Vc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(He())],["signers",getArrayDecoder(J())],["compressedProofArgs",getOptionDecoder(M())]])}function Ov(){return combineCodec(Hc(),Vc())}function Fc(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Hc().encode(c),programAddress:r})}function Bv(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:Vc().decode(e.data)}}var jc=new Uint8Array([19]);function zv(){return fixEncoderSize(getBytesEncoder(),1).encode(jc)}function Yc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(we())],["signers",getArrayEncoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:jc}))}function Jc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(He())],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function Kv(){return combineCodec(Yc(),Jc())}function Zc(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Yc().encode(c),programAddress:r})}function qv(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:Jc().decode(e.data)}}var $c=new Uint8Array([18]);function $v(){return fixEncoderSize(getBytesEncoder(),1).encode($c)}function mo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["addressTreeInfo",Rt()],["outputStateTreeIndex",getU8Encoder()],["userArgs",Be()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:$c}))}function ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["addressTreeInfo",bt()],["outputStateTreeIndex",getU8Decoder()],["userArgs",Ne()],["settingsIndex",getU128Decoder()]])}function eU(){return combineCodec(mo(),ea())}async function ta(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:mo().encode(c),programAddress:r})}function tU(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:mo().encode(c),programAddress:r})}function rU(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:ea().decode(e.data)}}var da=new Uint8Array([0]);function dU(){return fixEncoderSize(getBytesEncoder(),1).encode(da)}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:da}))}function ua(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",De()],["compressedProofArgs",M()]])}function uU(){return combineCodec(lo(),ua())}async function Aa(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data: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=y(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:lo().encode(c),programAddress:r})}function gU(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:ua().decode(e.data)}}var ma=new Uint8Array([4]);function SU(){return fixEncoderSize(getBytesEncoder(),1).encode(ma)}function To(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["member",Fn()],["role",Ve()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(wt())],["userAccountCreationArgs",Ee()],["linkWalletArgs",getOptionEncoder(Wn())]]),e=>({...e,discriminator:ma}))}function ya(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["member",_t()],["role",Fe()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Ht())],["userAccountCreationArgs",De()],["linkWalletArgs",getOptionDecoder(Ln())]])}function xU(){return combineCodec(To(),ya())}async function la(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=y(i),s=l(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 IU(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=y({args:c}),s=l(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 CU(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 fa=new Uint8Array([3]);function RU(){return fixEncoderSize(getBytesEncoder(),1).encode(fa)}function So(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:fa}))}function Sa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function bU(){return combineCodec(So(),Sa())}async function xa(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=y(c),a=l(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:So().encode({}),programAddress:r})}function _U(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=y(c),a=l(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:So().encode({}),programAddress:r})}function vU(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:Sa().decode(e.data)}}var Ca=new Uint8Array([5]);function NU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ca)}function Io(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["createUserArgs",getArrayEncoder(Cn())]]),e=>({...e,discriminator:Ca}))}function Ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayDecoder(En())]])}function wU(){return combineCodec(Io(),Ea())}async function Da(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Io().encode(c),programAddress:r})}function HU(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Io().encode(c),programAddress:r})}function VU(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:Ea().decode(e.data)}}var ha=new Uint8Array([17]);function YU(){return fixEncoderSize(getBytesEncoder(),1).encode(ha)}function Ra(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",z()],["compressedProofArgs",P()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:ha}))}function ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",K()],["compressedProofArgs",M()],["signers",getArrayDecoder(J())]])}function JU(){return combineCodec(Ra(),ba())}function _a(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Ra().encode(c),programAddress:r})}function ZU(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:ba().decode(e.data)}}var ka=new Uint8Array([2]);function rk(){return fixEncoderSize(getBytesEncoder(),1).encode(ka)}function Wa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:ka}))}function La(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function nk(){return combineCodec(Wa(),La())}function Oa(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=y({args:c}),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.admin),...a],data:Wa().encode(c),programAddress:r})}function ok(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:La().decode(e.data)}}var Ha=new Uint8Array([1]);function Ak(){return fixEncoderSize(getBytesEncoder(),1).encode(Ha)}function Eo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Nn())]]),e=>({...e,discriminator:Ha}))}function Va(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(wn())]])}function gk(){return combineCodec(Eo(),Va())}async function pk(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Eo().encode(c),programAddress:r})}function Fa(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Eo().encode(c),programAddress:r})}function mk(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:Va().decode(e.data)}}var Ka=new Uint8Array([6]);function Ik(){return fixEncoderSize(getBytesEncoder(),1).encode(Ka)}function qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",je()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",P()]]),e=>({...e,discriminator:Ka}))}function ja(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ye()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",M()]])}function Ck(){return combineCodec(qa(),ja())}function Ya(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=y({args:c}),s=l(r);return Object.freeze({accounts:[s(t.authority),...a],data:qa().encode(c),programAddress:r})}function Ek(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:ja().decode(e.data)}}var Xa=new Uint8Array([7]);function _k(){return fixEncoderSize(getBytesEncoder(),1).encode(Xa)}function Qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",je()],["secp256r1VerifyArgs",getOptionEncoder(F())],["delegateTo",getOptionEncoder(Kn())],["oldSettingsMutArgs",getOptionEncoder(z())],["newSettingsMutArgs",getOptionEncoder(z())],["compressedProofArgs",P()]]),e=>({...e,discriminator:Xa}))}function $a(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ye()],["secp256r1VerifyArgs",getOptionDecoder(G())],["delegateTo",getOptionDecoder(qn())],["oldSettingsMutArgs",getOptionDecoder(K())],["newSettingsMutArgs",getOptionDecoder(K())],["compressedProofArgs",M()]])}function vk(){return combineCodec(Qa(),$a())}function ei(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=l(r);return Object.freeze({accounts:[s(t.feePayer),s(t.signer),s(t.oldSettings),s(t.newSettings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.domainConfig),...a],data:Qa().encode(c),programAddress:r})}function Uk(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:$a().decode(e.data)}}var ri=new Uint8Array([29]);function wk(){return fixEncoderSize(getBytesEncoder(),1).encode(ri)}function Do(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:ri}))}function ni(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())]])}function Hk(){return combineCodec(Do(),ni())}async function Vk(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(B(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Do().encode(c),programAddress:r})}function oi(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Do().encode(c),programAddress:r})}function Fk(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:ni().decode(e.data)}}var ai=new Uint8Array([27]);function Jk(){return fixEncoderSize(getBytesEncoder(),1).encode(ai)}function ii(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:ai}))}function di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function Zk(){return combineCodec(ii(),di())}function ui(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:ii().encode(c),programAddress:r})}function Xk(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:di().decode(e.data)}}var li=new Uint8Array([30]);function oW(){return fixEncoderSize(getBytesEncoder(),1).encode(li)}function Po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(kt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(It())],["compressedProofArgs",getOptionEncoder(P())],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:li}))}function Ti(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Wt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Ct())],["compressedProofArgs",getOptionDecoder(M())],["signers",getArrayDecoder(J())]])}function sW(){return combineCodec(Po(),Ti())}async function cW(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(B(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(B(t.source.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(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(B(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(B(t.destination.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(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(B(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Po().encode(c),programAddress:r})}function fi(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Po().encode(c),programAddress:r})}function aW(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:Ti().decode(e.data)}}var Ci=new Uint8Array([28]);function mW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ci)}function Mo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(kt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(It())],["signers",getArrayEncoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Ci}))}function Ei(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Wt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Ct())],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function yW(){return combineCodec(Mo(),Ei())}async function lW(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(B(t.source.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(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(B(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(B(t.destination.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(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(B(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Mo().encode(c),programAddress:r})}function Di(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Mo().encode(c),programAddress:r})}function TW(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:Ei().decode(e.data)}}var hi=new Uint8Array([13]);function DW(){return fixEncoderSize(getBytesEncoder(),1).encode(hi)}function Ri(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:hi}))}function bi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function PW(){return combineCodec(Ri(),bi())}function _i(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Ri().encode(c),programAddress:r})}function MW(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:bi().decode(e.data)}}var ki=new Uint8Array([23]);function kW(){return fixEncoderSize(getBytesEncoder(),1).encode(ki)}function Wi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:ki}))}function Li(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function WW(){return combineCodec(Wi(),Li())}function Oi(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.rentCollector),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Wi().encode(c),programAddress:r})}function LW(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:Li().decode(e.data)}}var wi=new Uint8Array([10]);function FW(){return fixEncoderSize(getBytesEncoder(),1).encode(wi)}function Hi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Lt()],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:wi}))}function Vi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Ot()],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function GW(){return combineCodec(Hi(),Vi())}function Fi(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:Hi().encode(c),programAddress:r})}function zW(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:Vi().decode(e.data)}}var Ki=new Uint8Array([20]);function XW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ki)}function qi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Lt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",vt()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Ki}))}function ji(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Ot()],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",M()]])}function QW(){return combineCodec(qi(),ji())}function Yi(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:qi().encode(c),programAddress:r})}function $W(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:ji().decode(e.data)}}var Xi=new Uint8Array([14]);function cL(){return fixEncoderSize(getBytesEncoder(),1).encode(Xi)}function Qi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Xi}))}function $i(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function aL(){return combineCodec(Qi(),$i())}function ed(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Qi().encode(c),programAddress:r})}function iL(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},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:$i().decode(e.data)}}var nd=new Uint8Array([24]);function yL(){return fixEncoderSize(getBytesEncoder(),1).encode(nd)}function od(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:nd}))}function sd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function lL(){return combineCodec(od(),sd())}function cd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:od().encode(c),programAddress:r})}function TL(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:sd().decode(e.data)}}var dd=new Uint8Array([12]);function EL(){return fixEncoderSize(getBytesEncoder(),1).encode(dd)}function ud(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:dd}))}function Ad(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function DL(){return combineCodec(ud(),Ad())}function gd(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=y({args:c}),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.transactionBuffer),...a],data:ud().encode(c),programAddress:r})}function PL(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:Ad().decode(e.data)}}var yd=new Uint8Array([22]);function vL(){return fixEncoderSize(getBytesEncoder(),1).encode(yd)}function ld(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:yd}))}function Td(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function UL(){return combineCodec(ld(),Td())}function fd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=y({args:c}),s=l(r);return Object.freeze({accounts:[s(t.transactionBuffer),...a],data:ld().encode(c),programAddress:r})}function kL(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:Td().decode(e.data)}}var Id=new Uint8Array([11]);function HL(){return fixEncoderSize(getBytesEncoder(),1).encode(Id)}function Cd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Id}))}function Ed(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function VL(){return combineCodec(Cd(),Ed())}function Dd(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Cd().encode(c),programAddress:r})}function FL(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:Ed().decode(e.data)}}var hd=new Uint8Array([21]);function JL(){return fixEncoderSize(getBytesEncoder(),1).encode(hd)}function Rd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",vt()],["compressedProofArgs",P()]]),e=>({...e,discriminator:hd}))}function bd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",M()]])}function ZL(){return combineCodec(Rd(),bd())}function _d(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Rd().encode(c),programAddress:r})}function XL(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:bd().decode(e.data)}}var kd=new Uint8Array([15]);function nO(){return fixEncoderSize(getBytesEncoder(),1).encode(kd)}function Wd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:kd}))}function Ld(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function oO(){return combineCodec(Wd(),Ld())}function Od(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=y({}),a=l(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:Wd().encode({}),programAddress:r})}function sO(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:Ld().decode(e.data)}}var wd=new Uint8Array([25]);function AO(){return fixEncoderSize(getBytesEncoder(),1).encode(wd)}function Hd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:wd}))}function Vd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function gO(){return combineCodec(Hd(),Vd())}function Fd(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=y({args:c}),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.transactionBuffer),...a],data:Hd().encode(c),programAddress:r})}function pO(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:Vd().decode(e.data)}}var Kd=new Uint8Array([16]);function xO(){return fixEncoderSize(getBytesEncoder(),1).encode(Kd)}function qd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Bt()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:Kd}))}function jd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Nt()],["signers",getArrayDecoder(J())]])}function IO(){return combineCodec(qd(),jd())}function Yd(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:qd().encode(c),programAddress:r})}function CO(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:jd().decode(e.data)}}var Xd=new Uint8Array([26]);function bO(){return fixEncoderSize(getBytesEncoder(),1).encode(Xd)}function Qd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Bt()],["signers",getArrayEncoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Xd}))}function $d(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Nt()],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function _O(){return combineCodec(Qd(),$d())}function eu(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Qd().encode(c),programAddress:r})}function vO(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:$d().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",bC=(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))(bC||{});function pB(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 _C=(T=>(T[T.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",T[T.ChangeConfig=1]="ChangeConfig",T[T.ChangeConfigCompressed=2]="ChangeConfigCompressed",T[T.CreateCompressedWallet=3]="CreateCompressedWallet",T[T.CreateDomainConfig=4]="CreateDomainConfig",T[T.CreateDomainUserAccount=5]="CreateDomainUserAccount",T[T.CreateGlobalCounter=6]="CreateGlobalCounter",T[T.CreateUserAccounts=7]="CreateUserAccounts",T[T.DecompressSettingsAccount=8]="DecompressSettingsAccount",T[T.DisableDomainConfig=9]="DisableDomainConfig",T[T.EditDomainConfig=10]="EditDomainConfig",T[T.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",T[T.EditUserDelegate=12]="EditUserDelegate",T[T.NativeTransferIntent=13]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=14]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=15]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=16]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=17]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=18]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=19]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=20]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=21]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=22]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=23]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=24]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=25]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=26]="TransactionBufferVoteCompressed",T[T.TransactionExecute=27]="TransactionExecute",T[T.TransactionExecuteCompressed=28]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=29]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=30]="TransactionExecuteSyncCompressed",T))(_C||{});function mB(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 UC=6e3,kC=6001,WC=6002,LC=6003,OC=6004,BC=6005,NC=6006,wC=6007,HC=6008,VC=6009,FC=6010,GC=6011,zC=6012,KC=6013,qC=6014,jC=6015,YC=6016,JC=6017,ZC=6018,XC=6019,QC=6020,$C=6021,eE=6022,tE=6023,rE=6024,nE=6025,oE=6026,sE=6027,cE=6028,aE=6029,iE=6030,dE=6031,uE=6032,AE=6033,gE=6034,pE=6035,mE=6036,yE=6037,lE=6038,TE=6039,fE=6040,SE=6041,xE=6042,IE=6043,CE=6044,EE=6045,DE=6046,PE=6047,ME=6048,hE=6049,RE=6050,bE=6051,_E=6052,vE=6053,UE=6054,kE=6055,WE=6056,LE=6057,OE=6058,BE=6059,NE=6060,wE=6061,HE=6062,VE=6063,FE=6064,GE=6065,zE=6066,KE=6067,qE=6068,jE=6069,YE=6070,JE=6071,ZE=6072,XE=6073,QE=6074,$E=6075,eD=6076,tD=6077,rD=6078,nD=6079,oD=6080,sD=6081,cD=6082,aD=6083,iD=6084,dD=6085,uD=6086,tu;process.env.NODE_ENV!=="production"&&(tu={[dE]:"This member is already delegated to another wallet.",[wC]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[tD]:"Clock sysvar access failed. This may indicate a system error.",[bE]:"Missing credential id.",[vE]:"The domain configuration account is disabled. Please contact support or try again later.",[UE]:"Missing domain configuration account.",[$E]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[uD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[FC]:"Duplicate public keys detected among members. Each member must have a unique key.",[VC]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[$C]:"No members provided. A multisig wallet must contain at least one member.",[NE]:"Slot numbers list is empty. At least one slot number is required for validation.",[ZC]:"Expected a User with Administrator role for this instruction.",[HC]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[YC]:"Expected a User with Transaction Manager role for this instruction.",[fE]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[SE]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[xE]:"Declared buffer size does not match the actual serialized size.",[BE]:"Failed to compute hash. This may indicate a system error.",[gE]:"Not enough members with vote permission to meet the approval threshold.",[uE]:"At least one signer with execute permission is required to proceed.",[AE]:"At least one signer with initiate permission is required to perform this action.",[oE]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[QE]:"Invalid account index in transaction message. The account index is out of bounds.",[LE]:"Address Tree supplied is not part of the whitelisted address trees.",[XC]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[cE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[TE]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[wE]:"Member key conversion failed. The provided key format is invalid.",[pE]:"Only delegated members are allowed for this transaction.",[nE]:"Unexpected number of accounts provided for this instruction.",[KC]:"User with Permanent Member role must have a delegated wallet.",[kC]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[OC]:"The extracted public key has an invalid length or encoding.",[UC]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[LC]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[RE]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[ME]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[tE]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[JE]:"Invalid source type for token transfer. The source account type is not supported.",[JC]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[jC]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[rE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[oD]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[sE]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[nD]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[YE]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[BC]:"The extracted WebAuthn signed message payload is malformed.",[DE]:"An input string exceeds the maximum allowed character length.",[kE]:"This member is not registered under the provided domain configuration.",[FE]:"Member not found in settings. Cannot remove a member that does not exist.",[XE]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[aE]:"A required account is missing from the instruction context.",[HE]:"Compressed proof arguments are missing. Required for compressed account operations.",[KE]:"Missing compressed token account. Required for token transfer operations.",[sD]:"Missing destination token account. Required for token transfer operations.",[jE]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[VE]:"Light CPI accounts are missing. Required for compressed account operations.",[iE]:"User mutation arguments are required when performing add or remove delegate operations.",[iD]:"Missing new authority account. Required for domain configuration updates.",[aD]:"Missing settings account. Required for delegate operations on compressed wallets.",[OE]:"Compressed settings data is missing. The settings account must be initialized with data.",[cD]:"Missing source token account. Required for token transfer operations.",[qE]:"Missing SPL interface PDA. Required for token transfer operations.",[PE]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[eD]:"User account address is missing. Required for secp256r1 signature verification.",[dD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[yE]:"No valid signer found in this transaction.",[QC]:"Only one administrator is allowed per wallet.",[zC]:"Only one permanent member is allowed per wallet.",[qC]:"Only one transaction manager is allowed per wallet.",[WE]:"The given origin index is not in the whitelisted origins.",[zE]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[GC]:"Permanent members cannot be removed from a wallet.",[EE]:"Writable CPI calls to protected accounts are not permitted.",[NC]:"The rpIdHash extracted from the signed message does not match the expected value.",[GE]:"Settings key mismatch. The provided settings key does not match the expected value.",[WC]:"The signature index provided is out of bounds for the secp256r1 instruction.",[hE]:"The specified slot number was not found in the provided slot history.",[ZE]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[eE]:"Too many members: a maximum of 4 members are supported.",[IE]:"This transaction has expired. It must be executed within 3 minutes of approval.",[CE]:"This transaction has not yet reached the required approval threshold.",[_E]:"Missing transports.",[lE]:"Only the transaction creator or rent payer may close this transaction buffer.",[rD]:"Unauthorized: Only the admin account is allowed to perform this action.",[mE]:"Member is not part of the expected signers for this transaction."});function xB(e){return process.env.NODE_ENV!=="production"?tu[e]:"Error message not available in production bundles."}function IB(e,n,r){return isProgramError(e,n,A,r)}async function UB({admin:e,addressTree:n}){return Wc({payer:e,addressTree:n,remainingAccounts:[]})}var Re=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 Re{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},$=class extends Re{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},v=class extends Re{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},ot=class extends Re{constructor(r,o,t){super(r,"NETWORK_ERROR",{statusCode:o,url:t});this.statusCode=o;this.url=t;}},Cr=class extends Re{constructor(r,o,t){super(`Operation "${r}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=o;this.lastError=t;}},Er=class extends Re{constructor(r,o,t){super(r,"PERMISSION_ERROR",{required:o,actual:t});this.required=o;this.actual=t;}};var zt={Ed25519:1,Secp256r1:2};var AD=m.looseObject({publicKey:m.string(),walletAddress:m.string(),settingsIndexWithAddress:m.object({index:m.union([m.number(),m.bigint()]),settingsAddressTreeIndex:m.number()}),username:m.string().optional(),profilePictureUrl:m.string().optional()}),ru=m.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),wB=m.object({transactionActionType:ru,transactionAddress:m.string(),transactionMessageBytes:m.array(m.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),gD=m.object({transactionActionType:ru,transactionAddress:m.string(),transactionMessageBytes:m.base64()}).strict(),pD=m.union([m.object({type:m.literal("Ephemeral"),secretKey:m.string()}),m.object({type:m.literal("Default"),publickey:m.string(),endpoint:m.string()})]).array().optional(),nu=m.object({phase:m.literal("start"),redirectOrigin:m.url(),signer:m.string().optional(),rid:m.string(),validTill:m.number(),data:m.object({type:m.literal("message"),payload:m.string(),trustedDeviceCheck:m.boolean()}).strict()}).strict(),ou=m.object({phase:m.literal("start"),redirectOrigin:m.url(),signer:m.string().optional(),rid:m.string(),validTill:m.number(),data:m.object({type:m.literal("transaction"),payload:gD,sendTx:m.boolean(),additionalSigners:pD}).strict()}).strict(),su=m.object({startRequest:m.union([nu,ou]),authResponse:m.custom(),client:m.object({clientOrigin:m.url(),jws:m.string()}).strict(),device:m.object({jwk:m.base64(),jws:m.string()}).strict()}).strict(),cu=m.object({signer:m.string(),userAddressTreeIndex:m.number().optional(),additionalInfo:m.looseObject({}).optional()}).strict(),mD=m.object({slotHash:m.string(),slotNumber:m.string(),estimatedSlotHashExpiry:m.number(),originIndex:m.number(),crossOrigin:m.boolean()}).strict(),HB=m.object({phase:m.literal("complete"),data:m.object({type:m.literal("message"),payload:cu.extend(su.shape).extend({id:m.string().optional(),client:m.object({clientOrigin:m.url()}).strict()})}).strict()}).strict(),VB=m.object({phase:m.literal("complete"),data:m.object({type:m.literal("transaction"),payload:cu.extend(su.shape).extend(mD.shape).extend({client:m.object({clientOrigin:m.url()}).strict()})}).strict()}).strict(),FB=m.object({phase:m.literal("complete"),data:m.object({type:m.literal("transaction"),payload:m.object({startRequest:m.union([ou,nu]),txSig:m.string(),user:AD})}).strict()}).strict();var Pe={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},be=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,o)=>r|o,0))}static all(){return new e(Object.values(Pe).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var bo=33,_e=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 _e{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 iu=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(TD())],["addressTableLookups",getArrayCodec(fD())]]);function du(e){return iu.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 uu(e){let n=iu.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 dN(){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 uN(){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;}var vo=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"];function PN(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Pr(n.get(-2))),y:BigInt("0x"+Pr(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=yu(c),a=Tu(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:Uo(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 Uo(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 ko(e.data.payload.authResponse)}function _N(e,n,r,o){let t=Uo(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){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=Uo(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 ko(e){let n=Mr(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 Qo(se(),e),t=lu(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)))}function Pr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function hD(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 yu(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 lu(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 Tu(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 D=n&127;r+=D;}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,f=BigInt("0x"+Pr(u)),C=(f>g?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=hD(C);return new Uint8Array([...p,...x])}function Mr(e){let n=pe(e.response.clientDataJSON),r=pe(e.response.authenticatorData),o=sha256(n);return new Uint8Array([...r,...o])}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?Mr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:o,signature:c,message:i,publicKey:a}}function Ue(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 le(e){if(e instanceof _e)return {keyType:zt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:zt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function xu(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(xu(t))||(r.push(t),n.add(xu(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 Iu({payer:e,tipAmount:n}){let r=vo[Math.floor(Math.random()*vo.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function Cu(e,n,r,o){if(e<n||e>r)throw new v(`${o} must be between ${n} and ${r} (inclusive), got ${e}`)}function Eu(e,n){if(e<0)throw new v(`${n} must be non-negative, got ${e}`)}function Du(e){return typeof e=="string"?e:e.toString()}function Pu(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 Mu(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=Du(e);return Wo(n,r,()=>ye().getCompressedAccount(e))}async function Xe(e,n){let r=Pu(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 W(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function Te(e,n,r,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 fe(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 Mu(()=>ye().getValidityProofV0(e,n))}async function Se(){return (await Rr()).length-1}var Lo;async function Rr(){if(!Lo){let{data:e}=await bc(se(),await _u());Lo=e.whitelistedAddressTrees;}return Lo}function bu(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 Pw(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(le(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 Mw(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(le(e)))}}]}),se().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(V().encode(le(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 xe(t.index),t.settingsAddressTreeIndex,r)))}async function No(e){Eu(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 hw(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 _e?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 Lu(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function _u(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Ou(e,n,r){Cu(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 _e?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 xe(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function Nw(e){let n=await xe(e);return await Me(n)}async function ww(){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=>wu(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=be.has(o,Pe.InitiateTransaction),c=be.has(o,Pe.VoteTransaction),i=be.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(wu(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",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 f;try{f=JSON.parse(g.data);}catch{return}let S=typeof f.event=="string"?f.event:"message",C=f.data;try{r(S,C)&&a(()=>o());}catch(x){a(()=>t(x));}},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 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 Zw(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:f}=d,S=rP(r),C=JSON.stringify({publicKey:n.toString(),payload:g.map(x=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(x)),transactionMessageBytes:t?getBase64Decoder().decode(t):void 0,authResponses:o}))});for(let x=0;x<u;x++){if(f.aborted)throw wo();let D,E;try{E=await nP(S,f),E.send(C),await oP(E,f,(I,_)=>{if(I==="error"){let k=_&&typeof _=="object"&&typeof _.error=="string"?_.error:"Unknown error",q=new Error(k);throw q.noRetry=!0,q}return I==="signatures"?(D=_.signatures,!0):(I==="pending_transaction_approval"?c?.(_.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(D?.length)return D.map(I=>({[n]:getBase58Encoder().encode(I)}));x<u-1&&await sP(p,f);}throw new ot("Transaction manager: missing signatures")}}}function wu(e){return e.keyType===zt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function Xw(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 Qw(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 p2({payer:e,rpId:n,origins:r,authority:o}){let t=await ct({rpId:n}),c=new N;await c.addSystemAccounts();let i=await Se(),{address:a,addressTree:s}=await w(o.address,i),d=[{address:a,tree:s,queue:s,type:"User"}],u=await Z([],d),p=(await Te(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:g,systemOffset:f}=c.toAccountMetas(),S=W(u,f);return await Aa({origins:r,authorityCreationArgs:p,authority:o,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:g})}async function D2({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 Se(),{address:d,addressTree:u}=await w(r.member,s),p=[{address:d,type:"User",tree:u,queue:u}],g=await Z(a,p),f=null,S=null,C=a.filter(k=>k.type==="Settings"),x=a.filter(k=>k.type==="User");if(x.length&&(S=te(c,g.treeInfos.slice(0,1),g.leafIndices.slice(0,1),g.rootIndices.slice(0,1),g.proveByIndices.slice(0,1),x,X())[0]),C.length){let k=x.length,q=k+1;f=te(c,g.treeInfos.slice(k,q),g.leafIndices.slice(k,q),g.rootIndices.slice(k,q),g.proveByIndices.slice(k,q),C,j())[0];}let D=(await Te(c,g.treeInfos.slice(a.length),g.roots.slice(a.length),g.rootIndices.slice(a.length),p))[0],{remainingAccounts:E,systemOffset:I}=c.toAccountMetas(),_=W(g,I);return await la({payer:n,authority:e,compressedProofArgs:_,member:_t().decode(r.member.toBuffer()),credentialId:pe(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:f?some({settingsMutArgs:f,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:D,domainConfig:o,remainingAccounts:E})}async function R2({payer:e}){let n=await Lu();return xa({payer:e,globalCounter:n})}async function U2({admin:e,rpId:n,disable:r}){let o=await ct({rpId:n});return Oa({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=uu(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,lP=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 Ku(){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,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 qu(){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 K2(){return combineCodec(qu(),Ku())}function H(e,n){let r=e.length,o=lP+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??TP,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:qu().encode(i)}}function q2(e){return {programAddress:e.programAddress,accounts:{},data:Ku().decode(e.data)}}async function ju({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?Fd({transactionBuffer:n,payer:o.address,remainingAccounts:u,settingsKey:e}):Od({transactionBuffer:n,payer:o.address,settings:e})),a&&g.push(Iu({payer:o,tipAmount:a})),{instructions:g,addressLookupTableAccounts:p}}async function Yu({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:f,addressLookupTableAccounts:S,transactionMessage:C},{settingsMutArgs:x,proof:D,packedAccounts:E}]=await Promise.all([_r({transactionMessageBytes:r,walletAddress:g,additionalSigners:o,addressesByLookupTableAddress:i}),fe(s,e,n,d,u)]);E.addPreAccounts(f);let{secp256r1VerifyInput:I,transactionSyncSigners:_}=Ue(p,E,a),{remainingAccounts:k,systemOffset:q}=E.toAccountMetas(),ne=[];I.length>0&&ne.push(H(I));let Ie=xP(C,f);if(s){if(!c||!x)throw new v("Payer not found or proof args are missing for executeTransactionSync.");let Ce=W(D,q);ne.push(eu({signers:_,transactionMessage:Ie,settingsMutArgs:x,compressedProofArgs:Ce,payer:c,remainingAccounts:k}));}else ne.push(Yd({signers:_,settings:e,transactionMessage:Ie,remainingAccounts:k}));return {instructions:ne,addressLookupTableAccounts:S}}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 I8({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:f}]=await Promise.all([fe(a,e,n,false,t),Xe(d,t)]);if((f?.lamports??0)<BigInt(c))throw new v("Insufficient balance for native transfer.");let{secp256r1VerifyInput:S,transactionSyncSigners:C}=Ue(s,u),{remainingAccounts:x,systemOffset:D}=u.toAccountMetas(),E=[];if(S.length>0&&E.push(H(S)),a){if(!i||!g)throw new Error("Payer not found or proof args is missing.");let I=W(p,D);E.push(ui({amount:c,settingsMutArgs:g,compressedProofArgs:I,payer:i,signers:C,source:d,destination:r,remainingAccounts:x}));}else E.push(oi({amount:c,signers:C,source:d,destination:r,settings:e,remainingAccounts:x}));return E}var bP=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),_P=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Ur=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function N8({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,useDestinationSplAccount:p=false}){let g=de(t),f=await Me(e),S=await vP(o,r,f,s,d),[C,x]=await Promise.all([UP(S,c),HP(u,e,n,c)]),D=kP(C,S,i,p),[E,I]=await Promise.all([wP(f,o,D.splBalance,D.cTokenBalance,BigInt(i),u),NP(D.requireSplInterface,S.splInterfacePda,c)]),_=BigInt(E.reduce((We,jo)=>We+(jo.parsed.amount.toNumber()??0),0));if(D.splBalance+D.cTokenBalance+_<BigInt(i))throw new v("Insufficient balance for token transfer.");let k=new N;I&&k.addPreAccounts([{address:o,role:AccountRole.WRITABLE}]);let q=WP(E,x),{proof:ne,settingsMutArgs:Ie}=await LP(k,q,x),Ce=OP(E,ne,k),{secp256r1VerifyInput:tt,transactionSyncSigners:ke}=Ue(g,k),{remainingAccounts:Ae,systemOffset:rt}=k.toAccountMetas(),Or=W(ne,rt),T=[];tt.length>0&&T.push(H(tt));let Jt=BP({amount:i,transactionSyncSigners:ke,walletAddress:f,destination:r,addresses:S,balances:D,mint:o,tokenProgram:s,remainingAccounts:Ae,payer:a,sourceCompressedTokenAccounts:Ce,compressedProofArgs:Or,splInterfacePdaArgs:d});if(u){if(!Ie)throw new Error("Payer not found or proof args is missing.");T.push(Di({...Jt,settingsMutArgs:Ie}));}else T.push(fi({...Jt,settings:e}));return T}async function vP(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 UP(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 kP(e,n,r,o){let t=!!e.destinationSplAtaInfo.value,c=!!e.sourceSplAtaInfo.value,i=!!e.sourceCTokenAtaInfo.value,a=c?getTokenDecoder().decode(getBase64Encoder().encode(e.sourceSplAtaInfo.value.data[0])).amount:BigInt(0),s=BigInt(i?VP(getBase64Encoder().encode(e.sourceCTokenAtaInfo.value.data[0]))?.amount??0:0),d=t||o?n.destinationSplAta:void 0,u=t||o?void 0:n.destinationCTokenAta,p=c&&(a+s<BigInt(r)||s>BigInt(0)||!t)||!c&&t;return {splBalance:a,cTokenBalance:s,destinationSplTokenAccount:d,destinationCtokenTokenAccount:u,requireSplInterface:p,requireRentSponsor:a+s<BigInt(r)||!t}}function WP(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 LP(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 OP(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:bu(o.compressedAccount.data?.discriminator),tlv:o.parsed.tlv?some(getArrayDecoder(Et()).decode(o.parsed.tlv)):none(),state:o.parsed.state}))}function BP({amount:e,transactionSyncSigners:n,walletAddress:r,destination:o,addresses:t,balances:c,mint:i,tokenProgram:a,remainingAccounts:s,payer:d,sourceCompressedTokenAccounts:u,compressedProofArgs:p,splInterfacePdaArgs:g}){return {amount:e,signers:n,source:r,destination:o,sourceCtokenTokenAccount:t.sourceCtokenAta,sourceSplTokenAccount:t.sourceSplAta,destinationCtokenTokenAccount:c.destinationCtokenTokenAccount,destinationSplTokenAccount:c.destinationSplTokenAccount,mint:i,tokenProgram:a,remainingAccounts:s,payer:d,sourceCompressedTokenAccounts:u,compressedProofArgs:p,compressibleConfig:bP,splInterfacePda:c.requireSplInterface?t.splInterfacePda:void 0,rentSponsor:c.requireRentSponsor?_P:void 0,splInterfacePdaArgs:c.requireSplInterface?some(g):none()}}async function NP(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?[]:selectMinCompressedTokenAccountsForDecompression(s,new EP(i),c?3:4,{treeType:TreeType.StateV2}).selectedAccounts}async function HP(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 VP(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 Z8({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 x of d)if(x instanceof U){let D=p.length,{domainConfig:E,verifyArgs:I,signature:_,publicKey:k,message:q}=ce(x,D);if(q&&_&&k&&p.push({message:q,signature:_,publicKey:k}),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 D=i.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]).get(x.address)?.index;D!==void 0&&u.push({__kind:"Ed25519",fields:[D]});}let{remainingAccounts:g,systemOffset:f}=i.toAccountMetas(),S=W(a,f),C=[];if(p.length>0&&C.push(H(p)),c){if(!s)throw new v("Proof args are missing for compressed changeConfig.");C.push(Zc({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:s,remainingAccounts:g,signers:u}));}else C.push(Fc({settings:o,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:g,signers:u}));return C}async function nH({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 Se(),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 Te(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:s}=r.toAccountMetas(),d=W(c,s);return await Da({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 uH({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 Se(),{address:d,addressTree:u}=await re(await xe(e),s);i.push({address:d,queue:u,tree:u,type:"Settings"});let p=a.length,g=await Z(a,i),f=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 Te(c,g.treeInfos.slice(p),g.roots.slice(p),g.rootIndices.slice(p),i)).find(I=>I.type==="Settings")??null,{remainingAccounts:x,systemOffset:D}=c.toAccountMetas(),E=W(g,D);if(!C)throw new Error("Settings creation args is missing.");return await ta({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:E,...C,remainingAccounts:x})}async function xH({settings:e,settingsAddressTreeIndex:n,payer:r,signers:o,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await fe(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}=Ue(s,c),{remainingAccounts:p,systemOffset:g}=c.toAccountMetas(),f=W(i,g),S=[];return d.length>0&&S.push(H(d)),S.push(_a({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:f,signers:u,remainingAccounts:p})),S}async function hH({authority:e,domainConfig:n,newAuthority:r,newOrigins:o}){let t=null,c=[];if(r){let i=new N;await i.addSystemAccounts();let a=await Se(),{address:s,addressTree:d}=await w(r.address,a),u=[{address:s,tree:d,queue:d,type:"User"}],p=await Z([],u),g=(await Te(i,p.treeInfos,p.roots,p.rootIndices,u))[0],f=i.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:W(p,f.systemOffset),authorityCreationArgs:g};}return Fa({domainConfig:n,authority:e,newOrigins:o?some(o):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function kH({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=W(c,s);return Ya({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function GH({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 f,S=null,C,x=null,D=p.wallets.find(Ae=>Ae.isDelegate);if(D){let Ae=await xe(D.index);(await br(Ae,D.settingsAddressTreeIndex,t)).isCompressed?(g.push({address:(await re(Ae,D.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:g.length-1,end:g.length}):f=await xe(D.index);}if(o){let Ae=await xe(o.index);(await br(Ae,o.settingsAddressTreeIndex,t)).isCompressed?(g.push({address:(await re(Ae,o.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:g.length-1,end:g.length}):C=await xe(o.index);}let E=new N;await E.addSystemAccounts();let I=await ae(g,t),_=await Z(I,[]),k=te(E,_.treeInfos.slice(0,1),_.leafIndices.slice(0,1),_.rootIndices.slice(0,1),_.proveByIndices.slice(0,1),I.slice(0,1),X())[0],q=S?some(te(E,_.treeInfos.slice(S.start,S.end),_.leafIndices.slice(S.start,S.end),_.rootIndices.slice(S.start,S.end),_.proveByIndices.slice(S.start,S.end),I.slice(S.start,S.end),j())[0]):none(),ne=x?some(te(E,_.treeInfos.slice(x.start,x.end),_.leafIndices.slice(x.start,x.end),_.rootIndices.slice(x.start,x.end),_.proveByIndices.slice(x.start,x.end),I.slice(x.start,x.end),j())[0]):none(),{remainingAccounts:Ie,systemOffset:Ce}=E.toAccountMetas(),tt=W(_,Ce),ke=[];return u.length>0&&ke.push(H(u)),ke.push(ei({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:o?some(o):none(),feePayer:e,signer:n instanceof U?void 0:n,oldSettings:f,oldSettingsMutArgs:q,newSettings:C,newSettingsMutArgs:ne,compressedProofArgs:tt,userMutArgs:k,remainingAccounts:Ie})),ke}async function c5({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:o,compressed:t=false,cachedAccounts:c}){let i=await Ec(se(),r),a=i.data.multiWalletSettings,{packedAccounts:s,proof:d,settingsMutArgs:u}=await fe(t,a,e,false,c),{remainingAccounts:p,systemOffset:g}=s.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:C,signature:x,publicKey:D}=ce(n),E=[];if(C&&x&&D&&E.push(H([{message:C,signature:x,publicKey:D}])),t){if(!o||!u)throw new v("Payer not found or proof args are missing for closing buffer.");let I=W(d,g);E.push(Oi({transactionBuffer:r,domainConfig:f,closer:n instanceof U?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:u,payer:o,compressedProofArgs:I,remainingAccounts:p}));}else E.push(_i({transactionBuffer:r,domainConfig:f,closer:n instanceof U?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return E}function nA({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:f,signature:S,publicKey:C}=ce(n),x=[];if(f&&S&&C&&x.push(H([{message:f,signature:S,publicKey:C}])),d){let{settingsReadonlyArgs:D,compressedProofArgs:E,remainingAccounts:I}=d;x.push(Yi({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:D,compressedProofArgs:E,remainingAccounts:I}));}else x.push(Fi({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 x}function oA({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(cd({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(ed({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof U?void 0:e,remainingAccounts:[]})),d}function sA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:o=false}){return o?fd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):gd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function cA({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(_d({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(Dd({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof U?void 0:n,remainingAccounts:[]})),d}async function J5({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:o,compressed:t=false}){let c=await KP(r),i=new N,a=null,s=null,d=[];if(c.length||t){let p=await qP({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 jP({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:s,packedAccounts:i,compressed:t}}async function KP(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 qP({packedAccounts:e,userAccounts:n,compressed:r,settings:o,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let f=(await re(o,t)).address;i.push({address:f,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 f of a)f.type==="Settings"?d.push(f):f.type==="User"&&u.push(f);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 f=r?1:0;g=te(e,s.treeInfos.slice(f),s.leafIndices.slice(f),s.rootIndices.slice(f),s.proveByIndices.slice(f),u,X());}return {proof:s,settingsMutArgs:p,userMutArgs:g}}async function jP({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(ZP({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 JP({pubkey:c.member,userMutArgs:a})})));r.push({__kind:o.type,fields:[t]});break}case "EditPermissions":{let t=o.members.map(c=>YP({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 YP({pubkey:e,permissionArgs:n}){return {memberKey:le(e),permissions:uA(n)}}function JP({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:le(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function ZP({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:le(e),permissions:uA(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function uA(e){let n=[];return e.initiate&&n.push(Pe.InitiateTransaction),e.vote&&n.push(Pe.VoteTransaction),e.execute&&n.push(Pe.ExecuteTransaction),be.fromPermissions(n)}async function n6({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:f}){let S=Math.floor(Math.random()*255),C=await Ou(n,t instanceof U?t:t.address,S),x=[],D=[];for(let ee=0;ee<o.length;ee+=g){let Yo=o.subarray(ee,ee+g);x.push(Yo),D.push(sha256(Yo));}let E=sha256(o),{settingsReadonlyArgs:I,settingsMutArgs:_,proof:k,packedAccounts:q}=await fe(d,n,r,false,f),{remainingAccounts:ne,systemOffset:Ie}=q.toAccountMetas(),Ce=k&&I&&_?{settingsReadonlyArgs:I,settingsMutArgs:_,compressedProofArgs:W(k,Ie),remainingAccounts:ne,payer:e}:null,tt=de([t,...c?[c]:[],...u]).map(ee=>({memberKey:le(ee),messageHash:ee instanceof U?ko(ee.authResponse):null})),ke=nA({finalBufferHash:E,finalBufferSize:o.length,bufferIndex:S,payer:e,transactionBufferAddress:C,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:D,compressedArgs:Ce,expectedSigners:tt}),Ae=x.map(ee=>sA({transactionMessageBytes:ee,transactionBufferAddress:C,settings:n,compressed:d})),rt=u.map(ee=>cA({voter:ee,transactionBufferAddress:C,settings:n,compressedArgs:Ce})),Or=oA({compressedArgs:Ce,settings:n,executor:c,transactionBufferAddress:C}),{instructions:T,addressLookupTableAccounts:Jt}=await ju({compressed:d,settings:n,transactionMessageBytes:o,transactionBufferAddress:C,payer:e,additionalSigners:p,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s}),We=ee=>({payer:e,instructions:ee,addressesByLookupTableAddress:Jt});return [We(ke),...Ae.map(ee=>We([ee])),...rt.length?[We(rt.flat())]:[],We(Or),We(T)]}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 gA({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 f=t.extractTableLookup(g);if(f!==void 0){let{addressTableLookup:S,drainedKeys:C}=f;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),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 l6({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=gA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(du(o))}async function I6({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 Yu({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}}
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 m from'zod';import {getAssociatedTokenAccountAddress,getTokenDecoder,getTransferSolInstruction}from'gill/programs';import {p256}from'@noble/curves/nist.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {canonicalize}from'json-canonicalize';import {selectMinCompressedTokenAccountsForDecompression}from'@lightprotocol/compressed-token';import EP from'bn.js';import {equalBytes}from'@noble/curves/utils.js';var Jo=new Uint8Array([201,232,212,229,59,241,106,197]);function $P(){return fixEncoderSize(getBytesEncoder(),8).encode(Jo)}function DA(){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:Jo}))}function Zo(){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 eM(){return combineCodec(DA(),Zo())}function Xo(e){return decodeAccount(e,Zo())}async function Qo(e,n,r){let o=await PA(e,n,r);return assertAccountExists(o),o}async function PA(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Xo(o)}async function tM(e,n,r){let o=await MA(e,n,r);return assertAccountsExist(o),o}async function MA(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Xo(t))}function rM(){return 846}var ts=new Uint8Array([42,206,176,58,175,129,130,233]);function sM(){return fixEncoderSize(getBytesEncoder(),8).encode(ts)}function HA(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:ts}))}function rs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function cM(){return combineCodec(HA(),rs())}function ns(e){return decodeAccount(e,rs())}async function aM(e,n,r){let o=await VA(e,n,r);return assertAccountExists(o),o}async function VA(e,n,r){let o=await fetchEncodedAccount(e,n,r);return ns(o)}async function iM(e,n,r){let o=await FA(e,n,r);return assertAccountsExist(o),o}async function FA(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ns(t))}function dM(){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 gM(){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 yM(){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 SM(){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 CM(){return combineCodec(zr(),Kr())}function gt(){return getStructEncoder([["treeInfo",mt()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function pt(){return getStructDecoder([["treeInfo",yt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function MM(){return combineCodec(gt(),pt())}function lt(){return getStructEncoder([["treeInfo",mt()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function Tt(){return getStructDecoder([["treeInfo",yt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function _M(){return combineCodec(lt(),Tt())}function qr(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function jr(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function kM(){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 OM(){return combineCodec(Qr(),$r())}function ft(){return getStructEncoder([["data",getOptionEncoder(en())]])}function j(){return getStructDecoder([["data",getOptionDecoder(tn())]])}function HM(){return combineCodec(ft(),j())}function en(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(St())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function tn(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(xt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function zM(){return combineCodec(en(),tn())}function It(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",nn()],["tlv",getOptionEncoder(getArrayEncoder(rn()))],["state",Nr()]])}function Ct(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",on()],["tlv",getOptionDecoder(getArrayDecoder(Et()))],["state",wr()]])}function YM(){return combineCodec(It(),Ct())}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 QM(){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 rh(){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 ch(){return combineCodec(we(),He())}function ah(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function ih(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 gh(){return combineCodec(Cn(),En())}function fn(){return getStructEncoder([["memberKey",V()],["permissions",Le()]])}function Sn(){return getStructDecoder([["memberKey",Q()],["permissions",Oe()]])}function lh(){return combineCodec(fn(),Sn())}function Dt(){return getStructEncoder([["memberKey",V()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function Pt(){return getStructDecoder([["memberKey",Q()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function xh(){return combineCodec(Dt(),Pt())}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 Et(){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 Dh(){return combineCodec(rn(),Et())}function Ph(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Mh(e,n){return n.__kind===e}function Wn(){return getStructEncoder([["settingsMutArgs",z()],["transactionManager",getOptionEncoder(Mt())]])}function Ln(){return getStructDecoder([["settingsMutArgs",K()],["transactionManager",getOptionDecoder(ht())]])}function _h(){return combineCodec(Wn(),Ln())}function St(){return getStructEncoder([["pubkey",V()],["role",getU8Encoder()],["permissions",Le()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function xt(){return getStructDecoder([["pubkey",Q()],["role",getU8Decoder()],["permissions",Oe()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function Wh(){return combineCodec(St(),xt())}function V(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function Q(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function Bh(){return combineCodec(V(),Q())}function Nn(){return getStructEncoder([["authorityCreationArgs",Ee()],["compressedProofArgs",P()]])}function wn(){return getStructDecoder([["authorityCreationArgs",De()],["compressedProofArgs",M()]])}function Vh(){return combineCodec(Nn(),wn())}function Rt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function bt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function zh(){return combineCodec(Rt(),bt())}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 jh(){return combineCodec(nn(),on())}function mt(){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 Zh(){return combineCodec(mt(),yt())}function Dn(){return getStructEncoder([])}function Pn(){return getStructDecoder([])}function $h(){return combineCodec(Dn(),Pn())}function Mn(){return getStructEncoder([])}function hn(){return getStructDecoder([])}function rR(){return combineCodec(Mn(),hn())}function Le(){return getStructEncoder([["mask",getU8Encoder()]])}function Oe(){return getStructDecoder([["mask",getU8Decoder()]])}function sR(){return combineCodec(Le(),Oe())}function P(){return getStructEncoder([["proof",getOptionEncoder(Qr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function M(){return getStructDecoder([["proof",getOptionDecoder($r())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function dR(){return combineCodec(P(),M())}function xn(){return getStructEncoder([["memberKey",V()],["userArgs",Be()]])}function In(){return getStructDecoder([["memberKey",Q()],["userArgs",Ne()]])}function pR(){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 lR(){return combineCodec(mn(),yn())}function Fn(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function _t(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function SR(){return combineCodec(Fn(),_t())}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 CR(){return combineCodec(F(),G())}function Gn(){return getStructEncoder([["verifyArgs",F()],["domainConfigIndex",getU8Encoder()]])}function zn(){return getStructDecoder([["verifyArgs",G()],["domainConfigIndex",getU8Decoder()]])}function MR(){return combineCodec(Gn(),zn())}function Kn(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function qn(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function bR(){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 UR(){return combineCodec(jn(),Yn())}function z(){return getStructEncoder([["accountMeta",gt()],["data",ft()]])}function K(){return getStructDecoder([["accountMeta",pt()],["data",j()]])}function OR(){return combineCodec(z(),K())}function vt(){return getStructEncoder([["accountMeta",lt()],["data",ft()]])}function Ut(){return getStructDecoder([["accountMeta",Tt()],["data",j()]])}function HR(){return combineCodec(vt(),Ut())}function kt(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function Wt(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function GR(){return combineCodec(kt(),Wt())}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 jR(){return combineCodec(Rn(),bn())}function Lt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(Dt())]])}function Ot(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(Pt())]])}function XR(){return combineCodec(Lt(),Ot())}function Bt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(zr())],["addressTableLookups",getArrayEncoder(to())]])}function Nt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Kr())],["addressTableLookups",getArrayDecoder(ro())]])}function tb(){return combineCodec(Bt(),Nt())}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 ob(){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 ib(){return combineCodec(Y(),J())}function db(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function ub(e,n){return n.__kind===e}function _n(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function vn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function pb(){return combineCodec(_n(),vn())}function Un(){return getStructEncoder([["transferring",getU8Encoder()]])}function kn(){return getStructDecoder([["transferring",getU8Decoder()]])}function lb(){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 wt(){return getEnumEncoder(no)}function Ht(){return getEnumDecoder(no)}function Sb(){return combineCodec(wt(),Ht())}function Vt(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",V()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(wt()))],["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(Ht()))],["wallets",getArrayDecoder(Yn())],["role",Fe()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function Eb(){return combineCodec(Vt(),X())}function Ee(){return getStructEncoder([["addressTreeInfo",Rt()],["outputStateTreeIndex",getU8Encoder()]])}function De(){return getStructDecoder([["addressTreeInfo",bt()],["outputStateTreeIndex",getU8Decoder()]])}function hb(){return combineCodec(Ee(),De())}function je(){return getStructEncoder([["accountMeta",gt()],["data",Vt()]])}function Ye(){return getStructDecoder([["accountMeta",pt()],["data",X()]])}function vb(){return combineCodec(je(),Ye())}function Mt(){return getStructEncoder([["accountMeta",lt()],["data",Vt()]])}function ht(){return getStructDecoder([["accountMeta",Tt()],["data",X()]])}function Lb(){return combineCodec(Mt(),ht())}function Be(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Mt()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([je()])]])]])}function Ne(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([ht()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([Ye()])]])]])}function wb(){return combineCodec(Be(),Ne())}function Hb(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Vb(e,n){return n.__kind===e}var he=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(he||{});function Ve(){return getEnumEncoder(he)}function Fe(){return getEnumDecoder(he)}function zb(){return combineCodec(Ve(),Fe())}var mc=new Uint8Array([223,179,163,190,177,224,67,173]);function Y_(){return fixEncoderSize(getBytesEncoder(),8).encode(mc)}function kT(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(St())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:mc}))}function gr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(xt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function J_(){return combineCodec(kT(),gr())}function yc(e){return decodeAccount(e,gr())}async function Z_(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 X_(e,n,r){let o=await WT(e,n,r);return assertAccountsExist(o),o}async function WT(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>yc(t))}var xc=new Uint8Array([90,36,35,219,93,225,110,96]);function tv(){return fixEncoderSize(getBytesEncoder(),8).encode(xc)}function QT(){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(Dt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:xc}))}function Ic(){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(Pt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function rv(){return combineCodec(QT(),Ic())}function Cc(e){return decodeAccount(e,Ic())}async function Ec(e,n,r){let o=await $T(e,n,r);return assertAccountExists(o),o}async function $T(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Cc(o)}async function nv(e,n,r){let o=await e1(e,n,r);return assertAccountsExist(o),o}async function e1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Cc(t))}var Mc=new Uint8Array([105,23,173,2,197,255,80,87]);function cv(){return fixEncoderSize(getBytesEncoder(),8).encode(Mc)}function f1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Mc}))}function hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function av(){return combineCodec(f1(),hc())}function Rc(e){return decodeAccount(e,hc())}async function bc(e,n,r){let o=await S1(e,n,r);return assertAccountExists(o),o}async function S1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Rc(o)}async function iv(e,n,r){let o=await x1(e,n,r);return assertAccountsExist(o),o}async function x1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Rc(t))}function y({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 B(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function l(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let o=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:B(r.value),role:_c(r.value)?upgradeRoleToSigner(o):o,..._c(r.value)?{signer:r.value}:{}})}}function _c(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Uc=new Uint8Array([8]);function Pv(){return fixEncoderSize(getBytesEncoder(),1).encode(Uc)}function po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Uc}))}function kc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function Mv(){return combineCodec(po(),kc())}async function Wc(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:po().encode(c),programAddress:r})}function hv(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:po().encode(c),programAddress:r})}function Rv(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:kc().decode(e.data)}}var wc=new Uint8Array([9]);function Lv(){return fixEncoderSize(getBytesEncoder(),1).encode(wc)}function Hc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(we())],["signers",getArrayEncoder(Y())],["compressedProofArgs",getOptionEncoder(P())]]),e=>({...e,discriminator:wc}))}function Vc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(He())],["signers",getArrayDecoder(J())],["compressedProofArgs",getOptionDecoder(M())]])}function Ov(){return combineCodec(Hc(),Vc())}function Fc(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Hc().encode(c),programAddress:r})}function Bv(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:Vc().decode(e.data)}}var jc=new Uint8Array([19]);function zv(){return fixEncoderSize(getBytesEncoder(),1).encode(jc)}function Yc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(we())],["signers",getArrayEncoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:jc}))}function Jc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(He())],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function Kv(){return combineCodec(Yc(),Jc())}function Zc(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Yc().encode(c),programAddress:r})}function qv(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:Jc().decode(e.data)}}var $c=new Uint8Array([18]);function $v(){return fixEncoderSize(getBytesEncoder(),1).encode($c)}function mo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["addressTreeInfo",Rt()],["outputStateTreeIndex",getU8Encoder()],["userArgs",Be()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:$c}))}function ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["addressTreeInfo",bt()],["outputStateTreeIndex",getU8Decoder()],["userArgs",Ne()],["settingsIndex",getU128Decoder()]])}function eU(){return combineCodec(mo(),ea())}async function ta(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:mo().encode(c),programAddress:r})}function tU(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:mo().encode(c),programAddress:r})}function rU(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:ea().decode(e.data)}}var da=new Uint8Array([0]);function dU(){return fixEncoderSize(getBytesEncoder(),1).encode(da)}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:da}))}function ua(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",De()],["compressedProofArgs",M()]])}function uU(){return combineCodec(lo(),ua())}async function Aa(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data: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=y(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:lo().encode(c),programAddress:r})}function gU(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:ua().decode(e.data)}}var ma=new Uint8Array([4]);function SU(){return fixEncoderSize(getBytesEncoder(),1).encode(ma)}function To(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["member",Fn()],["role",Ve()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(wt())],["userAccountCreationArgs",Ee()],["linkWalletArgs",getOptionEncoder(Wn())]]),e=>({...e,discriminator:ma}))}function ya(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["member",_t()],["role",Fe()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Ht())],["userAccountCreationArgs",De()],["linkWalletArgs",getOptionDecoder(Ln())]])}function xU(){return combineCodec(To(),ya())}async function la(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=y(i),s=l(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 IU(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=y({args:c}),s=l(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 CU(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 fa=new Uint8Array([3]);function RU(){return fixEncoderSize(getBytesEncoder(),1).encode(fa)}function So(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:fa}))}function Sa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function bU(){return combineCodec(So(),Sa())}async function xa(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=y(c),a=l(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:So().encode({}),programAddress:r})}function _U(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=y(c),a=l(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:So().encode({}),programAddress:r})}function vU(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:Sa().decode(e.data)}}var Ca=new Uint8Array([5]);function NU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ca)}function Io(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["createUserArgs",getArrayEncoder(Cn())]]),e=>({...e,discriminator:Ca}))}function Ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayDecoder(En())]])}function wU(){return combineCodec(Io(),Ea())}async function Da(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Io().encode(c),programAddress:r})}function HU(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Io().encode(c),programAddress:r})}function VU(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:Ea().decode(e.data)}}var ha=new Uint8Array([17]);function YU(){return fixEncoderSize(getBytesEncoder(),1).encode(ha)}function Ra(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",z()],["compressedProofArgs",P()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:ha}))}function ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",K()],["compressedProofArgs",M()],["signers",getArrayDecoder(J())]])}function JU(){return combineCodec(Ra(),ba())}function _a(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Ra().encode(c),programAddress:r})}function ZU(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:ba().decode(e.data)}}var ka=new Uint8Array([2]);function rk(){return fixEncoderSize(getBytesEncoder(),1).encode(ka)}function Wa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:ka}))}function La(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function nk(){return combineCodec(Wa(),La())}function Oa(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=y({args:c}),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.admin),...a],data:Wa().encode(c),programAddress:r})}function ok(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:La().decode(e.data)}}var Ha=new Uint8Array([1]);function Ak(){return fixEncoderSize(getBytesEncoder(),1).encode(Ha)}function Eo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Nn())]]),e=>({...e,discriminator:Ha}))}function Va(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(wn())]])}function gk(){return combineCodec(Eo(),Va())}async function pk(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Eo().encode(c),programAddress:r})}function Fa(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Eo().encode(c),programAddress:r})}function mk(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:Va().decode(e.data)}}var Ka=new Uint8Array([6]);function Ik(){return fixEncoderSize(getBytesEncoder(),1).encode(Ka)}function qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",je()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",P()]]),e=>({...e,discriminator:Ka}))}function ja(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ye()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",M()]])}function Ck(){return combineCodec(qa(),ja())}function Ya(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=y({args:c}),s=l(r);return Object.freeze({accounts:[s(t.authority),...a],data:qa().encode(c),programAddress:r})}function Ek(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:ja().decode(e.data)}}var Xa=new Uint8Array([7]);function _k(){return fixEncoderSize(getBytesEncoder(),1).encode(Xa)}function Qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",je()],["secp256r1VerifyArgs",getOptionEncoder(F())],["delegateTo",getOptionEncoder(Kn())],["oldSettingsMutArgs",getOptionEncoder(z())],["newSettingsMutArgs",getOptionEncoder(z())],["compressedProofArgs",P()]]),e=>({...e,discriminator:Xa}))}function $a(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ye()],["secp256r1VerifyArgs",getOptionDecoder(G())],["delegateTo",getOptionDecoder(qn())],["oldSettingsMutArgs",getOptionDecoder(K())],["newSettingsMutArgs",getOptionDecoder(K())],["compressedProofArgs",M()]])}function vk(){return combineCodec(Qa(),$a())}function ei(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=l(r);return Object.freeze({accounts:[s(t.feePayer),s(t.signer),s(t.oldSettings),s(t.newSettings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.domainConfig),...a],data:Qa().encode(c),programAddress:r})}function Uk(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:$a().decode(e.data)}}var ri=new Uint8Array([29]);function wk(){return fixEncoderSize(getBytesEncoder(),1).encode(ri)}function Do(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:ri}))}function ni(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())]])}function Hk(){return combineCodec(Do(),ni())}async function Vk(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(B(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Do().encode(c),programAddress:r})}function oi(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Do().encode(c),programAddress:r})}function Fk(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:ni().decode(e.data)}}var ai=new Uint8Array([27]);function Jk(){return fixEncoderSize(getBytesEncoder(),1).encode(ai)}function ii(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:ai}))}function di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function Zk(){return combineCodec(ii(),di())}function ui(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:ii().encode(c),programAddress:r})}function Xk(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:di().decode(e.data)}}var li=new Uint8Array([30]);function oW(){return fixEncoderSize(getBytesEncoder(),1).encode(li)}function Po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(kt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(It())],["compressedProofArgs",getOptionEncoder(P())],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:li}))}function Ti(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Wt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Ct())],["compressedProofArgs",getOptionDecoder(M())],["signers",getArrayDecoder(J())]])}function sW(){return combineCodec(Po(),Ti())}async function cW(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(B(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(B(t.source.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(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(B(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(B(t.destination.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(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(B(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Po().encode(c),programAddress:r})}function fi(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Po().encode(c),programAddress:r})}function aW(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:Ti().decode(e.data)}}var Ci=new Uint8Array([28]);function mW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ci)}function Mo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(kt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(It())],["signers",getArrayEncoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Ci}))}function Ei(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Wt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Ct())],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function yW(){return combineCodec(Mo(),Ei())}async function lW(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(B(t.source.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(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(B(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(B(t.destination.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(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(B(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Mo().encode(c),programAddress:r})}function Di(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Mo().encode(c),programAddress:r})}function TW(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:Ei().decode(e.data)}}var hi=new Uint8Array([13]);function DW(){return fixEncoderSize(getBytesEncoder(),1).encode(hi)}function Ri(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:hi}))}function bi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function PW(){return combineCodec(Ri(),bi())}function _i(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Ri().encode(c),programAddress:r})}function MW(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:bi().decode(e.data)}}var ki=new Uint8Array([23]);function kW(){return fixEncoderSize(getBytesEncoder(),1).encode(ki)}function Wi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:ki}))}function Li(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function WW(){return combineCodec(Wi(),Li())}function Oi(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.rentCollector),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Wi().encode(c),programAddress:r})}function LW(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:Li().decode(e.data)}}var wi=new Uint8Array([10]);function FW(){return fixEncoderSize(getBytesEncoder(),1).encode(wi)}function Hi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Lt()],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:wi}))}function Vi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Ot()],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function GW(){return combineCodec(Hi(),Vi())}function Fi(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:Hi().encode(c),programAddress:r})}function zW(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:Vi().decode(e.data)}}var Ki=new Uint8Array([20]);function XW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ki)}function qi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Lt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",vt()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Ki}))}function ji(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Ot()],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",M()]])}function QW(){return combineCodec(qi(),ji())}function Yi(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:qi().encode(c),programAddress:r})}function $W(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:ji().decode(e.data)}}var Xi=new Uint8Array([14]);function cL(){return fixEncoderSize(getBytesEncoder(),1).encode(Xi)}function Qi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Xi}))}function $i(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function aL(){return combineCodec(Qi(),$i())}function ed(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Qi().encode(c),programAddress:r})}function iL(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},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:$i().decode(e.data)}}var nd=new Uint8Array([24]);function yL(){return fixEncoderSize(getBytesEncoder(),1).encode(nd)}function od(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:nd}))}function sd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function lL(){return combineCodec(od(),sd())}function cd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:od().encode(c),programAddress:r})}function TL(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:sd().decode(e.data)}}var dd=new Uint8Array([12]);function EL(){return fixEncoderSize(getBytesEncoder(),1).encode(dd)}function ud(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:dd}))}function Ad(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function DL(){return combineCodec(ud(),Ad())}function gd(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=y({args:c}),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.transactionBuffer),...a],data:ud().encode(c),programAddress:r})}function PL(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:Ad().decode(e.data)}}var yd=new Uint8Array([22]);function vL(){return fixEncoderSize(getBytesEncoder(),1).encode(yd)}function ld(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:yd}))}function Td(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function UL(){return combineCodec(ld(),Td())}function fd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=y({args:c}),s=l(r);return Object.freeze({accounts:[s(t.transactionBuffer),...a],data:ld().encode(c),programAddress:r})}function kL(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:Td().decode(e.data)}}var Id=new Uint8Array([11]);function HL(){return fixEncoderSize(getBytesEncoder(),1).encode(Id)}function Cd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Id}))}function Ed(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function VL(){return combineCodec(Cd(),Ed())}function Dd(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Cd().encode(c),programAddress:r})}function FL(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:Ed().decode(e.data)}}var hd=new Uint8Array([21]);function JL(){return fixEncoderSize(getBytesEncoder(),1).encode(hd)}function Rd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",vt()],["compressedProofArgs",P()]]),e=>({...e,discriminator:hd}))}function bd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",M()]])}function ZL(){return combineCodec(Rd(),bd())}function _d(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Rd().encode(c),programAddress:r})}function XL(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:bd().decode(e.data)}}var kd=new Uint8Array([15]);function nO(){return fixEncoderSize(getBytesEncoder(),1).encode(kd)}function Wd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:kd}))}function Ld(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function oO(){return combineCodec(Wd(),Ld())}function Od(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=y({}),a=l(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:Wd().encode({}),programAddress:r})}function sO(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:Ld().decode(e.data)}}var wd=new Uint8Array([25]);function AO(){return fixEncoderSize(getBytesEncoder(),1).encode(wd)}function Hd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:wd}))}function Vd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function gO(){return combineCodec(Hd(),Vd())}function Fd(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=y({args:c}),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.transactionBuffer),...a],data:Hd().encode(c),programAddress:r})}function pO(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:Vd().decode(e.data)}}var Kd=new Uint8Array([16]);function xO(){return fixEncoderSize(getBytesEncoder(),1).encode(Kd)}function qd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Bt()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:Kd}))}function jd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Nt()],["signers",getArrayDecoder(J())]])}function IO(){return combineCodec(qd(),jd())}function Yd(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:qd().encode(c),programAddress:r})}function CO(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:jd().decode(e.data)}}var Xd=new Uint8Array([26]);function bO(){return fixEncoderSize(getBytesEncoder(),1).encode(Xd)}function Qd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Bt()],["signers",getArrayEncoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Xd}))}function $d(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Nt()],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function _O(){return combineCodec(Qd(),$d())}function eu(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=y(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Qd().encode(c),programAddress:r})}function vO(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:$d().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",bC=(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))(bC||{});function pB(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 _C=(T=>(T[T.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",T[T.ChangeConfig=1]="ChangeConfig",T[T.ChangeConfigCompressed=2]="ChangeConfigCompressed",T[T.CreateCompressedWallet=3]="CreateCompressedWallet",T[T.CreateDomainConfig=4]="CreateDomainConfig",T[T.CreateDomainUserAccount=5]="CreateDomainUserAccount",T[T.CreateGlobalCounter=6]="CreateGlobalCounter",T[T.CreateUserAccounts=7]="CreateUserAccounts",T[T.DecompressSettingsAccount=8]="DecompressSettingsAccount",T[T.DisableDomainConfig=9]="DisableDomainConfig",T[T.EditDomainConfig=10]="EditDomainConfig",T[T.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",T[T.EditUserDelegate=12]="EditUserDelegate",T[T.NativeTransferIntent=13]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=14]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=15]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=16]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=17]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=18]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=19]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=20]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=21]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=22]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=23]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=24]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=25]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=26]="TransactionBufferVoteCompressed",T[T.TransactionExecute=27]="TransactionExecute",T[T.TransactionExecuteCompressed=28]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=29]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=30]="TransactionExecuteSyncCompressed",T))(_C||{});function mB(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 UC=6e3,kC=6001,WC=6002,LC=6003,OC=6004,BC=6005,NC=6006,wC=6007,HC=6008,VC=6009,FC=6010,GC=6011,zC=6012,KC=6013,qC=6014,jC=6015,YC=6016,JC=6017,ZC=6018,XC=6019,QC=6020,$C=6021,eE=6022,tE=6023,rE=6024,nE=6025,oE=6026,sE=6027,cE=6028,aE=6029,iE=6030,dE=6031,uE=6032,AE=6033,gE=6034,pE=6035,mE=6036,yE=6037,lE=6038,TE=6039,fE=6040,SE=6041,xE=6042,IE=6043,CE=6044,EE=6045,DE=6046,PE=6047,ME=6048,hE=6049,RE=6050,bE=6051,_E=6052,vE=6053,UE=6054,kE=6055,WE=6056,LE=6057,OE=6058,BE=6059,NE=6060,wE=6061,HE=6062,VE=6063,FE=6064,GE=6065,zE=6066,KE=6067,qE=6068,jE=6069,YE=6070,JE=6071,ZE=6072,XE=6073,QE=6074,$E=6075,eD=6076,tD=6077,rD=6078,nD=6079,oD=6080,sD=6081,cD=6082,aD=6083,iD=6084,dD=6085,uD=6086,tu;process.env.NODE_ENV!=="production"&&(tu={[dE]:"This member is already delegated to another wallet.",[wC]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[tD]:"Clock sysvar access failed. This may indicate a system error.",[bE]:"Missing credential id.",[vE]:"The domain configuration account is disabled. Please contact support or try again later.",[UE]:"Missing domain configuration account.",[$E]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[uD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[FC]:"Duplicate public keys detected among members. Each member must have a unique key.",[VC]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[$C]:"No members provided. A multisig wallet must contain at least one member.",[NE]:"Slot numbers list is empty. At least one slot number is required for validation.",[ZC]:"Expected a User with Administrator role for this instruction.",[HC]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[YC]:"Expected a User with Transaction Manager role for this instruction.",[fE]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[SE]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[xE]:"Declared buffer size does not match the actual serialized size.",[BE]:"Failed to compute hash. This may indicate a system error.",[gE]:"Not enough members with vote permission to meet the approval threshold.",[uE]:"At least one signer with execute permission is required to proceed.",[AE]:"At least one signer with initiate permission is required to perform this action.",[oE]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[QE]:"Invalid account index in transaction message. The account index is out of bounds.",[LE]:"Address Tree supplied is not part of the whitelisted address trees.",[XC]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[cE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[TE]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[wE]:"Member key conversion failed. The provided key format is invalid.",[pE]:"Only delegated members are allowed for this transaction.",[nE]:"Unexpected number of accounts provided for this instruction.",[KC]:"User with Permanent Member role must have a delegated wallet.",[kC]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[OC]:"The extracted public key has an invalid length or encoding.",[UC]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[LC]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[RE]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[ME]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[tE]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[JE]:"Invalid source type for token transfer. The source account type is not supported.",[JC]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[jC]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[rE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[oD]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[sE]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[nD]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[YE]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[BC]:"The extracted WebAuthn signed message payload is malformed.",[DE]:"An input string exceeds the maximum allowed character length.",[kE]:"This member is not registered under the provided domain configuration.",[FE]:"Member not found in settings. Cannot remove a member that does not exist.",[XE]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[aE]:"A required account is missing from the instruction context.",[HE]:"Compressed proof arguments are missing. Required for compressed account operations.",[KE]:"Missing compressed token account. Required for token transfer operations.",[sD]:"Missing destination token account. Required for token transfer operations.",[jE]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[VE]:"Light CPI accounts are missing. Required for compressed account operations.",[iE]:"User mutation arguments are required when performing add or remove delegate operations.",[iD]:"Missing new authority account. Required for domain configuration updates.",[aD]:"Missing settings account. Required for delegate operations on compressed wallets.",[OE]:"Compressed settings data is missing. The settings account must be initialized with data.",[cD]:"Missing source token account. Required for token transfer operations.",[qE]:"Missing SPL interface PDA. Required for token transfer operations.",[PE]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[eD]:"User account address is missing. Required for secp256r1 signature verification.",[dD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[yE]:"No valid signer found in this transaction.",[QC]:"Only one administrator is allowed per wallet.",[zC]:"Only one permanent member is allowed per wallet.",[qC]:"Only one transaction manager is allowed per wallet.",[WE]:"The given origin index is not in the whitelisted origins.",[zE]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[GC]:"Permanent members cannot be removed from a wallet.",[EE]:"Writable CPI calls to protected accounts are not permitted.",[NC]:"The rpIdHash extracted from the signed message does not match the expected value.",[GE]:"Settings key mismatch. The provided settings key does not match the expected value.",[WC]:"The signature index provided is out of bounds for the secp256r1 instruction.",[hE]:"The specified slot number was not found in the provided slot history.",[ZE]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[eE]:"Too many members: a maximum of 4 members are supported.",[IE]:"This transaction has expired. It must be executed within 3 minutes of approval.",[CE]:"This transaction has not yet reached the required approval threshold.",[_E]:"Missing transports.",[lE]:"Only the transaction creator or rent payer may close this transaction buffer.",[rD]:"Unauthorized: Only the admin account is allowed to perform this action.",[mE]:"Member is not part of the expected signers for this transaction."});function xB(e){return process.env.NODE_ENV!=="production"?tu[e]:"Error message not available in production bundles."}function IB(e,n,r){return isProgramError(e,n,A,r)}async function UB({admin:e,addressTree:n}){return Wc({payer:e,addressTree:n,remainingAccounts:[]})}var Re=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 Re{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},$=class extends Re{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},v=class extends Re{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},ot=class extends Re{constructor(r,o,t){super(r,"NETWORK_ERROR",{statusCode:o,url:t});this.statusCode=o;this.url=t;}},Cr=class extends Re{constructor(r,o,t){super(`Operation "${r}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=o;this.lastError=t;}},Er=class extends Re{constructor(r,o,t){super(r,"PERMISSION_ERROR",{required:o,actual:t});this.required=o;this.actual=t;}};var zt={Ed25519:1,Secp256r1:2};var AD=m.looseObject({publicKey:m.string(),walletAddress:m.string(),settingsIndexWithAddress:m.object({index:m.union([m.number(),m.bigint()]),settingsAddressTreeIndex:m.number()}),username:m.string().optional(),profilePictureUrl:m.string().optional()}),ru=m.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),wB=m.object({transactionActionType:ru,transactionAddress:m.string(),transactionMessageBytes:m.array(m.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),gD=m.object({transactionActionType:ru,transactionAddress:m.string(),transactionMessageBytes:m.base64()}).strict(),pD=m.union([m.object({type:m.literal("Ephemeral"),secretKey:m.string()}),m.object({type:m.literal("Default"),publickey:m.string(),endpoint:m.string()})]).array().optional(),nu=m.object({phase:m.literal("start"),redirectOrigin:m.url(),signer:m.string().optional(),rid:m.string(),validTill:m.number(),data:m.object({type:m.literal("message"),payload:m.string(),trustedDeviceCheck:m.boolean()}).strict()}).strict(),ou=m.object({phase:m.literal("start"),redirectOrigin:m.url(),signer:m.string().optional(),rid:m.string(),validTill:m.number(),data:m.object({type:m.literal("transaction"),payload:gD,sendTx:m.boolean(),additionalSigners:pD}).strict()}).strict(),su=m.object({startRequest:m.union([nu,ou]),authResponse:m.custom(),client:m.object({clientOrigin:m.url(),jws:m.string()}).strict(),device:m.object({jwk:m.base64(),jws:m.string()}).strict(),authProvider:m.object({jwk:m.base64(),jws:m.string()}).optional()}).strict(),cu=m.object({signer:m.string(),userAddressTreeIndex:m.number().optional(),additionalInfo:m.looseObject({}).optional()}).strict(),mD=m.object({slotHash:m.string(),slotNumber:m.string(),estimatedSlotHashExpiry:m.number(),originIndex:m.number(),crossOrigin:m.boolean()}).strict(),HB=m.object({phase:m.literal("complete"),data:m.object({type:m.literal("message"),payload:cu.extend(su.shape).extend({id:m.string().optional(),client:m.object({clientOrigin:m.url()}).strict()})}).strict()}).strict(),VB=m.object({phase:m.literal("complete"),data:m.object({type:m.literal("transaction"),payload:cu.extend(su.shape).extend(mD.shape).extend({client:m.object({clientOrigin:m.url()}).strict()})}).strict()}).strict(),FB=m.object({phase:m.literal("complete"),data:m.object({type:m.literal("transaction"),payload:m.object({startRequest:m.union([ou,nu]),txSig:m.string(),user:AD})}).strict()}).strict();var Pe={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},be=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,o)=>r|o,0))}static all(){return new e(Object.values(Pe).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var bo=33,_e=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 _e{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 iu=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(TD())],["addressTableLookups",getArrayCodec(fD())]]);function du(e){return iu.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 uu(e){let n=iu.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 dN(){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 uN(){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;}var vo=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"];function PN(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Pr(n.get(-2))),y:BigInt("0x"+Pr(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=yu(c),a=Tu(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:Uo(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 Uo(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 ko(e.data.payload.authResponse)}function _N(e,n,r,o){let t=Uo(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 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=Uo(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 ko(e){let n=Mr(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 Qo(se(),e),t=lu(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)))}function Pr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function hD(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 yu(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 lu(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 Tu(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 D=n&127;r+=D;}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,f=BigInt("0x"+Pr(u)),C=(f>g?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=hD(C);return new Uint8Array([...p,...x])}function Mr(e){let n=pe(e.response.clientDataJSON),r=pe(e.response.authenticatorData),o=sha256(n);return new Uint8Array([...r,...o])}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?Mr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:o,signature:c,message:i,publicKey:a}}function Ue(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 le(e){if(e instanceof _e)return {keyType:zt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:zt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function xu(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(xu(t))||(r.push(t),n.add(xu(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 Iu({payer:e,tipAmount:n}){let r=vo[Math.floor(Math.random()*vo.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function Cu(e,n,r,o){if(e<n||e>r)throw new v(`${o} must be between ${n} and ${r} (inclusive), got ${e}`)}function Eu(e,n){if(e<0)throw new v(`${n} must be non-negative, got ${e}`)}function Du(e){return typeof e=="string"?e:e.toString()}function Pu(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 Mu(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=Du(e);return Wo(n,r,()=>ye().getCompressedAccount(e))}async function Xe(e,n){let r=Pu(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 W(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function Te(e,n,r,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 fe(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 Mu(()=>ye().getValidityProofV0(e,n))}async function Se(){return (await Rr()).length-1}var Lo;async function Rr(){if(!Lo){let{data:e}=await bc(se(),await _u());Lo=e.whitelistedAddressTrees;}return Lo}function bu(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 Pw(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(le(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 Mw(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(le(e)))}}]}),se().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(V().encode(le(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 xe(t.index),t.settingsAddressTreeIndex,r)))}async function No(e){Eu(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 hw(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 _e?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 Lu(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function _u(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Ou(e,n,r){Cu(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 _e?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 xe(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function Nw(e){let n=await xe(e);return await Me(n)}async function ww(){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=>wu(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=be.has(o,Pe.InitiateTransaction),c=be.has(o,Pe.VoteTransaction),i=be.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(wu(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",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 f;try{f=JSON.parse(g.data);}catch{return}let S=typeof f.event=="string"?f.event:"message",C=f.data;try{r(S,C)&&a(()=>o());}catch(x){a(()=>t(x));}},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 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 Zw(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:f}=d,S=rP(r),C=JSON.stringify({publicKey:n.toString(),payload:g.map(x=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(x)),transactionMessageBytes:t?getBase64Decoder().decode(t):void 0,authResponses:o}))});for(let x=0;x<u;x++){if(f.aborted)throw wo();let D,E;try{E=await nP(S,f),E.send(C),await oP(E,f,(I,_)=>{if(I==="error"){let k=_&&typeof _=="object"&&typeof _.error=="string"?_.error:"Unknown error",q=new Error(k);throw q.noRetry=!0,q}return I==="signatures"?(D=_.signatures,!0):(I==="pending_transaction_approval"?c?.(_.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(D?.length)return D.map(I=>({[n]:getBase58Encoder().encode(I)}));x<u-1&&await sP(p,f);}throw new ot("Transaction manager: missing signatures")}}}function wu(e){return e.keyType===zt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function Xw(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 Qw(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 p2({payer:e,rpId:n,origins:r,authority:o}){let t=await ct({rpId:n}),c=new N;await c.addSystemAccounts();let i=await Se(),{address:a,addressTree:s}=await w(o.address,i),d=[{address:a,tree:s,queue:s,type:"User"}],u=await Z([],d),p=(await Te(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:g,systemOffset:f}=c.toAccountMetas(),S=W(u,f);return await Aa({origins:r,authorityCreationArgs:p,authority:o,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:g})}async function D2({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 Se(),{address:d,addressTree:u}=await w(r.member,s),p=[{address:d,type:"User",tree:u,queue:u}],g=await Z(a,p),f=null,S=null,C=a.filter(k=>k.type==="Settings"),x=a.filter(k=>k.type==="User");if(x.length&&(S=te(c,g.treeInfos.slice(0,1),g.leafIndices.slice(0,1),g.rootIndices.slice(0,1),g.proveByIndices.slice(0,1),x,X())[0]),C.length){let k=x.length,q=k+1;f=te(c,g.treeInfos.slice(k,q),g.leafIndices.slice(k,q),g.rootIndices.slice(k,q),g.proveByIndices.slice(k,q),C,j())[0];}let D=(await Te(c,g.treeInfos.slice(a.length),g.roots.slice(a.length),g.rootIndices.slice(a.length),p))[0],{remainingAccounts:E,systemOffset:I}=c.toAccountMetas(),_=W(g,I);return await la({payer:n,authority:e,compressedProofArgs:_,member:_t().decode(r.member.toBuffer()),credentialId:pe(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:f?some({settingsMutArgs:f,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:D,domainConfig:o,remainingAccounts:E})}async function R2({payer:e}){let n=await Lu();return xa({payer:e,globalCounter:n})}async function U2({admin:e,rpId:n,disable:r}){let o=await ct({rpId:n});return Oa({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=uu(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,lP=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 Ku(){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,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 qu(){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 K2(){return combineCodec(qu(),Ku())}function H(e,n){let r=e.length,o=lP+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??TP,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:qu().encode(i)}}function q2(e){return {programAddress:e.programAddress,accounts:{},data:Ku().decode(e.data)}}async function ju({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?Fd({transactionBuffer:n,payer:o.address,remainingAccounts:u,settingsKey:e}):Od({transactionBuffer:n,payer:o.address,settings:e})),a&&g.push(Iu({payer:o,tipAmount:a})),{instructions:g,addressLookupTableAccounts:p}}async function Yu({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:f,addressLookupTableAccounts:S,transactionMessage:C},{settingsMutArgs:x,proof:D,packedAccounts:E}]=await Promise.all([_r({transactionMessageBytes:r,walletAddress:g,additionalSigners:o,addressesByLookupTableAddress:i}),fe(s,e,n,d,u)]);E.addPreAccounts(f);let{secp256r1VerifyInput:I,transactionSyncSigners:_}=Ue(p,E,a),{remainingAccounts:k,systemOffset:q}=E.toAccountMetas(),ne=[];I.length>0&&ne.push(H(I));let Ie=xP(C,f);if(s){if(!c||!x)throw new v("Payer not found or proof args are missing for executeTransactionSync.");let Ce=W(D,q);ne.push(eu({signers:_,transactionMessage:Ie,settingsMutArgs:x,compressedProofArgs:Ce,payer:c,remainingAccounts:k}));}else ne.push(Yd({signers:_,settings:e,transactionMessage:Ie,remainingAccounts:k}));return {instructions:ne,addressLookupTableAccounts:S}}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 I8({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:f}]=await Promise.all([fe(a,e,n,false,t),Xe(d,t)]);if((f?.lamports??0)<BigInt(c))throw new v("Insufficient balance for native transfer.");let{secp256r1VerifyInput:S,transactionSyncSigners:C}=Ue(s,u),{remainingAccounts:x,systemOffset:D}=u.toAccountMetas(),E=[];if(S.length>0&&E.push(H(S)),a){if(!i||!g)throw new Error("Payer not found or proof args is missing.");let I=W(p,D);E.push(ui({amount:c,settingsMutArgs:g,compressedProofArgs:I,payer:i,signers:C,source:d,destination:r,remainingAccounts:x}));}else E.push(oi({amount:c,signers:C,source:d,destination:r,settings:e,remainingAccounts:x}));return E}var bP=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),_P=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Ur=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function N8({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,useDestinationSplAccount:p=false}){let g=de(t),f=await Me(e),S=await vP(o,r,f,s,d),[C,x]=await Promise.all([UP(S,c),HP(u,e,n,c)]),D=kP(C,S,i,p),[E,I]=await Promise.all([wP(f,o,D.splBalance,D.cTokenBalance,BigInt(i),u),NP(D.requireSplInterface,S.splInterfacePda,c)]),_=BigInt(E.reduce((We,jo)=>We+(jo.parsed.amount.toNumber()??0),0));if(D.splBalance+D.cTokenBalance+_<BigInt(i))throw new v("Insufficient balance for token transfer.");let k=new N;I&&k.addPreAccounts([{address:o,role:AccountRole.WRITABLE}]);let q=WP(E,x),{proof:ne,settingsMutArgs:Ie}=await LP(k,q,x),Ce=OP(E,ne,k),{secp256r1VerifyInput:tt,transactionSyncSigners:ke}=Ue(g,k),{remainingAccounts:Ae,systemOffset:rt}=k.toAccountMetas(),Or=W(ne,rt),T=[];tt.length>0&&T.push(H(tt));let Jt=BP({amount:i,transactionSyncSigners:ke,walletAddress:f,destination:r,addresses:S,balances:D,mint:o,tokenProgram:s,remainingAccounts:Ae,payer:a,sourceCompressedTokenAccounts:Ce,compressedProofArgs:Or,splInterfacePdaArgs:d});if(u){if(!Ie)throw new Error("Payer not found or proof args is missing.");T.push(Di({...Jt,settingsMutArgs:Ie}));}else T.push(fi({...Jt,settings:e}));return T}async function vP(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 UP(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 kP(e,n,r,o){let t=!!e.destinationSplAtaInfo.value,c=!!e.sourceSplAtaInfo.value,i=!!e.sourceCTokenAtaInfo.value,a=c?getTokenDecoder().decode(getBase64Encoder().encode(e.sourceSplAtaInfo.value.data[0])).amount:BigInt(0),s=BigInt(i?VP(getBase64Encoder().encode(e.sourceCTokenAtaInfo.value.data[0]))?.amount??0:0),d=t||o?n.destinationSplAta:void 0,u=t||o?void 0:n.destinationCTokenAta,p=c&&(a+s<BigInt(r)||s>BigInt(0)||!t)||!c&&t;return {splBalance:a,cTokenBalance:s,destinationSplTokenAccount:d,destinationCtokenTokenAccount:u,requireSplInterface:p,requireRentSponsor:a+s<BigInt(r)||!t}}function WP(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 LP(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 OP(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:bu(o.compressedAccount.data?.discriminator),tlv:o.parsed.tlv?some(getArrayDecoder(Et()).decode(o.parsed.tlv)):none(),state:o.parsed.state}))}function BP({amount:e,transactionSyncSigners:n,walletAddress:r,destination:o,addresses:t,balances:c,mint:i,tokenProgram:a,remainingAccounts:s,payer:d,sourceCompressedTokenAccounts:u,compressedProofArgs:p,splInterfacePdaArgs:g}){return {amount:e,signers:n,source:r,destination:o,sourceCtokenTokenAccount:t.sourceCtokenAta,sourceSplTokenAccount:t.sourceSplAta,destinationCtokenTokenAccount:c.destinationCtokenTokenAccount,destinationSplTokenAccount:c.destinationSplTokenAccount,mint:i,tokenProgram:a,remainingAccounts:s,payer:d,sourceCompressedTokenAccounts:u,compressedProofArgs:p,compressibleConfig:bP,splInterfacePda:c.requireSplInterface?t.splInterfacePda:void 0,rentSponsor:c.requireRentSponsor?_P:void 0,splInterfacePdaArgs:c.requireSplInterface?some(g):none()}}async function NP(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?[]:selectMinCompressedTokenAccountsForDecompression(s,new EP(i),c?3:4,{treeType:TreeType.StateV2}).selectedAccounts}async function HP(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 VP(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 Z8({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 x of d)if(x instanceof U){let D=p.length,{domainConfig:E,verifyArgs:I,signature:_,publicKey:k,message:q}=ce(x,D);if(q&&_&&k&&p.push({message:q,signature:_,publicKey:k}),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 D=i.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]).get(x.address)?.index;D!==void 0&&u.push({__kind:"Ed25519",fields:[D]});}let{remainingAccounts:g,systemOffset:f}=i.toAccountMetas(),S=W(a,f),C=[];if(p.length>0&&C.push(H(p)),c){if(!s)throw new v("Proof args are missing for compressed changeConfig.");C.push(Zc({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:s,remainingAccounts:g,signers:u}));}else C.push(Fc({settings:o,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:g,signers:u}));return C}async function nH({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 Se(),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 Te(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:s}=r.toAccountMetas(),d=W(c,s);return await Da({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 uH({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 Se(),{address:d,addressTree:u}=await re(await xe(e),s);i.push({address:d,queue:u,tree:u,type:"Settings"});let p=a.length,g=await Z(a,i),f=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 Te(c,g.treeInfos.slice(p),g.roots.slice(p),g.rootIndices.slice(p),i)).find(I=>I.type==="Settings")??null,{remainingAccounts:x,systemOffset:D}=c.toAccountMetas(),E=W(g,D);if(!C)throw new Error("Settings creation args is missing.");return await ta({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:E,...C,remainingAccounts:x})}async function xH({settings:e,settingsAddressTreeIndex:n,payer:r,signers:o,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await fe(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}=Ue(s,c),{remainingAccounts:p,systemOffset:g}=c.toAccountMetas(),f=W(i,g),S=[];return d.length>0&&S.push(H(d)),S.push(_a({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:f,signers:u,remainingAccounts:p})),S}async function hH({authority:e,domainConfig:n,newAuthority:r,newOrigins:o}){let t=null,c=[];if(r){let i=new N;await i.addSystemAccounts();let a=await Se(),{address:s,addressTree:d}=await w(r.address,a),u=[{address:s,tree:d,queue:d,type:"User"}],p=await Z([],u),g=(await Te(i,p.treeInfos,p.roots,p.rootIndices,u))[0],f=i.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:W(p,f.systemOffset),authorityCreationArgs:g};}return Fa({domainConfig:n,authority:e,newOrigins:o?some(o):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function kH({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=W(c,s);return Ya({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function GH({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 f,S=null,C,x=null,D=p.wallets.find(Ae=>Ae.isDelegate);if(D){let Ae=await xe(D.index);(await br(Ae,D.settingsAddressTreeIndex,t)).isCompressed?(g.push({address:(await re(Ae,D.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:g.length-1,end:g.length}):f=await xe(D.index);}if(o){let Ae=await xe(o.index);(await br(Ae,o.settingsAddressTreeIndex,t)).isCompressed?(g.push({address:(await re(Ae,o.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:g.length-1,end:g.length}):C=await xe(o.index);}let E=new N;await E.addSystemAccounts();let I=await ae(g,t),_=await Z(I,[]),k=te(E,_.treeInfos.slice(0,1),_.leafIndices.slice(0,1),_.rootIndices.slice(0,1),_.proveByIndices.slice(0,1),I.slice(0,1),X())[0],q=S?some(te(E,_.treeInfos.slice(S.start,S.end),_.leafIndices.slice(S.start,S.end),_.rootIndices.slice(S.start,S.end),_.proveByIndices.slice(S.start,S.end),I.slice(S.start,S.end),j())[0]):none(),ne=x?some(te(E,_.treeInfos.slice(x.start,x.end),_.leafIndices.slice(x.start,x.end),_.rootIndices.slice(x.start,x.end),_.proveByIndices.slice(x.start,x.end),I.slice(x.start,x.end),j())[0]):none(),{remainingAccounts:Ie,systemOffset:Ce}=E.toAccountMetas(),tt=W(_,Ce),ke=[];return u.length>0&&ke.push(H(u)),ke.push(ei({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:o?some(o):none(),feePayer:e,signer:n instanceof U?void 0:n,oldSettings:f,oldSettingsMutArgs:q,newSettings:C,newSettingsMutArgs:ne,compressedProofArgs:tt,userMutArgs:k,remainingAccounts:Ie})),ke}async function c5({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:o,compressed:t=false,cachedAccounts:c}){let i=await Ec(se(),r),a=i.data.multiWalletSettings,{packedAccounts:s,proof:d,settingsMutArgs:u}=await fe(t,a,e,false,c),{remainingAccounts:p,systemOffset:g}=s.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:C,signature:x,publicKey:D}=ce(n),E=[];if(C&&x&&D&&E.push(H([{message:C,signature:x,publicKey:D}])),t){if(!o||!u)throw new v("Payer not found or proof args are missing for closing buffer.");let I=W(d,g);E.push(Oi({transactionBuffer:r,domainConfig:f,closer:n instanceof U?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:u,payer:o,compressedProofArgs:I,remainingAccounts:p}));}else E.push(_i({transactionBuffer:r,domainConfig:f,closer:n instanceof U?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return E}function nA({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:f,signature:S,publicKey:C}=ce(n),x=[];if(f&&S&&C&&x.push(H([{message:f,signature:S,publicKey:C}])),d){let{settingsReadonlyArgs:D,compressedProofArgs:E,remainingAccounts:I}=d;x.push(Yi({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:D,compressedProofArgs:E,remainingAccounts:I}));}else x.push(Fi({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 x}function oA({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(cd({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(ed({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof U?void 0:e,remainingAccounts:[]})),d}function sA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:o=false}){return o?fd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):gd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function cA({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(_d({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(Dd({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof U?void 0:n,remainingAccounts:[]})),d}async function J5({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:o,compressed:t=false}){let c=await KP(r),i=new N,a=null,s=null,d=[];if(c.length||t){let p=await qP({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 jP({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:s,packedAccounts:i,compressed:t}}async function KP(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 qP({packedAccounts:e,userAccounts:n,compressed:r,settings:o,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let f=(await re(o,t)).address;i.push({address:f,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 f of a)f.type==="Settings"?d.push(f):f.type==="User"&&u.push(f);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 f=r?1:0;g=te(e,s.treeInfos.slice(f),s.leafIndices.slice(f),s.rootIndices.slice(f),s.proveByIndices.slice(f),u,X());}return {proof:s,settingsMutArgs:p,userMutArgs:g}}async function jP({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(ZP({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 JP({pubkey:c.member,userMutArgs:a})})));r.push({__kind:o.type,fields:[t]});break}case "EditPermissions":{let t=o.members.map(c=>YP({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 YP({pubkey:e,permissionArgs:n}){return {memberKey:le(e),permissions:uA(n)}}function JP({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:le(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function ZP({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:le(e),permissions:uA(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function uA(e){let n=[];return e.initiate&&n.push(Pe.InitiateTransaction),e.vote&&n.push(Pe.VoteTransaction),e.execute&&n.push(Pe.ExecuteTransaction),be.fromPermissions(n)}async function n6({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:f}){let S=Math.floor(Math.random()*255),C=await Ou(n,t instanceof U?t:t.address,S),x=[],D=[];for(let ee=0;ee<o.length;ee+=g){let Yo=o.subarray(ee,ee+g);x.push(Yo),D.push(sha256(Yo));}let E=sha256(o),{settingsReadonlyArgs:I,settingsMutArgs:_,proof:k,packedAccounts:q}=await fe(d,n,r,false,f),{remainingAccounts:ne,systemOffset:Ie}=q.toAccountMetas(),Ce=k&&I&&_?{settingsReadonlyArgs:I,settingsMutArgs:_,compressedProofArgs:W(k,Ie),remainingAccounts:ne,payer:e}:null,tt=de([t,...c?[c]:[],...u]).map(ee=>({memberKey:le(ee),messageHash:ee instanceof U?ko(ee.authResponse):null})),ke=nA({finalBufferHash:E,finalBufferSize:o.length,bufferIndex:S,payer:e,transactionBufferAddress:C,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:D,compressedArgs:Ce,expectedSigners:tt}),Ae=x.map(ee=>sA({transactionMessageBytes:ee,transactionBufferAddress:C,settings:n,compressed:d})),rt=u.map(ee=>cA({voter:ee,transactionBufferAddress:C,settings:n,compressedArgs:Ce})),Or=oA({compressedArgs:Ce,settings:n,executor:c,transactionBufferAddress:C}),{instructions:T,addressLookupTableAccounts:Jt}=await ju({compressed:d,settings:n,transactionMessageBytes:o,transactionBufferAddress:C,payer:e,additionalSigners:p,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s}),We=ee=>({payer:e,instructions:ee,addressesByLookupTableAddress:Jt});return [We(ke),...Ae.map(ee=>We([ee])),...rt.length?[We(rt.flat())]:[],We(Or),We(T)]}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 gA({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 f=t.extractTableLookup(g);if(f!==void 0){let{addressTableLookup:S,drainedKeys:C}=f;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),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 l6({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=gA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(du(o))}async function I6({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 Yu({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
2
  export{Uc as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,Br as AccountState,pD as AdditionalSignersSchema,su as AuthenticationContextSchema,cu as BaseResponseSchema,jc as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,wc as CHANGE_CONFIG_DISCRIMINATOR,$c as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,da as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,ma as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,fa as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Ca as CREATE_USER_ACCOUNTS_DISCRIMINATOR,HB as CompleteMessageRequestSchema,FB as CompleteSendTransactionRequestSchema,VB as CompleteTransactionRequestSchema,ha as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,ka as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Jo as DOMAIN_CONFIG_DISCRIMINATOR,Ha as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,Ka as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,Xa as EDIT_USER_DELEGATE_DISCRIMINATOR,ts as GLOBAL_COUNTER_DISCRIMINATOR,zt as KeyType,dE as MULTI_WALLET_ERROR__ALREADY_DELEGATED,wC as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,tD as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,bE as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,vE as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,UE as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,$E as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,uD as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,FC as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,VC as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,$C as MULTI_WALLET_ERROR__EMPTY_MEMBERS,NE as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,ZC as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,HC as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,YC as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,fE as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,SE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,xE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,BE as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,gE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,uE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,AE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,oE as MULTI_WALLET_ERROR__INVALID_ACCOUNT,QE as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,LE as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,XC as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,cE as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,TE as MULTI_WALLET_ERROR__INVALID_BUFFER,wE as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,pE as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,nE as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,KC as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,kC as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,OC as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,UC as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,LC as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,RE as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,ME as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,tE as MULTI_WALLET_ERROR__INVALID_THRESHOLD,JE as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,JC as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,jC as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,rE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,oD as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,sE as MULTI_WALLET_ERROR__INVALID_USER_ROLE,nD as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,YE as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,BC as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,DE as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,kE as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,FE as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,XE as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,aE as MULTI_WALLET_ERROR__MISSING_ACCOUNT,HE as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,KE as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,sD as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,jE as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,VE as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,iE as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,iD as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,aD as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,OE as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,cD as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,qE as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,PE as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,eD as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,dD as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,yE as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,QC as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,zC as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,qC as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,WE as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,zE as MULTI_WALLET_ERROR__PAYER_MISMATCH,GC as MULTI_WALLET_ERROR__PERMANENT_MEMBER,EE as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,NC as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,GE as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,WC as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,hE as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,ZE as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,eE as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,IE as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,CE as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,_E as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,lE as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,rD as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,mE as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,bC as MultiWalletAccount,_C as MultiWalletInstruction,ai as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,ri as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Pe as Permission,be as Permissions,mc as SETTINGS_DISCRIMINATOR,_e as Secp256r1Key,U as SignedSecp256r1Key,nu as StartMessageRequestSchema,ou as StartTransactionRequestSchema,Ci as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,li as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,ki as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,hi as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,Ki as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,wi as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,xc as TRANSACTION_BUFFER_DISCRIMINATOR,nd as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Xi as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,yd as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,dd as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,hd as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Id as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,wd as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,kd as TRANSACTION_EXECUTE_DISCRIMINATOR,Xd as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,Kd as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,ru as TransactionActionTypeSchema,mD as TransactionDetailsSchema,wB as TransactionPayloadSchema,gD as TransactionPayloadWithBase64MessageBytesSchema,no as Transports,AD as UserInfoSchema,he as UserRole,Mc as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,UB as addWhitelistedAddressTrees,pe as base64URLStringToBuffer,UN as bufferToBase64URLString,Z8 as changeConfig,c5 as closeTransactionBuffer,ah as configAction,LN as convertBase64StringToJWK,WN as convertJWKToBase64String,wu as convertMemberKeyToString,MN as convertPubkeyCompressedToCose,PN as convertPubkeyCoseToCompressed,bN as createClientAuthorizationCompleteRequestChallenge,RN as createClientAuthorizationStartRequestChallenge,p2 as createDomainConfig,D2 as createDomainUserAccounts,R2 as createGlobalCounter,_N as createMessageChallenge,nA as createTransactionBuffer,vN as createTransactionChallenge,Zw as createTransactionManagerSigner,nH as createUserAccounts,uH as createWallet,Xo as decodeDomainConfig,ns as decodeGlobalCounter,yc as decodeSettings,Cc as decodeTransactionBuffer,Rc as decodeWhitelistedAddressTree,xH as decompressSettingsAccount,Qw as deserializeConfigActions,U2 as disableDomainConfig,hH as editDomainConfig,kH as editTransactionManagerUrl,GH as editUserDelegate,ju as executeTransaction,oA as executeTransactionBuffer,Yu as executeTransactionSync,sA as extendTransactionBuffer,Ph as extensionStruct,tM as fetchAllDomainConfig,iM as fetchAllGlobalCounter,MA as fetchAllMaybeDomainConfig,FA as fetchAllMaybeGlobalCounter,WT as fetchAllMaybeSettings,e1 as fetchAllMaybeTransactionBuffer,x1 as fetchAllMaybeWhitelistedAddressTree,X_ as fetchAllSettings,Mw as fetchAllSettingsAccountByMember,nv as fetchAllTransactionBuffer,iv as fetchAllWhitelistedAddressTree,Qo as fetchDomainConfig,aM as fetchGlobalCounter,PA as fetchMaybeDomainConfig,VA as fetchMaybeGlobalCounter,oo as fetchMaybeSettings,jD as fetchMaybeSettingsAccountData,$T as fetchMaybeTransactionBuffer,qD as fetchMaybeUserAccountData,S1 as fetchMaybeWhitelistedAddressTree,Z_ as fetchSettings,br as fetchSettingsAccountData,Ec as fetchTransactionBuffer,Pw as fetchUserAccountByFilters,Bo as fetchUserAccountData,bc as fetchWhitelistedAddressTree,gM as getAccountStateCodec,wr as getAccountStateDecoder,Nr as getAccountStateEncoder,SM as getAddMemberArgsCodec,Gr as getAddMemberArgsDecoder,Fr as getAddMemberArgsEncoder,Pv as getAddWhitelistedAddressTreesDiscriminatorBytes,hv as getAddWhitelistedAddressTreesInstruction,Wc as getAddWhitelistedAddressTreesInstructionAsync,Mv as getAddWhitelistedAddressTreesInstructionDataCodec,kc as getAddWhitelistedAddressTreesInstructionDataDecoder,po as getAddWhitelistedAddressTreesInstructionDataEncoder,yM as getAdditionalMetadataCodec,Vr as getAdditionalMetadataDecoder,Hr as getAdditionalMetadataEncoder,zv as getChangeConfigCompressedDiscriminatorBytes,Zc as getChangeConfigCompressedInstruction,Kv as getChangeConfigCompressedInstructionDataCodec,Jc as getChangeConfigCompressedInstructionDataDecoder,Yc as getChangeConfigCompressedInstructionDataEncoder,Lv as getChangeConfigDiscriminatorBytes,Fc as getChangeConfigInstruction,Ov as getChangeConfigInstructionDataCodec,Vc as getChangeConfigInstructionDataDecoder,Hc as getChangeConfigInstructionDataEncoder,Uo as getClientAndDeviceHash,CM as getCompiledInstructionCodec,Kr as getCompiledInstructionDecoder,zr as getCompiledInstructionEncoder,MM as getCompressedAccountMetaCodec,pt as getCompressedAccountMetaDecoder,gt as getCompressedAccountMetaEncoder,_M as getCompressedAccountMetaReadOnlyCodec,Tt as getCompressedAccountMetaReadOnlyDecoder,lt as getCompressedAccountMetaReadOnlyEncoder,kM as getCompressedOnlyExtensionCodec,jr as getCompressedOnlyExtensionDecoder,qr as getCompressedOnlyExtensionEncoder,OM as getCompressedProofCodec,$r as getCompressedProofDecoder,Qr as getCompressedProofEncoder,re as getCompressedSettingsAddress,HM as getCompressedSettingsCodec,zM as getCompressedSettingsDataCodec,tn as getCompressedSettingsDataDecoder,en as getCompressedSettingsDataEncoder,j as getCompressedSettingsDecoder,ft as getCompressedSettingsEncoder,YM as getCompressedTokenArgsCodec,Ct as getCompressedTokenArgsDecoder,It as getCompressedTokenArgsEncoder,QM as getCompressibleExtensionCodec,dn as getCompressibleExtensionDecoder,an as getCompressibleExtensionEncoder,rh as getCompressionInfoCodec,An as getCompressionInfoDecoder,un as getCompressionInfoEncoder,ch as getConfigActionCodec,He as getConfigActionDecoder,we as getConfigActionEncoder,$v as getCreateCompressedWalletDiscriminatorBytes,tU as getCreateCompressedWalletInstruction,ta as getCreateCompressedWalletInstructionAsync,eU as getCreateCompressedWalletInstructionDataCodec,ea as getCreateCompressedWalletInstructionDataDecoder,mo as getCreateCompressedWalletInstructionDataEncoder,dU as getCreateDomainConfigDiscriminatorBytes,AU as getCreateDomainConfigInstruction,Aa as getCreateDomainConfigInstructionAsync,uU as getCreateDomainConfigInstructionDataCodec,ua as getCreateDomainConfigInstructionDataDecoder,lo as getCreateDomainConfigInstructionDataEncoder,SU as getCreateDomainUserAccountDiscriminatorBytes,IU as getCreateDomainUserAccountInstruction,la as getCreateDomainUserAccountInstructionAsync,xU as getCreateDomainUserAccountInstructionDataCodec,ya as getCreateDomainUserAccountInstructionDataDecoder,To as getCreateDomainUserAccountInstructionDataEncoder,RU as getCreateGlobalCounterDiscriminatorBytes,_U as getCreateGlobalCounterInstruction,xa as getCreateGlobalCounterInstructionAsync,bU as getCreateGlobalCounterInstructionDataCodec,Sa as getCreateGlobalCounterInstructionDataDecoder,So as getCreateGlobalCounterInstructionDataEncoder,gh as getCreateUserAccountArgsCodec,En as getCreateUserAccountArgsDecoder,Cn as getCreateUserAccountArgsEncoder,NU as getCreateUserAccountsDiscriminatorBytes,HU as getCreateUserAccountsInstruction,Da as getCreateUserAccountsInstructionAsync,wU as getCreateUserAccountsInstructionDataCodec,Ea as getCreateUserAccountsInstructionDataDecoder,Io as getCreateUserAccountsInstructionDataEncoder,YU as getDecompressSettingsAccountDiscriminatorBytes,_a as getDecompressSettingsAccountInstruction,JU as getDecompressSettingsAccountInstructionDataCodec,ba as getDecompressSettingsAccountInstructionDataDecoder,Ra as getDecompressSettingsAccountInstructionDataEncoder,rk as getDisableDomainConfigDiscriminatorBytes,Oa as getDisableDomainConfigInstruction,nk as getDisableDomainConfigInstructionDataCodec,La as getDisableDomainConfigInstructionDataDecoder,Wa as getDisableDomainConfigInstructionDataEncoder,ct as getDomainConfigAddress,eM as getDomainConfigCodec,Zo as getDomainConfigDecoder,$P as getDomainConfigDiscriminatorBytes,DA as getDomainConfigEncoder,rM as getDomainConfigSize,Ak as getEditDomainConfigDiscriminatorBytes,Fa as getEditDomainConfigInstruction,pk as getEditDomainConfigInstructionAsync,gk as getEditDomainConfigInstructionDataCodec,Va as getEditDomainConfigInstructionDataDecoder,Eo as getEditDomainConfigInstructionDataEncoder,lh as getEditMemberArgsCodec,Sn as getEditMemberArgsDecoder,fn as getEditMemberArgsEncoder,Ik as getEditTransactionManagerUrlDiscriminatorBytes,Ya as getEditTransactionManagerUrlInstruction,Ck as getEditTransactionManagerUrlInstructionDataCodec,ja as getEditTransactionManagerUrlInstructionDataDecoder,qa as getEditTransactionManagerUrlInstructionDataEncoder,_k as getEditUserDelegateDiscriminatorBytes,ei as getEditUserDelegateInstruction,vk as getEditUserDelegateInstructionDataCodec,$a as getEditUserDelegateInstructionDataDecoder,Qa as getEditUserDelegateInstructionDataEncoder,xh as getExpectedSignerCodec,Pt as getExpectedSignerDecoder,Dt as getExpectedSignerEncoder,Dh as getExtensionStructCodec,Et as getExtensionStructDecoder,rn as getExtensionStructEncoder,Lu as getGlobalCounterAddress,cM as getGlobalCounterCodec,rs as getGlobalCounterDecoder,sM as getGlobalCounterDiscriminatorBytes,HA as getGlobalCounterEncoder,dM as getGlobalCounterSize,ww as getLightCpiSigner,ye as getLightProtocolRpc,_h as getLinkWalletArgsCodec,Ln as getLinkWalletArgsDecoder,Wn as getLinkWalletArgsEncoder,Wh as getMemberCodec,xt as getMemberDecoder,St as getMemberEncoder,Bh as getMemberKeyCodec,Q as getMemberKeyDecoder,V as getMemberKeyEncoder,xB as getMultiWalletErrorMessage,Jk as getNativeTransferIntentCompressedDiscriminatorBytes,ui as getNativeTransferIntentCompressedInstruction,Zk as getNativeTransferIntentCompressedInstructionDataCodec,di as getNativeTransferIntentCompressedInstructionDataDecoder,ii as getNativeTransferIntentCompressedInstructionDataEncoder,wk as getNativeTransferIntentDiscriminatorBytes,oi as getNativeTransferIntentInstruction,Vk as getNativeTransferIntentInstructionAsync,Hk as getNativeTransferIntentInstructionDataCodec,ni as getNativeTransferIntentInstructionDataDecoder,Do as getNativeTransferIntentInstructionDataEncoder,Vh as getNewAuthorityArgsCodec,wn as getNewAuthorityArgsDecoder,Nn as getNewAuthorityArgsEncoder,kN as getOriginIndex,zh as getPackedAddressTreeInfoCodec,bt as getPackedAddressTreeInfoDecoder,Rt as getPackedAddressTreeInfoEncoder,jh as getPackedMerkleContextCodec,on as getPackedMerkleContextDecoder,nn as getPackedMerkleContextEncoder,Zh as getPackedStateTreeInfoCodec,yt as getPackedStateTreeInfoDecoder,mt as getPackedStateTreeInfoEncoder,$h as getPausableAccountExtensionCodec,Pn as getPausableAccountExtensionDecoder,Dn as getPausableAccountExtensionEncoder,rR as getPermanentDelegateAccountExtensionCodec,hn as getPermanentDelegateAccountExtensionDecoder,Mn as getPermanentDelegateAccountExtensionEncoder,sR as getPermissionsCodec,Oe as getPermissionsDecoder,Le as getPermissionsEncoder,dR as getProofArgsCodec,M as getProofArgsDecoder,P as getProofArgsEncoder,pR as getRemoveMemberArgsCodec,In as getRemoveMemberArgsDecoder,xn as getRemoveMemberArgsEncoder,lR as getRentConfigCodec,yn as getRentConfigDecoder,mn as getRentConfigEncoder,ko as getSecp256r1MessageHash,SR as getSecp256r1PubkeyCodec,_t as getSecp256r1PubkeyDecoder,Fn as getSecp256r1PubkeyEncoder,SP as getSecp256r1SignatureOffsetsDataDecoder,fP as getSecp256r1SignatureOffsetsDataEncoder,CR as getSecp256r1VerifyArgsCodec,G as getSecp256r1VerifyArgsDecoder,F as getSecp256r1VerifyArgsEncoder,MR as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,zn as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,Gn as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,H as getSecp256r1VerifyInstruction,K2 as getSecp256r1VerifyInstructionDataCodec,Ku as getSecp256r1VerifyInstructionDataDecoder,qu as getSecp256r1VerifyInstructionDataEncoder,uN as getSendAndConfirmTransaction,J_ as getSettingsCodec,gr as getSettingsDecoder,Y_ as getSettingsDiscriminatorBytes,kT as getSettingsEncoder,xe as getSettingsFromIndex,UR as getSettingsIndexWithAddressAndDelegateInfoCodec,Yn as getSettingsIndexWithAddressAndDelegateInfoDecoder,jn as getSettingsIndexWithAddressAndDelegateInfoEncoder,bR as getSettingsIndexWithAddressCodec,qn as getSettingsIndexWithAddressDecoder,Kn as getSettingsIndexWithAddressEncoder,OR as getSettingsMutArgsCodec,K as getSettingsMutArgsDecoder,z as getSettingsMutArgsEncoder,HR as getSettingsReadonlyArgsCodec,Ut as getSettingsReadonlyArgsDecoder,vt as getSettingsReadonlyArgsEncoder,hN as getSignedSecp256r1Key,se as getSolanaRpc,dN as getSolanaRpcEndpoint,GR as getSplInterfacePdaArgsCodec,Wt as getSplInterfacePdaArgsDecoder,kt as getSplInterfacePdaArgsEncoder,jR as getTokenMetadataCodec,bn as getTokenMetadataDecoder,Rn as getTokenMetadataEncoder,mW as getTokenTransferIntentCompressedDiscriminatorBytes,Di as getTokenTransferIntentCompressedInstruction,lW as getTokenTransferIntentCompressedInstructionAsync,yW as getTokenTransferIntentCompressedInstructionDataCodec,Ei as getTokenTransferIntentCompressedInstructionDataDecoder,Mo as getTokenTransferIntentCompressedInstructionDataEncoder,oW as getTokenTransferIntentDiscriminatorBytes,fi as getTokenTransferIntentInstruction,cW as getTokenTransferIntentInstructionAsync,sW as getTokenTransferIntentInstructionDataCodec,Ti as getTokenTransferIntentInstructionDataDecoder,Po as getTokenTransferIntentInstructionDataEncoder,Ou as getTransactionBufferAddress,kW as getTransactionBufferCloseCompressedDiscriminatorBytes,Oi as getTransactionBufferCloseCompressedInstruction,WW as getTransactionBufferCloseCompressedInstructionDataCodec,Li as getTransactionBufferCloseCompressedInstructionDataDecoder,Wi as getTransactionBufferCloseCompressedInstructionDataEncoder,DW as getTransactionBufferCloseDiscriminatorBytes,_i as getTransactionBufferCloseInstruction,PW as getTransactionBufferCloseInstructionDataCodec,bi as getTransactionBufferCloseInstructionDataDecoder,Ri as getTransactionBufferCloseInstructionDataEncoder,rv as getTransactionBufferCodec,XR as getTransactionBufferCreateArgsCodec,Ot as getTransactionBufferCreateArgsDecoder,Lt as getTransactionBufferCreateArgsEncoder,XW as getTransactionBufferCreateCompressedDiscriminatorBytes,Yi as getTransactionBufferCreateCompressedInstruction,QW as getTransactionBufferCreateCompressedInstructionDataCodec,ji as getTransactionBufferCreateCompressedInstructionDataDecoder,qi as getTransactionBufferCreateCompressedInstructionDataEncoder,FW as getTransactionBufferCreateDiscriminatorBytes,Fi as getTransactionBufferCreateInstruction,GW as getTransactionBufferCreateInstructionDataCodec,Vi as getTransactionBufferCreateInstructionDataDecoder,Hi as getTransactionBufferCreateInstructionDataEncoder,Ic as getTransactionBufferDecoder,tv as getTransactionBufferDiscriminatorBytes,QT as getTransactionBufferEncoder,yL as getTransactionBufferExecuteCompressedDiscriminatorBytes,cd as getTransactionBufferExecuteCompressedInstruction,lL as getTransactionBufferExecuteCompressedInstructionDataCodec,sd as getTransactionBufferExecuteCompressedInstructionDataDecoder,od as getTransactionBufferExecuteCompressedInstructionDataEncoder,cL as getTransactionBufferExecuteDiscriminatorBytes,ed as getTransactionBufferExecuteInstruction,aL as getTransactionBufferExecuteInstructionDataCodec,$i as getTransactionBufferExecuteInstructionDataDecoder,Qi as getTransactionBufferExecuteInstructionDataEncoder,vL as getTransactionBufferExtendCompressedDiscriminatorBytes,fd as getTransactionBufferExtendCompressedInstruction,UL as getTransactionBufferExtendCompressedInstructionDataCodec,Td as getTransactionBufferExtendCompressedInstructionDataDecoder,ld as getTransactionBufferExtendCompressedInstructionDataEncoder,EL as getTransactionBufferExtendDiscriminatorBytes,gd as getTransactionBufferExtendInstruction,DL as getTransactionBufferExtendInstructionDataCodec,Ad as getTransactionBufferExtendInstructionDataDecoder,ud as getTransactionBufferExtendInstructionDataEncoder,JL as getTransactionBufferVoteCompressedDiscriminatorBytes,_d as getTransactionBufferVoteCompressedInstruction,ZL as getTransactionBufferVoteCompressedInstructionDataCodec,bd as getTransactionBufferVoteCompressedInstructionDataDecoder,Rd as getTransactionBufferVoteCompressedInstructionDataEncoder,HL as getTransactionBufferVoteDiscriminatorBytes,Dd as getTransactionBufferVoteInstruction,VL as getTransactionBufferVoteInstructionDataCodec,Ed as getTransactionBufferVoteInstructionDataDecoder,Cd as getTransactionBufferVoteInstructionDataEncoder,AO as getTransactionExecuteCompressedDiscriminatorBytes,Fd as getTransactionExecuteCompressedInstruction,gO as getTransactionExecuteCompressedInstructionDataCodec,Vd as getTransactionExecuteCompressedInstructionDataDecoder,Hd as getTransactionExecuteCompressedInstructionDataEncoder,nO as getTransactionExecuteDiscriminatorBytes,Od as getTransactionExecuteInstruction,oO as getTransactionExecuteInstructionDataCodec,Ld as getTransactionExecuteInstructionDataDecoder,Wd as getTransactionExecuteInstructionDataEncoder,bO as getTransactionExecuteSyncCompressedDiscriminatorBytes,eu as getTransactionExecuteSyncCompressedInstruction,_O as getTransactionExecuteSyncCompressedInstructionDataCodec,$d as getTransactionExecuteSyncCompressedInstructionDataDecoder,Qd as getTransactionExecuteSyncCompressedInstructionDataEncoder,xO as getTransactionExecuteSyncDiscriminatorBytes,Yd as getTransactionExecuteSyncInstruction,IO as getTransactionExecuteSyncInstructionDataCodec,jd as getTransactionExecuteSyncInstructionDataDecoder,qd as getTransactionExecuteSyncInstructionDataEncoder,ob as getTransactionMessageAddressTableLookupCodec,ro as getTransactionMessageAddressTableLookupDecoder,to as getTransactionMessageAddressTableLookupEncoder,tb as getTransactionMessageCodec,Nt as getTransactionMessageDecoder,Bt as getTransactionMessageEncoder,ib as getTransactionSyncSignersCodec,J as getTransactionSyncSignersDecoder,Y as getTransactionSyncSignersEncoder,pb as getTransferFeeAccountExtensionCodec,vn as getTransferFeeAccountExtensionDecoder,_n as getTransferFeeAccountExtensionEncoder,lb as getTransferHookAccountExtensionCodec,kn as getTransferHookAccountExtensionDecoder,Un as getTransferHookAccountExtensionEncoder,Sb as getTransportsCodec,Ht as getTransportsDecoder,wt as getTransportsEncoder,w as getUserAccountAddress,Eb as getUserCodec,hb as getUserCreationArgsCodec,De as getUserCreationArgsDecoder,Ee as getUserCreationArgsEncoder,X as getUserDecoder,Vt as getUserEncoder,vb as getUserMutArgsCodec,Ye as getUserMutArgsDecoder,je as getUserMutArgsEncoder,Lb as getUserReadOnlyArgsCodec,ht as getUserReadOnlyArgsDecoder,Mt as getUserReadOnlyArgsEncoder,wb as getUserReadOnlyOrMutateArgsCodec,Ne as getUserReadOnlyOrMutateArgsDecoder,Be as getUserReadOnlyOrMutateArgsEncoder,zb as getUserRoleCodec,Fe as getUserRoleDecoder,Ve as getUserRoleEncoder,Nw as getWalletAddressFromIndex,Me as getWalletAddressFromSettings,av as getWhitelistedAddressTreeCodec,hc as getWhitelistedAddressTreeDecoder,cv as getWhitelistedAddressTreeDiscriminatorBytes,f1 as getWhitelistedAddressTreeEncoder,No as getWhitelistedAddressTreeFromIndex,hw as getWhitelistedAddressTreeIndexFromAddress,_u as getWhitelistedAddressTreesAddress,pB as identifyMultiWalletAccount,mB as identifyMultiWalletInstruction,AN as initialize,ih as isConfigAction,Mh as isExtensionStruct,IB as isMultiWalletError,ub as isTransactionSyncSigners,Vb as isUserReadOnlyOrMutateArgs,I8 as nativeTransferIntent,Rv as parseAddWhitelistedAddressTreesInstruction,qv as parseChangeConfigCompressedInstruction,Bv as parseChangeConfigInstruction,rU as parseCreateCompressedWalletInstruction,gU as parseCreateDomainConfigInstruction,CU as parseCreateDomainUserAccountInstruction,vU as parseCreateGlobalCounterInstruction,VU as parseCreateUserAccountsInstruction,ZU as parseDecompressSettingsAccountInstruction,ok as parseDisableDomainConfigInstruction,mk as parseEditDomainConfigInstruction,Ek as parseEditTransactionManagerUrlInstruction,Uk as parseEditUserDelegateInstruction,Xk as parseNativeTransferIntentCompressedInstruction,Fk as parseNativeTransferIntentInstruction,q2 as parseSecp256r1VerifyInstruction,TW as parseTokenTransferIntentCompressedInstruction,aW as parseTokenTransferIntentInstruction,LW as parseTransactionBufferCloseCompressedInstruction,MW as parseTransactionBufferCloseInstruction,$W as parseTransactionBufferCreateCompressedInstruction,zW as parseTransactionBufferCreateInstruction,TL as parseTransactionBufferExecuteCompressedInstruction,iL as parseTransactionBufferExecuteInstruction,kL as parseTransactionBufferExtendCompressedInstruction,PL as parseTransactionBufferExtendInstruction,XL as parseTransactionBufferVoteCompressedInstruction,FL as parseTransactionBufferVoteInstruction,pO as parseTransactionExecuteCompressedInstruction,sO as parseTransactionExecuteInstruction,vO as parseTransactionExecuteSyncCompressedInstruction,CO as parseTransactionExecuteSyncInstruction,J5 as prepareChangeConfigArgs,n6 as prepareTransactionBundle,l6 as prepareTransactionMessage,I6 as prepareTransactionSync,Jw as retrieveTransactionManager,Xw as serializeConfigActions,N8 as tokenTransferIntent,db as transactionSyncSigners,Hb as userReadOnlyOrMutateArgs,uu as vaultTransactionMessageDeserialize,du as vaultTransactionMessageSerialize,cA as voteTransactionBuffer};//# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map