@revibase/core 0.2.0 → 0.2.1
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 +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getOptionEncoder,getOptionDecoder,getArrayEncoder,getU64Encoder,getArrayDecoder,getU64Decoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getU16Encoder,getU16Decoder,getBooleanEncoder,getBooleanDecoder,getEnumEncoder,getEnumDecoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64Encoder,getBase64Decoder,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,getBlockhashDecoder,compileTransaction,getTransactionEncoder,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,encodeBN254toBase58,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import 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 {equalBytes}from'@noble/curves/utils.js';var ts=new Uint8Array([201,232,212,229,59,241,106,197]);function vC(){return fixEncoderSize(getBytesEncoder(),8).encode(ts)}function mu(){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:ts}))}function rs(){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 UC(){return combineCodec(mu(),rs())}function ns(e){return decodeAccount(e,rs())}async function ss(e,n,r){let s=await lu(e,n,r);return assertAccountExists(s),s}async function lu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ns(s)}async function LC(e,n,r){let s=await fu(e,n,r);return assertAccountsExist(s),s}async function fu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ns(t))}function WC(){return 846}var as=new Uint8Array([42,206,176,58,175,129,130,233]);function NC(){return fixEncoderSize(getBytesEncoder(),8).encode(as)}function Uu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:as}))}function is(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function wC(){return combineCodec(Uu(),is())}function ds(e){return decodeAccount(e,is())}async function kC(e,n,r){let s=await Lu(e,n,r);return assertAccountExists(s),s}async function Lu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ds(s)}async function HC(e,n,r){let s=await Wu(e,n,r);return assertAccountsExist(s),s}async function Wu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ds(t))}function VC(){return 24}function Pr(){return getStructEncoder([["memberKey",B()],["permissions",_e()],["userArgs",Ue()]])}function br(){return getStructDecoder([["memberKey",q()],["permissions",ve()],["userArgs",Le()]])}function KC(){return combineCodec(Pr(),br())}function _r(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function vr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function qC(){return combineCodec(_r(),vr())}function st(){return getStructEncoder([["treeInfo",ct()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function ot(){return getStructDecoder([["treeInfo",at()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function $C(){return combineCodec(st(),ot())}function it(){return getStructEncoder([["treeInfo",ct()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function dt(){return getStructDecoder([["treeInfo",at()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function rD(){return combineCodec(it(),dt())}function Br(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function Nr(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function oD(){return combineCodec(Br(),Nr())}function ut(){return getStructEncoder([["data",getOptionEncoder(wr())]])}function Y(){return getStructDecoder([["data",getOptionDecoder(kr())]])}function dD(){return combineCodec(ut(),Y())}function wr(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(At())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function kr(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(gt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function yD(){return combineCodec(wr(),kr())}function We(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Gr())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Pr())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(zr())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Oe(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Fr())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(br())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Kr())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function lD(){return combineCodec(We(),Oe())}function fD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function SD(e,n){return n.__kind===e}function jr(){return getStructEncoder([["member",getAddressEncoder()],["role",Be()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",fe()]])}function Jr(){return getStructDecoder([["member",getAddressDecoder()],["role",Ne()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",Se()]])}function CD(){return combineCodec(jr(),Jr())}function Gr(){return getStructEncoder([["memberKey",B()],["permissions",_e()]])}function Fr(){return getStructDecoder([["memberKey",q()],["permissions",ve()]])}function hD(){return combineCodec(Gr(),Fr())}function yt(){return getStructEncoder([["memberKey",B()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function pt(){return getStructDecoder([["memberKey",q()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function vD(){return combineCodec(yt(),pt())}function qr(){return getStructEncoder([["settingsMutArgs",k()],["transactionManager",getOptionEncoder(Tt())]])}function Yr(){return getStructDecoder([["settingsMutArgs",H()],["transactionManager",getOptionDecoder(mt())]])}function OD(){return combineCodec(qr(),Yr())}function At(){return getStructEncoder([["pubkey",B()],["role",getU8Encoder()],["permissions",_e()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function gt(){return getStructDecoder([["pubkey",q()],["role",getU8Decoder()],["permissions",ve()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function kD(){return combineCodec(At(),gt())}function B(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function q(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function GD(){return combineCodec(B(),q())}function $r(){return getStructEncoder([["authorityCreationArgs",fe()],["compressedProofArgs",M()]])}function Qr(){return getStructDecoder([["authorityCreationArgs",Se()],["compressedProofArgs",R()]])}function jD(){return combineCodec($r(),Qr())}function lt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function ft(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function YD(){return combineCodec(lt(),ft())}function ct(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function at(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function $D(){return combineCodec(ct(),at())}function _e(){return getStructEncoder([["mask",getU8Encoder()]])}function ve(){return getStructDecoder([["mask",getU8Decoder()]])}function tM(){return combineCodec(_e(),ve())}function M(){return getStructEncoder([["proof",getOptionEncoder(Br())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function R(){return getStructDecoder([["proof",getOptionDecoder(Nr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function oM(){return combineCodec(M(),R())}function zr(){return getStructEncoder([["memberKey",B()],["userArgs",Ue()]])}function Kr(){return getStructDecoder([["memberKey",q()],["userArgs",Le()]])}function dM(){return combineCodec(zr(),Kr())}function en(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function St(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function gM(){return combineCodec(en(),St())}function N(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function w(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function TM(){return combineCodec(N(),w())}function tn(){return getStructEncoder([["verifyArgs",N()],["domainConfigIndex",getU8Encoder()]])}function rn(){return getStructDecoder([["verifyArgs",w()],["domainConfigIndex",getU8Decoder()]])}function SM(){return combineCodec(tn(),rn())}function nn(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function sn(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function EM(){return combineCodec(nn(),sn())}function on(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function cn(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function MM(){return combineCodec(on(),cn())}function k(){return getStructEncoder([["accountMeta",st()],["data",ut()]])}function H(){return getStructDecoder([["accountMeta",ot()],["data",Y()]])}function bM(){return combineCodec(k(),H())}function xt(){return getStructEncoder([["accountMeta",it()],["data",ut()]])}function It(){return getStructDecoder([["accountMeta",dt()],["data",Y()]])}function LM(){return combineCodec(xt(),It())}function Et(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(yt())]])}function Ct(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(pt())]])}function NM(){return combineCodec(Et(),Ct())}function Dt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(_r())],["addressTableLookups",getArrayEncoder(an())]])}function Mt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(vr())],["addressTableLookups",getArrayDecoder(dn())]])}function VM(){return combineCodec(Dt(),Mt())}function an(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function dn(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function zM(){return combineCodec(an(),dn())}function G(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([tn()])]])]])}function F(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([rn()])]])]])}function qM(){return combineCodec(G(),F())}function YM(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function XM(e,n){return n.__kind===e}var un=(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))(un||{});function Rt(){return getEnumEncoder(un)}function ht(){return getEnumDecoder(un)}function QM(){return combineCodec(Rt(),ht())}function Pt(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",B()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(Rt()))],["wallets",getArrayEncoder(on())],["role",Be()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function K(){return getStructDecoder([["domainConfig",getOptionDecoder(getAddressDecoder())],["member",q()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(ht()))],["wallets",getArrayDecoder(cn())],["role",Ne()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function nR(){return combineCodec(Pt(),K())}function fe(){return getStructEncoder([["addressTreeInfo",lt()],["outputStateTreeIndex",getU8Encoder()]])}function Se(){return getStructDecoder([["addressTreeInfo",ft()],["outputStateTreeIndex",getU8Decoder()]])}function aR(){return combineCodec(fe(),Se())}function we(){return getStructEncoder([["accountMeta",st()],["data",Pt()]])}function ke(){return getStructDecoder([["accountMeta",ot()],["data",K()]])}function AR(){return combineCodec(we(),ke())}function Tt(){return getStructEncoder([["accountMeta",it()],["data",Pt()]])}function mt(){return getStructDecoder([["accountMeta",dt()],["data",K()]])}function TR(){return combineCodec(Tt(),mt())}function Ue(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Tt()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([we()])]])]])}function Le(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([mt()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([ke()])]])]])}function SR(){return combineCodec(Ue(),Le())}function xR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function IR(e,n){return n.__kind===e}var Ce=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(Ce||{});function Be(){return getEnumEncoder(Ce)}function Ne(){return getEnumDecoder(Ce)}function DR(){return combineCodec(Be(),Ne())}var eo=new Uint8Array([223,179,163,190,177,224,67,173]);function yh(){return fixEncoderSize(getBytesEncoder(),8).encode(eo)}function rp(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(At())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:eo}))}function nr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(gt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function ph(){return combineCodec(rp(),nr())}function to(e){return decodeAccount(e,nr())}async function Th(e,n,r){let s=await An(e,n,r);return assertAccountExists(s),s}async function An(e,n,r){let s=await fetchEncodedAccount(e,n,r);return to(s)}async function mh(e,n,r){let s=await np(e,n,r);return assertAccountsExist(s),s}async function np(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>to(t))}var co=new Uint8Array([90,36,35,219,93,225,110,96]);function xh(){return fixEncoderSize(getBytesEncoder(),8).encode(co)}function Ip(){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",B()],["executor",B()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(B())],["expectedSigners",getArrayEncoder(yt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:co}))}function ao(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multiWalletSettings",getAddressDecoder()],["multiWalletBump",getU8Decoder()],["canExecute",getBooleanDecoder()],["preauthorizeExecution",getBooleanDecoder()],["validTill",getU64Decoder()],["payer",getAddressDecoder()],["bump",getU8Decoder()],["bufferIndex",getU8Decoder()],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["creator",q()],["executor",q()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(q())],["expectedSigners",getArrayDecoder(pt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Ih(){return combineCodec(Ip(),ao())}function io(e){return decodeAccount(e,ao())}async function uo(e,n,r){let s=await Ep(e,n,r);return assertAccountExists(s),s}async function Ep(e,n,r){let s=await fetchEncodedAccount(e,n,r);return io(s)}async function Eh(e,n,r){let s=await Cp(e,n,r);return assertAccountsExist(s),s}async function Cp(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>io(t))}var yo=new Uint8Array([105,23,173,2,197,255,80,87]);function Mh(){return fixEncoderSize(getBytesEncoder(),8).encode(yo)}function Vp(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:yo}))}function po(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function Rh(){return combineCodec(Vp(),po())}function To(e){return decodeAccount(e,po())}async function mo(e,n,r){let s=await Gp(e,n,r);return assertAccountExists(s),s}async function Gp(e,n,r){let s=await fetchEncodedAccount(e,n,r);return To(s)}async function hh(e,n,r){let s=await Fp(e,n,r);return assertAccountsExist(s),s}async function Fp(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>To(t))}function T({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 j(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 m(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let s=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:j(r.value),role:lo(r.value)?upgradeRoleToSigner(s):s,...lo(r.value)?{signer:r.value}:{}})}}function lo(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var So=new Uint8Array([8]);function zh(){return fixEncoderSize(getBytesEncoder(),1).encode(So)}function Sn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:So}))}function xo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function Kh(){return combineCodec(Sn(),xo())}async function Io(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.whitelistedAddressTrees),c(t.payer),c(t.systemProgram),...a],data:Sn().encode(o),programAddress:r})}function jh(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.whitelistedAddressTrees),c(t.payer),c(t.systemProgram),...a],data:Sn().encode(o),programAddress:r})}function Jh(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:xo().decode(e.data)}}var Ro=new Uint8Array([9]);function eP(){return fixEncoderSize(getBytesEncoder(),1).encode(Ro)}function ho(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(We())],["signers",getArrayEncoder(G())],["compressedProofArgs",getOptionEncoder(M())]]),e=>({...e,discriminator:Ro}))}function Po(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Oe())],["signers",getArrayDecoder(F())],["compressedProofArgs",getOptionDecoder(R())]])}function tP(){return combineCodec(ho(),Po())}function bo(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.payer),c(t.systemProgram),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:ho().encode(o),programAddress:r})}function rP(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Po().decode(e.data)}}var Wo=new Uint8Array([19]);function dP(){return fixEncoderSize(getBytesEncoder(),1).encode(Wo)}function Oo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(We())],["signers",getArrayEncoder(G())],["settingsMutArgs",k()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Wo}))}function Bo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Oe())],["signers",getArrayDecoder(F())],["settingsMutArgs",H()],["compressedProofArgs",R()]])}function uP(){return combineCodec(Oo(),Bo())}function No(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:Oo().encode(o),programAddress:r})}function AP(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Bo().decode(e.data)}}var Ho=new Uint8Array([18]);function fP(){return fixEncoderSize(getBytesEncoder(),1).encode(Ho)}function xn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["addressTreeInfo",lt()],["outputStateTreeIndex",getU8Encoder()],["userArgs",Ue()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Ho}))}function Vo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",R()],["addressTreeInfo",ft()],["outputStateTreeIndex",getU8Decoder()],["userArgs",Le()],["settingsIndex",getU128Decoder()]])}function SP(){return combineCodec(xn(),Vo())}async function Go(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.initialMember),c(t.systemProgram),c(t.globalCounter),c(t.whitelistedAddressTrees),...a],data:xn().encode(o),programAddress:r})}function xP(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.initialMember),c(t.systemProgram),c(t.globalCounter),c(t.whitelistedAddressTrees),...a],data:xn().encode(o),programAddress:r})}function IP(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:Vo().decode(e.data)}}var Xo=new Uint8Array([0]);function PP(){return fixEncoderSize(getBytesEncoder(),1).encode(Xo)}function En(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",fe()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Xo}))}function Zo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",Se()],["compressedProofArgs",R()]])}function bP(){return combineCodec(En(),Zo())}async function $o(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.domainConfig),c(t.payer),c(t.authority),c(t.systemProgram),c(t.whitelistedAddressTrees),...a],data:En().encode(o),programAddress:r})}function _P(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.domainConfig),c(t.payer),c(t.authority),c(t.systemProgram),c(t.whitelistedAddressTrees),...a],data:En().encode(o),programAddress:r})}function vP(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Zo().decode(e.data)}}var tc=new Uint8Array([4]);function wP(){return fixEncoderSize(getBytesEncoder(),1).encode(tc)}function Cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["member",en()],["role",Be()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(Rt())],["userAccountCreationArgs",fe()],["linkWalletArgs",getOptionEncoder(qr())]]),e=>({...e,discriminator:tc}))}function rc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",R()],["member",St()],["role",Ne()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(ht())],["userAccountCreationArgs",Se()],["linkWalletArgs",getOptionDecoder(Yr())]])}function kP(){return combineCodec(Cn(),rc())}async function nc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.domainConfig),c(t.authority),c(t.whitelistedAddressTrees),...a],data:Cn().encode(o),programAddress:r})}function HP(e,n){let r=n?.programAddress??u,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}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.domainConfig),c(t.authority),c(t.whitelistedAddressTrees),...a],data:Cn().encode(o),programAddress:r})}function VP(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:rc().decode(e.data)}}var oc=new Uint8Array([3]);function JP(){return fixEncoderSize(getBytesEncoder(),1).encode(oc)}function Mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:oc}))}function cc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function qP(){return combineCodec(Mn(),cc())}async function ac(e,n){let r=n?.programAddress??u,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={};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=T(o),a=m(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:Mn().encode({}),programAddress:r})}function YP(e,n){let r=n?.programAddress??u,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=T(o),a=m(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:Mn().encode({}),programAddress:r})}function XP(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:cc().decode(e.data)}}var dc=new Uint8Array([5]);function nb(){return fixEncoderSize(getBytesEncoder(),1).encode(dc)}function hn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayEncoder(jr())]]),e=>({...e,discriminator:dc}))}function uc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",R()],["createUserArgs",getArrayDecoder(Jr())]])}function sb(){return combineCodec(hn(),uc())}async function Ac(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.systemProgram),c(t.whitelistedAddressTrees),...a],data:hn().encode(o),programAddress:r})}function ob(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.systemProgram),c(t.whitelistedAddressTrees),...a],data:hn().encode(o),programAddress:r})}function cb(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:uc().decode(e.data)}}var pc=new Uint8Array([17]);function yb(){return fixEncoderSize(getBytesEncoder(),1).encode(pc)}function Tc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",k()],["compressedProofArgs",M()],["signers",getArrayEncoder(G())]]),e=>({...e,discriminator:pc}))}function mc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",H()],["compressedProofArgs",R()],["signers",getArrayDecoder(F())]])}function pb(){return combineCodec(Tc(),mc())}function lc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.payer),c(t.systemProgram),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:Tc().encode(o),programAddress:r})}function Tb(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:mc().decode(e.data)}}var xc=new Uint8Array([2]);function Ib(){return fixEncoderSize(getBytesEncoder(),1).encode(xc)}function Ic(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:xc}))}function Ec(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function Eb(){return combineCodec(Ic(),Ec())}function Cc(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.domainConfig),c(t.admin),...a],data:Ic().encode(o),programAddress:r})}function Cb(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:Ec().decode(e.data)}}var hc=new Uint8Array([1]);function _b(){return fixEncoderSize(getBytesEncoder(),1).encode(hc)}function bn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder($r())]]),e=>({...e,discriminator:hc}))}function Pc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Qr())]])}function vb(){return combineCodec(bn(),Pc())}async function Ub(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.domainConfig),c(t.authority),c(t.newAuthority),c(t.whitelistedAddressTrees),c(t.systemProgram),...a],data:bn().encode(o),programAddress:r})}function bc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.domainConfig),c(t.authority),c(t.newAuthority),c(t.whitelistedAddressTrees),c(t.systemProgram),...a],data:bn().encode(o),programAddress:r})}function Lb(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:Pc().decode(e.data)}}var Uc=new Uint8Array([6]);function Hb(){return fixEncoderSize(getBytesEncoder(),1).encode(Uc)}function Lc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",we()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",M()]]),e=>({...e,discriminator:Uc}))}function Wc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",ke()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",R()]])}function Vb(){return combineCodec(Lc(),Wc())}function Oc(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.authority),...a],data:Lc().encode(o),programAddress:r})}function Gb(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Wc().decode(e.data)}}var wc=new Uint8Array([7]);function Yb(){return fixEncoderSize(getBytesEncoder(),1).encode(wc)}function kc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",we()],["secp256r1VerifyArgs",getOptionEncoder(N())],["delegateTo",getOptionEncoder(nn())],["oldSettingsMutArgs",getOptionEncoder(k())],["newSettingsMutArgs",getOptionEncoder(k())],["compressedProofArgs",M()]]),e=>({...e,discriminator:wc}))}function Hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",ke()],["secp256r1VerifyArgs",getOptionDecoder(w())],["delegateTo",getOptionDecoder(sn())],["oldSettingsMutArgs",getOptionDecoder(H())],["newSettingsMutArgs",getOptionDecoder(H())],["compressedProofArgs",R()]])}function Xb(){return combineCodec(kc(),Hc())}function Vc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.feePayer),c(t.signer),c(t.oldSettings),c(t.newSettings),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.domainConfig),...a],data:kc().encode(o),programAddress:r})}function Zb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:Hc().decode(e.data)}}var Fc=new Uint8Array([29]);function s_(){return fixEncoderSize(getBytesEncoder(),1).encode(Fc)}function _n(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(G())]]),e=>({...e,discriminator:Fc}))}function zc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(F())]])}function o_(){return combineCodec(_n(),zc())}async function c_(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};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(j(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.destination),c(t.systemProgram),...a],data:_n().encode(o),programAddress:r})}function Kc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.destination),c(t.systemProgram),...a],data:_n().encode(o),programAddress:r})}function a_(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:zc().decode(e.data)}}var qc=new Uint8Array([27]);function p_(){return fixEncoderSize(getBytesEncoder(),1).encode(qc)}function Yc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(G())],["settingsMutArgs",k()],["compressedProofArgs",M()]]),e=>({...e,discriminator:qc}))}function Xc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(F())],["settingsMutArgs",H()],["compressedProofArgs",R()]])}function T_(){return combineCodec(Yc(),Xc())}function Zc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.destination),c(t.systemProgram),...a],data:Yc().encode(o),programAddress:r})}function m_(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Xc().decode(e.data)}}var Qc=new Uint8Array([30]);function C_(){return fixEncoderSize(getBytesEncoder(),1).encode(Qc)}function Un(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(G())]]),e=>({...e,discriminator:Qc}))}function ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(F())]])}function D_(){return combineCodec(Un(),ea())}async function ta(e,n){let r=n?.programAddress??u,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},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};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(j(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(j(t.source.value)),getAddressEncoder().encode(j(t.tokenProgram.value)),getAddressEncoder().encode(j(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(j(t.destination.value)),getAddressEncoder().encode(j(t.tokenProgram.value)),getAddressEncoder().encode(j(t.mint.value))]})),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.sourceSplTokenAccount),c(t.destination),c(t.destinationSplTokenAccount),c(t.tokenProgram),c(t.mint),c(t.associatedTokenProgram),c(t.systemProgram),...a],data:Un().encode(o),programAddress:r})}function M_(e,n){let r=n?.programAddress??u,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},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.sourceSplTokenAccount),c(t.destination),c(t.destinationSplTokenAccount),c(t.tokenProgram),c(t.mint),c(t.associatedTokenProgram),c(t.systemProgram),...a],data:Un().encode(o),programAddress:r})}function R_(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),destination:r(),destinationSplTokenAccount:r(),tokenProgram:r(),mint:r(),associatedTokenProgram:r(),systemProgram:r()},data:ea().decode(e.data)}}var oa=new Uint8Array([28]);function L_(){return fixEncoderSize(getBytesEncoder(),1).encode(oa)}function Ln(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(G())],["settingsMutArgs",k()],["compressedProofArgs",M()]]),e=>({...e,discriminator:oa}))}function ca(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(F())],["settingsMutArgs",H()],["compressedProofArgs",R()]])}function W_(){return combineCodec(Ln(),ca())}async function aa(e,n){let r=n?.programAddress??u,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},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};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(j(t.source.value)),getAddressEncoder().encode(j(t.tokenProgram.value)),getAddressEncoder().encode(j(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(j(t.destination.value)),getAddressEncoder().encode(j(t.tokenProgram.value)),getAddressEncoder().encode(j(t.mint.value))]})),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.sourceSplTokenAccount),c(t.destination),c(t.destinationSplTokenAccount),c(t.tokenProgram),c(t.mint),c(t.associatedTokenProgram),c(t.systemProgram),...a],data:Ln().encode(o),programAddress:r})}function O_(e,n){let r=n?.programAddress??u,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},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.sourceSplTokenAccount),c(t.destination),c(t.destinationSplTokenAccount),c(t.tokenProgram),c(t.mint),c(t.associatedTokenProgram),c(t.systemProgram),...a],data:Ln().encode(o),programAddress:r})}function B_(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),destination:r(),destinationSplTokenAccount:r(),tokenProgram:r(),mint:r(),associatedTokenProgram:r(),systemProgram:r()},data:ca().decode(e.data)}}var ua=new Uint8Array([13]);function F_(){return fixEncoderSize(getBytesEncoder(),1).encode(ua)}function Aa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:ua}))}function ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function z_(){return combineCodec(Aa(),ga())}function ya(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.payer),c(t.domainConfig),c(t.transactionBuffer),c(t.closer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:Aa().encode(o),programAddress:r})}function K_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ga().decode(e.data)}}var ma=new Uint8Array([23]);function $_(){return fixEncoderSize(getBytesEncoder(),1).encode(ma)}function la(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())],["settingsMutArgs",k()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ma}))}function fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsMutArgs",H()],["compressedProofArgs",R()]])}function Q_(){return combineCodec(la(),fa())}function Sa(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.rentCollector),c(t.domainConfig),c(t.transactionBuffer),c(t.closer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:la().encode(o),programAddress:r})}function ev(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:fa().decode(e.data)}}var Ea=new Uint8Array([10]);function av(){return fixEncoderSize(getBytesEncoder(),1).encode(Ea)}function Ca(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Et()],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:Ea}))}function Da(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Ct()],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function iv(){return combineCodec(Ca(),Da())}function Ma(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.payer),c(t.domainConfig),c(t.transactionBuffer),c(t.creator),c(t.systemProgram),c(t.instructionsSysvar),c(t.slotHashSysvar),...a],data:Ca().encode(o),programAddress:r})}function dv(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Da().decode(e.data)}}var Pa=new Uint8Array([20]);function mv(){return fixEncoderSize(getBytesEncoder(),1).encode(Pa)}function ba(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Et()],["secp256r1VerifyArgs",getOptionEncoder(N())],["settingsReadonlyArgs",xt()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Pa}))}function _a(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Ct()],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",It()],["compressedProofArgs",R()]])}function lv(){return combineCodec(ba(),_a())}function va(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.domainConfig),c(t.transactionBuffer),c(t.creator),c(t.systemProgram),c(t.instructionsSysvar),c(t.slotHashSysvar),...a],data:ba().encode(o),programAddress:r})}function fv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:_a().decode(e.data)}}var Wa=new Uint8Array([14]);function Mv(){return fixEncoderSize(getBytesEncoder(),1).encode(Wa)}function Oa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:Wa}))}function Ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Rv(){return combineCodec(Oa(),Ba())}function Na(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.domainConfig),c(t.executor),c(t.transactionBuffer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:Oa().encode(o),programAddress:r})}function hv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ba().decode(e.data)}}var Ha=new Uint8Array([24]);function Wv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ha)}function Va(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())],["settingsMutArgs",k()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ha}))}function Ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsMutArgs",H()],["compressedProofArgs",R()]])}function Ov(){return combineCodec(Va(),Ga())}function Fa(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.domainConfig),c(t.executor),c(t.transactionBuffer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:Va().encode(o),programAddress:r})}function Bv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ga().decode(e.data)}}var ja=new Uint8Array([12]);function Gv(){return fixEncoderSize(getBytesEncoder(),1).encode(ja)}function Ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:ja}))}function qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Fv(){return combineCodec(Ja(),qa())}function Ya(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.transactionBuffer),...a],data:Ja().encode(o),programAddress:r})}function zv(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:qa().decode(e.data)}}var $a=new Uint8Array([22]);function Xv(){return fixEncoderSize(getBytesEncoder(),1).encode($a)}function Qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:$a}))}function ei(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function Zv(){return combineCodec(Qa(),ei())}function ti(e,n){let r=n?.programAddress??u,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.transactionBuffer),...a],data:Qa().encode(o),programAddress:r})}function $v(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:ei().decode(e.data)}}var si=new Uint8Array([11]);function oU(){return fixEncoderSize(getBytesEncoder(),1).encode(si)}function oi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:si}))}function ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function cU(){return combineCodec(oi(),ci())}function ai(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.domainConfig),c(t.transactionBuffer),c(t.voter),c(t.systemProgram),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:oi().encode(o),programAddress:r})}function aU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ci().decode(e.data)}}var ui=new Uint8Array([21]);function pU(){return fixEncoderSize(getBytesEncoder(),1).encode(ui)}function Ai(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())],["settingsReadonlyArgs",xt()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ui}))}function gi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",It()],["compressedProofArgs",R()]])}function TU(){return combineCodec(Ai(),gi())}function yi(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.domainConfig),c(t.transactionBuffer),c(t.voter),c(t.systemProgram),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:Ai().encode(o),programAddress:r})}function mU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:gi().decode(e.data)}}var mi=new Uint8Array([15]);function EU(){return fixEncoderSize(getBytesEncoder(),1).encode(mi)}function li(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:mi}))}function fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function CU(){return combineCodec(li(),fi())}function Si(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=T({}),a=m(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:li().encode({}),programAddress:r})}function DU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:fi().decode(e.data)}}var Ei=new Uint8Array([25]);function _U(){return fixEncoderSize(getBytesEncoder(),1).encode(Ei)}function Ci(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Ei}))}function Di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function vU(){return combineCodec(Ci(),Di())}function Mi(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.transactionBuffer),...a],data:Ci().encode(o),programAddress:r})}function UU(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:Di().decode(e.data)}}var Pi=new Uint8Array([16]);function kU(){return fixEncoderSize(getBytesEncoder(),1).encode(Pi)}function bi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Dt()],["signers",getArrayEncoder(G())]]),e=>({...e,discriminator:Pi}))}function _i(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Mt()],["signers",getArrayDecoder(F())]])}function HU(){return combineCodec(bi(),_i())}function vi(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:bi().encode(o),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},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:_i().decode(e.data)}}var Wi=new Uint8Array([26]);function qU(){return fixEncoderSize(getBytesEncoder(),1).encode(Wi)}function Oi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Dt()],["signers",getArrayEncoder(G())],["settingsMutArgs",k()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Wi}))}function Bi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Mt()],["signers",getArrayDecoder(F())],["settingsMutArgs",H()],["compressedProofArgs",R()]])}function YU(){return combineCodec(Oi(),Bi())}function Ni(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:Oi().encode(o),programAddress:r})}function XU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Bi().decode(e.data)}}var u="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",ex=(o=>(o[o.DomainConfig=0]="DomainConfig",o[o.GlobalCounter=1]="GlobalCounter",o[o.Settings=2]="Settings",o[o.TransactionBuffer=3]="TransactionBuffer",o[o.WhitelistedAddressTree=4]="WhitelistedAddressTree",o))(ex||{});function UL(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 tx=(l=>(l[l.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",l[l.ChangeConfig=1]="ChangeConfig",l[l.ChangeConfigCompressed=2]="ChangeConfigCompressed",l[l.CreateCompressedWallet=3]="CreateCompressedWallet",l[l.CreateDomainConfig=4]="CreateDomainConfig",l[l.CreateDomainUserAccount=5]="CreateDomainUserAccount",l[l.CreateGlobalCounter=6]="CreateGlobalCounter",l[l.CreateUserAccounts=7]="CreateUserAccounts",l[l.DecompressSettingsAccount=8]="DecompressSettingsAccount",l[l.DisableDomainConfig=9]="DisableDomainConfig",l[l.EditDomainConfig=10]="EditDomainConfig",l[l.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",l[l.EditUserDelegate=12]="EditUserDelegate",l[l.NativeTransferIntent=13]="NativeTransferIntent",l[l.NativeTransferIntentCompressed=14]="NativeTransferIntentCompressed",l[l.TokenTransferIntent=15]="TokenTransferIntent",l[l.TokenTransferIntentCompressed=16]="TokenTransferIntentCompressed",l[l.TransactionBufferClose=17]="TransactionBufferClose",l[l.TransactionBufferCloseCompressed=18]="TransactionBufferCloseCompressed",l[l.TransactionBufferCreate=19]="TransactionBufferCreate",l[l.TransactionBufferCreateCompressed=20]="TransactionBufferCreateCompressed",l[l.TransactionBufferExecute=21]="TransactionBufferExecute",l[l.TransactionBufferExecuteCompressed=22]="TransactionBufferExecuteCompressed",l[l.TransactionBufferExtend=23]="TransactionBufferExtend",l[l.TransactionBufferExtendCompressed=24]="TransactionBufferExtendCompressed",l[l.TransactionBufferVote=25]="TransactionBufferVote",l[l.TransactionBufferVoteCompressed=26]="TransactionBufferVoteCompressed",l[l.TransactionExecute=27]="TransactionExecute",l[l.TransactionExecuteCompressed=28]="TransactionExecuteCompressed",l[l.TransactionExecuteSync=29]="TransactionExecuteSync",l[l.TransactionExecuteSyncCompressed=30]="TransactionExecuteSyncCompressed",l))(tx||{});function LL(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 nx=6e3,sx=6001,ox=6002,cx=6003,ax=6004,ix=6005,dx=6006,ux=6007,Ax=6008,gx=6009,yx=6010,px=6011,Tx=6012,mx=6013,lx=6014,fx=6015,Sx=6016,xx=6017,Ix=6018,Ex=6019,Cx=6020,Dx=6021,Mx=6022,Rx=6023,hx=6024,Px=6025,bx=6026,_x=6027,vx=6028,Ux=6029,Lx=6030,Wx=6031,Ox=6032,Bx=6033,Nx=6034,wx=6035,kx=6036,Hx=6037,Vx=6038,Gx=6039,Fx=6040,zx=6041,Kx=6042,jx=6043,Jx=6044,qx=6045,Yx=6046,Xx=6047,Zx=6048,$x=6049,Qx=6050,eI=6051,tI=6052,rI=6053,nI=6054,sI=6055,oI=6056,cI=6057,aI=6058,iI=6059,dI=6060,uI=6061,AI=6062,gI=6063,yI=6064,pI=6065,TI=6066,mI=6067,lI=6068,fI=6069,SI=6070,xI=6071,II=6072,EI=6073,CI=6074,DI=6075,MI=6076,RI=6077,hI=6078,PI=6079,bI=6080,_I=6081,vI=6082,UI=6083,LI=6084,WI=6085,OI=6086,wi;process.env.NODE_ENV!=="production"&&(wi={[Wx]:"This member is already delegated to another wallet.",[ux]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[RI]:"Clock sysvar access failed. This may indicate a system error.",[eI]:"Missing credential id.",[rI]:"The domain configuration account is disabled. Please contact support or try again later.",[nI]:"Missing domain configuration account.",[DI]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[OI]:"Duplicate address tree detected. This address tree is already in the whitelist.",[yx]:"Duplicate public keys detected among members. Each member must have a unique key.",[gx]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[Dx]:"No members provided. A multisig wallet must contain at least one member.",[dI]:"Slot numbers list is empty. At least one slot number is required for validation.",[Ix]:"Expected a User with Administrator role for this instruction.",[Ax]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[Sx]:"Expected a User with Transaction Manager role for this instruction.",[Fx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[zx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Kx]:"Declared buffer size does not match the actual serialized size.",[iI]:"Failed to compute hash. This may indicate a system error.",[Nx]:"Not enough members with vote permission to meet the approval threshold.",[Ox]:"At least one signer with execute permission is required to proceed.",[Bx]:"At least one signer with initiate permission is required to perform this action.",[bx]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[CI]:"Invalid account index in transaction message. The account index is out of bounds.",[cI]:"Address Tree supplied is not part of the whitelisted address trees.",[Ex]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[vx]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Gx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[uI]:"Member key conversion failed. The provided key format is invalid.",[wx]:"Only delegated members are allowed for this transaction.",[Px]:"Unexpected number of accounts provided for this instruction.",[mx]:"User with Permanent Member role must have a delegated wallet.",[sx]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[ax]:"The extracted public key has an invalid length or encoding.",[nx]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[cx]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[Qx]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[Zx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[Rx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[xI]:"Invalid source type for token transfer. The source account type is not supported.",[xx]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[fx]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[hx]:"Malformed transaction message: structure or formatting does not match the expected layout.",[bI]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[_x]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[PI]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[SI]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[ix]:"The extracted WebAuthn signed message payload is malformed.",[Yx]:"An input string exceeds the maximum allowed character length.",[sI]:"This member is not registered under the provided domain configuration.",[yI]:"Member not found in settings. Cannot remove a member that does not exist.",[EI]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[Ux]:"A required account is missing from the instruction context.",[AI]:"Compressed proof arguments are missing. Required for compressed account operations.",[mI]:"Missing compressed token account. Required for token transfer operations.",[_I]:"Missing destination token account. Required for token transfer operations.",[fI]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[gI]:"Light CPI accounts are missing. Required for compressed account operations.",[Lx]:"User mutation arguments are required when performing add or remove delegate operations.",[LI]:"Missing new authority account. Required for domain configuration updates.",[UI]:"Missing settings account. Required for delegate operations on compressed wallets.",[aI]:"Compressed settings data is missing. The settings account must be initialized with data.",[vI]:"Missing source token account. Required for token transfer operations.",[lI]:"Missing SPL interface PDA. Required for token transfer operations.",[Xx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[MI]:"User account address is missing. Required for secp256r1 signature verification.",[WI]:"Missing whitelisted address trees account. Required for domain configuration updates.",[Hx]:"No valid signer found in this transaction.",[Cx]:"Only one administrator is allowed per wallet.",[Tx]:"Only one permanent member is allowed per wallet.",[lx]:"Only one transaction manager is allowed per wallet.",[oI]:"The given origin index is not in the whitelisted origins.",[TI]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[px]:"Permanent members cannot be removed from a wallet.",[qx]:"Writable CPI calls to protected accounts are not permitted.",[dx]:"The rpIdHash extracted from the signed message does not match the expected value.",[pI]:"Settings key mismatch. The provided settings key does not match the expected value.",[ox]:"The signature index provided is out of bounds for the secp256r1 instruction.",[$x]:"The specified slot number was not found in the provided slot history.",[II]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[Mx]:"Too many members: a maximum of 4 members are supported.",[jx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[Jx]:"This transaction has not yet reached the required approval threshold.",[tI]:"Missing transports.",[Vx]:"Only the transaction creator or rent payer may close this transaction buffer.",[hI]:"Unauthorized: Only the admin account is allowed to perform this action.",[kx]:"Member is not part of the expected signers for this transaction."});function kL(e){return process.env.NODE_ENV!=="production"?wi[e]:"Error message not available in production bundles."}function HL(e,n,r){return isProgramError(e,n,u,r)}async function ZL({admin:e,addressTree:n}){return Io({payer:e,addressTree:n,remainingAccounts:[]})}var xe=class extends Error{constructor(r,s,t){super(r);this.code=s;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},Ve=class extends xe{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},J=class extends xe{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},P=class extends xe{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},ge=class extends xe{constructor(r,s,t){super(r,"NETWORK_ERROR",{statusCode:s,url:t});this.statusCode=s;this.url=t;}};var se=class extends xe{constructor(r,s,t){super(r,"BUNDLE_ERROR",{bundleId:s,attempt:t});this.bundleId=s;this.attempt=t;}},gr=class extends xe{constructor(r,s,t){super(`Operation "${r}" failed after ${s} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=s;this.lastError=t;}},yr=class extends xe{constructor(r,s,t){super(r,"PERMISSION_ERROR",{required:s,actual:t});this.required=s;this.actual=t;}};var _t={Ed25519:1,Secp256r1:2};var BI=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()}),ki=g.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),sW=g.object({transactionActionType:ki,transactionAddress:g.string(),transactionMessageBytes:g.array(g.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),NI=g.object({transactionActionType:ki,transactionAddress:g.string(),transactionMessageBytes:g.base64()}).strict(),wI=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(),Hi=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()}).strict()}).strict(),Vi=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:NI,sendTx:g.boolean(),additionalSigners:wI}).strict()}).strict(),Gi=g.object({startRequest:g.union([Hi,Vi]),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(),Fi=g.object({signer:g.string(),userAddressTreeIndex:g.number().optional(),additionalInfo:g.looseObject({}).optional()}).strict(),kI=g.object({slotHash:g.string(),slotNumber:g.string(),originIndex:g.number(),crossOrigin:g.boolean()}).strict(),oW=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("message"),payload:Fi.extend(Gi.shape).extend({id:g.string().optional(),client:g.object({clientOrigin:g.url()}).strict()})}).strict()}).strict(),cW=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("transaction"),payload:Fi.extend(Gi.shape).extend(kI.shape).extend({client:g.object({clientOrigin:g.url()}).strict()})}).strict()}).strict(),aW=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("transaction"),payload:g.object({startRequest:g.union([Vi,Hi]),txSig:g.string(),user:BI})}).strict()}).strict();var Ie={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},De=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(Ie).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var Bn=33,Me=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!==Bn)throw new Error(`Invalid public key length, expected ${Bn} 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===Bn)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()}},b=class extends Me{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 GI(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function FI(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var Ki=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(GI())],["addressTableLookups",getArrayCodec(FI())]]);function ji(e){return Ki.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 Ji(e){let n=Ki.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:u,staticAccounts:n.accountKeys,version:0}}var wn=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],qi="https://mainnet.block-engine.jito.wtf/api/v1",Yi="https://bundles.jito.wtf/api/v1/bundles/tip_floor",Xi="landed_tips_75th_percentile";var Q={};function Zi(){if(!Q.solanaRpcEndpoint)throw new Ve("RPC endpoint");return Q.solanaRpcEndpoint}function he(){if(!Q.lightProtocolRpc)throw new Ve("Light Protocol RPC");return Q.lightProtocolRpc}function z(){if(!Q.solanaRpc)throw new Ve("Solana RPC");return Q.solanaRpc}function $i(){if(!Q.sendAndConfirm)throw new Ve("Send and confirm transaction function");return Q.sendAndConfirm}function kn(){return Q.jitoTipsConfig?Q.jitoTipsConfig:{blockEngineUrl:qi,getJitoTipsUrl:Yi,priority:Xi}}function vW({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){Q.solanaRpcEndpoint=e,Q.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:o}=createSolanaClient({urlOrMoniker:e});Q.solanaRpc=t,Q.sendAndConfirm=o,Q.jitoTipsConfig=s??null;}async function vt(e,n){if(!e.ok)throw new ge(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function Ut(e){try{return await e.json()}catch(n){throw new ge(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function jW(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Tr(n.get(-2))),y:BigInt("0x"+Tr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function JW(e){let r=p256.Point.fromBytes(getBase58Encoder().encode(e)).toBytes(false),s=new Map;return s.set(1,2),s.set(3,-7),s.set(-1,1),s.set(-2,r.slice(1,33)),s.set(-3,r.slice(33,65)),new Uint8Array(encodeCBOR(s))}async function qW(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=ue(n),o=JSON.parse(getUtf8Decoder().decode(ue(r))),i=rd(o),a=sd(ue(s)),c=await Ye({rpIdHash:t.subarray(0,32)});return new b(e.signer.toString(),{verifyArgs:{clientDataJson:ue(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:Hn(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:c,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function Hn(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(n),...getBase64Encoder().encode(r)]))}function YW(e){return sha256(getUtf8Encoder().encode(JSON.stringify(e)))}function XW(e){return Vn(e.data.payload.authResponse)}function ZW(e,n,r,s){let t=Hn(n,r,s);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...t]))}async function $W(e,n,r,s,t,o){let i;if(!t||!o){let A=(await z().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!A)throw new J("Slot sysvar","Unable to fetch slot sysvar data");let y=getBase64Encoder().encode(A[0]);o=getU64Decoder().decode(y.subarray(0,8)).toString(),i=y.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),c=Hn(n,r,s),d=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...a,...i,...c]));return {slotNumber:o,slotHash:t,challenge:d}}function Vn(e){let n=mr(e);return sha256(n)}function QW(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ue(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),o=new ArrayBuffer(t.length),i=new Uint8Array(o);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}async function eO(e,n){let{data:r}=await ss(z(),e),t=nd(r.origins,r.numOrigins).findIndex(o=>o===n);if(t===-1)throw new J("Origin","Origin not found in domain config");return t}function tO(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function rO(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}function Tr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function QI(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 rd(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let s=JSON.stringify(r);return new TextEncoder().encode(s.slice(1,-1))}function nd(e,n){let r=[],s=0,t=new TextDecoder;for(let o=0;o<n;o++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let i=e[s]|e[s+1]<<8;if(s+=2,s+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(s,s+i),c=t.decode(a);r.push(c),s+=i;}return r}function sd(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 _=n&127;r+=_;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,o=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,c=e.slice(a,a+i),d=o[0]===0&&o.length>32?o.slice(1):o,A=c[0]===0&&c.length>32?c.slice(1):c;if(d.length>32||A.length>32)throw new Error("r or s length > 32 bytes");let y=new Uint8Array(32);y.set(d,32-d.length);let p=p256.Point.CURVE().n>>1n,f=BigInt("0x"+Tr(A)),I=(f>p?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=QI(I);return new Uint8Array([...y,...x])}function mr(e){let n=ue(e.response.clientDataJSON),r=ue(e.response.authenticatorData),s=sha256(n);return new Uint8Array([...r,...s])}var eE=400,tE=429,cd=500,rE=3,nE=500,sE=2,oE=3e4,ad={backoffBase:sE,maxDelayMs:oE,retryOnRateLimit:true,initialDelayMs:nE,maxRetries:rE};function id(e){return e===tE}function dd(e){return e>=cd}function cE(e){return e>=eE&&e<cd}function aE(e){return id(e)||dd(e)}function iE(e,n,r){return e instanceof Response?id(e.status)?r.retryOnRateLimit??true:cE(e.status)?false:dd(e.status):e instanceof TypeError||e instanceof Error}function dE(e,n,r,s){let t=n*Math.pow(r,e-1);return Math.min(t,s)}function uE(e){return new Promise(n=>setTimeout(n,e))}async function Ot(e,n){let{maxRetries:r,initialDelayMs:s,backoffBase:t,maxDelayMs:o,shouldRetry:i}={...ad,...n},a;for(let c=1;c<=r;c++)try{return await e()}catch(d){if(a=d,i&&!i(d,c))throw d;if(c>=r)break;let A=dE(c,s,t,o);await uE(A);}throw new gr(e.name||"retryWithBackoff",r,a)}async function Xe(e,n){let r={...ad,...n},s=(o,i)=>iE(o,i,r);return Ot(async()=>{let o=await e();if(!o.ok&&aE(o.status))throw o;return o},{...r,shouldRetry:n?.shouldRetry??s})}function ud(...e){return n=>e.some(r=>n instanceof r)}function Ad(e,n,r,s){if(e<n||e>r)throw new P(`${s} must be between ${n} and ${r} (inclusive), got ${e}`)}function gd(e,n){if(e<0)throw new P(`${n} must be non-negative, got ${e}`)}function Bt(e,n){if(e.length===0)throw new P(`${n} cannot be empty`)}function yd(e,n){if(e.trim().length===0)throw new P(`${n} cannot be empty`)}async function Fn(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await z().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),o=>appendTransactionMessageInstructions(s.instructions,o),o=>setTransactionMessageFeePayerSigner(s.payer,o),o=>setTransactionMessageLifetimeUsingBlockhash(r,o),o=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(o,s.addressesByLookupTableAddress):o,async o=>{let i=Math.ceil((s.unitsConsumed??0)*1.1);return i>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:i})],o):o},async o=>n?compileTransaction(await o):await signTransactionMessageWithSigners(await o))))}async function fd(e){let n=prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:8e5}),getSetComputeUnitPriceInstruction({microLamports:1e4})],e),r=getBase64EncodedWireTransaction(compileTransaction(n));if(r.length>1644)throw new P(`Transaction exceeds maximum length of ${1644} bytes (actual: ${r.length} bytes)`);let s=await z().simulateTransaction(r,{encoding:"base64"}).send();if(s.value.err){if(s.value.logs){let o=["Transaction simulation failed:","",...s.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,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getOptionEncoder,getOptionDecoder,getArrayEncoder,getU64Encoder,getArrayDecoder,getU64Decoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getU16Encoder,getU16Decoder,getBooleanEncoder,getBooleanDecoder,getEnumEncoder,getEnumDecoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64Encoder,getBase64Decoder,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,getBlockhashDecoder,compileTransaction,getTransactionEncoder,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,encodeBN254toBase58,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import 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 {equalBytes}from'@noble/curves/utils.js';var ts=new Uint8Array([201,232,212,229,59,241,106,197]);function vC(){return fixEncoderSize(getBytesEncoder(),8).encode(ts)}function lu(){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:ts}))}function rs(){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 UC(){return combineCodec(lu(),rs())}function ns(e){return decodeAccount(e,rs())}async function ss(e,n,r){let s=await fu(e,n,r);return assertAccountExists(s),s}async function fu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ns(s)}async function LC(e,n,r){let s=await Su(e,n,r);return assertAccountsExist(s),s}async function Su(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ns(t))}function WC(){return 846}var as=new Uint8Array([42,206,176,58,175,129,130,233]);function NC(){return fixEncoderSize(getBytesEncoder(),8).encode(as)}function Lu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:as}))}function is(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function kC(){return combineCodec(Lu(),is())}function ds(e){return decodeAccount(e,is())}async function wC(e,n,r){let s=await Wu(e,n,r);return assertAccountExists(s),s}async function Wu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ds(s)}async function HC(e,n,r){let s=await Ou(e,n,r);return assertAccountsExist(s),s}async function Ou(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ds(t))}function VC(){return 24}function Pr(){return getStructEncoder([["memberKey",N()],["permissions",_e()],["userArgs",Ue()]])}function br(){return getStructDecoder([["memberKey",X()],["permissions",ve()],["userArgs",Le()]])}function KC(){return combineCodec(Pr(),br())}function _r(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function vr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function JC(){return combineCodec(_r(),vr())}function st(){return getStructEncoder([["treeInfo",ct()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function ot(){return getStructDecoder([["treeInfo",at()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function $C(){return combineCodec(st(),ot())}function it(){return getStructEncoder([["treeInfo",ct()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function dt(){return getStructDecoder([["treeInfo",at()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function rD(){return combineCodec(it(),dt())}function Br(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function Nr(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function oD(){return combineCodec(Br(),Nr())}function ut(){return getStructEncoder([["data",getOptionEncoder(kr())]])}function Z(){return getStructDecoder([["data",getOptionDecoder(wr())]])}function dD(){return combineCodec(ut(),Z())}function kr(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(At())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function wr(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(gt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function yD(){return combineCodec(kr(),wr())}function We(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Gr())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Pr())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(zr())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Oe(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Fr())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(br())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Kr())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function lD(){return combineCodec(We(),Oe())}function fD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function SD(e,n){return n.__kind===e}function jr(){return getStructEncoder([["member",getAddressEncoder()],["role",Be()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",fe()]])}function qr(){return getStructDecoder([["member",getAddressDecoder()],["role",Ne()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",Se()]])}function CD(){return combineCodec(jr(),qr())}function Gr(){return getStructEncoder([["memberKey",N()],["permissions",_e()]])}function Fr(){return getStructDecoder([["memberKey",X()],["permissions",ve()]])}function hD(){return combineCodec(Gr(),Fr())}function yt(){return getStructEncoder([["memberKey",N()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function pt(){return getStructDecoder([["memberKey",X()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function vD(){return combineCodec(yt(),pt())}function Jr(){return getStructEncoder([["settingsMutArgs",H()],["transactionManager",getOptionEncoder(Tt())]])}function Yr(){return getStructDecoder([["settingsMutArgs",V()],["transactionManager",getOptionDecoder(mt())]])}function OD(){return combineCodec(Jr(),Yr())}function At(){return getStructEncoder([["pubkey",N()],["role",getU8Encoder()],["permissions",_e()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function gt(){return getStructDecoder([["pubkey",X()],["role",getU8Decoder()],["permissions",ve()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function wD(){return combineCodec(At(),gt())}function N(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function X(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function GD(){return combineCodec(N(),X())}function $r(){return getStructEncoder([["authorityCreationArgs",fe()],["compressedProofArgs",M()]])}function Qr(){return getStructDecoder([["authorityCreationArgs",Se()],["compressedProofArgs",R()]])}function jD(){return combineCodec($r(),Qr())}function lt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function ft(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function YD(){return combineCodec(lt(),ft())}function ct(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function at(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function $D(){return combineCodec(ct(),at())}function _e(){return getStructEncoder([["mask",getU8Encoder()]])}function ve(){return getStructDecoder([["mask",getU8Decoder()]])}function tM(){return combineCodec(_e(),ve())}function M(){return getStructEncoder([["proof",getOptionEncoder(Br())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function R(){return getStructDecoder([["proof",getOptionDecoder(Nr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function oM(){return combineCodec(M(),R())}function zr(){return getStructEncoder([["memberKey",N()],["userArgs",Ue()]])}function Kr(){return getStructDecoder([["memberKey",X()],["userArgs",Le()]])}function dM(){return combineCodec(zr(),Kr())}function en(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function St(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function gM(){return combineCodec(en(),St())}function k(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function w(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function TM(){return combineCodec(k(),w())}function tn(){return getStructEncoder([["verifyArgs",k()],["domainConfigIndex",getU8Encoder()]])}function rn(){return getStructDecoder([["verifyArgs",w()],["domainConfigIndex",getU8Decoder()]])}function SM(){return combineCodec(tn(),rn())}function nn(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function sn(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function EM(){return combineCodec(nn(),sn())}function on(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function cn(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function MM(){return combineCodec(on(),cn())}function H(){return getStructEncoder([["accountMeta",st()],["data",ut()]])}function V(){return getStructDecoder([["accountMeta",ot()],["data",Z()]])}function bM(){return combineCodec(H(),V())}function xt(){return getStructEncoder([["accountMeta",it()],["data",ut()]])}function It(){return getStructDecoder([["accountMeta",dt()],["data",Z()]])}function LM(){return combineCodec(xt(),It())}function Et(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(yt())]])}function Ct(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(pt())]])}function NM(){return combineCodec(Et(),Ct())}function Dt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(_r())],["addressTableLookups",getArrayEncoder(an())]])}function Mt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(vr())],["addressTableLookups",getArrayDecoder(dn())]])}function VM(){return combineCodec(Dt(),Mt())}function an(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function dn(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function zM(){return combineCodec(an(),dn())}function z(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([tn()])]])]])}function K(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([rn()])]])]])}function JM(){return combineCodec(z(),K())}function YM(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function XM(e,n){return n.__kind===e}var un=(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))(un||{});function Rt(){return getEnumEncoder(un)}function ht(){return getEnumDecoder(un)}function QM(){return combineCodec(Rt(),ht())}function Pt(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",N()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(Rt()))],["wallets",getArrayEncoder(on())],["role",Be()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function q(){return getStructDecoder([["domainConfig",getOptionDecoder(getAddressDecoder())],["member",X()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(ht()))],["wallets",getArrayDecoder(cn())],["role",Ne()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function nR(){return combineCodec(Pt(),q())}function fe(){return getStructEncoder([["addressTreeInfo",lt()],["outputStateTreeIndex",getU8Encoder()]])}function Se(){return getStructDecoder([["addressTreeInfo",ft()],["outputStateTreeIndex",getU8Decoder()]])}function aR(){return combineCodec(fe(),Se())}function ke(){return getStructEncoder([["accountMeta",st()],["data",Pt()]])}function we(){return getStructDecoder([["accountMeta",ot()],["data",q()]])}function AR(){return combineCodec(ke(),we())}function Tt(){return getStructEncoder([["accountMeta",it()],["data",Pt()]])}function mt(){return getStructDecoder([["accountMeta",dt()],["data",q()]])}function TR(){return combineCodec(Tt(),mt())}function Ue(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Tt()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([ke()])]])]])}function Le(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([mt()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([we()])]])]])}function SR(){return combineCodec(Ue(),Le())}function xR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function IR(e,n){return n.__kind===e}var Ce=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(Ce||{});function Be(){return getEnumEncoder(Ce)}function Ne(){return getEnumDecoder(Ce)}function DR(){return combineCodec(Be(),Ne())}var eo=new Uint8Array([223,179,163,190,177,224,67,173]);function yh(){return fixEncoderSize(getBytesEncoder(),8).encode(eo)}function np(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(At())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:eo}))}function nr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(gt())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function ph(){return combineCodec(np(),nr())}function to(e){return decodeAccount(e,nr())}async function Th(e,n,r){let s=await An(e,n,r);return assertAccountExists(s),s}async function An(e,n,r){let s=await fetchEncodedAccount(e,n,r);return to(s)}async function mh(e,n,r){let s=await sp(e,n,r);return assertAccountsExist(s),s}async function sp(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>to(t))}var co=new Uint8Array([90,36,35,219,93,225,110,96]);function xh(){return fixEncoderSize(getBytesEncoder(),8).encode(co)}function Ep(){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",N()],["executor",N()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(N())],["expectedSigners",getArrayEncoder(yt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:co}))}function ao(){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",X()],["executor",X()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(X())],["expectedSigners",getArrayDecoder(pt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Ih(){return combineCodec(Ep(),ao())}function io(e){return decodeAccount(e,ao())}async function uo(e,n,r){let s=await Cp(e,n,r);return assertAccountExists(s),s}async function Cp(e,n,r){let s=await fetchEncodedAccount(e,n,r);return io(s)}async function Eh(e,n,r){let s=await Dp(e,n,r);return assertAccountsExist(s),s}async function Dp(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>io(t))}var yo=new Uint8Array([105,23,173,2,197,255,80,87]);function Mh(){return fixEncoderSize(getBytesEncoder(),8).encode(yo)}function Gp(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:yo}))}function po(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function Rh(){return combineCodec(Gp(),po())}function To(e){return decodeAccount(e,po())}async function mo(e,n,r){let s=await Fp(e,n,r);return assertAccountExists(s),s}async function Fp(e,n,r){let s=await fetchEncodedAccount(e,n,r);return To(s)}async function hh(e,n,r){let s=await zp(e,n,r);return assertAccountsExist(s),s}async function zp(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>To(t))}function T({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 J(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 m(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let s=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:J(r.value),role:lo(r.value)?upgradeRoleToSigner(s):s,...lo(r.value)?{signer:r.value}:{}})}}function lo(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var So=new Uint8Array([8]);function zh(){return fixEncoderSize(getBytesEncoder(),1).encode(So)}function Sn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:So}))}function xo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function Kh(){return combineCodec(Sn(),xo())}async function Io(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.whitelistedAddressTrees),c(t.payer),c(t.systemProgram),...a],data:Sn().encode(o),programAddress:r})}function jh(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.whitelistedAddressTrees),c(t.payer),c(t.systemProgram),...a],data:Sn().encode(o),programAddress:r})}function qh(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:xo().decode(e.data)}}var Ro=new Uint8Array([9]);function eP(){return fixEncoderSize(getBytesEncoder(),1).encode(Ro)}function ho(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(We())],["signers",getArrayEncoder(z())],["compressedProofArgs",getOptionEncoder(M())]]),e=>({...e,discriminator:Ro}))}function Po(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Oe())],["signers",getArrayDecoder(K())],["compressedProofArgs",getOptionDecoder(R())]])}function tP(){return combineCodec(ho(),Po())}function bo(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.payer),c(t.systemProgram),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:ho().encode(o),programAddress:r})}function rP(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Po().decode(e.data)}}var Wo=new Uint8Array([19]);function dP(){return fixEncoderSize(getBytesEncoder(),1).encode(Wo)}function Oo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(We())],["signers",getArrayEncoder(z())],["settingsMutArgs",H()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Wo}))}function Bo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Oe())],["signers",getArrayDecoder(K())],["settingsMutArgs",V()],["compressedProofArgs",R()]])}function uP(){return combineCodec(Oo(),Bo())}function No(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:Oo().encode(o),programAddress:r})}function AP(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Bo().decode(e.data)}}var Ho=new Uint8Array([18]);function fP(){return fixEncoderSize(getBytesEncoder(),1).encode(Ho)}function xn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["addressTreeInfo",lt()],["outputStateTreeIndex",getU8Encoder()],["userArgs",Ue()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Ho}))}function Vo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",R()],["addressTreeInfo",ft()],["outputStateTreeIndex",getU8Decoder()],["userArgs",Le()],["settingsIndex",getU128Decoder()]])}function SP(){return combineCodec(xn(),Vo())}async function Go(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.initialMember),c(t.systemProgram),c(t.globalCounter),c(t.whitelistedAddressTrees),...a],data:xn().encode(o),programAddress:r})}function xP(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.initialMember),c(t.systemProgram),c(t.globalCounter),c(t.whitelistedAddressTrees),...a],data:xn().encode(o),programAddress:r})}function IP(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:Vo().decode(e.data)}}var Xo=new Uint8Array([0]);function PP(){return fixEncoderSize(getBytesEncoder(),1).encode(Xo)}function En(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",fe()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Xo}))}function Zo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",Se()],["compressedProofArgs",R()]])}function bP(){return combineCodec(En(),Zo())}async function $o(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.domainConfig),c(t.payer),c(t.authority),c(t.systemProgram),c(t.whitelistedAddressTrees),...a],data:En().encode(o),programAddress:r})}function _P(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.domainConfig),c(t.payer),c(t.authority),c(t.systemProgram),c(t.whitelistedAddressTrees),...a],data:En().encode(o),programAddress:r})}function vP(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Zo().decode(e.data)}}var tc=new Uint8Array([4]);function kP(){return fixEncoderSize(getBytesEncoder(),1).encode(tc)}function Cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["member",en()],["role",Be()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(Rt())],["userAccountCreationArgs",fe()],["linkWalletArgs",getOptionEncoder(Jr())]]),e=>({...e,discriminator:tc}))}function rc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",R()],["member",St()],["role",Ne()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(ht())],["userAccountCreationArgs",Se()],["linkWalletArgs",getOptionDecoder(Yr())]])}function wP(){return combineCodec(Cn(),rc())}async function nc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.domainConfig),c(t.authority),c(t.whitelistedAddressTrees),...a],data:Cn().encode(o),programAddress:r})}function HP(e,n){let r=n?.programAddress??u,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}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.domainConfig),c(t.authority),c(t.whitelistedAddressTrees),...a],data:Cn().encode(o),programAddress:r})}function VP(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:rc().decode(e.data)}}var oc=new Uint8Array([3]);function qP(){return fixEncoderSize(getBytesEncoder(),1).encode(oc)}function Mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:oc}))}function cc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function JP(){return combineCodec(Mn(),cc())}async function ac(e,n){let r=n?.programAddress??u,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={};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=T(o),a=m(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:Mn().encode({}),programAddress:r})}function YP(e,n){let r=n?.programAddress??u,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=T(o),a=m(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:Mn().encode({}),programAddress:r})}function XP(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:cc().decode(e.data)}}var dc=new Uint8Array([5]);function nb(){return fixEncoderSize(getBytesEncoder(),1).encode(dc)}function hn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayEncoder(jr())]]),e=>({...e,discriminator:dc}))}function uc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",R()],["createUserArgs",getArrayDecoder(qr())]])}function sb(){return combineCodec(hn(),uc())}async function Ac(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.systemProgram),c(t.whitelistedAddressTrees),...a],data:hn().encode(o),programAddress:r})}function ob(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.systemProgram),c(t.whitelistedAddressTrees),...a],data:hn().encode(o),programAddress:r})}function cb(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:uc().decode(e.data)}}var pc=new Uint8Array([17]);function yb(){return fixEncoderSize(getBytesEncoder(),1).encode(pc)}function Tc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",H()],["compressedProofArgs",M()],["signers",getArrayEncoder(z())]]),e=>({...e,discriminator:pc}))}function mc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",V()],["compressedProofArgs",R()],["signers",getArrayDecoder(K())]])}function pb(){return combineCodec(Tc(),mc())}function lc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.payer),c(t.systemProgram),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:Tc().encode(o),programAddress:r})}function Tb(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:mc().decode(e.data)}}var xc=new Uint8Array([2]);function Ib(){return fixEncoderSize(getBytesEncoder(),1).encode(xc)}function Ic(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:xc}))}function Ec(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function Eb(){return combineCodec(Ic(),Ec())}function Cc(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.domainConfig),c(t.admin),...a],data:Ic().encode(o),programAddress:r})}function Cb(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:Ec().decode(e.data)}}var hc=new Uint8Array([1]);function _b(){return fixEncoderSize(getBytesEncoder(),1).encode(hc)}function bn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder($r())]]),e=>({...e,discriminator:hc}))}function Pc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Qr())]])}function vb(){return combineCodec(bn(),Pc())}async function Ub(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};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=T(i),c=m(r);return Object.freeze({accounts:[c(t.domainConfig),c(t.authority),c(t.newAuthority),c(t.whitelistedAddressTrees),c(t.systemProgram),...a],data:bn().encode(o),programAddress:r})}function bc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.domainConfig),c(t.authority),c(t.newAuthority),c(t.whitelistedAddressTrees),c(t.systemProgram),...a],data:bn().encode(o),programAddress:r})}function Lb(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:Pc().decode(e.data)}}var Uc=new Uint8Array([6]);function Hb(){return fixEncoderSize(getBytesEncoder(),1).encode(Uc)}function Lc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",ke()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",M()]]),e=>({...e,discriminator:Uc}))}function Wc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",we()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",R()]])}function Vb(){return combineCodec(Lc(),Wc())}function Oc(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.authority),...a],data:Lc().encode(o),programAddress:r})}function Gb(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Wc().decode(e.data)}}var kc=new Uint8Array([7]);function Yb(){return fixEncoderSize(getBytesEncoder(),1).encode(kc)}function wc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",ke()],["secp256r1VerifyArgs",getOptionEncoder(k())],["delegateTo",getOptionEncoder(nn())],["oldSettingsMutArgs",getOptionEncoder(H())],["newSettingsMutArgs",getOptionEncoder(H())],["compressedProofArgs",M()]]),e=>({...e,discriminator:kc}))}function Hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",we()],["secp256r1VerifyArgs",getOptionDecoder(w())],["delegateTo",getOptionDecoder(sn())],["oldSettingsMutArgs",getOptionDecoder(V())],["newSettingsMutArgs",getOptionDecoder(V())],["compressedProofArgs",R()]])}function Xb(){return combineCodec(wc(),Hc())}function Vc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.feePayer),c(t.signer),c(t.oldSettings),c(t.newSettings),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.domainConfig),...a],data:wc().encode(o),programAddress:r})}function Zb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:Hc().decode(e.data)}}var Fc=new Uint8Array([29]);function s_(){return fixEncoderSize(getBytesEncoder(),1).encode(Fc)}function _n(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(z())]]),e=>({...e,discriminator:Fc}))}function zc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(K())]])}function o_(){return combineCodec(_n(),zc())}async function c_(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};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(J(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.destination),c(t.systemProgram),...a],data:_n().encode(o),programAddress:r})}function Kc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.destination),c(t.systemProgram),...a],data:_n().encode(o),programAddress:r})}function a_(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:zc().decode(e.data)}}var Jc=new Uint8Array([27]);function p_(){return fixEncoderSize(getBytesEncoder(),1).encode(Jc)}function Yc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(z())],["settingsMutArgs",H()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Jc}))}function Xc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(K())],["settingsMutArgs",V()],["compressedProofArgs",R()]])}function T_(){return combineCodec(Yc(),Xc())}function Zc(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.destination),c(t.systemProgram),...a],data:Yc().encode(o),programAddress:r})}function m_(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Xc().decode(e.data)}}var Qc=new Uint8Array([30]);function C_(){return fixEncoderSize(getBytesEncoder(),1).encode(Qc)}function Un(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(z())]]),e=>({...e,discriminator:Qc}))}function ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(K())]])}function D_(){return combineCodec(Un(),ea())}async function ta(e,n){let r=n?.programAddress??u,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},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};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(J(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(J(t.source.value)),getAddressEncoder().encode(J(t.tokenProgram.value)),getAddressEncoder().encode(J(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(J(t.destination.value)),getAddressEncoder().encode(J(t.tokenProgram.value)),getAddressEncoder().encode(J(t.mint.value))]})),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.sourceSplTokenAccount),c(t.destination),c(t.destinationSplTokenAccount),c(t.tokenProgram),c(t.mint),c(t.associatedTokenProgram),c(t.systemProgram),...a],data:Un().encode(o),programAddress:r})}function M_(e,n){let r=n?.programAddress??u,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},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.sourceSplTokenAccount),c(t.destination),c(t.destinationSplTokenAccount),c(t.tokenProgram),c(t.mint),c(t.associatedTokenProgram),c(t.systemProgram),...a],data:Un().encode(o),programAddress:r})}function R_(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),destination:r(),destinationSplTokenAccount:r(),tokenProgram:r(),mint:r(),associatedTokenProgram:r(),systemProgram:r()},data:ea().decode(e.data)}}var oa=new Uint8Array([28]);function L_(){return fixEncoderSize(getBytesEncoder(),1).encode(oa)}function Ln(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(z())],["settingsMutArgs",H()],["compressedProofArgs",M()]]),e=>({...e,discriminator:oa}))}function ca(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(K())],["settingsMutArgs",V()],["compressedProofArgs",R()]])}function W_(){return combineCodec(Ln(),ca())}async function aa(e,n){let r=n?.programAddress??u,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},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};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(J(t.source.value)),getAddressEncoder().encode(J(t.tokenProgram.value)),getAddressEncoder().encode(J(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(J(t.destination.value)),getAddressEncoder().encode(J(t.tokenProgram.value)),getAddressEncoder().encode(J(t.mint.value))]})),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.sourceSplTokenAccount),c(t.destination),c(t.destinationSplTokenAccount),c(t.tokenProgram),c(t.mint),c(t.associatedTokenProgram),c(t.systemProgram),...a],data:Ln().encode(o),programAddress:r})}function O_(e,n){let r=n?.programAddress??u,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},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.slotHashSysvar),c(t.instructionsSysvar),c(t.source),c(t.sourceSplTokenAccount),c(t.destination),c(t.destinationSplTokenAccount),c(t.tokenProgram),c(t.mint),c(t.associatedTokenProgram),c(t.systemProgram),...a],data:Ln().encode(o),programAddress:r})}function B_(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),destination:r(),destinationSplTokenAccount:r(),tokenProgram:r(),mint:r(),associatedTokenProgram:r(),systemProgram:r()},data:ca().decode(e.data)}}var ua=new Uint8Array([13]);function F_(){return fixEncoderSize(getBytesEncoder(),1).encode(ua)}function Aa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(k())]]),e=>({...e,discriminator:ua}))}function ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function z_(){return combineCodec(Aa(),ga())}function ya(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.payer),c(t.domainConfig),c(t.transactionBuffer),c(t.closer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:Aa().encode(o),programAddress:r})}function K_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ga().decode(e.data)}}var ma=new Uint8Array([23]);function $_(){return fixEncoderSize(getBytesEncoder(),1).encode(ma)}function la(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(k())],["settingsMutArgs",H()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ma}))}function fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsMutArgs",V()],["compressedProofArgs",R()]])}function Q_(){return combineCodec(la(),fa())}function Sa(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.rentCollector),c(t.domainConfig),c(t.transactionBuffer),c(t.closer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:la().encode(o),programAddress:r})}function ev(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:fa().decode(e.data)}}var Ea=new Uint8Array([10]);function av(){return fixEncoderSize(getBytesEncoder(),1).encode(Ea)}function Ca(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Et()],["secp256r1VerifyArgs",getOptionEncoder(k())]]),e=>({...e,discriminator:Ea}))}function Da(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Ct()],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function iv(){return combineCodec(Ca(),Da())}function Ma(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.payer),c(t.domainConfig),c(t.transactionBuffer),c(t.creator),c(t.systemProgram),c(t.instructionsSysvar),c(t.slotHashSysvar),...a],data:Ca().encode(o),programAddress:r})}function dv(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Da().decode(e.data)}}var Pa=new Uint8Array([20]);function mv(){return fixEncoderSize(getBytesEncoder(),1).encode(Pa)}function ba(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Et()],["secp256r1VerifyArgs",getOptionEncoder(k())],["settingsReadonlyArgs",xt()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Pa}))}function _a(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Ct()],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",It()],["compressedProofArgs",R()]])}function lv(){return combineCodec(ba(),_a())}function va(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.domainConfig),c(t.transactionBuffer),c(t.creator),c(t.systemProgram),c(t.instructionsSysvar),c(t.slotHashSysvar),...a],data:ba().encode(o),programAddress:r})}function fv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:_a().decode(e.data)}}var Wa=new Uint8Array([14]);function Mv(){return fixEncoderSize(getBytesEncoder(),1).encode(Wa)}function Oa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(k())]]),e=>({...e,discriminator:Wa}))}function Ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Rv(){return combineCodec(Oa(),Ba())}function Na(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.domainConfig),c(t.executor),c(t.transactionBuffer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:Oa().encode(o),programAddress:r})}function hv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ba().decode(e.data)}}var Ha=new Uint8Array([24]);function Wv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ha)}function Va(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(k())],["settingsMutArgs",H()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ha}))}function Ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsMutArgs",V()],["compressedProofArgs",R()]])}function Ov(){return combineCodec(Va(),Ga())}function Fa(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.domainConfig),c(t.executor),c(t.transactionBuffer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:Va().encode(o),programAddress:r})}function Bv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ga().decode(e.data)}}var ja=new Uint8Array([12]);function Gv(){return fixEncoderSize(getBytesEncoder(),1).encode(ja)}function qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:ja}))}function Ja(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Fv(){return combineCodec(qa(),Ja())}function Ya(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.transactionBuffer),...a],data:qa().encode(o),programAddress:r})}function zv(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:Ja().decode(e.data)}}var $a=new Uint8Array([22]);function Xv(){return fixEncoderSize(getBytesEncoder(),1).encode($a)}function Qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:$a}))}function ei(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function Zv(){return combineCodec(Qa(),ei())}function ti(e,n){let r=n?.programAddress??u,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.transactionBuffer),...a],data:Qa().encode(o),programAddress:r})}function $v(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:ei().decode(e.data)}}var si=new Uint8Array([11]);function oU(){return fixEncoderSize(getBytesEncoder(),1).encode(si)}function oi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(k())]]),e=>({...e,discriminator:si}))}function ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function cU(){return combineCodec(oi(),ci())}function ai(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.domainConfig),c(t.transactionBuffer),c(t.voter),c(t.systemProgram),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:oi().encode(o),programAddress:r})}function aU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ci().decode(e.data)}}var ui=new Uint8Array([21]);function pU(){return fixEncoderSize(getBytesEncoder(),1).encode(ui)}function Ai(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(k())],["settingsReadonlyArgs",xt()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ui}))}function gi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",It()],["compressedProofArgs",R()]])}function TU(){return combineCodec(Ai(),gi())}function yi(e,n){let r=n?.programAddress??u,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}},o={...e},i={args:o};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.domainConfig),c(t.transactionBuffer),c(t.voter),c(t.systemProgram),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:Ai().encode(o),programAddress:r})}function mU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:gi().decode(e.data)}}var mi=new Uint8Array([15]);function EU(){return fixEncoderSize(getBytesEncoder(),1).encode(mi)}function li(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:mi}))}function fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function CU(){return combineCodec(li(),fi())}function Si(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=T({}),a=m(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:li().encode({}),programAddress:r})}function DU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:fi().decode(e.data)}}var Ei=new Uint8Array([25]);function _U(){return fixEncoderSize(getBytesEncoder(),1).encode(Ei)}function Ci(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Ei}))}function Di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function vU(){return combineCodec(Ci(),Di())}function Mi(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},o={...e},a=T({args:o}),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.transactionBuffer),...a],data:Ci().encode(o),programAddress:r})}function UU(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:Di().decode(e.data)}}var Pi=new Uint8Array([16]);function wU(){return fixEncoderSize(getBytesEncoder(),1).encode(Pi)}function bi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Dt()],["signers",getArrayEncoder(z())]]),e=>({...e,discriminator:Pi}))}function _i(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Mt()],["signers",getArrayDecoder(K())]])}function HU(){return combineCodec(bi(),_i())}function vi(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.settings),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:bi().encode(o),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},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:_i().decode(e.data)}}var Wi=new Uint8Array([26]);function JU(){return fixEncoderSize(getBytesEncoder(),1).encode(Wi)}function Oi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Dt()],["signers",getArrayEncoder(z())],["settingsMutArgs",H()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Wi}))}function Bi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Mt()],["signers",getArrayDecoder(K())],["settingsMutArgs",V()],["compressedProofArgs",R()]])}function YU(){return combineCodec(Oi(),Bi())}function Ni(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},o={...e},i={args:o};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=T(i),c=m(r);return Object.freeze({accounts:[c(t.payer),c(t.slotHashSysvar),c(t.instructionsSysvar),...a],data:Oi().encode(o),programAddress:r})}function XU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Bi().decode(e.data)}}var u="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",tx=(o=>(o[o.DomainConfig=0]="DomainConfig",o[o.GlobalCounter=1]="GlobalCounter",o[o.Settings=2]="Settings",o[o.TransactionBuffer=3]="TransactionBuffer",o[o.WhitelistedAddressTree=4]="WhitelistedAddressTree",o))(tx||{});function UL(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 rx=(l=>(l[l.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",l[l.ChangeConfig=1]="ChangeConfig",l[l.ChangeConfigCompressed=2]="ChangeConfigCompressed",l[l.CreateCompressedWallet=3]="CreateCompressedWallet",l[l.CreateDomainConfig=4]="CreateDomainConfig",l[l.CreateDomainUserAccount=5]="CreateDomainUserAccount",l[l.CreateGlobalCounter=6]="CreateGlobalCounter",l[l.CreateUserAccounts=7]="CreateUserAccounts",l[l.DecompressSettingsAccount=8]="DecompressSettingsAccount",l[l.DisableDomainConfig=9]="DisableDomainConfig",l[l.EditDomainConfig=10]="EditDomainConfig",l[l.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",l[l.EditUserDelegate=12]="EditUserDelegate",l[l.NativeTransferIntent=13]="NativeTransferIntent",l[l.NativeTransferIntentCompressed=14]="NativeTransferIntentCompressed",l[l.TokenTransferIntent=15]="TokenTransferIntent",l[l.TokenTransferIntentCompressed=16]="TokenTransferIntentCompressed",l[l.TransactionBufferClose=17]="TransactionBufferClose",l[l.TransactionBufferCloseCompressed=18]="TransactionBufferCloseCompressed",l[l.TransactionBufferCreate=19]="TransactionBufferCreate",l[l.TransactionBufferCreateCompressed=20]="TransactionBufferCreateCompressed",l[l.TransactionBufferExecute=21]="TransactionBufferExecute",l[l.TransactionBufferExecuteCompressed=22]="TransactionBufferExecuteCompressed",l[l.TransactionBufferExtend=23]="TransactionBufferExtend",l[l.TransactionBufferExtendCompressed=24]="TransactionBufferExtendCompressed",l[l.TransactionBufferVote=25]="TransactionBufferVote",l[l.TransactionBufferVoteCompressed=26]="TransactionBufferVoteCompressed",l[l.TransactionExecute=27]="TransactionExecute",l[l.TransactionExecuteCompressed=28]="TransactionExecuteCompressed",l[l.TransactionExecuteSync=29]="TransactionExecuteSync",l[l.TransactionExecuteSyncCompressed=30]="TransactionExecuteSyncCompressed",l))(rx||{});function LL(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 sx=6e3,ox=6001,cx=6002,ax=6003,ix=6004,dx=6005,ux=6006,Ax=6007,gx=6008,yx=6009,px=6010,Tx=6011,mx=6012,lx=6013,fx=6014,Sx=6015,xx=6016,Ix=6017,Ex=6018,Cx=6019,Dx=6020,Mx=6021,Rx=6022,hx=6023,Px=6024,bx=6025,_x=6026,vx=6027,Ux=6028,Lx=6029,Wx=6030,Ox=6031,Bx=6032,Nx=6033,kx=6034,wx=6035,Hx=6036,Vx=6037,Gx=6038,Fx=6039,zx=6040,Kx=6041,jx=6042,qx=6043,Jx=6044,Yx=6045,Xx=6046,Zx=6047,$x=6048,Qx=6049,eI=6050,tI=6051,rI=6052,nI=6053,sI=6054,oI=6055,cI=6056,aI=6057,iI=6058,dI=6059,uI=6060,AI=6061,gI=6062,yI=6063,pI=6064,TI=6065,mI=6066,lI=6067,fI=6068,SI=6069,xI=6070,II=6071,EI=6072,CI=6073,DI=6074,MI=6075,RI=6076,hI=6077,PI=6078,bI=6079,_I=6080,vI=6081,UI=6082,LI=6083,WI=6084,OI=6085,BI=6086,ki;process.env.NODE_ENV!=="production"&&(ki={[Ox]:"This member is already delegated to another wallet.",[Ax]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[hI]:"Clock sysvar access failed. This may indicate a system error.",[tI]:"Missing credential id.",[nI]:"The domain configuration account is disabled. Please contact support or try again later.",[sI]:"Missing domain configuration account.",[MI]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[BI]:"Duplicate address tree detected. This address tree is already in the whitelist.",[px]:"Duplicate public keys detected among members. Each member must have a unique key.",[yx]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[Mx]:"No members provided. A multisig wallet must contain at least one member.",[uI]:"Slot numbers list is empty. At least one slot number is required for validation.",[Ex]:"Expected a User with Administrator role for this instruction.",[gx]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[xx]:"Expected a User with Transaction Manager role for this instruction.",[zx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[Kx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[jx]:"Declared buffer size does not match the actual serialized size.",[dI]:"Failed to compute hash. This may indicate a system error.",[kx]:"Not enough members with vote permission to meet the approval threshold.",[Bx]:"At least one signer with execute permission is required to proceed.",[Nx]:"At least one signer with initiate permission is required to perform this action.",[_x]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[DI]:"Invalid account index in transaction message. The account index is out of bounds.",[aI]:"Address Tree supplied is not part of the whitelisted address trees.",[Cx]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[Ux]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Fx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[AI]:"Member key conversion failed. The provided key format is invalid.",[wx]:"Only delegated members are allowed for this transaction.",[bx]:"Unexpected number of accounts provided for this instruction.",[lx]:"User with Permanent Member role must have a delegated wallet.",[ox]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[ix]:"The extracted public key has an invalid length or encoding.",[sx]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[ax]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[eI]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[$x]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[hx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[II]:"Invalid source type for token transfer. The source account type is not supported.",[Ix]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[Sx]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[Px]:"Malformed transaction message: structure or formatting does not match the expected layout.",[_I]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[vx]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[bI]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[xI]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[dx]:"The extracted WebAuthn signed message payload is malformed.",[Xx]:"An input string exceeds the maximum allowed character length.",[oI]:"This member is not registered under the provided domain configuration.",[pI]:"Member not found in settings. Cannot remove a member that does not exist.",[CI]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[Lx]:"A required account is missing from the instruction context.",[gI]:"Compressed proof arguments are missing. Required for compressed account operations.",[lI]:"Missing compressed token account. Required for token transfer operations.",[vI]:"Missing destination token account. Required for token transfer operations.",[SI]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[yI]:"Light CPI accounts are missing. Required for compressed account operations.",[Wx]:"User mutation arguments are required when performing add or remove delegate operations.",[WI]:"Missing new authority account. Required for domain configuration updates.",[LI]:"Missing settings account. Required for delegate operations on compressed wallets.",[iI]:"Compressed settings data is missing. The settings account must be initialized with data.",[UI]:"Missing source token account. Required for token transfer operations.",[fI]:"Missing SPL interface PDA. Required for token transfer operations.",[Zx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[RI]:"User account address is missing. Required for secp256r1 signature verification.",[OI]:"Missing whitelisted address trees account. Required for domain configuration updates.",[Vx]:"No valid signer found in this transaction.",[Dx]:"Only one administrator is allowed per wallet.",[mx]:"Only one permanent member is allowed per wallet.",[fx]:"Only one transaction manager is allowed per wallet.",[cI]:"The given origin index is not in the whitelisted origins.",[mI]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[Tx]:"Permanent members cannot be removed from a wallet.",[Yx]:"Writable CPI calls to protected accounts are not permitted.",[ux]:"The rpIdHash extracted from the signed message does not match the expected value.",[TI]:"Settings key mismatch. The provided settings key does not match the expected value.",[cx]:"The signature index provided is out of bounds for the secp256r1 instruction.",[Qx]:"The specified slot number was not found in the provided slot history.",[EI]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[Rx]:"Too many members: a maximum of 4 members are supported.",[qx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[Jx]:"This transaction has not yet reached the required approval threshold.",[rI]:"Missing transports.",[Gx]:"Only the transaction creator or rent payer may close this transaction buffer.",[PI]:"Unauthorized: Only the admin account is allowed to perform this action.",[Hx]:"Member is not part of the expected signers for this transaction."});function wL(e){return process.env.NODE_ENV!=="production"?ki[e]:"Error message not available in production bundles."}function HL(e,n,r){return isProgramError(e,n,u,r)}async function ZL({admin:e,addressTree:n}){return Io({payer:e,addressTree:n,remainingAccounts:[]})}var xe=class extends Error{constructor(r,s,t){super(r);this.code=s;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},Ve=class extends xe{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},Y=class extends xe{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},P=class extends xe{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},ge=class extends xe{constructor(r,s,t){super(r,"NETWORK_ERROR",{statusCode:s,url:t});this.statusCode=s;this.url=t;}};var se=class extends xe{constructor(r,s,t){super(r,"BUNDLE_ERROR",{bundleId:s,attempt:t});this.bundleId=s;this.attempt=t;}},gr=class extends xe{constructor(r,s,t){super(`Operation "${r}" failed after ${s} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=s;this.lastError=t;}},yr=class extends xe{constructor(r,s,t){super(r,"PERMISSION_ERROR",{required:s,actual:t});this.required=s;this.actual=t;}};var _t={Ed25519:1,Secp256r1:2};var NI=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()}),wi=g.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),sW=g.object({transactionActionType:wi,transactionAddress:g.string(),transactionMessageBytes:g.array(g.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),kI=g.object({transactionActionType:wi,transactionAddress:g.string(),transactionMessageBytes:g.base64()}).strict(),wI=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(),Hi=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(),Vi=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:kI,sendTx:g.boolean(),additionalSigners:wI}).strict()}).strict(),Gi=g.object({startRequest:g.union([Hi,Vi]),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(),Fi=g.object({signer:g.string(),userAddressTreeIndex:g.number().optional(),additionalInfo:g.looseObject({}).optional()}).strict(),HI=g.object({slotHash:g.string(),slotNumber:g.string(),originIndex:g.number(),crossOrigin:g.boolean()}).strict(),oW=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("message"),payload:Fi.extend(Gi.shape).extend({id:g.string().optional(),client:g.object({clientOrigin:g.url()}).strict()})}).strict()}).strict(),cW=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("transaction"),payload:Fi.extend(Gi.shape).extend(HI.shape).extend({client:g.object({clientOrigin:g.url()}).strict()})}).strict()}).strict(),aW=g.object({phase:g.literal("complete"),data:g.object({type:g.literal("transaction"),payload:g.object({startRequest:g.union([Vi,Hi]),txSig:g.string(),user:NI})}).strict()}).strict();var Ie={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},De=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(Ie).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var Bn=33,Me=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!==Bn)throw new Error(`Invalid public key length, expected ${Bn} 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===Bn)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()}},b=class extends Me{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 FI(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function zI(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var Ki=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(FI())],["addressTableLookups",getArrayCodec(zI())]]);function ji(e){return Ki.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 qi(e){let n=Ki.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:u,staticAccounts:n.accountKeys,version:0}}var kn=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Ji="https://mainnet.block-engine.jito.wtf/api/v1",Yi="https://bundles.jito.wtf/api/v1/bundles/tip_floor",Xi="landed_tips_75th_percentile";var ee={};function Zi(){if(!ee.solanaRpcEndpoint)throw new Ve("RPC endpoint");return ee.solanaRpcEndpoint}function he(){if(!ee.lightProtocolRpc)throw new Ve("Light Protocol RPC");return ee.lightProtocolRpc}function j(){if(!ee.solanaRpc)throw new Ve("Solana RPC");return ee.solanaRpc}function $i(){if(!ee.sendAndConfirm)throw new Ve("Send and confirm transaction function");return ee.sendAndConfirm}function wn(){return ee.jitoTipsConfig?ee.jitoTipsConfig:{blockEngineUrl:Ji,getJitoTipsUrl:Yi,priority:Xi}}function vW({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){ee.solanaRpcEndpoint=e,ee.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:o}=createSolanaClient({urlOrMoniker:e});ee.solanaRpc=t,ee.sendAndConfirm=o,ee.jitoTipsConfig=s??null;}async function vt(e,n){if(!e.ok)throw new ge(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function Ut(e){try{return await e.json()}catch(n){throw new ge(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function jW(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Tr(n.get(-2))),y:BigInt("0x"+Tr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function qW(e){let r=p256.Point.fromBytes(getBase58Encoder().encode(e)).toBytes(false),s=new Map;return s.set(1,2),s.set(3,-7),s.set(-1,1),s.set(-2,r.slice(1,33)),s.set(-3,r.slice(33,65)),new Uint8Array(encodeCBOR(s))}async function JW(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=ue(n),o=JSON.parse(getUtf8Decoder().decode(ue(r))),i=nd(o),a=od(ue(s)),c=await Ye({rpIdHash:t.subarray(0,32)});return new b(e.signer.toString(),{verifyArgs:{clientDataJson:ue(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:Hn(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:c,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function Hn(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(n),...getBase64Encoder().encode(r)]))}function YW(e){return sha256(getUtf8Encoder().encode(canonicalize(e)))}function XW(e){return Vn(e.data.payload.authResponse)}function ZW(e,n,r,s){let t=Hn(n,r,s);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...t]))}async function $W(e,n,r,s,t,o){let i;if(!t||!o){let A=(await j().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!A)throw new Y("Slot sysvar","Unable to fetch slot sysvar data");let y=getBase64Encoder().encode(A[0]);o=getU64Decoder().decode(y.subarray(0,8)).toString(),i=y.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),c=Hn(n,r,s),d=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...a,...i,...c]));return {slotNumber:o,slotHash:t,challenge:d}}function Vn(e){let n=mr(e);return sha256(n)}function QW(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ue(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),o=new ArrayBuffer(t.length),i=new Uint8Array(o);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}async function eO(e,n){let{data:r}=await ss(j(),e),t=sd(r.origins,r.numOrigins).findIndex(o=>o===n);if(t===-1)throw new Y("Origin","Origin not found in domain config");return t}function tO(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function rO(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}function Tr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function QI(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 nd(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let s=JSON.stringify(r);return new TextEncoder().encode(s.slice(1,-1))}function sd(e,n){let r=[],s=0,t=new TextDecoder;for(let o=0;o<n;o++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let i=e[s]|e[s+1]<<8;if(s+=2,s+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(s,s+i),c=t.decode(a);r.push(c),s+=i;}return r}function od(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 _=n&127;r+=_;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,o=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,c=e.slice(a,a+i),d=o[0]===0&&o.length>32?o.slice(1):o,A=c[0]===0&&c.length>32?c.slice(1):c;if(d.length>32||A.length>32)throw new Error("r or s length > 32 bytes");let y=new Uint8Array(32);y.set(d,32-d.length);let p=p256.Point.CURVE().n>>1n,f=BigInt("0x"+Tr(A)),I=(f>p?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=QI(I);return new Uint8Array([...y,...x])}function mr(e){let n=ue(e.response.clientDataJSON),r=ue(e.response.authenticatorData),s=sha256(n);return new Uint8Array([...r,...s])}var eE=400,tE=429,ad=500,rE=3,nE=500,sE=2,oE=3e4,id={backoffBase:sE,maxDelayMs:oE,retryOnRateLimit:true,initialDelayMs:nE,maxRetries:rE};function dd(e){return e===tE}function ud(e){return e>=ad}function cE(e){return e>=eE&&e<ad}function aE(e){return dd(e)||ud(e)}function iE(e,n,r){return e instanceof Response?dd(e.status)?r.retryOnRateLimit??true:cE(e.status)?false:ud(e.status):e instanceof TypeError||e instanceof Error}function dE(e,n,r,s){let t=n*Math.pow(r,e-1);return Math.min(t,s)}function uE(e){return new Promise(n=>setTimeout(n,e))}async function Ot(e,n){let{maxRetries:r,initialDelayMs:s,backoffBase:t,maxDelayMs:o,shouldRetry:i}={...id,...n},a;for(let c=1;c<=r;c++)try{return await e()}catch(d){if(a=d,i&&!i(d,c))throw d;if(c>=r)break;let A=dE(c,s,t,o);await uE(A);}throw new gr(e.name||"retryWithBackoff",r,a)}async function Xe(e,n){let r={...id,...n},s=(o,i)=>iE(o,i,r);return Ot(async()=>{let o=await e();if(!o.ok&&aE(o.status))throw o;return o},{...r,shouldRetry:n?.shouldRetry??s})}function Ad(...e){return n=>e.some(r=>n instanceof r)}function gd(e,n,r,s){if(e<n||e>r)throw new P(`${s} must be between ${n} and ${r} (inclusive), got ${e}`)}function yd(e,n){if(e<0)throw new P(`${n} must be non-negative, got ${e}`)}function Bt(e,n){if(e.length===0)throw new P(`${n} cannot be empty`)}function pd(e,n){if(e.trim().length===0)throw new P(`${n} cannot be empty`)}async function Fn(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await j().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),o=>appendTransactionMessageInstructions(s.instructions,o),o=>setTransactionMessageFeePayerSigner(s.payer,o),o=>setTransactionMessageLifetimeUsingBlockhash(r,o),o=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(o,s.addressesByLookupTableAddress):o,async o=>{let i=Math.ceil((s.unitsConsumed??0)*1.1);return i>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:i})],o):o},async o=>n?compileTransaction(await o):await signTransactionMessageWithSigners(await o))))}async function Sd(e){let n=prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:8e5}),getSetComputeUnitPriceInstruction({microLamports:1e4})],e),r=getBase64EncodedWireTransaction(compileTransaction(n));if(r.length>1644)throw new P(`Transaction exceeds maximum length of ${1644} bytes (actual: ${r.length} bytes)`);let s=await j().simulateTransaction(r,{encoding:"base64"}).send();if(s.value.err){if(s.value.logs){let o=["Transaction simulation failed:","",...s.value.logs].join(`
|
|
2
2
|
`);throw new Error(o)}let t=["Transaction simulation failed:","",s.value.err.toString()].join(`
|
|
3
|
-
`);throw new Error(t)}return s.value.unitsConsumed}async function Sd(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(o=>o.role===AccountRole.WRITABLE||o.role===AccountRole.WRITABLE_SIGNER).map(o=>o.address)).send()).map(o=>Number(o.prioritizationFee));s.sort((o,i)=>o-i);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function xd(e,n){Bt(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new P(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await Xe(()=>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 vt(r,n);let s=await Ut(r);if(!s.result||s.error)throw new se(`Unable to simulate bundle: ${JSON.stringify(s.error??s.result)}`);if(typeof s.result.value.summary!="string"&&s.result.value.summary.failed){let{TransactionFailure:t}=s.result.value.summary.failed.error,[,o]=t;throw new se(`Simulation failed: ${o}`)}return s.result.value.transactionResults.map(t=>t.unitsConsumed)}function oe(e,n=0){let r=e instanceof b?e:void 0,s=r?.verifyArgs&&n!==-1?some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):none(),t=r?.domainConfig?r.domainConfig:void 0,o=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs.clientDataJson?mr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:o,message:i,publicKey:a}}function Pe(e,n,r=[]){let s=[];for(let t of e)if(t instanceof b){let o=r.length,{domainConfig:i,verifyArgs:a,signature:c,publicKey:d,message:A}=oe(t,o);if(A&&c&&d&&r.push({message:A,signature:c,publicKey:d}),i){let y=n.addPreAccounts([{address:i,role:AccountRole.READONLY}]).get(i)?.index;a.__option==="Some"&&y!==void 0&&s.push({__kind:"Secp256r1",fields:[{domainConfigIndex:y,verifyArgs:a.value}]});}}else {let o=n.addPreAccounts([{address:t.address,role:AccountRole.READONLY_SIGNER,signer:t}]).get(t.address)?.index;o!==void 0&&s.push({__kind:"Ed25519",fields:[o]});}return {secp256r1VerifyInput:r,transactionSyncSigners:s}}function ye(e){if(e instanceof Me)return {keyType:_t.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:_t.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function pd(e){return e instanceof b?e.toString():e.address.toString()}function ae(e){let n=new Set,r=[];for(let t of e)n.has(pd(t))||(r.push(t),n.add(pd(t)));let s=r.filter(t=>t instanceof b);if(s.length>1)throw new P(`More than 1 Secp256r1 signers in an instruction is not supported (found ${s.length})`);return r}function Id({payer:e,tipAmount:n}){let r=wn[Math.floor(Math.random()*wn.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function Ed(e){return typeof e=="string"?e:e.toString()}function Cd(e){return e.toString()}async function zn(e,n,r){let s=e?.get(n);if(s)return s;let t=await r();return t&&e&&e.set(n,t),t}var V=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(u.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n,r={address:address(n),role:AccountRole.WRITABLE},s=true){let t=s?this.packedMap:this.preMap;if(!t.has(n)){let o=s?this.nextPackedIndex++:this.nextPreIndex++;t.set(n,{index:o,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 he().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let o of n){let i=this.insertOrGet(o.treeInfo.tree.toString()),a=this.insertOrGet(o.treeInfo.queue.toString());s.push({rootIndex:o.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:o.leafIndex,proveByIndex:o.proveByIndex});let c=o.treeInfo.nextTreeInfo??o.treeInfo,d=this.packOutputTreeIndex(c);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let o of r){let i=this.insertOrGet(o.treeInfo.tree.toString()),a=this.insertOrGet(o.treeInfo.queue.toString());t.push({rootIndex:o.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(n){return Array.from(n.entries()).sort((s,t)=>s[1].index-t[1].index).map(([,{accountMeta:s}])=>({...s}))}getOffsets(n){let r=n,s=r+this.systemAccounts.length;return [r,s]}toAccountMetas(){let n=this.hashSetAccountsToMetas(this.preMap),r=this.hashSetAccountsToMetas(this.packedMap),[s,t]=this.getOffsets(n.length);return {remainingAccounts:[...n,...this.systemAccounts,...r],systemOffset:s,packedOffset:t}}};async function Sr(e,n){let r=Ed(e);return zn(n,r,()=>he().getCompressedAccount(e))}async function xr(e,n){let r=Cd(e);return zn(n,r,()=>z().getAccountInfo(e,{encoding:"base64"}).send())}async function Ae(e,n){let r=(await Promise.all(e.map(s=>Sr(s.address,n)))).filter(s=>s!==null).filter(s=>s.data!==null&&s.address!==null);if(r.length!==e.length)throw new J("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((s,t)=>({...s,type:e[t].type,tree:s.treeInfo.tree,queue:s.treeInfo.queue}))}function U(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function pe(e,n,r,s,t){if(t.length===0)return [];let o=t.map((d,A)=>({treeInfo:n[A],root:r[A],rootIndex:s[A],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],o),a=await e.getOutputTreeIndex();return t.map((d,A)=>({addressTreeInfo:i[A],outputStateTreeIndex:a,address:d.address,type:d.type}))}function ee(e,n,r,s,t,o,i){let a=[];for(let A=0;A<n.length;A++)a.push({treeInfo:n[A],rootIndex:s[A],leafIndex:r[A],proveByIndex:t[A],hash:o[A].hash});let c=e.packTreeInfos(a,[]).stateTrees;if(!c)throw new P("Unable to parse state tree data");return o.map((A,y)=>({data:i.decode(A.data.data),accountMeta:{treeInfo:c.packedTreeInfos[y],address:new Uint8Array(A.address),outputStateTreeIndex:c.outputTreeIndex}}))}async function ie(e,n,r,s,t){let o=null,i=null,a=null,c=new V;if(e){await c.addSystemAccounts();let{address:d}=await ce(n,r),A=(await Ae([{address:d,type:"Settings"}],t))[0];s?a={rootIndices:[0],roots:[],leafIndices:[A.leafIndex],leaves:[],treeInfos:[A.treeInfo],proveByIndices:[A.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 X([A],[]);let y=c.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:A.hash}],[]).stateTrees;if(!y)throw new P("Unable to parse state tree data");let p=Y().decode(A.data?.data);o={accountMeta:{address:new Uint8Array(A.address),treeInfo:y.packedTreeInfos[0]},data:p},i={accountMeta:{address:new Uint8Array(A.address),treeInfo:y.packedTreeInfos[0],outputStateTreeIndex:y.outputTreeIndex},data:p};}return {settingsReadonlyArgs:o,proof:a,packedAccounts:c,settingsMutArgs:i}}async function X(e,n){return Ot(()=>he().getValidityProofV0(e,n))}async function Te(){return (await Ir()).length-1}var Kn;async function Ir(){if(!Kn){let{data:e}=await mo(z(),await Rd());Kn=e.whitelistedAddressTrees;}return Kn}async function wt(e,n,r){let s=await UE(e,n,r);if(!s)throw new J("User account");return s}async function UE(e,n,r){let{address:s}=await W(e,n),t=await Sr(s,r);return t?.data?.data?K().decode(t.data.data):null}async function XO(e,{member:n,credentialId:r}){let s=[{memcmp:{offset:1,encoding:"base58",bytes:e}}];if(n)s.push({memcmp:{offset:33,encoding:"base58",bytes:getBase58Decoder().decode(B().encode(ye(n)))}});else if(r)s.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(ue(r))}});else return null;let t=await he().getCompressedAccountsByOwner(new PublicKey(u.toString()),{filters:s});return t.items.filter(o=>!!o.data).length?t.items.map(o=>K().decode(o.data?.data))[0]:null}async function Er(e,n,r){let s=await LE(e,n,r);if(!s)throw new J("Settings account");return s}async function LE(e,n,r){try{let{address:s}=await ce(e,n),t=await Sr(s,r);if(!t?.data?.data)throw new J("Compressed settings account");let o=Y().decode(t.data.data);if(o.data.__option==="None")throw new J("Compressed settings account");return {...o.data.value,isCompressed:!0}}catch{let s=await An(z(),e);return s.exists?{...s.data,isCompressed:false}:null}}async function ZO(e,n,r){let s=await wt(e,n,r);if(s.role===1||s.role===0){let t=[],[o,i]=await Promise.all([he().getCompressedAccountsByOwner(new PublicKey(u.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:getBase58Decoder().decode(B().encode(ye(e)))}}]}),z().getProgramAccounts(u,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(B().encode(ye(e)))}}]}).send()]);return o.items.forEach(a=>{if(a.data?.data){let c=Y().decode(a.data.data);c.data.__option==="Some"&&t.push({...c.data.value,isCompressed:true});}}),i.forEach(a=>{let c=nr().decode(getBase64Encoder().encode(a.account.data[0]));t.push({...c,isCompressed:false});}),t}else return await Promise.all(s.wallets.map(async t=>Er(await me(t.index),t.settingsAddressTreeIndex,r)))}async function Jn(e){gd(e,"index");let n=await Ir();if(e>=n.length)throw new P(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function $O(e){let r=(await Ir()).findIndex(s=>s.toString()===e);if(r===-1)throw new J("Address tree",`Address ${e} not found in whitelist`);return r}async function ce(e,n=0){let r=await Jn(n),s=deriveAddressSeedV2([getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(u)).toString(),"base58"),addressTree:new PublicKey(r)}}async function W(e,n=0){let r=await Jn(n),s=deriveAddressSeedV2([getUtf8Encoder().encode("user"),e instanceof Me?e.toTruncatedBuffer():getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(u.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function Ye({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(getUtf8Encoder().encode(n));else throw new P("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function vd(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function Rd(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Ud(e,n,r){Ad(r,0,255,"buffer_index");let[s]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof Me?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function Ee(e){let[n]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function me(e){let[n]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function dB(e){let n=await me(e);return await Ee(n)}async function uB(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function SB(e){Bt(e,"bundle");let n=await Fn(e,true),r=await xd(n.map(getBase64EncodedWireTransaction),Zi()),s=await Fn(e.map((o,i)=>({...o,unitsConsumed:r[i]})));return await NE(s.map(getBase64EncodedWireTransaction))}async function NE(e,n=kn(),r){Bt(e,"serializedTransactions");let{blockEngineUrl:s}=n,t=`${s}/bundles`,o=await Xe(()=>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 vt(o,t);let i=await Ut(o);if(i.error)throw new se(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new se("No bundle ID returned from Jito");return i.result}async function xB(e,n=30,r=3e3,s=kn()){yd(e,"bundleId");let{blockEngineUrl:t}=s,o=`${t}/getBundleStatuses`;return Ot(async()=>{let i=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await vt(i,o);let a=await Ut(i);if(a.error)throw new se(`Error getting bundle status: ${JSON.stringify(a.error,null,2)}`,e);if(!a.result?.value?.length)throw new se("Bundle not yet confirmed",e);let c=a.result.value[0];if(c.confirmation_status==="confirmed"||c.confirmation_status==="finalized"){let d=c.transactions[c.transactions.length-1];if(!d)throw new se("No transactions in confirmed bundle",e);return d}throw new se(`Bundle status: ${c.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:ud(se,ge)})}async function hB({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await z().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),o=>appendTransactionMessageInstructions(e,o),o=>setTransactionMessageFeePayerSigner(n,o),o=>setTransactionMessageLifetimeUsingBlockhash(s.value,o),o=>r?compressTransactionMessageUsingAddressLookupTables(o,r):o,async o=>{let[i,a]=await Promise.all([fd(o),Sd(z(),o.instructions.flatMap(d=>d.accounts??[]))]),c=Math.ceil((Number(i)??0)*1.1);return prependTransactionMessageInstructions([...c>2e5?[getSetComputeUnitLimitInstruction({units:c})]:[],...a>0?[getSetComputeUnitPriceInstruction({microLamports:a})]:[]],o)},async o=>await signTransactionMessageWithSigners(await o));return await $i()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function GB(e,n){if(n.threshold>1)throw new P("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(c=>Bd(c.pubkey)===e);if(!r)throw new J("Member",`Signer ${e} not found in settings`);let{permissions:s}=r;if(!s)throw new J("Permissions","No permissions found for the current member");let t=De.has(s,Ie.InitiateTransaction),o=De.has(s,Ie.VoteTransaction),i=De.has(s,Ie.ExecuteTransaction);if(t&&o&&i)return {};if(!o||!i)throw new yr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[o?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(c=>c.role===0);if(!a)throw new J("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(Bd(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function FB({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let o=await wt(n,r,t);if(o.transactionManagerUrl.__option==="None")throw new J("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return eC(n,o.transactionManagerUrl.value,e,s)}function eC(e,n,r,s){return {address:e,async signTransactions(t){let o=await Xe(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:e.toString(),payload:t.map(a=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(a)),transactionMessageBytes:s?getBase64Decoder().decode(s):void 0,authResponses:r}))})}));if(!o.ok)throw new ge(`Transaction manager request failed: ${o.statusText}`,o.status,n);let i=await o.json();if("error"in i)throw new ge(`Transaction manager error: ${i.error}`,o.status,n);return i.signatures.map(a=>({[e]:getBase58Encoder().encode(a)}))}}}function Bd(e){return e.keyType===_t.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function zB(e){let n=e.map(o=>We().encode(o)),r=4+n.reduce((o,i)=>o+i.length,0),s=new Uint8Array(r),t=0;s.set(getU32Encoder().encode(e.length),t),t+=4;for(let o of n)s.set(o,t),t+=o.length;return s}function KB(e){let n=0,[r,s]=getU32Decoder().read(e,n);n=s;let t=new Array(r);for(let o=0;o<r;o++){let i=Oe().read(e,n);t[o]=i[0],n=i[1];}if(n!==e.length)throw new P(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function aN({payer:e,rpId:n,origins:r,authority:s}){let t=await Ye({rpId:n}),o=new V;await o.addSystemAccounts();let i=await Te(),{address:a,addressTree:c}=await W(s.address,i),d=[{address:a,tree:c,queue:c,type:"User"}],A=await X([],d),y=(await pe(o,A.treeInfos,A.roots,A.rootIndices,d))[0],{remainingAccounts:p,systemOffset:f}=o.toAccountMetas(),S=U(A,f);return await $o({origins:r,authorityCreationArgs:y,authority:s,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function fN({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let o=new V;await o.addSystemAccounts();let i=[];r.settings&&(i.push({address:(await ce(r.settings,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&i.push({address:(await W(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let a=i.length?await Ae(i,t):[],c=await Te(),{address:d,addressTree:A}=await W(r.member,c),y=[{address:d,type:"User",tree:A,queue:A}],p=await X(a,y),f=null,S=null,I=a.filter(Z=>Z.type==="Settings"),x=a.filter(Z=>Z.type==="User");I.length&&(f=ee(o,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),I,Y())[0]),x.length&&(S=ee(o,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,K())[0]);let _=await pe(o,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),y),{remainingAccounts:h,systemOffset:v}=o.toAccountMetas(),L=U(p,v);return await nc({payer:n,authority:e,compressedProofArgs:L,member:St().decode(r.member.toBuffer()),credentialId:ue(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:f?some({settingsMutArgs:f,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:_[0],domainConfig:s,remainingAccounts:h})}async function EN({payer:e}){let n=await vd();return ac({payer:e,globalCounter:n})}async function RN({admin:e,rpId:n,disable:r}){let s=await Ye({rpId:n});return Cc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}function rC(e,n,r,s){let t=nC(e,n),o=sC(e,n)&&r!==s;return t&&o?AccountRole.WRITABLE_SIGNER:t&&!o?AccountRole.WRITABLE:!t&&o?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function nC(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:o}=e.header,i=s-t,a=r-s-o;return n>=r?false:n<i?true:n>=s?n-s<a:false}function sC(e,n){return n<e.header.numSignerAccounts}async function Cr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Ji(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let o=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),z()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,c]of t.staticAccounts.entries())i.push({address:c,role:rC(t,a,c,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let c=o[a.lookupTableAddress];if(!c)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let A=c[d];if(!A)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:A,role:AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let A=c[d];if(!A)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:A,role:AccountRole.READONLY});}}for(let a of s?.filter(c=>c.address!==e)??[]){let c=i.findIndex(d=>d.address===a.address);c===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[c].role===AccountRole.READONLY||i[c].role===AccountRole.READONLY_SIGNER?i[c]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[c].role===AccountRole.WRITABLE||i[c].role===AccountRole.WRITABLE_SIGNER)&&(i[c]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:o,transactionMessage:t}}var $e=33,Qe=64,Zn=14,AC=2,gC=address("Secp256r1SigVerify1111111111111111111111111");function yC(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function pC(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function Gd(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let s=getU8Decoder().decode(e,n);n+=1;let t=[],o=pC();for(let a=0;a<r;a++)t.push(o.decode(e,n)),n+=Zn;let i=[];for(let a=0;a<r;a++){let c=fixDecoderSize(getBytesDecoder(),$e).decode(e,n);n+=$e;let d=fixDecoderSize(getBytesDecoder(),Qe).decode(e,n);n+=Qe;let A=t[a].messageDataSize,y=fixDecoderSize(getBytesDecoder(),A).decode(e,n);n+=A,i.push({publicKey:c,signature:d,message:y});}return [{numSignatures:r,padding:s,offsets:t,payload:i},n]}})}function Fd(){return createEncoder({getSizeFromValue:e=>{let n=Zn*e.offsets.length,r=e.payload.reduce((s,t)=>s+$e+Qe+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=getU8Encoder().write(e.numSignatures,n,r),r=getU8Encoder().write(e.padding,n,r);let s=yC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),$e).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),Qe).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function kN(){return combineCodec(Fd(),Gd())}function O(e,n){let r=e.length,s=AC+r*Zn,t=[];for(let c=0;c<r;c++){let{message:d}=e[c],A=s,y=A+$e,p=y+Qe;t.push({publicKeyOffset:A,publicKeyInstructionIndex:65535,signatureOffset:y,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),s+=$e+Qe+d.length;}let o=n?.programAddress??gC,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:o,data:Fd().encode(i)}}function HN(e){return {programAddress:e.programAddress,accounts:{},data:Gd().decode(e.data)}}async function zd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:o=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:c=false}){let d=await Ee(e),{accountMetas:A,addressLookupTableAccounts:y}=await Cr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return o.length>0&&p.push(O(o)),p.push(c?Mi({transactionBuffer:n,payer:s.address,remainingAccounts:A,settingsKey:e}):Si({transactionBuffer:n,payer:s.address,settings:e})),a&&p.push(Id({payer:s,tipAmount:a})),{instructions:p,addressLookupTableAccounts:y}}async function Kd({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,additionalSigners:s,signers:t,payer:o,addressesByLookupTableAddress:i,secp256r1VerifyInput:a=[],compressed:c=false,simulateProof:d=false,cachedAccounts:A}){let y=ae(t),p=await Ee(e),[{accountMetas:f,addressLookupTableAccounts:S,transactionMessage:I},{settingsMutArgs:x,proof:_,packedAccounts:h}]=await Promise.all([Cr({transactionMessageBytes:r,walletAddress:p,additionalSigners:s,addressesByLookupTableAddress:i}),ie(c,e,n,d,A)]);h.addPreAccounts(f);let{secp256r1VerifyInput:v,transactionSyncSigners:L}=Pe(y,h,a),{remainingAccounts:Z,systemOffset:re}=h.toAccountMetas(),ne=[];v.length>0&&ne.push(O(v));let je=TC(I,f);if(c){if(!o||!x)throw new P("Payer not found or proof args are missing for executeTransactionSync.");let be=U(_,re);ne.push(Ni({signers:L,transactionMessage:je,settingsMutArgs:x,compressedProofArgs:be,payer:o,remainingAccounts:Z}));}else ne.push(vi({signers:L,settings:e,transactionMessage:je,remainingAccounts:Z}));return {instructions:ne,addressLookupTableAccounts:S}}function TC(e,n){if(e.version==="legacy")throw new P("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(s=>s.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function Tw({settings:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:o,payer:i,compressed:a=false}){let c=ae(s),d=await Ee(e),[{packedAccounts:A,proof:y,settingsMutArgs:p},{value:f}]=await Promise.all([ie(a,e,n,false,t),xr(d,t)]);if((f?.lamports??0)<BigInt(o))throw new P("Insufficient balance for native transfer.");let{secp256r1VerifyInput:S,transactionSyncSigners:I}=Pe(c,A),{remainingAccounts:x,systemOffset:_}=A.toAccountMetas(),h=[];if(S.length>0&&h.push(O(S)),a){if(!i||!p)throw new Error("Payer not found or proof args is missing.");let v=U(y,_);h.push(Zc({amount:o,settingsMutArgs:p,compressedProofArgs:v,payer:i,signers:I,source:d,destination:r,remainingAccounts:x}));}else h.push(Kc({amount:o,signers:I,source:d,destination:r,settings:e,remainingAccounts:x}));return h}async function hw({settings:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:o,amount:i,payer:a,tokenProgram:c,compressed:d=false}){let A=ae(t),y=await Ee(e),p=await getAssociatedTokenAccountAddress(s,y,c),[{packedAccounts:f,proof:S,settingsMutArgs:I},{value:x}]=await Promise.all([ie(d,e,n,false,o),xr(p,o)]);if((x?getTokenDecoder().decode(getBase64Encoder().encode(x.data[0])).amount:0)<i)throw new P("Insufficient balance for token transfer.");let{secp256r1VerifyInput:h,transactionSyncSigners:v}=Pe(A,f),{remainingAccounts:L,systemOffset:Z}=f.toAccountMetas(),re=[];if(h.length>0&&re.push(O(h)),d){if(!a||!I)throw new Error("Payer not found or proof args is missing.");let ne=U(S,Z);re.push(await aa({amount:i,settingsMutArgs:I,compressedProofArgs:ne,payer:a,signers:v,source:y,destination:r,remainingAccounts:L,sourceSplTokenAccount:p,tokenProgram:c,mint:s}));}else re.push(await ta({amount:i,signers:v,source:y,destination:r,settings:e,remainingAccounts:L,sourceSplTokenAccount:p,tokenProgram:c,mint:s}));return re}async function kw({signers:e,payer:n,changeConfigArgs:r}){let{settings:s,configActions:t,compressed:o,packedAccounts:i,proof:a,settingsMutArgs:c}=r,d=ae(e),A=[],y=[];for(let x of d)if(x instanceof b){let _=y.length,{domainConfig:h,verifyArgs:v,signature:L,publicKey:Z,message:re}=oe(x,_);if(re&&L&&Z&&y.push({message:re,signature:L,publicKey:Z}),h){let ne=i.addPreAccounts([{address:h,role:AccountRole.READONLY}]).get(h)?.index;v.__option==="Some"&&ne!==void 0&&A.push({__kind:"Secp256r1",fields:[{domainConfigIndex:ne,verifyArgs:v.value}]});}}else {let _=i.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]).get(x.address)?.index;_!==void 0&&A.push({__kind:"Ed25519",fields:[_]});}let{remainingAccounts:p,systemOffset:f}=i.toAccountMetas(),S=U(a,f),I=[];if(y.length>0&&I.push(O(y)),o){if(!c)throw new P("Proof args are missing for compressed changeConfig.");I.push(No({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:c,remainingAccounts:p,signers:A}));}else I.push(bo({settings:s,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:p,signers:A}));return I}async function jw({createUserArgs:e,payer:n}){let r=new V;await r.addSystemAccounts(),r.addPreAccounts(e.map(A=>({address:A.member.address,role:AccountRole.READONLY_SIGNER,signer:A.member})));let s=await Te(),t=await Promise.all(e.map(async A=>{let{address:y,addressTree:p}=await W(A.member.address,s);return {address:y,tree:p,queue:p,type:"User"}})),o=await X([],t),i=await pe(r,o.treeInfos,o.roots,o.rootIndices,t),{remainingAccounts:a,systemOffset:c}=r.toAccountMetas(),d=U(o,c);return await Ac({compressedProofArgs:d,payer:n,createUserArgs:e.map((A,y)=>({member:A.member.address,role:A.role,userCreationArgs:i[y],transactionManagerUrl:A.role===0?A.transactionManagerUrl:null})),remainingAccounts:a})}async function Qw({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let o=new V;await o.addSystemAccounts();let i=[],a=[];a.push(...await Ae([{address:(await W(r.address,s)).address,type:"User"}],t));let c=await Te(),{address:d,addressTree:A}=await ce(await me(e),c);i.push({address:d,queue:A,tree:A,type:"Settings"});let y=a.length,p=await X(a,i),f=ee(o,p.treeInfos.slice(0,y),p.leafIndices.slice(0,y),p.rootIndices.slice(0,y),p.proveByIndices.slice(0,y),a.filter(v=>v.type==="User"),K())[0],I=(await pe(o,p.treeInfos.slice(y),p.roots.slice(y),p.rootIndices.slice(y),i)).find(v=>v.type==="Settings")??null,{remainingAccounts:x,systemOffset:_}=o.toAccountMetas(),h=U(p,_);if(!I)throw new Error("Settings creation args is missing.");return await Go({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:h,...I,remainingAccounts:x})}async function dk({settings:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:o,proof:i,settingsMutArgs:a}=await ie(true,e,n,false,t);if(!a)throw new P("Proof args are missing for settings account.");let c=ae(s),{secp256r1VerifyInput:d,transactionSyncSigners:A}=Pe(c,o),{remainingAccounts:y,systemOffset:p}=o.toAccountMetas(),f=U(i,p),S=[];return d.length>0&&S.push(O(d)),S.push(lc({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:f,signers:A,remainingAccounts:y})),S}async function mk({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,o=[];if(r){let i=new V;await i.addSystemAccounts();let a=await Te(),{address:c,addressTree:d}=await W(r.address,a),A=[{address:c,tree:d,queue:d,type:"User"}],y=await X([],A),p=(await pe(i,y.treeInfos,y.roots,y.rootIndices,A))[0],f=i.toAccountMetas();o=f.remainingAccounts,t={compressedProofArgs:U(y,f.systemOffset),authorityCreationArgs:p};}return bc({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:o})}async function Ek({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new V;await s.addSystemAccounts();let t=await Ae([{address:(await W(e.address,n)).address,type:"User"}]),o=await X(t,[]),i=ee(s,o.treeInfos,o.leafIndices,o.rootIndices,o.proveByIndices,t,K())[0],{remainingAccounts:a,systemOffset:c}=s.toAccountMetas(),d=U(o,c);return Oc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function Uk({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:o,verifyArgs:i,message:a,signature:c,publicKey:d}=oe(n),A=[];a&&c&&d&&A.push({message:a,signature:c,publicKey:d});let y=await wt(n instanceof b?n:n.address,r,t),p=[];p.push({address:(await W(n instanceof b?n:n.address,r)).address,type:"User"});let f,S=null,I,x=null,_=y.wallets.find(le=>le.isDelegate);if(_){let le=await me(_.index);(await Er(le,_.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ce(le,_.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):f=await me(_.index);}if(s){let le=await me(s.index);(await Er(le,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ce(le,s.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):I=await me(s.index);}let h=new V;await h.addSystemAccounts();let v=await Ae(p,t),L=await X(v,[]),Z=ee(h,L.treeInfos.slice(0,1),L.leafIndices.slice(0,1),L.rootIndices.slice(0,1),L.proveByIndices.slice(0,1),v.slice(0,1),K())[0],re=S?some(ee(h,L.treeInfos.slice(S.start,S.end),L.leafIndices.slice(S.start,S.end),L.rootIndices.slice(S.start,S.end),L.proveByIndices.slice(S.start,S.end),v.slice(S.start,S.end),Y())[0]):none(),ne=x?some(ee(h,L.treeInfos.slice(x.start,x.end),L.leafIndices.slice(x.start,x.end),L.rootIndices.slice(x.start,x.end),L.proveByIndices.slice(x.start,x.end),v.slice(x.start,x.end),Y())[0]):none(),{remainingAccounts:je,systemOffset:be}=h.toAccountMetas(),hr=U(L,be),et=[];return A.length>0&&et.push(O(A)),et.push(Vc({secp256r1VerifyArgs:i,domainConfig:o,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof b?void 0:n,oldSettings:f,oldSettingsMutArgs:re,newSettings:I,newSettingsMutArgs:ne,compressedProofArgs:hr,userMutArgs:Z,remainingAccounts:je})),et}async function Yk({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:s,compressed:t=false,cachedAccounts:o}){let i=await uo(z(),r),a=i.data.multiWalletSettings,{packedAccounts:c,proof:d,settingsMutArgs:A}=await ie(t,a,e,false,o),{remainingAccounts:y,systemOffset:p}=c.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:I,signature:x,publicKey:_}=oe(n),h=[];if(I&&x&&_&&h.push(O([{message:I,signature:x,publicKey:_}])),t){if(!s||!A)throw new P("Payer not found or proof args are missing for closing buffer.");let v=U(d,p);h.push(Sa({transactionBuffer:r,domainConfig:f,closer:n instanceof b?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:A,payer:s,compressedProofArgs:v,remainingAccounts:y}));}else h.push(ya({transactionBuffer:r,domainConfig:f,closer:n instanceof b?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return h}function Jd({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:o,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:c,compressedArgs:d,expectedSigners:A}){let{domainConfig:y,verifyArgs:p,message:f,signature:S,publicKey:I}=oe(n),x=[];if(f&&S&&I&&x.push(O([{message:f,signature:S,publicKey:I}])),d){let{settingsReadonlyArgs:_,compressedProofArgs:h,remainingAccounts:v}=d;x.push(va({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof b?void 0:n,domainConfig:y,args:{bufferIndex:r,finalBufferHash:o,finalBufferSize:i,bufferExtendHashes:c,preauthorizeExecution:a,expectedSigners:A},settingsReadonlyArgs:_,compressedProofArgs:h,remainingAccounts:v}));}else x.push(Ma({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof b?void 0:n,domainConfig:y,args:{bufferIndex:r,finalBufferHash:o,finalBufferSize:i,bufferExtendHashes:c,preauthorizeExecution:a,expectedSigners:A},remainingAccounts:[]}));return x}function qd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:o,signature:i,message:a,publicKey:c}=oe(e),d=[];return a&&i&&c&&d.push(O([{message:a,signature:i,publicKey:c}])),s?d.push(Fa({transactionBuffer:n,secp256r1VerifyArgs:o,domainConfig:t,executor:e instanceof b?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Na({settings:r,transactionBuffer:n,secp256r1VerifyArgs:o,domainConfig:t,executor:e instanceof b?void 0:e,remainingAccounts:[]})),d}function Yd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?ti({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Ya({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Xd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:o,signature:i,publicKey:a,message:c}=oe(n),d=[];return c&&i&&a&&d.push(O([{message:c,signature:i,publicKey:a}])),s?d.push(yi({transactionBuffer:r,secp256r1VerifyArgs:o,domainConfig:t,voter:n instanceof b?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(ai({settings:e,transactionBuffer:r,secp256r1VerifyArgs:o,domainConfig:t,voter:n instanceof b?void 0:n,remainingAccounts:[]})),d}async function w2({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let o=await EC(r),i=new V,a=null,c=null,d=[];if(o.length||t){let y=await CC({packedAccounts:i,userAccounts:o,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:s});a=y.proof,c=y.settingsMutArgs??null,d=y.userMutArgs??[];}return {configActions:await DC({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:c,packedAccounts:i,compressed:t}}async function EC(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>W(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let s=await Promise.all(r.members.map(t=>W(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function CC({packedAccounts:e,userAccounts:n,compressed:r,settings:s,settingsAddressTreeIndex:t,cachedAccounts:o}){await e.addSystemAccounts();let i=[];if(r){let f=(await ce(s,t)).address;i.push({address:f,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await Ae(i,o):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let c=await X(a,[]),d=[],A=[];for(let f of a)f.type==="Settings"?d.push(f):f.type==="User"&&A.push(f);let y,p=[];if(r&&c&&(y=ee(e,c.treeInfos.slice(0,1),c.leafIndices.slice(0,1),c.rootIndices.slice(0,1),c.proveByIndices.slice(0,1),d,Y())[0]),A.length&&c){let f=r?1:0;p=ee(e,c.treeInfos.slice(f),c.leafIndices.slice(f),c.rootIndices.slice(f),c.proveByIndices.slice(f),A,K());}return {proof:c,settingsMutArgs:y,userMutArgs:p}}async function DC({configActionsArgs:e,userMutArgs:n}){let r=[];for(let s of e)switch(s.type){case "AddMembers":{let t=[];for(let o of s.members){let i=await W(o.member,o.userAddressTreeIndex).then(a=>n.find(c=>equalBytes(c.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(a.address)))));if(!i)throw new Error("Unable to find user account");t.push(hC({permissionArgs:o.permissions,userMutArgs:i,pubkey:o.member}));}r.push({__kind:s.type,fields:[t]});break}case "RemoveMembers":{let t=await Promise.all(s.members.map(o=>W(o.member,o.userAddressTreeIndex).then(i=>{let a=n.find(c=>equalBytes(c.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(i.address))));if(!a)throw new Error("Unable to find user account");return RC({pubkey:o.member,userMutArgs:a})})));r.push({__kind:s.type,fields:[t]});break}case "EditPermissions":{let t=s.members.map(o=>MC({permissionArgs:o.permissions,pubkey:o.member}));r.push({__kind:s.type,fields:[t]});break}default:r.push({__kind:s.type,fields:[s.threshold]});}return r}function MC({pubkey:e,permissionArgs:n}){return {memberKey:ye(e),permissions:eu(n)}}function RC({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:ye(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function hC({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:ye(e),permissions:eu(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function eu(e){let n=[];return e.initiate&&n.push(Ie.InitiateTransaction),e.vote&&n.push(Ie.VoteTransaction),e.execute&&n.push(Ie.ExecuteTransaction),De.fromPermissions(n)}async function j2({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:o,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:c,compressed:d=false,additionalVoters:A=[],additionalSigners:y=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:f}){let S=Math.floor(Math.random()*255),I=await Ud(n,t instanceof b?t:t.address,S),x=[],_=[];for(let $=0;$<s.length;$+=p){let es=s.subarray($,$+p);x.push(es),_.push(sha256(es));}let h=sha256(s),{settingsReadonlyArgs:v,settingsMutArgs:L,proof:Z,packedAccounts:re}=await ie(d,n,r,false,f),{remainingAccounts:ne,systemOffset:je}=re.toAccountMetas(),be=Z&&v&&L?{settingsReadonlyArgs:v,settingsMutArgs:L,compressedProofArgs:U(Z,je),remainingAccounts:ne,payer:e}:null,hr=ae([t,...o?[o]:[],...A]).map($=>({memberKey:ye($),messageHash:$ instanceof b?Vn($.authResponse):null})),et=Jd({finalBufferHash:h,finalBufferSize:s.length,bufferIndex:S,payer:e,transactionBufferAddress:I,settings:n,creator:t,preauthorizeExecution:!o,bufferExtendHashes:_,compressedArgs:be,expectedSigners:hr}),le=x.map($=>Yd({transactionMessageBytes:$,transactionBufferAddress:I,settings:n,compressed:d})),Ht=A.map($=>Xd({voter:$,transactionBufferAddress:I,settings:n,compressedArgs:be})),nu=qd({compressedArgs:be,settings:n,executor:o,transactionBufferAddress:I}),{instructions:l,addressLookupTableAccounts:su}=await zd({compressed:d,settings:n,transactionMessageBytes:s,transactionBufferAddress:I,payer:e,additionalSigners:y,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:c}),tt=$=>({payer:e,instructions:$,addressesByLookupTableAddress:su});return [tt(et),...le.map($=>tt([$])),...Ht.length?[tt(Ht.flat())]:[],tt(nu),tt(l)]}var Mr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=i=>{let a=s.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},s.set(i,a)),a},o=t(r);o.isSigner=true,o.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let c=t(a.address);c.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,c.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),s=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),o=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:o.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 c=[...r.map(([d])=>d),...s.map(([d])=>d),...t.map(([d])=>d),...o.map(([d])=>d)];return [i,c]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,o]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:o}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[o,i]of this.keyMetaMap.entries())if(r(i)){let a=o,c=n.findIndex(d=>d===a);if(c>=0){if(c>=256)throw new Error("Max lookup table index exceeded");s.push(c),t.push(a),this.keyMetaMap.delete(o);}}return [s,t]}};var Rr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((o,i)=>{s.set(o,i);});let t=o=>{let i=s.get(o);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(o=>({programAddressIndex:t(o.programAddress),accountIndices:o.accounts?.map(i=>t(i.address))??[],data:o.data}))}};function ru({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Mr.compile(r,e),o=new Array,i={writable:[],readonly:[]},a=Object.entries(s??{});for(let p of a){let f=t.extractTableLookup(p);if(f!==void 0){let{addressTableLookup:S,drainedKeys:I}=f;o.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[c,d]=t.getMessageComponents(),y=new Rr(d,i).compileInstructions(r);return {version:0,header:c,instructions:y,lifetimeToken:n,staticAccounts:d,addressTableLookups:o}}function o8({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=ru({instructions:e,payer:n,recentBlockhash:u,addressesByLookupTableAddress:r});return new Uint8Array(ji(s))}async function u8({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,additionalSigners:o,secp256r1VerifyInput:i,addressesByLookupTableAddress:a,cachedAccounts:c,compressed:d=false,simulateProof:A=false}){let{instructions:y,addressLookupTableAccounts:p}=await Kd({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,additionalSigners:o,transactionMessageBytes:s,secp256r1VerifyInput:i,compressed:d,addressesByLookupTableAddress:a,simulateProof:A,cachedAccounts:c});return {payer:e,instructions:y,addressesByLookupTableAddress:p}}export{So as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,wI as AdditionalSignersSchema,Gi as AuthenticationContextSchema,Fi as BaseResponseSchema,Wo as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,Ro as CHANGE_CONFIG_DISCRIMINATOR,Ho as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,Xo as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,tc as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,oc as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,dc as CREATE_USER_ACCOUNTS_DISCRIMINATOR,oW as CompleteMessageRequestSchema,aW as CompleteSendTransactionRequestSchema,cW as CompleteTransactionRequestSchema,pc as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,xc as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,ts as DOMAIN_CONFIG_DISCRIMINATOR,hc as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,Uc as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,wc as EDIT_USER_DELEGATE_DISCRIMINATOR,as as GLOBAL_COUNTER_DISCRIMINATOR,_t as KeyType,Wx as MULTI_WALLET_ERROR__ALREADY_DELEGATED,ux as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,RI as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,eI as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,rI as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,nI as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,DI as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,OI as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,yx as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,gx as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,Dx as MULTI_WALLET_ERROR__EMPTY_MEMBERS,dI as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,Ix as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,Ax as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,Sx as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,Fx as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,zx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,Kx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,iI as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,Nx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,Ox as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,Bx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,bx as MULTI_WALLET_ERROR__INVALID_ACCOUNT,CI as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,cI as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,Ex as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,vx as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,Gx as MULTI_WALLET_ERROR__INVALID_BUFFER,uI as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,wx as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,Px as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,mx as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,sx as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,ax as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,nx as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,cx as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,Qx as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,Zx as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,Rx as MULTI_WALLET_ERROR__INVALID_THRESHOLD,xI as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,xx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,fx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,hx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,bI as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,_x as MULTI_WALLET_ERROR__INVALID_USER_ROLE,PI as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,SI as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,ix as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,Yx as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,sI as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,yI as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,EI as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,Ux as MULTI_WALLET_ERROR__MISSING_ACCOUNT,AI as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,mI as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,_I as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,fI as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,gI as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,Lx as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,LI as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,UI as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,aI as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,vI as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,lI as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,Xx as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,MI as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,WI as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,Hx as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,Cx as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,Tx as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,lx as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,oI as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,TI as MULTI_WALLET_ERROR__PAYER_MISMATCH,px as MULTI_WALLET_ERROR__PERMANENT_MEMBER,qx as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,dx as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,pI as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,ox as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,$x as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,II as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,Mx as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,jx as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,Jx as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,tI as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,Vx as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,hI as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,kx as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,u as MULTI_WALLET_PROGRAM_ADDRESS,ex as MultiWalletAccount,tx as MultiWalletInstruction,qc as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Fc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Ie as Permission,De as Permissions,eo as SETTINGS_DISCRIMINATOR,Me as Secp256r1Key,b as SignedSecp256r1Key,Hi as StartMessageRequestSchema,Vi as StartTransactionRequestSchema,oa as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Qc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,ma as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,ua as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,Pa as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,Ea as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,co as TRANSACTION_BUFFER_DISCRIMINATOR,Ha as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Wa as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,$a as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,ja as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,ui as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,si as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,Ei as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,mi as TRANSACTION_EXECUTE_DISCRIMINATOR,Wi as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,Pi as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,ki as TransactionActionTypeSchema,kI as TransactionDetailsSchema,sW as TransactionPayloadSchema,NI as TransactionPayloadWithBase64MessageBytesSchema,un as Transports,BI as UserInfoSchema,Ce as UserRole,yo as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,ZL as addWhitelistedAddressTrees,ue as base64URLStringToBuffer,QW as bufferToBase64URLString,kw as changeConfig,Yk as closeTransactionBuffer,fD as configAction,rO as convertBase64StringToJWK,tO as convertJWKToBase64String,Bd as convertMemberKeyToString,JW as convertPubkeyCompressedToCose,jW as convertPubkeyCoseToCompressed,XW as createClientAuthorizationCompleteRequestChallenge,YW as createClientAuthorizationStartRequestChallenge,aN as createDomainConfig,fN as createDomainUserAccounts,EN as createGlobalCounter,ZW as createMessageChallenge,Jd as createTransactionBuffer,$W as createTransactionChallenge,eC as createTransactionManagerSigner,jw as createUserAccounts,Qw as createWallet,ns as decodeDomainConfig,ds as decodeGlobalCounter,to as decodeSettings,io as decodeTransactionBuffer,To as decodeWhitelistedAddressTree,dk as decompressSettingsAccount,KB as deserializeConfigActions,RN as disableDomainConfig,mk as editDomainConfig,Ek as editTransactionManagerUrl,Uk as editUserDelegate,zd as executeTransaction,qd as executeTransactionBuffer,Kd as executeTransactionSync,Yd as extendTransactionBuffer,LC as fetchAllDomainConfig,HC as fetchAllGlobalCounter,fu as fetchAllMaybeDomainConfig,Wu as fetchAllMaybeGlobalCounter,np as fetchAllMaybeSettings,Cp as fetchAllMaybeTransactionBuffer,Fp as fetchAllMaybeWhitelistedAddressTree,mh as fetchAllSettings,ZO as fetchAllSettingsAccountByMember,Eh as fetchAllTransactionBuffer,hh as fetchAllWhitelistedAddressTree,ss as fetchDomainConfig,kC as fetchGlobalCounter,lu as fetchMaybeDomainConfig,Lu as fetchMaybeGlobalCounter,An as fetchMaybeSettings,LE as fetchMaybeSettingsAccountData,Ep as fetchMaybeTransactionBuffer,UE as fetchMaybeUserAccountData,Gp as fetchMaybeWhitelistedAddressTree,Th as fetchSettings,Er as fetchSettingsAccountData,uo as fetchTransactionBuffer,XO as fetchUserAccountByFilters,wt as fetchUserAccountData,mo as fetchWhitelistedAddressTree,KC as getAddMemberArgsCodec,br as getAddMemberArgsDecoder,Pr as getAddMemberArgsEncoder,zh as getAddWhitelistedAddressTreesDiscriminatorBytes,jh as getAddWhitelistedAddressTreesInstruction,Io as getAddWhitelistedAddressTreesInstructionAsync,Kh as getAddWhitelistedAddressTreesInstructionDataCodec,xo as getAddWhitelistedAddressTreesInstructionDataDecoder,Sn as getAddWhitelistedAddressTreesInstructionDataEncoder,dP as getChangeConfigCompressedDiscriminatorBytes,No as getChangeConfigCompressedInstruction,uP as getChangeConfigCompressedInstructionDataCodec,Bo as getChangeConfigCompressedInstructionDataDecoder,Oo as getChangeConfigCompressedInstructionDataEncoder,eP as getChangeConfigDiscriminatorBytes,bo as getChangeConfigInstruction,tP as getChangeConfigInstructionDataCodec,Po as getChangeConfigInstructionDataDecoder,ho as getChangeConfigInstructionDataEncoder,Hn as getClientAndDeviceHash,qC as getCompiledInstructionCodec,vr as getCompiledInstructionDecoder,_r as getCompiledInstructionEncoder,$C as getCompressedAccountMetaCodec,ot as getCompressedAccountMetaDecoder,st as getCompressedAccountMetaEncoder,rD as getCompressedAccountMetaReadOnlyCodec,dt as getCompressedAccountMetaReadOnlyDecoder,it as getCompressedAccountMetaReadOnlyEncoder,oD as getCompressedProofCodec,Nr as getCompressedProofDecoder,Br as getCompressedProofEncoder,ce as getCompressedSettingsAddress,dD as getCompressedSettingsCodec,yD as getCompressedSettingsDataCodec,kr as getCompressedSettingsDataDecoder,wr as getCompressedSettingsDataEncoder,Y as getCompressedSettingsDecoder,ut as getCompressedSettingsEncoder,lD as getConfigActionCodec,Oe as getConfigActionDecoder,We as getConfigActionEncoder,fP as getCreateCompressedWalletDiscriminatorBytes,xP as getCreateCompressedWalletInstruction,Go as getCreateCompressedWalletInstructionAsync,SP as getCreateCompressedWalletInstructionDataCodec,Vo as getCreateCompressedWalletInstructionDataDecoder,xn as getCreateCompressedWalletInstructionDataEncoder,PP as getCreateDomainConfigDiscriminatorBytes,_P as getCreateDomainConfigInstruction,$o as getCreateDomainConfigInstructionAsync,bP as getCreateDomainConfigInstructionDataCodec,Zo as getCreateDomainConfigInstructionDataDecoder,En as getCreateDomainConfigInstructionDataEncoder,wP as getCreateDomainUserAccountDiscriminatorBytes,HP as getCreateDomainUserAccountInstruction,nc as getCreateDomainUserAccountInstructionAsync,kP as getCreateDomainUserAccountInstructionDataCodec,rc as getCreateDomainUserAccountInstructionDataDecoder,Cn as getCreateDomainUserAccountInstructionDataEncoder,JP as getCreateGlobalCounterDiscriminatorBytes,YP as getCreateGlobalCounterInstruction,ac as getCreateGlobalCounterInstructionAsync,qP as getCreateGlobalCounterInstructionDataCodec,cc as getCreateGlobalCounterInstructionDataDecoder,Mn as getCreateGlobalCounterInstructionDataEncoder,CD as getCreateUserAccountArgsCodec,Jr as getCreateUserAccountArgsDecoder,jr as getCreateUserAccountArgsEncoder,nb as getCreateUserAccountsDiscriminatorBytes,ob as getCreateUserAccountsInstruction,Ac as getCreateUserAccountsInstructionAsync,sb as getCreateUserAccountsInstructionDataCodec,uc as getCreateUserAccountsInstructionDataDecoder,hn as getCreateUserAccountsInstructionDataEncoder,yb as getDecompressSettingsAccountDiscriminatorBytes,lc as getDecompressSettingsAccountInstruction,pb as getDecompressSettingsAccountInstructionDataCodec,mc as getDecompressSettingsAccountInstructionDataDecoder,Tc as getDecompressSettingsAccountInstructionDataEncoder,Ib as getDisableDomainConfigDiscriminatorBytes,Cc as getDisableDomainConfigInstruction,Eb as getDisableDomainConfigInstructionDataCodec,Ec as getDisableDomainConfigInstructionDataDecoder,Ic as getDisableDomainConfigInstructionDataEncoder,Ye as getDomainConfigAddress,UC as getDomainConfigCodec,rs as getDomainConfigDecoder,vC as getDomainConfigDiscriminatorBytes,mu as getDomainConfigEncoder,WC as getDomainConfigSize,_b as getEditDomainConfigDiscriminatorBytes,bc as getEditDomainConfigInstruction,Ub as getEditDomainConfigInstructionAsync,vb as getEditDomainConfigInstructionDataCodec,Pc as getEditDomainConfigInstructionDataDecoder,bn as getEditDomainConfigInstructionDataEncoder,hD as getEditMemberArgsCodec,Fr as getEditMemberArgsDecoder,Gr as getEditMemberArgsEncoder,Hb as getEditTransactionManagerUrlDiscriminatorBytes,Oc as getEditTransactionManagerUrlInstruction,Vb as getEditTransactionManagerUrlInstructionDataCodec,Wc as getEditTransactionManagerUrlInstructionDataDecoder,Lc as getEditTransactionManagerUrlInstructionDataEncoder,Yb as getEditUserDelegateDiscriminatorBytes,Vc as getEditUserDelegateInstruction,Xb as getEditUserDelegateInstructionDataCodec,Hc as getEditUserDelegateInstructionDataDecoder,kc as getEditUserDelegateInstructionDataEncoder,vD as getExpectedSignerCodec,pt as getExpectedSignerDecoder,yt as getExpectedSignerEncoder,vd as getGlobalCounterAddress,wC as getGlobalCounterCodec,is as getGlobalCounterDecoder,NC as getGlobalCounterDiscriminatorBytes,Uu as getGlobalCounterEncoder,VC as getGlobalCounterSize,kn as getJitoTipsConfig,uB as getLightCpiSigner,he as getLightProtocolRpc,OD as getLinkWalletArgsCodec,Yr as getLinkWalletArgsDecoder,qr as getLinkWalletArgsEncoder,kD as getMemberCodec,gt as getMemberDecoder,At as getMemberEncoder,GD as getMemberKeyCodec,q as getMemberKeyDecoder,B as getMemberKeyEncoder,kL as getMultiWalletErrorMessage,p_ as getNativeTransferIntentCompressedDiscriminatorBytes,Zc as getNativeTransferIntentCompressedInstruction,T_ as getNativeTransferIntentCompressedInstructionDataCodec,Xc as getNativeTransferIntentCompressedInstructionDataDecoder,Yc as getNativeTransferIntentCompressedInstructionDataEncoder,s_ as getNativeTransferIntentDiscriminatorBytes,Kc as getNativeTransferIntentInstruction,c_ as getNativeTransferIntentInstructionAsync,o_ as getNativeTransferIntentInstructionDataCodec,zc as getNativeTransferIntentInstructionDataDecoder,_n as getNativeTransferIntentInstructionDataEncoder,jD as getNewAuthorityArgsCodec,Qr as getNewAuthorityArgsDecoder,$r as getNewAuthorityArgsEncoder,eO as getOriginIndex,YD as getPackedAddressTreeInfoCodec,ft as getPackedAddressTreeInfoDecoder,lt as getPackedAddressTreeInfoEncoder,$D as getPackedStateTreeInfoCodec,at as getPackedStateTreeInfoDecoder,ct as getPackedStateTreeInfoEncoder,tM as getPermissionsCodec,ve as getPermissionsDecoder,_e as getPermissionsEncoder,oM as getProofArgsCodec,R as getProofArgsDecoder,M as getProofArgsEncoder,dM as getRemoveMemberArgsCodec,Kr as getRemoveMemberArgsDecoder,zr as getRemoveMemberArgsEncoder,Vn as getSecp256r1MessageHash,gM as getSecp256r1PubkeyCodec,St as getSecp256r1PubkeyDecoder,en as getSecp256r1PubkeyEncoder,pC as getSecp256r1SignatureOffsetsDataDecoder,yC as getSecp256r1SignatureOffsetsDataEncoder,TM as getSecp256r1VerifyArgsCodec,w as getSecp256r1VerifyArgsDecoder,N as getSecp256r1VerifyArgsEncoder,SM as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,rn as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,tn as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,O as getSecp256r1VerifyInstruction,kN as getSecp256r1VerifyInstructionDataCodec,Gd as getSecp256r1VerifyInstructionDataDecoder,Fd as getSecp256r1VerifyInstructionDataEncoder,$i as getSendAndConfirmTransaction,ph as getSettingsCodec,nr as getSettingsDecoder,yh as getSettingsDiscriminatorBytes,rp as getSettingsEncoder,me as getSettingsFromIndex,MM as getSettingsIndexWithAddressAndDelegateInfoCodec,cn as getSettingsIndexWithAddressAndDelegateInfoDecoder,on as getSettingsIndexWithAddressAndDelegateInfoEncoder,EM as getSettingsIndexWithAddressCodec,sn as getSettingsIndexWithAddressDecoder,nn as getSettingsIndexWithAddressEncoder,bM as getSettingsMutArgsCodec,H as getSettingsMutArgsDecoder,k as getSettingsMutArgsEncoder,LM as getSettingsReadonlyArgsCodec,It as getSettingsReadonlyArgsDecoder,xt as getSettingsReadonlyArgsEncoder,qW as getSignedSecp256r1Key,FB as getSignedTransactionManager,z as getSolanaRpc,Zi as getSolanaRpcEndpoint,L_ as getTokenTransferIntentCompressedDiscriminatorBytes,O_ as getTokenTransferIntentCompressedInstruction,aa as getTokenTransferIntentCompressedInstructionAsync,W_ as getTokenTransferIntentCompressedInstructionDataCodec,ca as getTokenTransferIntentCompressedInstructionDataDecoder,Ln as getTokenTransferIntentCompressedInstructionDataEncoder,C_ as getTokenTransferIntentDiscriminatorBytes,M_ as getTokenTransferIntentInstruction,ta as getTokenTransferIntentInstructionAsync,D_ as getTokenTransferIntentInstructionDataCodec,ea as getTokenTransferIntentInstructionDataDecoder,Un as getTokenTransferIntentInstructionDataEncoder,Ud as getTransactionBufferAddress,$_ as getTransactionBufferCloseCompressedDiscriminatorBytes,Sa as getTransactionBufferCloseCompressedInstruction,Q_ as getTransactionBufferCloseCompressedInstructionDataCodec,fa as getTransactionBufferCloseCompressedInstructionDataDecoder,la as getTransactionBufferCloseCompressedInstructionDataEncoder,F_ as getTransactionBufferCloseDiscriminatorBytes,ya as getTransactionBufferCloseInstruction,z_ as getTransactionBufferCloseInstructionDataCodec,ga as getTransactionBufferCloseInstructionDataDecoder,Aa as getTransactionBufferCloseInstructionDataEncoder,Ih as getTransactionBufferCodec,NM as getTransactionBufferCreateArgsCodec,Ct as getTransactionBufferCreateArgsDecoder,Et as getTransactionBufferCreateArgsEncoder,mv as getTransactionBufferCreateCompressedDiscriminatorBytes,va as getTransactionBufferCreateCompressedInstruction,lv as getTransactionBufferCreateCompressedInstructionDataCodec,_a as getTransactionBufferCreateCompressedInstructionDataDecoder,ba as getTransactionBufferCreateCompressedInstructionDataEncoder,av as getTransactionBufferCreateDiscriminatorBytes,Ma as getTransactionBufferCreateInstruction,iv as getTransactionBufferCreateInstructionDataCodec,Da as getTransactionBufferCreateInstructionDataDecoder,Ca as getTransactionBufferCreateInstructionDataEncoder,ao as getTransactionBufferDecoder,xh as getTransactionBufferDiscriminatorBytes,Ip as getTransactionBufferEncoder,Wv as getTransactionBufferExecuteCompressedDiscriminatorBytes,Fa as getTransactionBufferExecuteCompressedInstruction,Ov as getTransactionBufferExecuteCompressedInstructionDataCodec,Ga as getTransactionBufferExecuteCompressedInstructionDataDecoder,Va as getTransactionBufferExecuteCompressedInstructionDataEncoder,Mv as getTransactionBufferExecuteDiscriminatorBytes,Na as getTransactionBufferExecuteInstruction,Rv as getTransactionBufferExecuteInstructionDataCodec,Ba as getTransactionBufferExecuteInstructionDataDecoder,Oa as getTransactionBufferExecuteInstructionDataEncoder,Xv as getTransactionBufferExtendCompressedDiscriminatorBytes,ti as getTransactionBufferExtendCompressedInstruction,Zv as getTransactionBufferExtendCompressedInstructionDataCodec,ei as getTransactionBufferExtendCompressedInstructionDataDecoder,Qa as getTransactionBufferExtendCompressedInstructionDataEncoder,Gv as getTransactionBufferExtendDiscriminatorBytes,Ya as getTransactionBufferExtendInstruction,Fv as getTransactionBufferExtendInstructionDataCodec,qa as getTransactionBufferExtendInstructionDataDecoder,Ja as getTransactionBufferExtendInstructionDataEncoder,pU as getTransactionBufferVoteCompressedDiscriminatorBytes,yi as getTransactionBufferVoteCompressedInstruction,TU as getTransactionBufferVoteCompressedInstructionDataCodec,gi as getTransactionBufferVoteCompressedInstructionDataDecoder,Ai as getTransactionBufferVoteCompressedInstructionDataEncoder,oU as getTransactionBufferVoteDiscriminatorBytes,ai as getTransactionBufferVoteInstruction,cU as getTransactionBufferVoteInstructionDataCodec,ci as getTransactionBufferVoteInstructionDataDecoder,oi as getTransactionBufferVoteInstructionDataEncoder,_U as getTransactionExecuteCompressedDiscriminatorBytes,Mi as getTransactionExecuteCompressedInstruction,vU as getTransactionExecuteCompressedInstructionDataCodec,Di as getTransactionExecuteCompressedInstructionDataDecoder,Ci as getTransactionExecuteCompressedInstructionDataEncoder,EU as getTransactionExecuteDiscriminatorBytes,Si as getTransactionExecuteInstruction,CU as getTransactionExecuteInstructionDataCodec,fi as getTransactionExecuteInstructionDataDecoder,li as getTransactionExecuteInstructionDataEncoder,qU as getTransactionExecuteSyncCompressedDiscriminatorBytes,Ni as getTransactionExecuteSyncCompressedInstruction,YU as getTransactionExecuteSyncCompressedInstructionDataCodec,Bi as getTransactionExecuteSyncCompressedInstructionDataDecoder,Oi as getTransactionExecuteSyncCompressedInstructionDataEncoder,kU as getTransactionExecuteSyncDiscriminatorBytes,vi as getTransactionExecuteSyncInstruction,HU as getTransactionExecuteSyncInstructionDataCodec,_i as getTransactionExecuteSyncInstructionDataDecoder,bi as getTransactionExecuteSyncInstructionDataEncoder,zM as getTransactionMessageAddressTableLookupCodec,dn as getTransactionMessageAddressTableLookupDecoder,an as getTransactionMessageAddressTableLookupEncoder,VM as getTransactionMessageCodec,Mt as getTransactionMessageDecoder,Dt as getTransactionMessageEncoder,qM as getTransactionSyncSignersCodec,F as getTransactionSyncSignersDecoder,G as getTransactionSyncSignersEncoder,QM as getTransportsCodec,ht as getTransportsDecoder,Rt as getTransportsEncoder,W as getUserAccountAddress,nR as getUserCodec,aR as getUserCreationArgsCodec,Se as getUserCreationArgsDecoder,fe as getUserCreationArgsEncoder,K as getUserDecoder,Pt as getUserEncoder,AR as getUserMutArgsCodec,ke as getUserMutArgsDecoder,we as getUserMutArgsEncoder,TR as getUserReadOnlyArgsCodec,mt as getUserReadOnlyArgsDecoder,Tt as getUserReadOnlyArgsEncoder,SR as getUserReadOnlyOrMutateArgsCodec,Le as getUserReadOnlyOrMutateArgsDecoder,Ue as getUserReadOnlyOrMutateArgsEncoder,DR as getUserRoleCodec,Ne as getUserRoleDecoder,Be as getUserRoleEncoder,dB as getWalletAddressFromIndex,Ee as getWalletAddressFromSettings,Rh as getWhitelistedAddressTreeCodec,po as getWhitelistedAddressTreeDecoder,Mh as getWhitelistedAddressTreeDiscriminatorBytes,Vp as getWhitelistedAddressTreeEncoder,Jn as getWhitelistedAddressTreeFromIndex,$O as getWhitelistedAddressTreeIndexFromAddress,Rd as getWhitelistedAddressTreesAddress,UL as identifyMultiWalletAccount,LL as identifyMultiWalletInstruction,vW as initialize,SD as isConfigAction,HL as isMultiWalletError,XM as isTransactionSyncSigners,IR as isUserReadOnlyOrMutateArgs,Tw as nativeTransferIntent,Jh as parseAddWhitelistedAddressTreesInstruction,AP as parseChangeConfigCompressedInstruction,rP as parseChangeConfigInstruction,IP as parseCreateCompressedWalletInstruction,vP as parseCreateDomainConfigInstruction,VP as parseCreateDomainUserAccountInstruction,XP as parseCreateGlobalCounterInstruction,cb as parseCreateUserAccountsInstruction,Tb as parseDecompressSettingsAccountInstruction,Cb as parseDisableDomainConfigInstruction,Lb as parseEditDomainConfigInstruction,Gb as parseEditTransactionManagerUrlInstruction,Zb as parseEditUserDelegateInstruction,m_ as parseNativeTransferIntentCompressedInstruction,a_ as parseNativeTransferIntentInstruction,HN as parseSecp256r1VerifyInstruction,B_ as parseTokenTransferIntentCompressedInstruction,R_ as parseTokenTransferIntentInstruction,ev as parseTransactionBufferCloseCompressedInstruction,K_ as parseTransactionBufferCloseInstruction,fv as parseTransactionBufferCreateCompressedInstruction,dv as parseTransactionBufferCreateInstruction,Bv as parseTransactionBufferExecuteCompressedInstruction,hv as parseTransactionBufferExecuteInstruction,$v as parseTransactionBufferExtendCompressedInstruction,zv as parseTransactionBufferExtendInstruction,mU as parseTransactionBufferVoteCompressedInstruction,aU as parseTransactionBufferVoteInstruction,UU as parseTransactionExecuteCompressedInstruction,DU as parseTransactionExecuteInstruction,XU as parseTransactionExecuteSyncCompressedInstruction,VU as parseTransactionExecuteSyncInstruction,xB as pollJitoBundleConfirmation,w2 as prepareChangeConfigArgs,j2 as prepareTransactionBundle,o8 as prepareTransactionMessage,u8 as prepareTransactionSync,GB as retrieveTransactionManager,NE as sendJitoBundle,zB as serializeConfigActions,SB as signAndSendBundledTransactions,hB as signAndSendTransaction,hw as tokenTransferIntent,YM as transactionSyncSigners,xR as userReadOnlyOrMutateArgs,Ji as vaultTransactionMessageDeserialize,ji as vaultTransactionMessageSerialize,Xd as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
3
|
+
`);throw new Error(t)}return s.value.unitsConsumed}async function xd(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(o=>o.role===AccountRole.WRITABLE||o.role===AccountRole.WRITABLE_SIGNER).map(o=>o.address)).send()).map(o=>Number(o.prioritizationFee));s.sort((o,i)=>o-i);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function Id(e,n){Bt(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new P(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await Xe(()=>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 vt(r,n);let s=await Ut(r);if(!s.result||s.error)throw new se(`Unable to simulate bundle: ${JSON.stringify(s.error??s.result)}`);if(typeof s.result.value.summary!="string"&&s.result.value.summary.failed){let{TransactionFailure:t}=s.result.value.summary.failed.error,[,o]=t;throw new se(`Simulation failed: ${o}`)}return s.result.value.transactionResults.map(t=>t.unitsConsumed)}function oe(e,n=0){let r=e instanceof b?e:void 0,s=r?.verifyArgs&&n!==-1?some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):none(),t=r?.domainConfig?r.domainConfig:void 0,o=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs.clientDataJson?mr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:o,message:i,publicKey:a}}function Pe(e,n,r=[]){let s=[];for(let t of e)if(t instanceof b){let o=r.length,{domainConfig:i,verifyArgs:a,signature:c,publicKey:d,message:A}=oe(t,o);if(A&&c&&d&&r.push({message:A,signature:c,publicKey:d}),i){let y=n.addPreAccounts([{address:i,role:AccountRole.READONLY}]).get(i)?.index;a.__option==="Some"&&y!==void 0&&s.push({__kind:"Secp256r1",fields:[{domainConfigIndex:y,verifyArgs:a.value}]});}}else {let o=n.addPreAccounts([{address:t.address,role:AccountRole.READONLY_SIGNER,signer:t}]).get(t.address)?.index;o!==void 0&&s.push({__kind:"Ed25519",fields:[o]});}return {secp256r1VerifyInput:r,transactionSyncSigners:s}}function ye(e){if(e instanceof Me)return {keyType:_t.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:_t.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function Td(e){return e instanceof b?e.toString():e.address.toString()}function ae(e){let n=new Set,r=[];for(let t of e)n.has(Td(t))||(r.push(t),n.add(Td(t)));let s=r.filter(t=>t instanceof b);if(s.length>1)throw new P(`More than 1 Secp256r1 signers in an instruction is not supported (found ${s.length})`);return r}function Ed({payer:e,tipAmount:n}){let r=kn[Math.floor(Math.random()*kn.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function Cd(e){return typeof e=="string"?e:e.toString()}function Dd(e){return e.toString()}async function zn(e,n,r){let s=e?.get(n);if(s)return s;let t=await r();return t&&e&&e.set(n,t),t}var G=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(u.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n,r={address:address(n),role:AccountRole.WRITABLE},s=true){let t=s?this.packedMap:this.preMap;if(!t.has(n)){let o=s?this.nextPackedIndex++:this.nextPreIndex++;t.set(n,{index:o,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 he().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let o of n){let i=this.insertOrGet(o.treeInfo.tree.toString()),a=this.insertOrGet(o.treeInfo.queue.toString());s.push({rootIndex:o.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:o.leafIndex,proveByIndex:o.proveByIndex});let c=o.treeInfo.nextTreeInfo??o.treeInfo,d=this.packOutputTreeIndex(c);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let o of r){let i=this.insertOrGet(o.treeInfo.tree.toString()),a=this.insertOrGet(o.treeInfo.queue.toString());t.push({rootIndex:o.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(n){return Array.from(n.entries()).sort((s,t)=>s[1].index-t[1].index).map(([,{accountMeta:s}])=>({...s}))}getOffsets(n){let r=n,s=r+this.systemAccounts.length;return [r,s]}toAccountMetas(){let n=this.hashSetAccountsToMetas(this.preMap),r=this.hashSetAccountsToMetas(this.packedMap),[s,t]=this.getOffsets(n.length);return {remainingAccounts:[...n,...this.systemAccounts,...r],systemOffset:s,packedOffset:t}}};async function Sr(e,n){let r=Cd(e);return zn(n,r,()=>he().getCompressedAccount(e))}async function xr(e,n){let r=Dd(e);return zn(n,r,()=>j().getAccountInfo(e,{encoding:"base64"}).send())}async function Ae(e,n){let r=(await Promise.all(e.map(s=>Sr(s.address,n)))).filter(s=>s!==null).filter(s=>s.data!==null&&s.address!==null);if(r.length!==e.length)throw new Y("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((s,t)=>({...s,type:e[t].type,tree:s.treeInfo.tree,queue:s.treeInfo.queue}))}function U(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function pe(e,n,r,s,t){if(t.length===0)return [];let o=t.map((d,A)=>({treeInfo:n[A],root:r[A],rootIndex:s[A],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],o),a=await e.getOutputTreeIndex();return t.map((d,A)=>({addressTreeInfo:i[A],outputStateTreeIndex:a,address:d.address,type:d.type}))}function te(e,n,r,s,t,o,i){let a=[];for(let A=0;A<n.length;A++)a.push({treeInfo:n[A],rootIndex:s[A],leafIndex:r[A],proveByIndex:t[A],hash:o[A].hash});let c=e.packTreeInfos(a,[]).stateTrees;if(!c)throw new P("Unable to parse state tree data");return o.map((A,y)=>({data:i.decode(A.data.data),accountMeta:{treeInfo:c.packedTreeInfos[y],address:new Uint8Array(A.address),outputStateTreeIndex:c.outputTreeIndex}}))}async function ie(e,n,r,s,t){let o=null,i=null,a=null,c=new G;if(e){await c.addSystemAccounts();let{address:d}=await ce(n,r),A=(await Ae([{address:d,type:"Settings"}],t))[0];s?a={rootIndices:[0],roots:[],leafIndices:[A.leafIndex],leaves:[],treeInfos:[A.treeInfo],proveByIndices:[A.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 $([A],[]);let y=c.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:A.hash}],[]).stateTrees;if(!y)throw new P("Unable to parse state tree data");let p=Z().decode(A.data?.data);o={accountMeta:{address:new Uint8Array(A.address),treeInfo:y.packedTreeInfos[0]},data:p},i={accountMeta:{address:new Uint8Array(A.address),treeInfo:y.packedTreeInfos[0],outputStateTreeIndex:y.outputTreeIndex},data:p};}return {settingsReadonlyArgs:o,proof:a,packedAccounts:c,settingsMutArgs:i}}async function $(e,n){return Ot(()=>he().getValidityProofV0(e,n))}async function Te(){return (await Ir()).length-1}var Kn;async function Ir(){if(!Kn){let{data:e}=await mo(j(),await hd());Kn=e.whitelistedAddressTrees;}return Kn}async function kt(e,n,r){let s=await UE(e,n,r);if(!s)throw new Y("User account");return s}async function UE(e,n,r){let{address:s}=await O(e,n),t=await Sr(s,r);return t?.data?.data?q().decode(t.data.data):null}async function XO(e,{member:n,credentialId:r}){let s=[{memcmp:{offset:1,encoding:"base58",bytes:e}}];if(n)s.push({memcmp:{offset:33,encoding:"base58",bytes:getBase58Decoder().decode(N().encode(ye(n)))}});else if(r)s.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(ue(r))}});else return null;let t=await he().getCompressedAccountsByOwner(new PublicKey(u.toString()),{filters:s});return t.items.filter(o=>!!o.data).length?t.items.map(o=>q().decode(o.data?.data))[0]:null}async function Er(e,n,r){let s=await LE(e,n,r);if(!s)throw new Y("Settings account");return s}async function LE(e,n,r){try{let{address:s}=await ce(e,n),t=await Sr(s,r);if(!t?.data?.data)throw new Y("Compressed settings account");let o=Z().decode(t.data.data);if(o.data.__option==="None")throw new Y("Compressed settings account");return {...o.data.value,isCompressed:!0}}catch{let s=await An(j(),e);return s.exists?{...s.data,isCompressed:false}:null}}async function ZO(e,n,r){let s=await kt(e,n,r);if(s.role===1||s.role===0){let t=[],[o,i]=await Promise.all([he().getCompressedAccountsByOwner(new PublicKey(u.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:getBase58Decoder().decode(N().encode(ye(e)))}}]}),j().getProgramAccounts(u,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(N().encode(ye(e)))}}]}).send()]);return o.items.forEach(a=>{if(a.data?.data){let c=Z().decode(a.data.data);c.data.__option==="Some"&&t.push({...c.data.value,isCompressed:true});}}),i.forEach(a=>{let c=nr().decode(getBase64Encoder().encode(a.account.data[0]));t.push({...c,isCompressed:false});}),t}else return await Promise.all(s.wallets.map(async t=>Er(await me(t.index),t.settingsAddressTreeIndex,r)))}async function qn(e){yd(e,"index");let n=await Ir();if(e>=n.length)throw new P(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function $O(e){let r=(await Ir()).findIndex(s=>s.toString()===e);if(r===-1)throw new Y("Address tree",`Address ${e} not found in whitelist`);return r}async function ce(e,n=0){let r=await qn(n),s=deriveAddressSeedV2([getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(u)).toString(),"base58"),addressTree:new PublicKey(r)}}async function O(e,n=0){let r=await qn(n),s=deriveAddressSeedV2([getUtf8Encoder().encode("user"),e instanceof Me?e.toTruncatedBuffer():getAddressEncoder().encode(e)]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(u.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function Ye({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(getUtf8Encoder().encode(n));else throw new P("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function Ud(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function hd(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Ld(e,n,r){gd(r,0,255,"buffer_index");let[s]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof Me?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function Ee(e){let[n]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function me(e){let[n]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function dB(e){let n=await me(e);return await Ee(n)}async function uB(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function SB(e){Bt(e,"bundle");let n=await Fn(e,true),r=await Id(n.map(getBase64EncodedWireTransaction),Zi()),s=await Fn(e.map((o,i)=>({...o,unitsConsumed:r[i]})));return await NE(s.map(getBase64EncodedWireTransaction))}async function NE(e,n=wn(),r){Bt(e,"serializedTransactions");let{blockEngineUrl:s}=n,t=`${s}/bundles`,o=await Xe(()=>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 vt(o,t);let i=await Ut(o);if(i.error)throw new se(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new se("No bundle ID returned from Jito");return i.result}async function xB(e,n=30,r=3e3,s=wn()){pd(e,"bundleId");let{blockEngineUrl:t}=s,o=`${t}/getBundleStatuses`;return Ot(async()=>{let i=await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await vt(i,o);let a=await Ut(i);if(a.error)throw new se(`Error getting bundle status: ${JSON.stringify(a.error,null,2)}`,e);if(!a.result?.value?.length)throw new se("Bundle not yet confirmed",e);let c=a.result.value[0];if(c.confirmation_status==="confirmed"||c.confirmation_status==="finalized"){let d=c.transactions[c.transactions.length-1];if(!d)throw new se("No transactions in confirmed bundle",e);return d}throw new se(`Bundle status: ${c.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:Ad(se,ge)})}async function hB({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await j().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),o=>appendTransactionMessageInstructions(e,o),o=>setTransactionMessageFeePayerSigner(n,o),o=>setTransactionMessageLifetimeUsingBlockhash(s.value,o),o=>r?compressTransactionMessageUsingAddressLookupTables(o,r):o,async o=>{let[i,a]=await Promise.all([Sd(o),xd(j(),o.instructions.flatMap(d=>d.accounts??[]))]),c=Math.ceil((Number(i)??0)*1.1);return prependTransactionMessageInstructions([...c>2e5?[getSetComputeUnitLimitInstruction({units:c})]:[],...a>0?[getSetComputeUnitPriceInstruction({microLamports:a})]:[]],o)},async o=>await signTransactionMessageWithSigners(await o));return await $i()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function GB(e,n){if(n.threshold>1)throw new P("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(c=>Nd(c.pubkey)===e);if(!r)throw new Y("Member",`Signer ${e} not found in settings`);let{permissions:s}=r;if(!s)throw new Y("Permissions","No permissions found for the current member");let t=De.has(s,Ie.InitiateTransaction),o=De.has(s,Ie.VoteTransaction),i=De.has(s,Ie.ExecuteTransaction);if(t&&o&&i)return {};if(!o||!i)throw new yr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[o?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(c=>c.role===0);if(!a)throw new Y("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(Nd(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function FB({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let o=await kt(n,r,t);if(o.transactionManagerUrl.__option==="None")throw new Y("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return eC(n,o.transactionManagerUrl.value,e,s)}function eC(e,n,r,s){return {address:e,async signTransactions(t){let o=await Xe(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:e.toString(),payload:t.map(a=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(a)),transactionMessageBytes:s?getBase64Decoder().decode(s):void 0,authResponses:r}))})}));if(!o.ok)throw new ge(`Transaction manager request failed: ${o.statusText}`,o.status,n);let i=await o.json();if("error"in i)throw new ge(`Transaction manager error: ${i.error}`,o.status,n);return i.signatures.map(a=>({[e]:getBase58Encoder().encode(a)}))}}}function Nd(e){return e.keyType===_t.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function zB(e){let n=e.map(o=>We().encode(o)),r=4+n.reduce((o,i)=>o+i.length,0),s=new Uint8Array(r),t=0;s.set(getU32Encoder().encode(e.length),t),t+=4;for(let o of n)s.set(o,t),t+=o.length;return s}function KB(e){let n=0,[r,s]=getU32Decoder().read(e,n);n=s;let t=new Array(r);for(let o=0;o<r;o++){let i=Oe().read(e,n);t[o]=i[0],n=i[1];}if(n!==e.length)throw new P(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function aN({payer:e,rpId:n,origins:r,authority:s}){let t=await Ye({rpId:n}),o=new G;await o.addSystemAccounts();let i=await Te(),{address:a,addressTree:c}=await O(s.address,i),d=[{address:a,tree:c,queue:c,type:"User"}],A=await $([],d),y=(await pe(o,A.treeInfos,A.roots,A.rootIndices,d))[0],{remainingAccounts:p,systemOffset:f}=o.toAccountMetas(),S=U(A,f);return await $o({origins:r,authorityCreationArgs:y,authority:s,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function fN({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let o=new G;await o.addSystemAccounts();let i=[];r.settings&&(r.transactionManager&&i.push({address:(await O(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}),i.push({address:(await ce(r.settings,r.settingsAddressTreeIndex)).address,type:"Settings"}));let a=i.length?await Ae(i,t):[],c=await Te(),{address:d,addressTree:A}=await O(r.member,c),y=[{address:d,type:"User",tree:A,queue:A}],p=await $(a,y),f=null,S=null,I=a.filter(W=>W.type==="Settings"),x=a.filter(W=>W.type==="User");if(x.length&&(S=te(o,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),x,q())[0]),I.length){let W=x.length,F=W+1;f=te(o,p.treeInfos.slice(W,F),p.leafIndices.slice(W,F),p.rootIndices.slice(W,F),p.proveByIndices.slice(W,F),I,Z())[0];}let _=(await pe(o,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),y))[0],{remainingAccounts:h,systemOffset:v}=o.toAccountMetas(),L=U(p,v);return await nc({payer:n,authority:e,compressedProofArgs:L,member:St().decode(r.member.toBuffer()),credentialId:ue(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:f?some({settingsMutArgs:f,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:_,domainConfig:s,remainingAccounts:h})}async function EN({payer:e}){let n=await Ud();return ac({payer:e,globalCounter:n})}async function RN({admin:e,rpId:n,disable:r}){let s=await Ye({rpId:n});return Cc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}function rC(e,n,r,s){let t=nC(e,n),o=sC(e,n)&&r!==s;return t&&o?AccountRole.WRITABLE_SIGNER:t&&!o?AccountRole.WRITABLE:!t&&o?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function nC(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:o}=e.header,i=s-t,a=r-s-o;return n>=r?false:n<i?true:n>=s?n-s<a:false}function sC(e,n){return n<e.header.numSignerAccounts}async function Cr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=qi(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let o=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),j()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,c]of t.staticAccounts.entries())i.push({address:c,role:rC(t,a,c,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let c=o[a.lookupTableAddress];if(!c)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let A=c[d];if(!A)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:A,role:AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let A=c[d];if(!A)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:A,role:AccountRole.READONLY});}}for(let a of s?.filter(c=>c.address!==e)??[]){let c=i.findIndex(d=>d.address===a.address);c===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[c].role===AccountRole.READONLY||i[c].role===AccountRole.READONLY_SIGNER?i[c]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[c].role===AccountRole.WRITABLE||i[c].role===AccountRole.WRITABLE_SIGNER)&&(i[c]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:o,transactionMessage:t}}var $e=33,Qe=64,Zn=14,AC=2,gC=address("Secp256r1SigVerify1111111111111111111111111");function yC(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function pC(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function Fd(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let s=getU8Decoder().decode(e,n);n+=1;let t=[],o=pC();for(let a=0;a<r;a++)t.push(o.decode(e,n)),n+=Zn;let i=[];for(let a=0;a<r;a++){let c=fixDecoderSize(getBytesDecoder(),$e).decode(e,n);n+=$e;let d=fixDecoderSize(getBytesDecoder(),Qe).decode(e,n);n+=Qe;let A=t[a].messageDataSize,y=fixDecoderSize(getBytesDecoder(),A).decode(e,n);n+=A,i.push({publicKey:c,signature:d,message:y});}return [{numSignatures:r,padding:s,offsets:t,payload:i},n]}})}function zd(){return createEncoder({getSizeFromValue:e=>{let n=Zn*e.offsets.length,r=e.payload.reduce((s,t)=>s+$e+Qe+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=getU8Encoder().write(e.numSignatures,n,r),r=getU8Encoder().write(e.padding,n,r);let s=yC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),$e).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),Qe).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function wN(){return combineCodec(zd(),Fd())}function B(e,n){let r=e.length,s=AC+r*Zn,t=[];for(let c=0;c<r;c++){let{message:d}=e[c],A=s,y=A+$e,p=y+Qe;t.push({publicKeyOffset:A,publicKeyInstructionIndex:65535,signatureOffset:y,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),s+=$e+Qe+d.length;}let o=n?.programAddress??gC,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:o,data:zd().encode(i)}}function HN(e){return {programAddress:e.programAddress,accounts:{},data:Fd().decode(e.data)}}async function Kd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:o=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:c=false}){let d=await Ee(e),{accountMetas:A,addressLookupTableAccounts:y}=await Cr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return o.length>0&&p.push(B(o)),p.push(c?Mi({transactionBuffer:n,payer:s.address,remainingAccounts:A,settingsKey:e}):Si({transactionBuffer:n,payer:s.address,settings:e})),a&&p.push(Ed({payer:s,tipAmount:a})),{instructions:p,addressLookupTableAccounts:y}}async function jd({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,additionalSigners:s,signers:t,payer:o,addressesByLookupTableAddress:i,secp256r1VerifyInput:a=[],compressed:c=false,simulateProof:d=false,cachedAccounts:A}){let y=ae(t),p=await Ee(e),[{accountMetas:f,addressLookupTableAccounts:S,transactionMessage:I},{settingsMutArgs:x,proof:_,packedAccounts:h}]=await Promise.all([Cr({transactionMessageBytes:r,walletAddress:p,additionalSigners:s,addressesByLookupTableAddress:i}),ie(c,e,n,d,A)]);h.addPreAccounts(f);let{secp256r1VerifyInput:v,transactionSyncSigners:L}=Pe(y,h,a),{remainingAccounts:W,systemOffset:F}=h.toAccountMetas(),ne=[];v.length>0&&ne.push(B(v));let je=TC(I,f);if(c){if(!o||!x)throw new P("Payer not found or proof args are missing for executeTransactionSync.");let be=U(_,F);ne.push(Ni({signers:L,transactionMessage:je,settingsMutArgs:x,compressedProofArgs:be,payer:o,remainingAccounts:W}));}else ne.push(vi({signers:L,settings:e,transactionMessage:je,remainingAccounts:W}));return {instructions:ne,addressLookupTableAccounts:S}}function TC(e,n){if(e.version==="legacy")throw new P("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(s=>s.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function Tk({settings:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:o,payer:i,compressed:a=false}){let c=ae(s),d=await Ee(e),[{packedAccounts:A,proof:y,settingsMutArgs:p},{value:f}]=await Promise.all([ie(a,e,n,false,t),xr(d,t)]);if((f?.lamports??0)<BigInt(o))throw new P("Insufficient balance for native transfer.");let{secp256r1VerifyInput:S,transactionSyncSigners:I}=Pe(c,A),{remainingAccounts:x,systemOffset:_}=A.toAccountMetas(),h=[];if(S.length>0&&h.push(B(S)),a){if(!i||!p)throw new Error("Payer not found or proof args is missing.");let v=U(y,_);h.push(Zc({amount:o,settingsMutArgs:p,compressedProofArgs:v,payer:i,signers:I,source:d,destination:r,remainingAccounts:x}));}else h.push(Kc({amount:o,signers:I,source:d,destination:r,settings:e,remainingAccounts:x}));return h}async function hk({settings:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:o,amount:i,payer:a,tokenProgram:c,compressed:d=false}){let A=ae(t),y=await Ee(e),p=await getAssociatedTokenAccountAddress(s,y,c),[{packedAccounts:f,proof:S,settingsMutArgs:I},{value:x}]=await Promise.all([ie(d,e,n,false,o),xr(p,o)]);if((x?getTokenDecoder().decode(getBase64Encoder().encode(x.data[0])).amount:0)<i)throw new P("Insufficient balance for token transfer.");let{secp256r1VerifyInput:h,transactionSyncSigners:v}=Pe(A,f),{remainingAccounts:L,systemOffset:W}=f.toAccountMetas(),F=[];if(h.length>0&&F.push(B(h)),d){if(!a||!I)throw new Error("Payer not found or proof args is missing.");let ne=U(S,W);F.push(await aa({amount:i,settingsMutArgs:I,compressedProofArgs:ne,payer:a,signers:v,source:y,destination:r,remainingAccounts:L,sourceSplTokenAccount:p,tokenProgram:c,mint:s}));}else F.push(await ta({amount:i,signers:v,source:y,destination:r,settings:e,remainingAccounts:L,sourceSplTokenAccount:p,tokenProgram:c,mint:s}));return F}async function wk({signers:e,payer:n,changeConfigArgs:r}){let{settings:s,configActions:t,compressed:o,packedAccounts:i,proof:a,settingsMutArgs:c}=r,d=ae(e),A=[],y=[];for(let x of d)if(x instanceof b){let _=y.length,{domainConfig:h,verifyArgs:v,signature:L,publicKey:W,message:F}=oe(x,_);if(F&&L&&W&&y.push({message:F,signature:L,publicKey:W}),h){let ne=i.addPreAccounts([{address:h,role:AccountRole.READONLY}]).get(h)?.index;v.__option==="Some"&&ne!==void 0&&A.push({__kind:"Secp256r1",fields:[{domainConfigIndex:ne,verifyArgs:v.value}]});}}else {let _=i.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]).get(x.address)?.index;_!==void 0&&A.push({__kind:"Ed25519",fields:[_]});}let{remainingAccounts:p,systemOffset:f}=i.toAccountMetas(),S=U(a,f),I=[];if(y.length>0&&I.push(B(y)),o){if(!c)throw new P("Proof args are missing for compressed changeConfig.");I.push(No({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:c,remainingAccounts:p,signers:A}));}else I.push(bo({settings:s,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:p,signers:A}));return I}async function jk({createUserArgs:e,payer:n}){let r=new G;await r.addSystemAccounts(),r.addPreAccounts(e.map(A=>({address:A.member.address,role:AccountRole.READONLY_SIGNER,signer:A.member})));let s=await Te(),t=await Promise.all(e.map(async A=>{let{address:y,addressTree:p}=await O(A.member.address,s);return {address:y,tree:p,queue:p,type:"User"}})),o=await $([],t),i=await pe(r,o.treeInfos,o.roots,o.rootIndices,t),{remainingAccounts:a,systemOffset:c}=r.toAccountMetas(),d=U(o,c);return await Ac({compressedProofArgs:d,payer:n,createUserArgs:e.map((A,y)=>({member:A.member.address,role:A.role,userCreationArgs:i[y],transactionManagerUrl:A.role===0?A.transactionManagerUrl:null})),remainingAccounts:a})}async function Qk({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let o=new G;await o.addSystemAccounts();let i=[],a=[];a.push(...await Ae([{address:(await O(r.address,s)).address,type:"User"}],t));let c=await Te(),{address:d,addressTree:A}=await ce(await me(e),c);i.push({address:d,queue:A,tree:A,type:"Settings"});let y=a.length,p=await $(a,i),f=te(o,p.treeInfos.slice(0,y),p.leafIndices.slice(0,y),p.rootIndices.slice(0,y),p.proveByIndices.slice(0,y),a.filter(v=>v.type==="User"),q())[0],I=(await pe(o,p.treeInfos.slice(y),p.roots.slice(y),p.rootIndices.slice(y),i)).find(v=>v.type==="Settings")??null,{remainingAccounts:x,systemOffset:_}=o.toAccountMetas(),h=U(p,_);if(!I)throw new Error("Settings creation args is missing.");return await Go({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:h,...I,remainingAccounts:x})}async function dw({settings:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:o,proof:i,settingsMutArgs:a}=await ie(true,e,n,false,t);if(!a)throw new P("Proof args are missing for settings account.");let c=ae(s),{secp256r1VerifyInput:d,transactionSyncSigners:A}=Pe(c,o),{remainingAccounts:y,systemOffset:p}=o.toAccountMetas(),f=U(i,p),S=[];return d.length>0&&S.push(B(d)),S.push(lc({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:f,signers:A,remainingAccounts:y})),S}async function mw({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,o=[];if(r){let i=new G;await i.addSystemAccounts();let a=await Te(),{address:c,addressTree:d}=await O(r.address,a),A=[{address:c,tree:d,queue:d,type:"User"}],y=await $([],A),p=(await pe(i,y.treeInfos,y.roots,y.rootIndices,A))[0],f=i.toAccountMetas();o=f.remainingAccounts,t={compressedProofArgs:U(y,f.systemOffset),authorityCreationArgs:p};}return bc({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:o})}async function Ew({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new G;await s.addSystemAccounts();let t=await Ae([{address:(await O(e.address,n)).address,type:"User"}]),o=await $(t,[]),i=te(s,o.treeInfos,o.leafIndices,o.rootIndices,o.proveByIndices,t,q())[0],{remainingAccounts:a,systemOffset:c}=s.toAccountMetas(),d=U(o,c);return Oc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function Uw({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:o,verifyArgs:i,message:a,signature:c,publicKey:d}=oe(n),A=[];a&&c&&d&&A.push({message:a,signature:c,publicKey:d});let y=await kt(n instanceof b?n:n.address,r,t),p=[];p.push({address:(await O(n instanceof b?n:n.address,r)).address,type:"User"});let f,S=null,I,x=null,_=y.wallets.find(le=>le.isDelegate);if(_){let le=await me(_.index);(await Er(le,_.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ce(le,_.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):f=await me(_.index);}if(s){let le=await me(s.index);(await Er(le,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ce(le,s.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):I=await me(s.index);}let h=new G;await h.addSystemAccounts();let v=await Ae(p,t),L=await $(v,[]),W=te(h,L.treeInfos.slice(0,1),L.leafIndices.slice(0,1),L.rootIndices.slice(0,1),L.proveByIndices.slice(0,1),v.slice(0,1),q())[0],F=S?some(te(h,L.treeInfos.slice(S.start,S.end),L.leafIndices.slice(S.start,S.end),L.rootIndices.slice(S.start,S.end),L.proveByIndices.slice(S.start,S.end),v.slice(S.start,S.end),Z())[0]):none(),ne=x?some(te(h,L.treeInfos.slice(x.start,x.end),L.leafIndices.slice(x.start,x.end),L.rootIndices.slice(x.start,x.end),L.proveByIndices.slice(x.start,x.end),v.slice(x.start,x.end),Z())[0]):none(),{remainingAccounts:je,systemOffset:be}=h.toAccountMetas(),hr=U(L,be),et=[];return A.length>0&&et.push(B(A)),et.push(Vc({secp256r1VerifyArgs:i,domainConfig:o,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof b?void 0:n,oldSettings:f,oldSettingsMutArgs:F,newSettings:I,newSettingsMutArgs:ne,compressedProofArgs:hr,userMutArgs:W,remainingAccounts:je})),et}async function Yw({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:s,compressed:t=false,cachedAccounts:o}){let i=await uo(j(),r),a=i.data.multiWalletSettings,{packedAccounts:c,proof:d,settingsMutArgs:A}=await ie(t,a,e,false,o),{remainingAccounts:y,systemOffset:p}=c.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:I,signature:x,publicKey:_}=oe(n),h=[];if(I&&x&&_&&h.push(B([{message:I,signature:x,publicKey:_}])),t){if(!s||!A)throw new P("Payer not found or proof args are missing for closing buffer.");let v=U(d,p);h.push(Sa({transactionBuffer:r,domainConfig:f,closer:n instanceof b?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:A,payer:s,compressedProofArgs:v,remainingAccounts:y}));}else h.push(ya({transactionBuffer:r,domainConfig:f,closer:n instanceof b?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return h}function Jd({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:o,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:c,compressedArgs:d,expectedSigners:A}){let{domainConfig:y,verifyArgs:p,message:f,signature:S,publicKey:I}=oe(n),x=[];if(f&&S&&I&&x.push(B([{message:f,signature:S,publicKey:I}])),d){let{settingsReadonlyArgs:_,compressedProofArgs:h,remainingAccounts:v}=d;x.push(va({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof b?void 0:n,domainConfig:y,args:{bufferIndex:r,finalBufferHash:o,finalBufferSize:i,bufferExtendHashes:c,preauthorizeExecution:a,expectedSigners:A},settingsReadonlyArgs:_,compressedProofArgs:h,remainingAccounts:v}));}else x.push(Ma({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof b?void 0:n,domainConfig:y,args:{bufferIndex:r,finalBufferHash:o,finalBufferSize:i,bufferExtendHashes:c,preauthorizeExecution:a,expectedSigners:A},remainingAccounts:[]}));return x}function Yd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:o,signature:i,message:a,publicKey:c}=oe(e),d=[];return a&&i&&c&&d.push(B([{message:a,signature:i,publicKey:c}])),s?d.push(Fa({transactionBuffer:n,secp256r1VerifyArgs:o,domainConfig:t,executor:e instanceof b?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Na({settings:r,transactionBuffer:n,secp256r1VerifyArgs:o,domainConfig:t,executor:e instanceof b?void 0:e,remainingAccounts:[]})),d}function Xd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?ti({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Ya({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Zd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:o,signature:i,publicKey:a,message:c}=oe(n),d=[];return c&&i&&a&&d.push(B([{message:c,signature:i,publicKey:a}])),s?d.push(yi({transactionBuffer:r,secp256r1VerifyArgs:o,domainConfig:t,voter:n instanceof b?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(ai({settings:e,transactionBuffer:r,secp256r1VerifyArgs:o,domainConfig:t,voter:n instanceof b?void 0:n,remainingAccounts:[]})),d}async function k2({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let o=await EC(r),i=new G,a=null,c=null,d=[];if(o.length||t){let y=await CC({packedAccounts:i,userAccounts:o,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:s});a=y.proof,c=y.settingsMutArgs??null,d=y.userMutArgs??[];}return {configActions:await DC({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:c,packedAccounts:i,compressed:t}}async function EC(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>O(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let s=await Promise.all(r.members.map(t=>O(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function CC({packedAccounts:e,userAccounts:n,compressed:r,settings:s,settingsAddressTreeIndex:t,cachedAccounts:o}){await e.addSystemAccounts();let i=[];if(r){let f=(await ce(s,t)).address;i.push({address:f,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await Ae(i,o):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let c=await $(a,[]),d=[],A=[];for(let f of a)f.type==="Settings"?d.push(f):f.type==="User"&&A.push(f);let y,p=[];if(r&&c&&(y=te(e,c.treeInfos.slice(0,1),c.leafIndices.slice(0,1),c.rootIndices.slice(0,1),c.proveByIndices.slice(0,1),d,Z())[0]),A.length&&c){let f=r?1:0;p=te(e,c.treeInfos.slice(f),c.leafIndices.slice(f),c.rootIndices.slice(f),c.proveByIndices.slice(f),A,q());}return {proof:c,settingsMutArgs:y,userMutArgs:p}}async function DC({configActionsArgs:e,userMutArgs:n}){let r=[];for(let s of e)switch(s.type){case "AddMembers":{let t=[];for(let o of s.members){let i=await O(o.member,o.userAddressTreeIndex).then(a=>n.find(c=>equalBytes(c.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(a.address)))));if(!i)throw new Error("Unable to find user account");t.push(hC({permissionArgs:o.permissions,userMutArgs:i,pubkey:o.member}));}r.push({__kind:s.type,fields:[t]});break}case "RemoveMembers":{let t=await Promise.all(s.members.map(o=>O(o.member,o.userAddressTreeIndex).then(i=>{let a=n.find(c=>equalBytes(c.accountMeta.address,getBase58Encoder().encode(encodeBN254toBase58(i.address))));if(!a)throw new Error("Unable to find user account");return RC({pubkey:o.member,userMutArgs:a})})));r.push({__kind:s.type,fields:[t]});break}case "EditPermissions":{let t=s.members.map(o=>MC({permissionArgs:o.permissions,pubkey:o.member}));r.push({__kind:s.type,fields:[t]});break}default:r.push({__kind:s.type,fields:[s.threshold]});}return r}function MC({pubkey:e,permissionArgs:n}){return {memberKey:ye(e),permissions:tu(n)}}function RC({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:ye(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function hC({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:ye(e),permissions:tu(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function tu(e){let n=[];return e.initiate&&n.push(Ie.InitiateTransaction),e.vote&&n.push(Ie.VoteTransaction),e.execute&&n.push(Ie.ExecuteTransaction),De.fromPermissions(n)}async function j2({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:o,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:c,compressed:d=false,additionalVoters:A=[],additionalSigners:y=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:f}){let S=Math.floor(Math.random()*255),I=await Ld(n,t instanceof b?t:t.address,S),x=[],_=[];for(let Q=0;Q<s.length;Q+=p){let es=s.subarray(Q,Q+p);x.push(es),_.push(sha256(es));}let h=sha256(s),{settingsReadonlyArgs:v,settingsMutArgs:L,proof:W,packedAccounts:F}=await ie(d,n,r,false,f),{remainingAccounts:ne,systemOffset:je}=F.toAccountMetas(),be=W&&v&&L?{settingsReadonlyArgs:v,settingsMutArgs:L,compressedProofArgs:U(W,je),remainingAccounts:ne,payer:e}:null,hr=ae([t,...o?[o]:[],...A]).map(Q=>({memberKey:ye(Q),messageHash:Q instanceof b?Vn(Q.authResponse):null})),et=Jd({finalBufferHash:h,finalBufferSize:s.length,bufferIndex:S,payer:e,transactionBufferAddress:I,settings:n,creator:t,preauthorizeExecution:!o,bufferExtendHashes:_,compressedArgs:be,expectedSigners:hr}),le=x.map(Q=>Xd({transactionMessageBytes:Q,transactionBufferAddress:I,settings:n,compressed:d})),Ht=A.map(Q=>Zd({voter:Q,transactionBufferAddress:I,settings:n,compressedArgs:be})),su=Yd({compressedArgs:be,settings:n,executor:o,transactionBufferAddress:I}),{instructions:l,addressLookupTableAccounts:ou}=await Kd({compressed:d,settings:n,transactionMessageBytes:s,transactionBufferAddress:I,payer:e,additionalSigners:y,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:c}),tt=Q=>({payer:e,instructions:Q,addressesByLookupTableAddress:ou});return [tt(et),...le.map(Q=>tt([Q])),...Ht.length?[tt(Ht.flat())]:[],tt(su),tt(l)]}var Mr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=i=>{let a=s.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},s.set(i,a)),a},o=t(r);o.isSigner=true,o.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let c=t(a.address);c.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,c.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),s=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),o=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:o.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 c=[...r.map(([d])=>d),...s.map(([d])=>d),...t.map(([d])=>d),...o.map(([d])=>d)];return [i,c]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,o]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:o}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[o,i]of this.keyMetaMap.entries())if(r(i)){let a=o,c=n.findIndex(d=>d===a);if(c>=0){if(c>=256)throw new Error("Max lookup table index exceeded");s.push(c),t.push(a),this.keyMetaMap.delete(o);}}return [s,t]}};var Rr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((o,i)=>{s.set(o,i);});let t=o=>{let i=s.get(o);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(o=>({programAddressIndex:t(o.programAddress),accountIndices:o.accounts?.map(i=>t(i.address))??[],data:o.data}))}};function nu({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Mr.compile(r,e),o=new Array,i={writable:[],readonly:[]},a=Object.entries(s??{});for(let p of a){let f=t.extractTableLookup(p);if(f!==void 0){let{addressTableLookup:S,drainedKeys:I}=f;o.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[c,d]=t.getMessageComponents(),y=new Rr(d,i).compileInstructions(r);return {version:0,header:c,instructions:y,lifetimeToken:n,staticAccounts:d,addressTableLookups:o}}function o8({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=nu({instructions:e,payer:n,recentBlockhash:u,addressesByLookupTableAddress:r});return new Uint8Array(ji(s))}async function u8({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,additionalSigners:o,secp256r1VerifyInput:i,addressesByLookupTableAddress:a,cachedAccounts:c,compressed:d=false,simulateProof:A=false}){let{instructions:y,addressLookupTableAccounts:p}=await jd({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,additionalSigners:o,transactionMessageBytes:s,secp256r1VerifyInput:i,compressed:d,addressesByLookupTableAddress:a,simulateProof:A,cachedAccounts:c});return {payer:e,instructions:y,addressesByLookupTableAddress:p}}export{So as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,wI as AdditionalSignersSchema,Gi as AuthenticationContextSchema,Fi as BaseResponseSchema,Wo as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,Ro as CHANGE_CONFIG_DISCRIMINATOR,Ho as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,Xo as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,tc as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,oc as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,dc as CREATE_USER_ACCOUNTS_DISCRIMINATOR,oW as CompleteMessageRequestSchema,aW as CompleteSendTransactionRequestSchema,cW as CompleteTransactionRequestSchema,pc as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,xc as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,ts as DOMAIN_CONFIG_DISCRIMINATOR,hc as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,Uc as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,kc as EDIT_USER_DELEGATE_DISCRIMINATOR,as as GLOBAL_COUNTER_DISCRIMINATOR,_t as KeyType,Ox as MULTI_WALLET_ERROR__ALREADY_DELEGATED,Ax as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,hI as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,tI as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,nI as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,sI as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,MI as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,BI as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,px as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,yx as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,Mx as MULTI_WALLET_ERROR__EMPTY_MEMBERS,uI as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,Ex as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,gx as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,xx as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,zx as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,Kx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,jx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,dI as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,kx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,Bx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,Nx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,_x as MULTI_WALLET_ERROR__INVALID_ACCOUNT,DI as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,aI as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,Cx as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,Ux as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,Fx as MULTI_WALLET_ERROR__INVALID_BUFFER,AI as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,wx as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,bx as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,lx as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,ox as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,ix as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,sx as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,ax as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,eI as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,$x as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,hx as MULTI_WALLET_ERROR__INVALID_THRESHOLD,II as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,Ix as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,Sx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,Px as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,_I as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,vx as MULTI_WALLET_ERROR__INVALID_USER_ROLE,bI as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,xI as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,dx as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,Xx as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,oI as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,pI as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,CI as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,Lx as MULTI_WALLET_ERROR__MISSING_ACCOUNT,gI as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,lI as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,vI as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,SI as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,yI as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,Wx as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,WI as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,LI as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,iI as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,UI as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,fI as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,Zx as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,RI as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,OI as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,Vx as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,Dx as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,mx as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,fx as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,cI as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,mI as MULTI_WALLET_ERROR__PAYER_MISMATCH,Tx as MULTI_WALLET_ERROR__PERMANENT_MEMBER,Yx as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,ux as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,TI as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,cx as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,Qx as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,EI as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,Rx as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,qx as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,Jx as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,rI as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,Gx as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,PI as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,Hx as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,u as MULTI_WALLET_PROGRAM_ADDRESS,tx as MultiWalletAccount,rx as MultiWalletInstruction,Jc as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Fc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Ie as Permission,De as Permissions,eo as SETTINGS_DISCRIMINATOR,Me as Secp256r1Key,b as SignedSecp256r1Key,Hi as StartMessageRequestSchema,Vi as StartTransactionRequestSchema,oa as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Qc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,ma as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,ua as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,Pa as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,Ea as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,co as TRANSACTION_BUFFER_DISCRIMINATOR,Ha as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Wa as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,$a as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,ja as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,ui as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,si as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,Ei as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,mi as TRANSACTION_EXECUTE_DISCRIMINATOR,Wi as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,Pi as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,wi as TransactionActionTypeSchema,HI as TransactionDetailsSchema,sW as TransactionPayloadSchema,kI as TransactionPayloadWithBase64MessageBytesSchema,un as Transports,NI as UserInfoSchema,Ce as UserRole,yo as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,ZL as addWhitelistedAddressTrees,ue as base64URLStringToBuffer,QW as bufferToBase64URLString,wk as changeConfig,Yw as closeTransactionBuffer,fD as configAction,rO as convertBase64StringToJWK,tO as convertJWKToBase64String,Nd as convertMemberKeyToString,qW as convertPubkeyCompressedToCose,jW as convertPubkeyCoseToCompressed,XW as createClientAuthorizationCompleteRequestChallenge,YW as createClientAuthorizationStartRequestChallenge,aN as createDomainConfig,fN as createDomainUserAccounts,EN as createGlobalCounter,ZW as createMessageChallenge,Jd as createTransactionBuffer,$W as createTransactionChallenge,eC as createTransactionManagerSigner,jk as createUserAccounts,Qk as createWallet,ns as decodeDomainConfig,ds as decodeGlobalCounter,to as decodeSettings,io as decodeTransactionBuffer,To as decodeWhitelistedAddressTree,dw as decompressSettingsAccount,KB as deserializeConfigActions,RN as disableDomainConfig,mw as editDomainConfig,Ew as editTransactionManagerUrl,Uw as editUserDelegate,Kd as executeTransaction,Yd as executeTransactionBuffer,jd as executeTransactionSync,Xd as extendTransactionBuffer,LC as fetchAllDomainConfig,HC as fetchAllGlobalCounter,Su as fetchAllMaybeDomainConfig,Ou as fetchAllMaybeGlobalCounter,sp as fetchAllMaybeSettings,Dp as fetchAllMaybeTransactionBuffer,zp as fetchAllMaybeWhitelistedAddressTree,mh as fetchAllSettings,ZO as fetchAllSettingsAccountByMember,Eh as fetchAllTransactionBuffer,hh as fetchAllWhitelistedAddressTree,ss as fetchDomainConfig,wC as fetchGlobalCounter,fu as fetchMaybeDomainConfig,Wu as fetchMaybeGlobalCounter,An as fetchMaybeSettings,LE as fetchMaybeSettingsAccountData,Cp as fetchMaybeTransactionBuffer,UE as fetchMaybeUserAccountData,Fp as fetchMaybeWhitelistedAddressTree,Th as fetchSettings,Er as fetchSettingsAccountData,uo as fetchTransactionBuffer,XO as fetchUserAccountByFilters,kt as fetchUserAccountData,mo as fetchWhitelistedAddressTree,KC as getAddMemberArgsCodec,br as getAddMemberArgsDecoder,Pr as getAddMemberArgsEncoder,zh as getAddWhitelistedAddressTreesDiscriminatorBytes,jh as getAddWhitelistedAddressTreesInstruction,Io as getAddWhitelistedAddressTreesInstructionAsync,Kh as getAddWhitelistedAddressTreesInstructionDataCodec,xo as getAddWhitelistedAddressTreesInstructionDataDecoder,Sn as getAddWhitelistedAddressTreesInstructionDataEncoder,dP as getChangeConfigCompressedDiscriminatorBytes,No as getChangeConfigCompressedInstruction,uP as getChangeConfigCompressedInstructionDataCodec,Bo as getChangeConfigCompressedInstructionDataDecoder,Oo as getChangeConfigCompressedInstructionDataEncoder,eP as getChangeConfigDiscriminatorBytes,bo as getChangeConfigInstruction,tP as getChangeConfigInstructionDataCodec,Po as getChangeConfigInstructionDataDecoder,ho as getChangeConfigInstructionDataEncoder,Hn as getClientAndDeviceHash,JC as getCompiledInstructionCodec,vr as getCompiledInstructionDecoder,_r as getCompiledInstructionEncoder,$C as getCompressedAccountMetaCodec,ot as getCompressedAccountMetaDecoder,st as getCompressedAccountMetaEncoder,rD as getCompressedAccountMetaReadOnlyCodec,dt as getCompressedAccountMetaReadOnlyDecoder,it as getCompressedAccountMetaReadOnlyEncoder,oD as getCompressedProofCodec,Nr as getCompressedProofDecoder,Br as getCompressedProofEncoder,ce as getCompressedSettingsAddress,dD as getCompressedSettingsCodec,yD as getCompressedSettingsDataCodec,wr as getCompressedSettingsDataDecoder,kr as getCompressedSettingsDataEncoder,Z as getCompressedSettingsDecoder,ut as getCompressedSettingsEncoder,lD as getConfigActionCodec,Oe as getConfigActionDecoder,We as getConfigActionEncoder,fP as getCreateCompressedWalletDiscriminatorBytes,xP as getCreateCompressedWalletInstruction,Go as getCreateCompressedWalletInstructionAsync,SP as getCreateCompressedWalletInstructionDataCodec,Vo as getCreateCompressedWalletInstructionDataDecoder,xn as getCreateCompressedWalletInstructionDataEncoder,PP as getCreateDomainConfigDiscriminatorBytes,_P as getCreateDomainConfigInstruction,$o as getCreateDomainConfigInstructionAsync,bP as getCreateDomainConfigInstructionDataCodec,Zo as getCreateDomainConfigInstructionDataDecoder,En as getCreateDomainConfigInstructionDataEncoder,kP as getCreateDomainUserAccountDiscriminatorBytes,HP as getCreateDomainUserAccountInstruction,nc as getCreateDomainUserAccountInstructionAsync,wP as getCreateDomainUserAccountInstructionDataCodec,rc as getCreateDomainUserAccountInstructionDataDecoder,Cn as getCreateDomainUserAccountInstructionDataEncoder,qP as getCreateGlobalCounterDiscriminatorBytes,YP as getCreateGlobalCounterInstruction,ac as getCreateGlobalCounterInstructionAsync,JP as getCreateGlobalCounterInstructionDataCodec,cc as getCreateGlobalCounterInstructionDataDecoder,Mn as getCreateGlobalCounterInstructionDataEncoder,CD as getCreateUserAccountArgsCodec,qr as getCreateUserAccountArgsDecoder,jr as getCreateUserAccountArgsEncoder,nb as getCreateUserAccountsDiscriminatorBytes,ob as getCreateUserAccountsInstruction,Ac as getCreateUserAccountsInstructionAsync,sb as getCreateUserAccountsInstructionDataCodec,uc as getCreateUserAccountsInstructionDataDecoder,hn as getCreateUserAccountsInstructionDataEncoder,yb as getDecompressSettingsAccountDiscriminatorBytes,lc as getDecompressSettingsAccountInstruction,pb as getDecompressSettingsAccountInstructionDataCodec,mc as getDecompressSettingsAccountInstructionDataDecoder,Tc as getDecompressSettingsAccountInstructionDataEncoder,Ib as getDisableDomainConfigDiscriminatorBytes,Cc as getDisableDomainConfigInstruction,Eb as getDisableDomainConfigInstructionDataCodec,Ec as getDisableDomainConfigInstructionDataDecoder,Ic as getDisableDomainConfigInstructionDataEncoder,Ye as getDomainConfigAddress,UC as getDomainConfigCodec,rs as getDomainConfigDecoder,vC as getDomainConfigDiscriminatorBytes,lu as getDomainConfigEncoder,WC as getDomainConfigSize,_b as getEditDomainConfigDiscriminatorBytes,bc as getEditDomainConfigInstruction,Ub as getEditDomainConfigInstructionAsync,vb as getEditDomainConfigInstructionDataCodec,Pc as getEditDomainConfigInstructionDataDecoder,bn as getEditDomainConfigInstructionDataEncoder,hD as getEditMemberArgsCodec,Fr as getEditMemberArgsDecoder,Gr as getEditMemberArgsEncoder,Hb as getEditTransactionManagerUrlDiscriminatorBytes,Oc as getEditTransactionManagerUrlInstruction,Vb as getEditTransactionManagerUrlInstructionDataCodec,Wc as getEditTransactionManagerUrlInstructionDataDecoder,Lc as getEditTransactionManagerUrlInstructionDataEncoder,Yb as getEditUserDelegateDiscriminatorBytes,Vc as getEditUserDelegateInstruction,Xb as getEditUserDelegateInstructionDataCodec,Hc as getEditUserDelegateInstructionDataDecoder,wc as getEditUserDelegateInstructionDataEncoder,vD as getExpectedSignerCodec,pt as getExpectedSignerDecoder,yt as getExpectedSignerEncoder,Ud as getGlobalCounterAddress,kC as getGlobalCounterCodec,is as getGlobalCounterDecoder,NC as getGlobalCounterDiscriminatorBytes,Lu as getGlobalCounterEncoder,VC as getGlobalCounterSize,wn as getJitoTipsConfig,uB as getLightCpiSigner,he as getLightProtocolRpc,OD as getLinkWalletArgsCodec,Yr as getLinkWalletArgsDecoder,Jr as getLinkWalletArgsEncoder,wD as getMemberCodec,gt as getMemberDecoder,At as getMemberEncoder,GD as getMemberKeyCodec,X as getMemberKeyDecoder,N as getMemberKeyEncoder,wL as getMultiWalletErrorMessage,p_ as getNativeTransferIntentCompressedDiscriminatorBytes,Zc as getNativeTransferIntentCompressedInstruction,T_ as getNativeTransferIntentCompressedInstructionDataCodec,Xc as getNativeTransferIntentCompressedInstructionDataDecoder,Yc as getNativeTransferIntentCompressedInstructionDataEncoder,s_ as getNativeTransferIntentDiscriminatorBytes,Kc as getNativeTransferIntentInstruction,c_ as getNativeTransferIntentInstructionAsync,o_ as getNativeTransferIntentInstructionDataCodec,zc as getNativeTransferIntentInstructionDataDecoder,_n as getNativeTransferIntentInstructionDataEncoder,jD as getNewAuthorityArgsCodec,Qr as getNewAuthorityArgsDecoder,$r as getNewAuthorityArgsEncoder,eO as getOriginIndex,YD as getPackedAddressTreeInfoCodec,ft as getPackedAddressTreeInfoDecoder,lt as getPackedAddressTreeInfoEncoder,$D as getPackedStateTreeInfoCodec,at as getPackedStateTreeInfoDecoder,ct as getPackedStateTreeInfoEncoder,tM as getPermissionsCodec,ve as getPermissionsDecoder,_e as getPermissionsEncoder,oM as getProofArgsCodec,R as getProofArgsDecoder,M as getProofArgsEncoder,dM as getRemoveMemberArgsCodec,Kr as getRemoveMemberArgsDecoder,zr as getRemoveMemberArgsEncoder,Vn as getSecp256r1MessageHash,gM as getSecp256r1PubkeyCodec,St as getSecp256r1PubkeyDecoder,en as getSecp256r1PubkeyEncoder,pC as getSecp256r1SignatureOffsetsDataDecoder,yC as getSecp256r1SignatureOffsetsDataEncoder,TM as getSecp256r1VerifyArgsCodec,w as getSecp256r1VerifyArgsDecoder,k as getSecp256r1VerifyArgsEncoder,SM as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,rn as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,tn as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,B as getSecp256r1VerifyInstruction,wN as getSecp256r1VerifyInstructionDataCodec,Fd as getSecp256r1VerifyInstructionDataDecoder,zd as getSecp256r1VerifyInstructionDataEncoder,$i as getSendAndConfirmTransaction,ph as getSettingsCodec,nr as getSettingsDecoder,yh as getSettingsDiscriminatorBytes,np as getSettingsEncoder,me as getSettingsFromIndex,MM as getSettingsIndexWithAddressAndDelegateInfoCodec,cn as getSettingsIndexWithAddressAndDelegateInfoDecoder,on as getSettingsIndexWithAddressAndDelegateInfoEncoder,EM as getSettingsIndexWithAddressCodec,sn as getSettingsIndexWithAddressDecoder,nn as getSettingsIndexWithAddressEncoder,bM as getSettingsMutArgsCodec,V as getSettingsMutArgsDecoder,H as getSettingsMutArgsEncoder,LM as getSettingsReadonlyArgsCodec,It as getSettingsReadonlyArgsDecoder,xt as getSettingsReadonlyArgsEncoder,JW as getSignedSecp256r1Key,FB as getSignedTransactionManager,j as getSolanaRpc,Zi as getSolanaRpcEndpoint,L_ as getTokenTransferIntentCompressedDiscriminatorBytes,O_ as getTokenTransferIntentCompressedInstruction,aa as getTokenTransferIntentCompressedInstructionAsync,W_ as getTokenTransferIntentCompressedInstructionDataCodec,ca as getTokenTransferIntentCompressedInstructionDataDecoder,Ln as getTokenTransferIntentCompressedInstructionDataEncoder,C_ as getTokenTransferIntentDiscriminatorBytes,M_ as getTokenTransferIntentInstruction,ta as getTokenTransferIntentInstructionAsync,D_ as getTokenTransferIntentInstructionDataCodec,ea as getTokenTransferIntentInstructionDataDecoder,Un as getTokenTransferIntentInstructionDataEncoder,Ld as getTransactionBufferAddress,$_ as getTransactionBufferCloseCompressedDiscriminatorBytes,Sa as getTransactionBufferCloseCompressedInstruction,Q_ as getTransactionBufferCloseCompressedInstructionDataCodec,fa as getTransactionBufferCloseCompressedInstructionDataDecoder,la as getTransactionBufferCloseCompressedInstructionDataEncoder,F_ as getTransactionBufferCloseDiscriminatorBytes,ya as getTransactionBufferCloseInstruction,z_ as getTransactionBufferCloseInstructionDataCodec,ga as getTransactionBufferCloseInstructionDataDecoder,Aa as getTransactionBufferCloseInstructionDataEncoder,Ih as getTransactionBufferCodec,NM as getTransactionBufferCreateArgsCodec,Ct as getTransactionBufferCreateArgsDecoder,Et as getTransactionBufferCreateArgsEncoder,mv as getTransactionBufferCreateCompressedDiscriminatorBytes,va as getTransactionBufferCreateCompressedInstruction,lv as getTransactionBufferCreateCompressedInstructionDataCodec,_a as getTransactionBufferCreateCompressedInstructionDataDecoder,ba as getTransactionBufferCreateCompressedInstructionDataEncoder,av as getTransactionBufferCreateDiscriminatorBytes,Ma as getTransactionBufferCreateInstruction,iv as getTransactionBufferCreateInstructionDataCodec,Da as getTransactionBufferCreateInstructionDataDecoder,Ca as getTransactionBufferCreateInstructionDataEncoder,ao as getTransactionBufferDecoder,xh as getTransactionBufferDiscriminatorBytes,Ep as getTransactionBufferEncoder,Wv as getTransactionBufferExecuteCompressedDiscriminatorBytes,Fa as getTransactionBufferExecuteCompressedInstruction,Ov as getTransactionBufferExecuteCompressedInstructionDataCodec,Ga as getTransactionBufferExecuteCompressedInstructionDataDecoder,Va as getTransactionBufferExecuteCompressedInstructionDataEncoder,Mv as getTransactionBufferExecuteDiscriminatorBytes,Na as getTransactionBufferExecuteInstruction,Rv as getTransactionBufferExecuteInstructionDataCodec,Ba as getTransactionBufferExecuteInstructionDataDecoder,Oa as getTransactionBufferExecuteInstructionDataEncoder,Xv as getTransactionBufferExtendCompressedDiscriminatorBytes,ti as getTransactionBufferExtendCompressedInstruction,Zv as getTransactionBufferExtendCompressedInstructionDataCodec,ei as getTransactionBufferExtendCompressedInstructionDataDecoder,Qa as getTransactionBufferExtendCompressedInstructionDataEncoder,Gv as getTransactionBufferExtendDiscriminatorBytes,Ya as getTransactionBufferExtendInstruction,Fv as getTransactionBufferExtendInstructionDataCodec,Ja as getTransactionBufferExtendInstructionDataDecoder,qa as getTransactionBufferExtendInstructionDataEncoder,pU as getTransactionBufferVoteCompressedDiscriminatorBytes,yi as getTransactionBufferVoteCompressedInstruction,TU as getTransactionBufferVoteCompressedInstructionDataCodec,gi as getTransactionBufferVoteCompressedInstructionDataDecoder,Ai as getTransactionBufferVoteCompressedInstructionDataEncoder,oU as getTransactionBufferVoteDiscriminatorBytes,ai as getTransactionBufferVoteInstruction,cU as getTransactionBufferVoteInstructionDataCodec,ci as getTransactionBufferVoteInstructionDataDecoder,oi as getTransactionBufferVoteInstructionDataEncoder,_U as getTransactionExecuteCompressedDiscriminatorBytes,Mi as getTransactionExecuteCompressedInstruction,vU as getTransactionExecuteCompressedInstructionDataCodec,Di as getTransactionExecuteCompressedInstructionDataDecoder,Ci as getTransactionExecuteCompressedInstructionDataEncoder,EU as getTransactionExecuteDiscriminatorBytes,Si as getTransactionExecuteInstruction,CU as getTransactionExecuteInstructionDataCodec,fi as getTransactionExecuteInstructionDataDecoder,li as getTransactionExecuteInstructionDataEncoder,JU as getTransactionExecuteSyncCompressedDiscriminatorBytes,Ni as getTransactionExecuteSyncCompressedInstruction,YU as getTransactionExecuteSyncCompressedInstructionDataCodec,Bi as getTransactionExecuteSyncCompressedInstructionDataDecoder,Oi as getTransactionExecuteSyncCompressedInstructionDataEncoder,wU as getTransactionExecuteSyncDiscriminatorBytes,vi as getTransactionExecuteSyncInstruction,HU as getTransactionExecuteSyncInstructionDataCodec,_i as getTransactionExecuteSyncInstructionDataDecoder,bi as getTransactionExecuteSyncInstructionDataEncoder,zM as getTransactionMessageAddressTableLookupCodec,dn as getTransactionMessageAddressTableLookupDecoder,an as getTransactionMessageAddressTableLookupEncoder,VM as getTransactionMessageCodec,Mt as getTransactionMessageDecoder,Dt as getTransactionMessageEncoder,JM as getTransactionSyncSignersCodec,K as getTransactionSyncSignersDecoder,z as getTransactionSyncSignersEncoder,QM as getTransportsCodec,ht as getTransportsDecoder,Rt as getTransportsEncoder,O as getUserAccountAddress,nR as getUserCodec,aR as getUserCreationArgsCodec,Se as getUserCreationArgsDecoder,fe as getUserCreationArgsEncoder,q as getUserDecoder,Pt as getUserEncoder,AR as getUserMutArgsCodec,we as getUserMutArgsDecoder,ke as getUserMutArgsEncoder,TR as getUserReadOnlyArgsCodec,mt as getUserReadOnlyArgsDecoder,Tt as getUserReadOnlyArgsEncoder,SR as getUserReadOnlyOrMutateArgsCodec,Le as getUserReadOnlyOrMutateArgsDecoder,Ue as getUserReadOnlyOrMutateArgsEncoder,DR as getUserRoleCodec,Ne as getUserRoleDecoder,Be as getUserRoleEncoder,dB as getWalletAddressFromIndex,Ee as getWalletAddressFromSettings,Rh as getWhitelistedAddressTreeCodec,po as getWhitelistedAddressTreeDecoder,Mh as getWhitelistedAddressTreeDiscriminatorBytes,Gp as getWhitelistedAddressTreeEncoder,qn as getWhitelistedAddressTreeFromIndex,$O as getWhitelistedAddressTreeIndexFromAddress,hd as getWhitelistedAddressTreesAddress,UL as identifyMultiWalletAccount,LL as identifyMultiWalletInstruction,vW as initialize,SD as isConfigAction,HL as isMultiWalletError,XM as isTransactionSyncSigners,IR as isUserReadOnlyOrMutateArgs,Tk as nativeTransferIntent,qh as parseAddWhitelistedAddressTreesInstruction,AP as parseChangeConfigCompressedInstruction,rP as parseChangeConfigInstruction,IP as parseCreateCompressedWalletInstruction,vP as parseCreateDomainConfigInstruction,VP as parseCreateDomainUserAccountInstruction,XP as parseCreateGlobalCounterInstruction,cb as parseCreateUserAccountsInstruction,Tb as parseDecompressSettingsAccountInstruction,Cb as parseDisableDomainConfigInstruction,Lb as parseEditDomainConfigInstruction,Gb as parseEditTransactionManagerUrlInstruction,Zb as parseEditUserDelegateInstruction,m_ as parseNativeTransferIntentCompressedInstruction,a_ as parseNativeTransferIntentInstruction,HN as parseSecp256r1VerifyInstruction,B_ as parseTokenTransferIntentCompressedInstruction,R_ as parseTokenTransferIntentInstruction,ev as parseTransactionBufferCloseCompressedInstruction,K_ as parseTransactionBufferCloseInstruction,fv as parseTransactionBufferCreateCompressedInstruction,dv as parseTransactionBufferCreateInstruction,Bv as parseTransactionBufferExecuteCompressedInstruction,hv as parseTransactionBufferExecuteInstruction,$v as parseTransactionBufferExtendCompressedInstruction,zv as parseTransactionBufferExtendInstruction,mU as parseTransactionBufferVoteCompressedInstruction,aU as parseTransactionBufferVoteInstruction,UU as parseTransactionExecuteCompressedInstruction,DU as parseTransactionExecuteInstruction,XU as parseTransactionExecuteSyncCompressedInstruction,VU as parseTransactionExecuteSyncInstruction,xB as pollJitoBundleConfirmation,k2 as prepareChangeConfigArgs,j2 as prepareTransactionBundle,o8 as prepareTransactionMessage,u8 as prepareTransactionSync,GB as retrieveTransactionManager,NE as sendJitoBundle,zB as serializeConfigActions,SB as signAndSendBundledTransactions,hB as signAndSendTransaction,hk as tokenTransferIntent,YM as transactionSyncSigners,xR as userReadOnlyOrMutateArgs,qi as vaultTransactionMessageDeserialize,ji as vaultTransactionMessageSerialize,Zd as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|