@revibase/core 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -41
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +429 -1642
- package/dist/index.d.ts +429 -1642
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,getEnumEncoder,getEnumDecoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getU64Encoder,getU64Decoder,getOptionEncoder,getOptionDecoder,getArrayEncoder,getArrayDecoder,getU16Encoder,getU16Decoder,getBooleanEncoder,getBooleanDecoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getUnitEncoder,getUnitDecoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64Encoder,getBase64Decoder,getTransactionEncoder,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,TreeType,encodeBN254toBase58,getLightSystemAccountMetasV2,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import g from'zod';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {p256}from'@noble/curves/nist.js';import {canonicalize}from'json-canonicalize';import {getAssociatedTokenAccountAddress,getTokenDecoder,getTransferSolInstruction}from'gill/programs';import {equalBytes}from'@noble/curves/utils.js';var Xo=new Uint8Array([201,232,212,229,59,241,106,197]);function ZP(){return fixEncoderSize(getBytesEncoder(),8).encode(Xo)}function PA(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["rpIdHash",fixEncoderSize(getBytesEncoder(),32)],["bump",getU8Encoder()],["isDisabled",getU8Encoder()],["rpIdLength",getU8Encoder()],["numOrigins",getU8Encoder()],["rpId",fixEncoderSize(getBytesEncoder(),255)],["origins",fixEncoderSize(getBytesEncoder(),515)]]),e=>({...e,discriminator:Xo}))}function Qo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["rpIdHash",fixDecoderSize(getBytesDecoder(),32)],["bump",getU8Decoder()],["isDisabled",getU8Decoder()],["rpIdLength",getU8Decoder()],["numOrigins",getU8Decoder()],["rpId",fixDecoderSize(getBytesDecoder(),255)],["origins",fixDecoderSize(getBytesDecoder(),515)]])}function XP(){return combineCodec(PA(),Qo())}function $o(e){return decodeAccount(e,Qo())}async function es(e,n,r){let o=await MA(e,n,r);return assertAccountExists(o),o}async function MA(e,n,r){let o=await fetchEncodedAccount(e,n,r);return $o(o)}async function QP(e,n,r){let o=await hA(e,n,r);return assertAccountsExist(o),o}async function hA(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>$o(t))}function $P(){return 846}var ns=new Uint8Array([42,206,176,58,175,129,130,233]);function rM(){return fixEncoderSize(getBytesEncoder(),8).encode(ns)}function VA(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:ns}))}function os(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function nM(){return combineCodec(VA(),os())}function ss(e){return decodeAccount(e,os())}async function oM(e,n,r){let o=await FA(e,n,r);return assertAccountExists(o),o}async function FA(e,n,r){let o=await fetchEncodedAccount(e,n,r);return ss(o)}async function sM(e,n,r){let o=await GA(e,n,r);return assertAccountsExist(o),o}async function GA(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ss(t))}function cM(){return 24}var Br=(r=>(r[r.Initialized=0]="Initialized",r[r.Frozen=1]="Frozen",r))(Br||{});function Nr(){return getEnumEncoder(Br)}function wr(){return getEnumDecoder(Br)}function dM(){return combineCodec(Nr(),wr())}function Hr(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Vr(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function gM(){return combineCodec(Hr(),Vr())}function Fr(){return getStructEncoder([["memberKey",V()],["permissions",Le()],["userArgs",Be()]])}function Gr(){return getStructDecoder([["memberKey",Q()],["permissions",Oe()],["userArgs",Ne()]])}function yM(){return combineCodec(Fr(),Gr())}function zr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Kr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function SM(){return combineCodec(zr(),Kr())}function mt(){return getStructEncoder([["treeInfo",yt()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function lt(){return getStructDecoder([["treeInfo",Tt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function EM(){return combineCodec(mt(),lt())}function ft(){return getStructEncoder([["treeInfo",yt()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function St(){return getStructDecoder([["treeInfo",Tt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function hM(){return combineCodec(ft(),St())}function qr(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function jr(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function _M(){return combineCodec(qr(),jr())}function Qr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function $r(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function kM(){return combineCodec(Qr(),$r())}function xt(){return getStructEncoder([["data",getOptionEncoder(en())]])}function j(){return getStructDecoder([["data",getOptionDecoder(tn())]])}function BM(){return combineCodec(xt(),j())}function en(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(It())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function tn(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(Ct())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function VM(){return combineCodec(en(),tn())}function Et(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",nn()],["tlv",getOptionEncoder(getArrayEncoder(rn()))],["state",Nr()]])}function Dt(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",on()],["tlv",getOptionDecoder(getArrayDecoder(Pt()))],["state",wr()]])}function KM(){return combineCodec(Et(),Dt())}function an(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",un()]])}function dn(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",An()]])}function JM(){return combineCodec(an(),dn())}function un(){return getStructEncoder([["configAccountVersion",getU16Encoder()],["compressToPubkey",getU8Encoder()],["accountVersion",getU8Encoder()],["lamportsPerWrite",getU32Encoder()],["compressionAuthority",fixEncoderSize(getBytesEncoder(),32)],["rentSponsor",fixEncoderSize(getBytesEncoder(),32)],["lastClaimedSlot",getU64Encoder()],["rentExemptionPaid",getU32Encoder()],["reserved",getU32Encoder()],["rentConfig",mn()]])}function An(){return getStructDecoder([["configAccountVersion",getU16Decoder()],["compressToPubkey",getU8Decoder()],["accountVersion",getU8Decoder()],["lamportsPerWrite",getU32Decoder()],["compressionAuthority",fixDecoderSize(getBytesDecoder(),32)],["rentSponsor",fixDecoderSize(getBytesDecoder(),32)],["lastClaimedSlot",getU64Decoder()],["rentExemptionPaid",getU32Decoder()],["reserved",getU32Decoder()],["rentConfig",ln()]])}function $M(){return combineCodec(un(),An())}function we(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(fn())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Fr())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(xn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function He(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Sn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Gr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(In())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function nh(){return combineCodec(we(),He())}function oh(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function sh(e,n){return n.__kind===e}function Cn(){return getStructEncoder([["member",getAddressEncoder()],["role",Ve()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Ee()]])}function En(){return getStructDecoder([["member",getAddressDecoder()],["role",Fe()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",De()]])}function dh(){return combineCodec(Cn(),En())}function fn(){return getStructEncoder([["memberKey",V()],["permissions",Le()]])}function Sn(){return getStructDecoder([["memberKey",Q()],["permissions",Oe()]])}function ph(){return combineCodec(fn(),Sn())}function Mt(){return getStructEncoder([["memberKey",V()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function ht(){return getStructDecoder([["memberKey",Q()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function Th(){return combineCodec(Mt(),ht())}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 Pt(){return getDiscriminatedUnionDecoder([["Placeholder0",getUnitDecoder()],["Placeholder1",getUnitDecoder()],["Placeholder2",getUnitDecoder()],["Placeholder3",getUnitDecoder()],["Placeholder4",getUnitDecoder()],["Placeholder5",getUnitDecoder()],["Placeholder6",getUnitDecoder()],["Placeholder7",getUnitDecoder()],["Placeholder8",getUnitDecoder()],["Placeholder9",getUnitDecoder()],["Placeholder10",getUnitDecoder()],["Placeholder11",getUnitDecoder()],["Placeholder12",getUnitDecoder()],["Placeholder13",getUnitDecoder()],["Placeholder14",getUnitDecoder()],["Placeholder15",getUnitDecoder()],["Placeholder16",getUnitDecoder()],["Placeholder17",getUnitDecoder()],["Placeholder18",getUnitDecoder()],["TokenMetadata",getStructDecoder([["fields",getTupleDecoder([bn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([Pn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([hn()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([vn()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([kn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([jr()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([dn()])]])]])}function Ih(){return combineCodec(rn(),Pt())}function Ch(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Eh(e,n){return n.__kind===e}function Wn(){return getStructEncoder([["settingsMutArgs",K()],["transactionManager",getOptionEncoder(Rt())]])}function Ln(){return getStructDecoder([["settingsMutArgs",q()],["transactionManager",getOptionDecoder(bt())]])}function hh(){return combineCodec(Wn(),Ln())}function It(){return getStructEncoder([["pubkey",V()],["role",getU8Encoder()],["permissions",Le()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function Ct(){return getStructDecoder([["pubkey",Q()],["role",getU8Decoder()],["permissions",Oe()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function vh(){return combineCodec(It(),Ct())}function V(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function Q(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function Wh(){return combineCodec(V(),Q())}function Nn(){return getStructEncoder([["authorityCreationArgs",Ee()],["compressedProofArgs",P()]])}function wn(){return getStructDecoder([["authorityCreationArgs",De()],["compressedProofArgs",M()]])}function Nh(){return combineCodec(Nn(),wn())}function _t(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function vt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function Vh(){return combineCodec(_t(),vt())}function nn(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function on(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function zh(){return combineCodec(nn(),on())}function yt(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function Tt(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function jh(){return combineCodec(yt(),Tt())}function Dn(){return getStructEncoder([])}function Pn(){return getStructDecoder([])}function Zh(){return combineCodec(Dn(),Pn())}function Mn(){return getStructEncoder([])}function hn(){return getStructDecoder([])}function $h(){return combineCodec(Mn(),hn())}function Le(){return getStructEncoder([["mask",getU8Encoder()]])}function Oe(){return getStructDecoder([["mask",getU8Decoder()]])}function rR(){return combineCodec(Le(),Oe())}function P(){return getStructEncoder([["proof",getOptionEncoder(Qr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function M(){return getStructDecoder([["proof",getOptionDecoder($r())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function cR(){return combineCodec(P(),M())}function xn(){return getStructEncoder([["memberKey",V()],["userArgs",Be()]])}function In(){return getStructDecoder([["memberKey",Q()],["userArgs",Ne()]])}function uR(){return combineCodec(xn(),In())}function mn(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function ln(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function pR(){return combineCodec(mn(),ln())}function Fn(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Ut(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function yR(){return combineCodec(Fn(),Ut())}function F(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function G(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function SR(){return combineCodec(F(),G())}function Gn(){return getStructEncoder([["verifyArgs",F()],["domainConfigIndex",getU8Encoder()]])}function zn(){return getStructDecoder([["verifyArgs",G()],["domainConfigIndex",getU8Decoder()]])}function ER(){return combineCodec(Gn(),zn())}function Kn(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function qn(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function MR(){return combineCodec(Kn(),qn())}function jn(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function Yn(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function bR(){return combineCodec(jn(),Yn())}function K(){return getStructEncoder([["accountMeta",mt()],["data",xt()]])}function q(){return getStructDecoder([["accountMeta",lt()],["data",j()]])}function kR(){return combineCodec(K(),q())}function kt(){return getStructEncoder([["accountMeta",ft()],["data",xt()]])}function Wt(){return getStructDecoder([["accountMeta",St()],["data",j()]])}function BR(){return combineCodec(kt(),Wt())}function Lt(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function Ot(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function HR(){return combineCodec(Lt(),Ot())}function Rn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(Hr())]])}function bn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(Vr())]])}function zR(){return combineCodec(Rn(),bn())}function Bt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(Mt())]])}function Nt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(ht())]])}function YR(){return combineCodec(Bt(),Nt())}function wt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(zr())],["addressTableLookups",getArrayEncoder(to())]])}function Ht(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Kr())],["addressTableLookups",getArrayDecoder(ro())]])}function QR(){return combineCodec(wt(),Ht())}function to(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function ro(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function tb(){return combineCodec(to(),ro())}function Y(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([Gn()])]])]])}function J(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([zn()])]])]])}function sb(){return combineCodec(Y(),J())}function cb(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function ab(e,n){return n.__kind===e}function _n(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function vn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function ub(){return combineCodec(_n(),vn())}function Un(){return getStructEncoder([["transferring",getU8Encoder()]])}function kn(){return getStructDecoder([["transferring",getU8Decoder()]])}function pb(){return combineCodec(Un(),kn())}var no=(a=>(a[a.Ble=0]="Ble",a[a.Cable=1]="Cable",a[a.Hybrid=2]="Hybrid",a[a.Internal=3]="Internal",a[a.Nfc=4]="Nfc",a[a.SmartCard=5]="SmartCard",a[a.Usb=6]="Usb",a))(no||{});function Vt(){return getEnumEncoder(no)}function Ft(){return getEnumDecoder(no)}function yb(){return combineCodec(Vt(),Ft())}function Gt(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",V()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(Vt()))],["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(Ft()))],["wallets",getArrayDecoder(Yn())],["role",Fe()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function xb(){return combineCodec(Gt(),X())}function Ee(){return getStructEncoder([["addressTreeInfo",_t()],["outputStateTreeIndex",getU8Encoder()]])}function De(){return getStructDecoder([["addressTreeInfo",vt()],["outputStateTreeIndex",getU8Decoder()]])}function Db(){return combineCodec(Ee(),De())}function je(){return getStructEncoder([["accountMeta",mt()],["data",Gt()]])}function Ye(){return getStructDecoder([["accountMeta",lt()],["data",X()]])}function Rb(){return combineCodec(je(),Ye())}function Rt(){return getStructEncoder([["accountMeta",ft()],["data",Gt()]])}function bt(){return getStructDecoder([["accountMeta",St()],["data",X()]])}function Ub(){return combineCodec(Rt(),bt())}function Be(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Rt()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([je()])]])]])}function Ne(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([bt()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([Ye()])]])]])}function Ob(){return combineCodec(Be(),Ne())}function Bb(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Nb(e,n){return n.__kind===e}var Re=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(Re||{});function Ve(){return getEnumEncoder(Re)}function Fe(){return getEnumDecoder(Re)}function Vb(){return combineCodec(Ve(),Fe())}var yc=new Uint8Array([223,179,163,190,177,224,67,173]);function K_(){return fixEncoderSize(getBytesEncoder(),8).encode(yc)}function WT(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(It())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:yc}))}function pr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(Ct())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function q_(){return combineCodec(WT(),pr())}function Tc(e){return decodeAccount(e,pr())}async function j_(e,n,r){let o=await oo(e,n,r);return assertAccountExists(o),o}async function oo(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Tc(o)}async function Y_(e,n,r){let o=await LT(e,n,r);return assertAccountsExist(o),o}async function LT(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Tc(t))}var Cc=new Uint8Array([90,36,35,219,93,225,110,96]);function Q_(){return fixEncoderSize(getBytesEncoder(),8).encode(Cc)}function $T(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["multiWalletSettings",getAddressEncoder()],["multiWalletBump",getU8Encoder()],["canExecute",getBooleanEncoder()],["preauthorizeExecution",getBooleanEncoder()],["validTill",getU64Encoder()],["payer",getAddressEncoder()],["bump",getU8Encoder()],["bufferIndex",getU8Encoder()],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["creator",V()],["executor",V()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(V())],["expectedSigners",getArrayEncoder(Mt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Cc}))}function Ec(){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(ht())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function $_(){return combineCodec($T(),Ec())}function Dc(e){return decodeAccount(e,Ec())}async function Pc(e,n,r){let o=await e1(e,n,r);return assertAccountExists(o),o}async function e1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Dc(o)}async function ev(e,n,r){let o=await t1(e,n,r);return assertAccountsExist(o),o}async function t1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Dc(t))}var Rc=new Uint8Array([105,23,173,2,197,255,80,87]);function nv(){return fixEncoderSize(getBytesEncoder(),8).encode(Rc)}function S1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Rc}))}function bc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function ov(){return combineCodec(S1(),bc())}function _c(e){return decodeAccount(e,bc())}async function vc(e,n,r){let o=await x1(e,n,r);return assertAccountExists(o),o}async function x1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return _c(o)}async function sv(e,n,r){let o=await I1(e,n,r);return assertAccountsExist(o),o}async function I1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>_c(t))}function l({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function O(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function y(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let o=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:O(r.value),role:Uc(r.value)?upgradeRoleToSigner(o):o,...Uc(r.value)?{signer:r.value}:{}})}}function Uc(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Wc=new Uint8Array([8]);function Cv(){return fixEncoderSize(getBytesEncoder(),1).encode(Wc)}function po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Wc}))}function Lc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function Ev(){return combineCodec(po(),Lc())}async function Oc(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:po().encode(c),programAddress:r})}function Dv(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:po().encode(c),programAddress:r})}function Pv(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:Lc().decode(e.data)}}var Vc=new Uint8Array([9]);function Uv(){return fixEncoderSize(getBytesEncoder(),1).encode(Vc)}function Fc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(we())],["signers",getArrayEncoder(Y())],["compressedProofArgs",getOptionEncoder(P())]]),e=>({...e,discriminator:Vc}))}function Gc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(He())],["signers",getArrayDecoder(J())],["compressedProofArgs",getOptionDecoder(M())]])}function kv(){return combineCodec(Fc(),Gc())}function zc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Fc().encode(c),programAddress:r})}function Wv(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Gc().decode(e.data)}}var Jc=new Uint8Array([19]);function Vv(){return fixEncoderSize(getBytesEncoder(),1).encode(Jc)}function Zc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(we())],["signers",getArrayEncoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Jc}))}function Xc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(He())],["signers",getArrayDecoder(J())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function Fv(){return combineCodec(Zc(),Xc())}function Qc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Zc().encode(c),programAddress:r})}function Gv(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Xc().decode(e.data)}}var ta=new Uint8Array([18]);function Zv(){return fixEncoderSize(getBytesEncoder(),1).encode(ta)}function mo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["addressTreeInfo",_t()],["outputStateTreeIndex",getU8Encoder()],["userArgs",Be()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:ta}))}function ra(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["addressTreeInfo",vt()],["outputStateTreeIndex",getU8Decoder()],["userArgs",Ne()],["settingsIndex",getU128Decoder()]])}function Xv(){return combineCodec(mo(),ra())}async function na(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:mo().encode(c),programAddress:r})}function Qv(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:mo().encode(c),programAddress:r})}function $v(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:ra().decode(e.data)}}var Aa=new Uint8Array([0]);function cU(){return fixEncoderSize(getBytesEncoder(),1).encode(Aa)}function yo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",Ee()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Aa}))}function ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",De()],["compressedProofArgs",M()]])}function aU(){return combineCodec(yo(),ga())}async function pa(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:yo().encode(c),programAddress:r})}function iU(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:yo().encode(c),programAddress:r})}function dU(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:ga().decode(e.data)}}var ya=new Uint8Array([4]);function yU(){return fixEncoderSize(getBytesEncoder(),1).encode(ya)}function To(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["member",Fn()],["role",Ve()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(Vt())],["userAccountCreationArgs",Ee()],["linkWalletArgs",getOptionEncoder(Wn())]]),e=>({...e,discriminator:ya}))}function Ta(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["member",Ut()],["role",Fe()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Ft())],["userAccountCreationArgs",De()],["linkWalletArgs",getOptionDecoder(Ln())]])}function TU(){return combineCodec(To(),Ta())}async function fa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:To().encode(c),programAddress:r})}function fU(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:To().encode(c),programAddress:r})}function SU(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:Ta().decode(e.data)}}var xa=new Uint8Array([3]);function PU(){return fixEncoderSize(getBytesEncoder(),1).encode(xa)}function So(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:xa}))}function Ia(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function MU(){return combineCodec(So(),Ia())}async function Ca(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(c),a=y(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:So().encode({}),programAddress:r})}function hU(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(c),a=y(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:So().encode({}),programAddress:r})}function RU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:Ia().decode(e.data)}}var Da=new Uint8Array([5]);function LU(){return fixEncoderSize(getBytesEncoder(),1).encode(Da)}function Io(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["createUserArgs",getArrayEncoder(Cn())]]),e=>({...e,discriminator:Da}))}function Pa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayDecoder(En())]])}function OU(){return combineCodec(Io(),Pa())}async function Ma(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Io().encode(c),programAddress:r})}function BU(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Io().encode(c),programAddress:r})}function NU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Pa().decode(e.data)}}var ba=new Uint8Array([17]);function KU(){return fixEncoderSize(getBytesEncoder(),1).encode(ba)}function _a(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",K()],["compressedProofArgs",P()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:ba}))}function va(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",q()],["compressedProofArgs",M()],["signers",getArrayDecoder(J())]])}function qU(){return combineCodec(_a(),va())}function Ua(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:_a().encode(c),programAddress:r})}function jU(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:va().decode(e.data)}}var La=new Uint8Array([2]);function $U(){return fixEncoderSize(getBytesEncoder(),1).encode(La)}function Oa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:La}))}function Ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function ek(){return combineCodec(Oa(),Ba())}function Na(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.admin),...a],data:Oa().encode(c),programAddress:r})}function tk(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:Ba().decode(e.data)}}var Fa=new Uint8Array([1]);function ik(){return fixEncoderSize(getBytesEncoder(),1).encode(Fa)}function Eo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Nn())]]),e=>({...e,discriminator:Fa}))}function Ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(wn())]])}function dk(){return combineCodec(Eo(),Ga())}async function uk(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Eo().encode(c),programAddress:r})}function za(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Eo().encode(c),programAddress:r})}function Ak(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:o(),whitelistedAddressTrees:o(),systemProgram:r()},data:Ga().decode(e.data)}}var ja=new Uint8Array([6]);function fk(){return fixEncoderSize(getBytesEncoder(),1).encode(ja)}function Ya(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",je()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",P()]]),e=>({...e,discriminator:ja}))}function Ja(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ye()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",M()]])}function Sk(){return combineCodec(Ya(),Ja())}function Za(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.authority),...a],data:Ya().encode(c),programAddress:r})}function xk(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{authority:r()},data:Ja().decode(e.data)}}var $a=new Uint8Array([7]);function hk(){return fixEncoderSize(getBytesEncoder(),1).encode($a)}function ei(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",je()],["secp256r1VerifyArgs",getOptionEncoder(F())],["delegateTo",getOptionEncoder(Kn())],["oldSettingsMutArgs",getOptionEncoder(K())],["newSettingsMutArgs",getOptionEncoder(K())],["compressedProofArgs",P()]]),e=>({...e,discriminator:$a}))}function ti(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ye()],["secp256r1VerifyArgs",getOptionDecoder(G())],["delegateTo",getOptionDecoder(qn())],["oldSettingsMutArgs",getOptionDecoder(q())],["newSettingsMutArgs",getOptionDecoder(q())],["compressedProofArgs",M()]])}function Rk(){return combineCodec(ei(),ti())}function ri(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.feePayer),s(t.signer),s(t.oldSettings),s(t.newSettings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.domainConfig),...a],data:ei().encode(c),programAddress:r})}function bk(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:o(),oldSettings:o(),newSettings:o(),slotHashSysvar:o(),instructionsSysvar:o(),domainConfig:o()},data:ti().decode(e.data)}}var oi=new Uint8Array([29]);function Ok(){return fixEncoderSize(getBytesEncoder(),1).encode(oi)}function Do(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:oi}))}function si(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())]])}function Bk(){return combineCodec(Do(),si())}async function Nk(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(O(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Do().encode(c),programAddress:r})}function ci(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Do().encode(c),programAddress:r})}function wk(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:si().decode(e.data)}}var di=new Uint8Array([27]);function qk(){return fixEncoderSize(getBytesEncoder(),1).encode(di)}function ui(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:di}))}function Ai(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function jk(){return combineCodec(ui(),Ai())}function gi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:ui().encode(c),programAddress:r})}function Yk(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Ai().decode(e.data)}}var fi=new Uint8Array([30]);function tW(){return fixEncoderSize(getBytesEncoder(),1).encode(fi)}function Po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Lt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(Et())],["compressedProofArgs",getOptionEncoder(P())],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:fi}))}function Si(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Ot())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Dt())],["compressedProofArgs",getOptionDecoder(M())],["signers",getArrayDecoder(J())]])}function rW(){return combineCodec(Po(),Si())}async function nW(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(O(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Po().encode(c),programAddress:r})}function xi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Po().encode(c),programAddress:r})}function oW(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:Si().decode(e.data)}}var Di=new Uint8Array([28]);function AW(){return fixEncoderSize(getBytesEncoder(),1).encode(Di)}function Mo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Lt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(Et())],["signers",getArrayEncoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Di}))}function Pi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Ot())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Dt())],["signers",getArrayDecoder(J())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function gW(){return combineCodec(Mo(),Pi())}async function pW(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Mo().encode(c),programAddress:r})}function Mi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Mo().encode(c),programAddress:r})}function mW(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:Pi().decode(e.data)}}var bi=new Uint8Array([13]);function IW(){return fixEncoderSize(getBytesEncoder(),1).encode(bi)}function _i(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:bi}))}function vi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function CW(){return combineCodec(_i(),vi())}function Ui(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:_i().encode(c),programAddress:r})}function EW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:vi().decode(e.data)}}var Li=new Uint8Array([23]);function _W(){return fixEncoderSize(getBytesEncoder(),1).encode(Li)}function Oi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Li}))}function Bi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function vW(){return combineCodec(Oi(),Bi())}function Ni(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.rentCollector),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Oi().encode(c),programAddress:r})}function UW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:Bi().decode(e.data)}}var Vi=new Uint8Array([10]);function wW(){return fixEncoderSize(getBytesEncoder(),1).encode(Vi)}function Fi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Bt()],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Vi}))}function Gi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Nt()],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function HW(){return combineCodec(Fi(),Gi())}function zi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:Fi().encode(c),programAddress:r})}function VW(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:Gi().decode(e.data)}}var ji=new Uint8Array([20]);function YW(){return fixEncoderSize(getBytesEncoder(),1).encode(ji)}function Yi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Bt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",kt()],["compressedProofArgs",P()]]),e=>({...e,discriminator:ji}))}function Ji(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Nt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Wt()],["compressedProofArgs",M()]])}function JW(){return combineCodec(Yi(),Ji())}function Zi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:Yi().encode(c),programAddress:r})}function ZW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:Ji().decode(e.data)}}var $i=new Uint8Array([14]);function nL(){return fixEncoderSize(getBytesEncoder(),1).encode($i)}function ed(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:$i}))}function td(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function oL(){return combineCodec(ed(),td())}function rd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:ed().encode(c),programAddress:r})}function sL(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:td().decode(e.data)}}var sd=new Uint8Array([24]);function gL(){return fixEncoderSize(getBytesEncoder(),1).encode(sd)}function cd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:sd}))}function ad(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function pL(){return combineCodec(cd(),ad())}function id(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:cd().encode(c),programAddress:r})}function mL(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:ad().decode(e.data)}}var Ad=new Uint8Array([12]);function xL(){return fixEncoderSize(getBytesEncoder(),1).encode(Ad)}function gd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Ad}))}function pd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function IL(){return combineCodec(gd(),pd())}function md(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.transactionBuffer),...a],data:gd().encode(c),programAddress:r})}function CL(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:pd().decode(e.data)}}var Td=new Uint8Array([22]);function RL(){return fixEncoderSize(getBytesEncoder(),1).encode(Td)}function fd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Td}))}function Sd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function bL(){return combineCodec(fd(),Sd())}function xd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.transactionBuffer),...a],data:fd().encode(c),programAddress:r})}function _L(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:Sd().decode(e.data)}}var Ed=new Uint8Array([11]);function BL(){return fixEncoderSize(getBytesEncoder(),1).encode(Ed)}function Dd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Ed}))}function Pd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function NL(){return combineCodec(Dd(),Pd())}function Md(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Dd().encode(c),programAddress:r})}function wL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:Pd().decode(e.data)}}var bd=new Uint8Array([21]);function qL(){return fixEncoderSize(getBytesEncoder(),1).encode(bd)}function _d(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",kt()],["compressedProofArgs",P()]]),e=>({...e,discriminator:bd}))}function vd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Wt()],["compressedProofArgs",M()]])}function jL(){return combineCodec(_d(),vd())}function Ud(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:_d().encode(c),programAddress:r})}function YL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:vd().decode(e.data)}}var Ld=new Uint8Array([15]);function eO(){return fixEncoderSize(getBytesEncoder(),1).encode(Ld)}function Od(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Ld}))}function Bd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function tO(){return combineCodec(Od(),Bd())}function Nd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.transactionBuffer),...a],data:Od().encode({}),programAddress:r})}function rO(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:Bd().decode(e.data)}}var Vd=new Uint8Array([25]);function iO(){return fixEncoderSize(getBytesEncoder(),1).encode(Vd)}function Fd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Vd}))}function Gd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function dO(){return combineCodec(Fd(),Gd())}function zd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.transactionBuffer),...a],data:Fd().encode(c),programAddress:r})}function uO(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:Gd().decode(e.data)}}var jd=new Uint8Array([16]);function TO(){return fixEncoderSize(getBytesEncoder(),1).encode(jd)}function Yd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",wt()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:jd}))}function Jd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Ht()],["signers",getArrayDecoder(J())]])}function fO(){return combineCodec(Yd(),Jd())}function Zd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Yd().encode(c),programAddress:r})}function SO(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Jd().decode(e.data)}}var $d=new Uint8Array([26]);function MO(){return fixEncoderSize(getBytesEncoder(),1).encode($d)}function eu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",wt()],["signers",getArrayEncoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",P()]]),e=>({...e,discriminator:$d}))}function tu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Ht()],["signers",getArrayDecoder(J())],["settingsMutArgs",q()],["compressedProofArgs",M()]])}function hO(){return combineCodec(eu(),tu())}function ru(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:eu().encode(c),programAddress:r})}function RO(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:tu().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",_C=(c=>(c[c.DomainConfig=0]="DomainConfig",c[c.GlobalCounter=1]="GlobalCounter",c[c.Settings=2]="Settings",c[c.TransactionBuffer=3]="TransactionBuffer",c[c.WhitelistedAddressTree=4]="WhitelistedAddressTree",c))(_C||{});function uB(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([201,232,212,229,59,241,106,197])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([42,206,176,58,175,129,130,233])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([223,179,163,190,177,224,67,173])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([90,36,35,219,93,225,110,96])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([105,23,173,2,197,255,80,87])),0))return 4;throw new Error("The provided account could not be identified as a multiWallet account.")}var vC=(S=>(S[S.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",S[S.ChangeConfig=1]="ChangeConfig",S[S.ChangeConfigCompressed=2]="ChangeConfigCompressed",S[S.CreateCompressedWallet=3]="CreateCompressedWallet",S[S.CreateDomainConfig=4]="CreateDomainConfig",S[S.CreateDomainUserAccount=5]="CreateDomainUserAccount",S[S.CreateGlobalCounter=6]="CreateGlobalCounter",S[S.CreateUserAccounts=7]="CreateUserAccounts",S[S.DecompressSettingsAccount=8]="DecompressSettingsAccount",S[S.DisableDomainConfig=9]="DisableDomainConfig",S[S.EditDomainConfig=10]="EditDomainConfig",S[S.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",S[S.EditUserDelegate=12]="EditUserDelegate",S[S.NativeTransferIntent=13]="NativeTransferIntent",S[S.NativeTransferIntentCompressed=14]="NativeTransferIntentCompressed",S[S.TokenTransferIntent=15]="TokenTransferIntent",S[S.TokenTransferIntentCompressed=16]="TokenTransferIntentCompressed",S[S.TransactionBufferClose=17]="TransactionBufferClose",S[S.TransactionBufferCloseCompressed=18]="TransactionBufferCloseCompressed",S[S.TransactionBufferCreate=19]="TransactionBufferCreate",S[S.TransactionBufferCreateCompressed=20]="TransactionBufferCreateCompressed",S[S.TransactionBufferExecute=21]="TransactionBufferExecute",S[S.TransactionBufferExecuteCompressed=22]="TransactionBufferExecuteCompressed",S[S.TransactionBufferExtend=23]="TransactionBufferExtend",S[S.TransactionBufferExtendCompressed=24]="TransactionBufferExtendCompressed",S[S.TransactionBufferVote=25]="TransactionBufferVote",S[S.TransactionBufferVoteCompressed=26]="TransactionBufferVoteCompressed",S[S.TransactionExecute=27]="TransactionExecute",S[S.TransactionExecuteCompressed=28]="TransactionExecuteCompressed",S[S.TransactionExecuteSync=29]="TransactionExecuteSync",S[S.TransactionExecuteSyncCompressed=30]="TransactionExecuteSyncCompressed",S))(vC||{});function AB(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 4;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 5;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 6;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 7;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 8;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 9;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 10;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 11;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 12;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 13;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 14;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 15;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 16;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 17;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 18;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 19;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 20;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 21;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 22;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 23;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 24;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 25;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 26;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 27;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 28;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 29;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 30;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var kC=6e3,WC=6001,LC=6002,OC=6003,BC=6004,NC=6005,wC=6006,HC=6007,VC=6008,FC=6009,GC=6010,zC=6011,KC=6012,qC=6013,jC=6014,YC=6015,JC=6016,ZC=6017,XC=6018,QC=6019,$C=6020,eE=6021,tE=6022,rE=6023,nE=6024,oE=6025,sE=6026,cE=6027,aE=6028,iE=6029,dE=6030,uE=6031,AE=6032,gE=6033,pE=6034,mE=6035,lE=6036,yE=6037,TE=6038,fE=6039,SE=6040,xE=6041,IE=6042,CE=6043,EE=6044,DE=6045,PE=6046,ME=6047,hE=6048,RE=6049,bE=6050,_E=6051,vE=6052,UE=6053,kE=6054,WE=6055,LE=6056,OE=6057,BE=6058,NE=6059,wE=6060,HE=6061,VE=6062,FE=6063,GE=6064,zE=6065,KE=6066,qE=6067,jE=6068,YE=6069,JE=6070,ZE=6071,XE=6072,QE=6073,$E=6074,eD=6075,tD=6076,rD=6077,nD=6078,oD=6079,sD=6080,cD=6081,aD=6082,iD=6083,dD=6084,uD=6085,AD=6086,nu;process.env.NODE_ENV!=="production"&&(nu={[uE]:"This member is already delegated to another wallet.",[HC]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[rD]:"Clock sysvar access failed. This may indicate a system error.",[_E]:"Missing credential id.",[UE]:"The domain configuration account is disabled. Please contact support or try again later.",[kE]:"Missing domain configuration account.",[eD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[AD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[GC]:"Duplicate public keys detected among members. Each member must have a unique key.",[FC]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[eE]:"No members provided. A multisig wallet must contain at least one member.",[wE]:"Slot numbers list is empty. At least one slot number is required for validation.",[XC]:"Expected a User with Administrator role for this instruction.",[VC]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[JC]:"Expected a User with Transaction Manager role for this instruction.",[SE]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[xE]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[IE]:"Declared buffer size does not match the actual serialized size.",[NE]:"Failed to compute hash. This may indicate a system error.",[pE]:"Not enough members with vote permission to meet the approval threshold.",[AE]:"At least one signer with execute permission is required to proceed.",[gE]:"At least one signer with initiate permission is required to perform this action.",[sE]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[$E]:"Invalid account index in transaction message. The account index is out of bounds.",[OE]:"Address Tree supplied is not part of the whitelisted address trees.",[QC]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[aE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[fE]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[HE]:"Member key conversion failed. The provided key format is invalid.",[mE]:"Only delegated members are allowed for this transaction.",[oE]:"Unexpected number of accounts provided for this instruction.",[qC]:"User with Permanent Member role must have a delegated wallet.",[WC]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[BC]:"The extracted public key has an invalid length or encoding.",[kC]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[OC]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[bE]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[hE]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[rE]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[ZE]:"Invalid source type for token transfer. The source account type is not supported.",[ZC]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[YC]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[nE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[sD]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[cE]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[oD]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[JE]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[NC]:"The extracted WebAuthn signed message payload is malformed.",[PE]:"An input string exceeds the maximum allowed character length.",[WE]:"This member is not registered under the provided domain configuration.",[GE]:"Member not found in settings. Cannot remove a member that does not exist.",[QE]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[iE]:"A required account is missing from the instruction context.",[VE]:"Compressed proof arguments are missing. Required for compressed account operations.",[qE]:"Missing compressed token account. Required for token transfer operations.",[cD]:"Missing destination token account. Required for token transfer operations.",[YE]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[FE]:"Light CPI accounts are missing. Required for compressed account operations.",[dE]:"User mutation arguments are required when performing add or remove delegate operations.",[dD]:"Missing new authority account. Required for domain configuration updates.",[iD]:"Missing settings account. Required for delegate operations on compressed wallets.",[BE]:"Compressed settings data is missing. The settings account must be initialized with data.",[aD]:"Missing source token account. Required for token transfer operations.",[jE]:"Missing SPL interface PDA. Required for token transfer operations.",[ME]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[tD]:"User account address is missing. Required for secp256r1 signature verification.",[uD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[yE]:"No valid signer found in this transaction.",[$C]:"Only one administrator is allowed per wallet.",[KC]:"Only one permanent member is allowed per wallet.",[jC]:"Only one transaction manager is allowed per wallet.",[LE]:"The given origin index is not in the whitelisted origins.",[KE]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[zC]:"Permanent members cannot be removed from a wallet.",[DE]:"Writable CPI calls to protected accounts are not permitted.",[wC]:"The rpIdHash extracted from the signed message does not match the expected value.",[zE]:"Settings key mismatch. The provided settings key does not match the expected value.",[LC]:"The signature index provided is out of bounds for the secp256r1 instruction.",[RE]:"The specified slot number was not found in the provided slot history.",[XE]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[tE]:"Too many members: a maximum of 4 members are supported.",[CE]:"This transaction has expired. It must be executed within 3 minutes of approval.",[EE]:"This transaction has not yet reached the required approval threshold.",[vE]:"Missing transports.",[TE]:"Only the transaction creator or rent payer may close this transaction buffer.",[nD]:"Unauthorized: Only the admin account is allowed to perform this action.",[lE]:"Member is not part of the expected signers for this transaction."});function TB(e){return process.env.NODE_ENV!=="production"?nu[e]:"Error message not available in production bundles."}function fB(e,n,r){return isProgramError(e,n,A,r)}async function bB({admin:e,addressTree:n}){return Oc({payer:e,addressTree:n,remainingAccounts:[]})}var be=class extends Error{constructor(r,o,t){super(r);this.code=o;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},Je=class extends be{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},$=class extends be{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},v=class extends be{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},ot=class extends be{constructor(r,o,t){super(r,"NETWORK_ERROR",{statusCode:o,url:t});this.statusCode=o;this.url=t;}},Er=class extends be{constructor(r,o,t){super(`Operation "${r}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=o;this.lastError=t;}},Dr=class extends be{constructor(r,o,t){super(r,"PERMISSION_ERROR",{required:o,actual:t});this.required=o;this.actual=t;}};var qt={Ed25519:1,Secp256r1:2};var OB=g.looseObject({publicKey:g.string(),walletAddress:g.string(),settingsIndexWithAddress:g.object({index:g.union([g.number(),g.bigint()]),settingsAddressTreeIndex:g.number()})}),gD=g.object({devicePublicKey:g.string(),platform:g.enum(["web","ios","android"]),userAgent:g.string().optional(),browser:g.object({name:g.string().optional(),version:g.string().optional(),major:g.string().optional(),type:g.string().optional()}).optional(),engine:g.object({name:g.string().optional(),version:g.string().optional()}).optional(),cpu:g.object({architecture:g.string().optional()}).optional(),device:g.object({type:g.string().optional(),vendor:g.string().optional(),model:g.string().optional()}).optional(),os:g.object({name:g.string().optional(),version:g.string().optional()}).optional(),app:g.object({name:g.string().optional(),version:g.string().optional(),build:g.string().optional()}).optional(),display:g.object({screenWidth:g.number().optional(),screenHeight:g.number().optional(),viewportWidth:g.number().optional(),viewportHeight:g.number().optional(),devicePixelRatio:g.number().optional()}).optional(),locale:g.string().optional(),timezone:g.string().optional(),push:g.object({provider:g.enum(["expo","fcm","apns"]),token:g.string()}).optional(),website:g.string().optional(),nativeApp:g.string().optional(),createdAt:g.iso.datetime().optional()}).strict(),ou=g.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),BB=g.object({transactionActionType:ou,transactionAddress:g.string(),transactionMessageBytes:g.array(g.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),pD=g.object({transactionActionType:ou,transactionAddress:g.string(),transactionMessageBytes:g.base64()}).strict(),su=g.object({phase:g.literal("start"),clientOrigin:g.url(),signer:g.string().optional(),rid:g.string(),validTill:g.number(),providerOrigin:g.string(),rpId:g.string(),data:g.object({type:g.literal("message"),payload:g.string(),requireTwoFactorAuthentication:g.boolean().default(false)}).strict()}).strict(),cu=g.object({phase:g.literal("start"),clientOrigin:g.url(),signer:g.string().optional(),rid:g.string(),validTill:g.number(),providerOrigin:g.string(),rpId:g.string(),data:g.object({type:g.literal("transaction"),payload:pD}).strict()}).strict(),au=g.object({startRequest:g.union([su,cu]),authResponse:g.custom(),client:g.object({clientOrigin:g.url(),jws:g.string()}).strict(),device:g.object({jwk:g.base64(),jws:g.string(),deviceProfile:gD}).strict()}).strict(),iu=g.object({signer:g.string(),userAddressTreeIndex:g.number().optional(),additionalInfo:g.looseObject({}).optional()}).strict(),mD=g.object({slotHash:g.string(),slotNumber:g.string(),estimatedSlotHashExpiry:g.number(),originIndex:g.number(),crossOrigin:g.boolean()}).strict(),NB=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("message"),payload:iu.extend(au.shape).extend({startRequest:su,transactionManager:g.object({publicKey:g.string(),signature:g.string()}).optional()})}).strict()}).strict(),wB=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("transaction"),payload:iu.extend(au.shape).extend(mD.shape).extend({startRequest:cu})}).strict()}).strict();var Pe={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},_e=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,o)=>r|o,0))}static all(){return new e(Object.values(Pe).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var bo=33,ve=class{_bn;constructor(n){typeof n=="string"?this._bn=new Uint8Array(getBase58Encoder().encode(n)):this._bn=new Uint8Array(n),this.validateKeyLength(this._bn);}validateKeyLength(n){if(n.length!==bo)throw new Error(`Invalid public key length, expected ${bo} bytes but got ${n.length}`)}toBase58(){return getBase58Decoder().decode(this.toBytes())}toTruncatedBuffer(){let n=this.toBuffer();return n.subarray(1,n.length)}toBuffer(){if(!this._bn)throw new Error("Invalid public key input");let n=this._bn;if(n.byteLength===bo)return n;throw new Error("Invalid public key input")}toBytes(){let n=this.toBuffer();return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}toString(){return this.toBase58()}toJSON(){return this.toBase58()}},U=class extends ve{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(n,r){super(n),this.verifyArgs=r.verifyArgs,this.domainConfig=r.domainConfig,this.authData=r.authData,this.signature=r.signature,this.originIndex=r.originIndex,this.crossOrigin=r.crossOrigin,this.clientAndDeviceHash=r.clientAndDeviceHash,this.authResponse=r.authResponse;}};function TD(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function fD(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var uu=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(TD())],["addressTableLookups",getArrayCodec(fD())]]);function Au(e){return uu.encode({numSigners:e.header.numSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,accountKeys:e.staticAccounts,instructions:e.instructions.map(r=>({programAddressIndex:r.programAddressIndex,accountIndices:r.accountIndices??[],data:Array.from(r.data??[])})),addressTableLookups:e.version!=="legacy"?e.addressTableLookups?.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes,writableIndexes:r.writableIndexes}))??[]:[]})}function gu(e){let n=uu.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}var ie={};function cN(){if(!ie.solanaRpcEndpoint)throw new Je("RPC endpoint");return ie.solanaRpcEndpoint}function ye(){if(!ie.lightProtocolRpc)throw new Je("Light Protocol RPC");return ie.lightProtocolRpc}function se(){if(!ie.solanaRpc)throw new Je("Solana RPC");return ie.solanaRpc}function aN(){if(!ie.sendAndConfirm)throw new Je("Send and confirm transaction function");return ie.sendAndConfirm}function iN({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r}){ie.solanaRpcEndpoint=e,ie.lightProtocolRpc=createRpc(e,r,n);let{rpc:o,sendAndConfirmTransaction:t}=createSolanaClient({urlOrMoniker:e});ie.solanaRpc=o,ie.sendAndConfirm=t;}function Pr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function CD(e){let n=new Uint8Array(e.length/2);for(let r=0;r<n.length;r++)n[r]=parseInt(e.slice(r*2,r*2+2),16);return n}function mu(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 yu(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let h=n&127;r+=h;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let o=e[r+1],t=r+2,c=e.slice(t,t+o);if(r=t+o,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,s=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=s[0]===0&&s.length>32?s.slice(1):s;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let m=new Uint8Array(32);m.set(d,32-d.length);let p=p256.Point.CURVE().n>>1n,T=BigInt("0x"+Pr(u)),C=(T>p?p256.Point.CURVE().n-T:T).toString(16).padStart(64,"0"),f=CD(C);return new Uint8Array([...m,...f])}function jt(e){let n=pe(e.response.clientDataJSON),r=pe(e.response.authenticatorData),o=sha256(n);return new Uint8Array([...r,...o])}function PN(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+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=mu(c),a=yu(pe(o)),s=await at({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 m=(await se().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!m)throw new $("Slot sysvar","Unable to fetch slot sysvar data");let p=getBase64Encoder().encode(m[0]);c=getU64Decoder().decode(p.subarray(0,8)).toString(),a=p.subarray(8,40),t=getBase58Decoder().decode(a),i=Date.now()+512*400;}else a=getBase58Encoder().encode(t);let s=sha256(typeof e.transactionMessageBytes=="string"?getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),d=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 UN(e,n){return new Uint8Array([...jt(e),...getUtf8Encoder().encode(canonicalize(n))])}function ko(e){let n=jt(e);return sha256(n)}function kN(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 WN(e,n){let{data:r}=await es(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 LN(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function ON(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}var Wo=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"];function ce(e,n=0){let r=e instanceof U?e:void 0,o=r?.verifyArgs&&n!==-1?some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs.clientDataJson?jt(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:o,signature:c,message:i,publicKey:a}}function ke(e,n,r=[]){let o=[];for(let t of e)if(t instanceof U){let c=r.length,{domainConfig:i,verifyArgs:a,signature:s,publicKey:d,message:u}=ce(t,c);if(u&&s&&d&&r.push({message:u,signature:s,publicKey:d}),i){let m=n.addPreAccounts([{address:i,role:AccountRole.READONLY}]).get(i)?.index;a.__option==="Some"&&m!==void 0&&o.push({__kind:"Secp256r1",fields:[{domainConfigIndex:m,verifyArgs:a.value}]});}}else {let c=n.addPreAccounts([{address:t.address,role:AccountRole.READONLY_SIGNER,signer:t}]).get(t.address)?.index;c!==void 0&&o.push({__kind:"Ed25519",fields:[c]});}return {secp256r1VerifyInput:r,transactionSyncSigners:o}}function Te(e){if(e instanceof ve)return {keyType:qt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:qt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function Iu(e){return e instanceof U?e.toString():e.address.toString()}function de(e){let n=new Set,r=[];for(let t of e)n.has(Iu(t))||(r.push(t),n.add(Iu(t)));let o=r.filter(t=>t instanceof U);if(o.length>1)throw new v(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return r}function Cu({payer:e,tipAmount:n}){let r=Wo[Math.floor(Math.random()*Wo.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function Eu(e,n,r,o){if(e<n||e>r)throw new v(`${o} must be between ${n} and ${r} (inclusive), got ${e}`)}function Du(e,n){if(e<0)throw new v(`${n} must be non-negative, got ${e}`)}function Pu(e){return typeof e=="string"?e:e.toString()}function Mu(e){return e.toString()}async function Lo(e,n,r){let o=e?.get(n);if(o)return o;let t=await r();return t&&e&&e.set(n,t),t}var kD=3,WD=500,LD=2,OD=3e4,BD={backoffBase:LD,maxDelayMs:OD,retryOnRateLimit:true,initialDelayMs:WD,maxRetries:kD};function ND(e,n,r,o){let t=n*Math.pow(r,e-1);return Math.min(t,o)}function wD(e){return new Promise(n=>setTimeout(n,e))}async function hu(e,n){let{maxRetries:r,initialDelayMs:o,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...BD,...n},a;for(let s=1;s<=r;s++)try{return await e()}catch(d){if(a=d,i&&!i(d,s))throw d;if(s>=r)break;let u=ND(s,o,t,c);await wD(u);}throw new Er(e.name||"retryWithBackoff",r,a)}var N=class{systemAccounts;nextPreIndex;preMap;nextPackedIndex;packedMap;outputTreeIndex;constructor(){this.systemAccounts=[],this.nextPreIndex=0,this.preMap=new Map,this.nextPackedIndex=0,this.packedMap=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){for(let r of n)this.insertOrGet(r.address.toString(),r,false);return this.preMap}getAccountRole(n,r){return n?r?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:r?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(A.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n,r={address:address(n),role:AccountRole.WRITABLE},o=true){let t=o?this.packedMap:this.preMap;if(!t.has(n)){let c=o?this.nextPackedIndex++:this.nextPreIndex++;t.set(n,{index:c,accountMeta:r});}return t.get(n).index}packOutputTreeIndex(n){if(n.treeType===TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await ye().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let o=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());o.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let s=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(s);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:o.length>0?{packedTreeInfos:o,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(n){return Array.from(n.entries()).sort((o,t)=>o[1].index-t[1].index).map(([,{accountMeta:o}])=>({...o}))}getOffsets(n){let r=n,o=r+this.systemAccounts.length;return [r,o]}toAccountMetas(){let n=this.hashSetAccountsToMetas(this.preMap),r=this.hashSetAccountsToMetas(this.packedMap),[o,t]=this.getOffsets(n.length);return {remainingAccounts:[...n,...this.systemAccounts,...r],systemOffset:o,packedOffset:t}}};async function hr(e,n){let r=Pu(e);return Lo(n,r,()=>ye().getCompressedAccount(e))}async function Xe(e,n){let r=Mu(e);return Lo(n,r,()=>se().getAccountInfo(e,{encoding:"base64"}).send())}async function ae(e,n){let r=(await Promise.all(e.map(o=>hr(o.address,n)))).filter(o=>o!==null).filter(o=>o.data!==null&&o.address!==null);if(r.length!==e.length)throw new $("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((o,t)=>({...o,type:e[t].type,tree:o.treeInfo.tree,queue:o.treeInfo.queue}))}function k(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function fe(e,n,r,o,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:o[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function te(e,n,r,o,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:o[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let s=e.packTreeInfos(a,[]).stateTrees;if(!s)throw new v("Unable to parse state tree data");return c.map((u,m)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:s.packedTreeInfos[m],address:new Uint8Array(u.address),outputStateTreeIndex:s.outputTreeIndex}}))}async function Se(e,n,r,o,t){let c=null,i=null,a=null,s=new N;if(e){await s.addSystemAccounts();let{address:d}=await re(n,r),u=(await ae([{address:d,type:"Settings"}],t))[0];o?a={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:a=await Z([u],[]);let m=s.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!m)throw new v("Unable to parse state tree data");let p=j().decode(u.data?.data);c={accountMeta:{address:new Uint8Array(u.address),treeInfo:m.packedTreeInfos[0]},data:p},i={accountMeta:{address:new Uint8Array(u.address),treeInfo:m.packedTreeInfos[0],outputStateTreeIndex:m.outputTreeIndex},data:p};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:s,settingsMutArgs:i}}async function Z(e,n){return hu(()=>ye().getValidityProofV0(e,n))}async function xe(){return (await Rr()).length-1}var Oo;async function Rr(){if(!Oo){let{data:e}=await vc(se(),await vu());Oo=e.whitelistedAddressTrees;}return Oo}function _u(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let n=e[7];return n===3?2:3}async function No(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 Dw(e,{member:n,credentialId:r}){let o=[{memcmp:{offset:1,encoding:"base58",bytes:e}}];if(n)o.push({memcmp:{offset:33,encoding:"base58",bytes:getBase58Decoder().decode(V().encode(Te(n)))}});else if(r)o.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(pe(r))}});else return null;let t=await ye().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:o});return t.items.filter(c=>!!c.data).length?t.items.map(c=>X().decode(c.data?.data))[0]:null}async function br(e,n,r){let o=await jD(e,n,r);if(!o)throw new $("Settings account");return o}async function jD(e,n,r){try{let{address:o}=await re(e,n),t=await hr(o,r);if(!t?.data?.data)throw new $("Compressed settings account");let c=j().decode(t.data.data);if(c.data.__option==="None")throw new $("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let o=await oo(se(),e);return o.exists?{...o.data,isCompressed:false}:null}}async function Pw(e,n,r){let o=await No(e,n,r);if(o.role===1||o.role===0){let t=[],[c,i]=await Promise.all([ye().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:getBase58Decoder().decode(V().encode(Te(e)))}}]}),se().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(V().encode(Te(e)))}}]}).send()]);return c.items.forEach(a=>{if(a.data?.data){let s=j().decode(a.data.data);s.data.__option==="Some"&&t.push({...s.data.value,isCompressed:true});}}),i.forEach(a=>{let s=pr().decode(getBase64Encoder().encode(a.account.data[0]));t.push({...s,isCompressed:false});}),t}else return await Promise.all(o.wallets.map(async t=>br(await Ie(t.index),t.settingsAddressTreeIndex,r)))}async function wo(e){Du(e,"index");let n=await Rr();if(e>=n.length)throw new v(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function Mw(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 wo(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 wo(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("user"),e instanceof ve?e.toTruncatedBuffer():getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(o,new PublicKey(r),new PublicKey(A.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function at({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(getUtf8Encoder().encode(n));else throw new v("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function Ou(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function vu(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Bu(e,n,r){Eu(r,0,255,"buffer_index");let[o]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof ve?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return o}async function Me(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function Ie(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function Bw(e){let n=await Ie(e);return await Me(n)}async function Nw(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}function Yw(e,n){if(n.threshold>1)throw new v("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(s=>Hu(s.pubkey)===e);if(!r)throw new $("Member",`Signer ${e} not found in settings`);let{permissions:o}=r;if(!o)throw new $("Permissions","No permissions found for the current member");let t=_e.has(o,Pe.InitiateTransaction),c=_e.has(o,Pe.VoteTransaction),i=_e.has(o,Pe.ExecuteTransaction);if(t&&c&&i)return null;if(!c||!i)throw new Dr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(s=>s.role===0);if(!a)throw new $("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(Hu(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}function rP(e){let n=new URL(e);return n.protocol==="https:"?n.protocol="wss:":n.protocol==="http:"&&(n.protocol="ws:"),n.toString()}function nP(e,n){return new Promise((r,o)=>{let t=new WebSocket(e),c=()=>{try{t.close();}catch{}};n.addEventListener("abort",c,{once:true}),t.onopen=()=>{n.removeEventListener("abort",c),r(t);},t.onerror=()=>{n.removeEventListener("abort",c),o(new Error("WebSocket connection failed"));};})}async function oP(e,n,r){return new Promise((o,t)=>{let c=false,i=()=>{n.removeEventListener("abort",s),e.removeEventListener("message",d),e.removeEventListener("error",u),e.removeEventListener("close",m);},a=p=>{c||(c=true,i(),p());},s=()=>{try{e.close();}catch{}};n.addEventListener("abort",s);let d=p=>{if(typeof p.data!="string")return;let T;try{T=JSON.parse(p.data);}catch{return}let x=typeof T.event=="string"?T.event:"message",C=T.data;try{r(x,C)&&a(()=>o());}catch(f){a(()=>t(f));}},u=()=>{a(()=>t(new ot("Transaction manager request failed",0,e.url)));},m=()=>{a(()=>o());};e.addEventListener("message",d),e.addEventListener("error",u),e.addEventListener("close",m);})}function Ho(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(Ho());let t=setTimeout(r,e);n.addEventListener("abort",()=>{clearTimeout(t),o(Ho());},{once:true});});function Jw(e){let{address:n,url:r,authResponses:o,transactionMessageBytes:t,onPendingApprovalsCallback:c,onPendingApprovalsSuccess:i,abortController:a,opts:s}=e,d=a??new AbortController,u=s?.maxAttempts??10,m=s?.retryDelayMs??400;return {address:n,async signTransactions(p){let{signal:T}=d,x=rP(r),C=JSON.stringify({type:"transaction",data:{publicKey:n.toString(),payload:p.map(f=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(f)),transactionMessageBytes:t?getBase64Decoder().decode(t):void 0,authResponses:o}))}});for(let f=0;f<u;f++){if(T.aborted)throw Ho();let h,E;try{E=await nP(x,T),E.send(C),await oP(E,T,(I,D)=>{if(I==="error"){let B=D&&typeof D=="object"&&typeof D.error=="string"?D.error:"Unknown error",z=new Error(B);throw z.noRetry=!0,z}return I==="signatures"?(h=D.signatures,!0):(I==="pending_transaction_approval"?c?.(D.validTill):I==="transaction_approved"&&i?.(),!1)});}catch(I){if(I&&typeof I=="object"&&I.noRetry)throw new ot(`${I.message}`);if(I&&typeof I=="object"&&I.name==="AbortError")throw I}finally{try{E?.close();}catch{}}if(h?.length)return h.map(I=>({[n]:getBase58Encoder().encode(I)}));f<u-1&&await sP(m,T);}throw new ot("Transaction manager: missing signatures")}}}function Hu(e){return e.keyType===qt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function Zw(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 Xw(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 g2({payer:e,rpId:n,origins:r,authority:o}){let t=await at({rpId:n}),c=new N;await c.addSystemAccounts();let i=await xe(),{address:a,addressTree:s}=await w(o.address,i),d=[{address:a,tree:s,queue:s,type:"User"}],u=await Z([],d),m=(await fe(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:T}=c.toAccountMetas(),x=k(u,T);return await pa({origins:r,authorityCreationArgs:m,authority:o,compressedProofArgs:x,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function E2({authority:e,payer:n,createUserArgs:r,domainConfig:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[];r.settings&&(r.transactionManager&&i.push({address:(await w(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}),i.push({address:(await re(r.settings,r.settingsAddressTreeIndex)).address,type:"Settings"}));let a=i.length?await ae(i,t):[],s=await xe(),{address:d,addressTree:u}=await w(r.member,s),m=[{address:d,type:"User",tree:u,queue:u}],p=await Z(a,m),T=null,x=null,C=a.filter(B=>B.type==="Settings"),f=a.filter(B=>B.type==="User");if(f.length&&(x=te(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),f,X())[0]),C.length){let B=f.length,z=B+1;T=te(c,p.treeInfos.slice(B,z),p.leafIndices.slice(B,z),p.rootIndices.slice(B,z),p.proveByIndices.slice(B,z),C,j())[0];}let h=(await fe(c,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),m))[0],{remainingAccounts:E,systemOffset:I}=c.toAccountMetas(),D=k(p,I);return await fa({payer:n,authority:e,compressedProofArgs:D,member:Ut().decode(r.member.toBuffer()),credentialId:pe(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:T?some({settingsMutArgs:T,transactionManager:x?some(x):none()}):none(),userAccountCreationArgs:h,domainConfig:o,remainingAccounts:E})}async function h2({payer:e}){let n=await Ou();return Ca({payer:e,globalCounter:n})}async function v2({admin:e,rpId:n,disable:r}){let o=await at({rpId:n});return Na({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=gu(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 dt=33,ut=64,zo=14,yP=2,TP=address("Secp256r1SigVerify1111111111111111111111111");function fP(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function SP(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function qu(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let o=getU8Decoder().decode(e,n);n+=1;let t=[],c=SP();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=zo;let i=[];for(let a=0;a<r;a++){let s=fixDecoderSize(getBytesDecoder(),dt).decode(e,n);n+=dt;let d=fixDecoderSize(getBytesDecoder(),ut).decode(e,n);n+=ut;let u=t[a].messageDataSize,m=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:s,signature:d,message:m});}return [{numSignatures:r,padding:o,offsets:t,payload:i},n]}})}function ju(){return createEncoder({getSizeFromValue:e=>{let n=zo*e.offsets.length,r=e.payload.reduce((o,t)=>o+dt+ut+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(),dt).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),ut).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function z2(){return combineCodec(ju(),qu())}function H(e,n){let r=e.length,o=yP+r*zo,t=[];for(let s=0;s<r;s++){let{message:d}=e[s],u=o,m=u+dt,p=m+ut;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:m,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),o+=dt+ut+d.length;}let c=n?.programAddress??TP,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:ju().encode(i)}}function K2(e){return {programAddress:e.programAddress,accounts:{},data:qu().decode(e.data)}}async function Yu({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:o,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:s=false}){let d=await Me(e),{accountMetas:u,addressLookupTableAccounts:m}=await _r({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(H(c)),p.push(s?zd({transactionBuffer:n,payer:o.address,remainingAccounts:u,settingsKey:e}):Nd({transactionBuffer:n,payer:o.address,remainingAccounts:u,settings:e})),a&&p.push(Cu({payer:o,tipAmount:a})),{instructions:p,addressLookupTableAccounts:m}}async function Ju({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,additionalSigners:o,signers:t,payer:c,addressesByLookupTableAddress:i,secp256r1VerifyInput:a=[],compressed:s=false,simulateProof:d=false,cachedAccounts:u}){let m=de(t),p=await Me(e),[{accountMetas:T,addressLookupTableAccounts:x,transactionMessage:C},{settingsMutArgs:f,proof:h,packedAccounts:E}]=await Promise.all([_r({transactionMessageBytes:r,walletAddress:p,additionalSigners:o,addressesByLookupTableAddress:i}),Se(s,e,n,d,u)]);E.addPreAccounts(T);let{secp256r1VerifyInput:I,transactionSyncSigners:D}=ke(m,E,a),{remainingAccounts:B,systemOffset:z}=E.toAccountMetas(),ne=[];I.length>0&&ne.push(H(I));let Ce=xP(C,T);if(s){if(!c||!f)throw new v("Payer not found or proof args are missing for executeTransactionSync.");let me=k(h,z);ne.push(ru({signers:D,transactionMessage:Ce,settingsMutArgs:f,compressedProofArgs:me,payer:c,remainingAccounts:B}));}else ne.push(Zd({signers:D,settings:e,transactionMessage:Ce,remainingAccounts:B}));return {instructions:ne,addressLookupTableAccounts:x}}function xP(e,n){if(e.version==="legacy")throw new v("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:r.data??[]})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(o=>o.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function x8({settings:e,settingsAddressTreeIndex:n,destination:r,signers:o,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let s=de(o),d=await Me(e),[{packedAccounts:u,proof:m,settingsMutArgs:p},{value:T}]=await Promise.all([Se(a,e,n,false,t),Xe(d,t)]);if((T?.lamports??0)<BigInt(c))throw new v("Insufficient balance for native transfer.");let{secp256r1VerifyInput:x,transactionSyncSigners:C}=ke(s,u),{remainingAccounts:f,systemOffset:h}=u.toAccountMetas(),E=[];if(x.length>0&&E.push(H(x)),a){if(!i||!p)throw new Error("Payer not found or proof args is missing.");let I=k(m,h);E.push(gi({amount:c,settingsMutArgs:p,compressedProofArgs:I,payer:i,signers:C,source:d,destination:r,remainingAccounts:f}));}else E.push(ci({amount:c,signers:C,source:d,destination:r,settings:e,remainingAccounts:f}));return E}var tA=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),rA=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Ur=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function L8({settings:e,settingsAddressTreeIndex:n,destination:r,mint:o,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:s,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false}){let m=de(t),p=await Me(e),T=await hP(o,r,p,s,d),[x,C]=await Promise.all([RP(T,c),OP(u,e,n,c)]),f=bP(x,T,i),[h,E]=await Promise.all([WP(p,o,f.splBalance,f.cTokenBalance,BigInt(i),u),kP(f.requireSplInterface,T.splInterfacePda,c)]),I=BigInt(h.reduce((S,Or)=>S+(Or.parsed.amount.toNumber()??0),0));if(f.splBalance+f.cTokenBalance+I<BigInt(i))throw new v("Insufficient balance for token transfer.");let D=new N;E&&D.addPreAccounts([{address:o,role:AccountRole.WRITABLE}]);let B=_P(h,C),{proof:z,settingsMutArgs:ne}=await vP(D,B,C),Ce=UP(h,z,D),{secp256r1VerifyInput:me,transactionSyncSigners:tt}=ke(m,D),{remainingAccounts:he,systemOffset:Ae}=D.toAccountMetas(),We=k(z,Ae),rt=[];if(me.length>0&&rt.push(H(me)),u){if(!ne)throw new Error("Payer not found or proof args is missing.");rt.push(Mi({payer:a,source:p,sourceSplTokenAccount:T.sourceSplAta,sourceCtokenTokenAccount:T.sourceCtokenAta,destination:r,destinationSplTokenAccount:f.destinationSplTokenAccount,destinationCtokenTokenAccount:f.destinationCtokenTokenAccount,tokenProgram:s,mint:o,splInterfacePda:f.requireSplInterface?T.splInterfacePda:void 0,compressibleConfig:tA,rentSponsor:f.requireRentSponsor?rA:void 0,amount:i,signers:tt,sourceCompressedTokenAccounts:Ce,compressedProofArgs:We,splInterfacePdaArgs:f.requireSplInterface?some(d):none(),settingsMutArgs:ne,remainingAccounts:he}));}else rt.push(xi({settings:e,payer:a,source:p,sourceSplTokenAccount:T.sourceSplAta,sourceCtokenTokenAccount:T.sourceCtokenAta,destination:r,destinationSplTokenAccount:f.destinationSplTokenAccount,destinationCtokenTokenAccount:f.destinationCtokenTokenAccount,tokenProgram:s,mint:o,splInterfacePda:f.requireSplInterface?T.splInterfacePda:void 0,compressibleConfig:tA,rentSponsor:f.requireRentSponsor?rA:void 0,amount:i,signers:tt,sourceCompressedTokenAccounts:Ce,compressedProofArgs:We,splInterfacePdaArgs:f.requireSplInterface?some(d):none(),remainingAccounts:he}));return rt}async function hP(e,n,r,o,t){let c=p=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(p),getAddressEncoder().encode(Ur),getAddressEncoder().encode(e)],programAddress:Ur}),i=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(e)];t.restricted&&i.push(getUtf8Encoder().encode("restricted")),t.index>0&&i.push(getU8Encoder().encode(t.index));let[a,[s],d,[u],[m]]=await Promise.all([getAssociatedTokenAccountAddress(e,r,o),c(r),getAssociatedTokenAccountAddress(e,n,o),c(n),getProgramDerivedAddress({seeds:i,programAddress:Ur})]);return {sourceSplAta:a,sourceCtokenAta:s,destinationSplAta:d,destinationCTokenAta:u,splInterfacePda:m}}async function RP(e,n){let[r,o,t]=await Promise.all([Xe(e.destinationSplAta,n),Xe(e.sourceSplAta,n),Xe(e.sourceCtokenAta,n)]);return {destinationSplAtaInfo:r,sourceSplAtaInfo:o,sourceCTokenAtaInfo:t}}function bP(e,n,r){let o=!!e.destinationSplAtaInfo.value,t=!!e.sourceSplAtaInfo.value,c=!!e.sourceCTokenAtaInfo.value,i=t?getTokenDecoder().decode(getBase64Encoder().encode(e.sourceSplAtaInfo.value.data[0])).amount:BigInt(0),a=BigInt(c?BP(getBase64Encoder().encode(e.sourceCTokenAtaInfo.value.data[0]))?.amount??0:0),s=o?n.destinationSplAta:void 0,d=o?void 0:n.destinationCTokenAta,u=t&&(i+a<BigInt(r)||a>BigInt(0)||!o)||!t&&o;return {splBalance:i,cTokenBalance:a,destinationSplTokenAccount:s,destinationCtokenTokenAccount:d,requireSplInterface:u,requireRentSponsor:i+a<BigInt(r)||!o}}function _P(e,n){let r=[];return e.forEach(o=>r.push({hash:o.compressedAccount.hash,tree:o.compressedAccount.treeInfo.tree,queue:o.compressedAccount.treeInfo.queue,data:o.compressedAccount.data,address:o.compressedAccount.address})),n&&r.push(n),r}async function vP(e,n,r){let o=null,t=null;return n.length===0?{proof:t,settingsMutArgs:o}:(await e.addSystemAccounts(),t=await Z(n,[]),r&&(o=te(e,t.treeInfos.slice(-1),t.leafIndices.slice(-1),t.rootIndices.slice(-1),t.proveByIndices.slice(-1),n.slice(-1),j())[0]),{proof:t,settingsMutArgs:o})}function UP(e,n,r){return !n||!e.length?[]:e.map(o=>({amount:o.parsed.amount.toNumber(),merkleContext:{leafIndex:o.compressedAccount.leafIndex,merkleTreePubkeyIndex:r.insertOrGet(o.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:r.insertOrGet(o.compressedAccount.treeInfo.queue.toString()),proveByIndex:o.compressedAccount.proveByIndex},rootIndex:n.rootIndices[0],version:_u(o.compressedAccount.data?.discriminator),tlv:o.parsed.tlv?some(getArrayDecoder(Pt()).decode(o.parsed.tlv)):none(),state:o.parsed.state}))}async function kP(e,n,r){if(!e)return false;let{value:o}=await Xe(n,r);return !o}async function WP(e,n,r,o,t,c){let i=t-r-o;if(i<=0)return [];let s=(await ye().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(n)})).items.filter(u=>!!u.compressedAccount.data?.data.length&&u.compressedAccount.owner.toString()===Ur.toString()&&!u.parsed.amount.isZero());return s.length===0?[]:LP(s,Number(i),c?3:4,{treeType:TreeType.StateV2})}function LP(e,n,r=4,o){let t=e.filter(d=>d.compressedAccount.treeInfo.treeType===o?.treeType);if(t.length===0)throw new Error("No accounts found");let c=0,i=0,a=0,s=[];t.sort((d,u)=>u.parsed.amount.cmp(d.parsed.amount));for(let d of t){if(s.length>=r||c>=n)break;(!d.parsed.amount.isZero()||!d.compressedAccount.lamports.isZero())&&(c=c+d.parsed.amount.toNumber(),i=i+d.compressedAccount.lamports.toNumber(),s.push(d));}if(a=t.slice(0,r).reduce((d,u)=>d+u.parsed.amount.toNumber(),0),s.length===0)throw new Error("No accounts found.");if(c<n){let d=t.reduce((u,m)=>u+m.parsed.amount.toNumber(),0);throw s.length>=r?new Error(`Account limit exceeded: max ${a.toString()} (${r} accounts) per transaction. Total balance: ${d.toString()} (${t.length} accounts). Consider multiple transfers to spend full balance.`):new Error(`Insufficient balance for transfer. Required: ${n.toString()}, available: ${d.toString()}.`)}if(s.length===0)throw new Error("No accounts found.");return s}async function OP(e,n,r,o){if(!e)return null;let{address:t}=await re(n,r);return (await ae([{address:t,type:"Settings"}],o))[0]??null}function BP(e){if(!e||e.length===0)return null;try{return {amount:getU64Decoder().decode(e.slice(64,72))}}catch(n){return console.error("Token data parsing error:",n),null}}async function j8({signers:e,payer:n,changeConfigArgs:r}){let{settings:o,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:s}=r,d=de(e),u=[],m=[];for(let f of d)if(f instanceof U){let h=m.length,{domainConfig:E,verifyArgs:I,signature:D,publicKey:B,message:z}=ce(f,h);if(z&&D&&B&&m.push({message:z,signature:D,publicKey:B}),E){let ne=i.addPreAccounts([{address:E,role:AccountRole.READONLY}]).get(E)?.index;I.__option==="Some"&&ne!==void 0&&u.push({__kind:"Secp256r1",fields:[{domainConfigIndex:ne,verifyArgs:I.value}]});}}else {let h=i.addPreAccounts([{address:f.address,role:AccountRole.READONLY_SIGNER,signer:f}]).get(f.address)?.index;h!==void 0&&u.push({__kind:"Ed25519",fields:[h]});}let{remainingAccounts:p,systemOffset:T}=i.toAccountMetas(),x=k(a,T),C=[];if(m.length>0&&C.push(H(m)),c){if(!s)throw new v("Proof args are missing for compressed changeConfig.");C.push(Qc({configActions:t,payer:n,compressedProofArgs:x,settingsMutArgs:s,remainingAccounts:p,signers:u}));}else C.push(zc({settings:o,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:p,signers:u}));return C}async function eH({createUserArgs:e,payer:n}){let r=new N;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:AccountRole.READONLY_SIGNER,signer:u.member})));let o=await xe(),t=await Promise.all(e.map(async u=>{let{address:m,addressTree:p}=await w(u.member.address,o);return {address:m,tree:p,queue:p,type:"User"}})),c=await Z([],t),i=await fe(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:s}=r.toAccountMetas(),d=k(c,s);return await Ma({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,m)=>({member:u.member.address,role:u.role,userCreationArgs:i[m],transactionManagerUrl:u.role===0?u.transactionManagerUrl:null})),remainingAccounts:a})}async function aH({index:e,payer:n,initialMember:r,userAddressTreeIndex:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[],a=[];a.push(...await ae([{address:(await w(r.address,o)).address,type:"User"}],t));let s=await xe(),{address:d,addressTree:u}=await re(await Ie(e),s);i.push({address:d,queue:u,tree:u,type:"Settings"});let m=a.length,p=await Z(a,i),T=te(c,p.treeInfos.slice(0,m),p.leafIndices.slice(0,m),p.rootIndices.slice(0,m),p.proveByIndices.slice(0,m),a.filter(I=>I.type==="User"),X())[0],C=(await fe(c,p.treeInfos.slice(m),p.roots.slice(m),p.rootIndices.slice(m),i)).find(I=>I.type==="Settings")??null,{remainingAccounts:f,systemOffset:h}=c.toAccountMetas(),E=k(p,h);if(!C)throw new Error("Settings creation args is missing.");return await na({settingsIndex:e,payer:n,initialMember:r,userArgs:T.data.role===3?{__kind:"Mutate",fields:[T]}:{__kind:"Read",fields:[T]},compressedProofArgs:E,...C,remainingAccounts:f})}async function TH({settings:e,settingsAddressTreeIndex:n,payer:r,signers:o,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await Se(true,e,n,false,t);if(!a)throw new v("Proof args are missing for settings account.");let s=de(o),{secp256r1VerifyInput:d,transactionSyncSigners:u}=ke(s,c),{remainingAccounts:m,systemOffset:p}=c.toAccountMetas(),T=k(i,p),x=[];return d.length>0&&x.push(H(d)),x.push(Ua({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:T,signers:u,remainingAccounts:m})),x}async function DH({authority:e,domainConfig:n,newAuthority:r,newOrigins:o}){let t=null,c=[];if(r){let i=new N;await i.addSystemAccounts();let a=await xe(),{address:s,addressTree:d}=await w(r.address,a),u=[{address:s,tree:d,queue:d,type:"User"}],m=await Z([],u),p=(await fe(i,m.treeInfos,m.roots,m.rootIndices,u))[0],T=i.toAccountMetas();c=T.remainingAccounts,t={compressedProofArgs:k(m,T.systemOffset),authorityCreationArgs:p};}return za({domainConfig:n,authority:e,newOrigins:o?some(o):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function _H({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let o=new N;await o.addSystemAccounts();let t=await ae([{address:(await w(e.address,n)).address,type:"User"}]),c=await Z(t,[]),i=te(o,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:a,systemOffset:s}=o.toAccountMetas(),d=k(c,s);return Za({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function HH({payer:e,user:n,userAddressTreeIndex:r,newDelegate:o,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:s,publicKey:d}=ce(n),u=[];a&&s&&d&&u.push({message:a,signature:s,publicKey:d});let m=await No(n instanceof U?n:n.address,r,t),p=[];p.push({address:(await w(n instanceof U?n:n.address,r)).address,type:"User"});let T,x=null,C,f=null,h=m.wallets.find(Ae=>Ae.isDelegate);if(h){let Ae=await Ie(h.index);(await br(Ae,h.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await re(Ae,h.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):T=await Ie(h.index);}if(o){let Ae=await Ie(o.index);(await br(Ae,o.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await re(Ae,o.settingsAddressTreeIndex)).address,type:"Settings"}),f={start:p.length-1,end:p.length}):C=await Ie(o.index);}let E=new N;await E.addSystemAccounts();let I=await ae(p,t),D=await Z(I,[]),B=te(E,D.treeInfos.slice(0,1),D.leafIndices.slice(0,1),D.rootIndices.slice(0,1),D.proveByIndices.slice(0,1),I.slice(0,1),X())[0],z=x?some(te(E,D.treeInfos.slice(x.start,x.end),D.leafIndices.slice(x.start,x.end),D.rootIndices.slice(x.start,x.end),D.proveByIndices.slice(x.start,x.end),I.slice(x.start,x.end),j())[0]):none(),ne=f?some(te(E,D.treeInfos.slice(f.start,f.end),D.leafIndices.slice(f.start,f.end),D.rootIndices.slice(f.start,f.end),D.proveByIndices.slice(f.start,f.end),I.slice(f.start,f.end),j())[0]):none(),{remainingAccounts:Ce,systemOffset:me}=E.toAccountMetas(),tt=k(D,me),he=[];return u.length>0&&he.push(H(u)),he.push(ri({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:o?some(o):none(),feePayer:e,signer:n instanceof U?void 0:n,oldSettings:T,oldSettingsMutArgs:z,newSettings:C,newSettingsMutArgs:ne,compressedProofArgs:tt,userMutArgs:B,remainingAccounts:Ce})),he}async function n5({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:o,compressed:t=false,cachedAccounts:c}){let i=await Pc(se(),r),a=i.data.multiWalletSettings,{packedAccounts:s,proof:d,settingsMutArgs:u}=await Se(t,a,e,false,c),{remainingAccounts:m,systemOffset:p}=s.toAccountMetas(),{domainConfig:T,verifyArgs:x,message:C,signature:f,publicKey:h}=ce(n),E=[];if(C&&f&&h&&E.push(H([{message:C,signature:f,publicKey:h}])),t){if(!o||!u)throw new v("Payer not found or proof args are missing for closing buffer.");let I=k(d,p);E.push(Ni({transactionBuffer:r,domainConfig:T,closer:n instanceof U?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:x,settingsMutArgs:u,payer:o,compressedProofArgs:I,remainingAccounts:m}));}else E.push(Ui({transactionBuffer:r,domainConfig:T,closer:n instanceof U?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:x,remainingAccounts:[]}));return E}function oA({payer:e,creator:n,bufferIndex:r,settings:o,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,compressedArgs:d,expectedSigners:u}){let{domainConfig:m,verifyArgs:p,message:T,signature:x,publicKey:C}=ce(n),f=[];if(T&&x&&C&&f.push(H([{message:T,signature:x,publicKey:C}])),d){let{settingsReadonlyArgs:h,compressedProofArgs:E,remainingAccounts:I}=d;f.push(Zi({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof U?void 0:n,domainConfig:m,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},settingsReadonlyArgs:h,compressedProofArgs:E,remainingAccounts:I}));}else f.push(zi({settings:o,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof U?void 0:n,domainConfig:m,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},remainingAccounts:[]}));return f}function sA({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:s}=ce(e),d=[];return a&&i&&s&&d.push(H([{message:a,signature:i,publicKey:s}])),o?d.push(id({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(rd({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof U?void 0:e,remainingAccounts:[]})),d}function cA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:o=false}){return o?xd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):md({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function aA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:s}=ce(n),d=[];return s&&i&&a&&d.push(H([{message:s,signature:i,publicKey:a}])),o?d.push(Ud({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(Md({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof U?void 0:n,remainingAccounts:[]})),d}async function q5({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:o,compressed:t=false}){let c=await VP(r),i=new N,a=null,s=null,d=[];if(c.length||t){let m=await FP({packedAccounts:i,userAccounts:c,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:o});a=m.proof,s=m.settingsMutArgs??null,d=m.userMutArgs??[];}return {configActions:await GP({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:s,packedAccounts:i,compressed:t}}async function VP(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}}return n}async function FP({packedAccounts:e,userAccounts:n,compressed:r,settings:o,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let T=(await re(o,t)).address;i.push({address:T,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await ae(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let s=await Z(a,[]),d=[],u=[];for(let T of a)T.type==="Settings"?d.push(T):T.type==="User"&&u.push(T);let m,p=[];if(r&&s&&(m=te(e,s.treeInfos.slice(0,1),s.leafIndices.slice(0,1),s.rootIndices.slice(0,1),s.proveByIndices.slice(0,1),d,j())[0]),u.length&&s){let T=r?1:0;p=te(e,s.treeInfos.slice(T),s.leafIndices.slice(T),s.rootIndices.slice(T),s.proveByIndices.slice(T),u,X());}return {proof:s,settingsMutArgs:m,userMutArgs:p}}async function GP({configActionsArgs:e,userMutArgs:n}){let r=[];for(let o of e)switch(o.type){case "AddMembers":{let t=[];for(let c of o.members){let i=await w(c.member,c.userAddressTreeIndex).then(a=>n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(a.address)))));if(!i)throw new Error("Unable to find user account");t.push(qP({permissionArgs:c.permissions,userMutArgs:i,pubkey:c.member}));}r.push({__kind:o.type,fields:[t]});break}case "RemoveMembers":{let t=await Promise.all(o.members.map(c=>w(c.member,c.userAddressTreeIndex).then(i=>{let a=n.find(s=>equalBytes(s.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(i.address))));if(!a)throw new Error("Unable to find user account");return KP({pubkey:c.member,userMutArgs:a})})));r.push({__kind:o.type,fields:[t]});break}case "EditPermissions":{let t=o.members.map(c=>zP({permissionArgs:c.permissions,pubkey:c.member}));r.push({__kind:o.type,fields:[t]});break}default:r.push({__kind:o.type,fields:[o.threshold]});}return r}function zP({pubkey:e,permissionArgs:n}){return {memberKey:Te(e),permissions:AA(n)}}function KP({pubkey:e,userMutArgs:n}){let r=n.data.role;if(r===2)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:Te(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function qP({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===2)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===0&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:Te(e),permissions:AA(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function AA(e){let n=[];return e.initiate&&n.push(Pe.InitiateTransaction),e.vote&&n.push(Pe.VoteTransaction),e.execute&&n.push(Pe.ExecuteTransaction),_e.fromPermissions(n)}async function e6({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s,compressed:d=false,additionalVoters:u=[],additionalSigners:m=[],chunkSize:p=Math.ceil(o.length/2),cachedAccounts:T}){let x=Math.floor(Math.random()*255),C=await Bu(n,t instanceof U?t:t.address,x),f=[],h=[];for(let ee=0;ee<o.length;ee+=p){let Zo=o.subarray(ee,ee+p);f.push(Zo),h.push(sha256(Zo));}let E=sha256(o),{settingsReadonlyArgs:I,settingsMutArgs:D,proof:B,packedAccounts:z}=await Se(d,n,r,false,T),{remainingAccounts:ne,systemOffset:Ce}=z.toAccountMetas(),me=B&&I&&D?{settingsReadonlyArgs:I,settingsMutArgs:D,compressedProofArgs:k(B,Ce),remainingAccounts:ne,payer:e}:null,tt=de([t,...c?[c]:[],...u]).map(ee=>({memberKey:Te(ee),messageHash:ee instanceof U?ko(ee.authResponse):null})),he=oA({finalBufferHash:E,finalBufferSize:o.length,bufferIndex:x,payer:e,transactionBufferAddress:C,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:h,compressedArgs:me,expectedSigners:tt}),Ae=f.map(ee=>cA({transactionMessageBytes:ee,transactionBufferAddress:C,settings:n,compressed:d})),We=u.map(ee=>aA({voter:ee,transactionBufferAddress:C,settings:n,compressedArgs:me})),rt=sA({compressedArgs:me,settings:n,executor:c,transactionBufferAddress:C}),{instructions:S,addressLookupTableAccounts:Or}=await Yu({compressed:d,settings:n,transactionMessageBytes:o,transactionBufferAddress:C,payer:e,additionalSigners:m,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s}),At=ee=>({payer:e,instructions:ee,addressesByLookupTableAddress:Or});return [At(he),...Ae.map(ee=>At([ee])),...We.length?[At(We.flat())]:[],At(rt),At(S)]}var Wr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let o=new Map,t=i=>{let a=o.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},o.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let s=t(a.address);s.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,o)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),o=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),c=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+o.length,numReadonlySignerAccounts:o.length,numReadonlyNonSignerAccounts:c.length};if(r.length===0)throw new Error("Expected at least one writable signer key");let[a]=r[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let s=[...r.map(([d])=>d),...o.map(([d])=>d),...t.map(([d])=>d),...c.map(([d])=>d)];return [i,s]}extractTableLookup(n){let[r,o]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(n,r){let o=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,s=n.findIndex(d=>d===a);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),t.push(a),this.keyMetaMap.delete(c);}}return [o,t]}};var Lr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let o=new Map;this.keySegments().flat().forEach((c,i)=>{o.set(c,i);});let t=c=>{let i=o.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function pA({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:o}){let t=Wr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(o??{});for(let p of a){let T=t.extractTableLookup(p);if(T!==void 0){let{addressTableLookup:x,drainedKeys:C}=T;c.push({readonlyIndexes:x.readonlyIndexes,readableIndices:x.readonlyIndexes,writableIndexes:x.writableIndexes,writableIndices:x.writableIndexes,lookupTableAddress:address(x.lookupTableAddress)}),i.writable.push(...C.writable),i.readonly.push(...C.readonly);}}let[s,d]=t.getMessageComponents(),m=new Lr(d,i).compileInstructions(r);return {version:0,header:s,instructions:m,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function p6({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=pA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(Au(o))}async function f6({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,signers:t,additionalSigners:c,secp256r1VerifyInput:i,addressesByLookupTableAddress:a,cachedAccounts:s,compressed:d=false,simulateProof:u=false}){let{instructions:m,addressLookupTableAccounts:p}=await Ju({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,additionalSigners:c,transactionMessageBytes:o,secp256r1VerifyInput:i,compressed:d,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:s});return {payer:e,instructions:m,addressesByLookupTableAddress:p}}
|
|
2
|
-
export{Wc as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,Br as AccountState,au as AuthenticationContextSchema,iu as BaseResponseSchema,Jc as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,Vc as CHANGE_CONFIG_DISCRIMINATOR,ta as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,Aa as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,ya as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,xa as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Da as CREATE_USER_ACCOUNTS_DISCRIMINATOR,NB as CompleteMessageRequestSchema,wB as CompleteTransactionRequestSchema,ba as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,La as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Xo as DOMAIN_CONFIG_DISCRIMINATOR,gD as DeviceProfileSchema,Fa as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,ja as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,$a as EDIT_USER_DELEGATE_DISCRIMINATOR,ns as GLOBAL_COUNTER_DISCRIMINATOR,qt as KeyType,uE as MULTI_WALLET_ERROR__ALREADY_DELEGATED,HC as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,rD as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,_E as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,UE as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,kE as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,eD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,AD as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,GC as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,FC as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,eE as MULTI_WALLET_ERROR__EMPTY_MEMBERS,wE as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,XC as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,VC as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,JC as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,SE as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,xE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,IE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,NE as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,pE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,AE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,gE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,sE as MULTI_WALLET_ERROR__INVALID_ACCOUNT,$E as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,OE as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,QC as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,aE as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,fE as MULTI_WALLET_ERROR__INVALID_BUFFER,HE as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,mE as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,oE as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,qC as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,WC as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,BC as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,kC as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,OC as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,bE as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,hE as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,rE as MULTI_WALLET_ERROR__INVALID_THRESHOLD,ZE as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,ZC as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,YC as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,nE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,sD as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,cE as MULTI_WALLET_ERROR__INVALID_USER_ROLE,oD as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,JE as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,NC as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,PE as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,WE as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,GE as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,QE as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,iE as MULTI_WALLET_ERROR__MISSING_ACCOUNT,VE as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,qE as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,cD as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,YE as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,FE as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,dE as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,dD as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,iD as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,BE as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,aD as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,jE as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,ME as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,tD as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,uD as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,yE as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,$C as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,KC as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,jC as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,LE as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,KE as MULTI_WALLET_ERROR__PAYER_MISMATCH,zC as MULTI_WALLET_ERROR__PERMANENT_MEMBER,DE as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,wC as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,zE as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,LC as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,RE as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,XE as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,tE as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,CE as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,EE as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,vE as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,TE as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,nD as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,lE as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,_C as MultiWalletAccount,vC as MultiWalletInstruction,di as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,oi as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Pe as Permission,_e as Permissions,yc as SETTINGS_DISCRIMINATOR,ve as Secp256r1Key,U as SignedSecp256r1Key,su as StartMessageRequestSchema,cu as StartTransactionRequestSchema,Di as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,fi as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Li as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,bi as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,ji as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,Vi as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Cc as TRANSACTION_BUFFER_DISCRIMINATOR,sd as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,$i as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Td as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Ad as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,bd as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Ed as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,Vd as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,Ld as TRANSACTION_EXECUTE_DISCRIMINATOR,$d as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,jd as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,ou as TransactionActionTypeSchema,mD as TransactionDetailsSchema,BB as TransactionPayloadSchema,pD as TransactionPayloadWithBase64MessageBytesSchema,no as Transports,OB as UserInfoSchema,Re as UserRole,Rc as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,bB as addWhitelistedAddressTrees,pe as base64URLStringToBuffer,kN as bufferToBase64URLString,j8 as changeConfig,n5 as closeTransactionBuffer,oh as configAction,ON as convertBase64StringToJWK,LN as convertJWKToBase64String,Hu as convertMemberKeyToString,MN as convertPubkeyCompressedToCose,PN as convertPubkeyCoseToCompressed,bN as createClientAuthorizationCompleteRequestChallenge,RN as createClientAuthorizationStartRequestChallenge,g2 as createDomainConfig,E2 as createDomainUserAccounts,h2 as createGlobalCounter,_N as createMessageChallenge,oA as createTransactionBuffer,vN as createTransactionChallenge,Jw as createTransactionManagerSigner,eH as createUserAccounts,aH as createWallet,$o as decodeDomainConfig,ss as decodeGlobalCounter,Tc as decodeSettings,Dc as decodeTransactionBuffer,_c as decodeWhitelistedAddressTree,TH as decompressSettingsAccount,Xw as deserializeConfigActions,v2 as disableDomainConfig,DH as editDomainConfig,_H as editTransactionManagerUrl,HH as editUserDelegate,Yu as executeTransaction,sA as executeTransactionBuffer,Ju as executeTransactionSync,cA as extendTransactionBuffer,Ch as extensionStruct,QP as fetchAllDomainConfig,sM as fetchAllGlobalCounter,hA as fetchAllMaybeDomainConfig,GA as fetchAllMaybeGlobalCounter,LT as fetchAllMaybeSettings,t1 as fetchAllMaybeTransactionBuffer,I1 as fetchAllMaybeWhitelistedAddressTree,Y_ as fetchAllSettings,Pw as fetchAllSettingsAccountByMember,ev as fetchAllTransactionBuffer,sv as fetchAllWhitelistedAddressTree,es as fetchDomainConfig,oM as fetchGlobalCounter,MA as fetchMaybeDomainConfig,FA as fetchMaybeGlobalCounter,oo as fetchMaybeSettings,jD as fetchMaybeSettingsAccountData,e1 as fetchMaybeTransactionBuffer,qD as fetchMaybeUserAccountData,x1 as fetchMaybeWhitelistedAddressTree,j_ as fetchSettings,br as fetchSettingsAccountData,Pc as fetchTransactionBuffer,Dw as fetchUserAccountByFilters,No as fetchUserAccountData,vc as fetchWhitelistedAddressTree,dM as getAccountStateCodec,wr as getAccountStateDecoder,Nr as getAccountStateEncoder,yM as getAddMemberArgsCodec,Gr as getAddMemberArgsDecoder,Fr as getAddMemberArgsEncoder,Cv as getAddWhitelistedAddressTreesDiscriminatorBytes,Dv as getAddWhitelistedAddressTreesInstruction,Oc as getAddWhitelistedAddressTreesInstructionAsync,Ev as getAddWhitelistedAddressTreesInstructionDataCodec,Lc as getAddWhitelistedAddressTreesInstructionDataDecoder,po as getAddWhitelistedAddressTreesInstructionDataEncoder,gM as getAdditionalMetadataCodec,Vr as getAdditionalMetadataDecoder,Hr as getAdditionalMetadataEncoder,Vv as getChangeConfigCompressedDiscriminatorBytes,Qc as getChangeConfigCompressedInstruction,Fv as getChangeConfigCompressedInstructionDataCodec,Xc as getChangeConfigCompressedInstructionDataDecoder,Zc as getChangeConfigCompressedInstructionDataEncoder,Uv as getChangeConfigDiscriminatorBytes,zc as getChangeConfigInstruction,kv as getChangeConfigInstructionDataCodec,Gc as getChangeConfigInstructionDataDecoder,Fc as getChangeConfigInstructionDataEncoder,Uo as getClientAndDeviceHash,SM as getCompiledInstructionCodec,Kr as getCompiledInstructionDecoder,zr as getCompiledInstructionEncoder,EM as getCompressedAccountMetaCodec,lt as getCompressedAccountMetaDecoder,mt as getCompressedAccountMetaEncoder,hM as getCompressedAccountMetaReadOnlyCodec,St as getCompressedAccountMetaReadOnlyDecoder,ft as getCompressedAccountMetaReadOnlyEncoder,_M as getCompressedOnlyExtensionCodec,jr as getCompressedOnlyExtensionDecoder,qr as getCompressedOnlyExtensionEncoder,kM as getCompressedProofCodec,$r as getCompressedProofDecoder,Qr as getCompressedProofEncoder,re as getCompressedSettingsAddress,BM as getCompressedSettingsCodec,VM as getCompressedSettingsDataCodec,tn as getCompressedSettingsDataDecoder,en as getCompressedSettingsDataEncoder,j as getCompressedSettingsDecoder,xt as getCompressedSettingsEncoder,KM as getCompressedTokenArgsCodec,Dt as getCompressedTokenArgsDecoder,Et as getCompressedTokenArgsEncoder,JM as getCompressibleExtensionCodec,dn as getCompressibleExtensionDecoder,an as getCompressibleExtensionEncoder,$M as getCompressionInfoCodec,An as getCompressionInfoDecoder,un as getCompressionInfoEncoder,nh as getConfigActionCodec,He as getConfigActionDecoder,we as getConfigActionEncoder,Zv as getCreateCompressedWalletDiscriminatorBytes,Qv as getCreateCompressedWalletInstruction,na as getCreateCompressedWalletInstructionAsync,Xv as getCreateCompressedWalletInstructionDataCodec,ra as getCreateCompressedWalletInstructionDataDecoder,mo as getCreateCompressedWalletInstructionDataEncoder,cU as getCreateDomainConfigDiscriminatorBytes,iU as getCreateDomainConfigInstruction,pa as getCreateDomainConfigInstructionAsync,aU as getCreateDomainConfigInstructionDataCodec,ga as getCreateDomainConfigInstructionDataDecoder,yo as getCreateDomainConfigInstructionDataEncoder,yU as getCreateDomainUserAccountDiscriminatorBytes,fU as getCreateDomainUserAccountInstruction,fa as getCreateDomainUserAccountInstructionAsync,TU as getCreateDomainUserAccountInstructionDataCodec,Ta as getCreateDomainUserAccountInstructionDataDecoder,To as getCreateDomainUserAccountInstructionDataEncoder,PU as getCreateGlobalCounterDiscriminatorBytes,hU as getCreateGlobalCounterInstruction,Ca as getCreateGlobalCounterInstructionAsync,MU as getCreateGlobalCounterInstructionDataCodec,Ia as getCreateGlobalCounterInstructionDataDecoder,So as getCreateGlobalCounterInstructionDataEncoder,dh as getCreateUserAccountArgsCodec,En as getCreateUserAccountArgsDecoder,Cn as getCreateUserAccountArgsEncoder,LU as getCreateUserAccountsDiscriminatorBytes,BU as getCreateUserAccountsInstruction,Ma as getCreateUserAccountsInstructionAsync,OU as getCreateUserAccountsInstructionDataCodec,Pa as getCreateUserAccountsInstructionDataDecoder,Io as getCreateUserAccountsInstructionDataEncoder,KU as getDecompressSettingsAccountDiscriminatorBytes,Ua as getDecompressSettingsAccountInstruction,qU as getDecompressSettingsAccountInstructionDataCodec,va as getDecompressSettingsAccountInstructionDataDecoder,_a as getDecompressSettingsAccountInstructionDataEncoder,UN as getDeviceMessageHash,$U as getDisableDomainConfigDiscriminatorBytes,Na as getDisableDomainConfigInstruction,ek as getDisableDomainConfigInstructionDataCodec,Ba as getDisableDomainConfigInstructionDataDecoder,Oa as getDisableDomainConfigInstructionDataEncoder,at as getDomainConfigAddress,XP as getDomainConfigCodec,Qo as getDomainConfigDecoder,ZP as getDomainConfigDiscriminatorBytes,PA as getDomainConfigEncoder,$P as getDomainConfigSize,ik as getEditDomainConfigDiscriminatorBytes,za as getEditDomainConfigInstruction,uk as getEditDomainConfigInstructionAsync,dk as getEditDomainConfigInstructionDataCodec,Ga as getEditDomainConfigInstructionDataDecoder,Eo as getEditDomainConfigInstructionDataEncoder,ph as getEditMemberArgsCodec,Sn as getEditMemberArgsDecoder,fn as getEditMemberArgsEncoder,fk as getEditTransactionManagerUrlDiscriminatorBytes,Za as getEditTransactionManagerUrlInstruction,Sk as getEditTransactionManagerUrlInstructionDataCodec,Ja as getEditTransactionManagerUrlInstructionDataDecoder,Ya as getEditTransactionManagerUrlInstructionDataEncoder,hk as getEditUserDelegateDiscriminatorBytes,ri as getEditUserDelegateInstruction,Rk as getEditUserDelegateInstructionDataCodec,ti as getEditUserDelegateInstructionDataDecoder,ei as getEditUserDelegateInstructionDataEncoder,Th as getExpectedSignerCodec,ht as getExpectedSignerDecoder,Mt as getExpectedSignerEncoder,Ih as getExtensionStructCodec,Pt as getExtensionStructDecoder,rn as getExtensionStructEncoder,Ou as getGlobalCounterAddress,nM as getGlobalCounterCodec,os as getGlobalCounterDecoder,rM as getGlobalCounterDiscriminatorBytes,VA as getGlobalCounterEncoder,cM as getGlobalCounterSize,Nw as getLightCpiSigner,ye as getLightProtocolRpc,hh as getLinkWalletArgsCodec,Ln as getLinkWalletArgsDecoder,Wn as getLinkWalletArgsEncoder,vh as getMemberCodec,Ct as getMemberDecoder,It as getMemberEncoder,Wh as getMemberKeyCodec,Q as getMemberKeyDecoder,V as getMemberKeyEncoder,TB as getMultiWalletErrorMessage,qk as getNativeTransferIntentCompressedDiscriminatorBytes,gi as getNativeTransferIntentCompressedInstruction,jk as getNativeTransferIntentCompressedInstructionDataCodec,Ai as getNativeTransferIntentCompressedInstructionDataDecoder,ui as getNativeTransferIntentCompressedInstructionDataEncoder,Ok as getNativeTransferIntentDiscriminatorBytes,ci as getNativeTransferIntentInstruction,Nk as getNativeTransferIntentInstructionAsync,Bk as getNativeTransferIntentInstructionDataCodec,si as getNativeTransferIntentInstructionDataDecoder,Do as getNativeTransferIntentInstructionDataEncoder,Nh as getNewAuthorityArgsCodec,wn as getNewAuthorityArgsDecoder,Nn as getNewAuthorityArgsEncoder,WN as getOriginIndex,Vh as getPackedAddressTreeInfoCodec,vt as getPackedAddressTreeInfoDecoder,_t as getPackedAddressTreeInfoEncoder,zh as getPackedMerkleContextCodec,on as getPackedMerkleContextDecoder,nn as getPackedMerkleContextEncoder,jh as getPackedStateTreeInfoCodec,Tt as getPackedStateTreeInfoDecoder,yt as getPackedStateTreeInfoEncoder,Zh as getPausableAccountExtensionCodec,Pn as getPausableAccountExtensionDecoder,Dn as getPausableAccountExtensionEncoder,$h as getPermanentDelegateAccountExtensionCodec,hn as getPermanentDelegateAccountExtensionDecoder,Mn as getPermanentDelegateAccountExtensionEncoder,rR as getPermissionsCodec,Oe as getPermissionsDecoder,Le as getPermissionsEncoder,cR as getProofArgsCodec,M as getProofArgsDecoder,P as getProofArgsEncoder,uR as getRemoveMemberArgsCodec,In as getRemoveMemberArgsDecoder,xn as getRemoveMemberArgsEncoder,pR as getRentConfigCodec,ln as getRentConfigDecoder,mn as getRentConfigEncoder,ko as getSecp256r1MessageHash,yR as getSecp256r1PubkeyCodec,Ut as getSecp256r1PubkeyDecoder,Fn as getSecp256r1PubkeyEncoder,SP as getSecp256r1SignatureOffsetsDataDecoder,fP as getSecp256r1SignatureOffsetsDataEncoder,SR as getSecp256r1VerifyArgsCodec,G as getSecp256r1VerifyArgsDecoder,F as getSecp256r1VerifyArgsEncoder,ER as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,zn as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,Gn as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,H as getSecp256r1VerifyInstruction,z2 as getSecp256r1VerifyInstructionDataCodec,qu as getSecp256r1VerifyInstructionDataDecoder,ju as getSecp256r1VerifyInstructionDataEncoder,aN as getSendAndConfirmTransaction,q_ as getSettingsCodec,pr as getSettingsDecoder,K_ as getSettingsDiscriminatorBytes,WT as getSettingsEncoder,Ie as getSettingsFromIndex,bR as getSettingsIndexWithAddressAndDelegateInfoCodec,Yn as getSettingsIndexWithAddressAndDelegateInfoDecoder,jn as getSettingsIndexWithAddressAndDelegateInfoEncoder,MR as getSettingsIndexWithAddressCodec,qn as getSettingsIndexWithAddressDecoder,Kn as getSettingsIndexWithAddressEncoder,kR as getSettingsMutArgsCodec,q as getSettingsMutArgsDecoder,K as getSettingsMutArgsEncoder,BR as getSettingsReadonlyArgsCodec,Wt as getSettingsReadonlyArgsDecoder,kt as getSettingsReadonlyArgsEncoder,hN as getSignedSecp256r1Key,se as getSolanaRpc,cN as getSolanaRpcEndpoint,HR as getSplInterfacePdaArgsCodec,Ot as getSplInterfacePdaArgsDecoder,Lt as getSplInterfacePdaArgsEncoder,zR as getTokenMetadataCodec,bn as getTokenMetadataDecoder,Rn as getTokenMetadataEncoder,AW as getTokenTransferIntentCompressedDiscriminatorBytes,Mi as getTokenTransferIntentCompressedInstruction,pW as getTokenTransferIntentCompressedInstructionAsync,gW as getTokenTransferIntentCompressedInstructionDataCodec,Pi as getTokenTransferIntentCompressedInstructionDataDecoder,Mo as getTokenTransferIntentCompressedInstructionDataEncoder,tW as getTokenTransferIntentDiscriminatorBytes,xi as getTokenTransferIntentInstruction,nW as getTokenTransferIntentInstructionAsync,rW as getTokenTransferIntentInstructionDataCodec,Si as getTokenTransferIntentInstructionDataDecoder,Po as getTokenTransferIntentInstructionDataEncoder,Bu as getTransactionBufferAddress,_W as getTransactionBufferCloseCompressedDiscriminatorBytes,Ni as getTransactionBufferCloseCompressedInstruction,vW as getTransactionBufferCloseCompressedInstructionDataCodec,Bi as getTransactionBufferCloseCompressedInstructionDataDecoder,Oi as getTransactionBufferCloseCompressedInstructionDataEncoder,IW as getTransactionBufferCloseDiscriminatorBytes,Ui as getTransactionBufferCloseInstruction,CW as getTransactionBufferCloseInstructionDataCodec,vi as getTransactionBufferCloseInstructionDataDecoder,_i as getTransactionBufferCloseInstructionDataEncoder,$_ as getTransactionBufferCodec,YR as getTransactionBufferCreateArgsCodec,Nt as getTransactionBufferCreateArgsDecoder,Bt as getTransactionBufferCreateArgsEncoder,YW as getTransactionBufferCreateCompressedDiscriminatorBytes,Zi as getTransactionBufferCreateCompressedInstruction,JW as getTransactionBufferCreateCompressedInstructionDataCodec,Ji as getTransactionBufferCreateCompressedInstructionDataDecoder,Yi as getTransactionBufferCreateCompressedInstructionDataEncoder,wW as getTransactionBufferCreateDiscriminatorBytes,zi as getTransactionBufferCreateInstruction,HW as getTransactionBufferCreateInstructionDataCodec,Gi as getTransactionBufferCreateInstructionDataDecoder,Fi as getTransactionBufferCreateInstructionDataEncoder,Ec as getTransactionBufferDecoder,Q_ as getTransactionBufferDiscriminatorBytes,$T as getTransactionBufferEncoder,gL as getTransactionBufferExecuteCompressedDiscriminatorBytes,id as getTransactionBufferExecuteCompressedInstruction,pL as getTransactionBufferExecuteCompressedInstructionDataCodec,ad as getTransactionBufferExecuteCompressedInstructionDataDecoder,cd as getTransactionBufferExecuteCompressedInstructionDataEncoder,nL as getTransactionBufferExecuteDiscriminatorBytes,rd as getTransactionBufferExecuteInstruction,oL as getTransactionBufferExecuteInstructionDataCodec,td as getTransactionBufferExecuteInstructionDataDecoder,ed as getTransactionBufferExecuteInstructionDataEncoder,RL as getTransactionBufferExtendCompressedDiscriminatorBytes,xd as getTransactionBufferExtendCompressedInstruction,bL as getTransactionBufferExtendCompressedInstructionDataCodec,Sd as getTransactionBufferExtendCompressedInstructionDataDecoder,fd as getTransactionBufferExtendCompressedInstructionDataEncoder,xL as getTransactionBufferExtendDiscriminatorBytes,md as getTransactionBufferExtendInstruction,IL as getTransactionBufferExtendInstructionDataCodec,pd as getTransactionBufferExtendInstructionDataDecoder,gd as getTransactionBufferExtendInstructionDataEncoder,qL as getTransactionBufferVoteCompressedDiscriminatorBytes,Ud as getTransactionBufferVoteCompressedInstruction,jL as getTransactionBufferVoteCompressedInstructionDataCodec,vd as getTransactionBufferVoteCompressedInstructionDataDecoder,_d as getTransactionBufferVoteCompressedInstructionDataEncoder,BL as getTransactionBufferVoteDiscriminatorBytes,Md as getTransactionBufferVoteInstruction,NL as getTransactionBufferVoteInstructionDataCodec,Pd as getTransactionBufferVoteInstructionDataDecoder,Dd as getTransactionBufferVoteInstructionDataEncoder,iO as getTransactionExecuteCompressedDiscriminatorBytes,zd as getTransactionExecuteCompressedInstruction,dO as getTransactionExecuteCompressedInstructionDataCodec,Gd as getTransactionExecuteCompressedInstructionDataDecoder,Fd as getTransactionExecuteCompressedInstructionDataEncoder,eO as getTransactionExecuteDiscriminatorBytes,Nd as getTransactionExecuteInstruction,tO as getTransactionExecuteInstructionDataCodec,Bd as getTransactionExecuteInstructionDataDecoder,Od as getTransactionExecuteInstructionDataEncoder,MO as getTransactionExecuteSyncCompressedDiscriminatorBytes,ru as getTransactionExecuteSyncCompressedInstruction,hO as getTransactionExecuteSyncCompressedInstructionDataCodec,tu as getTransactionExecuteSyncCompressedInstructionDataDecoder,eu as getTransactionExecuteSyncCompressedInstructionDataEncoder,TO as getTransactionExecuteSyncDiscriminatorBytes,Zd as getTransactionExecuteSyncInstruction,fO as getTransactionExecuteSyncInstructionDataCodec,Jd as getTransactionExecuteSyncInstructionDataDecoder,Yd as getTransactionExecuteSyncInstructionDataEncoder,tb as getTransactionMessageAddressTableLookupCodec,ro as getTransactionMessageAddressTableLookupDecoder,to as getTransactionMessageAddressTableLookupEncoder,QR as getTransactionMessageCodec,Ht as getTransactionMessageDecoder,wt as getTransactionMessageEncoder,sb as getTransactionSyncSignersCodec,J as getTransactionSyncSignersDecoder,Y as getTransactionSyncSignersEncoder,ub as getTransferFeeAccountExtensionCodec,vn as getTransferFeeAccountExtensionDecoder,_n as getTransferFeeAccountExtensionEncoder,pb as getTransferHookAccountExtensionCodec,kn as getTransferHookAccountExtensionDecoder,Un as getTransferHookAccountExtensionEncoder,yb as getTransportsCodec,Ft as getTransportsDecoder,Vt as getTransportsEncoder,w as getUserAccountAddress,xb as getUserCodec,Db as getUserCreationArgsCodec,De as getUserCreationArgsDecoder,Ee as getUserCreationArgsEncoder,X as getUserDecoder,Gt as getUserEncoder,Rb as getUserMutArgsCodec,Ye as getUserMutArgsDecoder,je as getUserMutArgsEncoder,Ub as getUserReadOnlyArgsCodec,bt as getUserReadOnlyArgsDecoder,Rt as getUserReadOnlyArgsEncoder,Ob as getUserReadOnlyOrMutateArgsCodec,Ne as getUserReadOnlyOrMutateArgsDecoder,Be as getUserReadOnlyOrMutateArgsEncoder,Vb as getUserRoleCodec,Fe as getUserRoleDecoder,Ve as getUserRoleEncoder,Bw as getWalletAddressFromIndex,Me as getWalletAddressFromSettings,ov as getWhitelistedAddressTreeCodec,bc as getWhitelistedAddressTreeDecoder,nv as getWhitelistedAddressTreeDiscriminatorBytes,S1 as getWhitelistedAddressTreeEncoder,wo as getWhitelistedAddressTreeFromIndex,Mw as getWhitelistedAddressTreeIndexFromAddress,vu as getWhitelistedAddressTreesAddress,uB as identifyMultiWalletAccount,AB as identifyMultiWalletInstruction,iN as initialize,sh as isConfigAction,Eh as isExtensionStruct,fB as isMultiWalletError,ab as isTransactionSyncSigners,Nb as isUserReadOnlyOrMutateArgs,x8 as nativeTransferIntent,Pv as parseAddWhitelistedAddressTreesInstruction,Gv as parseChangeConfigCompressedInstruction,Wv as parseChangeConfigInstruction,$v as parseCreateCompressedWalletInstruction,dU as parseCreateDomainConfigInstruction,SU as parseCreateDomainUserAccountInstruction,RU as parseCreateGlobalCounterInstruction,NU as parseCreateUserAccountsInstruction,jU as parseDecompressSettingsAccountInstruction,tk as parseDisableDomainConfigInstruction,Ak as parseEditDomainConfigInstruction,xk as parseEditTransactionManagerUrlInstruction,bk as parseEditUserDelegateInstruction,Yk as parseNativeTransferIntentCompressedInstruction,wk as parseNativeTransferIntentInstruction,K2 as parseSecp256r1VerifyInstruction,mW as parseTokenTransferIntentCompressedInstruction,oW as parseTokenTransferIntentInstruction,UW as parseTransactionBufferCloseCompressedInstruction,EW as parseTransactionBufferCloseInstruction,ZW as parseTransactionBufferCreateCompressedInstruction,VW as parseTransactionBufferCreateInstruction,mL as parseTransactionBufferExecuteCompressedInstruction,sL as parseTransactionBufferExecuteInstruction,_L as parseTransactionBufferExtendCompressedInstruction,CL as parseTransactionBufferExtendInstruction,YL as parseTransactionBufferVoteCompressedInstruction,wL as parseTransactionBufferVoteInstruction,uO as parseTransactionExecuteCompressedInstruction,rO as parseTransactionExecuteInstruction,RO as parseTransactionExecuteSyncCompressedInstruction,SO as parseTransactionExecuteSyncInstruction,q5 as prepareChangeConfigArgs,e6 as prepareTransactionBundle,p6 as prepareTransactionMessage,f6 as prepareTransactionSync,Yw as retrieveTransactionManager,Zw as serializeConfigActions,L8 as tokenTransferIntent,cb as transactionSyncSigners,Bb as userReadOnlyOrMutateArgs,gu as vaultTransactionMessageDeserialize,Au as vaultTransactionMessageSerialize,aA as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
1
|
+
import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,getEnumEncoder,getEnumDecoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getU64Encoder,getU64Decoder,getU16Encoder,getOptionEncoder,getArrayEncoder,getU16Decoder,getOptionDecoder,getArrayDecoder,getBooleanEncoder,getBooleanDecoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUnitEncoder,getUnitDecoder,getUtf8Encoder,getUtf8Decoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64Encoder,getBase64Decoder,getTransactionEncoder,createDecoder,createEncoder,AccountRole,some,none,upgradeRoleToSigner,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {sha256}from'@noble/hashes/sha2.js';import u from'zod';import {createRpc,TreeType,getLightSystemAccountMetasV2,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {p256}from'@noble/curves/nist.js';import {canonicalize}from'json-canonicalize';import {getAssociatedTokenAccountAddress,getTokenDecoder,getTransferSolInstruction}from'gill/programs';import {PublicKey}from'@solana/web3.js';var kr=new Uint8Array([201,232,212,229,59,241,106,197]);function H1(){return fixEncoderSize(getBytesEncoder(),8).encode(kr)}function xi(){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:kr}))}function Or(){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 z1(){return combineCodec(xi(),Or())}function Wr(e){return decodeAccount(e,Or())}async function Br(e,r,t){let o=await Ii(e,r,t);return assertAccountExists(o),o}async function Ii(e,r,t){let o=await fetchEncodedAccount(e,r,t);return Wr(o)}async function K1(e,r,t){let o=await Ei(e,r,t);return assertAccountsExist(o),o}async function Ei(e,r,t){return (await fetchEncodedAccounts(e,r,t)).map(n=>Wr(n))}function q1(){return 846}var Fr=new Uint8Array([42,206,176,58,175,129,130,233]);function J1(){return fixEncoderSize(getBytesEncoder(),8).encode(Fr)}function Wi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Fr}))}function Gr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function Z1(){return combineCodec(Wi(),Gr())}function Vr(e){return decodeAccount(e,Gr())}async function X1(e,r,t){let o=await Bi(e,r,t);return assertAccountExists(o),o}async function Bi(e,r,t){let o=await fetchEncodedAccount(e,r,t);return Vr(o)}async function $1(e,r,t){let o=await Ni(e,r,t);return assertAccountsExist(o),o}async function Ni(e,r,t){return (await fetchEncodedAccounts(e,r,t)).map(n=>Vr(n))}function Q1(){return 24}var ht=(t=>(t[t.Initialized=0]="Initialized",t[t.Frozen=1]="Frozen",t))(ht||{});function Ut(){return getEnumEncoder(ht)}function vt(){return getEnumDecoder(ht)}function nS(){return combineCodec(Ut(),vt())}function Lt(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function kt(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function sS(){return combineCodec(Lt(),kt())}function Ot(){return getStructEncoder([["memberKey",U()],["permissions",ae()]])}function Wt(){return getStructDecoder([["memberKey",k()],["permissions",ie()]])}function uS(){return combineCodec(Ot(),Wt())}function Bt(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Nt(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function gS(){return combineCodec(Bt(),Nt())}function wt(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function Ft(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function mS(){return combineCodec(wt(),Ft())}function Kt(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function qt(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function fS(){return combineCodec(Kt(),qt())}function jt(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",Zt()],["tlv",getOptionEncoder(getArrayEncoder(Jt()))],["state",Ut()]])}function Yt(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",Xt()],["tlv",getOptionDecoder(getArrayDecoder(Le()))],["state",vt()]])}function ES(){return combineCodec(jt(),Yt())}function en(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",nn()]])}function tn(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",rn()]])}function MS(){return combineCodec(en(),tn())}function nn(){return getStructEncoder([["configAccountVersion",getU16Encoder()],["compressToPubkey",getU8Encoder()],["accountVersion",getU8Encoder()],["lamportsPerWrite",getU32Encoder()],["compressionAuthority",fixEncoderSize(getBytesEncoder(),32)],["rentSponsor",fixEncoderSize(getBytesEncoder(),32)],["lastClaimedSlot",getU64Encoder()],["rentExemptionPaid",getU32Encoder()],["reserved",getU32Encoder()],["rentConfig",cn()]])}function rn(){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",an()]])}function hS(){return combineCodec(nn(),rn())}function ke(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(An())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Ot())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(ln())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Oe(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(gn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Wt())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(pn())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function kS(){return combineCodec(ke(),Oe())}function OS(e,r){return Array.isArray(r)?{__kind:e,fields:r}:{__kind:e,...r??{}}}function WS(e,r){return r.__kind===e}function An(){return getStructEncoder([["memberKey",U()],["permissions",ae()]])}function gn(){return getStructDecoder([["memberKey",k()],["permissions",ie()]])}function FS(){return combineCodec(An(),gn())}function We(){return getStructEncoder([["memberKey",U()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function Be(){return getStructDecoder([["memberKey",k()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function zS(){return combineCodec(We(),Be())}function Jt(){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([Sn()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([mn()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([Tn()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([In()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([Dn()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([wt()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([en()])]])]])}function Le(){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([xn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([yn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([fn()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([En()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([bn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([Ft()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([tn()])]])]])}function YS(){return combineCodec(Jt(),Le())}function JS(e,r){return Array.isArray(r)?{__kind:e,fields:r}:{__kind:e,...r??{}}}function ZS(e,r){return r.__kind===e}function Rn(){return getStructEncoder([["pubkey",U()],["role",getU8Encoder()],["permissions",ae()],["padding",getU8Encoder()],["isDelegate",getU8Encoder()]])}function Pn(){return getStructDecoder([["pubkey",k()],["role",getU8Decoder()],["permissions",ie()],["padding",getU8Decoder()],["isDelegate",getU8Decoder()]])}function ex(){return combineCodec(Rn(),Pn())}function U(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function k(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function rx(){return combineCodec(U(),k())}function Zt(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function Xt(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function cx(){return combineCodec(Zt(),Xt())}function mn(){return getStructEncoder([])}function yn(){return getStructDecoder([])}function ux(){return combineCodec(mn(),yn())}function Tn(){return getStructEncoder([])}function fn(){return getStructDecoder([])}function gx(){return combineCodec(Tn(),fn())}function ae(){return getStructEncoder([["mask",getU8Encoder()]])}function ie(){return getStructDecoder([["mask",getU8Decoder()]])}function mx(){return combineCodec(ae(),ie())}function _n(){return getStructEncoder([["proof",getOptionEncoder(Kt())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function hn(){return getStructDecoder([["proof",getOptionDecoder(qt())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function Sx(){return combineCodec(_n(),hn())}function ln(){return getStructEncoder([["memberKey",U()]])}function pn(){return getStructDecoder([["memberKey",k()]])}function Dx(){return combineCodec(ln(),pn())}function cn(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function an(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function Mx(){return combineCodec(cn(),an())}function Ln(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Ne(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function _x(){return combineCodec(Ln(),Ne())}function B(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function N(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function vx(){return combineCodec(B(),N())}function kn(){return getStructEncoder([["verifyArgs",B()],["domainConfigIndex",getU8Encoder()]])}function On(){return getStructDecoder([["verifyArgs",N()],["domainConfigIndex",getU8Decoder()]])}function Wx(){return combineCodec(kn(),On())}function Wn(){return getStructEncoder([["index",getU128Encoder()],["isDelegate",getBooleanEncoder()]])}function Bn(){return getStructDecoder([["index",getU128Decoder()],["isDelegate",getBooleanDecoder()]])}function wx(){return combineCodec(Wn(),Bn())}function Nn(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function wn(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function Vx(){return combineCodec(Nn(),wn())}function Sn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(Lt())]])}function xn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(kt())]])}function qx(){return combineCodec(Sn(),xn())}function qn(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function jn(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Jx(){return combineCodec(qn(),jn())}function J(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([kn()])]])]])}function Z(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([On()])]])]])}function Qx(){return combineCodec(J(),Z())}function eI(e,r){return Array.isArray(r)?{__kind:e,fields:r}:{__kind:e,...r??{}}}function tI(e,r){return r.__kind===e}function In(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function En(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function oI(){return combineCodec(In(),En())}function Dn(){return getStructEncoder([["transferring",getU8Encoder()]])}function bn(){return getStructDecoder([["transferring",getU8Decoder()]])}function aI(){return combineCodec(Dn(),bn())}var Yn=(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))(Yn||{});function we(){return getEnumEncoder(Yn)}function Fe(){return getEnumDecoder(Yn)}function dI(){return combineCodec(we(),Fe())}var Ie=(n=>(n[n.TransactionManager=0]="TransactionManager",n[n.Administrator=1]="Administrator",n[n.PermanentMember=2]="PermanentMember",n[n.Member=3]="Member",n))(Ie||{});function le(){return getEnumEncoder(Ie)}function pe(){return getEnumDecoder(Ie)}function lI(){return combineCodec(le(),pe())}var vo=new Uint8Array([223,179,163,190,177,224,67,173]);function $I(){return fixEncoderSize(getBytesEncoder(),8).encode(vo)}function xg(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(Rn())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["padding",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:vo}))}function ct(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(Pn())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["padding",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function QI(){return combineCodec(xg(),ct())}function Lo(e){return decodeAccount(e,ct())}async function ko(e,r,t){let o=await Ig(e,r,t);return assertAccountExists(o),o}async function Ig(e,r,t){let o=await fetchEncodedAccount(e,r,t);return Lo(o)}async function eE(e,r,t){let o=await Eg(e,r,t);return assertAccountsExist(o),o}async function Eg(e,r,t){return (await fetchEncodedAccounts(e,r,t)).map(n=>Lo(n))}var wo=new Uint8Array([90,36,35,219,93,225,110,96]);function oE(){return fixEncoderSize(getBytesEncoder(),8).encode(wo)}function Fg(){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",U()],["executor",U()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(U())],["expectedSigners",getArrayEncoder(We())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:wo}))}function Fo(){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",k()],["executor",k()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(k())],["expectedSigners",getArrayDecoder(Be())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function sE(){return combineCodec(Fg(),Fo())}function Go(e){return decodeAccount(e,Fo())}async function Vo(e,r,t){let o=await Gg(e,r,t);return assertAccountExists(o),o}async function Gg(e,r,t){let o=await fetchEncodedAccount(e,r,t);return Go(o)}async function cE(e,r,t){let o=await Vg(e,r,t);return assertAccountsExist(o),o}async function Vg(e,r,t){return (await fetchEncodedAccounts(e,r,t)).map(n=>Go(n))}var Xo=new Uint8Array([159,117,95,227,239,151,58,236]);function dE(){return fixEncoderSize(getBytesEncoder(),8).encode(Xo)}function sl(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["domainConfig",getOptionEncoder(getAddressEncoder())],["member",U()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(we()))],["wallets",getArrayEncoder(Wn())],["role",le()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["bump",getU8Encoder()]]),e=>({...e,discriminator:Xo}))}function At(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["domainConfig",getOptionDecoder(getAddressDecoder())],["member",k()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(Fe()))],["wallets",getArrayDecoder(Bn())],["role",pe()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["bump",getU8Decoder()]])}function AE(){return combineCodec(sl(),At())}function $o(e){return decodeAccount(e,At())}async function gt(e,r,t){let o=await cl(e,r,t);return assertAccountExists(o),o}async function cl(e,r,t){let o=await fetchEncodedAccount(e,r,t);return $o(o)}async function gE(e,r,t){let o=await al(e,r,t);return assertAccountsExist(o),o}async function al(e,r,t){return (await fetchEncodedAccounts(e,r,t)).map(n=>$o(n))}function y({args:e}){if(!e)return [];let{remainingAccounts:r}=e;return r.map(t=>t.signer?{address:t.address,role:t.role,signer:t.signer}:{address:t.address,role:t.role})}function es(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function R(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function T(e,r){return t=>{if(!t.value)return Object.freeze({address:e,role:AccountRole.READONLY});let o=t.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:R(t.value),role:Qo(t.value)?upgradeRoleToSigner(o):o,...Qo(t.value)?{signer:t.value}:{}})}}function Qo(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var ss=new Uint8Array([8]);function hE(){return fixEncoderSize(getBytesEncoder(),1).encode(ss)}function cs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(ke())],["signers",getArrayEncoder(J())]]),e=>({...e,discriminator:ss}))}function as(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Oe())],["signers",getArrayDecoder(Z())]])}function UE(){return combineCodec(cs(),as())}function is(e,r){let t=r?.programAddress??A,n={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};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.systemProgram),s(n.slotHashSysvar),s(n.instructionsSysvar),...a],data:cs().encode(c),programAddress:t})}function vE(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),payer:t(),systemProgram:t(),slotHashSysvar:o(),instructionsSysvar:t()},data:as().decode(e.data)}}var ys=new Uint8Array([0]);function NE(){return fixEncoderSize(getBytesEncoder(),1).encode(ys)}function rr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),e=>({...e,discriminator:ys}))}function Ts(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function wE(){return combineCodec(rr(),Ts())}async function FE(e,r){let t=r?.programAddress??A,n={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},userAccount:{value:e.userAccount??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.userAccount.value||(n.userAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114])),getAddressEncoder().encode(R(n.authority.value))]}));let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.domainConfig),s(n.payer),s(n.authority),s(n.systemProgram),s(n.userAccount),...a],data:rr().encode(c),programAddress:t})}function fs(e,r){let t=r?.programAddress??A,n={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},userAccount:{value:e.userAccount??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.domainConfig),s(n.payer),s(n.authority),s(n.systemProgram),s(n.userAccount),...a],data:rr().encode(c),programAddress:t})}function GE(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:t(),payer:t(),authority:t(),systemProgram:t(),userAccount:t()},data:Ts().decode(e.data)}}var Is=new Uint8Array([4]);function YE(){return fixEncoderSize(getBytesEncoder(),1).encode(Is)}function Es(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["member",Ln()],["role",le()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(we())]]),e=>({...e,discriminator:Is}))}function Ds(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["member",Ne()],["role",pe()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Fe())]])}function JE(){return combineCodec(Es(),Ds())}function bs(e,r){let t=r?.programAddress??A,n={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},userAccount:{value:e.userAccount??null,isWritable:true},transactionManagerAccount:{value:e.transactionManagerAccount??null,isWritable:false},settings:{value:e.settings??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.payer),s(n.domainConfig),s(n.authority),s(n.userAccount),s(n.transactionManagerAccount),s(n.settings),s(n.systemProgram),...a],data:Es().encode(c),programAddress:t})}function ZE(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{payer:t(),domainConfig:t(),authority:t(),userAccount:t(),transactionManagerAccount:o(),settings:o(),systemProgram:t()},data:Ds().decode(e.data)}}var Ms=new Uint8Array([3]);function nD(){return fixEncoderSize(getBytesEncoder(),1).encode(Ms)}function cr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Ms}))}function Rs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function rD(){return combineCodec(cr(),Rs())}async function Ps(e,r){let t=r?.programAddress??A,n={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};n.globalCounter.value||(n.globalCounter.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let i=y(c),a=T(t);return Object.freeze({accounts:[a(n.globalCounter),a(n.payer),a(n.systemProgram),...i],data:cr().encode({}),programAddress:t})}function oD(e,r){let t=r?.programAddress??A,n={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let i=y(c),a=T(t);return Object.freeze({accounts:[a(n.globalCounter),a(n.payer),a(n.systemProgram),...i],data:cr().encode({}),programAddress:t})}function sD(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{globalCounter:t(),payer:t(),systemProgram:t()},data:Rs().decode(e.data)}}var hs=new Uint8Array([5]);function gD(){return fixEncoderSize(getBytesEncoder(),1).encode(hs)}function ir(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["role",le()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),e=>({...e,discriminator:hs}))}function Us(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["role",pe()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function lD(){return combineCodec(ir(),Us())}async function pD(e,r){let t=r?.programAddress??A,n={payer:{value:e.payer??null,isWritable:true},member:{value:e.member??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},userAccount:{value:e.userAccount??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.userAccount.value||(n.userAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114])),getAddressEncoder().encode(R(n.member.value))]}));let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.payer),s(n.member),s(n.systemProgram),s(n.userAccount),...a],data:ir().encode(c),programAddress:t})}function vs(e,r){let t=r?.programAddress??A,n={payer:{value:e.payer??null,isWritable:true},member:{value:e.member??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},userAccount:{value:e.userAccount??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.payer),s(n.member),s(n.systemProgram),s(n.userAccount),...a],data:ir().encode(c),programAddress:t})}function mD(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{payer:t(),member:t(),systemProgram:t(),userAccount:t()},data:Us().decode(e.data)}}var Os=new Uint8Array([16]);function ID(){return fixEncoderSize(getBytesEncoder(),1).encode(Os)}function dr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Os}))}function Ws(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()]])}function ED(){return combineCodec(dr(),Ws())}async function DD(e,r){let t=r?.programAddress??A,n={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},userAccount:{value:e.userAccount??null,isWritable:true},settings:{value:e.settings??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.globalCounter.value||(n.globalCounter.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),n.userAccount.value||(n.userAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114])),getAddressEncoder().encode(R(n.initialMember.value))]})),n.settings.value||(n.settings.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getU128Encoder().encode(es(c.settingsIndex))]}));let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.payer),s(n.initialMember),s(n.systemProgram),s(n.globalCounter),s(n.userAccount),s(n.settings),...a],data:dr().encode(c),programAddress:t})}function Bs(e,r){let t=r?.programAddress??A,n={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},userAccount:{value:e.userAccount??null,isWritable:true},settings:{value:e.settings??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.payer),s(n.initialMember),s(n.systemProgram),s(n.globalCounter),s(n.userAccount),s(n.settings),...a],data:dr().encode(c),programAddress:t})}function bD(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{payer:t(),initialMember:t(),systemProgram:t(),globalCounter:t(),userAccount:t(),settings:t()},data:Ws().decode(e.data)}}var Fs=new Uint8Array([2]);function hD(){return fixEncoderSize(getBytesEncoder(),1).encode(Fs)}function Gs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:Fs}))}function Vs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function UD(){return combineCodec(Gs(),Vs())}function Hs(e,r){let t=r?.programAddress??A,n={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=y({args:c}),s=T(t);return Object.freeze({accounts:[s(n.domainConfig),s(n.admin),...a],data:Gs().encode(c),programAddress:t})}function vD(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:t(),admin:t()},data:Vs().decode(e.data)}}var qs=new Uint8Array([1]);function ND(){return fixEncoderSize(getBytesEncoder(),1).encode(qs)}function js(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))]]),e=>({...e,discriminator:qs}))}function Ys(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))]])}function wD(){return combineCodec(js(),Ys())}function Js(e,r){let t=r?.programAddress??A,n={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},userAccount:{value:e.userAccount??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.domainConfig),s(n.authority),s(n.newAuthority),s(n.userAccount),s(n.systemProgram),...a],data:js().encode(c),programAddress:t})}function FD(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{domainConfig:t(),authority:t(),newAuthority:o(),userAccount:o(),systemProgram:t()},data:Ys().decode(e.data)}}var Xs=new Uint8Array([6]);function qD(){return fixEncoderSize(getBytesEncoder(),1).encode(Xs)}function gr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),e=>({...e,discriminator:Xs}))}function $s(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function jD(){return combineCodec(gr(),$s())}async function YD(e,r){let t=r?.programAddress??A,n={signer:{value:e.signer??null,isWritable:false},transactionManagerAccount:{value:e.transactionManagerAccount??null,isWritable:true}},c={...e},i={args:c};n.transactionManagerAccount.value||(n.transactionManagerAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114])),getAddressEncoder().encode(R(n.signer.value))]}));let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.signer),s(n.transactionManagerAccount),...a],data:gr().encode(c),programAddress:t})}function Qs(e,r){let t=r?.programAddress??A,n={signer:{value:e.signer??null,isWritable:false},transactionManagerAccount:{value:e.transactionManagerAccount??null,isWritable:true}},c={...e},a=y({args:c}),s=T(t);return Object.freeze({accounts:[s(n.signer),s(n.transactionManagerAccount),...a],data:gr().encode(c),programAddress:t})}function JD(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{signer:t(),transactionManagerAccount:t()},data:$s().decode(e.data)}}var oc=new Uint8Array([7]);function nb(){return fixEncoderSize(getBytesEncoder(),1).encode(oc)}function sc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["delegateTo",getOptionEncoder(getU128Encoder())]]),e=>({...e,discriminator:oc}))}function cc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(N())],["delegateTo",getOptionDecoder(getU128Decoder())]])}function rb(){return combineCodec(sc(),cc())}function ac(e,r){let t=r?.programAddress??A,n={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},userAccount:{value:e.userAccount??null,isWritable:true},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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.feePayer),s(n.signer),s(n.userAccount),s(n.oldSettings),s(n.newSettings),s(n.slotHashSysvar),s(n.instructionsSysvar),s(n.domainConfig),...a],data:sc().encode(c),programAddress:t})}function ob(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{feePayer:t(),signer:o(),userAccount:t(),oldSettings:o(),newSettings:o(),slotHashSysvar:o(),instructionsSysvar:o(),domainConfig:o()},data:cc().decode(e.data)}}var uc=new Uint8Array([17]);function Ab(){return fixEncoderSize(getBytesEncoder(),1).encode(uc)}function lr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(J())]]),e=>({...e,discriminator:uc}))}function dc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(Z())]])}function gb(){return combineCodec(lr(),dc())}async function lb(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),n.source.value||(n.source.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(R(n.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.slotHashSysvar),s(n.instructionsSysvar),s(n.source),s(n.destination),s(n.systemProgram),...a],data:lr().encode(c),programAddress:t})}function Ac(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.slotHashSysvar),s(n.instructionsSysvar),s(n.source),s(n.destination),s(n.systemProgram),...a],data:lr().encode(c),programAddress:t})}function pb(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),slotHashSysvar:o(),instructionsSysvar:t(),source:t(),destination:t(),systemProgram:t()},data:dc().decode(e.data)}}var Tc=new Uint8Array([18]);function Ib(){return fixEncoderSize(getBytesEncoder(),1).encode(Tc)}function pr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Nn())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(jt())],["compressedProofArgs",getOptionEncoder(_n())],["signers",getArrayEncoder(J())]]),e=>({...e,discriminator:Tc}))}function fc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(wn())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Yt())],["compressedProofArgs",getOptionDecoder(hn())],["signers",getArrayDecoder(Z())]])}function Eb(){return combineCodec(pr(),fc())}async function Db(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),n.source.value||(n.source.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(R(n.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),n.tokenProgram.value||(n.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),n.sourceSplTokenAccount.value||(n.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(R(n.source.value)),getAddressEncoder().encode(R(n.tokenProgram.value)),getAddressEncoder().encode(R(n.mint.value))]})),n.sourceCtokenTokenAccount.value||(n.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(R(n.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(R(n.mint.value))]})),n.destinationSplTokenAccount.value||(n.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(R(n.destination.value)),getAddressEncoder().encode(R(n.tokenProgram.value)),getAddressEncoder().encode(R(n.mint.value))]})),n.destinationCtokenTokenAccount.value||(n.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(R(n.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(R(n.mint.value))]})),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.compressedTokenProgramAuthority.value||(n.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),n.compressedTokenProgram.value||(n.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.slotHashSysvar),s(n.instructionsSysvar),s(n.source),s(n.sourceSplTokenAccount),s(n.sourceCtokenTokenAccount),s(n.destination),s(n.destinationSplTokenAccount),s(n.destinationCtokenTokenAccount),s(n.tokenProgram),s(n.mint),s(n.systemProgram),s(n.compressedTokenProgramAuthority),s(n.splInterfacePda),s(n.compressibleConfig),s(n.rentSponsor),s(n.compressedTokenProgram),...a],data:pr().encode(c),programAddress:t})}function Sc(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),n.tokenProgram.value||(n.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.compressedTokenProgramAuthority.value||(n.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),n.compressedTokenProgram.value||(n.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.slotHashSysvar),s(n.instructionsSysvar),s(n.source),s(n.sourceSplTokenAccount),s(n.sourceCtokenTokenAccount),s(n.destination),s(n.destinationSplTokenAccount),s(n.destinationCtokenTokenAccount),s(n.tokenProgram),s(n.mint),s(n.systemProgram),s(n.compressedTokenProgramAuthority),s(n.splInterfacePda),s(n.compressibleConfig),s(n.rentSponsor),s(n.compressedTokenProgram),...a],data:pr().encode(c),programAddress:t})}function bb(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),payer:t(),slotHashSysvar:o(),instructionsSysvar:t(),source:t(),sourceSplTokenAccount:t(),sourceCtokenTokenAccount:t(),destination:t(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:t(),mint:t(),systemProgram:t(),compressedTokenProgramAuthority:t(),splInterfacePda:o(),compressibleConfig:t(),rentSponsor:o(),compressedTokenProgram:t()},data:fc().decode(e.data)}}var Ec=new Uint8Array([12]);function Ub(){return fixEncoderSize(getBytesEncoder(),1).encode(Ec)}function Dc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:Ec}))}function bc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(N())]])}function vb(){return combineCodec(Dc(),bc())}function Cc(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.domainConfig),s(n.transactionBuffer),s(n.closer),s(n.slotHashSysvar),s(n.instructionsSysvar),...a],data:Dc().encode(c),programAddress:t})}function Lb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),payer:t(),domainConfig:o(),transactionBuffer:t(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:bc().decode(e.data)}}var Pc=new Uint8Array([9]);function Fb(){return fixEncoderSize(getBytesEncoder(),1).encode(Pc)}function _c(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(We())],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:Pc}))}function hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(Be())],["secp256r1VerifyArgs",getOptionDecoder(N())]])}function Gb(){return combineCodec(_c(),hc())}function Uc(e,r){let t=r?.programAddress??A,n={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};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.domainConfig),s(n.transactionBuffer),s(n.creator),s(n.systemProgram),s(n.instructionsSysvar),s(n.slotHashSysvar),...a],data:_c().encode(c),programAddress:t})}function Vb(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),payer:t(),domainConfig:o(),transactionBuffer:t(),creator:o(),systemProgram:t(),instructionsSysvar:t(),slotHashSysvar:o()},data:hc().decode(e.data)}}var kc=new Uint8Array([13]);function Jb(){return fixEncoderSize(getBytesEncoder(),1).encode(kc)}function Oc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:kc}))}function Wc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(N())]])}function Zb(){return combineCodec(Oc(),Wc())}function Bc(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.domainConfig),s(n.executor),s(n.transactionBuffer),s(n.slotHashSysvar),s(n.instructionsSysvar),...a],data:Oc().encode(c),programAddress:t})}function Xb(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),domainConfig:o(),executor:o(),transactionBuffer:t(),slotHashSysvar:o(),instructionsSysvar:o()},data:Wc().decode(e.data)}}var Fc=new Uint8Array([11]);function rC(){return fixEncoderSize(getBytesEncoder(),1).encode(Fc)}function Gc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Fc}))}function Vc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function oC(){return combineCodec(Gc(),Vc())}function Hc(e,r){let t=r?.programAddress??A,n={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=y({args:c}),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.transactionBuffer),...a],data:Gc().encode(c),programAddress:t})}function sC(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{settings:t(),transactionBuffer:t()},data:Vc().decode(e.data)}}var qc=new Uint8Array([10]);function gC(){return fixEncoderSize(getBytesEncoder(),1).encode(qc)}function jc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:qc}))}function Yc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(N())]])}function lC(){return combineCodec(jc(),Yc())}function Jc(e,r){let t=r?.programAddress??A,n={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};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.domainConfig),s(n.transactionBuffer),s(n.voter),s(n.systemProgram),s(n.slotHashSysvar),s(n.instructionsSysvar),...a],data:jc().encode(c),programAddress:t})}function pC(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),domainConfig:o(),transactionBuffer:t(),voter:o(),systemProgram:t(),slotHashSysvar:o(),instructionsSysvar:o()},data:Yc().decode(e.data)}}var $c=new Uint8Array([14]);function xC(){return fixEncoderSize(getBytesEncoder(),1).encode($c)}function Qc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:$c}))}function ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function IC(){return combineCodec(Qc(),ea())}function ta(e,r){let t=r?.programAddress??A,n={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=y({}),a=T(t);return Object.freeze({accounts:[a(n.settings),a(n.payer),a(n.transactionBuffer),...i],data:Qc().encode({}),programAddress:t})}function EC(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{settings:t(),payer:t(),transactionBuffer:t()},data:ea().decode(e.data)}}var oa=new Uint8Array([15]);function _C(){return fixEncoderSize(getBytesEncoder(),1).encode(oa)}function sa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(Bt())],["addressTableLookups",getArrayEncoder(qn())],["signers",getArrayEncoder(J())]]),e=>({...e,discriminator:oa}))}function ca(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Nt())],["addressTableLookups",getArrayDecoder(jn())],["signers",getArrayDecoder(Z())]])}function hC(){return combineCodec(sa(),ca())}function aa(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.slotHashSysvar),s(n.instructionsSysvar),...a],data:sa().encode(c),programAddress:t})}function UC(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),slotHashSysvar:o(),instructionsSysvar:t()},data:ca().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",_y=(c=>(c[c.DomainConfig=0]="DomainConfig",c[c.GlobalCounter=1]="GlobalCounter",c[c.Settings=2]="Settings",c[c.TransactionBuffer=3]="TransactionBuffer",c[c.User=4]="User",c))(_y||{});function tM(e){let r="data"in e?e.data:e;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([201,232,212,229,59,241,106,197])),0))return 0;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([42,206,176,58,175,129,130,233])),0))return 1;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([223,179,163,190,177,224,67,173])),0))return 2;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([90,36,35,219,93,225,110,96])),0))return 3;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([159,117,95,227,239,151,58,236])),0))return 4;throw new Error("The provided account could not be identified as a multiWallet account.")}var hy=(l=>(l[l.ChangeConfig=0]="ChangeConfig",l[l.CreateDomainConfig=1]="CreateDomainConfig",l[l.CreateDomainUserAccount=2]="CreateDomainUserAccount",l[l.CreateGlobalCounter=3]="CreateGlobalCounter",l[l.CreateUserAccount=4]="CreateUserAccount",l[l.CreateWallet=5]="CreateWallet",l[l.DisableDomainConfig=6]="DisableDomainConfig",l[l.EditDomainConfig=7]="EditDomainConfig",l[l.EditTransactionManagerUrl=8]="EditTransactionManagerUrl",l[l.EditUserDelegate=9]="EditUserDelegate",l[l.NativeTransferIntent=10]="NativeTransferIntent",l[l.TokenTransferIntent=11]="TokenTransferIntent",l[l.TransactionBufferClose=12]="TransactionBufferClose",l[l.TransactionBufferCreate=13]="TransactionBufferCreate",l[l.TransactionBufferExecute=14]="TransactionBufferExecute",l[l.TransactionBufferExtend=15]="TransactionBufferExtend",l[l.TransactionBufferVote=16]="TransactionBufferVote",l[l.TransactionExecute=17]="TransactionExecute",l[l.TransactionExecuteSync=18]="TransactionExecuteSync",l))(hy||{});function nM(e){let r="data"in e?e.data:e;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 1;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 2;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 3;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 4;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 5;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 6;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 7;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 8;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 9;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 10;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 11;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 12;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 13;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 14;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 15;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 16;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 17;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 18;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var vy=6e3,Ly=6001,ky=6002,Oy=6003,Wy=6004,By=6005,Ny=6006,wy=6007,Fy=6008,Gy=6009,Vy=6010,Hy=6011,zy=6012,Ky=6013,qy=6014,jy=6015,Yy=6016,Jy=6017,Zy=6018,Xy=6019,$y=6020,Qy=6021,eT=6022,tT=6023,nT=6024,rT=6025,oT=6026,sT=6027,cT=6028,aT=6029,iT=6030,uT=6031,dT=6032,AT=6033,gT=6034,lT=6035,pT=6036,mT=6037,yT=6038,TT=6039,fT=6040,ST=6041,xT=6042,IT=6043,ET=6044,DT=6045,bT=6046,CT=6047,MT=6048,RT=6049,PT=6050,_T=6051,hT=6052,UT=6053,vT=6054,LT=6055,kT=6056,OT=6057,WT=6058,BT=6059,NT=6060,wT=6061,FT=6062,GT=6063,VT=6064,HT=6065,zT=6066,KT=6067,qT=6068,jT=6069,YT=6070,JT=6071,ZT=6072,XT=6073,$T=6074,ia;process.env.NODE_ENV!=="production"&&(ia={[iT]:"This member is already delegated to another wallet.",[wy]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[PT]:"Missing credential id.",[hT]:"The domain configuration account is disabled. Please contact support or try again later.",[UT]:"Missing domain configuration account.",[qT]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[Vy]:"Duplicate public keys detected among members. Each member must have a unique key.",[Gy]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[Qy]:"No members provided. A multisig wallet must contain at least one member.",[Zy]:"Expected a User with Administrator role for this instruction.",[Fy]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[Yy]:"Expected a User with Transaction Manager role for this instruction.",[TT]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[fT]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[ST]:"Declared buffer size does not match the actual serialized size.",[LT]:"Failed to compute hash. This may indicate a system error.",[AT]:"Not enough members with vote permission to meet the approval threshold.",[uT]:"At least one signer with execute permission is required to proceed.",[dT]:"At least one signer with initiate permission is required to perform this action.",[oT]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[KT]:"Invalid account index in transaction message. The account index is out of bounds.",[Xy]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[cT]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[yT]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[kT]:"Member key conversion failed. The provided key format is invalid.",[gT]:"Only delegated members are allowed for this transaction.",[rT]:"Unexpected number of accounts provided for this instruction.",[Ky]:"User with Permanent Member role must have a delegated wallet.",[Ly]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[Wy]:"The extracted public key has an invalid length or encoding.",[vy]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[Oy]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[RT]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[CT]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[tT]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[zT]:"Invalid source type for token transfer. The source account type is not supported.",[Jy]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[jy]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[nT]:"Malformed transaction message: structure or formatting does not match the expected layout.",[JT]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[sT]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[YT]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[HT]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[By]:"The extracted WebAuthn signed message payload is malformed.",[DT]:"An input string exceeds the maximum allowed character length.",[BT]:"Member not found in settings. Cannot remove a member that does not exist.",[aT]:"A required account is missing from the instruction context.",[OT]:"Compressed proof arguments are missing. Required for compressed account operations.",[FT]:"Missing compressed token account. Required for token transfer operations.",[ZT]:"Missing destination token account. Required for token transfer operations.",[VT]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[WT]:"Light CPI accounts are missing. Required for compressed account operations.",[$T]:"Missing new authority account. Required for domain configuration updates.",[XT]:"Missing settings account. Required for delegate operations.",[GT]:"Missing SPL interface PDA. Required for token transfer operations.",[bT]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[pT]:"No valid signer found in this transaction.",[$y]:"Only one administrator is allowed per wallet.",[zy]:"Only one permanent member is allowed per wallet.",[qy]:"Only one transaction manager is allowed per wallet.",[vT]:"The given origin index is not in the whitelisted origins.",[wT]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[Hy]:"Permanent members cannot be removed from a wallet.",[ET]:"Writable CPI calls to protected accounts are not permitted.",[Ny]:"The rpIdHash extracted from the signed message does not match the expected value.",[NT]:"Settings key mismatch. The provided settings key does not match the expected value.",[ky]:"The signature index provided is out of bounds for the secp256r1 instruction.",[MT]:"The specified slot number was not found in the provided slot history.",[eT]:"Too many members: a maximum of 4 members are supported.",[xT]:"This transaction has expired. It must be executed within 3 minutes of approval.",[IT]:"This transaction has not yet reached the required approval threshold.",[_T]:"Missing transports.",[mT]:"Only the transaction creator or rent payer may close this transaction buffer.",[jT]:"Unauthorized: Only the admin account is allowed to perform this action.",[lT]:"Member is not part of the expected signers for this transaction."});function iM(e){return process.env.NODE_ENV!=="production"?ia[e]:"Error message not available in production bundles."}function uM(e,r,t){return isProgramError(e,r,A,t)}var te=class extends Error{constructor(t,o,n){super(t);this.code=o;this.cause=n;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},me=class extends te{constructor(r){super(`${r} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},X=class extends te{constructor(r,t){super(`${r} not found.${t?` ${t}`:""}`,"NOT_FOUND");}},O=class extends te{constructor(r,t){super(r,"VALIDATION_ERROR",{field:t});}},De=class extends te{constructor(t,o,n){super(t,"NETWORK_ERROR",{statusCode:o,url:n});this.statusCode=o;this.url=n;}},ft=class extends te{constructor(t,o,n){super(`Operation "${t}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:n});this.attempts=o;this.lastError=n;}},St=class extends te{constructor(t,o,n){super(t,"PERMISSION_ERROR",{required:o,actual:n});this.required=o;this.actual=n;}};var ze={Ed25519:1,Secp256r1:2};var bM=u.looseObject({publicKey:u.string(),walletAddress:u.string(),settingsIndexWithAddress:u.object({index:u.union([u.number(),u.bigint()])})}),QT=u.object({devicePublicKey:u.string(),platform:u.enum(["web","ios","android"]),userAgent:u.string().optional(),browser:u.object({name:u.string().optional(),version:u.string().optional(),major:u.string().optional(),type:u.string().optional()}).optional(),engine:u.object({name:u.string().optional(),version:u.string().optional()}).optional(),cpu:u.object({architecture:u.string().optional()}).optional(),device:u.object({type:u.string().optional(),vendor:u.string().optional(),model:u.string().optional()}).optional(),os:u.object({name:u.string().optional(),version:u.string().optional()}).optional(),app:u.object({name:u.string().optional(),version:u.string().optional(),build:u.string().optional()}).optional(),display:u.object({screenWidth:u.number().optional(),screenHeight:u.number().optional(),viewportWidth:u.number().optional(),viewportHeight:u.number().optional(),devicePixelRatio:u.number().optional()}).optional(),locale:u.string().optional(),timezone:u.string().optional(),push:u.object({provider:u.enum(["expo","fcm","apns"]),token:u.string()}).optional(),website:u.string().optional(),nativeApp:u.string().optional(),createdAt:u.iso.datetime().optional()}).strict(),ua=u.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","transfer_intent","change_delegate","change_config"]),CM=u.object({transactionActionType:ua,transactionAddress:u.string(),transactionMessageBytes:u.array(u.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),ef=u.object({transactionActionType:ua,transactionAddress:u.string(),transactionMessageBytes:u.base64()}).strict(),da=u.object({phase:u.literal("start"),clientOrigin:u.url(),signer:u.string().optional(),rid:u.string(),validTill:u.number(),providerOrigin:u.string(),rpId:u.string(),data:u.object({type:u.literal("message"),payload:u.string(),requireTwoFactorAuthentication:u.boolean().default(false)}).strict()}).strict(),Aa=u.object({phase:u.literal("start"),clientOrigin:u.url(),signer:u.string().optional(),rid:u.string(),validTill:u.number(),providerOrigin:u.string(),rpId:u.string(),data:u.object({type:u.literal("transaction"),payload:ef}).strict()}).strict(),ga=u.object({startRequest:u.union([da,Aa]),authResponse:u.custom(),client:u.object({clientOrigin:u.url(),jws:u.string()}).strict(),device:u.object({jwk:u.base64(),jws:u.string(),deviceProfile:QT}).strict()}).strict(),la=u.object({signer:u.string(),additionalInfo:u.looseObject({}).optional()}).strict(),tf=u.object({slotHash:u.string(),slotNumber:u.string(),estimatedSlotHashExpiry:u.number(),originIndex:u.number(),crossOrigin:u.boolean()}).strict(),MM=u.object({phase:u.literal("complete"),data:u.object({type:u.literal("message"),payload:la.extend(ga.shape).extend({startRequest:da,transactionManager:u.object({publicKey:u.string(),signature:u.string()}).optional()})}).strict()}).strict(),RM=u.object({phase:u.literal("complete"),data:u.object({type:u.literal("transaction"),payload:la.extend(ga.shape).extend(tf.shape).extend({startRequest:Aa})}).strict()}).strict();var $={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},ne=class e{constructor(r){this.mask=r;}static fromPermissions(r){return new e(r.reduce((t,o)=>t|o,0))}static all(){return new e(Object.values($).reduce((r,t)=>r|t,0))}static has(r,t){return (r.mask&t)===t}};var xr=33,re=class{_bn;constructor(r){typeof r=="string"?this._bn=new Uint8Array(getBase58Encoder().encode(r)):this._bn=new Uint8Array(r),this.validateKeyLength(this._bn);}validateKeyLength(r){if(r.length!==xr)throw new Error(`Invalid public key length, expected ${xr} bytes but got ${r.length}`)}toBase58(){return getBase58Decoder().decode(this.toBytes())}toTruncatedBuffer(){let r=this.toBuffer();return r.subarray(1,r.length)}toBuffer(){if(!this._bn)throw new Error("Invalid public key input");let r=this._bn;if(r.byteLength===xr)return r;throw new Error("Invalid public key input")}toBytes(){let r=this.toBuffer();return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}toString(){return this.toBase58()}toJSON(){return this.toBase58()}},I=class extends re{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(r,t){super(r),this.verifyArgs=t.verifyArgs,this.domainConfig=t.domainConfig,this.authData=t.authData,this.signature=t.signature,this.originIndex=t.originIndex,this.crossOrigin=t.crossOrigin,this.clientAndDeviceHash=t.clientAndDeviceHash,this.authResponse=t.authResponse;}};function of(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function sf(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var ma=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(of())],["addressTableLookups",getArrayCodec(sf())]]);function ya(e){return ma.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(t=>({programAddressIndex:t.programAddressIndex,accountIndices:t.accountIndices??[],data:Array.from(t.data??[])})),addressTableLookups:e.version!=="legacy"?e.addressTableLookups?.map(t=>({lookupTableAddress:t.lookupTableAddress,readonlyIndexes:t.readonlyIndexes,writableIndexes:t.writableIndexes}))??[]:[]})}function Ta(e){let r=ma.decode(e);return {header:{numSignerAccounts:r.numSigners,numReadonlySignerAccounts:r.numSigners-r.numWritableSigners,numReadonlyNonSignerAccounts:r.accountKeys.length-r.numSigners-r.numWritableNonSigners},addressTableLookups:r.addressTableLookups.map(t=>({lookupTableAddress:t.lookupTableAddress,readonlyIndexes:t.readonlyIndexes.map(Number),writableIndexes:t.writableIndexes.map(Number),readableIndices:t.readonlyIndexes.map(Number),writableIndices:t.writableIndexes.map(Number)})),instructions:r.instructions.map(t=>({accountIndices:t.accountIndices.map(Number),data:new Uint8Array(t.data),programAddressIndex:t.programAddressIndex})),lifetimeToken:A,staticAccounts:r.accountKeys,version:0}}function fa(e,r,t,o){if(e<r||e>t)throw new O(`${o} must be between ${r} and ${t} (inclusive), got ${e}`)}async function v(e){let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("user"),e instanceof re?e.toTruncatedBuffer():getAddressEncoder().encode(e)]});return r}async function be({rpIdHash:e,rpId:r}){if(!e)if(r)e=sha256(getUtf8Encoder().encode(r));else throw new O("Either rpId or rpIdHash must be provided");let[t]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return t}async function It(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function Sa(e,r,t){fa(t,0,255,"buffer_index");let[o]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),r instanceof re?r.toTruncatedBuffer():getAddressEncoder().encode(r),getU8Encoder().encode(t)]});return o}async function Q(e){let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return r}async function se(e){let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return r}async function XM(e){let r=await se(e);return await Q(r)}async function $M(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}var V={};function oR(){if(!V.solanaRpcEndpoint)throw new me("RPC endpoint");return V.solanaRpcEndpoint}function Ke(){if(!V.lightProtocolRpc)throw new me("Light Protocol RPC");return V.lightProtocolRpc}function _(){if(!V.solanaRpc)throw new me("Solana RPC");return V.solanaRpc}function sR(){if(!V.sendAndConfirm)throw new me("Send and confirm transaction function");return V.sendAndConfirm}function cR({rpcEndpoint:e,proverEndpoint:r,compressionApiEndpoint:t}){V.solanaRpcEndpoint=e,V.lightProtocolRpc=createRpc(e,t,r);let{rpc:o,sendAndConfirmTransaction:n}=createSolanaClient({urlOrMoniker:e});V.solanaRpc=o,V.sendAndConfirm=n;}function Et(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}function lf(e){let r=new Uint8Array(e.length/2);for(let t=0;t<r.length;t++)r[t]=parseInt(e.slice(t*2,t*2+2),16);return r}function Ia(e){let r=new Set(["type","challenge","origin","crossOrigin"]),t={};for(let n in e)r.has(n)||(t[n]=e[n]);if(Object.keys(t).length===0)return new Uint8Array([]);let o=JSON.stringify(t);return new TextEncoder().encode(o.slice(1,-1))}function Ea(e,r){let t=[],o=0,n=new TextDecoder;for(let c=0;c<r;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=n.decode(a);t.push(s),o+=i;}return t}function Da(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let r=e[1],t=2;if(r>128){let F=r&127;t+=F;}if(e[t]!==2)throw new Error("Expected INTEGER for r");let o=e[t+1],n=t+2,c=e.slice(n,n+o);if(t=n+o,e[t]!==2)throw new Error("Expected INTEGER for s");let i=e[t+1],a=t+2,s=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,g=s[0]===0&&s.length>32?s.slice(1):s;if(d.length>32||g.length>32)throw new Error("r or s length > 32 bytes");let p=new Uint8Array(32);p.set(d,32-d.length);let m=p256.Point.CURVE().n>>1n,f=BigInt("0x"+Et(g)),M=(f>m?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),P=lf(M);return new Uint8Array([...p,...P])}function qe(e){let r=K(e.response.clientDataJSON),t=K(e.response.authenticatorData),o=sha256(r);return new Uint8Array([...t,...o])}function DR(e){let r=decodeCBOR(e),t=p256.Point.fromAffine({x:BigInt("0x"+Et(r.get(-2))),y:BigInt("0x"+Et(r.get(-3)))});return getBase58Decoder().decode(t.toBytes(true))}function bR(e){let t=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,t.slice(1,33)),o.set(-3,t.slice(33,65)),new Uint8Array(encodeCBOR(o))}async function CR(e){let{authenticatorData:r,clientDataJSON:t,signature:o}=e.authResponse.response,n=K(r),c=JSON.parse(getUtf8Decoder().decode(K(t))),i=Ia(c),a=Da(K(o)),s=await be({rpIdHash:n.subarray(0,32)});return new I(e.signer.toString(),{verifyArgs:{clientDataJson:K(t),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:Dr(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:s,authData:n,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function Dr(e,r,t){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(r),...getBase64Encoder().encode(t)]))}function MR(e){return sha256(getUtf8Encoder().encode(canonicalize(e)))}function RR(e){return br(e.data.payload.authResponse)}function PR(e,r,t,o){let n=Dr(r,t,o);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...n]))}async function _R(e,r,t,o,n,c,i){let a;if(!n||!c||!i){let p=(await _().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!p)throw new X("Slot sysvar","Unable to fetch slot sysvar data");let m=getBase64Encoder().encode(p[0]);c=getU64Decoder().decode(m.subarray(0,8)).toString(),a=m.subarray(8,40),n=getBase58Decoder().decode(a),i=Date.now()+512*400;}else a=getBase58Encoder().encode(n);let s=sha256(typeof e.transactionMessageBytes=="string"?getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),d=Dr(r,t,o),g=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...s,...a,...d]));return {slotNumber:c,slotHash:n,challenge:g,estimatedSlotHashExpiry:i}}function hR(e,r){return new Uint8Array([...qe(e),...getUtf8Encoder().encode(canonicalize(r))])}function br(e){let r=qe(e);return sha256(r)}function UR(e){let r="";for(let o of e)r+=String.fromCharCode(o);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function K(e){let r=e.replace(/-/g,"+").replace(/_/g,"/"),t=(4-r.length%4)%4,o=r.padEnd(r.length+t,"="),n=atob(o),c=new ArrayBuffer(n.length),i=new Uint8Array(c);for(let a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return i}async function vR(e,r){let{data:t}=await Br(_(),e),n=Ea(t.origins,t.numOrigins).findIndex(c=>c===r);if(n===-1)throw new X("Origin","Origin not found in domain config");return n}function LR(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function kR(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}function VR(e,r){if(r.threshold>1)throw new O("Multi-signature transactions with threshold > 1 are not supported yet.");let t=r.members.find(s=>_a(s.pubkey)===e);if(!t)throw new X("Member",`Signer ${e} not found in settings`);let{permissions:o}=t;if(!o)throw new X("Permissions","No permissions found for the current member");let n=ne.has(o,$.InitiateTransaction),c=ne.has(o,$.VoteTransaction),i=ne.has(o,$.ExecuteTransaction);if(n&&c&&i)return null;if(!c||!i)throw new St("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=r.members.find(s=>s.role===0);if(!a)throw new X("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(_a(a.pubkey))}}function bf(e){let r=new URL(e);return r.protocol==="https:"?r.protocol="wss:":r.protocol==="http:"&&(r.protocol="ws:"),r.toString()}function Cf(e,r){return new Promise((t,o)=>{let n=new WebSocket(e),c=()=>{try{n.close();}catch{}};r.addEventListener("abort",c,{once:true}),n.onopen=()=>{r.removeEventListener("abort",c),t(n);},n.onerror=()=>{r.removeEventListener("abort",c),o(new Error("WebSocket connection failed"));};})}async function Mf(e,r,t){return new Promise((o,n)=>{let c=false,i=()=>{r.removeEventListener("abort",s),e.removeEventListener("message",d),e.removeEventListener("error",g),e.removeEventListener("close",p);},a=m=>{c||(c=true,i(),m());},s=()=>{try{e.close();}catch{}};r.addEventListener("abort",s);let d=m=>{if(typeof m.data!="string")return;let f;try{f=JSON.parse(m.data);}catch{return}let E=typeof f.event=="string"?f.event:"message",M=f.data;try{t(E,M)&&a(()=>o());}catch(P){a(()=>n(P));}},g=()=>{a(()=>n(new De("Transaction manager request failed",0,e.url)));},p=()=>{a(()=>o());};e.addEventListener("message",d),e.addEventListener("error",g),e.addEventListener("close",p);})}function Cr(e="Aborted"){let r=new Error(e);return r.name="AbortError",r}var Rf=(e,r)=>new Promise((t,o)=>{if(r.aborted)return o(Cr());let n=setTimeout(t,e);r.addEventListener("abort",()=>{clearTimeout(n),o(Cr());},{once:true});});function HR(e){let{address:r,url:t,authResponses:o,transactionMessageBytes:n,onPendingApprovalsCallback:c,onPendingApprovalsSuccess:i,abortController:a,opts:s}=e,d=a??new AbortController,g=s?.maxAttempts??10,p=s?.retryDelayMs??400;return {address:r,async signTransactions(m){let{signal:f}=d,E=bf(t),M=JSON.stringify({type:"transaction",data:{publicKey:r.toString(),payload:m.map(P=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(P)),transactionMessageBytes:n?getBase64Decoder().decode(n):void 0,authResponses:o}))}});for(let P=0;P<g;P++){if(f.aborted)throw Cr();let F,G;try{G=await Cf(E,f),G.send(M),await Mf(G,f,(l,H)=>{if(l==="error"){let he=H&&typeof H=="object"&&typeof H.error=="string"?H.error:"Unknown error",xe=new Error(he);throw xe.noRetry=!0,xe}return l==="signatures"?(F=H.signatures,!0):(l==="pending_transaction_approval"?c?.(H.validTill):l==="transaction_approved"&&i?.(),!1)});}catch(l){if(l&&typeof l=="object"&&l.noRetry)throw new De(`${l.message}`);if(l&&typeof l=="object"&&l.name==="AbortError")throw l}finally{try{G?.close();}catch{}}if(F?.length)return F.map(l=>({[r]:getBase58Encoder().encode(l)}));P<g-1&&await Rf(p,f);}throw new De("Transaction manager: missing signatures")}}}function _a(e){return e.keyType===ze.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function zR(e){let r=e.map(c=>ke().encode(c)),t=4+r.reduce((c,i)=>c+i.length,0),o=new Uint8Array(t),n=0;o.set(getU32Encoder().encode(e.length),n),n+=4;for(let c of r)o.set(c,n),n+=c.length;return o}function KR(e){let r=0,[t,o]=getU32Decoder().read(e,r);r=o;let n=new Array(t);for(let c=0;c<t;c++){let i=Oe().read(e,r);n[c]=i[0],r=i[1];}if(r!==e.length)throw new O(`Trailing bytes detected: expected ${e.length} bytes but consumed ${r}`);return n}var Mr=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"];function w(e,r=0){let t=e instanceof I?e:void 0,o=t?.verifyArgs&&r!==-1?some({signedMessageIndex:r,truncatedClientDataJson:t.verifyArgs.truncatedClientDataJson,slotNumber:t.verifyArgs.slotNumber,originIndex:t.originIndex,crossOrigin:t.crossOrigin,clientAndDeviceHash:t.clientAndDeviceHash}):none(),n=t?.domainConfig?t.domainConfig:void 0,c=t?.verifyArgs?t.signature:void 0,i=t?.authData&&t.verifyArgs.clientDataJson?qe(t.authResponse):void 0,a=t?.toBuffer();return {domainConfig:n,verifyArgs:o,signature:c,message:i,publicKey:a}}function Re(e,r,t=[]){let o=[];for(let n of e)if(n instanceof I){let c=t.length,{domainConfig:i,verifyArgs:a,signature:s,publicKey:d,message:g}=w(n,c);if(g&&s&&d&&t.push({message:g,signature:s,publicKey:d}),i){let p=r.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=r.addPreAccounts([{address:n.address,role:AccountRole.READONLY_SIGNER,signer:n}]).get(n.address)?.index;c!==void 0&&o.push({__kind:"Ed25519",fields:[c]});}return {secp256r1VerifyInput:t,transactionSyncSigners:o}}function ee(e){if(e instanceof re)return {keyType:ze.Secp256r1,key:e.toBytes()};{let r;try{r="address"in e?e.address:e;}catch{r=e;}return {keyType:ze.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(r)])}}}function Ua(e){return e instanceof I?e.toString():e.address.toString()}function j(e){let r=new Set,t=[];for(let n of e)r.has(Ua(n))||(t.push(n),r.add(Ua(n)));let o=t.filter(n=>n instanceof I);if(o.length>1)throw new O(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return t}function va({payer:e,tipAmount:r}){let t=Mr[Math.floor(Math.random()*Mr.length)];return getTransferSolInstruction({source:e,destination:address(t),amount:r})}var ka=8,Oa=1,Wf=34,Bf=5,Nf=ka+Oa,Wa=ka+Oa+32,wf=Wa+Wf+Bf,Ff=20;async function uP(e,{member:r,credentialId:t}){let o=[{memcmp:{offset:BigInt(Nf),encoding:"base58",bytes:e.toString()}}];if(r)o.push({memcmp:{offset:BigInt(Wa),encoding:"base58",bytes:getBase58Decoder().decode(U().encode(ee(r)))}});else if(t)o.push({memcmp:{offset:BigInt(wf),encoding:"base58",bytes:getBase58Decoder().decode(K(t))}});else return null;let n=await _().getProgramAccounts(A,{filters:o}).send();return n.length?n.map(c=>At().decode(getBase58Encoder().encode(c.account.data)))[0]:null}async function dP(e){let r=(await gt(_(),await v(e))).data;if(r.role===1||r.role===0){let t=[];return (await _().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(Ff),encoding:"base64",bytes:getBase64Decoder().decode(U().encode(ee(e)))}}]}).send()).forEach(n=>{let c=ct().decode(getBase64Encoder().encode(n.account.data[0]));t.push({...c});}),t}else return await Promise.all(r.wallets.map(async t=>ko(_(),await se(t.index))))}async function DP({payer:e,rpId:r,origins:t,authority:o}){let n=await be({rpId:r});return fs({origins:t,authority:o,payer:e,domainConfig:n,rpId:r,userAccount:await v(o.address),remainingAccounts:[]})}async function RP({payer:e}){let r=await It();return Ps({payer:e,globalCounter:r})}async function UP({admin:e,rpId:r,disable:t}){let o=await be({rpId:r});return Hs({domainConfig:o,admin:e,disable:t,remainingAccounts:[]})}function Vf(e,r,t,o){let n=Hf(e,r),c=zf(e,r)&&t!==o;return n&&c?AccountRole.WRITABLE_SIGNER:n&&!c?AccountRole.WRITABLE:!n&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function Hf(e,r){let t=e.staticAccounts.length,{numSignerAccounts:o,numReadonlySignerAccounts:n,numReadonlyNonSignerAccounts:c}=e.header,i=o-n,a=t-o-c;return r>=t?false:r<i?true:r>=o?r-o<a:false}function zf(e,r){return r<e.header.numSignerAccounts}async function bt({walletAddress:e,transactionMessageBytes:r,addressesByLookupTableAddress:t,additionalSigners:o}){let n=Ta(r);if(n.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=t??(n.addressTableLookups?await fetchAddressesForLookupTables(n.addressTableLookups.map(a=>a.lookupTableAddress),_()):{}),i=[];i.push(...n.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,s]of n.staticAccounts.entries())i.push({address:s,role:Vf(n,a,s,e)});if(n.addressTableLookups)for(let a of n.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 g=s[d];if(!g)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:g,role:AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let g=s[d];if(!g)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:g,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:n}}var Pe=33,_e=64,hr=14,Xf=2,$f=address("Secp256r1SigVerify1111111111111111111111111");function Qf(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function e1(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function Fa(){return createDecoder({read:(e,r=0)=>{let t=getU8Decoder().decode(e,r);r+=1;let o=getU8Decoder().decode(e,r);r+=1;let n=[],c=e1();for(let a=0;a<t;a++)n.push(c.decode(e,r)),r+=hr;let i=[];for(let a=0;a<t;a++){let s=fixDecoderSize(getBytesDecoder(),Pe).decode(e,r);r+=Pe;let d=fixDecoderSize(getBytesDecoder(),_e).decode(e,r);r+=_e;let g=n[a].messageDataSize,p=fixDecoderSize(getBytesDecoder(),g).decode(e,r);r+=g,i.push({publicKey:s,signature:d,message:p});}return [{numSignatures:t,padding:o,offsets:n,payload:i},r]}})}function Ga(){return createEncoder({getSizeFromValue:e=>{let r=hr*e.offsets.length,t=e.payload.reduce((o,n)=>o+Pe+_e+n.message.length,0);return 2+r+t},write:(e,r,t=0)=>{t=getU8Encoder().write(e.numSignatures,r,t),t=getU8Encoder().write(e.padding,r,t);let o=Qf();for(let n of e.offsets)t=o.write(n,r,t);for(let n of e.payload)t=fixEncoderSize(getBytesEncoder(),Pe).write(n.publicKey,r,t),t=fixEncoderSize(getBytesEncoder(),_e).write(n.signature,r,t),t=getBytesEncoder().write(n.message,r,t);return t}})}function VP(){return combineCodec(Ga(),Fa())}function L(e,r){let t=e.length,o=Xf+t*hr,n=[];for(let s=0;s<t;s++){let{message:d}=e[s],g=o,p=g+Pe,m=p+_e;n.push({publicKeyOffset:g,publicKeyInstructionIndex:65535,signatureOffset:p,signatureInstructionIndex:65535,messageDataOffset:m,messageDataSize:d.length,messageInstructionIndex:65535}),o+=Pe+_e+d.length;}let c=r?.programAddress??$f,i={numSignatures:t,padding:0,offsets:n,payload:e};return {accounts:[],programAddress:c,data:Ga().encode(i)}}function HP(e){return {programAddress:e.programAddress,accounts:{},data:Fa().decode(e.data)}}async function Va({settings:e,transactionBufferAddress:r,transactionMessageBytes:t,payer:o,addressesByLookupTableAddress:n,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a}){let s=await Q(e),{accountMetas:d,addressLookupTableAccounts:g}=await bt({transactionMessageBytes:t,walletAddress:s,additionalSigners:i,addressesByLookupTableAddress:n}),p=[];return c.length>0&&p.push(L(c)),p.push(ta({transactionBuffer:r,payer:o.address,settings:e})),a&&p.push(va({payer:o,tipAmount:a})),{instructions:p,addressLookupTableAccounts:g}}var Y=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(r){for(let t of r)this.insertOrGet(t.address.toString(),t,false);return this.preMap}getAccountRole(r,t){return r?t?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:t?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(A.toString())}).map(r=>({address:address(r.pubkey.toString()),role:this.getAccountRole(r.isSigner,r.isWritable)})));}insertOrGet(r,t={address:address(r),role:AccountRole.WRITABLE},o=true){let n=o?this.packedMap:this.preMap;if(!n.has(r)){let c=o?this.nextPackedIndex++:this.nextPreIndex++;n.set(r,{index:c,accountMeta:t});}return n.get(r).index}packOutputTreeIndex(r){if(r.treeType===TreeType.StateV1)return this.insertOrGet(r.tree.toString());if(r.treeType===TreeType.StateV2)return this.insertOrGet(r.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let r=await Ke().getStateTreeInfos(),t=selectStateTreeInfo(r);return this.packOutputTreeIndex(t)}packTreeInfos(r,t){let o=[],n=[];for(let c of r){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 t){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());n.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:o.length>0?{packedTreeInfos:o,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:n}}hashSetAccountsToMetas(r){return Array.from(r.entries()).sort((o,n)=>o[1].index-n[1].index).map(([,{accountMeta:o}])=>({...o}))}getOffsets(r){let t=r,o=t+this.systemAccounts.length;return [t,o]}toAccountMetas(){let r=this.hashSetAccountsToMetas(this.preMap),t=this.hashSetAccountsToMetas(this.packedMap),[o,n]=this.getOffsets(r.length);return {remainingAccounts:[...r,...this.systemAccounts,...t],systemOffset:o,packedOffset:n}}};async function Ka({settings:e,transactionMessageBytes:r,additionalSigners:t,signers:o,addressesByLookupTableAddress:n,secp256r1VerifyInput:c=[]}){let i=j(o),a=await Q(e),[{accountMetas:s,addressLookupTableAccounts:d,transactionMessage:g}]=await Promise.all([bt({transactionMessageBytes:r,walletAddress:a,additionalSigners:t,addressesByLookupTableAddress:n})]),p=new Y;p.addPreAccounts(s);let{secp256r1VerifyInput:m,transactionSyncSigners:f}=Re(i,p,c),{remainingAccounts:E}=p.toAccountMetas(),M=[];m.length>0&&M.push(L(m));let P=o1(g,s);return M.push(aa({signers:f,settings:e,...P,remainingAccounts:E})),{instructions:M,addressLookupTableAccounts:d}}function o1(e,r){if(e.version==="legacy")throw new O("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(t=>({...t,accountIndices:new Uint8Array(t.accountIndices??[]),data:t.data??[]})),addressTableLookups:e.addressTableLookups?.map(t=>({lookupTableAddressIndex:r.findIndex(o=>o.address===t.lookupTableAddress),writableIndexes:new Uint8Array(t.writableIndexes),readonlyIndexes:new Uint8Array(t.readonlyIndexes)}))??[]}}async function D_({settings:e,destination:r,signers:t,amount:o}){let n=j(t),c=await Q(e),{value:i}=await _().getAccountInfo(c,{encoding:"base64"}).send();if((i?.lamports??0)<BigInt(o))throw new O("Insufficient balance for native transfer.");let a=new Y,{secp256r1VerifyInput:s,transactionSyncSigners:d}=Re(n,a),{remainingAccounts:g}=a.toAccountMetas(),p=[];return s.length>0&&p.push(L(s)),p.push(Ac({amount:o,signers:d,source:c,destination:r,settings:e,remainingAccounts:g})),p}var s1=3,c1=500,a1=2,i1=3e4,u1={backoffBase:a1,maxDelayMs:i1,retryOnRateLimit:true,initialDelayMs:c1,maxRetries:s1};function d1(e,r,t,o){let n=r*Math.pow(t,e-1);return Math.min(n,o)}function A1(e){return new Promise(r=>setTimeout(r,e))}async function qa(e,r){let{maxRetries:t,initialDelayMs:o,backoffBase:n,maxDelayMs:c,shouldRetry:i}={...u1,...r},a;for(let s=1;s<=t;s++)try{return await e()}catch(d){if(a=d,i&&!i(d,s))throw d;if(s>=t)break;let g=d1(s,o,n,c);await A1(g);}throw new ft(e.name||"retryWithBackoff",t,a)}var f1=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),S1=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Mt=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function F_({settings:e,destination:r,mint:t,signers:o,amount:n,payer:c,tokenProgram:i,splInterfacePdaArgs:a={index:0,restricted:false}}){let s=j(o),d=await Q(e),g=await x1(t,r,d,i,a),p=await I1(g),m=E1(p,g,n),[f,E]=await Promise.all([R1(d,t,m.splBalance,m.cTokenBalance,BigInt(n)),M1(m.requireSplInterface,g.splInterfacePda)]),M=BigInt(f.reduce((Je,ii)=>Je+(ii.parsed.amount.toNumber()??0),0));if(m.splBalance+m.cTokenBalance+M<BigInt(n))throw new O("Insufficient balance for token transfer.");let P=new Y;E&&P.addPreAccounts([{address:t,role:AccountRole.WRITABLE}]);let F=D1(f),{proof:G}=await b1(P,F),l=C1(f,G,P),{secp256r1VerifyInput:H,transactionSyncSigners:he}=Re(s,P),{remainingAccounts:xe,systemOffset:ce}=P.toAccountMetas(),Lr=U1(G,ce),h=[];return H.length>0&&h.push(L(H)),h.push(Sc({settings:e,payer:c,source:d,sourceSplTokenAccount:g.sourceSplAta,sourceCtokenTokenAccount:g.sourceCtokenAta,destination:r,destinationSplTokenAccount:m.destinationSplTokenAccount,destinationCtokenTokenAccount:m.destinationCtokenTokenAccount,tokenProgram:i,mint:t,splInterfacePda:m.requireSplInterface?g.splInterfacePda:void 0,compressibleConfig:f1,rentSponsor:m.requireRentSponsor?S1:void 0,amount:n,signers:he,sourceCompressedTokenAccounts:l,compressedProofArgs:Lr,splInterfacePdaArgs:m.requireSplInterface?some(a):none(),remainingAccounts:xe})),h}async function x1(e,r,t,o,n){let c=m=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(m),getAddressEncoder().encode(Mt),getAddressEncoder().encode(e)],programAddress:Mt}),i=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(e)];n.restricted&&i.push(getUtf8Encoder().encode("restricted")),n.index>0&&i.push(getU8Encoder().encode(n.index));let[a,[s],d,[g],[p]]=await Promise.all([getAssociatedTokenAccountAddress(e,t,o),c(t),getAssociatedTokenAccountAddress(e,r,o),c(r),getProgramDerivedAddress({seeds:i,programAddress:Mt})]);return {sourceSplAta:a,sourceCtokenAta:s,destinationSplAta:d,destinationCTokenAta:g,splInterfacePda:p}}async function I1(e){let[r,t,o]=await Promise.all([_().getAccountInfo(e.destinationSplAta,{encoding:"base64"}).send(),_().getAccountInfo(e.sourceSplAta,{encoding:"base64"}).send(),_().getAccountInfo(e.sourceCtokenAta,{encoding:"base64"}).send()]);return {destinationSplAtaInfo:r,sourceSplAtaInfo:t,sourceCTokenAtaInfo:o}}function E1(e,r,t){let o=!!e.destinationSplAtaInfo.value,n=!!e.sourceSplAtaInfo.value,c=!!e.sourceCTokenAtaInfo.value,i=n?getTokenDecoder().decode(getBase64Encoder().encode(e.sourceSplAtaInfo.value.data[0])).amount:BigInt(0),a=BigInt(c?_1(getBase64Encoder().encode(e.sourceCTokenAtaInfo.value.data[0]))?.amount??0:0),s=o?r.destinationSplAta:void 0,d=o?void 0:r.destinationCTokenAta,g=n&&(i+a<BigInt(t)||a>BigInt(0)||!o)||!n&&o;return {splBalance:i,cTokenBalance:a,destinationSplTokenAccount:s,destinationCtokenTokenAccount:d,requireSplInterface:g,requireRentSponsor:i+a<BigInt(t)||!o}}function D1(e){let r=[];return e.forEach(t=>r.push({hash:t.compressedAccount.hash,tree:t.compressedAccount.treeInfo.tree,queue:t.compressedAccount.treeInfo.queue,data:t.compressedAccount.data,address:t.compressedAccount.address})),r}async function b1(e,r){let t=null;return r.length===0?{proof:t}:(await e.addSystemAccounts(),t=await v1(r,[]),{proof:t})}function C1(e,r,t){return !r||!e.length?[]:e.map(o=>({amount:o.parsed.amount.toNumber(),merkleContext:{leafIndex:o.compressedAccount.leafIndex,merkleTreePubkeyIndex:t.insertOrGet(o.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:t.insertOrGet(o.compressedAccount.treeInfo.queue.toString()),proveByIndex:o.compressedAccount.proveByIndex},rootIndex:r.rootIndices[0],version:h1(o.compressedAccount.data?.discriminator),tlv:o.parsed.tlv?some(getArrayDecoder(Le()).decode(o.parsed.tlv)):none(),state:o.parsed.state}))}async function M1(e,r){if(!e)return false;let{value:t}=await _().getAccountInfo(r,{encoding:"base64"}).send();return !t}async function R1(e,r,t,o,n){let c=n-t-o;if(c<=0)return [];let a=(await Ke().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(r)})).items.filter(d=>!!d.compressedAccount.data?.data.length&&d.compressedAccount.owner.toString()===Mt.toString()&&!d.parsed.amount.isZero());return a.length===0?[]:P1(a,Number(c),4,{treeType:TreeType.StateV2})}function P1(e,r,t=4,o){let n=e.filter(d=>d.compressedAccount.treeInfo.treeType===o?.treeType);if(n.length===0)throw new Error("No accounts found");let c=0,i=0,a=0,s=[];n.sort((d,g)=>g.parsed.amount.cmp(d.parsed.amount));for(let d of n){if(s.length>=t||c>=r)break;(!d.parsed.amount.isZero()||!d.compressedAccount.lamports.isZero())&&(c=c+d.parsed.amount.toNumber(),i=i+d.compressedAccount.lamports.toNumber(),s.push(d));}if(a=n.slice(0,t).reduce((d,g)=>d+g.parsed.amount.toNumber(),0),s.length===0)throw new Error("No accounts found.");if(c<r){let d=n.reduce((g,p)=>g+p.parsed.amount.toNumber(),0);throw s.length>=t?new Error(`Account limit exceeded: max ${a.toString()} (${t} accounts) per transaction. Total balance: ${d.toString()} (${n.length} accounts). Consider multiple transfers to spend full balance.`):new Error(`Insufficient balance for transfer. Required: ${r.toString()}, available: ${d.toString()}.`)}if(s.length===0)throw new Error("No accounts found.");return s}function _1(e){if(!e||e.length===0)return null;try{return {amount:getU64Decoder().decode(e.slice(64,72))}}catch(r){return console.error("Token data parsing error:",r),null}}function h1(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let r=e[7];return r===3?2:3}function U1(e,r){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:r}}async function v1(e,r){return qa(()=>Ke().getValidityProofV0(e,r))}function Z_({signers:e,payer:r,changeConfigArgs:t}){let{settings:o,configActions:n,packedAccounts:c}=t,i=j(e),a=[],s=[];for(let p of i)if(p instanceof I){let m=s.length,{domainConfig:f,verifyArgs:E,signature:M,publicKey:P,message:F}=w(p,m);if(F&&M&&P&&s.push({message:F,signature:M,publicKey:P}),f){let G=c.addPreAccounts([{address:f,role:AccountRole.READONLY}]).get(f)?.index;E.__option==="Some"&&G!==void 0&&a.push({__kind:"Secp256r1",fields:[{domainConfigIndex:G,verifyArgs:E.value}]});}}else {let m=c.addPreAccounts([{address:p.address,role:AccountRole.READONLY_SIGNER,signer:p}]).get(p.address)?.index;m!==void 0&&a.push({__kind:"Ed25519",fields:[m]});}let{remainingAccounts:d}=c.toAccountMetas(),g=[];return s.length>0&&g.push(L(s)),g.push(is({settings:o,configActions:n,payer:r,remainingAccounts:d,signers:a})),g}async function sh({authority:e,payer:r,createUserArgs:t,domainConfig:o}){return bs({payer:r,authority:e,member:Ne().decode(t.member.toBuffer()),credentialId:K(t.credentialId),transports:t.transports,role:t.role,domainConfig:o,settings:t.settings,transactionManagerAccount:t.transactionManagerAccount,userAccount:await v(t.member),remainingAccounts:[]})}async function dh({createUserArgs:e,payer:r}){return vs({payer:r,member:e.member,role:e.role,transactionManagerUrl:e.role===0?e.transactionManagerUrl:null,userAccount:await v(e.member.address),remainingAccounts:[]})}async function mh({index:e,payer:r,initialMember:t}){return Bs({globalCounter:await It(),userAccount:await v(t.address),settingsIndex:e,settings:await se(e),payer:r,initialMember:t,remainingAccounts:[]})}async function xh({authority:e,domainConfig:r,newAuthority:t,newOrigins:o}){return Js({domainConfig:r,authority:e,newOrigins:o?some(o):none(),newAuthority:t,userAccount:t?await v(t.address):void 0,remainingAccounts:[]})}async function bh({signer:e,transactionManagerUrl:r}){return Qs({signer:e,transactionManagerAccount:await v(e.address),transactionManagerUrl:r,remainingAccounts:[]})}async function vh({payer:e,user:r,newDelegate:t}){let o=(await gt(_(),await v(r instanceof I?r:r.address))).data,n,c,i=o.wallets.find(E=>E.isDelegate);i&&(n=await se(i.index)),t!==void 0&&(c=await se(t));let{domainConfig:a,verifyArgs:s,message:d,signature:g,publicKey:p}=w(r),m=[];d&&g&&p&&m.push({message:d,signature:g,publicKey:p});let f=[];return m.length>0&&f.push(L(m)),f.push(ac({secp256r1VerifyArgs:s,domainConfig:a,delegateTo:t!==void 0?some(t):none(),feePayer:e,signer:r instanceof I?void 0:r,oldSettings:n,newSettings:c,userAccount:await v(r instanceof I?r:r.address),remainingAccounts:[]})),f}async function jh({closer:e,transactionBufferAddress:r}){let t=await Vo(_(),r),o=t.data.multiWalletSettings,{domainConfig:n,verifyArgs:c,message:i,signature:a,publicKey:s}=w(e),d=[];return i&&a&&s&&d.push(L([{message:i,signature:a,publicKey:s}])),d.push(Cc({transactionBuffer:r,domainConfig:n,closer:e instanceof I?void 0:e,settings:o,payer:t.data.payer,secp256r1VerifyArgs:c,remainingAccounts:[]})),d}function ei({payer:e,creator:r,bufferIndex:t,settings:o,transactionBufferAddress:n,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,expectedSigners:d}){let{domainConfig:g,verifyArgs:p,message:m,signature:f,publicKey:E}=w(r),M=[];return m&&f&&E&&M.push(L([{message:m,signature:f,publicKey:E}])),M.push(Uc({settings:o,transactionBuffer:n,payer:e,secp256r1VerifyArgs:p,creator:r instanceof I?void 0:r,domainConfig:g,bufferIndex:t,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:d,remainingAccounts:[]})),M}function ti({executor:e,transactionBufferAddress:r,settings:t}){let{domainConfig:o,verifyArgs:n,signature:c,message:i,publicKey:a}=w(e),s=[];return i&&c&&a&&s.push(L([{message:i,signature:c,publicKey:a}])),s.push(Bc({settings:t,transactionBuffer:r,secp256r1VerifyArgs:n,domainConfig:o,executor:e instanceof I?void 0:e,remainingAccounts:[]})),s}function ni({transactionMessageBytes:e,transactionBufferAddress:r,settings:t}){return Hc({transactionBuffer:r,buffer:e,settings:t,remainingAccounts:[]})}function ri({settings:e,voter:r,transactionBufferAddress:t}){let{domainConfig:o,verifyArgs:n,signature:c,publicKey:i,message:a}=w(r),s=[];return a&&c&&i&&s.push(L([{message:a,signature:c,publicKey:i}])),s.push(Jc({settings:e,transactionBuffer:t,secp256r1VerifyArgs:n,domainConfig:o,voter:r instanceof I?void 0:r,remainingAccounts:[]})),s}async function LU({settings:e,configActionsArgs:r}){let t=new Y;return {configActions:await B1({configActionsArgs:r,packedAccounts:t}),settings:e,packedAccounts:t}}async function B1({configActionsArgs:e,packedAccounts:r}){let t=[];for(let o of e)switch(o.type){case "AddMembers":{let n=[];for(let c of o.members)r.addPreAccounts([{address:await v(c.member),role:AccountRole.WRITABLE}]),n.push(F1({permissionArgs:c.permissions,pubkey:c.member}));t.push({__kind:o.type,fields:[n]});break}case "RemoveMembers":{let n=await Promise.all(o.members.map(async c=>(r.addPreAccounts([{address:await v(c.member),role:AccountRole.WRITABLE}]),w1({pubkey:c.member}))));t.push({__kind:o.type,fields:[n]});break}case "EditPermissions":{let n=o.members.map(c=>N1({permissionArgs:c.permissions,pubkey:c.member}));t.push({__kind:o.type,fields:[n]});break}default:t.push({__kind:o.type,fields:[o.threshold]});}return t}function N1({pubkey:e,permissionArgs:r}){return {memberKey:ee(e),permissions:si(r)}}function w1({pubkey:e}){return {memberKey:ee(e)}}function F1({pubkey:e,permissionArgs:r}){return {memberKey:ee(e),permissions:si(r)}}function si(e){let r=[];return e.initiate&&r.push($.InitiateTransaction),e.vote&&r.push($.VoteTransaction),e.execute&&r.push($.ExecuteTransaction),ne.fromPermissions(r)}async function FU({payer:e,settings:r,transactionMessageBytes:t,creator:o,executor:n,secp256r1VerifyInput:c,jitoBundlesTipAmount:i,addressesByLookupTableAddress:a,additionalVoters:s=[],additionalSigners:d=[],chunkSize:g=Math.ceil(t.length/2)}){let p=Math.floor(Math.random()*255),m=await Sa(r,o instanceof I?o:o.address,p),f=[],E=[];for(let h=0;h<t.length;h+=g){let Je=t.subarray(h,h+g);f.push(Je),E.push(sha256(Je));}let M=sha256(t),P=j([o,...n?[n]:[],...s]).map(h=>({memberKey:ee(h),messageHash:h instanceof I?br(h.authResponse):null})),F=ei({finalBufferHash:M,finalBufferSize:t.length,bufferIndex:p,payer:e,transactionBufferAddress:m,settings:r,creator:o,preauthorizeExecution:!n,bufferExtendHashes:E,expectedSigners:P}),G=f.map(h=>ni({transactionMessageBytes:h,transactionBufferAddress:m,settings:r})),l=s.map(h=>ri({voter:h,transactionBufferAddress:m,settings:r})),H=ti({settings:r,executor:n,transactionBufferAddress:m}),{instructions:he,addressLookupTableAccounts:xe}=await Va({settings:r,transactionMessageBytes:t,transactionBufferAddress:m,payer:e,additionalSigners:d,secp256r1VerifyInput:c,jitoBundlesTipAmount:i,addressesByLookupTableAddress:a}),ce=h=>({payer:e,instructions:h,addressesByLookupTableAddress:xe});return [ce(F),...G.map(h=>ce([h])),...l.length?[ce(l.flat())]:[],ce(H),ce(he)]}var Pt=class e{payer;keyMetaMap;constructor(r,t){this.payer=r,this.keyMetaMap=t;}static compile(r,t){let o=new Map,n=i=>{let a=o.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},o.set(i,a)),a},c=n(t);c.isSigner=true,c.isWritable=true;for(let i of r){n(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let s=n(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(t,o)}getMessageComponents(){let r=[...this.keyMetaMap.entries()];if(r.length>256)throw new Error("Max static account keys length exceeded");let t=r.filter(([,d])=>d.isSigner&&d.isWritable),o=r.filter(([,d])=>d.isSigner&&!d.isWritable),n=r.filter(([,d])=>!d.isSigner&&d.isWritable),c=r.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:t.length+o.length,numReadonlySignerAccounts:o.length,numReadonlyNonSignerAccounts:c.length};if(t.length===0)throw new Error("Expected at least one writable signer key");let[a]=t[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let s=[...t.map(([d])=>d),...o.map(([d])=>d),...n.map(([d])=>d),...c.map(([d])=>d)];return [i,s]}extractTableLookup(r){let[t,o]=this.drainKeysFoundInLookupTable(r[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[n,c]=this.drainKeysFoundInLookupTable(r[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(t.length===0&&n.length===0))return {addressTableLookup:{lookupTableAddress:r[0],writableIndexes:t,readonlyIndexes:n},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(r,t){let o=new Array,n=new Array;for(let[c,i]of this.keyMetaMap.entries())if(t(i)){let a=c,s=r.findIndex(d=>d===a);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),n.push(a),this.keyMetaMap.delete(c);}}return [o,n]}};var _t=class{staticAccountKeys;accountKeysFromLookups;constructor(r,t){this.staticAccountKeys=r,this.accountKeysFromLookups=t;}keySegments(){let r=[this.staticAccountKeys];return this.accountKeysFromLookups&&(r.push(this.accountKeysFromLookups.writable),r.push(this.accountKeysFromLookups.readonly)),r}get(r){for(let t of this.keySegments()){if(r<t.length)return t[r];r-=t.length;}}get length(){return this.keySegments().flat().length}compileInstructions(r){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 n=c=>{let i=o.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return r.map(c=>({programAddressIndex:n(c.programAddress),accountIndices:c.accounts?.map(i=>n(i.address))??[],data:c.data}))}};function ai({payer:e,recentBlockhash:r,instructions:t,addressesByLookupTableAddress:o}){let n=Pt.compile(t,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(o??{});for(let m of a){let f=n.extractTableLookup(m);if(f!==void 0){let{addressTableLookup:E,drainedKeys:M}=f;c.push({readonlyIndexes:E.readonlyIndexes,readableIndices:E.readonlyIndexes,writableIndexes:E.writableIndexes,writableIndices:E.writableIndexes,lookupTableAddress:address(E.lookupTableAddress)}),i.writable.push(...M.writable),i.readonly.push(...M.readonly);}}let[s,d]=n.getMessageComponents(),p=new _t(d,i).compileInstructions(t);return {version:0,header:s,instructions:p,lifetimeToken:r,staticAccounts:d,addressTableLookups:c}}function QU({instructions:e,payer:r,addressesByLookupTableAddress:t}){let o=ai({instructions:e,payer:r,recentBlockhash:A,addressesByLookupTableAddress:t});return new Uint8Array(ya(o))}async function ov({payer:e,settings:r,transactionMessageBytes:t,signers:o,additionalSigners:n,secp256r1VerifyInput:c,addressesByLookupTableAddress:i}){let{instructions:a,addressLookupTableAccounts:s}=await Ka({settings:r,signers:o,additionalSigners:n,transactionMessageBytes:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i});return {payer:e,instructions:a,addressesByLookupTableAddress:s}}
|
|
2
|
+
export{ht as AccountState,ga as AuthenticationContextSchema,la as BaseResponseSchema,ss as CHANGE_CONFIG_DISCRIMINATOR,ys as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Is as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Ms as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,hs as CREATE_USER_ACCOUNT_DISCRIMINATOR,Os as CREATE_WALLET_DISCRIMINATOR,MM as CompleteMessageRequestSchema,RM as CompleteTransactionRequestSchema,Fs as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,kr as DOMAIN_CONFIG_DISCRIMINATOR,QT as DeviceProfileSchema,qs as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,Xs as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,oc as EDIT_USER_DELEGATE_DISCRIMINATOR,Fr as GLOBAL_COUNTER_DISCRIMINATOR,ze as KeyType,iT as MULTI_WALLET_ERROR__ALREADY_DELEGATED,wy as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,PT as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,hT as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,UT as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,qT as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,Vy as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,Gy as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,Qy as MULTI_WALLET_ERROR__EMPTY_MEMBERS,Zy as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,Fy as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,Yy as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,TT as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,fT as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,ST as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,LT as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,AT as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,uT as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,dT as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,oT as MULTI_WALLET_ERROR__INVALID_ACCOUNT,KT as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,Xy as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,cT as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,yT as MULTI_WALLET_ERROR__INVALID_BUFFER,kT as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,gT as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,rT as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,Ky as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,Ly as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,Wy as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,vy as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,Oy as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,RT as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,CT as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,tT as MULTI_WALLET_ERROR__INVALID_THRESHOLD,zT as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,Jy as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,jy as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,nT as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,JT as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,sT as MULTI_WALLET_ERROR__INVALID_USER_ROLE,YT as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,HT as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,By as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,DT as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,BT as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,aT as MULTI_WALLET_ERROR__MISSING_ACCOUNT,OT as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,FT as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,ZT as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,VT as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,WT as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,$T as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,XT as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,GT as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,bT as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,pT as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,$y as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,zy as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,qy as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,vT as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,wT as MULTI_WALLET_ERROR__PAYER_MISMATCH,Hy as MULTI_WALLET_ERROR__PERMANENT_MEMBER,ET as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,Ny as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,NT as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,ky as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,MT as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,eT as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,xT as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,IT as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,_T as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,mT as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,jT as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,lT as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,_y as MultiWalletAccount,hy as MultiWalletInstruction,uc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,$ as Permission,ne as Permissions,vo as SETTINGS_DISCRIMINATOR,re as Secp256r1Key,I as SignedSecp256r1Key,da as StartMessageRequestSchema,Aa as StartTransactionRequestSchema,Tc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Ec as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,Pc as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,wo as TRANSACTION_BUFFER_DISCRIMINATOR,kc as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Fc as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,qc as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,$c as TRANSACTION_EXECUTE_DISCRIMINATOR,oa as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,ua as TransactionActionTypeSchema,tf as TransactionDetailsSchema,CM as TransactionPayloadSchema,ef as TransactionPayloadWithBase64MessageBytesSchema,Yn as Transports,Xo as USER_DISCRIMINATOR,bM as UserInfoSchema,Ie as UserRole,K as base64URLStringToBuffer,UR as bufferToBase64URLString,Z_ as changeConfig,jh as closeTransactionBuffer,OS as configAction,kR as convertBase64StringToJWK,LR as convertJWKToBase64String,_a as convertMemberKeyToString,bR as convertPubkeyCompressedToCose,DR as convertPubkeyCoseToCompressed,RR as createClientAuthorizationCompleteRequestChallenge,MR as createClientAuthorizationStartRequestChallenge,DP as createDomainConfig,sh as createDomainUserAccounts,RP as createGlobalCounter,PR as createMessageChallenge,ei as createTransactionBuffer,_R as createTransactionChallenge,HR as createTransactionManagerSigner,dh as createUserAccounts,mh as createWallet,Wr as decodeDomainConfig,Vr as decodeGlobalCounter,Lo as decodeSettings,Go as decodeTransactionBuffer,$o as decodeUser,KR as deserializeConfigActions,UP as disableDomainConfig,xh as editDomainConfig,bh as editTransactionManagerUrl,vh as editUserDelegate,Va as executeTransaction,ti as executeTransactionBuffer,Ka as executeTransactionSync,ni as extendTransactionBuffer,JS as extensionStruct,K1 as fetchAllDomainConfig,$1 as fetchAllGlobalCounter,Ei as fetchAllMaybeDomainConfig,Ni as fetchAllMaybeGlobalCounter,Eg as fetchAllMaybeSettings,Vg as fetchAllMaybeTransactionBuffer,al as fetchAllMaybeUser,eE as fetchAllSettings,dP as fetchAllSettingsAccountByMember,cE as fetchAllTransactionBuffer,gE as fetchAllUser,Br as fetchDomainConfig,X1 as fetchGlobalCounter,Ii as fetchMaybeDomainConfig,Bi as fetchMaybeGlobalCounter,Ig as fetchMaybeSettings,Gg as fetchMaybeTransactionBuffer,cl as fetchMaybeUser,ko as fetchSettings,Vo as fetchTransactionBuffer,gt as fetchUser,uP as fetchUserAccountByFilters,nS as getAccountStateCodec,vt as getAccountStateDecoder,Ut as getAccountStateEncoder,uS as getAddMemberArgsCodec,Wt as getAddMemberArgsDecoder,Ot as getAddMemberArgsEncoder,sS as getAdditionalMetadataCodec,kt as getAdditionalMetadataDecoder,Lt as getAdditionalMetadataEncoder,hE as getChangeConfigDiscriminatorBytes,is as getChangeConfigInstruction,UE as getChangeConfigInstructionDataCodec,as as getChangeConfigInstructionDataDecoder,cs as getChangeConfigInstructionDataEncoder,Dr as getClientAndDeviceHash,gS as getCompiledInstructionCodec,Nt as getCompiledInstructionDecoder,Bt as getCompiledInstructionEncoder,mS as getCompressedOnlyExtensionCodec,Ft as getCompressedOnlyExtensionDecoder,wt as getCompressedOnlyExtensionEncoder,fS as getCompressedProofCodec,qt as getCompressedProofDecoder,Kt as getCompressedProofEncoder,ES as getCompressedTokenArgsCodec,Yt as getCompressedTokenArgsDecoder,jt as getCompressedTokenArgsEncoder,MS as getCompressibleExtensionCodec,tn as getCompressibleExtensionDecoder,en as getCompressibleExtensionEncoder,hS as getCompressionInfoCodec,rn as getCompressionInfoDecoder,nn as getCompressionInfoEncoder,kS as getConfigActionCodec,Oe as getConfigActionDecoder,ke as getConfigActionEncoder,NE as getCreateDomainConfigDiscriminatorBytes,fs as getCreateDomainConfigInstruction,FE as getCreateDomainConfigInstructionAsync,wE as getCreateDomainConfigInstructionDataCodec,Ts as getCreateDomainConfigInstructionDataDecoder,rr as getCreateDomainConfigInstructionDataEncoder,YE as getCreateDomainUserAccountDiscriminatorBytes,bs as getCreateDomainUserAccountInstruction,JE as getCreateDomainUserAccountInstructionDataCodec,Ds as getCreateDomainUserAccountInstructionDataDecoder,Es as getCreateDomainUserAccountInstructionDataEncoder,nD as getCreateGlobalCounterDiscriminatorBytes,oD as getCreateGlobalCounterInstruction,Ps as getCreateGlobalCounterInstructionAsync,rD as getCreateGlobalCounterInstructionDataCodec,Rs as getCreateGlobalCounterInstructionDataDecoder,cr as getCreateGlobalCounterInstructionDataEncoder,gD as getCreateUserAccountDiscriminatorBytes,vs as getCreateUserAccountInstruction,pD as getCreateUserAccountInstructionAsync,lD as getCreateUserAccountInstructionDataCodec,Us as getCreateUserAccountInstructionDataDecoder,ir as getCreateUserAccountInstructionDataEncoder,ID as getCreateWalletDiscriminatorBytes,Bs as getCreateWalletInstruction,DD as getCreateWalletInstructionAsync,ED as getCreateWalletInstructionDataCodec,Ws as getCreateWalletInstructionDataDecoder,dr as getCreateWalletInstructionDataEncoder,hR as getDeviceMessageHash,hD as getDisableDomainConfigDiscriminatorBytes,Hs as getDisableDomainConfigInstruction,UD as getDisableDomainConfigInstructionDataCodec,Vs as getDisableDomainConfigInstructionDataDecoder,Gs as getDisableDomainConfigInstructionDataEncoder,be as getDomainConfigAddress,z1 as getDomainConfigCodec,Or as getDomainConfigDecoder,H1 as getDomainConfigDiscriminatorBytes,xi as getDomainConfigEncoder,q1 as getDomainConfigSize,ND as getEditDomainConfigDiscriminatorBytes,Js as getEditDomainConfigInstruction,wD as getEditDomainConfigInstructionDataCodec,Ys as getEditDomainConfigInstructionDataDecoder,js as getEditDomainConfigInstructionDataEncoder,FS as getEditMemberArgsCodec,gn as getEditMemberArgsDecoder,An as getEditMemberArgsEncoder,qD as getEditTransactionManagerUrlDiscriminatorBytes,Qs as getEditTransactionManagerUrlInstruction,YD as getEditTransactionManagerUrlInstructionAsync,jD as getEditTransactionManagerUrlInstructionDataCodec,$s as getEditTransactionManagerUrlInstructionDataDecoder,gr as getEditTransactionManagerUrlInstructionDataEncoder,nb as getEditUserDelegateDiscriminatorBytes,ac as getEditUserDelegateInstruction,rb as getEditUserDelegateInstructionDataCodec,cc as getEditUserDelegateInstructionDataDecoder,sc as getEditUserDelegateInstructionDataEncoder,zS as getExpectedSignerCodec,Be as getExpectedSignerDecoder,We as getExpectedSignerEncoder,YS as getExtensionStructCodec,Le as getExtensionStructDecoder,Jt as getExtensionStructEncoder,It as getGlobalCounterAddress,Z1 as getGlobalCounterCodec,Gr as getGlobalCounterDecoder,J1 as getGlobalCounterDiscriminatorBytes,Wi as getGlobalCounterEncoder,Q1 as getGlobalCounterSize,$M as getLightCpiSigner,Ke as getLightProtocolRpc,ex as getMemberCodec,Pn as getMemberDecoder,Rn as getMemberEncoder,rx as getMemberKeyCodec,k as getMemberKeyDecoder,U as getMemberKeyEncoder,iM as getMultiWalletErrorMessage,Ab as getNativeTransferIntentDiscriminatorBytes,Ac as getNativeTransferIntentInstruction,lb as getNativeTransferIntentInstructionAsync,gb as getNativeTransferIntentInstructionDataCodec,dc as getNativeTransferIntentInstructionDataDecoder,lr as getNativeTransferIntentInstructionDataEncoder,vR as getOriginIndex,cx as getPackedMerkleContextCodec,Xt as getPackedMerkleContextDecoder,Zt as getPackedMerkleContextEncoder,ux as getPausableAccountExtensionCodec,yn as getPausableAccountExtensionDecoder,mn as getPausableAccountExtensionEncoder,gx as getPermanentDelegateAccountExtensionCodec,fn as getPermanentDelegateAccountExtensionDecoder,Tn as getPermanentDelegateAccountExtensionEncoder,mx as getPermissionsCodec,ie as getPermissionsDecoder,ae as getPermissionsEncoder,Sx as getProofArgsCodec,hn as getProofArgsDecoder,_n as getProofArgsEncoder,Dx as getRemoveMemberArgsCodec,pn as getRemoveMemberArgsDecoder,ln as getRemoveMemberArgsEncoder,Mx as getRentConfigCodec,an as getRentConfigDecoder,cn as getRentConfigEncoder,br as getSecp256r1MessageHash,_x as getSecp256r1PubkeyCodec,Ne as getSecp256r1PubkeyDecoder,Ln as getSecp256r1PubkeyEncoder,e1 as getSecp256r1SignatureOffsetsDataDecoder,Qf as getSecp256r1SignatureOffsetsDataEncoder,vx as getSecp256r1VerifyArgsCodec,N as getSecp256r1VerifyArgsDecoder,B as getSecp256r1VerifyArgsEncoder,Wx as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,On as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,kn as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,L as getSecp256r1VerifyInstruction,VP as getSecp256r1VerifyInstructionDataCodec,Fa as getSecp256r1VerifyInstructionDataDecoder,Ga as getSecp256r1VerifyInstructionDataEncoder,sR as getSendAndConfirmTransaction,QI as getSettingsCodec,ct as getSettingsDecoder,$I as getSettingsDiscriminatorBytes,xg as getSettingsEncoder,se as getSettingsFromIndex,wx as getSettingsIndexWithDelegateInfoCodec,Bn as getSettingsIndexWithDelegateInfoDecoder,Wn as getSettingsIndexWithDelegateInfoEncoder,CR as getSignedSecp256r1Key,_ as getSolanaRpc,oR as getSolanaRpcEndpoint,Vx as getSplInterfacePdaArgsCodec,wn as getSplInterfacePdaArgsDecoder,Nn as getSplInterfacePdaArgsEncoder,qx as getTokenMetadataCodec,xn as getTokenMetadataDecoder,Sn as getTokenMetadataEncoder,Ib as getTokenTransferIntentDiscriminatorBytes,Sc as getTokenTransferIntentInstruction,Db as getTokenTransferIntentInstructionAsync,Eb as getTokenTransferIntentInstructionDataCodec,fc as getTokenTransferIntentInstructionDataDecoder,pr as getTokenTransferIntentInstructionDataEncoder,Sa as getTransactionBufferAddress,Ub as getTransactionBufferCloseDiscriminatorBytes,Cc as getTransactionBufferCloseInstruction,vb as getTransactionBufferCloseInstructionDataCodec,bc as getTransactionBufferCloseInstructionDataDecoder,Dc as getTransactionBufferCloseInstructionDataEncoder,sE as getTransactionBufferCodec,Fb as getTransactionBufferCreateDiscriminatorBytes,Uc as getTransactionBufferCreateInstruction,Gb as getTransactionBufferCreateInstructionDataCodec,hc as getTransactionBufferCreateInstructionDataDecoder,_c as getTransactionBufferCreateInstructionDataEncoder,Fo as getTransactionBufferDecoder,oE as getTransactionBufferDiscriminatorBytes,Fg as getTransactionBufferEncoder,Jb as getTransactionBufferExecuteDiscriminatorBytes,Bc as getTransactionBufferExecuteInstruction,Zb as getTransactionBufferExecuteInstructionDataCodec,Wc as getTransactionBufferExecuteInstructionDataDecoder,Oc as getTransactionBufferExecuteInstructionDataEncoder,rC as getTransactionBufferExtendDiscriminatorBytes,Hc as getTransactionBufferExtendInstruction,oC as getTransactionBufferExtendInstructionDataCodec,Vc as getTransactionBufferExtendInstructionDataDecoder,Gc as getTransactionBufferExtendInstructionDataEncoder,gC as getTransactionBufferVoteDiscriminatorBytes,Jc as getTransactionBufferVoteInstruction,lC as getTransactionBufferVoteInstructionDataCodec,Yc as getTransactionBufferVoteInstructionDataDecoder,jc as getTransactionBufferVoteInstructionDataEncoder,xC as getTransactionExecuteDiscriminatorBytes,ta as getTransactionExecuteInstruction,IC as getTransactionExecuteInstructionDataCodec,ea as getTransactionExecuteInstructionDataDecoder,Qc as getTransactionExecuteInstructionDataEncoder,_C as getTransactionExecuteSyncDiscriminatorBytes,aa as getTransactionExecuteSyncInstruction,hC as getTransactionExecuteSyncInstructionDataCodec,ca as getTransactionExecuteSyncInstructionDataDecoder,sa as getTransactionExecuteSyncInstructionDataEncoder,Jx as getTransactionMessageAddressTableLookupCodec,jn as getTransactionMessageAddressTableLookupDecoder,qn as getTransactionMessageAddressTableLookupEncoder,Qx as getTransactionSyncSignersCodec,Z as getTransactionSyncSignersDecoder,J as getTransactionSyncSignersEncoder,oI as getTransferFeeAccountExtensionCodec,En as getTransferFeeAccountExtensionDecoder,In as getTransferFeeAccountExtensionEncoder,aI as getTransferHookAccountExtensionCodec,bn as getTransferHookAccountExtensionDecoder,Dn as getTransferHookAccountExtensionEncoder,dI as getTransportsCodec,Fe as getTransportsDecoder,we as getTransportsEncoder,v as getUserAddress,AE as getUserCodec,At as getUserDecoder,dE as getUserDiscriminatorBytes,sl as getUserEncoder,lI as getUserRoleCodec,pe as getUserRoleDecoder,le as getUserRoleEncoder,h1 as getVersionFromDiscriminator,XM as getWalletAddressFromIndex,Q as getWalletAddressFromSettings,tM as identifyMultiWalletAccount,nM as identifyMultiWalletInstruction,cR as initialize,WS as isConfigAction,ZS as isExtensionStruct,uM as isMultiWalletError,tI as isTransactionSyncSigners,D_ as nativeTransferIntent,vE as parseChangeConfigInstruction,GE as parseCreateDomainConfigInstruction,ZE as parseCreateDomainUserAccountInstruction,sD as parseCreateGlobalCounterInstruction,mD as parseCreateUserAccountInstruction,bD as parseCreateWalletInstruction,vD as parseDisableDomainConfigInstruction,FD as parseEditDomainConfigInstruction,JD as parseEditTransactionManagerUrlInstruction,ob as parseEditUserDelegateInstruction,pb as parseNativeTransferIntentInstruction,HP as parseSecp256r1VerifyInstruction,bb as parseTokenTransferIntentInstruction,Lb as parseTransactionBufferCloseInstruction,Vb as parseTransactionBufferCreateInstruction,Xb as parseTransactionBufferExecuteInstruction,sC as parseTransactionBufferExtendInstruction,pC as parseTransactionBufferVoteInstruction,EC as parseTransactionExecuteInstruction,UC as parseTransactionExecuteSyncInstruction,LU as prepareChangeConfigArgs,FU as prepareTransactionBundle,QU as prepareTransactionMessage,ov as prepareTransactionSync,VR as retrieveTransactionManager,zR as serializeConfigActions,F_ as tokenTransferIntent,eI as transactionSyncSigners,Ta as vaultTransactionMessageDeserialize,ya as vaultTransactionMessageSerialize,ri as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|