@revibase/core 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -14
- package/dist/index.d.ts +5 -14
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
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,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,getBlockhashDecoder,compileTransaction,getTransactionEncoder,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,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 {getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTokenDecoder,getTransferSolInstruction}from'gill/programs';import {p256}from'@noble/curves/nist.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {canonicalize}from'json-canonicalize';import {selectMinCompressedTokenAccountsForDecompression}from'@lightprotocol/compressed-token';import fh from'bn.js';import {equalBytes}from'@noble/curves/utils.js';var ss=new Uint8Array([201,232,212,229,59,241,106,197]);function Jh(){return fixEncoderSize(getBytesEncoder(),8).encode(ss)}function ZA(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["rpIdHash",fixEncoderSize(getBytesEncoder(),32)],["bump",getU8Encoder()],["isDisabled",getU8Encoder()],["rpIdLength",getU8Encoder()],["numOrigins",getU8Encoder()],["rpId",fixEncoderSize(getBytesEncoder(),255)],["origins",fixEncoderSize(getBytesEncoder(),515)]]),e=>({...e,discriminator:ss}))}function cs(){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 Yh(){return combineCodec(ZA(),cs())}function as(e){return decodeAccount(e,cs())}async function is(e,n,r){let o=await XA(e,n,r);return assertAccountExists(o),o}async function XA(e,n,r){let o=await fetchEncodedAccount(e,n,r);return as(o)}async function Zh(e,n,r){let o=await QA(e,n,r);return assertAccountsExist(o),o}async function QA(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>as(t))}function Xh(){return 846}var As=new Uint8Array([42,206,176,58,175,129,130,233]);function eM(){return fixEncoderSize(getBytesEncoder(),8).encode(As)}function gg(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:As}))}function gs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function tM(){return combineCodec(gg(),gs())}function ps(e){return decodeAccount(e,gs())}async function rM(e,n,r){let o=await pg(e,n,r);return assertAccountExists(o),o}async function pg(e,n,r){let o=await fetchEncodedAccount(e,n,r);return ps(o)}async function nM(e,n,r){let o=await mg(e,n,r);return assertAccountsExist(o),o}async function mg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ps(t))}function oM(){return 24}var jr=(r=>(r[r.Initialized=0]="Initialized",r[r.Frozen=1]="Frozen",r))(jr||{});function qr(){return getEnumEncoder(jr)}function Jr(){return getEnumDecoder(jr)}function aM(){return combineCodec(qr(),Jr())}function Yr(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Zr(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function uM(){return combineCodec(Yr(),Zr())}function Xr(){return getStructEncoder([["memberKey",V()],["permissions",Be()],["userArgs",we()]])}function Qr(){return getStructDecoder([["memberKey",$()],["permissions",Ne()],["userArgs",He()]])}function mM(){return combineCodec(Xr(),Qr())}function $r(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function en(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function yM(){return combineCodec($r(),en())}function mt(){return getStructEncoder([["treeInfo",Tt()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function lt(){return getStructDecoder([["treeInfo",yt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function IM(){return combineCodec(mt(),lt())}function ft(){return getStructEncoder([["treeInfo",Tt()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function St(){return getStructDecoder([["treeInfo",yt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function PM(){return combineCodec(ft(),St())}function tn(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function rn(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function RM(){return combineCodec(tn(),rn())}function an(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function dn(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function vM(){return combineCodec(an(),dn())}function xt(){return getStructEncoder([["data",getOptionEncoder(un())]])}function j(){return getStructDecoder([["data",getOptionDecoder(An())]])}function LM(){return combineCodec(xt(),j())}function un(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(It())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function An(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(Ct())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function wM(){return combineCodec(un(),An())}function Et(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",pn()],["tlv",getOptionEncoder(getArrayEncoder(gn()))],["state",qr()]])}function Dt(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",mn()],["tlv",getOptionDecoder(getArrayDecoder(Pt()))],["state",Jr()]])}function GM(){return combineCodec(Et(),Dt())}function yn(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",Sn()]])}function fn(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",xn()]])}function qM(){return combineCodec(yn(),fn())}function Sn(){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",En()]])}function xn(){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",Dn()]])}function XM(){return combineCodec(Sn(),xn())}function Ve(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Mn())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Xr())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(bn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Fe(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Rn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Qr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(_n())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function tR(){return combineCodec(Ve(),Fe())}function rR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function nR(e,n){return n.__kind===e}function vn(){return getStructEncoder([["member",getAddressEncoder()],["role",Ge()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Pe()]])}function Un(){return getStructDecoder([["member",getAddressDecoder()],["role",ze()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",he()]])}function aR(){return combineCodec(vn(),Un())}function Mn(){return getStructEncoder([["memberKey",V()],["permissions",Be()]])}function Rn(){return getStructDecoder([["memberKey",$()],["permissions",Ne()]])}function AR(){return combineCodec(Mn(),Rn())}function ht(){return getStructEncoder([["memberKey",V()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function Mt(){return getStructDecoder([["memberKey",$()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function lR(){return combineCodec(ht(),Mt())}function gn(){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([Bn()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([kn()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([Ln()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([wn()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([Vn()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([tn()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([yn()])]])]])}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([Nn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([Wn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([On()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([Hn()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([Fn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([rn()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([fn()])]])]])}function SR(){return combineCodec(gn(),Pt())}function xR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function IR(e,n){return n.__kind===e}function Gn(){return getStructEncoder([["settingsMutArgs",z()],["transactionManager",getOptionEncoder(Rt())]])}function zn(){return getStructDecoder([["settingsMutArgs",K()],["transactionManager",getOptionDecoder(bt())]])}function PR(){return combineCodec(Gn(),zn())}function It(){return getStructEncoder([["pubkey",V()],["role",getU8Encoder()],["permissions",Be()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function Ct(){return getStructDecoder([["pubkey",$()],["role",getU8Decoder()],["permissions",Ne()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function bR(){return combineCodec(It(),Ct())}function V(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function $(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function UR(){return combineCodec(V(),$())}function qn(){return getStructEncoder([["authorityCreationArgs",Pe()],["compressedProofArgs",C()]])}function Jn(){return getStructDecoder([["authorityCreationArgs",he()],["compressedProofArgs",E()]])}function OR(){return combineCodec(qn(),Jn())}function _t(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function vt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function wR(){return combineCodec(_t(),vt())}function pn(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function mn(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function FR(){return combineCodec(pn(),mn())}function Tt(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function yt(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function KR(){return combineCodec(Tt(),yt())}function kn(){return getStructEncoder([])}function Wn(){return getStructDecoder([])}function JR(){return combineCodec(kn(),Wn())}function Ln(){return getStructEncoder([])}function On(){return getStructDecoder([])}function XR(){return combineCodec(Ln(),On())}function Be(){return getStructEncoder([["mask",getU8Encoder()]])}function Ne(){return getStructDecoder([["mask",getU8Decoder()]])}function eb(){return combineCodec(Be(),Ne())}function C(){return getStructEncoder([["proof",getOptionEncoder(an())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function E(){return getStructDecoder([["proof",getOptionDecoder(dn())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function ob(){return combineCodec(C(),E())}function bn(){return getStructEncoder([["memberKey",V()],["userArgs",we()]])}function _n(){return getStructDecoder([["memberKey",$()],["userArgs",He()]])}function ib(){return combineCodec(bn(),_n())}function En(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function Dn(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function Ab(){return combineCodec(En(),Dn())}function Xn(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Ut(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function mb(){return combineCodec(Xn(),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 yb(){return combineCodec(F(),G())}function Qn(){return getStructEncoder([["verifyArgs",F()],["domainConfigIndex",getU8Encoder()]])}function $n(){return getStructDecoder([["verifyArgs",G()],["domainConfigIndex",getU8Decoder()]])}function Ib(){return combineCodec(Qn(),$n())}function eo(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function to(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function Db(){return combineCodec(eo(),to())}function ro(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function no(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function Mb(){return combineCodec(ro(),no())}function z(){return getStructEncoder([["accountMeta",mt()],["data",xt()]])}function K(){return getStructDecoder([["accountMeta",lt()],["data",j()]])}function vb(){return combineCodec(z(),K())}function kt(){return getStructEncoder([["accountMeta",ft()],["data",xt()]])}function Wt(){return getStructDecoder([["accountMeta",St()],["data",j()]])}function Lb(){return combineCodec(kt(),Wt())}function Lt(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function Ot(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function Nb(){return combineCodec(Lt(),Ot())}function Bn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(Yr())]])}function Nn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(Zr())]])}function Fb(){return combineCodec(Bn(),Nn())}function Bt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(ht())]])}function Nt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(Mt())]])}function jb(){return combineCodec(Bt(),Nt())}function wt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder($r())],["addressTableLookups",getArrayEncoder(Ao())]])}function Ht(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(en())],["addressTableLookups",getArrayDecoder(go())]])}function Zb(){return combineCodec(wt(),Ht())}function Ao(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function go(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function $b(){return combineCodec(Ao(),go())}function q(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([Qn()])]])]])}function J(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([$n()])]])]])}function n_(){return combineCodec(q(),J())}function o_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function s_(e,n){return n.__kind===e}function wn(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function Hn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function i_(){return combineCodec(wn(),Hn())}function Vn(){return getStructEncoder([["transferring",getU8Encoder()]])}function Fn(){return getStructDecoder([["transferring",getU8Decoder()]])}function A_(){return combineCodec(Vn(),Fn())}var po=(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))(po||{});function Vt(){return getEnumEncoder(po)}function Ft(){return getEnumDecoder(po)}function m_(){return combineCodec(Vt(),Ft())}function Gt(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",V()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(Vt()))],["wallets",getArrayEncoder(ro())],["role",Ge()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function X(){return getStructDecoder([["domainConfig",getOptionDecoder(getAddressDecoder())],["member",$()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(Ft()))],["wallets",getArrayDecoder(no())],["role",ze()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function f_(){return combineCodec(Gt(),X())}function Pe(){return getStructEncoder([["addressTreeInfo",_t()],["outputStateTreeIndex",getU8Encoder()]])}function he(){return getStructDecoder([["addressTreeInfo",vt()],["outputStateTreeIndex",getU8Decoder()]])}function C_(){return combineCodec(Pe(),he())}function Ye(){return getStructEncoder([["accountMeta",mt()],["data",Gt()]])}function Ze(){return getStructDecoder([["accountMeta",lt()],["data",X()]])}function h_(){return combineCodec(Ye(),Ze())}function Rt(){return getStructEncoder([["accountMeta",ft()],["data",Gt()]])}function bt(){return getStructDecoder([["accountMeta",St()],["data",X()]])}function __(){return combineCodec(Rt(),bt())}function we(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Rt()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([Ye()])]])]])}function He(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([bt()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([Ze()])]])]])}function W_(){return combineCodec(we(),He())}function L_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function O_(e,n){return n.__kind===e}var _e=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(_e||{});function Ge(){return getEnumEncoder(_e)}function ze(){return getEnumDecoder(_e)}function w_(){return combineCodec(Ge(),ze())}var Dc=new Uint8Array([223,179,163,190,177,224,67,173]);function Gv(){return fixEncoderSize(getBytesEncoder(),8).encode(Dc)}function s1(){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:Dc}))}function Sr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(Ct())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function zv(){return combineCodec(s1(),Sr())}function Pc(e){return decodeAccount(e,Sr())}async function Kv(e,n,r){let o=await mo(e,n,r);return assertAccountExists(o),o}async function mo(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Pc(o)}async function jv(e,n,r){let o=await c1(e,n,r);return assertAccountsExist(o),o}async function c1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Pc(t))}var _c=new Uint8Array([90,36,35,219,93,225,110,96]);function Zv(){return fixEncoderSize(getBytesEncoder(),8).encode(_c)}function D1(){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(ht())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:_c}))}function vc(){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",$()],["executor",$()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder($())],["expectedSigners",getArrayDecoder(Mt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Xv(){return combineCodec(D1(),vc())}function Uc(e){return decodeAccount(e,vc())}async function kc(e,n,r){let o=await P1(e,n,r);return assertAccountExists(o),o}async function P1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Uc(o)}async function Qv(e,n,r){let o=await h1(e,n,r);return assertAccountsExist(o),o}async function h1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Uc(t))}var Oc=new Uint8Array([105,23,173,2,197,255,80,87]);function tU(){return fixEncoderSize(getBytesEncoder(),8).encode(Oc)}function z1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Oc}))}function Bc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function rU(){return combineCodec(z1(),Bc())}function Nc(e){return decodeAccount(e,Bc())}async function wc(e,n,r){let o=await K1(e,n,r);return assertAccountExists(o),o}async function K1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Nc(o)}async function nU(e,n,r){let o=await j1(e,n,r);return assertAccountsExist(o),o}async function j1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Nc(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 B(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function T(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let o=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:B(r.value),role:Hc(r.value)?upgradeRoleToSigner(o):o,...Hc(r.value)?{signer:r.value}:{}})}}function Hc(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Fc=new Uint8Array([8]);function xU(){return fixEncoderSize(getBytesEncoder(),1).encode(Fc)}function Co(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Fc}))}function Gc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function IU(){return combineCodec(Co(),Gc())}async function zc(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=T(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Co().encode(c),programAddress:r})}function CU(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=T(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Co().encode(c),programAddress:r})}function EU(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:Gc().decode(e.data)}}var Yc=new Uint8Array([9]);function _U(){return fixEncoderSize(getBytesEncoder(),1).encode(Yc)}function Zc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(Ve())],["signers",getArrayEncoder(q())],["compressedProofArgs",getOptionEncoder(C())]]),e=>({...e,discriminator:Yc}))}function Xc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Fe())],["signers",getArrayDecoder(J())],["compressedProofArgs",getOptionDecoder(E())]])}function vU(){return combineCodec(Zc(),Xc())}function Qc(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=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Zc().encode(c),programAddress:r})}function UU(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:Xc().decode(e.data)}}var na=new Uint8Array([19]);function wU(){return fixEncoderSize(getBytesEncoder(),1).encode(na)}function oa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(Ve())],["signers",getArrayEncoder(q())],["settingsMutArgs",z()],["compressedProofArgs",C()]]),e=>({...e,discriminator:na}))}function sa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Fe())],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",E()]])}function HU(){return combineCodec(oa(),sa())}function ca(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:oa().encode(c),programAddress:r})}function VU(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:sa().decode(e.data)}}var da=new Uint8Array([18]);function JU(){return fixEncoderSize(getBytesEncoder(),1).encode(da)}function Eo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["addressTreeInfo",_t()],["outputStateTreeIndex",getU8Encoder()],["userArgs",we()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:da}))}function ua(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["addressTreeInfo",vt()],["outputStateTreeIndex",getU8Decoder()],["userArgs",He()],["settingsIndex",getU128Decoder()]])}function YU(){return combineCodec(Eo(),ua())}async function Aa(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:Eo().encode(c),programAddress:r})}function ZU(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:Eo().encode(c),programAddress:r})}function XU(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:ua().decode(e.data)}}var Sa=new Uint8Array([0]);function ok(){return fixEncoderSize(getBytesEncoder(),1).encode(Sa)}function Po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",Pe()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Sa}))}function xa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",he()],["compressedProofArgs",E()]])}function sk(){return combineCodec(Po(),xa())}async function Ia(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=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Po().encode(c),programAddress:r})}function ck(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=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Po().encode(c),programAddress:r})}function ak(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:xa().decode(e.data)}}var Da=new Uint8Array([4]);function mk(){return fixEncoderSize(getBytesEncoder(),1).encode(Da)}function ho(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["member",Xn()],["role",Ge()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(Vt())],["userAccountCreationArgs",Pe()],["linkWalletArgs",getOptionEncoder(Gn())]]),e=>({...e,discriminator:Da}))}function Pa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["member",Ut()],["role",ze()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Ft())],["userAccountCreationArgs",he()],["linkWalletArgs",getOptionDecoder(zn())]])}function lk(){return combineCodec(ho(),Pa())}async function ha(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:ho().encode(c),programAddress:r})}function Tk(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:ho().encode(c),programAddress:r})}function yk(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:Pa().decode(e.data)}}var Ra=new Uint8Array([3]);function Ek(){return fixEncoderSize(getBytesEncoder(),1).encode(Ra)}function Ro(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Ra}))}function ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function Dk(){return combineCodec(Ro(),ba())}async function _a(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=T(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:Ro().encode({}),programAddress:r})}function Pk(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=T(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:Ro().encode({}),programAddress:r})}function hk(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:ba().decode(e.data)}}var Ua=new Uint8Array([5]);function kk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ua)}function _o(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["createUserArgs",getArrayEncoder(vn())]]),e=>({...e,discriminator:Ua}))}function ka(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["createUserArgs",getArrayDecoder(Un())]])}function Wk(){return combineCodec(_o(),ka())}async function Wa(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:_o().encode(c),programAddress:r})}function Lk(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:_o().encode(c),programAddress:r})}function Ok(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:ka().decode(e.data)}}var Ba=new Uint8Array([17]);function Gk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ba)}function Na(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",z()],["compressedProofArgs",C()],["signers",getArrayEncoder(q())]]),e=>({...e,discriminator:Ba}))}function wa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",K()],["compressedProofArgs",E()],["signers",getArrayDecoder(J())]])}function zk(){return combineCodec(Na(),wa())}function Ha(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=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Na().encode(c),programAddress:r})}function Kk(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:wa().decode(e.data)}}var Ga=new Uint8Array([2]);function Xk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ga)}function za(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:Ga}))}function Ka(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function Qk(){return combineCodec(za(),Ka())}function ja(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=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.admin),...a],data:za().encode(c),programAddress:r})}function $k(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:Ka().decode(e.data)}}var Za=new Uint8Array([1]);function cW(){return fixEncoderSize(getBytesEncoder(),1).encode(Za)}function Uo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(qn())]]),e=>({...e,discriminator:Za}))}function Xa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Jn())]])}function aW(){return combineCodec(Uo(),Xa())}async function iW(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=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Uo().encode(c),programAddress:r})}function Qa(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=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Uo().encode(c),programAddress:r})}function dW(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:Xa().decode(e.data)}}var ti=new Uint8Array([6]);function TW(){return fixEncoderSize(getBytesEncoder(),1).encode(ti)}function ri(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Ye()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",C()]]),e=>({...e,discriminator:ti}))}function ni(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ze()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",E()]])}function yW(){return combineCodec(ri(),ni())}function oi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.authority),...a],data:ri().encode(c),programAddress:r})}function fW(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:ni().decode(e.data)}}var ai=new Uint8Array([7]);function PW(){return fixEncoderSize(getBytesEncoder(),1).encode(ai)}function ii(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Ye()],["secp256r1VerifyArgs",getOptionEncoder(F())],["delegateTo",getOptionEncoder(eo())],["oldSettingsMutArgs",getOptionEncoder(z())],["newSettingsMutArgs",getOptionEncoder(z())],["compressedProofArgs",C()]]),e=>({...e,discriminator:ai}))}function di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ze()],["secp256r1VerifyArgs",getOptionDecoder(G())],["delegateTo",getOptionDecoder(to())],["oldSettingsMutArgs",getOptionDecoder(K())],["newSettingsMutArgs",getOptionDecoder(K())],["compressedProofArgs",E()]])}function hW(){return combineCodec(ii(),di())}function ui(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=T(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:ii().encode(c),programAddress:r})}function MW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:o(),oldSettings:o(),newSettings:o(),slotHashSysvar:o(),instructionsSysvar:o(),domainConfig:o()},data:di().decode(e.data)}}var gi=new Uint8Array([29]);function WW(){return fixEncoderSize(getBytesEncoder(),1).encode(gi)}function ko(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(q())]]),e=>({...e,discriminator:gi}))}function pi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())]])}function LW(){return combineCodec(ko(),pi())}async function OW(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(B(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=T(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:ko().encode(c),programAddress:r})}function mi(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=T(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:ko().encode(c),programAddress:r})}function BW(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:pi().decode(e.data)}}var yi=new Uint8Array([27]);function zW(){return fixEncoderSize(getBytesEncoder(),1).encode(yi)}function fi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(q())],["settingsMutArgs",z()],["compressedProofArgs",C()]]),e=>({...e,discriminator:yi}))}function Si(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",E()]])}function KW(){return combineCodec(fi(),Si())}function xi(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=T(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:fi().encode(c),programAddress:r})}function jW(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:Si().decode(e.data)}}var hi=new Uint8Array([30]);function $W(){return fixEncoderSize(getBytesEncoder(),1).encode(hi)}function Wo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Lt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(Et())],["compressedProofArgs",getOptionEncoder(C())],["signers",getArrayEncoder(q())]]),e=>({...e,discriminator:hi}))}function Mi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Ot())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Dt())],["compressedProofArgs",getOptionDecoder(E())],["signers",getArrayDecoder(J())]])}function eL(){return combineCodec(Wo(),Mi())}async function tL(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(B(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(B(t.source.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(B(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(B(t.destination.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(B(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Wo().encode(c),programAddress:r})}function Ri(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=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Wo().encode(c),programAddress:r})}function rL(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:Mi().decode(e.data)}}var Ui=new Uint8Array([28]);function dL(){return fixEncoderSize(getBytesEncoder(),1).encode(Ui)}function Lo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Lt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(Et())],["signers",getArrayEncoder(q())],["settingsMutArgs",z()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ui}))}function ki(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Ot())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Dt())],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",E()]])}function uL(){return combineCodec(Lo(),ki())}async function AL(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(B(t.source.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(B(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(B(t.destination.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(B(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=T(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:Lo().encode(c),programAddress:r})}function Wi(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=T(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:Lo().encode(c),programAddress:r})}function gL(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:ki().decode(e.data)}}var Bi=new Uint8Array([13]);function SL(){return fixEncoderSize(getBytesEncoder(),1).encode(Bi)}function Ni(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Bi}))}function wi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function xL(){return combineCodec(Ni(),wi())}function Hi(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=T(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:Ni().encode(c),programAddress:r})}function IL(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:wi().decode(e.data)}}var Gi=new Uint8Array([23]);function RL(){return fixEncoderSize(getBytesEncoder(),1).encode(Gi)}function zi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",z()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Gi}))}function Ki(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",K()],["compressedProofArgs",E()]])}function bL(){return combineCodec(zi(),Ki())}function ji(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=T(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:zi().encode(c),programAddress:r})}function _L(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:Ki().decode(e.data)}}var Yi=new Uint8Array([10]);function BL(){return fixEncoderSize(getBytesEncoder(),1).encode(Yi)}function Zi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Bt()],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Yi}))}function Xi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Nt()],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function NL(){return combineCodec(Zi(),Xi())}function Qi(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=T(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:Zi().encode(c),programAddress:r})}function wL(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:Xi().decode(e.data)}}var td=new Uint8Array([20]);function jL(){return fixEncoderSize(getBytesEncoder(),1).encode(td)}function rd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Bt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",kt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:td}))}function nd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Nt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Wt()],["compressedProofArgs",E()]])}function qL(){return combineCodec(rd(),nd())}function od(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=T(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:rd().encode(c),programAddress:r})}function JL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:nd().decode(e.data)}}var ad=new Uint8Array([14]);function tO(){return fixEncoderSize(getBytesEncoder(),1).encode(ad)}function id(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:ad}))}function dd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function rO(){return combineCodec(id(),dd())}function ud(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=T(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:id().encode(c),programAddress:r})}function nO(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:dd().decode(e.data)}}var pd=new Uint8Array([24]);function uO(){return fixEncoderSize(getBytesEncoder(),1).encode(pd)}function md(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",z()],["compressedProofArgs",C()]]),e=>({...e,discriminator:pd}))}function ld(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",K()],["compressedProofArgs",E()]])}function AO(){return combineCodec(md(),ld())}function Td(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=T(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:md().encode(c),programAddress:r})}function gO(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:ld().decode(e.data)}}var Sd=new Uint8Array([12]);function fO(){return fixEncoderSize(getBytesEncoder(),1).encode(Sd)}function xd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Sd}))}function Id(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function SO(){return combineCodec(xd(),Id())}function Cd(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=T(r);return Object.freeze({accounts:[s(t.settings),s(t.transactionBuffer),...a],data:xd().encode(c),programAddress:r})}function xO(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:Id().decode(e.data)}}var Pd=new Uint8Array([22]);function hO(){return fixEncoderSize(getBytesEncoder(),1).encode(Pd)}function hd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Pd}))}function Md(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function MO(){return combineCodec(hd(),Md())}function Rd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.transactionBuffer),...a],data:hd().encode(c),programAddress:r})}function RO(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:Md().decode(e.data)}}var vd=new Uint8Array([11]);function LO(){return fixEncoderSize(getBytesEncoder(),1).encode(vd)}function Ud(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:vd}))}function kd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function OO(){return combineCodec(Ud(),kd())}function Wd(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=T(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:Ud().encode(c),programAddress:r})}function BO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:kd().decode(e.data)}}var Bd=new Uint8Array([21]);function zO(){return fixEncoderSize(getBytesEncoder(),1).encode(Bd)}function Nd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",kt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Bd}))}function wd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Wt()],["compressedProofArgs",E()]])}function KO(){return combineCodec(Nd(),wd())}function Hd(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=T(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:Nd().encode(c),programAddress:r})}function jO(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:wd().decode(e.data)}}var Gd=new Uint8Array([15]);function QO(){return fixEncoderSize(getBytesEncoder(),1).encode(Gd)}function zd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Gd}))}function Kd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function $O(){return combineCodec(zd(),Kd())}function jd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=l({}),a=T(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:zd().encode({}),programAddress:r})}function eB(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:Kd().decode(e.data)}}var Yd=new Uint8Array([25]);function cB(){return fixEncoderSize(getBytesEncoder(),1).encode(Yd)}function Zd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Yd}))}function Xd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function aB(){return combineCodec(Zd(),Xd())}function Qd(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.transactionBuffer),...a],data:Zd().encode(c),programAddress:r})}function iB(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:Xd().decode(e.data)}}var tu=new Uint8Array([16]);function lB(){return fixEncoderSize(getBytesEncoder(),1).encode(tu)}function ru(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",wt()],["signers",getArrayEncoder(q())]]),e=>({...e,discriminator:tu}))}function nu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Ht()],["signers",getArrayDecoder(J())]])}function TB(){return combineCodec(ru(),nu())}function ou(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=T(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:ru().encode(c),programAddress:r})}function yB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:nu().decode(e.data)}}var au=new Uint8Array([26]);function DB(){return fixEncoderSize(getBytesEncoder(),1).encode(au)}function iu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",wt()],["signers",getArrayEncoder(q())],["settingsMutArgs",z()],["compressedProofArgs",C()]]),e=>({...e,discriminator:au}))}function du(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Ht()],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",E()]])}function PB(){return combineCodec(iu(),du())}function uu(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:iu().encode(c),programAddress:r})}function hB(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:du().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",tE=(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))(tE||{});function iN(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 rE=(y=>(y[y.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",y[y.ChangeConfig=1]="ChangeConfig",y[y.ChangeConfigCompressed=2]="ChangeConfigCompressed",y[y.CreateCompressedWallet=3]="CreateCompressedWallet",y[y.CreateDomainConfig=4]="CreateDomainConfig",y[y.CreateDomainUserAccount=5]="CreateDomainUserAccount",y[y.CreateGlobalCounter=6]="CreateGlobalCounter",y[y.CreateUserAccounts=7]="CreateUserAccounts",y[y.DecompressSettingsAccount=8]="DecompressSettingsAccount",y[y.DisableDomainConfig=9]="DisableDomainConfig",y[y.EditDomainConfig=10]="EditDomainConfig",y[y.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",y[y.EditUserDelegate=12]="EditUserDelegate",y[y.NativeTransferIntent=13]="NativeTransferIntent",y[y.NativeTransferIntentCompressed=14]="NativeTransferIntentCompressed",y[y.TokenTransferIntent=15]="TokenTransferIntent",y[y.TokenTransferIntentCompressed=16]="TokenTransferIntentCompressed",y[y.TransactionBufferClose=17]="TransactionBufferClose",y[y.TransactionBufferCloseCompressed=18]="TransactionBufferCloseCompressed",y[y.TransactionBufferCreate=19]="TransactionBufferCreate",y[y.TransactionBufferCreateCompressed=20]="TransactionBufferCreateCompressed",y[y.TransactionBufferExecute=21]="TransactionBufferExecute",y[y.TransactionBufferExecuteCompressed=22]="TransactionBufferExecuteCompressed",y[y.TransactionBufferExtend=23]="TransactionBufferExtend",y[y.TransactionBufferExtendCompressed=24]="TransactionBufferExtendCompressed",y[y.TransactionBufferVote=25]="TransactionBufferVote",y[y.TransactionBufferVoteCompressed=26]="TransactionBufferVoteCompressed",y[y.TransactionExecute=27]="TransactionExecute",y[y.TransactionExecuteCompressed=28]="TransactionExecuteCompressed",y[y.TransactionExecuteSync=29]="TransactionExecuteSync",y[y.TransactionExecuteSyncCompressed=30]="TransactionExecuteSyncCompressed",y))(rE||{});function dN(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 oE=6e3,sE=6001,cE=6002,aE=6003,iE=6004,dE=6005,uE=6006,AE=6007,gE=6008,pE=6009,mE=6010,lE=6011,TE=6012,yE=6013,fE=6014,SE=6015,xE=6016,IE=6017,CE=6018,EE=6019,DE=6020,PE=6021,hE=6022,ME=6023,RE=6024,bE=6025,_E=6026,vE=6027,UE=6028,kE=6029,WE=6030,LE=6031,OE=6032,BE=6033,NE=6034,wE=6035,HE=6036,VE=6037,FE=6038,GE=6039,zE=6040,KE=6041,jE=6042,qE=6043,JE=6044,YE=6045,ZE=6046,XE=6047,QE=6048,$E=6049,eD=6050,tD=6051,rD=6052,nD=6053,oD=6054,sD=6055,cD=6056,aD=6057,iD=6058,dD=6059,uD=6060,AD=6061,gD=6062,pD=6063,mD=6064,lD=6065,TD=6066,yD=6067,fD=6068,SD=6069,xD=6070,ID=6071,CD=6072,ED=6073,DD=6074,PD=6075,hD=6076,MD=6077,RD=6078,bD=6079,_D=6080,vD=6081,UD=6082,kD=6083,WD=6084,LD=6085,OD=6086,Au;process.env.NODE_ENV!=="production"&&(Au={[LE]:"This member is already delegated to another wallet.",[AE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[MD]:"Clock sysvar access failed. This may indicate a system error.",[tD]:"Missing credential id.",[nD]:"The domain configuration account is disabled. Please contact support or try again later.",[oD]:"Missing domain configuration account.",[PD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[OD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[mE]:"Duplicate public keys detected among members. Each member must have a unique key.",[pE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[PE]:"No members provided. A multisig wallet must contain at least one member.",[uD]:"Slot numbers list is empty. At least one slot number is required for validation.",[CE]:"Expected a User with Administrator role for this instruction.",[gE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[xE]:"Expected a User with Transaction Manager role for this instruction.",[zE]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[KE]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[jE]:"Declared buffer size does not match the actual serialized size.",[dD]:"Failed to compute hash. This may indicate a system error.",[NE]:"Not enough members with vote permission to meet the approval threshold.",[OE]:"At least one signer with execute permission is required to proceed.",[BE]:"At least one signer with initiate permission is required to perform this action.",[_E]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[DD]:"Invalid account index in transaction message. The account index is out of bounds.",[aD]:"Address Tree supplied is not part of the whitelisted address trees.",[EE]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[UE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[GE]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[AD]:"Member key conversion failed. The provided key format is invalid.",[wE]:"Only delegated members are allowed for this transaction.",[bE]:"Unexpected number of accounts provided for this instruction.",[yE]:"User with Permanent Member role must have a delegated wallet.",[sE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[iE]:"The extracted public key has an invalid length or encoding.",[oE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[aE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[eD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[QE]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[ME]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[ID]:"Invalid source type for token transfer. The source account type is not supported.",[IE]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[SE]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[RE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[_D]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[vE]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[bD]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[xD]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[dE]:"The extracted WebAuthn signed message payload is malformed.",[ZE]:"An input string exceeds the maximum allowed character length.",[sD]:"This member is not registered under the provided domain configuration.",[mD]:"Member not found in settings. Cannot remove a member that does not exist.",[ED]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[kE]:"A required account is missing from the instruction context.",[gD]:"Compressed proof arguments are missing. Required for compressed account operations.",[yD]:"Missing compressed token account. Required for token transfer operations.",[vD]:"Missing destination token account. Required for token transfer operations.",[SD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[pD]:"Light CPI accounts are missing. Required for compressed account operations.",[WE]:"User mutation arguments are required when performing add or remove delegate operations.",[WD]:"Missing new authority account. Required for domain configuration updates.",[kD]:"Missing settings account. Required for delegate operations on compressed wallets.",[iD]:"Compressed settings data is missing. The settings account must be initialized with data.",[UD]:"Missing source token account. Required for token transfer operations.",[fD]:"Missing SPL interface PDA. Required for token transfer operations.",[XE]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[hD]:"User account address is missing. Required for secp256r1 signature verification.",[LD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[VE]:"No valid signer found in this transaction.",[DE]:"Only one administrator is allowed per wallet.",[TE]:"Only one permanent member is allowed per wallet.",[fE]:"Only one transaction manager is allowed per wallet.",[cD]:"The given origin index is not in the whitelisted origins.",[TD]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[lE]:"Permanent members cannot be removed from a wallet.",[YE]:"Writable CPI calls to protected accounts are not permitted.",[uE]:"The rpIdHash extracted from the signed message does not match the expected value.",[lD]:"Settings key mismatch. The provided settings key does not match the expected value.",[cE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[$E]:"The specified slot number was not found in the provided slot history.",[CD]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[hE]:"Too many members: a maximum of 4 members are supported.",[qE]:"This transaction has expired. It must be executed within 3 minutes of approval.",[JE]:"This transaction has not yet reached the required approval threshold.",[rD]:"Missing transports.",[FE]:"Only the transaction creator or rent payer may close this transaction buffer.",[RD]:"Unauthorized: Only the admin account is allowed to perform this action.",[HE]:"Member is not part of the expected signers for this transaction."});function lN(e){return process.env.NODE_ENV!=="production"?Au[e]:"Error message not available in production bundles."}function TN(e,n,r){return isProgramError(e,n,A,r)}async function MN({admin:e,addressTree:n}){return zc({payer:e,addressTree:n,remainingAccounts:[]})}var Me=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);}},Xe=class extends Me{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},Q=class extends Me{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},b=class extends Me{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},Te=class extends Me{constructor(r,o,t){super(r,"NETWORK_ERROR",{statusCode:o,url:t});this.statusCode=o;this.url=t;}};var ae=class extends Me{constructor(r,o,t){super(r,"BUNDLE_ERROR",{bundleId:o,attempt:t});this.bundleId=o;this.attempt=t;}},br=class extends Me{constructor(r,o,t){super(`Operation "${r}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=o;this.lastError=t;}},_r=class extends Me{constructor(r,o,t){super(r,"PERMISSION_ERROR",{required:o,actual:t});this.required=o;this.actual=t;}};var jt={Ed25519:1,Secp256r1:2};var BD=g.looseObject({publicKey:g.string(),walletAddress:g.string(),settingsIndexWithAddress:g.object({index:g.union([g.number(),g.bigint()]),settingsAddressTreeIndex:g.number()}),username:g.string().optional(),profilePictureUrl:g.string().optional()}),gu=g.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),WN=g.object({transactionActionType:gu,transactionAddress:g.string(),transactionMessageBytes:g.array(g.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),ND=g.object({transactionActionType:gu,transactionAddress:g.string(),transactionMessageBytes:g.base64()}).strict(),wD=g.union([g.object({type:g.literal("Ephemeral"),secretKey:g.string()}),g.object({type:g.literal("Default"),publickey:g.string(),endpoint:g.string()})]).array().optional(),pu=g.object({phase:g.literal("start"),redirectOrigin:g.url(),signer:g.string().optional(),rid:g.string(),validTill:g.number(),data:g.object({type:g.literal("message"),payload:g.string(),trustedDeviceCheck:g.boolean()}).strict()}).strict(),mu=g.object({phase:g.literal("start"),redirectOrigin:g.url(),signer:g.string().optional(),rid:g.string(),validTill:g.number(),data:g.object({type:g.literal("transaction"),payload:ND,sendTx:g.boolean(),additionalSigners:wD}).strict()}).strict(),lu=g.object({startRequest:g.union([pu,mu]),authResponse:g.custom(),client:g.object({clientOrigin:g.url(),jws:g.string()}).strict(),device:g.object({jwk:g.base64(),jws:g.string()}).strict(),authProvider:g.object({jwk:g.base64(),jws:g.string()}).strict().optional()}).strict(),Tu=g.object({signer:g.string(),userAddressTreeIndex:g.number().optional(),additionalInfo:g.looseObject({}).optional()}).strict(),HD=g.object({slotHash:g.string(),slotNumber:g.string(),originIndex:g.number(),crossOrigin:g.boolean()}).strict(),LN=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("message"),payload:Tu.extend(lu.shape).extend({id:g.string().optional(),client:g.object({clientOrigin:g.url()}).strict()})}).strict()}).strict(),ON=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("transaction"),payload:Tu.extend(lu.shape).extend(HD.shape).extend({client:g.object({clientOrigin:g.url()}).strict()})}).strict()}).strict(),BN=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("transaction"),payload:g.object({startRequest:g.union([mu,pu]),txSig:g.string(),user:BD})}).strict()}).strict();var Re={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},ve=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(Re).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var No=33,Ue=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!==No)throw new Error(`Invalid public key length, expected ${No} 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===No)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()}},_=class extends Ue{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(n,r){super(n),this.verifyArgs=r.verifyArgs,this.domainConfig=r.domainConfig,this.authData=r.authData,this.signature=r.signature,this.originIndex=r.originIndex,this.crossOrigin=r.crossOrigin,this.clientAndDeviceHash=r.clientAndDeviceHash,this.authResponse=r.authResponse;}};function GD(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function zD(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var fu=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(GD())],["addressTableLookups",getArrayCodec(zD())]]);function Su(e){return fu.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 xu(e){let n=fu.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 Ho=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Iu="https://mainnet.block-engine.jito.wtf/api/v1",Cu="https://bundles.jito.wtf/api/v1/bundles/tip_floor",Eu="landed_tips_75th_percentile";var ne={};function Du(){if(!ne.solanaRpcEndpoint)throw new Xe("RPC endpoint");return ne.solanaRpcEndpoint}function ye(){if(!ne.lightProtocolRpc)throw new Xe("Light Protocol RPC");return ne.lightProtocolRpc}function Y(){if(!ne.solanaRpc)throw new Xe("Solana RPC");return ne.solanaRpc}function Pu(){if(!ne.sendAndConfirm)throw new Xe("Send and confirm transaction function");return ne.sendAndConfirm}function Vo(){return ne.jitoTipsConfig?ne.jitoTipsConfig:{blockEngineUrl:Iu,getJitoTipsUrl:Cu,priority:Eu}}function aw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:o}){ne.solanaRpcEndpoint=e,ne.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});ne.solanaRpc=t,ne.sendAndConfirm=c,ne.jitoTipsConfig=o??null;}async function qt(e,n){if(!e.ok)throw new Te(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function Jt(e){try{return await e.json()}catch(n){throw new Te(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function Cw(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Ur(n.get(-2))),y:BigInt("0x"+Ur(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function Ew(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 Dw(e){let{authenticatorData:n,clientDataJSON:r,signature:o}=e.authResponse.response,t=me(n),c=JSON.parse(getUtf8Decoder().decode(me(r))),i=_u(c),a=Uu(me(o)),s=await at({rpIdHash:t.subarray(0,32)});return new _(e.signer.toString(),{verifyArgs:{clientDataJson:me(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:Fo(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 Fo(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(n),...getBase64Encoder().encode(r)]))}function Pw(e){return sha256(getUtf8Encoder().encode(canonicalize(e)))}function hw(e){return Go(e.data.payload.authResponse)}function Mw(e,n,r,o){let t=Fo(n,r,o);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...t]))}async function Rw(e,n,r,o,t,c){let i;if(!t||!c){let u=(await Y().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!u)throw new Q("Slot sysvar","Unable to fetch slot sysvar data");let p=getBase64Encoder().encode(u[0]);c=getU64Decoder().decode(p.subarray(0,8)).toString(),i=p.subarray(8,40),t=getBase58Decoder().decode(i);}else i=getBase58Encoder().encode(t);let a=sha256(typeof e.transactionMessageBytes=="string"?getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),s=Fo(n,r,o),d=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...a,...i,...s]));return {slotNumber:c,slotHash:t,challenge:d}}function Go(e){let n=kr(e);return sha256(n)}function bw(e){let n="";for(let o of e)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function me(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 _w(e,n){let{data:r}=await is(Y(),e),t=vu(r.origins,r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Q("Origin","Origin not found in domain config");return t}function vw(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function Uw(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}function Ur(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function $D(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 _u(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 vu(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 Uu(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 M=n&127;r+=M;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let o=e[r+1],t=r+2,c=e.slice(t,t+o);if(r=t+o,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,s=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=s[0]===0&&s.length>32?s.slice(1):s;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let p=new Uint8Array(32);p.set(d,32-d.length);let m=p256.Point.CURVE().n>>1n,f=BigInt("0x"+Ur(u)),I=(f>m?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=$D(I);return new Uint8Array([...p,...x])}function kr(e){let n=me(e.response.clientDataJSON),r=me(e.response.authenticatorData),o=sha256(n);return new Uint8Array([...r,...o])}var eP=400,tP=429,Wu=500,rP=3,nP=500,oP=2,sP=3e4,Lu={backoffBase:oP,maxDelayMs:sP,retryOnRateLimit:true,initialDelayMs:nP,maxRetries:rP};function Ou(e){return e===tP}function Bu(e){return e>=Wu}function cP(e){return e>=eP&&e<Wu}function aP(e){return Ou(e)||Bu(e)}function iP(e,n,r){return e instanceof Response?Ou(e.status)?r.retryOnRateLimit??true:cP(e.status)?false:Bu(e.status):e instanceof TypeError||e instanceof Error}function dP(e,n,r,o){let t=n*Math.pow(r,e-1);return Math.min(t,o)}function uP(e){return new Promise(n=>setTimeout(n,e))}async function Xt(e,n){let{maxRetries:r,initialDelayMs:o,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...Lu,...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=dP(s,o,t,c);await uP(u);}throw new br(e.name||"retryWithBackoff",r,a)}async function it(e,n){let r={...Lu,...n},o=(c,i)=>iP(c,i,r);return Xt(async()=>{let c=await e();if(!c.ok&&aP(c.status))throw c;return c},{...r,shouldRetry:n?.shouldRetry??o})}function Nu(...e){return n=>e.some(r=>n instanceof r)}function wu(e,n,r,o){if(e<n||e>r)throw new b(`${o} must be between ${n} and ${r} (inclusive), got ${e}`)}function Hu(e,n){if(e<0)throw new b(`${n} must be non-negative, got ${e}`)}function Qt(e,n){if(e.length===0)throw new b(`${n} cannot be empty`)}function Vu(e,n){if(e.trim().length===0)throw new b(`${n} cannot be empty`)}async function Ko(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await Y().getLatestBlockhash().send()).value;return await Promise.all(e.map(async o=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(o.instructions,c),c=>setTransactionMessageFeePayerSigner(o.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>o.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,o.addressesByLookupTableAddress):c,async c=>{let i=Math.ceil((o.unitsConsumed??0)*1.1);return i>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:i})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function ju(e){let n=prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:8e5}),getSetComputeUnitPriceInstruction({microLamports:1e4})],e),r=getBase64EncodedWireTransaction(compileTransaction(n));if(r.length>1644)throw new b(`Transaction exceeds maximum length of ${1644} bytes (actual: ${r.length} bytes)`);let o=await Y().simulateTransaction(r,{encoding:"base64"}).send();if(o.value.err){if(o.value.logs){let c=["Transaction simulation failed:","",...o.value.logs].join(`
|
|
1
|
+
import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,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,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,getBlockhashDecoder,compileTransaction,getTransactionEncoder,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,TreeType,encodeBN254toBase58,getLightSystemAccountMetasV2,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import m from'zod';import {getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTokenDecoder,getTransferSolInstruction}from'gill/programs';import {p256}from'@noble/curves/nist.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {canonicalize}from'json-canonicalize';import {selectMinCompressedTokenAccountsForDecompression}from'@lightprotocol/compressed-token';import Sh from'bn.js';import {equalBytes}from'@noble/curves/utils.js';var ss=new Uint8Array([201,232,212,229,59,241,106,197]);function Yh(){return fixEncoderSize(getBytesEncoder(),8).encode(ss)}function ZA(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["rpIdHash",fixEncoderSize(getBytesEncoder(),32)],["bump",getU8Encoder()],["isDisabled",getU8Encoder()],["rpIdLength",getU8Encoder()],["numOrigins",getU8Encoder()],["rpId",fixEncoderSize(getBytesEncoder(),255)],["origins",fixEncoderSize(getBytesEncoder(),515)]]),e=>({...e,discriminator:ss}))}function cs(){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 Zh(){return combineCodec(ZA(),cs())}function as(e){return decodeAccount(e,cs())}async function is(e,n,r){let o=await XA(e,n,r);return assertAccountExists(o),o}async function XA(e,n,r){let o=await fetchEncodedAccount(e,n,r);return as(o)}async function Xh(e,n,r){let o=await QA(e,n,r);return assertAccountsExist(o),o}async function QA(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>as(t))}function Qh(){return 846}var As=new Uint8Array([42,206,176,58,175,129,130,233]);function tM(){return fixEncoderSize(getBytesEncoder(),8).encode(As)}function gg(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:As}))}function gs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function rM(){return combineCodec(gg(),gs())}function ps(e){return decodeAccount(e,gs())}async function nM(e,n,r){let o=await pg(e,n,r);return assertAccountExists(o),o}async function pg(e,n,r){let o=await fetchEncodedAccount(e,n,r);return ps(o)}async function oM(e,n,r){let o=await mg(e,n,r);return assertAccountsExist(o),o}async function mg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ps(t))}function sM(){return 24}var jr=(r=>(r[r.Initialized=0]="Initialized",r[r.Frozen=1]="Frozen",r))(jr||{});function qr(){return getEnumEncoder(jr)}function Jr(){return getEnumDecoder(jr)}function iM(){return combineCodec(qr(),Jr())}function Yr(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Zr(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function AM(){return combineCodec(Yr(),Zr())}function Xr(){return getStructEncoder([["memberKey",V()],["permissions",Be()],["userArgs",we()]])}function Qr(){return getStructDecoder([["memberKey",$()],["permissions",Ne()],["userArgs",He()]])}function lM(){return combineCodec(Xr(),Qr())}function $r(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function en(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function fM(){return combineCodec($r(),en())}function mt(){return getStructEncoder([["treeInfo",Tt()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function lt(){return getStructDecoder([["treeInfo",yt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function CM(){return combineCodec(mt(),lt())}function ft(){return getStructEncoder([["treeInfo",Tt()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function St(){return getStructDecoder([["treeInfo",yt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function hM(){return combineCodec(ft(),St())}function tn(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function rn(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function bM(){return combineCodec(tn(),rn())}function an(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function dn(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function UM(){return combineCodec(an(),dn())}function xt(){return getStructEncoder([["data",getOptionEncoder(un())]])}function j(){return getStructDecoder([["data",getOptionDecoder(An())]])}function OM(){return combineCodec(xt(),j())}function un(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(It())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function An(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(Ct())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function HM(){return combineCodec(un(),An())}function Et(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",pn()],["tlv",getOptionEncoder(getArrayEncoder(gn()))],["state",qr()]])}function Dt(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",mn()],["tlv",getOptionDecoder(getArrayDecoder(Pt()))],["state",Jr()]])}function zM(){return combineCodec(Et(),Dt())}function yn(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",Sn()]])}function fn(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",xn()]])}function JM(){return combineCodec(yn(),fn())}function Sn(){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",En()]])}function xn(){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",Dn()]])}function QM(){return combineCodec(Sn(),xn())}function Ve(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Mn())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Xr())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(bn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Fe(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Rn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Qr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(_n())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function rR(){return combineCodec(Ve(),Fe())}function nR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function oR(e,n){return n.__kind===e}function vn(){return getStructEncoder([["member",getAddressEncoder()],["role",Ge()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Pe()]])}function Un(){return getStructDecoder([["member",getAddressDecoder()],["role",ze()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",he()]])}function iR(){return combineCodec(vn(),Un())}function Mn(){return getStructEncoder([["memberKey",V()],["permissions",Be()]])}function Rn(){return getStructDecoder([["memberKey",$()],["permissions",Ne()]])}function gR(){return combineCodec(Mn(),Rn())}function ht(){return getStructEncoder([["memberKey",V()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function Mt(){return getStructDecoder([["memberKey",$()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function TR(){return combineCodec(ht(),Mt())}function gn(){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([Bn()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([kn()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([Ln()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([wn()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([Vn()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([tn()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([yn()])]])]])}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([Nn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([Wn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([On()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([Hn()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([Fn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([rn()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([fn()])]])]])}function xR(){return combineCodec(gn(),Pt())}function IR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function CR(e,n){return n.__kind===e}function Gn(){return getStructEncoder([["settingsMutArgs",z()],["transactionManager",getOptionEncoder(Rt())]])}function zn(){return getStructDecoder([["settingsMutArgs",K()],["transactionManager",getOptionDecoder(bt())]])}function hR(){return combineCodec(Gn(),zn())}function It(){return getStructEncoder([["pubkey",V()],["role",getU8Encoder()],["permissions",Be()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function Ct(){return getStructDecoder([["pubkey",$()],["role",getU8Decoder()],["permissions",Ne()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function _R(){return combineCodec(It(),Ct())}function V(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function $(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function kR(){return combineCodec(V(),$())}function qn(){return getStructEncoder([["authorityCreationArgs",Pe()],["compressedProofArgs",C()]])}function Jn(){return getStructDecoder([["authorityCreationArgs",he()],["compressedProofArgs",E()]])}function BR(){return combineCodec(qn(),Jn())}function _t(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function vt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function HR(){return combineCodec(_t(),vt())}function pn(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function mn(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function GR(){return combineCodec(pn(),mn())}function Tt(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function yt(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function jR(){return combineCodec(Tt(),yt())}function kn(){return getStructEncoder([])}function Wn(){return getStructDecoder([])}function YR(){return combineCodec(kn(),Wn())}function Ln(){return getStructEncoder([])}function On(){return getStructDecoder([])}function QR(){return combineCodec(Ln(),On())}function Be(){return getStructEncoder([["mask",getU8Encoder()]])}function Ne(){return getStructDecoder([["mask",getU8Decoder()]])}function tb(){return combineCodec(Be(),Ne())}function C(){return getStructEncoder([["proof",getOptionEncoder(an())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function E(){return getStructDecoder([["proof",getOptionDecoder(dn())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function sb(){return combineCodec(C(),E())}function bn(){return getStructEncoder([["memberKey",V()],["userArgs",we()]])}function _n(){return getStructDecoder([["memberKey",$()],["userArgs",He()]])}function db(){return combineCodec(bn(),_n())}function En(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function Dn(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function gb(){return combineCodec(En(),Dn())}function Xn(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Ut(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function lb(){return combineCodec(Xn(),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 fb(){return combineCodec(F(),G())}function Qn(){return getStructEncoder([["verifyArgs",F()],["domainConfigIndex",getU8Encoder()]])}function $n(){return getStructDecoder([["verifyArgs",G()],["domainConfigIndex",getU8Decoder()]])}function Cb(){return combineCodec(Qn(),$n())}function eo(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function to(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function Pb(){return combineCodec(eo(),to())}function ro(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function no(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function Rb(){return combineCodec(ro(),no())}function z(){return getStructEncoder([["accountMeta",mt()],["data",xt()]])}function K(){return getStructDecoder([["accountMeta",lt()],["data",j()]])}function Ub(){return combineCodec(z(),K())}function kt(){return getStructEncoder([["accountMeta",ft()],["data",xt()]])}function Wt(){return getStructDecoder([["accountMeta",St()],["data",j()]])}function Ob(){return combineCodec(kt(),Wt())}function Lt(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function Ot(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function wb(){return combineCodec(Lt(),Ot())}function Bn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(Yr())]])}function Nn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(Zr())]])}function Gb(){return combineCodec(Bn(),Nn())}function Bt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(ht())]])}function Nt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(Mt())]])}function qb(){return combineCodec(Bt(),Nt())}function wt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder($r())],["addressTableLookups",getArrayEncoder(Ao())]])}function Ht(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(en())],["addressTableLookups",getArrayDecoder(go())]])}function Xb(){return combineCodec(wt(),Ht())}function Ao(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function go(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function e_(){return combineCodec(Ao(),go())}function q(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([Qn()])]])]])}function J(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([$n()])]])]])}function o_(){return combineCodec(q(),J())}function s_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function c_(e,n){return n.__kind===e}function wn(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function Hn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function d_(){return combineCodec(wn(),Hn())}function Vn(){return getStructEncoder([["transferring",getU8Encoder()]])}function Fn(){return getStructDecoder([["transferring",getU8Decoder()]])}function g_(){return combineCodec(Vn(),Fn())}var po=(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))(po||{});function Vt(){return getEnumEncoder(po)}function Ft(){return getEnumDecoder(po)}function l_(){return combineCodec(Vt(),Ft())}function Gt(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",V()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(Vt()))],["wallets",getArrayEncoder(ro())],["role",Ge()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function X(){return getStructDecoder([["domainConfig",getOptionDecoder(getAddressDecoder())],["member",$()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(Ft()))],["wallets",getArrayDecoder(no())],["role",ze()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function S_(){return combineCodec(Gt(),X())}function Pe(){return getStructEncoder([["addressTreeInfo",_t()],["outputStateTreeIndex",getU8Encoder()]])}function he(){return getStructDecoder([["addressTreeInfo",vt()],["outputStateTreeIndex",getU8Decoder()]])}function E_(){return combineCodec(Pe(),he())}function Ye(){return getStructEncoder([["accountMeta",mt()],["data",Gt()]])}function Ze(){return getStructDecoder([["accountMeta",lt()],["data",X()]])}function M_(){return combineCodec(Ye(),Ze())}function Rt(){return getStructEncoder([["accountMeta",ft()],["data",Gt()]])}function bt(){return getStructDecoder([["accountMeta",St()],["data",X()]])}function v_(){return combineCodec(Rt(),bt())}function we(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Rt()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([Ye()])]])]])}function He(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([bt()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([Ze()])]])]])}function L_(){return combineCodec(we(),He())}function O_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function B_(e,n){return n.__kind===e}var _e=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(_e||{});function Ge(){return getEnumEncoder(_e)}function ze(){return getEnumDecoder(_e)}function H_(){return combineCodec(Ge(),ze())}var Dc=new Uint8Array([223,179,163,190,177,224,67,173]);function zv(){return fixEncoderSize(getBytesEncoder(),8).encode(Dc)}function s1(){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:Dc}))}function Sr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(Ct())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function Kv(){return combineCodec(s1(),Sr())}function Pc(e){return decodeAccount(e,Sr())}async function jv(e,n,r){let o=await mo(e,n,r);return assertAccountExists(o),o}async function mo(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Pc(o)}async function qv(e,n,r){let o=await c1(e,n,r);return assertAccountsExist(o),o}async function c1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Pc(t))}var _c=new Uint8Array([90,36,35,219,93,225,110,96]);function Xv(){return fixEncoderSize(getBytesEncoder(),8).encode(_c)}function D1(){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(ht())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:_c}))}function vc(){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",$()],["executor",$()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder($())],["expectedSigners",getArrayDecoder(Mt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Qv(){return combineCodec(D1(),vc())}function Uc(e){return decodeAccount(e,vc())}async function kc(e,n,r){let o=await P1(e,n,r);return assertAccountExists(o),o}async function P1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Uc(o)}async function $v(e,n,r){let o=await h1(e,n,r);return assertAccountsExist(o),o}async function h1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Uc(t))}var Oc=new Uint8Array([105,23,173,2,197,255,80,87]);function rU(){return fixEncoderSize(getBytesEncoder(),8).encode(Oc)}function z1(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Oc}))}function Bc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function nU(){return combineCodec(z1(),Bc())}function Nc(e){return decodeAccount(e,Bc())}async function wc(e,n,r){let o=await K1(e,n,r);return assertAccountExists(o),o}async function K1(e,n,r){let o=await fetchEncodedAccount(e,n,r);return Nc(o)}async function oU(e,n,r){let o=await j1(e,n,r);return assertAccountsExist(o),o}async function j1(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Nc(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 B(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function T(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let o=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:B(r.value),role:Hc(r.value)?upgradeRoleToSigner(o):o,...Hc(r.value)?{signer:r.value}:{}})}}function Hc(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Fc=new Uint8Array([8]);function IU(){return fixEncoderSize(getBytesEncoder(),1).encode(Fc)}function Co(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Fc}))}function Gc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function CU(){return combineCodec(Co(),Gc())}async function zc(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=T(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Co().encode(c),programAddress:r})}function EU(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=T(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Co().encode(c),programAddress:r})}function DU(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:Gc().decode(e.data)}}var Yc=new Uint8Array([9]);function vU(){return fixEncoderSize(getBytesEncoder(),1).encode(Yc)}function Zc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(Ve())],["signers",getArrayEncoder(q())],["compressedProofArgs",getOptionEncoder(C())]]),e=>({...e,discriminator:Yc}))}function Xc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Fe())],["signers",getArrayDecoder(J())],["compressedProofArgs",getOptionDecoder(E())]])}function UU(){return combineCodec(Zc(),Xc())}function Qc(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=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Zc().encode(c),programAddress:r})}function kU(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:Xc().decode(e.data)}}var na=new Uint8Array([19]);function HU(){return fixEncoderSize(getBytesEncoder(),1).encode(na)}function oa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(Ve())],["signers",getArrayEncoder(q())],["settingsMutArgs",z()],["compressedProofArgs",C()]]),e=>({...e,discriminator:na}))}function sa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Fe())],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",E()]])}function VU(){return combineCodec(oa(),sa())}function ca(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:oa().encode(c),programAddress:r})}function FU(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:sa().decode(e.data)}}var da=new Uint8Array([18]);function YU(){return fixEncoderSize(getBytesEncoder(),1).encode(da)}function Eo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["addressTreeInfo",_t()],["outputStateTreeIndex",getU8Encoder()],["userArgs",we()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:da}))}function ua(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["addressTreeInfo",vt()],["outputStateTreeIndex",getU8Decoder()],["userArgs",He()],["settingsIndex",getU128Decoder()]])}function ZU(){return combineCodec(Eo(),ua())}async function Aa(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:Eo().encode(c),programAddress:r})}function XU(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:Eo().encode(c),programAddress:r})}function QU(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:ua().decode(e.data)}}var Sa=new Uint8Array([0]);function sk(){return fixEncoderSize(getBytesEncoder(),1).encode(Sa)}function Po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",Pe()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Sa}))}function xa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",he()],["compressedProofArgs",E()]])}function ck(){return combineCodec(Po(),xa())}async function Ia(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=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Po().encode(c),programAddress:r})}function ak(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=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Po().encode(c),programAddress:r})}function ik(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:xa().decode(e.data)}}var Da=new Uint8Array([4]);function lk(){return fixEncoderSize(getBytesEncoder(),1).encode(Da)}function ho(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["member",Xn()],["role",Ge()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(Vt())],["userAccountCreationArgs",Pe()],["linkWalletArgs",getOptionEncoder(Gn())]]),e=>({...e,discriminator:Da}))}function Pa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["member",Ut()],["role",ze()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Ft())],["userAccountCreationArgs",he()],["linkWalletArgs",getOptionDecoder(zn())]])}function Tk(){return combineCodec(ho(),Pa())}async function ha(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:ho().encode(c),programAddress:r})}function yk(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:ho().encode(c),programAddress:r})}function fk(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:Pa().decode(e.data)}}var Ra=new Uint8Array([3]);function Dk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ra)}function Ro(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Ra}))}function ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function Pk(){return combineCodec(Ro(),ba())}async function _a(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=T(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:Ro().encode({}),programAddress:r})}function hk(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=T(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:Ro().encode({}),programAddress:r})}function Mk(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:ba().decode(e.data)}}var Ua=new Uint8Array([5]);function Wk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ua)}function _o(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["createUserArgs",getArrayEncoder(vn())]]),e=>({...e,discriminator:Ua}))}function ka(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["createUserArgs",getArrayDecoder(Un())]])}function Lk(){return combineCodec(_o(),ka())}async function Wa(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:_o().encode(c),programAddress:r})}function Ok(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:_o().encode(c),programAddress:r})}function Bk(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:ka().decode(e.data)}}var Ba=new Uint8Array([17]);function zk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ba)}function Na(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",z()],["compressedProofArgs",C()],["signers",getArrayEncoder(q())]]),e=>({...e,discriminator:Ba}))}function wa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",K()],["compressedProofArgs",E()],["signers",getArrayDecoder(J())]])}function Kk(){return combineCodec(Na(),wa())}function Ha(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=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Na().encode(c),programAddress:r})}function jk(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:wa().decode(e.data)}}var Ga=new Uint8Array([2]);function Qk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ga)}function za(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:Ga}))}function Ka(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function $k(){return combineCodec(za(),Ka())}function ja(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=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.admin),...a],data:za().encode(c),programAddress:r})}function eW(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:Ka().decode(e.data)}}var Za=new Uint8Array([1]);function aW(){return fixEncoderSize(getBytesEncoder(),1).encode(Za)}function Uo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(qn())]]),e=>({...e,discriminator:Za}))}function Xa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Jn())]])}function iW(){return combineCodec(Uo(),Xa())}async function dW(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=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Uo().encode(c),programAddress:r})}function Qa(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=T(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Uo().encode(c),programAddress:r})}function uW(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:Xa().decode(e.data)}}var ti=new Uint8Array([6]);function yW(){return fixEncoderSize(getBytesEncoder(),1).encode(ti)}function ri(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Ye()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",C()]]),e=>({...e,discriminator:ti}))}function ni(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ze()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",E()]])}function fW(){return combineCodec(ri(),ni())}function oi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.authority),...a],data:ri().encode(c),programAddress:r})}function SW(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:ni().decode(e.data)}}var ai=new Uint8Array([7]);function hW(){return fixEncoderSize(getBytesEncoder(),1).encode(ai)}function ii(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Ye()],["secp256r1VerifyArgs",getOptionEncoder(F())],["delegateTo",getOptionEncoder(eo())],["oldSettingsMutArgs",getOptionEncoder(z())],["newSettingsMutArgs",getOptionEncoder(z())],["compressedProofArgs",C()]]),e=>({...e,discriminator:ai}))}function di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ze()],["secp256r1VerifyArgs",getOptionDecoder(G())],["delegateTo",getOptionDecoder(to())],["oldSettingsMutArgs",getOptionDecoder(K())],["newSettingsMutArgs",getOptionDecoder(K())],["compressedProofArgs",E()]])}function MW(){return combineCodec(ii(),di())}function ui(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=T(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:ii().encode(c),programAddress:r})}function RW(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:di().decode(e.data)}}var gi=new Uint8Array([29]);function LW(){return fixEncoderSize(getBytesEncoder(),1).encode(gi)}function ko(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(q())]]),e=>({...e,discriminator:gi}))}function pi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())]])}function OW(){return combineCodec(ko(),pi())}async function BW(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(B(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=T(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:ko().encode(c),programAddress:r})}function mi(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=T(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:ko().encode(c),programAddress:r})}function NW(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:pi().decode(e.data)}}var yi=new Uint8Array([27]);function KW(){return fixEncoderSize(getBytesEncoder(),1).encode(yi)}function fi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(q())],["settingsMutArgs",z()],["compressedProofArgs",C()]]),e=>({...e,discriminator:yi}))}function Si(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",E()]])}function jW(){return combineCodec(fi(),Si())}function xi(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=T(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:fi().encode(c),programAddress:r})}function qW(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:Si().decode(e.data)}}var hi=new Uint8Array([30]);function eL(){return fixEncoderSize(getBytesEncoder(),1).encode(hi)}function Wo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Lt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(Et())],["compressedProofArgs",getOptionEncoder(C())],["signers",getArrayEncoder(q())]]),e=>({...e,discriminator:hi}))}function Mi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Ot())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Dt())],["compressedProofArgs",getOptionDecoder(E())],["signers",getArrayDecoder(J())]])}function tL(){return combineCodec(Wo(),Mi())}async function rL(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(B(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(B(t.source.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(B(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(B(t.destination.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(B(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Wo().encode(c),programAddress:r})}function Ri(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=T(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Wo().encode(c),programAddress:r})}function nL(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:Mi().decode(e.data)}}var Ui=new Uint8Array([28]);function uL(){return fixEncoderSize(getBytesEncoder(),1).encode(Ui)}function Lo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Lt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(Et())],["signers",getArrayEncoder(q())],["settingsMutArgs",z()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ui}))}function ki(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Ot())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Dt())],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",E()]])}function AL(){return combineCodec(Lo(),ki())}async function gL(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(B(t.source.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(B(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(B(t.destination.value)),getAddressEncoder().encode(B(t.tokenProgram.value)),getAddressEncoder().encode(B(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(B(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(B(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=T(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:Lo().encode(c),programAddress:r})}function Wi(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=T(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:Lo().encode(c),programAddress:r})}function pL(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:ki().decode(e.data)}}var Bi=new Uint8Array([13]);function xL(){return fixEncoderSize(getBytesEncoder(),1).encode(Bi)}function Ni(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Bi}))}function wi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function IL(){return combineCodec(Ni(),wi())}function Hi(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=T(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:Ni().encode(c),programAddress:r})}function CL(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:wi().decode(e.data)}}var Gi=new Uint8Array([23]);function bL(){return fixEncoderSize(getBytesEncoder(),1).encode(Gi)}function zi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",z()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Gi}))}function Ki(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",K()],["compressedProofArgs",E()]])}function _L(){return combineCodec(zi(),Ki())}function ji(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=T(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:zi().encode(c),programAddress:r})}function vL(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:Ki().decode(e.data)}}var Yi=new Uint8Array([10]);function NL(){return fixEncoderSize(getBytesEncoder(),1).encode(Yi)}function Zi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Bt()],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Yi}))}function Xi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Nt()],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function wL(){return combineCodec(Zi(),Xi())}function Qi(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=T(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:Zi().encode(c),programAddress:r})}function HL(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:Xi().decode(e.data)}}var td=new Uint8Array([20]);function qL(){return fixEncoderSize(getBytesEncoder(),1).encode(td)}function rd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Bt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",kt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:td}))}function nd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Nt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Wt()],["compressedProofArgs",E()]])}function JL(){return combineCodec(rd(),nd())}function od(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=T(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:rd().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(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:nd().decode(e.data)}}var ad=new Uint8Array([14]);function rO(){return fixEncoderSize(getBytesEncoder(),1).encode(ad)}function id(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:ad}))}function dd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function nO(){return combineCodec(id(),dd())}function ud(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=T(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:id().encode(c),programAddress:r})}function oO(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:dd().decode(e.data)}}var pd=new Uint8Array([24]);function AO(){return fixEncoderSize(getBytesEncoder(),1).encode(pd)}function md(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",z()],["compressedProofArgs",C()]]),e=>({...e,discriminator:pd}))}function ld(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",K()],["compressedProofArgs",E()]])}function gO(){return combineCodec(md(),ld())}function Td(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=T(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:md().encode(c),programAddress:r})}function pO(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:ld().decode(e.data)}}var Sd=new Uint8Array([12]);function SO(){return fixEncoderSize(getBytesEncoder(),1).encode(Sd)}function xd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Sd}))}function Id(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function xO(){return combineCodec(xd(),Id())}function Cd(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=T(r);return Object.freeze({accounts:[s(t.settings),s(t.transactionBuffer),...a],data:xd().encode(c),programAddress:r})}function IO(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:Id().decode(e.data)}}var Pd=new Uint8Array([22]);function MO(){return fixEncoderSize(getBytesEncoder(),1).encode(Pd)}function hd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Pd}))}function Md(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function RO(){return combineCodec(hd(),Md())}function Rd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=T(r);return Object.freeze({accounts:[s(t.transactionBuffer),...a],data:hd().encode(c),programAddress:r})}function bO(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:Md().decode(e.data)}}var vd=new Uint8Array([11]);function OO(){return fixEncoderSize(getBytesEncoder(),1).encode(vd)}function Ud(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:vd}))}function kd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function BO(){return combineCodec(Ud(),kd())}function Wd(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=T(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:Ud().encode(c),programAddress:r})}function NO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:kd().decode(e.data)}}var Bd=new Uint8Array([21]);function KO(){return fixEncoderSize(getBytesEncoder(),1).encode(Bd)}function Nd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",kt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Bd}))}function wd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",Wt()],["compressedProofArgs",E()]])}function jO(){return combineCodec(Nd(),wd())}function Hd(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=T(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:Nd().encode(c),programAddress:r})}function qO(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:wd().decode(e.data)}}var Gd=new Uint8Array([15]);function $O(){return fixEncoderSize(getBytesEncoder(),1).encode(Gd)}function zd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Gd}))}function Kd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function eB(){return combineCodec(zd(),Kd())}function jd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=l({}),a=T(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:zd().encode({}),programAddress:r})}function tB(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:Kd().decode(e.data)}}var Yd=new Uint8Array([25]);function aB(){return fixEncoderSize(getBytesEncoder(),1).encode(Yd)}function Zd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Yd}))}function Xd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function iB(){return combineCodec(Zd(),Xd())}function Qd(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.transactionBuffer),...a],data:Zd().encode(c),programAddress:r})}function dB(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:Xd().decode(e.data)}}var tu=new Uint8Array([16]);function TB(){return fixEncoderSize(getBytesEncoder(),1).encode(tu)}function ru(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",wt()],["signers",getArrayEncoder(q())]]),e=>({...e,discriminator:tu}))}function nu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Ht()],["signers",getArrayDecoder(J())]])}function yB(){return combineCodec(ru(),nu())}function ou(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=T(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:ru().encode(c),programAddress:r})}function fB(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:nu().decode(e.data)}}var au=new Uint8Array([26]);function PB(){return fixEncoderSize(getBytesEncoder(),1).encode(au)}function iu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",wt()],["signers",getArrayEncoder(q())],["settingsMutArgs",z()],["compressedProofArgs",C()]]),e=>({...e,discriminator:au}))}function du(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Ht()],["signers",getArrayDecoder(J())],["settingsMutArgs",K()],["compressedProofArgs",E()]])}function hB(){return combineCodec(iu(),du())}function uu(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=T(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:iu().encode(c),programAddress:r})}function MB(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:du().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",tE=(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))(tE||{});function dN(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 rE=(y=>(y[y.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",y[y.ChangeConfig=1]="ChangeConfig",y[y.ChangeConfigCompressed=2]="ChangeConfigCompressed",y[y.CreateCompressedWallet=3]="CreateCompressedWallet",y[y.CreateDomainConfig=4]="CreateDomainConfig",y[y.CreateDomainUserAccount=5]="CreateDomainUserAccount",y[y.CreateGlobalCounter=6]="CreateGlobalCounter",y[y.CreateUserAccounts=7]="CreateUserAccounts",y[y.DecompressSettingsAccount=8]="DecompressSettingsAccount",y[y.DisableDomainConfig=9]="DisableDomainConfig",y[y.EditDomainConfig=10]="EditDomainConfig",y[y.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",y[y.EditUserDelegate=12]="EditUserDelegate",y[y.NativeTransferIntent=13]="NativeTransferIntent",y[y.NativeTransferIntentCompressed=14]="NativeTransferIntentCompressed",y[y.TokenTransferIntent=15]="TokenTransferIntent",y[y.TokenTransferIntentCompressed=16]="TokenTransferIntentCompressed",y[y.TransactionBufferClose=17]="TransactionBufferClose",y[y.TransactionBufferCloseCompressed=18]="TransactionBufferCloseCompressed",y[y.TransactionBufferCreate=19]="TransactionBufferCreate",y[y.TransactionBufferCreateCompressed=20]="TransactionBufferCreateCompressed",y[y.TransactionBufferExecute=21]="TransactionBufferExecute",y[y.TransactionBufferExecuteCompressed=22]="TransactionBufferExecuteCompressed",y[y.TransactionBufferExtend=23]="TransactionBufferExtend",y[y.TransactionBufferExtendCompressed=24]="TransactionBufferExtendCompressed",y[y.TransactionBufferVote=25]="TransactionBufferVote",y[y.TransactionBufferVoteCompressed=26]="TransactionBufferVoteCompressed",y[y.TransactionExecute=27]="TransactionExecute",y[y.TransactionExecuteCompressed=28]="TransactionExecuteCompressed",y[y.TransactionExecuteSync=29]="TransactionExecuteSync",y[y.TransactionExecuteSyncCompressed=30]="TransactionExecuteSyncCompressed",y))(rE||{});function uN(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 oE=6e3,sE=6001,cE=6002,aE=6003,iE=6004,dE=6005,uE=6006,AE=6007,gE=6008,pE=6009,mE=6010,lE=6011,TE=6012,yE=6013,fE=6014,SE=6015,xE=6016,IE=6017,CE=6018,EE=6019,DE=6020,PE=6021,hE=6022,ME=6023,RE=6024,bE=6025,_E=6026,vE=6027,UE=6028,kE=6029,WE=6030,LE=6031,OE=6032,BE=6033,NE=6034,wE=6035,HE=6036,VE=6037,FE=6038,GE=6039,zE=6040,KE=6041,jE=6042,qE=6043,JE=6044,YE=6045,ZE=6046,XE=6047,QE=6048,$E=6049,eD=6050,tD=6051,rD=6052,nD=6053,oD=6054,sD=6055,cD=6056,aD=6057,iD=6058,dD=6059,uD=6060,AD=6061,gD=6062,pD=6063,mD=6064,lD=6065,TD=6066,yD=6067,fD=6068,SD=6069,xD=6070,ID=6071,CD=6072,ED=6073,DD=6074,PD=6075,hD=6076,MD=6077,RD=6078,bD=6079,_D=6080,vD=6081,UD=6082,kD=6083,WD=6084,LD=6085,OD=6086,Au;process.env.NODE_ENV!=="production"&&(Au={[LE]:"This member is already delegated to another wallet.",[AE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[MD]:"Clock sysvar access failed. This may indicate a system error.",[tD]:"Missing credential id.",[nD]:"The domain configuration account is disabled. Please contact support or try again later.",[oD]:"Missing domain configuration account.",[PD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[OD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[mE]:"Duplicate public keys detected among members. Each member must have a unique key.",[pE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[PE]:"No members provided. A multisig wallet must contain at least one member.",[uD]:"Slot numbers list is empty. At least one slot number is required for validation.",[CE]:"Expected a User with Administrator role for this instruction.",[gE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[xE]:"Expected a User with Transaction Manager role for this instruction.",[zE]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[KE]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[jE]:"Declared buffer size does not match the actual serialized size.",[dD]:"Failed to compute hash. This may indicate a system error.",[NE]:"Not enough members with vote permission to meet the approval threshold.",[OE]:"At least one signer with execute permission is required to proceed.",[BE]:"At least one signer with initiate permission is required to perform this action.",[_E]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[DD]:"Invalid account index in transaction message. The account index is out of bounds.",[aD]:"Address Tree supplied is not part of the whitelisted address trees.",[EE]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[UE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[GE]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[AD]:"Member key conversion failed. The provided key format is invalid.",[wE]:"Only delegated members are allowed for this transaction.",[bE]:"Unexpected number of accounts provided for this instruction.",[yE]:"User with Permanent Member role must have a delegated wallet.",[sE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[iE]:"The extracted public key has an invalid length or encoding.",[oE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[aE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[eD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[QE]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[ME]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[ID]:"Invalid source type for token transfer. The source account type is not supported.",[IE]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[SE]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[RE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[_D]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[vE]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[bD]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[xD]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[dE]:"The extracted WebAuthn signed message payload is malformed.",[ZE]:"An input string exceeds the maximum allowed character length.",[sD]:"This member is not registered under the provided domain configuration.",[mD]:"Member not found in settings. Cannot remove a member that does not exist.",[ED]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[kE]:"A required account is missing from the instruction context.",[gD]:"Compressed proof arguments are missing. Required for compressed account operations.",[yD]:"Missing compressed token account. Required for token transfer operations.",[vD]:"Missing destination token account. Required for token transfer operations.",[SD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[pD]:"Light CPI accounts are missing. Required for compressed account operations.",[WE]:"User mutation arguments are required when performing add or remove delegate operations.",[WD]:"Missing new authority account. Required for domain configuration updates.",[kD]:"Missing settings account. Required for delegate operations on compressed wallets.",[iD]:"Compressed settings data is missing. The settings account must be initialized with data.",[UD]:"Missing source token account. Required for token transfer operations.",[fD]:"Missing SPL interface PDA. Required for token transfer operations.",[XE]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[hD]:"User account address is missing. Required for secp256r1 signature verification.",[LD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[VE]:"No valid signer found in this transaction.",[DE]:"Only one administrator is allowed per wallet.",[TE]:"Only one permanent member is allowed per wallet.",[fE]:"Only one transaction manager is allowed per wallet.",[cD]:"The given origin index is not in the whitelisted origins.",[TD]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[lE]:"Permanent members cannot be removed from a wallet.",[YE]:"Writable CPI calls to protected accounts are not permitted.",[uE]:"The rpIdHash extracted from the signed message does not match the expected value.",[lD]:"Settings key mismatch. The provided settings key does not match the expected value.",[cE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[$E]:"The specified slot number was not found in the provided slot history.",[CD]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[hE]:"Too many members: a maximum of 4 members are supported.",[qE]:"This transaction has expired. It must be executed within 3 minutes of approval.",[JE]:"This transaction has not yet reached the required approval threshold.",[rD]:"Missing transports.",[FE]:"Only the transaction creator or rent payer may close this transaction buffer.",[RD]:"Unauthorized: Only the admin account is allowed to perform this action.",[HE]:"Member is not part of the expected signers for this transaction."});function TN(e){return process.env.NODE_ENV!=="production"?Au[e]:"Error message not available in production bundles."}function yN(e,n,r){return isProgramError(e,n,A,r)}async function RN({admin:e,addressTree:n}){return zc({payer:e,addressTree:n,remainingAccounts:[]})}var Me=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);}},Xe=class extends Me{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},Q=class extends Me{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},b=class extends Me{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},me=class extends Me{constructor(r,o,t){super(r,"NETWORK_ERROR",{statusCode:o,url:t});this.statusCode=o;this.url=t;}};var ae=class extends Me{constructor(r,o,t){super(r,"BUNDLE_ERROR",{bundleId:o,attempt:t});this.bundleId=o;this.attempt=t;}},br=class extends Me{constructor(r,o,t){super(`Operation "${r}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=o;this.lastError=t;}},_r=class extends Me{constructor(r,o,t){super(r,"PERMISSION_ERROR",{required:o,actual:t});this.required=o;this.actual=t;}};var jt={Ed25519:1,Secp256r1:2};var BD=m.looseObject({publicKey:m.string(),walletAddress:m.string(),settingsIndexWithAddress:m.object({index:m.union([m.number(),m.bigint()]),settingsAddressTreeIndex:m.number()}),username:m.string().optional(),profilePictureUrl:m.string().optional()}),gu=m.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),LN=m.object({transactionActionType:gu,transactionAddress:m.string(),transactionMessageBytes:m.array(m.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),ND=m.object({transactionActionType:gu,transactionAddress:m.string(),transactionMessageBytes:m.base64()}).strict(),wD=m.union([m.object({type:m.literal("Ephemeral"),secretKey:m.string()}),m.object({type:m.literal("Default"),publickey:m.string(),endpoint:m.string()})]).array().optional(),pu=m.object({phase:m.literal("start"),redirectOrigin:m.url(),signer:m.string().optional(),rid:m.string(),validTill:m.number(),data:m.object({type:m.literal("message"),payload:m.string(),trustedDeviceCheck:m.boolean()}).strict()}).strict(),mu=m.object({phase:m.literal("start"),redirectOrigin:m.url(),signer:m.string().optional(),rid:m.string(),validTill:m.number(),data:m.object({type:m.literal("transaction"),payload:ND,sendTx:m.boolean(),additionalSigners:wD}).strict()}).strict(),lu=m.object({startRequest:m.union([pu,mu]),authResponse:m.custom(),client:m.object({clientOrigin:m.url(),jws:m.string()}).strict(),device:m.object({jwk:m.base64(),jws:m.string()}).strict()}).strict(),Tu=m.object({signer:m.string(),userAddressTreeIndex:m.number().optional(),additionalInfo:m.looseObject({}).optional()}).strict(),HD=m.object({slotHash:m.string(),slotNumber:m.string(),originIndex:m.number(),crossOrigin:m.boolean()}).strict(),ON=m.object({phase:m.literal("complete"),data:m.object({type:m.literal("message"),payload:Tu.extend(lu.shape).extend({id:m.string().optional(),client:m.object({clientOrigin:m.url()}).strict()})}).strict()}).strict(),BN=m.object({phase:m.literal("complete"),data:m.object({type:m.literal("transaction"),payload:Tu.extend(lu.shape).extend(HD.shape).extend({client:m.object({clientOrigin:m.url()}).strict()})}).strict()}).strict(),NN=m.object({phase:m.literal("complete"),data:m.object({type:m.literal("transaction"),payload:m.object({startRequest:m.union([mu,pu]),txSig:m.string(),user:BD})}).strict()}).strict();var Re={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},ve=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(Re).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var No=33,Ue=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!==No)throw new Error(`Invalid public key length, expected ${No} 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===No)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()}},_=class extends Ue{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(n,r){super(n),this.verifyArgs=r.verifyArgs,this.domainConfig=r.domainConfig,this.authData=r.authData,this.signature=r.signature,this.originIndex=r.originIndex,this.crossOrigin=r.crossOrigin,this.clientAndDeviceHash=r.clientAndDeviceHash,this.authResponse=r.authResponse;}};function GD(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function zD(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var fu=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(GD())],["addressTableLookups",getArrayCodec(zD())]]);function Su(e){return fu.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 xu(e){let n=fu.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 Ho=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Iu="https://mainnet.block-engine.jito.wtf/api/v1",Cu="https://bundles.jito.wtf/api/v1/bundles/tip_floor",Eu="landed_tips_75th_percentile";var ne={};function Du(){if(!ne.solanaRpcEndpoint)throw new Xe("RPC endpoint");return ne.solanaRpcEndpoint}function ye(){if(!ne.lightProtocolRpc)throw new Xe("Light Protocol RPC");return ne.lightProtocolRpc}function Y(){if(!ne.solanaRpc)throw new Xe("Solana RPC");return ne.solanaRpc}function Pu(){if(!ne.sendAndConfirm)throw new Xe("Send and confirm transaction function");return ne.sendAndConfirm}function Vo(){return ne.jitoTipsConfig?ne.jitoTipsConfig:{blockEngineUrl:Iu,getJitoTipsUrl:Cu,priority:Eu}}function iw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:o}){ne.solanaRpcEndpoint=e,ne.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});ne.solanaRpc=t,ne.sendAndConfirm=c,ne.jitoTipsConfig=o??null;}async function qt(e,n){if(!e.ok)throw new me(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function Jt(e){try{return await e.json()}catch(n){throw new me(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function Ew(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Ur(n.get(-2))),y:BigInt("0x"+Ur(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function Dw(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 Pw(e){let{authenticatorData:n,clientDataJSON:r,signature:o}=e.authResponse.response,t=le(n),c=JSON.parse(getUtf8Decoder().decode(le(r))),i=_u(c),a=Uu(le(o)),s=await at({rpIdHash:t.subarray(0,32)});return new _(e.signer.toString(),{verifyArgs:{clientDataJson:le(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:Fo(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 Fo(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(n),...getBase64Encoder().encode(r)]))}function hw(e){return sha256(getUtf8Encoder().encode(canonicalize(e)))}function Mw(e){return Go(e.data.payload.authResponse)}function Rw(e,n,r,o){let t=Fo(n,r,o);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...t]))}async function bw(e,n,r,o,t,c){let i;if(!t||!c){let u=(await Y().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!u)throw new Q("Slot sysvar","Unable to fetch slot sysvar data");let g=getBase64Encoder().encode(u[0]);c=getU64Decoder().decode(g.subarray(0,8)).toString(),i=g.subarray(8,40),t=getBase58Decoder().decode(i);}else i=getBase58Encoder().encode(t);let a=sha256(typeof e.transactionMessageBytes=="string"?getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),s=Fo(n,r,o),d=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...a,...i,...s]));return {slotNumber:c,slotHash:t,challenge:d}}function Go(e){let n=kr(e);return sha256(n)}function _w(e){let n="";for(let o of e)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function le(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 vw(e,n){let{data:r}=await is(Y(),e),t=vu(r.origins,r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Q("Origin","Origin not found in domain config");return t}function Uw(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function kw(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}function Ur(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function $D(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 _u(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 vu(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 Uu(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 M=n&127;r+=M;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let o=e[r+1],t=r+2,c=e.slice(t,t+o);if(r=t+o,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,s=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=s[0]===0&&s.length>32?s.slice(1):s;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let p=p256.Point.CURVE().n>>1n,f=BigInt("0x"+Ur(u)),I=(f>p?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=$D(I);return new Uint8Array([...g,...x])}function kr(e){let n=le(e.response.clientDataJSON),r=le(e.response.authenticatorData),o=sha256(n);return new Uint8Array([...r,...o])}var eP=400,tP=429,Wu=500,rP=3,nP=500,oP=2,sP=3e4,Lu={backoffBase:oP,maxDelayMs:sP,retryOnRateLimit:true,initialDelayMs:nP,maxRetries:rP};function Ou(e){return e===tP}function Bu(e){return e>=Wu}function cP(e){return e>=eP&&e<Wu}function aP(e){return Ou(e)||Bu(e)}function iP(e,n,r){return e instanceof Response?Ou(e.status)?r.retryOnRateLimit??true:cP(e.status)?false:Bu(e.status):e instanceof TypeError||e instanceof Error}function dP(e,n,r,o){let t=n*Math.pow(r,e-1);return Math.min(t,o)}function uP(e){return new Promise(n=>setTimeout(n,e))}async function Xt(e,n){let{maxRetries:r,initialDelayMs:o,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...Lu,...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=dP(s,o,t,c);await uP(u);}throw new br(e.name||"retryWithBackoff",r,a)}async function it(e,n){let r={...Lu,...n},o=(c,i)=>iP(c,i,r);return Xt(async()=>{let c=await e();if(!c.ok&&aP(c.status))throw c;return c},{...r,shouldRetry:n?.shouldRetry??o})}function Nu(...e){return n=>e.some(r=>n instanceof r)}function wu(e,n,r,o){if(e<n||e>r)throw new b(`${o} must be between ${n} and ${r} (inclusive), got ${e}`)}function Hu(e,n){if(e<0)throw new b(`${n} must be non-negative, got ${e}`)}function Qt(e,n){if(e.length===0)throw new b(`${n} cannot be empty`)}function Vu(e,n){if(e.trim().length===0)throw new b(`${n} cannot be empty`)}async function Ko(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await Y().getLatestBlockhash().send()).value;return await Promise.all(e.map(async o=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(o.instructions,c),c=>setTransactionMessageFeePayerSigner(o.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>o.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,o.addressesByLookupTableAddress):c,async c=>{let i=Math.ceil((o.unitsConsumed??0)*1.1);return i>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:i})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function ju(e){let n=prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:8e5}),getSetComputeUnitPriceInstruction({microLamports:1e4})],e),r=getBase64EncodedWireTransaction(compileTransaction(n));if(r.length>1644)throw new b(`Transaction exceeds maximum length of ${1644} bytes (actual: ${r.length} bytes)`);let o=await Y().simulateTransaction(r,{encoding:"base64"}).send();if(o.value.err){if(o.value.logs){let c=["Transaction simulation failed:","",...o.value.logs].join(`
|
|
2
2
|
`);throw new Error(c)}let t=["Transaction simulation failed:","",o.value.err.toString()].join(`
|
|
3
|
-
`);throw new Error(t)}return o.value.unitsConsumed}async function qu(e,n){let o=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===AccountRole.WRITABLE||c.role===AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));o.sort((c,i)=>c-i);let t=Math.floor(o.length/2);return o.length%2===0?Math.round((o[t-1]+o[t])/2):o[t]}async function Ju(e,n){Qt(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new b(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await it(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})}));await qt(r,n);let o=await Jt(r);if(!o.result||o.error)throw new ae(`Unable to simulate bundle: ${JSON.stringify(o.error??o.result)}`);if(typeof o.result.value.summary!="string"&&o.result.value.summary.failed){let{TransactionFailure:t}=o.result.value.summary.failed.error,[,c]=t;throw new ae(`Simulation failed: ${c}`)}return o.result.value.transactionResults.map(t=>t.unitsConsumed)}function ie(e,n=0){let r=e instanceof _?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?kr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:o,signature:c,message:i,publicKey:a}}function We(e,n,r=[]){let o=[];for(let t of e)if(t instanceof _){let c=r.length,{domainConfig:i,verifyArgs:a,signature:s,publicKey:d,message:u}=ie(t,c);if(u&&s&&d&&r.push({message:u,signature:s,publicKey:d}),i){let p=n.addPreAccounts([{address:i,role:AccountRole.READONLY}]).get(i)?.index;a.__option==="Some"&&p!==void 0&&o.push({__kind:"Secp256r1",fields:[{domainConfigIndex:p,verifyArgs:a.value}]});}}else {let c=n.addPreAccounts([{address:t.address,role:AccountRole.READONLY_SIGNER,signer:t}]).get(t.address)?.index;c!==void 0&&o.push({__kind:"Ed25519",fields:[c]});}return {secp256r1VerifyInput:r,transactionSyncSigners:o}}function fe(e){if(e instanceof Ue)return {keyType:jt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:jt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function Fu(e){return e instanceof _?e.toString():e.address.toString()}function ue(e){let n=new Set,r=[];for(let t of e)n.has(Fu(t))||(r.push(t),n.add(Fu(t)));let o=r.filter(t=>t instanceof _);if(o.length>1)throw new b(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return r}function Yu({payer:e,tipAmount:n}){let r=Ho[Math.floor(Math.random()*Ho.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function Zu(e){return typeof e=="string"?e:e.toString()}function Xu(e){return e.toString()}async function jo(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 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 Or(e,n){let r=Zu(e);return jo(n,r,()=>ye().getCompressedAccount(e))}async function $e(e,n){let r=Xu(e);return jo(n,r,()=>Y().getAccountInfo(e,{encoding:"base64"}).send())}async function de(e,n){let r=(await Promise.all(e.map(o=>Or(o.address,n)))).filter(o=>o!==null).filter(o=>o.data!==null&&o.address!==null);if(r.length!==e.length)throw new Q("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 v(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 Se(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 re(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 b("Unable to parse state tree data");return c.map((u,p)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:s.packedTreeInfos[p],address:new Uint8Array(u.address),outputStateTreeIndex:s.outputTreeIndex}}))}async function xe(e,n,r,o,t){let c=null,i=null,a=null,s=new N;if(e){await s.addSystemAccounts();let{address:d}=await oe(n,r),u=(await de([{address:d,type:"Settings"}],t))[0];o?a={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:a=await Z([u],[]);let p=s.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!p)throw new b("Unable to parse state tree data");let m=j().decode(u.data?.data);c={accountMeta:{address:new Uint8Array(u.address),treeInfo:p.packedTreeInfos[0]},data:m},i={accountMeta:{address:new Uint8Array(u.address),treeInfo:p.packedTreeInfos[0],outputStateTreeIndex:p.outputTreeIndex},data:m};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:s,settingsMutArgs:i}}async function Z(e,n){return Xt(()=>ye().getValidityProofV0(e,n))}async function Ie(){return (await Br()).length-1}var qo;async function Br(){if(!qo){let{data:e}=await wc(Y(),await tA());qo=e.whitelistedAddressTrees;}return qo}function eA(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 er(e,n,r){let o=await UP(e,n,r);if(!o)throw new Q("User account");return o}async function UP(e,n,r){let{address:o}=await w(e,n),t=await Or(o,r);return t?.data?.data?X().decode(t.data.data):null}async function h2(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(fe(n)))}});else if(r)o.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(me(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 Nr(e,n,r){let o=await kP(e,n,r);if(!o)throw new Q("Settings account");return o}async function kP(e,n,r){try{let{address:o}=await oe(e,n),t=await Or(o,r);if(!t?.data?.data)throw new Q("Compressed settings account");let c=j().decode(t.data.data);if(c.data.__option==="None")throw new Q("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let o=await mo(Y(),e);return o.exists?{...o.data,isCompressed:false}:null}}async function M2(e,n,r){let o=await er(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(fe(e)))}}]}),Y().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(V().encode(fe(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=Sr().decode(getBase64Encoder().encode(a.account.data[0]));t.push({...s,isCompressed:false});}),t}else return await Promise.all(o.wallets.map(async t=>Nr(await Ce(t.index),t.settingsAddressTreeIndex,r)))}async function Yo(e){Hu(e,"index");let n=await Br();if(e>=n.length)throw new b(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function R2(e){let r=(await Br()).findIndex(o=>o.toString()===e);if(r===-1)throw new Q("Address tree",`Address ${e} not found in whitelist`);return r}async function oe(e,n=0){let r=await Yo(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 Yo(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("user"),e instanceof Ue?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 b("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function cA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function tA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function aA(e,n,r){wu(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 Ue?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return o}async function be(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function Ce(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function w2(e){let n=await Ce(e);return await be(n)}async function H2(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function Y2(e){Qt(e,"bundle");let n=await Ko(e,true),r=await Ju(n.map(getBase64EncodedWireTransaction),Du()),o=await Ko(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await BP(o.map(getBase64EncodedWireTransaction))}async function BP(e,n=Vo(),r){Qt(e,"serializedTransactions");let{blockEngineUrl:o}=n,t=`${o}/bundles`,c=await it(()=>fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})}),r);await qt(c,t);let i=await Jt(c);if(i.error)throw new ae(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new ae("No bundle ID returned from Jito");return i.result}async function Z2(e,n=30,r=3e3,o=Vo()){Vu(e,"bundleId");let{blockEngineUrl:t}=o,c=`${t}/getBundleStatuses`;return Xt(async()=>{let i=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await qt(i,c);let a=await Jt(i);if(a.error)throw new ae(`Error getting bundle status: ${JSON.stringify(a.error,null,2)}`,e);if(!a.result?.value?.length)throw new ae("Bundle not yet confirmed",e);let s=a.result.value[0];if(s.confirmation_status==="confirmed"||s.confirmation_status==="finalized"){let d=s.transactions[s.transactions.length-1];if(!d)throw new ae("No transactions in confirmed bundle",e);return d}throw new ae(`Bundle status: ${s.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:Nu(ae,Te)})}async function n8({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=await Y().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(e,c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(o.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([ju(c),qu(Y(),c.instructions.flatMap(d=>d.accounts??[]))]),s=Math.ceil((Number(i)??0)*1.1);return prependTransactionMessageInstructions([...s>2e5?[getSetComputeUnitLimitInstruction({units:s})]:[],...a>0?[getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await Pu()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function f8(e,n){if(n.threshold>1)throw new b("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(s=>AA(s.pubkey)===e);if(!r)throw new Q("Member",`Signer ${e} not found in settings`);let{permissions:o}=r;if(!o)throw new Q("Permissions","No permissions found for the current member");let t=ve.has(o,Re.InitiateTransaction),c=ve.has(o,Re.VoteTransaction),i=ve.has(o,Re.ExecuteTransaction);if(t&&c&&i)return {};if(!c||!i)throw new _r("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 Q("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(AA(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function S8({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:o,cachedAccounts:t}){if(!n)return null;let c=await er(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Q("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return eh(n,c.transactionManagerUrl.value,e,o)}function eh(e,n,r,o){return {address:e,async signTransactions(t){let c=await it(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:e.toString(),payload:t.map(a=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(a)),transactionMessageBytes:o?getBase64Decoder().decode(o):void 0,authResponses:r}))})}));if(!c.ok)throw new Te(`Transaction manager request failed: ${c.statusText}`,c.status,n);let i=await c.json();if("error"in i)throw new Te(`Transaction manager error: ${i.error}`,c.status,n);return i.signatures.map(a=>({[e]:getBase58Encoder().encode(a)}))}}}function AA(e){return e.keyType===jt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function x8(e){let n=e.map(c=>Ve().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 I8(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=Fe().read(e,n);t[c]=i[0],n=i[1];}if(n!==e.length)throw new b(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function B8({payer:e,rpId:n,origins:r,authority:o}){let t=await at({rpId:n}),c=new N;await c.addSystemAccounts();let i=await Ie(),{address:a,addressTree:s}=await w(o.address,i),d=[{address:a,tree:s,queue:s,type:"User"}],u=await Z([],d),p=(await Se(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:m,systemOffset:f}=c.toAccountMetas(),S=v(u,f);return await Ia({origins:r,authorityCreationArgs:p,authority:o,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:m})}async function J8({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 oe(r.settings,r.settingsAddressTreeIndex)).address,type:"Settings"}));let a=i.length?await de(i,t):[],s=await Ie(),{address:d,addressTree:u}=await w(r.member,s),p=[{address:d,type:"User",tree:u,queue:u}],m=await Z(a,p),f=null,S=null,I=a.filter(k=>k.type==="Settings"),x=a.filter(k=>k.type==="User");if(x.length&&(S=re(c,m.treeInfos.slice(0,1),m.leafIndices.slice(0,1),m.rootIndices.slice(0,1),m.proveByIndices.slice(0,1),x,X())[0]),I.length){let k=x.length,ee=k+1;f=re(c,m.treeInfos.slice(k,ee),m.leafIndices.slice(k,ee),m.rootIndices.slice(k,ee),m.proveByIndices.slice(k,ee),I,j())[0];}let M=(await Se(c,m.treeInfos.slice(a.length),m.roots.slice(a.length),m.rootIndices.slice(a.length),p))[0],{remainingAccounts:R,systemOffset:U}=c.toAccountMetas(),W=v(m,U);return await ha({payer:n,authority:e,compressedProofArgs:W,member:Ut().decode(r.member.toBuffer()),credentialId:me(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:f?some({settingsMutArgs:f,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:M,domainConfig:o,remainingAccounts:R})}async function Q8({payer:e}){let n=await cA();return _a({payer:e,globalCounter:n})}async function rH({admin:e,rpId:n,disable:r}){let o=await at({rpId:n});return ja({domainConfig:o,admin:e,disable:r,remainingAccounts:[]})}function rh(e,n,r,o){let t=nh(e,n),c=oh(e,n)&&r!==o;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function nh(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 oh(e,n){return n<e.header.numSignerAccounts}async function wr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:o}){let t=xu(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),Y()):{}),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:rh(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 ut=33,At=64,$o=14,Ah=2,gh=address("Secp256r1SigVerify1111111111111111111111111");function ph(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function mh(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function yA(){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=mh();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=$o;let i=[];for(let a=0;a<r;a++){let s=fixDecoderSize(getBytesDecoder(),ut).decode(e,n);n+=ut;let d=fixDecoderSize(getBytesDecoder(),At).decode(e,n);n+=At;let u=t[a].messageDataSize,p=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:s,signature:d,message:p});}return [{numSignatures:r,padding:o,offsets:t,payload:i},n]}})}function fA(){return createEncoder({getSizeFromValue:e=>{let n=$o*e.offsets.length,r=e.payload.reduce((o,t)=>o+ut+At+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=ph();for(let t of e.offsets)r=o.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),ut).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),At).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function lH(){return combineCodec(fA(),yA())}function H(e,n){let r=e.length,o=Ah+r*$o,t=[];for(let s=0;s<r;s++){let{message:d}=e[s],u=o,p=u+ut,m=p+At;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:p,signatureInstructionIndex:65535,messageDataOffset:m,messageDataSize:d.length,messageInstructionIndex:65535}),o+=ut+At+d.length;}let c=n?.programAddress??gh,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:fA().encode(i)}}function TH(e){return {programAddress:e.programAddress,accounts:{},data:yA().decode(e.data)}}async function SA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:o,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:s=false}){let d=await be(e),{accountMetas:u,addressLookupTableAccounts:p}=await wr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),m=[];return c.length>0&&m.push(H(c)),m.push(s?Qd({transactionBuffer:n,payer:o.address,remainingAccounts:u,settingsKey:e}):jd({transactionBuffer:n,payer:o.address,settings:e})),a&&m.push(Yu({payer:o,tipAmount:a})),{instructions:m,addressLookupTableAccounts:p}}async function xA({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,additionalSigners:o,signers:t,payer:c,addressesByLookupTableAddress:i,secp256r1VerifyInput:a=[],compressed:s=false,simulateProof:d=false,cachedAccounts:u}){let p=ue(t),m=await be(e),[{accountMetas:f,addressLookupTableAccounts:S,transactionMessage:I},{settingsMutArgs:x,proof:M,packedAccounts:R}]=await Promise.all([wr({transactionMessageBytes:r,walletAddress:m,additionalSigners:o,addressesByLookupTableAddress:i}),xe(s,e,n,d,u)]);R.addPreAccounts(f);let{secp256r1VerifyInput:U,transactionSyncSigners:W}=We(p,R,a),{remainingAccounts:k,systemOffset:ee}=R.toAccountMetas(),se=[];U.length>0&&se.push(H(U));let Ee=lh(I,f);if(s){if(!c||!x)throw new b("Payer not found or proof args are missing for executeTransactionSync.");let De=v(M,ee);se.push(uu({signers:W,transactionMessage:Ee,settingsMutArgs:x,compressedProofArgs:De,payer:c,remainingAccounts:k}));}else se.push(ou({signers:W,settings:e,transactionMessage:Ee,remainingAccounts:k}));return {instructions:se,addressLookupTableAccounts:S}}function lh(e,n){if(e.version==="legacy")throw new b("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 KH({settings:e,settingsAddressTreeIndex:n,destination:r,signers:o,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let s=ue(o),d=await be(e),[{packedAccounts:u,proof:p,settingsMutArgs:m},{value:f}]=await Promise.all([xe(a,e,n,false,t),$e(d,t)]);if((f?.lamports??0)<BigInt(c))throw new b("Insufficient balance for native transfer.");let{secp256r1VerifyInput:S,transactionSyncSigners:I}=We(s,u),{remainingAccounts:x,systemOffset:M}=u.toAccountMetas(),R=[];if(S.length>0&&R.push(H(S)),a){if(!i||!m)throw new Error("Payer not found or proof args is missing.");let U=v(p,M);R.push(xi({amount:c,settingsMutArgs:m,compressedProofArgs:U,payer:i,signers:I,source:d,destination:r,remainingAccounts:x}));}else R.push(mi({amount:c,signers:I,source:d,destination:r,settings:e,remainingAccounts:x}));return R}var Dh=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),Ph=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Vr=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function i5({settings:e,settingsAddressTreeIndex:n,destination:r,mint:o,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:s,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false,useDestinationSplAccount:p=false}){let m=ue(t),f=await be(e),S=await hh(o,r,f,s,d),[I,x]=await Promise.all([Mh(S,c),Lh(u,e,n,c)]),M=Rh(I,S,i,p),[R,U]=await Promise.all([Wh(f,o,M.splBalance,M.cTokenBalance,BigInt(i),u),kh(M.requireSplInterface,S.splInterfacePda,c)]),W=BigInt(R.reduce((Oe,ns)=>Oe+(ns.parsed.amount.toNumber()??0),0));if(M.splBalance+M.cTokenBalance+W<BigInt(i))throw new b("Insufficient balance for token transfer.");let k=new N;U&&k.addPreAccounts([{address:o,role:AccountRole.WRITABLE}]);let ee=bh(R,x),{proof:se,settingsMutArgs:Ee}=await _h(k,ee,x),De=vh(R,se,k),{secp256r1VerifyInput:nt,transactionSyncSigners:Le}=We(m,k),{remainingAccounts:ge,systemOffset:ot}=k.toAccountMetas(),Kr=v(se,ot),y=[];nt.length>0&&y.push(H(nt));let rr=Uh({amount:i,transactionSyncSigners:Le,walletAddress:f,destination:r,addresses:S,balances:M,mint:o,tokenProgram:s,remainingAccounts:ge,payer:a,sourceCompressedTokenAccounts:De,compressedProofArgs:Kr,splInterfacePdaArgs:d});if(u){if(!Ee)throw new Error("Payer not found or proof args is missing.");y.push(Wi({...rr,settingsMutArgs:Ee}));}else y.push(Ri({...rr,settings:e}));return y}async function hh(e,n,r,o,t){let c=m=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(m),getAddressEncoder().encode(Vr),getAddressEncoder().encode(e)],programAddress:Vr}),i=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(e)];t.restricted&&i.push(getUtf8Encoder().encode("restricted")),t.index>0&&i.push(getU8Encoder().encode(t.index));let[a,[s],d,[u],[p]]=await Promise.all([getAssociatedTokenAccountAddress(e,r,o),c(r),getAssociatedTokenAccountAddress(e,n,o),c(n),getProgramDerivedAddress({seeds:i,programAddress:Vr})]);return {sourceSplAta:a,sourceCtokenAta:s,destinationSplAta:d,destinationCTokenAta:u,splInterfacePda:p}}async function Mh(e,n){let[r,o,t]=await Promise.all([$e(e.destinationSplAta,n),$e(e.sourceSplAta,n),$e(e.sourceCtokenAta,n)]);return {destinationSplAtaInfo:r,sourceSplAtaInfo:o,sourceCTokenAtaInfo:t}}function Rh(e,n,r,o){let t=!!e.destinationSplAtaInfo.value,c=!!e.sourceSplAtaInfo.value,i=!!e.sourceCTokenAtaInfo.value,a=c?getTokenDecoder().decode(getBase64Encoder().encode(e.sourceSplAtaInfo.value.data[0])).amount:BigInt(0),s=BigInt(i?Oh(getBase64Encoder().encode(e.sourceCTokenAtaInfo.value.data[0]))?.amount??0:0),d=t||o?n.destinationSplAta:void 0,u=t||o?void 0:n.destinationCTokenAta,p=c&&(a+s<BigInt(r)||s>BigInt(0)||!t)||!c&&t;return {splBalance:a,cTokenBalance:s,destinationSplTokenAccount:d,destinationCtokenTokenAccount:u,requireSplInterface:p,requireRentSponsor:a+s<BigInt(r)||!t}}function bh(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 _h(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=re(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 vh(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:eA(o.compressedAccount.data?.discriminator),tlv:o.parsed.tlv?some(getArrayDecoder(Pt()).decode(o.parsed.tlv)):none(),state:o.parsed.state}))}function Uh({amount:e,transactionSyncSigners:n,walletAddress:r,destination:o,addresses:t,balances:c,mint:i,tokenProgram:a,remainingAccounts:s,payer:d,sourceCompressedTokenAccounts:u,compressedProofArgs:p,splInterfacePdaArgs:m}){return {amount:e,signers:n,source:r,destination:o,sourceCtokenTokenAccount:t.sourceCtokenAta,sourceSplTokenAccount:t.sourceSplAta,destinationCtokenTokenAccount:c.destinationCtokenTokenAccount,destinationSplTokenAccount:c.destinationSplTokenAccount,mint:i,tokenProgram:a,remainingAccounts:s,payer:d,sourceCompressedTokenAccounts:u,compressedProofArgs:p,compressibleConfig:Dh,splInterfacePda:c.requireSplInterface?t.splInterfacePda:void 0,rentSponsor:c.requireRentSponsor?Ph:void 0,splInterfacePdaArgs:c.requireSplInterface?some(m):none()}}async function kh(e,n,r){if(!e)return false;let{value:o}=await $e(n,r);return !o}async function Wh(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()===Vr.toString()&&!u.parsed.amount.isZero());return s.length===0?[]:selectMinCompressedTokenAccountsForDecompression(s,new fh(i),c?3:4,{treeType:TreeType.StateV2}).selectedAccounts}async function Lh(e,n,r,o){if(!e)return null;let{address:t}=await oe(n,r);return (await de([{address:t,type:"Settings"}],o))[0]??null}function Oh(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 x5({signers:e,payer:n,changeConfigArgs:r}){let{settings:o,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:s}=r,d=ue(e),u=[],p=[];for(let x of d)if(x instanceof _){let M=p.length,{domainConfig:R,verifyArgs:U,signature:W,publicKey:k,message:ee}=ie(x,M);if(ee&&W&&k&&p.push({message:ee,signature:W,publicKey:k}),R){let se=i.addPreAccounts([{address:R,role:AccountRole.READONLY}]).get(R)?.index;U.__option==="Some"&&se!==void 0&&u.push({__kind:"Secp256r1",fields:[{domainConfigIndex:se,verifyArgs:U.value}]});}}else {let M=i.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]).get(x.address)?.index;M!==void 0&&u.push({__kind:"Ed25519",fields:[M]});}let{remainingAccounts:m,systemOffset:f}=i.toAccountMetas(),S=v(a,f),I=[];if(p.length>0&&I.push(H(p)),c){if(!s)throw new b("Proof args are missing for compressed changeConfig.");I.push(ca({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:s,remainingAccounts:m,signers:u}));}else I.push(Qc({settings:o,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:m,signers:u}));return I}async function M5({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 Ie(),t=await Promise.all(e.map(async u=>{let{address:p,addressTree:m}=await w(u.member.address,o);return {address:p,tree:m,queue:m,type:"User"}})),c=await Z([],t),i=await Se(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:s}=r.toAccountMetas(),d=v(c,s);return await Wa({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,p)=>({member:u.member.address,role:u.role,userCreationArgs:i[p],transactionManagerUrl:u.role===0?u.transactionManagerUrl:null})),remainingAccounts:a})}async function W5({index:e,payer:n,initialMember:r,userAddressTreeIndex:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[],a=[];a.push(...await de([{address:(await w(r.address,o)).address,type:"User"}],t));let s=await Ie(),{address:d,addressTree:u}=await oe(await Ce(e),s);i.push({address:d,queue:u,tree:u,type:"Settings"});let p=a.length,m=await Z(a,i),f=re(c,m.treeInfos.slice(0,p),m.leafIndices.slice(0,p),m.rootIndices.slice(0,p),m.proveByIndices.slice(0,p),a.filter(U=>U.type==="User"),X())[0],I=(await Se(c,m.treeInfos.slice(p),m.roots.slice(p),m.rootIndices.slice(p),i)).find(U=>U.type==="Settings")??null,{remainingAccounts:x,systemOffset:M}=c.toAccountMetas(),R=v(m,M);if(!I)throw new Error("Settings creation args is missing.");return await Aa({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:R,...I,remainingAccounts:x})}async function z5({settings:e,settingsAddressTreeIndex:n,payer:r,signers:o,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await xe(true,e,n,false,t);if(!a)throw new b("Proof args are missing for settings account.");let s=ue(o),{secp256r1VerifyInput:d,transactionSyncSigners:u}=We(s,c),{remainingAccounts:p,systemOffset:m}=c.toAccountMetas(),f=v(i,m),S=[];return d.length>0&&S.push(H(d)),S.push(Ha({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:f,signers:u,remainingAccounts:p})),S}async function X5({authority:e,domainConfig:n,newAuthority:r,newOrigins:o}){let t=null,c=[];if(r){let i=new N;await i.addSystemAccounts();let a=await Ie(),{address:s,addressTree:d}=await w(r.address,a),u=[{address:s,tree:d,queue:d,type:"User"}],p=await Z([],u),m=(await Se(i,p.treeInfos,p.roots,p.rootIndices,u))[0],f=i.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:v(p,f.systemOffset),authorityCreationArgs:m};}return Qa({domainConfig:n,authority:e,newOrigins:o?some(o):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function n6({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let o=new N;await o.addSystemAccounts();let t=await de([{address:(await w(e.address,n)).address,type:"User"}]),c=await Z(t,[]),i=re(o,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:a,systemOffset:s}=o.toAccountMetas(),d=v(c,s);return oi({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function p6({payer:e,user:n,userAddressTreeIndex:r,newDelegate:o,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:s,publicKey:d}=ie(n),u=[];a&&s&&d&&u.push({message:a,signature:s,publicKey:d});let p=await er(n instanceof _?n:n.address,r,t),m=[];m.push({address:(await w(n instanceof _?n:n.address,r)).address,type:"User"});let f,S=null,I,x=null,M=p.wallets.find(ge=>ge.isDelegate);if(M){let ge=await Ce(M.index);(await Nr(ge,M.settingsAddressTreeIndex,t)).isCompressed?(m.push({address:(await oe(ge,M.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:m.length-1,end:m.length}):f=await Ce(M.index);}if(o){let ge=await Ce(o.index);(await Nr(ge,o.settingsAddressTreeIndex,t)).isCompressed?(m.push({address:(await oe(ge,o.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:m.length-1,end:m.length}):I=await Ce(o.index);}let R=new N;await R.addSystemAccounts();let U=await de(m,t),W=await Z(U,[]),k=re(R,W.treeInfos.slice(0,1),W.leafIndices.slice(0,1),W.rootIndices.slice(0,1),W.proveByIndices.slice(0,1),U.slice(0,1),X())[0],ee=S?some(re(R,W.treeInfos.slice(S.start,S.end),W.leafIndices.slice(S.start,S.end),W.rootIndices.slice(S.start,S.end),W.proveByIndices.slice(S.start,S.end),U.slice(S.start,S.end),j())[0]):none(),se=x?some(re(R,W.treeInfos.slice(x.start,x.end),W.leafIndices.slice(x.start,x.end),W.rootIndices.slice(x.start,x.end),W.proveByIndices.slice(x.start,x.end),U.slice(x.start,x.end),j())[0]):none(),{remainingAccounts:Ee,systemOffset:De}=R.toAccountMetas(),nt=v(W,De),Le=[];return u.length>0&&Le.push(H(u)),Le.push(ui({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:o?some(o):none(),feePayer:e,signer:n instanceof _?void 0:n,oldSettings:f,oldSettingsMutArgs:ee,newSettings:I,newSettingsMutArgs:se,compressedProofArgs:nt,userMutArgs:k,remainingAccounts:Ee})),Le}async function _6({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:o,compressed:t=false,cachedAccounts:c}){let i=await kc(Y(),r),a=i.data.multiWalletSettings,{packedAccounts:s,proof:d,settingsMutArgs:u}=await xe(t,a,e,false,c),{remainingAccounts:p,systemOffset:m}=s.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:I,signature:x,publicKey:M}=ie(n),R=[];if(I&&x&&M&&R.push(H([{message:I,signature:x,publicKey:M}])),t){if(!o||!u)throw new b("Payer not found or proof args are missing for closing buffer.");let U=v(d,m);R.push(ji({transactionBuffer:r,domainConfig:f,closer:n instanceof _?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:u,payer:o,compressedProofArgs:U,remainingAccounts:p}));}else R.push(Hi({transactionBuffer:r,domainConfig:f,closer:n instanceof _?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return R}function bA({payer:e,creator:n,bufferIndex:r,settings:o,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,compressedArgs:d,expectedSigners:u}){let{domainConfig:p,verifyArgs:m,message:f,signature:S,publicKey:I}=ie(n),x=[];if(f&&S&&I&&x.push(H([{message:f,signature:S,publicKey:I}])),d){let{settingsReadonlyArgs:M,compressedProofArgs:R,remainingAccounts:U}=d;x.push(od({transactionBuffer:t,payer:e,secp256r1VerifyArgs:m,creator:n instanceof _?void 0:n,domainConfig:p,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},settingsReadonlyArgs:M,compressedProofArgs:R,remainingAccounts:U}));}else x.push(Qi({settings:o,transactionBuffer:t,payer:e,secp256r1VerifyArgs:m,creator:n instanceof _?void 0:n,domainConfig:p,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},remainingAccounts:[]}));return x}function _A({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:s}=ie(e),d=[];return a&&i&&s&&d.push(H([{message:a,signature:i,publicKey:s}])),o?d.push(Td({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof _?void 0:e,settingsMutArgs:o.settingsMutArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(ud({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof _?void 0:e,remainingAccounts:[]})),d}function vA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:o=false}){return o?Rd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Cd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function UA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:s}=ie(n),d=[];return s&&i&&a&&d.push(H([{message:s,signature:i,publicKey:a}])),o?d.push(Hd({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof _?void 0:n,settingsReadonlyArgs:o.settingsReadonlyArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(Wd({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof _?void 0:n,remainingAccounts:[]})),d}async function SV({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:o,compressed:t=false}){let c=await Hh(r),i=new N,a=null,s=null,d=[];if(c.length||t){let p=await Vh({packedAccounts:i,userAccounts:c,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:o});a=p.proof,s=p.settingsMutArgs??null,d=p.userMutArgs??[];}return {configActions:await Fh({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:s,packedAccounts:i,compressed:t}}async function Hh(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 Vh({packedAccounts:e,userAccounts:n,compressed:r,settings:o,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let f=(await oe(o,t)).address;i.push({address:f,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await de(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let s=await Z(a,[]),d=[],u=[];for(let f of a)f.type==="Settings"?d.push(f):f.type==="User"&&u.push(f);let p,m=[];if(r&&s&&(p=re(e,s.treeInfos.slice(0,1),s.leafIndices.slice(0,1),s.rootIndices.slice(0,1),s.proveByIndices.slice(0,1),d,j())[0]),u.length&&s){let f=r?1:0;m=re(e,s.treeInfos.slice(f),s.leafIndices.slice(f),s.rootIndices.slice(f),s.proveByIndices.slice(f),u,X());}return {proof:s,settingsMutArgs:p,userMutArgs:m}}async function Fh({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(Kh({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 zh({pubkey:c.member,userMutArgs:a})})));r.push({__kind:o.type,fields:[t]});break}case "EditPermissions":{let t=o.members.map(c=>Gh({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 Gh({pubkey:e,permissionArgs:n}){return {memberKey:fe(e),permissions:OA(n)}}function zh({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:fe(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function Kh({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:fe(e),permissions:OA(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function OA(e){let n=[];return e.initiate&&n.push(Re.InitiateTransaction),e.vote&&n.push(Re.VoteTransaction),e.execute&&n.push(Re.ExecuteTransaction),ve.fromPermissions(n)}async function MV({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s,compressed:d=false,additionalVoters:u=[],additionalSigners:p=[],chunkSize:m=Math.ceil(o.length/2),cachedAccounts:f}){let S=Math.floor(Math.random()*255),I=await aA(n,t instanceof _?t:t.address,S),x=[],M=[];for(let te=0;te<o.length;te+=m){let os=o.subarray(te,te+m);x.push(os),M.push(sha256(os));}let R=sha256(o),{settingsReadonlyArgs:U,settingsMutArgs:W,proof:k,packedAccounts:ee}=await xe(d,n,r,false,f),{remainingAccounts:se,systemOffset:Ee}=ee.toAccountMetas(),De=k&&U&&W?{settingsReadonlyArgs:U,settingsMutArgs:W,compressedProofArgs:v(k,Ee),remainingAccounts:se,payer:e}:null,nt=ue([t,...c?[c]:[],...u]).map(te=>({memberKey:fe(te),messageHash:te instanceof _?Go(te.authResponse):null})),Le=bA({finalBufferHash:R,finalBufferSize:o.length,bufferIndex:S,payer:e,transactionBufferAddress:I,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:M,compressedArgs:De,expectedSigners:nt}),ge=x.map(te=>vA({transactionMessageBytes:te,transactionBufferAddress:I,settings:n,compressed:d})),ot=u.map(te=>UA({voter:te,transactionBufferAddress:I,settings:n,compressedArgs:De})),Kr=_A({compressedArgs:De,settings:n,executor:c,transactionBufferAddress:I}),{instructions:y,addressLookupTableAccounts:rr}=await SA({compressed:d,settings:n,transactionMessageBytes:o,transactionBufferAddress:I,payer:e,additionalSigners:p,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s}),Oe=te=>({payer:e,instructions:te,addressesByLookupTableAddress:rr});return [Oe(Le),...ge.map(te=>Oe([te])),...ot.length?[Oe(ot.flat())]:[],Oe(Kr),Oe(y)]}var Gr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let o=new Map,t=i=>{let a=o.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},o.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let s=t(a.address);s.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,o)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),o=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),c=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+o.length,numReadonlySignerAccounts:o.length,numReadonlyNonSignerAccounts:c.length};if(r.length===0)throw new Error("Expected at least one writable signer key");let[a]=r[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let s=[...r.map(([d])=>d),...o.map(([d])=>d),...t.map(([d])=>d),...c.map(([d])=>d)];return [i,s]}extractTableLookup(n){let[r,o]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(n,r){let o=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,s=n.findIndex(d=>d===a);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),t.push(a),this.keyMetaMap.delete(c);}}return [o,t]}};var zr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let o=new Map;this.keySegments().flat().forEach((c,i)=>{o.set(c,i);});let t=c=>{let i=o.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function NA({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:o}){let t=Gr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(o??{});for(let m of a){let f=t.extractTableLookup(m);if(f!==void 0){let{addressTableLookup:S,drainedKeys:I}=f;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),i.writable.push(...I.writable),i.readonly.push(...I.readonly);}}let[s,d]=t.getMessageComponents(),p=new zr(d,i).compileInstructions(r);return {version:0,header:s,instructions:p,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function HV({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=NA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(Su(o))}async function KV({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,signers:t,additionalSigners:c,secp256r1VerifyInput:i,addressesByLookupTableAddress:a,cachedAccounts:s,compressed:d=false,simulateProof:u=false}){let{instructions:p,addressLookupTableAccounts:m}=await xA({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,additionalSigners:c,transactionMessageBytes:o,secp256r1VerifyInput:i,compressed:d,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:s});return {payer:e,instructions:p,addressesByLookupTableAddress:m}}export{Fc as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,jr as AccountState,wD as AdditionalSignersSchema,lu as AuthenticationContextSchema,Tu as BaseResponseSchema,na as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,Yc as CHANGE_CONFIG_DISCRIMINATOR,da as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,Sa as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Da as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Ra as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Ua as CREATE_USER_ACCOUNTS_DISCRIMINATOR,LN as CompleteMessageRequestSchema,BN as CompleteSendTransactionRequestSchema,ON as CompleteTransactionRequestSchema,Ba as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Ga as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,ss as DOMAIN_CONFIG_DISCRIMINATOR,Za as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,ti as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,ai as EDIT_USER_DELEGATE_DISCRIMINATOR,As as GLOBAL_COUNTER_DISCRIMINATOR,jt as KeyType,LE as MULTI_WALLET_ERROR__ALREADY_DELEGATED,AE as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,MD as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,tD as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,nD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,oD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,PD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,OD as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,mE as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,pE as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,PE as MULTI_WALLET_ERROR__EMPTY_MEMBERS,uD as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,CE as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,gE as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,xE as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,zE as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,KE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,jE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,dD as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,NE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,OE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,BE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,_E as MULTI_WALLET_ERROR__INVALID_ACCOUNT,DD as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,aD as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,EE as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,UE as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,GE as MULTI_WALLET_ERROR__INVALID_BUFFER,AD as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,wE as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,bE as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,yE as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,sE as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,iE as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,oE as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,aE as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,eD as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,QE as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,ME as MULTI_WALLET_ERROR__INVALID_THRESHOLD,ID as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,IE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,SE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,RE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,_D as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,vE as MULTI_WALLET_ERROR__INVALID_USER_ROLE,bD as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,xD as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,dE as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,ZE as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,sD as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,mD as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,ED as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,kE as MULTI_WALLET_ERROR__MISSING_ACCOUNT,gD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,yD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,vD as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,SD as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,pD as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,WE as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,WD as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,kD as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,iD as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,UD as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,fD as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,XE as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,hD as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,LD as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,VE as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,DE as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,TE as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,fE as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,cD as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,TD as MULTI_WALLET_ERROR__PAYER_MISMATCH,lE as MULTI_WALLET_ERROR__PERMANENT_MEMBER,YE as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,uE as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,lD as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,cE as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,$E as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,CD as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,hE as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,qE as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,JE as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,rD as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,FE as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,RD as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,HE as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,tE as MultiWalletAccount,rE as MultiWalletInstruction,yi as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,gi as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Re as Permission,ve as Permissions,Dc as SETTINGS_DISCRIMINATOR,Ue as Secp256r1Key,_ as SignedSecp256r1Key,pu as StartMessageRequestSchema,mu as StartTransactionRequestSchema,Ui as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,hi as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Gi as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,Bi as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,td as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,Yi as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,_c as TRANSACTION_BUFFER_DISCRIMINATOR,pd as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,ad as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Pd as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Sd as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Bd as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,vd as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,Yd as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,Gd as TRANSACTION_EXECUTE_DISCRIMINATOR,au as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,tu as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,gu as TransactionActionTypeSchema,HD as TransactionDetailsSchema,WN as TransactionPayloadSchema,ND as TransactionPayloadWithBase64MessageBytesSchema,po as Transports,BD as UserInfoSchema,_e as UserRole,Oc as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,MN as addWhitelistedAddressTrees,me as base64URLStringToBuffer,bw as bufferToBase64URLString,x5 as changeConfig,_6 as closeTransactionBuffer,rR as configAction,Uw as convertBase64StringToJWK,vw as convertJWKToBase64String,AA as convertMemberKeyToString,Ew as convertPubkeyCompressedToCose,Cw as convertPubkeyCoseToCompressed,hw as createClientAuthorizationCompleteRequestChallenge,Pw as createClientAuthorizationStartRequestChallenge,B8 as createDomainConfig,J8 as createDomainUserAccounts,Q8 as createGlobalCounter,Mw as createMessageChallenge,bA as createTransactionBuffer,Rw as createTransactionChallenge,eh as createTransactionManagerSigner,M5 as createUserAccounts,W5 as createWallet,as as decodeDomainConfig,ps as decodeGlobalCounter,Pc as decodeSettings,Uc as decodeTransactionBuffer,Nc as decodeWhitelistedAddressTree,z5 as decompressSettingsAccount,I8 as deserializeConfigActions,rH as disableDomainConfig,X5 as editDomainConfig,n6 as editTransactionManagerUrl,p6 as editUserDelegate,SA as executeTransaction,_A as executeTransactionBuffer,xA as executeTransactionSync,vA as extendTransactionBuffer,xR as extensionStruct,Zh as fetchAllDomainConfig,nM as fetchAllGlobalCounter,QA as fetchAllMaybeDomainConfig,mg as fetchAllMaybeGlobalCounter,c1 as fetchAllMaybeSettings,h1 as fetchAllMaybeTransactionBuffer,j1 as fetchAllMaybeWhitelistedAddressTree,jv as fetchAllSettings,M2 as fetchAllSettingsAccountByMember,Qv as fetchAllTransactionBuffer,nU as fetchAllWhitelistedAddressTree,is as fetchDomainConfig,rM as fetchGlobalCounter,XA as fetchMaybeDomainConfig,pg as fetchMaybeGlobalCounter,mo as fetchMaybeSettings,kP as fetchMaybeSettingsAccountData,P1 as fetchMaybeTransactionBuffer,UP as fetchMaybeUserAccountData,K1 as fetchMaybeWhitelistedAddressTree,Kv as fetchSettings,Nr as fetchSettingsAccountData,kc as fetchTransactionBuffer,h2 as fetchUserAccountByFilters,er as fetchUserAccountData,wc as fetchWhitelistedAddressTree,aM as getAccountStateCodec,Jr as getAccountStateDecoder,qr as getAccountStateEncoder,mM as getAddMemberArgsCodec,Qr as getAddMemberArgsDecoder,Xr as getAddMemberArgsEncoder,xU as getAddWhitelistedAddressTreesDiscriminatorBytes,CU as getAddWhitelistedAddressTreesInstruction,zc as getAddWhitelistedAddressTreesInstructionAsync,IU as getAddWhitelistedAddressTreesInstructionDataCodec,Gc as getAddWhitelistedAddressTreesInstructionDataDecoder,Co as getAddWhitelistedAddressTreesInstructionDataEncoder,uM as getAdditionalMetadataCodec,Zr as getAdditionalMetadataDecoder,Yr as getAdditionalMetadataEncoder,wU as getChangeConfigCompressedDiscriminatorBytes,ca as getChangeConfigCompressedInstruction,HU as getChangeConfigCompressedInstructionDataCodec,sa as getChangeConfigCompressedInstructionDataDecoder,oa as getChangeConfigCompressedInstructionDataEncoder,_U as getChangeConfigDiscriminatorBytes,Qc as getChangeConfigInstruction,vU as getChangeConfigInstructionDataCodec,Xc as getChangeConfigInstructionDataDecoder,Zc as getChangeConfigInstructionDataEncoder,Fo as getClientAndDeviceHash,yM as getCompiledInstructionCodec,en as getCompiledInstructionDecoder,$r as getCompiledInstructionEncoder,IM as getCompressedAccountMetaCodec,lt as getCompressedAccountMetaDecoder,mt as getCompressedAccountMetaEncoder,PM as getCompressedAccountMetaReadOnlyCodec,St as getCompressedAccountMetaReadOnlyDecoder,ft as getCompressedAccountMetaReadOnlyEncoder,RM as getCompressedOnlyExtensionCodec,rn as getCompressedOnlyExtensionDecoder,tn as getCompressedOnlyExtensionEncoder,vM as getCompressedProofCodec,dn as getCompressedProofDecoder,an as getCompressedProofEncoder,oe as getCompressedSettingsAddress,LM as getCompressedSettingsCodec,wM as getCompressedSettingsDataCodec,An as getCompressedSettingsDataDecoder,un as getCompressedSettingsDataEncoder,j as getCompressedSettingsDecoder,xt as getCompressedSettingsEncoder,GM as getCompressedTokenArgsCodec,Dt as getCompressedTokenArgsDecoder,Et as getCompressedTokenArgsEncoder,qM as getCompressibleExtensionCodec,fn as getCompressibleExtensionDecoder,yn as getCompressibleExtensionEncoder,XM as getCompressionInfoCodec,xn as getCompressionInfoDecoder,Sn as getCompressionInfoEncoder,tR as getConfigActionCodec,Fe as getConfigActionDecoder,Ve as getConfigActionEncoder,JU as getCreateCompressedWalletDiscriminatorBytes,ZU as getCreateCompressedWalletInstruction,Aa as getCreateCompressedWalletInstructionAsync,YU as getCreateCompressedWalletInstructionDataCodec,ua as getCreateCompressedWalletInstructionDataDecoder,Eo as getCreateCompressedWalletInstructionDataEncoder,ok as getCreateDomainConfigDiscriminatorBytes,ck as getCreateDomainConfigInstruction,Ia as getCreateDomainConfigInstructionAsync,sk as getCreateDomainConfigInstructionDataCodec,xa as getCreateDomainConfigInstructionDataDecoder,Po as getCreateDomainConfigInstructionDataEncoder,mk as getCreateDomainUserAccountDiscriminatorBytes,Tk as getCreateDomainUserAccountInstruction,ha as getCreateDomainUserAccountInstructionAsync,lk as getCreateDomainUserAccountInstructionDataCodec,Pa as getCreateDomainUserAccountInstructionDataDecoder,ho as getCreateDomainUserAccountInstructionDataEncoder,Ek as getCreateGlobalCounterDiscriminatorBytes,Pk as getCreateGlobalCounterInstruction,_a as getCreateGlobalCounterInstructionAsync,Dk as getCreateGlobalCounterInstructionDataCodec,ba as getCreateGlobalCounterInstructionDataDecoder,Ro as getCreateGlobalCounterInstructionDataEncoder,aR as getCreateUserAccountArgsCodec,Un as getCreateUserAccountArgsDecoder,vn as getCreateUserAccountArgsEncoder,kk as getCreateUserAccountsDiscriminatorBytes,Lk as getCreateUserAccountsInstruction,Wa as getCreateUserAccountsInstructionAsync,Wk as getCreateUserAccountsInstructionDataCodec,ka as getCreateUserAccountsInstructionDataDecoder,_o as getCreateUserAccountsInstructionDataEncoder,Gk as getDecompressSettingsAccountDiscriminatorBytes,Ha as getDecompressSettingsAccountInstruction,zk as getDecompressSettingsAccountInstructionDataCodec,wa as getDecompressSettingsAccountInstructionDataDecoder,Na as getDecompressSettingsAccountInstructionDataEncoder,Xk as getDisableDomainConfigDiscriminatorBytes,ja as getDisableDomainConfigInstruction,Qk as getDisableDomainConfigInstructionDataCodec,Ka as getDisableDomainConfigInstructionDataDecoder,za as getDisableDomainConfigInstructionDataEncoder,at as getDomainConfigAddress,Yh as getDomainConfigCodec,cs as getDomainConfigDecoder,Jh as getDomainConfigDiscriminatorBytes,ZA as getDomainConfigEncoder,Xh as getDomainConfigSize,cW as getEditDomainConfigDiscriminatorBytes,Qa as getEditDomainConfigInstruction,iW as getEditDomainConfigInstructionAsync,aW as getEditDomainConfigInstructionDataCodec,Xa as getEditDomainConfigInstructionDataDecoder,Uo as getEditDomainConfigInstructionDataEncoder,AR as getEditMemberArgsCodec,Rn as getEditMemberArgsDecoder,Mn as getEditMemberArgsEncoder,TW as getEditTransactionManagerUrlDiscriminatorBytes,oi as getEditTransactionManagerUrlInstruction,yW as getEditTransactionManagerUrlInstructionDataCodec,ni as getEditTransactionManagerUrlInstructionDataDecoder,ri as getEditTransactionManagerUrlInstructionDataEncoder,PW as getEditUserDelegateDiscriminatorBytes,ui as getEditUserDelegateInstruction,hW as getEditUserDelegateInstructionDataCodec,di as getEditUserDelegateInstructionDataDecoder,ii as getEditUserDelegateInstructionDataEncoder,lR as getExpectedSignerCodec,Mt as getExpectedSignerDecoder,ht as getExpectedSignerEncoder,SR as getExtensionStructCodec,Pt as getExtensionStructDecoder,gn as getExtensionStructEncoder,cA as getGlobalCounterAddress,tM as getGlobalCounterCodec,gs as getGlobalCounterDecoder,eM as getGlobalCounterDiscriminatorBytes,gg as getGlobalCounterEncoder,oM as getGlobalCounterSize,Vo as getJitoTipsConfig,H2 as getLightCpiSigner,ye as getLightProtocolRpc,PR as getLinkWalletArgsCodec,zn as getLinkWalletArgsDecoder,Gn as getLinkWalletArgsEncoder,bR as getMemberCodec,Ct as getMemberDecoder,It as getMemberEncoder,UR as getMemberKeyCodec,$ as getMemberKeyDecoder,V as getMemberKeyEncoder,lN as getMultiWalletErrorMessage,zW as getNativeTransferIntentCompressedDiscriminatorBytes,xi as getNativeTransferIntentCompressedInstruction,KW as getNativeTransferIntentCompressedInstructionDataCodec,Si as getNativeTransferIntentCompressedInstructionDataDecoder,fi as getNativeTransferIntentCompressedInstructionDataEncoder,WW as getNativeTransferIntentDiscriminatorBytes,mi as getNativeTransferIntentInstruction,OW as getNativeTransferIntentInstructionAsync,LW as getNativeTransferIntentInstructionDataCodec,pi as getNativeTransferIntentInstructionDataDecoder,ko as getNativeTransferIntentInstructionDataEncoder,OR as getNewAuthorityArgsCodec,Jn as getNewAuthorityArgsDecoder,qn as getNewAuthorityArgsEncoder,_w as getOriginIndex,wR as getPackedAddressTreeInfoCodec,vt as getPackedAddressTreeInfoDecoder,_t as getPackedAddressTreeInfoEncoder,FR as getPackedMerkleContextCodec,mn as getPackedMerkleContextDecoder,pn as getPackedMerkleContextEncoder,KR as getPackedStateTreeInfoCodec,yt as getPackedStateTreeInfoDecoder,Tt as getPackedStateTreeInfoEncoder,JR as getPausableAccountExtensionCodec,Wn as getPausableAccountExtensionDecoder,kn as getPausableAccountExtensionEncoder,XR as getPermanentDelegateAccountExtensionCodec,On as getPermanentDelegateAccountExtensionDecoder,Ln as getPermanentDelegateAccountExtensionEncoder,eb as getPermissionsCodec,Ne as getPermissionsDecoder,Be as getPermissionsEncoder,ob as getProofArgsCodec,E as getProofArgsDecoder,C as getProofArgsEncoder,ib as getRemoveMemberArgsCodec,_n as getRemoveMemberArgsDecoder,bn as getRemoveMemberArgsEncoder,Ab as getRentConfigCodec,Dn as getRentConfigDecoder,En as getRentConfigEncoder,Go as getSecp256r1MessageHash,mb as getSecp256r1PubkeyCodec,Ut as getSecp256r1PubkeyDecoder,Xn as getSecp256r1PubkeyEncoder,mh as getSecp256r1SignatureOffsetsDataDecoder,ph as getSecp256r1SignatureOffsetsDataEncoder,yb as getSecp256r1VerifyArgsCodec,G as getSecp256r1VerifyArgsDecoder,F as getSecp256r1VerifyArgsEncoder,Ib as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,$n as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,Qn as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,H as getSecp256r1VerifyInstruction,lH as getSecp256r1VerifyInstructionDataCodec,yA as getSecp256r1VerifyInstructionDataDecoder,fA as getSecp256r1VerifyInstructionDataEncoder,Pu as getSendAndConfirmTransaction,zv as getSettingsCodec,Sr as getSettingsDecoder,Gv as getSettingsDiscriminatorBytes,s1 as getSettingsEncoder,Ce as getSettingsFromIndex,Mb as getSettingsIndexWithAddressAndDelegateInfoCodec,no as getSettingsIndexWithAddressAndDelegateInfoDecoder,ro as getSettingsIndexWithAddressAndDelegateInfoEncoder,Db as getSettingsIndexWithAddressCodec,to as getSettingsIndexWithAddressDecoder,eo as getSettingsIndexWithAddressEncoder,vb as getSettingsMutArgsCodec,K as getSettingsMutArgsDecoder,z as getSettingsMutArgsEncoder,Lb as getSettingsReadonlyArgsCodec,Wt as getSettingsReadonlyArgsDecoder,kt as getSettingsReadonlyArgsEncoder,Dw as getSignedSecp256r1Key,S8 as getSignedTransactionManager,Y as getSolanaRpc,Du as getSolanaRpcEndpoint,Nb as getSplInterfacePdaArgsCodec,Ot as getSplInterfacePdaArgsDecoder,Lt as getSplInterfacePdaArgsEncoder,Fb as getTokenMetadataCodec,Nn as getTokenMetadataDecoder,Bn as getTokenMetadataEncoder,dL as getTokenTransferIntentCompressedDiscriminatorBytes,Wi as getTokenTransferIntentCompressedInstruction,AL as getTokenTransferIntentCompressedInstructionAsync,uL as getTokenTransferIntentCompressedInstructionDataCodec,ki as getTokenTransferIntentCompressedInstructionDataDecoder,Lo as getTokenTransferIntentCompressedInstructionDataEncoder,$W as getTokenTransferIntentDiscriminatorBytes,Ri as getTokenTransferIntentInstruction,tL as getTokenTransferIntentInstructionAsync,eL as getTokenTransferIntentInstructionDataCodec,Mi as getTokenTransferIntentInstructionDataDecoder,Wo as getTokenTransferIntentInstructionDataEncoder,aA as getTransactionBufferAddress,RL as getTransactionBufferCloseCompressedDiscriminatorBytes,ji as getTransactionBufferCloseCompressedInstruction,bL as getTransactionBufferCloseCompressedInstructionDataCodec,Ki as getTransactionBufferCloseCompressedInstructionDataDecoder,zi as getTransactionBufferCloseCompressedInstructionDataEncoder,SL as getTransactionBufferCloseDiscriminatorBytes,Hi as getTransactionBufferCloseInstruction,xL as getTransactionBufferCloseInstructionDataCodec,wi as getTransactionBufferCloseInstructionDataDecoder,Ni as getTransactionBufferCloseInstructionDataEncoder,Xv as getTransactionBufferCodec,jb as getTransactionBufferCreateArgsCodec,Nt as getTransactionBufferCreateArgsDecoder,Bt as getTransactionBufferCreateArgsEncoder,jL as getTransactionBufferCreateCompressedDiscriminatorBytes,od as getTransactionBufferCreateCompressedInstruction,qL as getTransactionBufferCreateCompressedInstructionDataCodec,nd as getTransactionBufferCreateCompressedInstructionDataDecoder,rd as getTransactionBufferCreateCompressedInstructionDataEncoder,BL as getTransactionBufferCreateDiscriminatorBytes,Qi as getTransactionBufferCreateInstruction,NL as getTransactionBufferCreateInstructionDataCodec,Xi as getTransactionBufferCreateInstructionDataDecoder,Zi as getTransactionBufferCreateInstructionDataEncoder,vc as getTransactionBufferDecoder,Zv as getTransactionBufferDiscriminatorBytes,D1 as getTransactionBufferEncoder,uO as getTransactionBufferExecuteCompressedDiscriminatorBytes,Td as getTransactionBufferExecuteCompressedInstruction,AO as getTransactionBufferExecuteCompressedInstructionDataCodec,ld as getTransactionBufferExecuteCompressedInstructionDataDecoder,md as getTransactionBufferExecuteCompressedInstructionDataEncoder,tO as getTransactionBufferExecuteDiscriminatorBytes,ud as getTransactionBufferExecuteInstruction,rO as getTransactionBufferExecuteInstructionDataCodec,dd as getTransactionBufferExecuteInstructionDataDecoder,id as getTransactionBufferExecuteInstructionDataEncoder,hO as getTransactionBufferExtendCompressedDiscriminatorBytes,Rd as getTransactionBufferExtendCompressedInstruction,MO as getTransactionBufferExtendCompressedInstructionDataCodec,Md as getTransactionBufferExtendCompressedInstructionDataDecoder,hd as getTransactionBufferExtendCompressedInstructionDataEncoder,fO as getTransactionBufferExtendDiscriminatorBytes,Cd as getTransactionBufferExtendInstruction,SO as getTransactionBufferExtendInstructionDataCodec,Id as getTransactionBufferExtendInstructionDataDecoder,xd as getTransactionBufferExtendInstructionDataEncoder,zO as getTransactionBufferVoteCompressedDiscriminatorBytes,Hd as getTransactionBufferVoteCompressedInstruction,KO as getTransactionBufferVoteCompressedInstructionDataCodec,wd as getTransactionBufferVoteCompressedInstructionDataDecoder,Nd as getTransactionBufferVoteCompressedInstructionDataEncoder,LO as getTransactionBufferVoteDiscriminatorBytes,Wd as getTransactionBufferVoteInstruction,OO as getTransactionBufferVoteInstructionDataCodec,kd as getTransactionBufferVoteInstructionDataDecoder,Ud as getTransactionBufferVoteInstructionDataEncoder,cB as getTransactionExecuteCompressedDiscriminatorBytes,Qd as getTransactionExecuteCompressedInstruction,aB as getTransactionExecuteCompressedInstructionDataCodec,Xd as getTransactionExecuteCompressedInstructionDataDecoder,Zd as getTransactionExecuteCompressedInstructionDataEncoder,QO as getTransactionExecuteDiscriminatorBytes,jd as getTransactionExecuteInstruction,$O as getTransactionExecuteInstructionDataCodec,Kd as getTransactionExecuteInstructionDataDecoder,zd as getTransactionExecuteInstructionDataEncoder,DB as getTransactionExecuteSyncCompressedDiscriminatorBytes,uu as getTransactionExecuteSyncCompressedInstruction,PB as getTransactionExecuteSyncCompressedInstructionDataCodec,du as getTransactionExecuteSyncCompressedInstructionDataDecoder,iu as getTransactionExecuteSyncCompressedInstructionDataEncoder,lB as getTransactionExecuteSyncDiscriminatorBytes,ou as getTransactionExecuteSyncInstruction,TB as getTransactionExecuteSyncInstructionDataCodec,nu as getTransactionExecuteSyncInstructionDataDecoder,ru as getTransactionExecuteSyncInstructionDataEncoder,$b as getTransactionMessageAddressTableLookupCodec,go as getTransactionMessageAddressTableLookupDecoder,Ao as getTransactionMessageAddressTableLookupEncoder,Zb as getTransactionMessageCodec,Ht as getTransactionMessageDecoder,wt as getTransactionMessageEncoder,n_ as getTransactionSyncSignersCodec,J as getTransactionSyncSignersDecoder,q as getTransactionSyncSignersEncoder,i_ as getTransferFeeAccountExtensionCodec,Hn as getTransferFeeAccountExtensionDecoder,wn as getTransferFeeAccountExtensionEncoder,A_ as getTransferHookAccountExtensionCodec,Fn as getTransferHookAccountExtensionDecoder,Vn as getTransferHookAccountExtensionEncoder,m_ as getTransportsCodec,Ft as getTransportsDecoder,Vt as getTransportsEncoder,w as getUserAccountAddress,f_ as getUserCodec,C_ as getUserCreationArgsCodec,he as getUserCreationArgsDecoder,Pe as getUserCreationArgsEncoder,X as getUserDecoder,Gt as getUserEncoder,h_ as getUserMutArgsCodec,Ze as getUserMutArgsDecoder,Ye as getUserMutArgsEncoder,__ as getUserReadOnlyArgsCodec,bt as getUserReadOnlyArgsDecoder,Rt as getUserReadOnlyArgsEncoder,W_ as getUserReadOnlyOrMutateArgsCodec,He as getUserReadOnlyOrMutateArgsDecoder,we as getUserReadOnlyOrMutateArgsEncoder,w_ as getUserRoleCodec,ze as getUserRoleDecoder,Ge as getUserRoleEncoder,w2 as getWalletAddressFromIndex,be as getWalletAddressFromSettings,rU as getWhitelistedAddressTreeCodec,Bc as getWhitelistedAddressTreeDecoder,tU as getWhitelistedAddressTreeDiscriminatorBytes,z1 as getWhitelistedAddressTreeEncoder,Yo as getWhitelistedAddressTreeFromIndex,R2 as getWhitelistedAddressTreeIndexFromAddress,tA as getWhitelistedAddressTreesAddress,iN as identifyMultiWalletAccount,dN as identifyMultiWalletInstruction,aw as initialize,nR as isConfigAction,IR as isExtensionStruct,TN as isMultiWalletError,s_ as isTransactionSyncSigners,O_ as isUserReadOnlyOrMutateArgs,KH as nativeTransferIntent,EU as parseAddWhitelistedAddressTreesInstruction,VU as parseChangeConfigCompressedInstruction,UU as parseChangeConfigInstruction,XU as parseCreateCompressedWalletInstruction,ak as parseCreateDomainConfigInstruction,yk as parseCreateDomainUserAccountInstruction,hk as parseCreateGlobalCounterInstruction,Ok as parseCreateUserAccountsInstruction,Kk as parseDecompressSettingsAccountInstruction,$k as parseDisableDomainConfigInstruction,dW as parseEditDomainConfigInstruction,fW as parseEditTransactionManagerUrlInstruction,MW as parseEditUserDelegateInstruction,jW as parseNativeTransferIntentCompressedInstruction,BW as parseNativeTransferIntentInstruction,TH as parseSecp256r1VerifyInstruction,gL as parseTokenTransferIntentCompressedInstruction,rL as parseTokenTransferIntentInstruction,_L as parseTransactionBufferCloseCompressedInstruction,IL as parseTransactionBufferCloseInstruction,JL as parseTransactionBufferCreateCompressedInstruction,wL as parseTransactionBufferCreateInstruction,gO as parseTransactionBufferExecuteCompressedInstruction,nO as parseTransactionBufferExecuteInstruction,RO as parseTransactionBufferExtendCompressedInstruction,xO as parseTransactionBufferExtendInstruction,jO as parseTransactionBufferVoteCompressedInstruction,BO as parseTransactionBufferVoteInstruction,iB as parseTransactionExecuteCompressedInstruction,eB as parseTransactionExecuteInstruction,hB as parseTransactionExecuteSyncCompressedInstruction,yB as parseTransactionExecuteSyncInstruction,Z2 as pollJitoBundleConfirmation,SV as prepareChangeConfigArgs,MV as prepareTransactionBundle,HV as prepareTransactionMessage,KV as prepareTransactionSync,f8 as retrieveTransactionManager,BP as sendJitoBundle,x8 as serializeConfigActions,Y2 as signAndSendBundledTransactions,n8 as signAndSendTransaction,i5 as tokenTransferIntent,o_ as transactionSyncSigners,L_ as userReadOnlyOrMutateArgs,xu as vaultTransactionMessageDeserialize,Su as vaultTransactionMessageSerialize,UA as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
3
|
+
`);throw new Error(t)}return o.value.unitsConsumed}async function qu(e,n){let o=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===AccountRole.WRITABLE||c.role===AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));o.sort((c,i)=>c-i);let t=Math.floor(o.length/2);return o.length%2===0?Math.round((o[t-1]+o[t])/2):o[t]}async function Ju(e,n){Qt(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new b(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await it(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})}));await qt(r,n);let o=await Jt(r);if(!o.result||o.error)throw new ae(`Unable to simulate bundle: ${JSON.stringify(o.error??o.result)}`);if(typeof o.result.value.summary!="string"&&o.result.value.summary.failed){let{TransactionFailure:t}=o.result.value.summary.failed.error,[,c]=t;throw new ae(`Simulation failed: ${c}`)}return o.result.value.transactionResults.map(t=>t.unitsConsumed)}function ie(e,n=0){let r=e instanceof _?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?kr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:o,signature:c,message:i,publicKey:a}}function We(e,n,r=[]){let o=[];for(let t of e)if(t instanceof _){let c=r.length,{domainConfig:i,verifyArgs:a,signature:s,publicKey:d,message:u}=ie(t,c);if(u&&s&&d&&r.push({message:u,signature:s,publicKey:d}),i){let g=n.addPreAccounts([{address:i,role:AccountRole.READONLY}]).get(i)?.index;a.__option==="Some"&&g!==void 0&&o.push({__kind:"Secp256r1",fields:[{domainConfigIndex:g,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 fe(e){if(e instanceof Ue)return {keyType:jt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:jt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function Fu(e){return e instanceof _?e.toString():e.address.toString()}function ue(e){let n=new Set,r=[];for(let t of e)n.has(Fu(t))||(r.push(t),n.add(Fu(t)));let o=r.filter(t=>t instanceof _);if(o.length>1)throw new b(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return r}function Yu({payer:e,tipAmount:n}){let r=Ho[Math.floor(Math.random()*Ho.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function Zu(e){return typeof e=="string"?e:e.toString()}function Xu(e){return e.toString()}async function jo(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 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 Or(e,n){let r=Zu(e);return jo(n,r,()=>ye().getCompressedAccount(e))}async function $e(e,n){let r=Xu(e);return jo(n,r,()=>Y().getAccountInfo(e,{encoding:"base64"}).send())}async function de(e,n){let r=(await Promise.all(e.map(o=>Or(o.address,n)))).filter(o=>o!==null).filter(o=>o.data!==null&&o.address!==null);if(r.length!==e.length)throw new Q("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 v(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 Se(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 re(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 b("Unable to parse state tree data");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:s.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:s.outputTreeIndex}}))}async function xe(e,n,r,o,t){let c=null,i=null,a=null,s=new N;if(e){await s.addSystemAccounts();let{address:d}=await oe(n,r),u=(await de([{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 g=s.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!g)throw new b("Unable to parse state tree data");let p=j().decode(u.data?.data);c={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0]},data:p},i={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:p};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:s,settingsMutArgs:i}}async function Z(e,n){return Xt(()=>ye().getValidityProofV0(e,n))}async function Ie(){return (await Br()).length-1}var qo;async function Br(){if(!qo){let{data:e}=await wc(Y(),await tA());qo=e.whitelistedAddressTrees;}return qo}function eA(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 er(e,n,r){let o=await UP(e,n,r);if(!o)throw new Q("User account");return o}async function UP(e,n,r){let{address:o}=await w(e,n),t=await Or(o,r);return t?.data?.data?X().decode(t.data.data):null}async function M2(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(fe(n)))}});else if(r)o.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(le(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 Nr(e,n,r){let o=await kP(e,n,r);if(!o)throw new Q("Settings account");return o}async function kP(e,n,r){try{let{address:o}=await oe(e,n),t=await Or(o,r);if(!t?.data?.data)throw new Q("Compressed settings account");let c=j().decode(t.data.data);if(c.data.__option==="None")throw new Q("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let o=await mo(Y(),e);return o.exists?{...o.data,isCompressed:false}:null}}async function R2(e,n,r){let o=await er(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(fe(e)))}}]}),Y().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(V().encode(fe(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=Sr().decode(getBase64Encoder().encode(a.account.data[0]));t.push({...s,isCompressed:false});}),t}else return await Promise.all(o.wallets.map(async t=>Nr(await Ce(t.index),t.settingsAddressTreeIndex,r)))}async function Yo(e){Hu(e,"index");let n=await Br();if(e>=n.length)throw new b(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function b2(e){let r=(await Br()).findIndex(o=>o.toString()===e);if(r===-1)throw new Q("Address tree",`Address ${e} not found in whitelist`);return r}async function oe(e,n=0){let r=await Yo(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 Yo(n),o=deriveAddressSeedV2([getUtf8Encoder().encode("user"),e instanceof Ue?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 b("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function cA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function tA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function aA(e,n,r){wu(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 Ue?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return o}async function be(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function Ce(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function H2(e){let n=await Ce(e);return await be(n)}async function V2(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function Z2(e){Qt(e,"bundle");let n=await Ko(e,true),r=await Ju(n.map(getBase64EncodedWireTransaction),Du()),o=await Ko(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await BP(o.map(getBase64EncodedWireTransaction))}async function BP(e,n=Vo(),r){Qt(e,"serializedTransactions");let{blockEngineUrl:o}=n,t=`${o}/bundles`,c=await it(()=>fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})}),r);await qt(c,t);let i=await Jt(c);if(i.error)throw new ae(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new ae("No bundle ID returned from Jito");return i.result}async function X2(e,n=30,r=3e3,o=Vo()){Vu(e,"bundleId");let{blockEngineUrl:t}=o,c=`${t}/getBundleStatuses`;return Xt(async()=>{let i=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await qt(i,c);let a=await Jt(i);if(a.error)throw new ae(`Error getting bundle status: ${JSON.stringify(a.error,null,2)}`,e);if(!a.result?.value?.length)throw new ae("Bundle not yet confirmed",e);let s=a.result.value[0];if(s.confirmation_status==="confirmed"||s.confirmation_status==="finalized"){let d=s.transactions[s.transactions.length-1];if(!d)throw new ae("No transactions in confirmed bundle",e);return d}throw new ae(`Bundle status: ${s.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:Nu(ae,me)})}async function o8({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=await Y().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(e,c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(o.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([ju(c),qu(Y(),c.instructions.flatMap(d=>d.accounts??[]))]),s=Math.ceil((Number(i)??0)*1.1);return prependTransactionMessageInstructions([...s>2e5?[getSetComputeUnitLimitInstruction({units:s})]:[],...a>0?[getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await Pu()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function S8(e,n){if(n.threshold>1)throw new b("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(s=>AA(s.pubkey)===e);if(!r)throw new Q("Member",`Signer ${e} not found in settings`);let{permissions:o}=r;if(!o)throw new Q("Permissions","No permissions found for the current member");let t=ve.has(o,Re.InitiateTransaction),c=ve.has(o,Re.VoteTransaction),i=ve.has(o,Re.ExecuteTransaction);if(t&&c&&i)return {};if(!c||!i)throw new _r("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 Q("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(AA(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function x8({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:o,cachedAccounts:t,onPendingApprovalsCallback:c,onPendingApprovalsSuccess:i,abortController:a}){if(!n)return null;let s=await er(n,r,t);if(s.transactionManagerUrl.__option==="None")throw new Q("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return eh(n,s.transactionManagerUrl.value,e,o,c,i,a)}function eh(e,n,r,o,t,c,i){return {address:e,async signTransactions(a){let s=i??new AbortController,d=await it(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},signal:s.signal,body:JSON.stringify({publicKey:e.toString(),payload:a.map(g=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(g)),transactionMessageBytes:o?getBase64Decoder().decode(o):void 0,authResponses:r}))})}));if(!d.ok)throw new me(`Transaction manager request failed: ${d.statusText}`,d.status,n);let u;if(await th(d,(g,p)=>{if(g==="error"){let f=typeof p?.error=="string"?p.error:"Unknown error";throw new me(`Transaction manager error: ${f}`,d.status,n)}return g==="signatures"?(u=p.signatures,!0):(g==="pending_transaction_approval"?t?.(p.validTill):g==="transaction_approved"&&c?.(),!1)}),!u)throw new me("Transaction manager error: missing signatures",d.status,n);return u.map(g=>({[e]:getBase58Encoder().encode(g)}))}}}async function th(e,n){let r=e.body?.getReader();if(!r)throw new Error("No response body");let o=new TextDecoder,t="";try{for(;;){let{value:c,done:i}=await r.read();if(i)break;for(t+=o.decode(c,{stream:!0});;){let a=t.indexOf(`
|
|
4
|
+
|
|
5
|
+
`);if(a===-1)break;let s=t.slice(0,a);t=t.slice(a+2);let d="message",u=[];for(let p of s.split(`
|
|
6
|
+
`)){let f=p.endsWith("\r")?p.slice(0,-1):p;f.startsWith(":")||f.length===0||(f.startsWith("event:")?d=f.slice(6).trim():f.startsWith("data:")&&u.push(f.slice(5).trimStart()));}if(u.length===0)continue;if(n(d,JSON.parse(u.length===1?u[0]:u.join(`
|
|
7
|
+
`)))){await r.cancel();return}}}t+=o.decode();}catch(c){try{await r.cancel();}catch{}throw c}}function AA(e){return e.keyType===jt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function I8(e){let n=e.map(c=>Ve().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 C8(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=Fe().read(e,n);t[c]=i[0],n=i[1];}if(n!==e.length)throw new b(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function N8({payer:e,rpId:n,origins:r,authority:o}){let t=await at({rpId:n}),c=new N;await c.addSystemAccounts();let i=await Ie(),{address:a,addressTree:s}=await w(o.address,i),d=[{address:a,tree:s,queue:s,type:"User"}],u=await Z([],d),g=(await Se(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:f}=c.toAccountMetas(),S=v(u,f);return await Ia({origins:r,authorityCreationArgs:g,authority:o,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function Y8({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 oe(r.settings,r.settingsAddressTreeIndex)).address,type:"Settings"}));let a=i.length?await de(i,t):[],s=await Ie(),{address:d,addressTree:u}=await w(r.member,s),g=[{address:d,type:"User",tree:u,queue:u}],p=await Z(a,g),f=null,S=null,I=a.filter(k=>k.type==="Settings"),x=a.filter(k=>k.type==="User");if(x.length&&(S=re(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),x,X())[0]),I.length){let k=x.length,ee=k+1;f=re(c,p.treeInfos.slice(k,ee),p.leafIndices.slice(k,ee),p.rootIndices.slice(k,ee),p.proveByIndices.slice(k,ee),I,j())[0];}let M=(await Se(c,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),g))[0],{remainingAccounts:R,systemOffset:U}=c.toAccountMetas(),W=v(p,U);return await ha({payer:n,authority:e,compressedProofArgs:W,member:Ut().decode(r.member.toBuffer()),credentialId:le(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:f?some({settingsMutArgs:f,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:M,domainConfig:o,remainingAccounts:R})}async function $8({payer:e}){let n=await cA();return _a({payer:e,globalCounter:n})}async function nH({admin:e,rpId:n,disable:r}){let o=await at({rpId:n});return ja({domainConfig:o,admin:e,disable:r,remainingAccounts:[]})}function nh(e,n,r,o){let t=oh(e,n),c=sh(e,n)&&r!==o;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function oh(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 sh(e,n){return n<e.header.numSignerAccounts}async function wr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:o}){let t=xu(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),Y()):{}),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:nh(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 ut=33,At=64,$o=14,gh=2,ph=address("Secp256r1SigVerify1111111111111111111111111");function mh(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function lh(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function yA(){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=lh();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=$o;let i=[];for(let a=0;a<r;a++){let s=fixDecoderSize(getBytesDecoder(),ut).decode(e,n);n+=ut;let d=fixDecoderSize(getBytesDecoder(),At).decode(e,n);n+=At;let u=t[a].messageDataSize,g=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:s,signature:d,message:g});}return [{numSignatures:r,padding:o,offsets:t,payload:i},n]}})}function fA(){return createEncoder({getSizeFromValue:e=>{let n=$o*e.offsets.length,r=e.payload.reduce((o,t)=>o+ut+At+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=mh();for(let t of e.offsets)r=o.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),ut).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),At).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function TH(){return combineCodec(fA(),yA())}function H(e,n){let r=e.length,o=gh+r*$o,t=[];for(let s=0;s<r;s++){let{message:d}=e[s],u=o,g=u+ut,p=g+At;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),o+=ut+At+d.length;}let c=n?.programAddress??ph,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:fA().encode(i)}}function yH(e){return {programAddress:e.programAddress,accounts:{},data:yA().decode(e.data)}}async function SA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:o,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:s=false}){let d=await be(e),{accountMetas:u,addressLookupTableAccounts:g}=await wr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(H(c)),p.push(s?Qd({transactionBuffer:n,payer:o.address,remainingAccounts:u,settingsKey:e}):jd({transactionBuffer:n,payer:o.address,settings:e})),a&&p.push(Yu({payer:o,tipAmount:a})),{instructions:p,addressLookupTableAccounts:g}}async function xA({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 g=ue(t),p=await be(e),[{accountMetas:f,addressLookupTableAccounts:S,transactionMessage:I},{settingsMutArgs:x,proof:M,packedAccounts:R}]=await Promise.all([wr({transactionMessageBytes:r,walletAddress:p,additionalSigners:o,addressesByLookupTableAddress:i}),xe(s,e,n,d,u)]);R.addPreAccounts(f);let{secp256r1VerifyInput:U,transactionSyncSigners:W}=We(g,R,a),{remainingAccounts:k,systemOffset:ee}=R.toAccountMetas(),se=[];U.length>0&&se.push(H(U));let Ee=Th(I,f);if(s){if(!c||!x)throw new b("Payer not found or proof args are missing for executeTransactionSync.");let De=v(M,ee);se.push(uu({signers:W,transactionMessage:Ee,settingsMutArgs:x,compressedProofArgs:De,payer:c,remainingAccounts:k}));}else se.push(ou({signers:W,settings:e,transactionMessage:Ee,remainingAccounts:k}));return {instructions:se,addressLookupTableAccounts:S}}function Th(e,n){if(e.version==="legacy")throw new b("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 jH({settings:e,settingsAddressTreeIndex:n,destination:r,signers:o,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let s=ue(o),d=await be(e),[{packedAccounts:u,proof:g,settingsMutArgs:p},{value:f}]=await Promise.all([xe(a,e,n,false,t),$e(d,t)]);if((f?.lamports??0)<BigInt(c))throw new b("Insufficient balance for native transfer.");let{secp256r1VerifyInput:S,transactionSyncSigners:I}=We(s,u),{remainingAccounts:x,systemOffset:M}=u.toAccountMetas(),R=[];if(S.length>0&&R.push(H(S)),a){if(!i||!p)throw new Error("Payer not found or proof args is missing.");let U=v(g,M);R.push(xi({amount:c,settingsMutArgs:p,compressedProofArgs:U,payer:i,signers:I,source:d,destination:r,remainingAccounts:x}));}else R.push(mi({amount:c,signers:I,source:d,destination:r,settings:e,remainingAccounts:x}));return R}var Ph=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),hh=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Vr=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function d5({settings:e,settingsAddressTreeIndex:n,destination:r,mint:o,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:s,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false,useDestinationSplAccount:g=false}){let p=ue(t),f=await be(e),S=await Mh(o,r,f,s,d),[I,x]=await Promise.all([Rh(S,c),Oh(u,e,n,c)]),M=bh(I,S,i,g),[R,U]=await Promise.all([Lh(f,o,M.splBalance,M.cTokenBalance,BigInt(i),u),Wh(M.requireSplInterface,S.splInterfacePda,c)]),W=BigInt(R.reduce((Oe,ns)=>Oe+(ns.parsed.amount.toNumber()??0),0));if(M.splBalance+M.cTokenBalance+W<BigInt(i))throw new b("Insufficient balance for token transfer.");let k=new N;U&&k.addPreAccounts([{address:o,role:AccountRole.WRITABLE}]);let ee=_h(R,x),{proof:se,settingsMutArgs:Ee}=await vh(k,ee,x),De=Uh(R,se,k),{secp256r1VerifyInput:nt,transactionSyncSigners:Le}=We(p,k),{remainingAccounts:ge,systemOffset:ot}=k.toAccountMetas(),Kr=v(se,ot),y=[];nt.length>0&&y.push(H(nt));let rr=kh({amount:i,transactionSyncSigners:Le,walletAddress:f,destination:r,addresses:S,balances:M,mint:o,tokenProgram:s,remainingAccounts:ge,payer:a,sourceCompressedTokenAccounts:De,compressedProofArgs:Kr,splInterfacePdaArgs:d});if(u){if(!Ee)throw new Error("Payer not found or proof args is missing.");y.push(Wi({...rr,settingsMutArgs:Ee}));}else y.push(Ri({...rr,settings:e}));return y}async function Mh(e,n,r,o,t){let c=p=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(p),getAddressEncoder().encode(Vr),getAddressEncoder().encode(e)],programAddress:Vr}),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],[g]]=await Promise.all([getAssociatedTokenAccountAddress(e,r,o),c(r),getAssociatedTokenAccountAddress(e,n,o),c(n),getProgramDerivedAddress({seeds:i,programAddress:Vr})]);return {sourceSplAta:a,sourceCtokenAta:s,destinationSplAta:d,destinationCTokenAta:u,splInterfacePda:g}}async function Rh(e,n){let[r,o,t]=await Promise.all([$e(e.destinationSplAta,n),$e(e.sourceSplAta,n),$e(e.sourceCtokenAta,n)]);return {destinationSplAtaInfo:r,sourceSplAtaInfo:o,sourceCTokenAtaInfo:t}}function bh(e,n,r,o){let t=!!e.destinationSplAtaInfo.value,c=!!e.sourceSplAtaInfo.value,i=!!e.sourceCTokenAtaInfo.value,a=c?getTokenDecoder().decode(getBase64Encoder().encode(e.sourceSplAtaInfo.value.data[0])).amount:BigInt(0),s=BigInt(i?Bh(getBase64Encoder().encode(e.sourceCTokenAtaInfo.value.data[0]))?.amount??0:0),d=t||o?n.destinationSplAta:void 0,u=t||o?void 0:n.destinationCTokenAta,g=c&&(a+s<BigInt(r)||s>BigInt(0)||!t)||!c&&t;return {splBalance:a,cTokenBalance:s,destinationSplTokenAccount:d,destinationCtokenTokenAccount:u,requireSplInterface:g,requireRentSponsor:a+s<BigInt(r)||!t}}function _h(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 vh(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=re(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 Uh(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:eA(o.compressedAccount.data?.discriminator),tlv:o.parsed.tlv?some(getArrayDecoder(Pt()).decode(o.parsed.tlv)):none(),state:o.parsed.state}))}function kh({amount:e,transactionSyncSigners:n,walletAddress:r,destination:o,addresses:t,balances:c,mint:i,tokenProgram:a,remainingAccounts:s,payer:d,sourceCompressedTokenAccounts:u,compressedProofArgs:g,splInterfacePdaArgs:p}){return {amount:e,signers:n,source:r,destination:o,sourceCtokenTokenAccount:t.sourceCtokenAta,sourceSplTokenAccount:t.sourceSplAta,destinationCtokenTokenAccount:c.destinationCtokenTokenAccount,destinationSplTokenAccount:c.destinationSplTokenAccount,mint:i,tokenProgram:a,remainingAccounts:s,payer:d,sourceCompressedTokenAccounts:u,compressedProofArgs:g,compressibleConfig:Ph,splInterfacePda:c.requireSplInterface?t.splInterfacePda:void 0,rentSponsor:c.requireRentSponsor?hh:void 0,splInterfacePdaArgs:c.requireSplInterface?some(p):none()}}async function Wh(e,n,r){if(!e)return false;let{value:o}=await $e(n,r);return !o}async function Lh(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()===Vr.toString()&&!u.parsed.amount.isZero());return s.length===0?[]:selectMinCompressedTokenAccountsForDecompression(s,new Sh(i),c?3:4,{treeType:TreeType.StateV2}).selectedAccounts}async function Oh(e,n,r,o){if(!e)return null;let{address:t}=await oe(n,r);return (await de([{address:t,type:"Settings"}],o))[0]??null}function Bh(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 I5({signers:e,payer:n,changeConfigArgs:r}){let{settings:o,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:s}=r,d=ue(e),u=[],g=[];for(let x of d)if(x instanceof _){let M=g.length,{domainConfig:R,verifyArgs:U,signature:W,publicKey:k,message:ee}=ie(x,M);if(ee&&W&&k&&g.push({message:ee,signature:W,publicKey:k}),R){let se=i.addPreAccounts([{address:R,role:AccountRole.READONLY}]).get(R)?.index;U.__option==="Some"&&se!==void 0&&u.push({__kind:"Secp256r1",fields:[{domainConfigIndex:se,verifyArgs:U.value}]});}}else {let M=i.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]).get(x.address)?.index;M!==void 0&&u.push({__kind:"Ed25519",fields:[M]});}let{remainingAccounts:p,systemOffset:f}=i.toAccountMetas(),S=v(a,f),I=[];if(g.length>0&&I.push(H(g)),c){if(!s)throw new b("Proof args are missing for compressed changeConfig.");I.push(ca({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:s,remainingAccounts:p,signers:u}));}else I.push(Qc({settings:o,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:p,signers:u}));return I}async function R5({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 Ie(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:p}=await w(u.member.address,o);return {address:g,tree:p,queue:p,type:"User"}})),c=await Z([],t),i=await Se(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:s}=r.toAccountMetas(),d=v(c,s);return await Wa({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:i[g],transactionManagerUrl:u.role===0?u.transactionManagerUrl:null})),remainingAccounts:a})}async function L5({index:e,payer:n,initialMember:r,userAddressTreeIndex:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[],a=[];a.push(...await de([{address:(await w(r.address,o)).address,type:"User"}],t));let s=await Ie(),{address:d,addressTree:u}=await oe(await Ce(e),s);i.push({address:d,queue:u,tree:u,type:"Settings"});let g=a.length,p=await Z(a,i),f=re(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),a.filter(U=>U.type==="User"),X())[0],I=(await Se(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),i)).find(U=>U.type==="Settings")??null,{remainingAccounts:x,systemOffset:M}=c.toAccountMetas(),R=v(p,M);if(!I)throw new Error("Settings creation args is missing.");return await Aa({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:R,...I,remainingAccounts:x})}async function K5({settings:e,settingsAddressTreeIndex:n,payer:r,signers:o,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await xe(true,e,n,false,t);if(!a)throw new b("Proof args are missing for settings account.");let s=ue(o),{secp256r1VerifyInput:d,transactionSyncSigners:u}=We(s,c),{remainingAccounts:g,systemOffset:p}=c.toAccountMetas(),f=v(i,p),S=[];return d.length>0&&S.push(H(d)),S.push(Ha({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:f,signers:u,remainingAccounts:g})),S}async function Q5({authority:e,domainConfig:n,newAuthority:r,newOrigins:o}){let t=null,c=[];if(r){let i=new N;await i.addSystemAccounts();let a=await Ie(),{address:s,addressTree:d}=await w(r.address,a),u=[{address:s,tree:d,queue:d,type:"User"}],g=await Z([],u),p=(await Se(i,g.treeInfos,g.roots,g.rootIndices,u))[0],f=i.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:v(g,f.systemOffset),authorityCreationArgs:p};}return Qa({domainConfig:n,authority:e,newOrigins:o?some(o):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function o6({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let o=new N;await o.addSystemAccounts();let t=await de([{address:(await w(e.address,n)).address,type:"User"}]),c=await Z(t,[]),i=re(o,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:a,systemOffset:s}=o.toAccountMetas(),d=v(c,s);return oi({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function m6({payer:e,user:n,userAddressTreeIndex:r,newDelegate:o,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:s,publicKey:d}=ie(n),u=[];a&&s&&d&&u.push({message:a,signature:s,publicKey:d});let g=await er(n instanceof _?n:n.address,r,t),p=[];p.push({address:(await w(n instanceof _?n:n.address,r)).address,type:"User"});let f,S=null,I,x=null,M=g.wallets.find(ge=>ge.isDelegate);if(M){let ge=await Ce(M.index);(await Nr(ge,M.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await oe(ge,M.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):f=await Ce(M.index);}if(o){let ge=await Ce(o.index);(await Nr(ge,o.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await oe(ge,o.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):I=await Ce(o.index);}let R=new N;await R.addSystemAccounts();let U=await de(p,t),W=await Z(U,[]),k=re(R,W.treeInfos.slice(0,1),W.leafIndices.slice(0,1),W.rootIndices.slice(0,1),W.proveByIndices.slice(0,1),U.slice(0,1),X())[0],ee=S?some(re(R,W.treeInfos.slice(S.start,S.end),W.leafIndices.slice(S.start,S.end),W.rootIndices.slice(S.start,S.end),W.proveByIndices.slice(S.start,S.end),U.slice(S.start,S.end),j())[0]):none(),se=x?some(re(R,W.treeInfos.slice(x.start,x.end),W.leafIndices.slice(x.start,x.end),W.rootIndices.slice(x.start,x.end),W.proveByIndices.slice(x.start,x.end),U.slice(x.start,x.end),j())[0]):none(),{remainingAccounts:Ee,systemOffset:De}=R.toAccountMetas(),nt=v(W,De),Le=[];return u.length>0&&Le.push(H(u)),Le.push(ui({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:o?some(o):none(),feePayer:e,signer:n instanceof _?void 0:n,oldSettings:f,oldSettingsMutArgs:ee,newSettings:I,newSettingsMutArgs:se,compressedProofArgs:nt,userMutArgs:k,remainingAccounts:Ee})),Le}async function v6({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:o,compressed:t=false,cachedAccounts:c}){let i=await kc(Y(),r),a=i.data.multiWalletSettings,{packedAccounts:s,proof:d,settingsMutArgs:u}=await xe(t,a,e,false,c),{remainingAccounts:g,systemOffset:p}=s.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:I,signature:x,publicKey:M}=ie(n),R=[];if(I&&x&&M&&R.push(H([{message:I,signature:x,publicKey:M}])),t){if(!o||!u)throw new b("Payer not found or proof args are missing for closing buffer.");let U=v(d,p);R.push(ji({transactionBuffer:r,domainConfig:f,closer:n instanceof _?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:u,payer:o,compressedProofArgs:U,remainingAccounts:g}));}else R.push(Hi({transactionBuffer:r,domainConfig:f,closer:n instanceof _?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return R}function bA({payer:e,creator:n,bufferIndex:r,settings:o,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,compressedArgs:d,expectedSigners:u}){let{domainConfig:g,verifyArgs:p,message:f,signature:S,publicKey:I}=ie(n),x=[];if(f&&S&&I&&x.push(H([{message:f,signature:S,publicKey:I}])),d){let{settingsReadonlyArgs:M,compressedProofArgs:R,remainingAccounts:U}=d;x.push(od({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof _?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},settingsReadonlyArgs:M,compressedProofArgs:R,remainingAccounts:U}));}else x.push(Qi({settings:o,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof _?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},remainingAccounts:[]}));return x}function _A({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:s}=ie(e),d=[];return a&&i&&s&&d.push(H([{message:a,signature:i,publicKey:s}])),o?d.push(Td({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof _?void 0:e,settingsMutArgs:o.settingsMutArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(ud({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof _?void 0:e,remainingAccounts:[]})),d}function vA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:o=false}){return o?Rd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Cd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function UA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:s}=ie(n),d=[];return s&&i&&a&&d.push(H([{message:s,signature:i,publicKey:a}])),o?d.push(Hd({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof _?void 0:n,settingsReadonlyArgs:o.settingsReadonlyArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(Wd({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof _?void 0:n,remainingAccounts:[]})),d}async function xV({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:o,compressed:t=false}){let c=await Vh(r),i=new N,a=null,s=null,d=[];if(c.length||t){let g=await Fh({packedAccounts:i,userAccounts:c,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:o});a=g.proof,s=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await Gh({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:s,packedAccounts:i,compressed:t}}async function Vh(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 Fh({packedAccounts:e,userAccounts:n,compressed:r,settings:o,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let f=(await oe(o,t)).address;i.push({address:f,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await de(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let s=await Z(a,[]),d=[],u=[];for(let f of a)f.type==="Settings"?d.push(f):f.type==="User"&&u.push(f);let g,p=[];if(r&&s&&(g=re(e,s.treeInfos.slice(0,1),s.leafIndices.slice(0,1),s.rootIndices.slice(0,1),s.proveByIndices.slice(0,1),d,j())[0]),u.length&&s){let f=r?1:0;p=re(e,s.treeInfos.slice(f),s.leafIndices.slice(f),s.rootIndices.slice(f),s.proveByIndices.slice(f),u,X());}return {proof:s,settingsMutArgs:g,userMutArgs:p}}async function Gh({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(jh({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 Kh({pubkey:c.member,userMutArgs:a})})));r.push({__kind:o.type,fields:[t]});break}case "EditPermissions":{let t=o.members.map(c=>zh({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 zh({pubkey:e,permissionArgs:n}){return {memberKey:fe(e),permissions:OA(n)}}function Kh({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:fe(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function jh({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:fe(e),permissions:OA(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function OA(e){let n=[];return e.initiate&&n.push(Re.InitiateTransaction),e.vote&&n.push(Re.VoteTransaction),e.execute&&n.push(Re.ExecuteTransaction),ve.fromPermissions(n)}async function RV({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:p=Math.ceil(o.length/2),cachedAccounts:f}){let S=Math.floor(Math.random()*255),I=await aA(n,t instanceof _?t:t.address,S),x=[],M=[];for(let te=0;te<o.length;te+=p){let os=o.subarray(te,te+p);x.push(os),M.push(sha256(os));}let R=sha256(o),{settingsReadonlyArgs:U,settingsMutArgs:W,proof:k,packedAccounts:ee}=await xe(d,n,r,false,f),{remainingAccounts:se,systemOffset:Ee}=ee.toAccountMetas(),De=k&&U&&W?{settingsReadonlyArgs:U,settingsMutArgs:W,compressedProofArgs:v(k,Ee),remainingAccounts:se,payer:e}:null,nt=ue([t,...c?[c]:[],...u]).map(te=>({memberKey:fe(te),messageHash:te instanceof _?Go(te.authResponse):null})),Le=bA({finalBufferHash:R,finalBufferSize:o.length,bufferIndex:S,payer:e,transactionBufferAddress:I,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:M,compressedArgs:De,expectedSigners:nt}),ge=x.map(te=>vA({transactionMessageBytes:te,transactionBufferAddress:I,settings:n,compressed:d})),ot=u.map(te=>UA({voter:te,transactionBufferAddress:I,settings:n,compressedArgs:De})),Kr=_A({compressedArgs:De,settings:n,executor:c,transactionBufferAddress:I}),{instructions:y,addressLookupTableAccounts:rr}=await SA({compressed:d,settings:n,transactionMessageBytes:o,transactionBufferAddress:I,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s}),Oe=te=>({payer:e,instructions:te,addressesByLookupTableAddress:rr});return [Oe(Le),...ge.map(te=>Oe([te])),...ot.length?[Oe(ot.flat())]:[],Oe(Kr),Oe(y)]}var Gr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let o=new Map,t=i=>{let a=o.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},o.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let s=t(a.address);s.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,o)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),o=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),c=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+o.length,numReadonlySignerAccounts:o.length,numReadonlyNonSignerAccounts:c.length};if(r.length===0)throw new Error("Expected at least one writable signer key");let[a]=r[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let s=[...r.map(([d])=>d),...o.map(([d])=>d),...t.map(([d])=>d),...c.map(([d])=>d)];return [i,s]}extractTableLookup(n){let[r,o]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(n,r){let o=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,s=n.findIndex(d=>d===a);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),t.push(a),this.keyMetaMap.delete(c);}}return [o,t]}};var zr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let o=new Map;this.keySegments().flat().forEach((c,i)=>{o.set(c,i);});let t=c=>{let i=o.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function NA({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:o}){let t=Gr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(o??{});for(let p of a){let f=t.extractTableLookup(p);if(f!==void 0){let{addressTableLookup:S,drainedKeys:I}=f;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),i.writable.push(...I.writable),i.readonly.push(...I.readonly);}}let[s,d]=t.getMessageComponents(),g=new zr(d,i).compileInstructions(r);return {version:0,header:s,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function VV({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=NA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(Su(o))}async function jV({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:g,addressLookupTableAccounts:p}=await xA({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:g,addressesByLookupTableAddress:p}}export{Fc as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,jr as AccountState,wD as AdditionalSignersSchema,lu as AuthenticationContextSchema,Tu as BaseResponseSchema,na as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,Yc as CHANGE_CONFIG_DISCRIMINATOR,da as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,Sa as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Da as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Ra as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Ua as CREATE_USER_ACCOUNTS_DISCRIMINATOR,ON as CompleteMessageRequestSchema,NN as CompleteSendTransactionRequestSchema,BN as CompleteTransactionRequestSchema,Ba as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Ga as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,ss as DOMAIN_CONFIG_DISCRIMINATOR,Za as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,ti as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,ai as EDIT_USER_DELEGATE_DISCRIMINATOR,As as GLOBAL_COUNTER_DISCRIMINATOR,jt as KeyType,LE as MULTI_WALLET_ERROR__ALREADY_DELEGATED,AE as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,MD as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,tD as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,nD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,oD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,PD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,OD as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,mE as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,pE as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,PE as MULTI_WALLET_ERROR__EMPTY_MEMBERS,uD as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,CE as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,gE as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,xE as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,zE as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,KE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,jE as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,dD as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,NE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,OE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,BE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,_E as MULTI_WALLET_ERROR__INVALID_ACCOUNT,DD as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,aD as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,EE as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,UE as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,GE as MULTI_WALLET_ERROR__INVALID_BUFFER,AD as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,wE as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,bE as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,yE as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,sE as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,iE as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,oE as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,aE as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,eD as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,QE as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,ME as MULTI_WALLET_ERROR__INVALID_THRESHOLD,ID as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,IE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,SE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,RE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,_D as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,vE as MULTI_WALLET_ERROR__INVALID_USER_ROLE,bD as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,xD as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,dE as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,ZE as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,sD as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,mD as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,ED as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,kE as MULTI_WALLET_ERROR__MISSING_ACCOUNT,gD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,yD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,vD as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,SD as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,pD as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,WE as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,WD as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,kD as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,iD as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,UD as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,fD as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,XE as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,hD as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,LD as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,VE as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,DE as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,TE as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,fE as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,cD as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,TD as MULTI_WALLET_ERROR__PAYER_MISMATCH,lE as MULTI_WALLET_ERROR__PERMANENT_MEMBER,YE as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,uE as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,lD as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,cE as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,$E as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,CD as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,hE as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,qE as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,JE as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,rD as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,FE as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,RD as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,HE as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,tE as MultiWalletAccount,rE as MultiWalletInstruction,yi as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,gi as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Re as Permission,ve as Permissions,Dc as SETTINGS_DISCRIMINATOR,Ue as Secp256r1Key,_ as SignedSecp256r1Key,pu as StartMessageRequestSchema,mu as StartTransactionRequestSchema,Ui as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,hi as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Gi as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,Bi as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,td as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,Yi as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,_c as TRANSACTION_BUFFER_DISCRIMINATOR,pd as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,ad as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Pd as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Sd as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Bd as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,vd as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,Yd as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,Gd as TRANSACTION_EXECUTE_DISCRIMINATOR,au as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,tu as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,gu as TransactionActionTypeSchema,HD as TransactionDetailsSchema,LN as TransactionPayloadSchema,ND as TransactionPayloadWithBase64MessageBytesSchema,po as Transports,BD as UserInfoSchema,_e as UserRole,Oc as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,RN as addWhitelistedAddressTrees,le as base64URLStringToBuffer,_w as bufferToBase64URLString,I5 as changeConfig,v6 as closeTransactionBuffer,nR as configAction,kw as convertBase64StringToJWK,Uw as convertJWKToBase64String,AA as convertMemberKeyToString,Dw as convertPubkeyCompressedToCose,Ew as convertPubkeyCoseToCompressed,Mw as createClientAuthorizationCompleteRequestChallenge,hw as createClientAuthorizationStartRequestChallenge,N8 as createDomainConfig,Y8 as createDomainUserAccounts,$8 as createGlobalCounter,Rw as createMessageChallenge,bA as createTransactionBuffer,bw as createTransactionChallenge,eh as createTransactionManagerSigner,R5 as createUserAccounts,L5 as createWallet,as as decodeDomainConfig,ps as decodeGlobalCounter,Pc as decodeSettings,Uc as decodeTransactionBuffer,Nc as decodeWhitelistedAddressTree,K5 as decompressSettingsAccount,C8 as deserializeConfigActions,nH as disableDomainConfig,Q5 as editDomainConfig,o6 as editTransactionManagerUrl,m6 as editUserDelegate,SA as executeTransaction,_A as executeTransactionBuffer,xA as executeTransactionSync,vA as extendTransactionBuffer,IR as extensionStruct,Xh as fetchAllDomainConfig,oM as fetchAllGlobalCounter,QA as fetchAllMaybeDomainConfig,mg as fetchAllMaybeGlobalCounter,c1 as fetchAllMaybeSettings,h1 as fetchAllMaybeTransactionBuffer,j1 as fetchAllMaybeWhitelistedAddressTree,qv as fetchAllSettings,R2 as fetchAllSettingsAccountByMember,$v as fetchAllTransactionBuffer,oU as fetchAllWhitelistedAddressTree,is as fetchDomainConfig,nM as fetchGlobalCounter,XA as fetchMaybeDomainConfig,pg as fetchMaybeGlobalCounter,mo as fetchMaybeSettings,kP as fetchMaybeSettingsAccountData,P1 as fetchMaybeTransactionBuffer,UP as fetchMaybeUserAccountData,K1 as fetchMaybeWhitelistedAddressTree,jv as fetchSettings,Nr as fetchSettingsAccountData,kc as fetchTransactionBuffer,M2 as fetchUserAccountByFilters,er as fetchUserAccountData,wc as fetchWhitelistedAddressTree,iM as getAccountStateCodec,Jr as getAccountStateDecoder,qr as getAccountStateEncoder,lM as getAddMemberArgsCodec,Qr as getAddMemberArgsDecoder,Xr as getAddMemberArgsEncoder,IU as getAddWhitelistedAddressTreesDiscriminatorBytes,EU as getAddWhitelistedAddressTreesInstruction,zc as getAddWhitelistedAddressTreesInstructionAsync,CU as getAddWhitelistedAddressTreesInstructionDataCodec,Gc as getAddWhitelistedAddressTreesInstructionDataDecoder,Co as getAddWhitelistedAddressTreesInstructionDataEncoder,AM as getAdditionalMetadataCodec,Zr as getAdditionalMetadataDecoder,Yr as getAdditionalMetadataEncoder,HU as getChangeConfigCompressedDiscriminatorBytes,ca as getChangeConfigCompressedInstruction,VU as getChangeConfigCompressedInstructionDataCodec,sa as getChangeConfigCompressedInstructionDataDecoder,oa as getChangeConfigCompressedInstructionDataEncoder,vU as getChangeConfigDiscriminatorBytes,Qc as getChangeConfigInstruction,UU as getChangeConfigInstructionDataCodec,Xc as getChangeConfigInstructionDataDecoder,Zc as getChangeConfigInstructionDataEncoder,Fo as getClientAndDeviceHash,fM as getCompiledInstructionCodec,en as getCompiledInstructionDecoder,$r as getCompiledInstructionEncoder,CM as getCompressedAccountMetaCodec,lt as getCompressedAccountMetaDecoder,mt as getCompressedAccountMetaEncoder,hM as getCompressedAccountMetaReadOnlyCodec,St as getCompressedAccountMetaReadOnlyDecoder,ft as getCompressedAccountMetaReadOnlyEncoder,bM as getCompressedOnlyExtensionCodec,rn as getCompressedOnlyExtensionDecoder,tn as getCompressedOnlyExtensionEncoder,UM as getCompressedProofCodec,dn as getCompressedProofDecoder,an as getCompressedProofEncoder,oe as getCompressedSettingsAddress,OM as getCompressedSettingsCodec,HM as getCompressedSettingsDataCodec,An as getCompressedSettingsDataDecoder,un as getCompressedSettingsDataEncoder,j as getCompressedSettingsDecoder,xt as getCompressedSettingsEncoder,zM as getCompressedTokenArgsCodec,Dt as getCompressedTokenArgsDecoder,Et as getCompressedTokenArgsEncoder,JM as getCompressibleExtensionCodec,fn as getCompressibleExtensionDecoder,yn as getCompressibleExtensionEncoder,QM as getCompressionInfoCodec,xn as getCompressionInfoDecoder,Sn as getCompressionInfoEncoder,rR as getConfigActionCodec,Fe as getConfigActionDecoder,Ve as getConfigActionEncoder,YU as getCreateCompressedWalletDiscriminatorBytes,XU as getCreateCompressedWalletInstruction,Aa as getCreateCompressedWalletInstructionAsync,ZU as getCreateCompressedWalletInstructionDataCodec,ua as getCreateCompressedWalletInstructionDataDecoder,Eo as getCreateCompressedWalletInstructionDataEncoder,sk as getCreateDomainConfigDiscriminatorBytes,ak as getCreateDomainConfigInstruction,Ia as getCreateDomainConfigInstructionAsync,ck as getCreateDomainConfigInstructionDataCodec,xa as getCreateDomainConfigInstructionDataDecoder,Po as getCreateDomainConfigInstructionDataEncoder,lk as getCreateDomainUserAccountDiscriminatorBytes,yk as getCreateDomainUserAccountInstruction,ha as getCreateDomainUserAccountInstructionAsync,Tk as getCreateDomainUserAccountInstructionDataCodec,Pa as getCreateDomainUserAccountInstructionDataDecoder,ho as getCreateDomainUserAccountInstructionDataEncoder,Dk as getCreateGlobalCounterDiscriminatorBytes,hk as getCreateGlobalCounterInstruction,_a as getCreateGlobalCounterInstructionAsync,Pk as getCreateGlobalCounterInstructionDataCodec,ba as getCreateGlobalCounterInstructionDataDecoder,Ro as getCreateGlobalCounterInstructionDataEncoder,iR as getCreateUserAccountArgsCodec,Un as getCreateUserAccountArgsDecoder,vn as getCreateUserAccountArgsEncoder,Wk as getCreateUserAccountsDiscriminatorBytes,Ok as getCreateUserAccountsInstruction,Wa as getCreateUserAccountsInstructionAsync,Lk as getCreateUserAccountsInstructionDataCodec,ka as getCreateUserAccountsInstructionDataDecoder,_o as getCreateUserAccountsInstructionDataEncoder,zk as getDecompressSettingsAccountDiscriminatorBytes,Ha as getDecompressSettingsAccountInstruction,Kk as getDecompressSettingsAccountInstructionDataCodec,wa as getDecompressSettingsAccountInstructionDataDecoder,Na as getDecompressSettingsAccountInstructionDataEncoder,Qk as getDisableDomainConfigDiscriminatorBytes,ja as getDisableDomainConfigInstruction,$k as getDisableDomainConfigInstructionDataCodec,Ka as getDisableDomainConfigInstructionDataDecoder,za as getDisableDomainConfigInstructionDataEncoder,at as getDomainConfigAddress,Zh as getDomainConfigCodec,cs as getDomainConfigDecoder,Yh as getDomainConfigDiscriminatorBytes,ZA as getDomainConfigEncoder,Qh as getDomainConfigSize,aW as getEditDomainConfigDiscriminatorBytes,Qa as getEditDomainConfigInstruction,dW as getEditDomainConfigInstructionAsync,iW as getEditDomainConfigInstructionDataCodec,Xa as getEditDomainConfigInstructionDataDecoder,Uo as getEditDomainConfigInstructionDataEncoder,gR as getEditMemberArgsCodec,Rn as getEditMemberArgsDecoder,Mn as getEditMemberArgsEncoder,yW as getEditTransactionManagerUrlDiscriminatorBytes,oi as getEditTransactionManagerUrlInstruction,fW as getEditTransactionManagerUrlInstructionDataCodec,ni as getEditTransactionManagerUrlInstructionDataDecoder,ri as getEditTransactionManagerUrlInstructionDataEncoder,hW as getEditUserDelegateDiscriminatorBytes,ui as getEditUserDelegateInstruction,MW as getEditUserDelegateInstructionDataCodec,di as getEditUserDelegateInstructionDataDecoder,ii as getEditUserDelegateInstructionDataEncoder,TR as getExpectedSignerCodec,Mt as getExpectedSignerDecoder,ht as getExpectedSignerEncoder,xR as getExtensionStructCodec,Pt as getExtensionStructDecoder,gn as getExtensionStructEncoder,cA as getGlobalCounterAddress,rM as getGlobalCounterCodec,gs as getGlobalCounterDecoder,tM as getGlobalCounterDiscriminatorBytes,gg as getGlobalCounterEncoder,sM as getGlobalCounterSize,Vo as getJitoTipsConfig,V2 as getLightCpiSigner,ye as getLightProtocolRpc,hR as getLinkWalletArgsCodec,zn as getLinkWalletArgsDecoder,Gn as getLinkWalletArgsEncoder,_R as getMemberCodec,Ct as getMemberDecoder,It as getMemberEncoder,kR as getMemberKeyCodec,$ as getMemberKeyDecoder,V as getMemberKeyEncoder,TN as getMultiWalletErrorMessage,KW as getNativeTransferIntentCompressedDiscriminatorBytes,xi as getNativeTransferIntentCompressedInstruction,jW as getNativeTransferIntentCompressedInstructionDataCodec,Si as getNativeTransferIntentCompressedInstructionDataDecoder,fi as getNativeTransferIntentCompressedInstructionDataEncoder,LW as getNativeTransferIntentDiscriminatorBytes,mi as getNativeTransferIntentInstruction,BW as getNativeTransferIntentInstructionAsync,OW as getNativeTransferIntentInstructionDataCodec,pi as getNativeTransferIntentInstructionDataDecoder,ko as getNativeTransferIntentInstructionDataEncoder,BR as getNewAuthorityArgsCodec,Jn as getNewAuthorityArgsDecoder,qn as getNewAuthorityArgsEncoder,vw as getOriginIndex,HR as getPackedAddressTreeInfoCodec,vt as getPackedAddressTreeInfoDecoder,_t as getPackedAddressTreeInfoEncoder,GR as getPackedMerkleContextCodec,mn as getPackedMerkleContextDecoder,pn as getPackedMerkleContextEncoder,jR as getPackedStateTreeInfoCodec,yt as getPackedStateTreeInfoDecoder,Tt as getPackedStateTreeInfoEncoder,YR as getPausableAccountExtensionCodec,Wn as getPausableAccountExtensionDecoder,kn as getPausableAccountExtensionEncoder,QR as getPermanentDelegateAccountExtensionCodec,On as getPermanentDelegateAccountExtensionDecoder,Ln as getPermanentDelegateAccountExtensionEncoder,tb as getPermissionsCodec,Ne as getPermissionsDecoder,Be as getPermissionsEncoder,sb as getProofArgsCodec,E as getProofArgsDecoder,C as getProofArgsEncoder,db as getRemoveMemberArgsCodec,_n as getRemoveMemberArgsDecoder,bn as getRemoveMemberArgsEncoder,gb as getRentConfigCodec,Dn as getRentConfigDecoder,En as getRentConfigEncoder,Go as getSecp256r1MessageHash,lb as getSecp256r1PubkeyCodec,Ut as getSecp256r1PubkeyDecoder,Xn as getSecp256r1PubkeyEncoder,lh as getSecp256r1SignatureOffsetsDataDecoder,mh as getSecp256r1SignatureOffsetsDataEncoder,fb as getSecp256r1VerifyArgsCodec,G as getSecp256r1VerifyArgsDecoder,F as getSecp256r1VerifyArgsEncoder,Cb as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,$n as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,Qn as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,H as getSecp256r1VerifyInstruction,TH as getSecp256r1VerifyInstructionDataCodec,yA as getSecp256r1VerifyInstructionDataDecoder,fA as getSecp256r1VerifyInstructionDataEncoder,Pu as getSendAndConfirmTransaction,Kv as getSettingsCodec,Sr as getSettingsDecoder,zv as getSettingsDiscriminatorBytes,s1 as getSettingsEncoder,Ce as getSettingsFromIndex,Rb as getSettingsIndexWithAddressAndDelegateInfoCodec,no as getSettingsIndexWithAddressAndDelegateInfoDecoder,ro as getSettingsIndexWithAddressAndDelegateInfoEncoder,Pb as getSettingsIndexWithAddressCodec,to as getSettingsIndexWithAddressDecoder,eo as getSettingsIndexWithAddressEncoder,Ub as getSettingsMutArgsCodec,K as getSettingsMutArgsDecoder,z as getSettingsMutArgsEncoder,Ob as getSettingsReadonlyArgsCodec,Wt as getSettingsReadonlyArgsDecoder,kt as getSettingsReadonlyArgsEncoder,Pw as getSignedSecp256r1Key,x8 as getSignedTransactionManager,Y as getSolanaRpc,Du as getSolanaRpcEndpoint,wb as getSplInterfacePdaArgsCodec,Ot as getSplInterfacePdaArgsDecoder,Lt as getSplInterfacePdaArgsEncoder,Gb as getTokenMetadataCodec,Nn as getTokenMetadataDecoder,Bn as getTokenMetadataEncoder,uL as getTokenTransferIntentCompressedDiscriminatorBytes,Wi as getTokenTransferIntentCompressedInstruction,gL as getTokenTransferIntentCompressedInstructionAsync,AL as getTokenTransferIntentCompressedInstructionDataCodec,ki as getTokenTransferIntentCompressedInstructionDataDecoder,Lo as getTokenTransferIntentCompressedInstructionDataEncoder,eL as getTokenTransferIntentDiscriminatorBytes,Ri as getTokenTransferIntentInstruction,rL as getTokenTransferIntentInstructionAsync,tL as getTokenTransferIntentInstructionDataCodec,Mi as getTokenTransferIntentInstructionDataDecoder,Wo as getTokenTransferIntentInstructionDataEncoder,aA as getTransactionBufferAddress,bL as getTransactionBufferCloseCompressedDiscriminatorBytes,ji as getTransactionBufferCloseCompressedInstruction,_L as getTransactionBufferCloseCompressedInstructionDataCodec,Ki as getTransactionBufferCloseCompressedInstructionDataDecoder,zi as getTransactionBufferCloseCompressedInstructionDataEncoder,xL as getTransactionBufferCloseDiscriminatorBytes,Hi as getTransactionBufferCloseInstruction,IL as getTransactionBufferCloseInstructionDataCodec,wi as getTransactionBufferCloseInstructionDataDecoder,Ni as getTransactionBufferCloseInstructionDataEncoder,Qv as getTransactionBufferCodec,qb as getTransactionBufferCreateArgsCodec,Nt as getTransactionBufferCreateArgsDecoder,Bt as getTransactionBufferCreateArgsEncoder,qL as getTransactionBufferCreateCompressedDiscriminatorBytes,od as getTransactionBufferCreateCompressedInstruction,JL as getTransactionBufferCreateCompressedInstructionDataCodec,nd as getTransactionBufferCreateCompressedInstructionDataDecoder,rd as getTransactionBufferCreateCompressedInstructionDataEncoder,NL as getTransactionBufferCreateDiscriminatorBytes,Qi as getTransactionBufferCreateInstruction,wL as getTransactionBufferCreateInstructionDataCodec,Xi as getTransactionBufferCreateInstructionDataDecoder,Zi as getTransactionBufferCreateInstructionDataEncoder,vc as getTransactionBufferDecoder,Xv as getTransactionBufferDiscriminatorBytes,D1 as getTransactionBufferEncoder,AO as getTransactionBufferExecuteCompressedDiscriminatorBytes,Td as getTransactionBufferExecuteCompressedInstruction,gO as getTransactionBufferExecuteCompressedInstructionDataCodec,ld as getTransactionBufferExecuteCompressedInstructionDataDecoder,md as getTransactionBufferExecuteCompressedInstructionDataEncoder,rO as getTransactionBufferExecuteDiscriminatorBytes,ud as getTransactionBufferExecuteInstruction,nO as getTransactionBufferExecuteInstructionDataCodec,dd as getTransactionBufferExecuteInstructionDataDecoder,id as getTransactionBufferExecuteInstructionDataEncoder,MO as getTransactionBufferExtendCompressedDiscriminatorBytes,Rd as getTransactionBufferExtendCompressedInstruction,RO as getTransactionBufferExtendCompressedInstructionDataCodec,Md as getTransactionBufferExtendCompressedInstructionDataDecoder,hd as getTransactionBufferExtendCompressedInstructionDataEncoder,SO as getTransactionBufferExtendDiscriminatorBytes,Cd as getTransactionBufferExtendInstruction,xO as getTransactionBufferExtendInstructionDataCodec,Id as getTransactionBufferExtendInstructionDataDecoder,xd as getTransactionBufferExtendInstructionDataEncoder,KO as getTransactionBufferVoteCompressedDiscriminatorBytes,Hd as getTransactionBufferVoteCompressedInstruction,jO as getTransactionBufferVoteCompressedInstructionDataCodec,wd as getTransactionBufferVoteCompressedInstructionDataDecoder,Nd as getTransactionBufferVoteCompressedInstructionDataEncoder,OO as getTransactionBufferVoteDiscriminatorBytes,Wd as getTransactionBufferVoteInstruction,BO as getTransactionBufferVoteInstructionDataCodec,kd as getTransactionBufferVoteInstructionDataDecoder,Ud as getTransactionBufferVoteInstructionDataEncoder,aB as getTransactionExecuteCompressedDiscriminatorBytes,Qd as getTransactionExecuteCompressedInstruction,iB as getTransactionExecuteCompressedInstructionDataCodec,Xd as getTransactionExecuteCompressedInstructionDataDecoder,Zd as getTransactionExecuteCompressedInstructionDataEncoder,$O as getTransactionExecuteDiscriminatorBytes,jd as getTransactionExecuteInstruction,eB as getTransactionExecuteInstructionDataCodec,Kd as getTransactionExecuteInstructionDataDecoder,zd as getTransactionExecuteInstructionDataEncoder,PB as getTransactionExecuteSyncCompressedDiscriminatorBytes,uu as getTransactionExecuteSyncCompressedInstruction,hB as getTransactionExecuteSyncCompressedInstructionDataCodec,du as getTransactionExecuteSyncCompressedInstructionDataDecoder,iu as getTransactionExecuteSyncCompressedInstructionDataEncoder,TB as getTransactionExecuteSyncDiscriminatorBytes,ou as getTransactionExecuteSyncInstruction,yB as getTransactionExecuteSyncInstructionDataCodec,nu as getTransactionExecuteSyncInstructionDataDecoder,ru as getTransactionExecuteSyncInstructionDataEncoder,e_ as getTransactionMessageAddressTableLookupCodec,go as getTransactionMessageAddressTableLookupDecoder,Ao as getTransactionMessageAddressTableLookupEncoder,Xb as getTransactionMessageCodec,Ht as getTransactionMessageDecoder,wt as getTransactionMessageEncoder,o_ as getTransactionSyncSignersCodec,J as getTransactionSyncSignersDecoder,q as getTransactionSyncSignersEncoder,d_ as getTransferFeeAccountExtensionCodec,Hn as getTransferFeeAccountExtensionDecoder,wn as getTransferFeeAccountExtensionEncoder,g_ as getTransferHookAccountExtensionCodec,Fn as getTransferHookAccountExtensionDecoder,Vn as getTransferHookAccountExtensionEncoder,l_ as getTransportsCodec,Ft as getTransportsDecoder,Vt as getTransportsEncoder,w as getUserAccountAddress,S_ as getUserCodec,E_ as getUserCreationArgsCodec,he as getUserCreationArgsDecoder,Pe as getUserCreationArgsEncoder,X as getUserDecoder,Gt as getUserEncoder,M_ as getUserMutArgsCodec,Ze as getUserMutArgsDecoder,Ye as getUserMutArgsEncoder,v_ as getUserReadOnlyArgsCodec,bt as getUserReadOnlyArgsDecoder,Rt as getUserReadOnlyArgsEncoder,L_ as getUserReadOnlyOrMutateArgsCodec,He as getUserReadOnlyOrMutateArgsDecoder,we as getUserReadOnlyOrMutateArgsEncoder,H_ as getUserRoleCodec,ze as getUserRoleDecoder,Ge as getUserRoleEncoder,H2 as getWalletAddressFromIndex,be as getWalletAddressFromSettings,nU as getWhitelistedAddressTreeCodec,Bc as getWhitelistedAddressTreeDecoder,rU as getWhitelistedAddressTreeDiscriminatorBytes,z1 as getWhitelistedAddressTreeEncoder,Yo as getWhitelistedAddressTreeFromIndex,b2 as getWhitelistedAddressTreeIndexFromAddress,tA as getWhitelistedAddressTreesAddress,dN as identifyMultiWalletAccount,uN as identifyMultiWalletInstruction,iw as initialize,oR as isConfigAction,CR as isExtensionStruct,yN as isMultiWalletError,c_ as isTransactionSyncSigners,B_ as isUserReadOnlyOrMutateArgs,jH as nativeTransferIntent,DU as parseAddWhitelistedAddressTreesInstruction,FU as parseChangeConfigCompressedInstruction,kU as parseChangeConfigInstruction,QU as parseCreateCompressedWalletInstruction,ik as parseCreateDomainConfigInstruction,fk as parseCreateDomainUserAccountInstruction,Mk as parseCreateGlobalCounterInstruction,Bk as parseCreateUserAccountsInstruction,jk as parseDecompressSettingsAccountInstruction,eW as parseDisableDomainConfigInstruction,uW as parseEditDomainConfigInstruction,SW as parseEditTransactionManagerUrlInstruction,RW as parseEditUserDelegateInstruction,qW as parseNativeTransferIntentCompressedInstruction,NW as parseNativeTransferIntentInstruction,yH as parseSecp256r1VerifyInstruction,pL as parseTokenTransferIntentCompressedInstruction,nL as parseTokenTransferIntentInstruction,vL as parseTransactionBufferCloseCompressedInstruction,CL as parseTransactionBufferCloseInstruction,YL as parseTransactionBufferCreateCompressedInstruction,HL as parseTransactionBufferCreateInstruction,pO as parseTransactionBufferExecuteCompressedInstruction,oO as parseTransactionBufferExecuteInstruction,bO as parseTransactionBufferExtendCompressedInstruction,IO as parseTransactionBufferExtendInstruction,qO as parseTransactionBufferVoteCompressedInstruction,NO as parseTransactionBufferVoteInstruction,dB as parseTransactionExecuteCompressedInstruction,tB as parseTransactionExecuteInstruction,MB as parseTransactionExecuteSyncCompressedInstruction,fB as parseTransactionExecuteSyncInstruction,X2 as pollJitoBundleConfirmation,xV as prepareChangeConfigArgs,RV as prepareTransactionBundle,VV as prepareTransactionMessage,jV as prepareTransactionSync,S8 as retrieveTransactionManager,BP as sendJitoBundle,I8 as serializeConfigActions,Z2 as signAndSendBundledTransactions,o8 as signAndSendTransaction,d5 as tokenTransferIntent,s_ as transactionSyncSigners,O_ as userReadOnlyOrMutateArgs,xu as vaultTransactionMessageDeserialize,Su as vaultTransactionMessageSerialize,UA as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
4
8
|
//# sourceMappingURL=index.js.map
|