@revibase/core 0.0.32 → 0.0.34
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 +150 -102
- package/dist/index.d.ts +150 -102
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,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,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,getBase64Decoder,createDecoder,createEncoder,AccountRole,some,none,upgradeRoleToSigner,getBlockhashDecoder,compileTransaction,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import ud from'bn.js';import {VERSION,featureFlags,createRpc,rpcRequest,versionedEndpoint,encodeBN254toBase58,jsonRpcResultAndContext,CompressedAccountResultV2,CompressedAccountResult,localTestActiveStateTreeInfos,getStateTreeInfoByPubkey,createCompressedAccountWithMerkleContextLegacy,createMerkleContextLegacy,bn,parseAccountData,deriveAddressSeedV2,createBN254,deriveAddressV2,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {SolanaJSONRPCError,PublicKey}from'@solana/web3.js';import {create,nullable}from'superstruct';import {estimateComputeUnitLimitFactory,getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTransferSolInstruction}from'gill/programs';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {p256}from'@noble/curves/nist.js';var On=new Uint8Array([201,232,212,229,59,241,106,197]);function ED(){return fixEncoderSize(getBytesEncoder(),8).encode(On)}function Hd(){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:On}))}function Bn(){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 PD(){return combineCodec(Hd(),Bn())}function wn(e){return decodeAccount(e,Bn())}async function kn(e,n,r){let s=await Gd(e,n,r);return assertAccountExists(s),s}async function Gd(e,n,r){let s=await fetchEncodedAccount(e,n,r);return wn(s)}async function hD(e,n,r){let s=await Fd(e,n,r);return assertAccountsExist(s),s}async function Fd(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>wn(t))}function RD(){return 846}var Hn=new Uint8Array([42,206,176,58,175,129,130,233]);function _D(){return fixEncoderSize(getBytesEncoder(),8).encode(Hn)}function nu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Hn}))}function Gn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function UD(){return combineCodec(nu(),Gn())}function Fn(e){return decodeAccount(e,Gn())}async function WD(e,n,r){let s=await su(e,n,r);return assertAccountExists(s),s}async function su(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Fn(s)}async function LD(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=>Fn(t))}function OD(){return 24}function Ar(){return getStructEncoder([["memberKey",$()],["permissions",he()],["userReadonlyArgs",be()]])}function gr(){return getStructDecoder([["memberKey",ee()],["permissions",Re()],["userReadonlyArgs",ve()]])}function ND(){return combineCodec(Ar(),gr())}function yr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function mr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function GD(){return combineCodec(yr(),mr())}function Xe(){return getStructEncoder([["treeInfo",$e()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function Qe(){return getStructDecoder([["treeInfo",et()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function JD(){return combineCodec(Xe(),Qe())}function tt(){return getStructEncoder([["treeInfo",$e()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function rt(){return getStructDecoder([["treeInfo",et()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function YD(){return combineCodec(tt(),rt())}function Sr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function xr(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function $D(){return combineCodec(Sr(),xr())}function nt(){return getStructEncoder([["data",getOptionEncoder(st())]])}function te(){return getStructDecoder([["data",getOptionDecoder(ot())]])}function nC(){return combineCodec(nt(),te())}function st(){return getStructEncoder([["threshold",getU8Encoder()],["bump",getU8Encoder()],["index",getU128Encoder()],["multiWalletBump",getU8Encoder()],["members",getArrayEncoder(ct())],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function ot(){return getStructDecoder([["threshold",getU8Decoder()],["bump",getU8Decoder()],["index",getU128Decoder()],["multiWalletBump",getU8Decoder()],["members",getArrayDecoder(at())],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function aC(){return combineCodec(st(),ot())}function it(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Cr())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Ar())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Er())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function dt(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Mr())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(gr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Pr())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function AC(){return combineCodec(it(),dt())}function gC(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function yC(e,n){return n.__kind===e}function hr(){return getStructEncoder([["member",getAddressEncoder()],["role",_e()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",ge()]])}function Rr(){return getStructDecoder([["member",getAddressDecoder()],["role",Ue()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",ye()]])}function fC(){return combineCodec(hr(),Rr())}function Cr(){return getStructEncoder([["memberKey",$()],["permissions",he()]])}function Mr(){return getStructDecoder([["memberKey",ee()],["permissions",Re()]])}function IC(){return combineCodec(Cr(),Mr())}function ut(){return getStructEncoder([["memberKey",$()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function At(){return getStructDecoder([["memberKey",ee()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function EC(){return combineCodec(ut(),At())}function br(){return getStructEncoder([["settingsMutArgs",k()],["transactionManager",getOptionEncoder(fe())]])}function vr(){return getStructDecoder([["settingsMutArgs",N()],["transactionManager",getOptionDecoder(le())]])}function bC(){return combineCodec(br(),vr())}function ct(){return getStructEncoder([["pubkey",$()],["permissions",he()],["role",getU8Encoder()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function at(){return getStructDecoder([["pubkey",ee()],["permissions",Re()],["role",getU8Decoder()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function WC(){return combineCodec(ct(),at())}function $(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function ee(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function BC(){return combineCodec($(),ee())}function Wr(){return getStructEncoder([["authorityCreationArgs",ge()],["compressedProofArgs",C()]])}function Lr(){return getStructDecoder([["authorityCreationArgs",ye()],["compressedProofArgs",M()]])}function VC(){return combineCodec(Wr(),Lr())}function gt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function yt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function FC(){return combineCodec(gt(),yt())}function $e(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function et(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function JC(){return combineCodec($e(),et())}function he(){return getStructEncoder([["mask",getU8Encoder()]])}function Re(){return getStructDecoder([["mask",getU8Decoder()]])}function ZC(){return combineCodec(he(),Re())}function C(){return getStructEncoder([["proof",getOptionEncoder(Sr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function M(){return getStructDecoder([["proof",getOptionDecoder(xr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function $C(){return combineCodec(C(),M())}function Er(){return getStructEncoder([["memberKey",$()],["userArgs",Or()]])}function Pr(){return getStructDecoder([["memberKey",ee()],["userArgs",Br()]])}function nM(){return combineCodec(Er(),Pr())}function wr(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function mt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function cM(){return combineCodec(wr(),mt())}function H(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function G(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function dM(){return combineCodec(H(),G())}function F(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",H()]])}function z(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",G()]])}function yM(){return combineCodec(F(),z())}function pt(){return getStructEncoder([["addressTreeInfo",gt()],["outputStateTreeIndex",getU8Encoder()]])}function Tt(){return getStructDecoder([["addressTreeInfo",yt()],["outputStateTreeIndex",getU8Decoder()]])}function fM(){return combineCodec(pt(),Tt())}function ft(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function lt(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function xM(){return combineCodec(ft(),lt())}function k(){return getStructEncoder([["accountMeta",Xe()],["data",nt()]])}function N(){return getStructDecoder([["accountMeta",Qe()],["data",te()]])}function MM(){return combineCodec(k(),N())}function St(){return getStructEncoder([["accountMeta",tt()],["data",nt()]])}function xt(){return getStructDecoder([["accountMeta",rt()],["data",te()]])}function RM(){return combineCodec(St(),xt())}function It(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getOptionEncoder(getArrayEncoder(ut()))]])}function Dt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(At()))]])}function UM(){return combineCodec(It(),Dt())}function Ct(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(yr())],["addressTableLookups",getArrayEncoder(kr())]])}function Mt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(mr())],["addressTableLookups",getArrayDecoder(Nr())]])}function BM(){return combineCodec(Ct(),Mt())}function kr(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Nr(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function NM(){return combineCodec(kr(),Nr())}function We(){return getStructEncoder([["member",$()],["domainConfig",getOptionEncoder(getAddressEncoder())],["role",_e()],["delegatedTo",getOptionEncoder(ft())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function Y(){return getStructDecoder([["member",ee()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",Ue()],["delegatedTo",getOptionDecoder(lt())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function FM(){return combineCodec(We(),Y())}function ge(){return getStructEncoder([["addressTreeInfo",gt()],["outputStateTreeIndex",getU8Encoder()]])}function ye(){return getStructDecoder([["addressTreeInfo",yt()],["outputStateTreeIndex",getU8Decoder()]])}function jM(){return combineCodec(ge(),ye())}function fe(){return getStructEncoder([["accountMeta",Xe()],["data",We()]])}function le(){return getStructDecoder([["accountMeta",Qe()],["data",Y()]])}function XM(){return combineCodec(fe(),le())}function be(){return getStructEncoder([["accountMeta",tt()],["data",We()]])}function ve(){return getStructDecoder([["accountMeta",rt()],["data",Y()]])}function tE(){return combineCodec(be(),ve())}function Or(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([be()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([fe()])]])]])}function Br(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([ve()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([le()])]])]])}function oE(){return combineCodec(Or(),Br())}function cE(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function aE(e,n){return n.__kind===e}var Ve=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(Ve||{});function _e(){return getEnumEncoder(Ve)}function Ue(){return getEnumDecoder(Ve)}function uE(){return combineCodec(_e(),Ue())}var Ds=new Uint8Array([223,179,163,190,177,224,67,173]);function XE(){return fixEncoderSize(getBytesEncoder(),8).encode(Ds)}function yy(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",fixEncoderSize(getBytesEncoder(),16)],["members",getArrayEncoder(ct(),{size:4})],["membersLen",getU8Encoder()],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["padding",fixEncoderSize(getBytesEncoder(),3)],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:Ds}))}function Cs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",fixDecoderSize(getBytesDecoder(),16)],["members",getArrayDecoder(at(),{size:4})],["membersLen",getU8Decoder()],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["padding",fixDecoderSize(getBytesDecoder(),3)],["latestSlotNumber",getU64Decoder()]])}function QE(){return combineCodec(yy(),Cs())}function Ms(e){return decodeAccount(e,Cs())}async function $E(e,n,r){let s=await zr(e,n,r);return assertAccountExists(s),s}async function zr(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Ms(s)}async function eP(e,n,r){let s=await my(e,n,r);return assertAccountsExist(s),s}async function my(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ms(t))}function tP(){return 192}var bs=new Uint8Array([90,36,35,219,93,225,110,96]);function oP(){return fixEncoderSize(getBytesEncoder(),8).encode(bs)}function Ly(){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",$()],["executor",$()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder($())],["expectedSecp256r1Signers",getOptionEncoder(getArrayEncoder(ut()))],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:bs}))}function vs(){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",ee()],["executor",ee()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(ee())],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(At()))],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function cP(){return combineCodec(Ly(),vs())}function _s(e){return decodeAccount(e,vs())}async function Us(e,n,r){let s=await Oy(e,n,r);return assertAccountExists(s),s}async function Oy(e,n,r){let s=await fetchEncodedAccount(e,n,r);return _s(s)}async function aP(e,n,r){let s=await By(e,n,r);return assertAccountsExist(s),s}async function By(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>_s(t))}var Os=new Uint8Array([105,23,173,2,197,255,80,87]);function uP(){return fixEncoderSize(getBytesEncoder(),8).encode(Os)}function em(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Os}))}function Bs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function AP(){return combineCodec(em(),Bs())}function ws(e){return decodeAccount(e,Bs())}async function ks(e,n,r){let s=await tm(e,n,r);return assertAccountExists(s),s}async function tm(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ws(s)}async function gP(e,n,r){let s=await rm(e,n,r);return assertAccountsExist(s),s}async function rm(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ws(t))}function y({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function Vs(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}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:Ns(r.value)?upgradeRoleToSigner(s):s,...Ns(r.value)?{signer:r.value}:{}})}}function Ns(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Gs=new Uint8Array([8]);function bP(){return fixEncoderSize(getBytesEncoder(),1).encode(Gs)}function Qr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Gs}))}function Fs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function vP(){return combineCodec(Qr(),Fs())}async function zs(e,n){let r=n?.programAddress??d,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:Qr().encode(c),programAddress:r})}function _P(e,n){let r=n?.programAddress??d,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:Qr().encode(c),programAddress:r})}function UP(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:Fs().decode(e.data)}}var Ys=new Uint8Array([9]);function NP(){return fixEncoderSize(getBytesEncoder(),1).encode(Ys)}function $r(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(it())],["secp256r1VerifyArgs",getArrayEncoder(F())],["compressedProofArgs",getOptionEncoder(C())]]),e=>({...e,discriminator:Ys}))}function Xs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(dt())],["secp256r1VerifyArgs",getArrayDecoder(z())],["compressedProofArgs",getOptionDecoder(M())]])}function VP(){return combineCodec($r(),Xs())}async function Qs(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.settings.value||(t.settings.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getU128Encoder().encode(Vs(c.settingsIndex))]})),t.authority.value||(t.authority.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"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:$r().encode(c),programAddress:r})}function HP(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:$r().encode(c),programAddress:r})}function GP(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Xs().decode(e.data)}}var no=new Uint8Array([20]);function ZP(){return fixEncoderSize(getBytesEncoder(),1).encode(no)}function so(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(it())],["secp256r1VerifyArgs",getArrayEncoder(F())],["settingsMut",k()],["compressedProofArgs",C()]]),e=>({...e,discriminator:no}))}function oo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(dt())],["secp256r1VerifyArgs",getArrayDecoder(z())],["settingsMut",N()],["compressedProofArgs",M()]])}function YP(){return combineCodec(so(),oo())}function co(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:so().encode(c),programAddress:r})}function XP(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:oo().decode(e.data)}}var uo=new Uint8Array([17]);function sh(){return fixEncoderSize(getBytesEncoder(),1).encode(uo)}function Ao(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["settingsMutArgs",k()],["secp256r1VerifyArgs",getArrayEncoder(F())]]),e=>({...e,discriminator:uo}))}function go(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",N()],["secp256r1VerifyArgs",getArrayDecoder(z())]])}function oh(){return combineCodec(Ao(),go())}function yo(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ao().encode(c),programAddress:r})}function ch(e){if(e.accounts.length<4)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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:go().decode(e.data)}}var Io=new Uint8Array([0]);function yh(){return fixEncoderSize(getBytesEncoder(),1).encode(Io)}function tn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",ge()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Io}))}function Do(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",ye()],["compressedProofArgs",M()]])}function mh(){return combineCodec(tn(),Do())}async function Co(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:tn().encode(c),programAddress:r})}function ph(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:tn().encode(c),programAddress:r})}function Th(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:Do().decode(e.data)}}var Eo=new Uint8Array([4]);function Ch(){return fixEncoderSize(getBytesEncoder(),1).encode(Eo)}function nn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["member",wr()],["role",_e()],["userAccountCreationArgs",ge()],["linkWalletArgs",getOptionEncoder(br())]]),e=>({...e,discriminator:Eo}))}function Po(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["member",mt()],["role",Ue()],["userAccountCreationArgs",ye()],["linkWalletArgs",getOptionDecoder(vr())]])}function Mh(){return combineCodec(nn(),Po())}async function ho(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:nn().encode(c),programAddress:r})}function Eh(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i=y({args:c}),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:nn().encode(c),programAddress:r})}function Ph(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:Po().decode(e.data)}}var bo=new Uint8Array([3]);function Uh(){return fixEncoderSize(getBytesEncoder(),1).encode(bo)}function on(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:bo}))}function vo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function Wh(){return combineCodec(on(),vo())}async function _o(e,n){let r=n?.programAddress??d,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=y(c),i=m(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:on().encode({}),programAddress:r})}function Lh(e,n){let r=n?.programAddress??d,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=y(c),i=m(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:on().encode({}),programAddress:r})}function Oh(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:vo().decode(e.data)}}var Lo=new Uint8Array([19]);function Gh(){return fixEncoderSize(getBytesEncoder(),1).encode(Lo)}function cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["settingsCreation",pt()],["userReadonlyArgs",be()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Lo}))}function Oo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["settingsCreation",Tt()],["userReadonlyArgs",ve()],["settingsIndex",getU128Decoder()]])}function Fh(){return combineCodec(cn(),Oo())}async function Bo(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:cn().encode(c),programAddress:r})}function zh(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:cn().encode(c),programAddress:r})}function Kh(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:Oo().decode(e.data)}}var ko=new Uint8Array([5]);function Qh(){return fixEncoderSize(getBytesEncoder(),1).encode(ko)}function dn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["createUserArgs",getArrayEncoder(hr())]]),e=>({...e,discriminator:ko}))}function No(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayDecoder(Rr())]])}function $h(){return combineCodec(dn(),No())}async function Vo(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:dn().encode(c),programAddress:r})}function eR(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:dn().encode(c),programAddress:r})}function tR(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:No().decode(e.data)}}var Fo=new Uint8Array([18]);function iR(){return fixEncoderSize(getBytesEncoder(),1).encode(Fo)}function zo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMut",k()],["compressedProofArgs",C()],["secp256r1VerifyArgs",getArrayEncoder(F())]]),e=>({...e,discriminator:Fo}))}function Ko(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMut",N()],["compressedProofArgs",M()],["secp256r1VerifyArgs",getArrayDecoder(z())]])}function dR(){return combineCodec(zo(),Ko())}function Jo(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:zo().encode(c),programAddress:r})}function uR(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Ko().decode(e.data)}}var Zo=new Uint8Array([2]);function TR(){return fixEncoderSize(getBytesEncoder(),1).encode(Zo)}function Yo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:Zo}))}function Xo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function fR(){return combineCodec(Yo(),Xo())}function Qo(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=y({args:c}),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:Yo().encode(c),programAddress:r})}function lR(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:Xo().decode(e.data)}}var rc=new Uint8Array([1]);function ER(){return fixEncoderSize(getBytesEncoder(),1).encode(rc)}function An(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Wr())]]),e=>({...e,discriminator:rc}))}function nc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Lr())]])}function PR(){return combineCodec(An(),nc())}async function hR(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:An().encode(c),programAddress:r})}function sc(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:An().encode(c),programAddress:r})}function RR(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:nc().decode(e.data)}}var ac=new Uint8Array([6]);function OR(){return fixEncoderSize(getBytesEncoder(),1).encode(ac)}function ic(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",fe()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",C()]]),e=>({...e,discriminator:ac}))}function dc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",le()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",M()]])}function BR(){return combineCodec(ic(),dc())}function uc(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i=y({args:c}),o=m(r);return Object.freeze({accounts:[o(t.authority),...i],data:ic().encode(c),programAddress:r})}function wR(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:dc().decode(e.data)}}var yc=new Uint8Array([7]);function zR(){return fixEncoderSize(getBytesEncoder(),1).encode(yc)}function mc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",fe()],["secp256r1VerifyArgs",getOptionEncoder(H())],["delegateTo",getOptionEncoder(ft())],["oldSettingsMutArgs",getOptionEncoder(k())],["newSettingsMutArgs",getOptionEncoder(k())],["compressedProofArgs",C()]]),e=>({...e,discriminator:yc}))}function pc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",le()],["secp256r1VerifyArgs",getOptionDecoder(G())],["delegateTo",getOptionDecoder(lt())],["oldSettingsMutArgs",getOptionDecoder(N())],["newSettingsMutArgs",getOptionDecoder(N())],["compressedProofArgs",M()]])}function KR(){return combineCodec(mc(),pc())}function Tc(e,n){let r=n?.programAddress??d,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...i],data:mc().encode(c),programAddress:r})}function JR(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:pc().decode(e.data)}}var Sc=new Uint8Array([33]);function $R(){return fixEncoderSize(getBytesEncoder(),1).encode(Sc)}function xc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",st()],["compressedProofArgs",C()],["settingsCreationArgs",pt()]]),e=>({...e,discriminator:Sc}))}function Ic(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",ot()],["compressedProofArgs",M()],["settingsCreationArgs",Tt()]])}function eb(){return combineCodec(xc(),Ic())}function Dc(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.authority),...i],data:xc().encode(c),programAddress:r})}function tb(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:Ic().decode(e.data)}}var Ec=new Uint8Array([32]);function ib(){return fixEncoderSize(getBytesEncoder(),1).encode(Ec)}function Pc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",We()],["compressedProofArgs",C()],["userCreationArgs",ge()]]),e=>({...e,discriminator:Ec}))}function hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Y()],["compressedProofArgs",M()],["userCreationArgs",ye()]])}function db(){return combineCodec(Pc(),hc())}function Rc(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.authority),...i],data:Pc().encode(c),programAddress:r})}function ub(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:hc().decode(e.data)}}var vc=new Uint8Array([30]);function fb(){return fixEncoderSize(getBytesEncoder(),1).encode(vc)}function gn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(F())]]),e=>({...e,discriminator:vc}))}function _c(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(z())]])}function lb(){return combineCodec(gn(),_c())}async function Sb(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(j(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:gn().encode(c),programAddress:r})}function Uc(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:gn().encode(c),programAddress:r})}function xb(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:_c().decode(e.data)}}var Oc=new Uint8Array([28]);function hb(){return fixEncoderSize(getBytesEncoder(),1).encode(Oc)}function Bc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(F())],["settingsMutArgs",k()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Oc}))}function wc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(z())],["settingsMutArgs",N()],["compressedProofArgs",M()]])}function Rb(){return combineCodec(Bc(),wc())}function kc(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Bc().encode(c),programAddress:r})}function bb(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:wc().decode(e.data)}}var Vc=new Uint8Array([31]);function Bb(){return fixEncoderSize(getBytesEncoder(),1).encode(Vc)}function mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(F())]]),e=>({...e,discriminator:Vc}))}function Hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(z())]])}function wb(){return combineCodec(mn(),Hc())}async function kb(e,n){let r=n?.programAddress??d,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},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(j(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceTokenAccount.value||(t.sourceTokenAccount.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.destinationTokenAccount.value||(t.destinationTokenAccount.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.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:mn().encode(c),programAddress:r})}function Gc(e,n){let r=n?.programAddress??d,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},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:mn().encode(c),programAddress:r})}function Nb(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:Hc().decode(e.data)}}var Jc=new Uint8Array([29]);function Jb(){return fixEncoderSize(getBytesEncoder(),1).encode(Jc)}function pn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(F())],["settingsMutArgs",k()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Jc}))}function jc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(z())],["settingsMutArgs",N()],["compressedProofArgs",M()]])}function jb(){return combineCodec(pn(),jc())}async function qb(e,n){let r=n?.programAddress??d,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},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceTokenAccount.value||(t.sourceTokenAccount.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.destinationTokenAccount.value||(t.destinationTokenAccount.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.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:pn().encode(c),programAddress:r})}function qc(e,n){let r=n?.programAddress??d,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},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:pn().encode(c),programAddress:r})}function Zb(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:jc().decode(e.data)}}var Xc=new Uint8Array([13]);function rv(){return fixEncoderSize(getBytesEncoder(),1).encode(Xc)}function Qc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())]]),e=>({...e,discriminator:Xc}))}function $c(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function nv(){return combineCodec(Qc(),$c())}function ea(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Qc().encode(c),programAddress:r})}function sv(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:$c().decode(e.data)}}var na=new Uint8Array([24]);function Av(){return fixEncoderSize(getBytesEncoder(),1).encode(na)}function sa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())],["settingsMutArgs",k()],["compressedProofArgs",C()]]),e=>({...e,discriminator:na}))}function oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",N()],["compressedProofArgs",M()]])}function gv(){return combineCodec(sa(),oa())}function ca(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:sa().encode(c),programAddress:r})}function yv(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:oa().decode(e.data)}}var da=new Uint8Array([10]);function xv(){return fixEncoderSize(getBytesEncoder(),1).encode(da)}function ua(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",It()],["secp256r1VerifyArgs",getOptionEncoder(H())]]),e=>({...e,discriminator:da}))}function Aa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Dt()],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function Iv(){return combineCodec(ua(),Aa())}function ga(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:ua().encode(c),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===d?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:Aa().decode(e.data)}}var pa=new Uint8Array([21]);function bv(){return fixEncoderSize(getBytesEncoder(),1).encode(pa)}function Ta(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",It()],["secp256r1VerifyArgs",getOptionEncoder(H())],["settingsReadonlyArgs",St()],["compressedProofArgs",C()]]),e=>({...e,discriminator:pa}))}function fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Dt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",xt()],["compressedProofArgs",M()]])}function vv(){return combineCodec(Ta(),fa())}function la(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:Ta().encode(c),programAddress:r})}function _v(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:fa().decode(e.data)}}var Ia=new Uint8Array([14]);function kv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ia)}function Da(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())]]),e=>({...e,discriminator:Ia}))}function Ca(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function Nv(){return combineCodec(Da(),Ca())}function Ma(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Da().encode(c),programAddress:r})}function Vv(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ca().decode(e.data)}}var ha=new Uint8Array([25]);function jv(){return fixEncoderSize(getBytesEncoder(),1).encode(ha)}function Ra(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())],["settingsMutArgs",k()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ha}))}function ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",N()],["compressedProofArgs",M()]])}function qv(){return combineCodec(Ra(),ba())}function va(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ra().encode(c),programAddress:r})}function Zv(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ba().decode(e.data)}}var Wa=new Uint8Array([12]);function t_(){return fixEncoderSize(getBytesEncoder(),1).encode(Wa)}function La(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Wa}))}function Oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function r_(){return combineCodec(La(),Oa())}function Ba(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=y({args:c}),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:La().encode(c),programAddress:r})}function n_(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:Oa().decode(e.data)}}var Na=new Uint8Array([23]);function d_(){return fixEncoderSize(getBytesEncoder(),1).encode(Na)}function Va(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Na}))}function Ha(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function u_(){return combineCodec(Va(),Ha())}function Ga(e,n){let r=n?.programAddress??d,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=y({args:c}),o=m(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:Va().encode(c),programAddress:r})}function A_(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:Ha().decode(e.data)}}var Ka=new Uint8Array([11]);function l_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ka)}function Ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())]]),e=>({...e,discriminator:Ka}))}function ja(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function S_(){return combineCodec(Ja(),ja())}function qa(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ja().encode(c),programAddress:r})}function x_(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ja().decode(e.data)}}var Xa=new Uint8Array([22]);function h_(){return fixEncoderSize(getBytesEncoder(),1).encode(Xa)}function Qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())],["settingsReadonlyArgs",St()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Xa}))}function $a(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",xt()],["compressedProofArgs",M()]])}function R_(){return combineCodec(Qa(),$a())}function ei(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Qa().encode(c),programAddress:r})}function b_(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:$a().decode(e.data)}}var ni=new Uint8Array([15]);function O_(){return fixEncoderSize(getBytesEncoder(),1).encode(ni)}function si(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:ni}))}function oi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function B_(){return combineCodec(si(),oi())}function ci(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=y({}),i=m(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:si().encode({}),programAddress:r})}function w_(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:oi().decode(e.data)}}var di=new Uint8Array([26]);function F_(){return fixEncoderSize(getBytesEncoder(),1).encode(di)}function ui(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:di}))}function Ai(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function z_(){return combineCodec(ui(),Ai())}function gi(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=y({args:c}),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:ui().encode(c),programAddress:r})}function K_(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:Ai().decode(e.data)}}var pi=new Uint8Array([16]);function Q_(){return fixEncoderSize(getBytesEncoder(),1).encode(pi)}function Ti(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Ct()],["secp256r1VerifyArgs",getArrayEncoder(F())]]),e=>({...e,discriminator:pi}))}function fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Mt()],["secp256r1VerifyArgs",getArrayDecoder(z())]])}function $_(){return combineCodec(Ti(),fi())}function li(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ti().encode(c),programAddress:r})}function eU(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:fi().decode(e.data)}}var Ii=new Uint8Array([27]);function aU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ii)}function Di(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Ct()],["secp256r1VerifyArgs",getArrayEncoder(F())],["settingsMutArgs",k()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ii}))}function Ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Mt()],["secp256r1VerifyArgs",getArrayDecoder(z())],["settingsMutArgs",N()],["compressedProofArgs",M()]])}function iU(){return combineCodec(Di(),Ci())}function Mi(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Di().encode(c),programAddress:r})}function dU(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Ci().decode(e.data)}}var d="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",US=(c=>(c[c.DomainConfig=0]="DomainConfig",c[c.GlobalCounter=1]="GlobalCounter",c[c.Settings=2]="Settings",c[c.TransactionBuffer=3]="TransactionBuffer",c[c.WhitelistedAddressTree=4]="WhitelistedAddressTree",c))(US||{});function qU(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 WS=(T=>(T[T.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",T[T.ChangeConfig=1]="ChangeConfig",T[T.ChangeConfigCompressed=2]="ChangeConfigCompressed",T[T.CompressSettingsAccount=3]="CompressSettingsAccount",T[T.CreateDomainConfig=4]="CreateDomainConfig",T[T.CreateDomainUserAccount=5]="CreateDomainUserAccount",T[T.CreateGlobalCounter=6]="CreateGlobalCounter",T[T.CreateMultiWalletCompressed=7]="CreateMultiWalletCompressed",T[T.CreateUserAccounts=8]="CreateUserAccounts",T[T.DecompressSettingsAccount=9]="DecompressSettingsAccount",T[T.DisableDomainConfig=10]="DisableDomainConfig",T[T.EditDomainConfig=11]="EditDomainConfig",T[T.EditTransactionManagerUrl=12]="EditTransactionManagerUrl",T[T.EditUserDelegate=13]="EditUserDelegate",T[T.MigrateCompressedSettings=14]="MigrateCompressedSettings",T[T.MigrateCompressedUsers=15]="MigrateCompressedUsers",T[T.NativeTransferIntent=16]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=17]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=18]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=19]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=20]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=21]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=22]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=23]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=24]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=25]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=26]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=27]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=28]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=29]="TransactionBufferVoteCompressed",T[T.TransactionExecute=30]="TransactionExecute",T[T.TransactionExecuteCompressed=31]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=32]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=33]="TransactionExecuteSyncCompressed",T))(WS||{});function ZU(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([20])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([17])),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([19])),0))return 7;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 8;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 9;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 10;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 11;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 12;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 13;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([33])),0))return 14;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([32])),0))return 15;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 16;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 17;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([31])),0))return 18;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 19;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 20;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 21;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 22;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 23;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 24;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 25;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 26;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 27;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 28;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 29;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 30;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 31;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 32;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 33;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var OS=6e3,BS=6001,wS=6002,kS=6003,NS=6004,VS=6005,HS=6006,GS=6007,FS=6008,zS=6009,KS=6010,JS=6011,jS=6012,qS=6013,ZS=6014,YS=6015,XS=6016,QS=6017,$S=6018,ex=6019,tx=6020,rx=6021,nx=6022,sx=6023,ox=6024,cx=6025,ax=6026,ix=6027,dx=6028,ux=6029,Ax=6030,gx=6031,yx=6032,mx=6033,px=6034,Tx=6035,fx=6036,lx=6037,Sx=6038,xx=6039,Ix=6040,Dx=6041,Cx=6042,Mx=6043,Ex=6044,Px=6045,hx=6046,Rx=6047,bx=6048,vx=6049,_x=6050,Ux=6051,Wx=6052,Lx=6053,Ox=6054,Ei;process.env.NODE_ENV!=="production"&&(Ei={[Ax]:"This member is already delegated to another wallet.",[GS]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[_x]:"The domain configuration account is disabled. Please contact support or try again later.",[Ux]:"Missing domain configuration account.",[KS]:"Duplicate public keys detected among members. Each member must have a unique key.",[zS]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[tx]:"No members provided. A multisig wallet must contain at least one member.",[$S]:"Expected a User with Administrator role for this instruction.",[FS]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[XS]:"Expected a User with Transaction Manager role for this instruction.",[xx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[Ix]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Dx]:"Declared buffer size does not match the actual serialized size.",[mx]:"Not enough members with vote permission to meet the approval threshold.",[gx]:"At least one signer with execute permission is required to proceed.",[yx]:"At least one signer with initiate permission is required to perform this action.",[cx]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[Ox]:"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.",[ix]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Sx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[px]:"Only delegated members are allowed for this transaction.",[ox]:"Unexpected number of accounts provided for this instruction.",[qS]:"User with Permanent Member role requires a must have a delegated wallet.",[BS]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[NS]:"The extracted public key has an invalid length or encoding.",[OS]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[kS]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[vx]:"The specified slot number is not recent.",[Rx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[nx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[QS]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[YS]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[sx]:"Malformed transaction message: structure or formatting does not match the expected layout.",[ax]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[VS]:"The extracted WebAuthn signed message payload is malformed.",[Px]:"An input string exceeds the maximum allowed character length.",[Wx]:"This member is not registered under the provided domain configuration.",[dx]:"A required account is missing from the instruction context.",[ux]:"User mutation arguments are required when performing add or remove delegate operations.",[hx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[fx]:"No valid signer found in this transaction.",[jS]:"Only one permanent member is allowed per wallet.",[ZS]:"Only one transaction manager is allowed per wallet.",[Lx]:"The given origin index is not in the whitelisted origins.",[JS]:"Permanent members cannot be removed from a wallet.",[Ex]:"Writable CPI calls to protected accounts are not permitted.",[HS]:"The rpIdHash extracted from the signed message does not match the expected value.",[wS]:"The signature index provided is out of bounds for the secp256r1 instruction.",[bx]:"The specified slot number was not found in the provided slot history.",[rx]:"Too many members: a maximum of 4 members are supported.",[Cx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[Mx]:"This transaction has not yet reached the required approval threshold.",[lx]:"Only the transaction creator or rent payer may close this transaction buffer.",[Tx]:"Member is not part of the expected signers for this transaction."});function tW(e){return process.env.NODE_ENV!=="production"?Ei[e]:"Error message not available in production bundles."}function rW(e,n,r){return isProgramError(e,n,d,r)}var bt={Ed25519:1,Secp256r1:2};var Se={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(Se).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var ln=33,Ce=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!==ln)throw new Error(`Invalid public key length, expected ${ln} 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===ln)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()}},E=class extends Ce{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 kx(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function Nx(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var hi=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(kx())],["addressTableLookups",getArrayCodec(Nx())]]);function Ri(e){return hi.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 bi(e){let n=hi.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:d,staticAccounts:n.accountKeys,version:0}}featureFlags.version=VERSION.V2;var q={};function Ge(){if(!q.solanaRpcEndpoint)throw new Error("Rpc is not initialized yet.");return q.solanaRpcEndpoint}function Be(){if(!q.lightProtocolRpc)throw new Error("Rpc is not initialized yet");return q.lightProtocolRpc}function ne(){if(!q.solanaRpc)throw new Error("Rpc is not initialized yet");return q.solanaRpc}function vi(){if(!q.sendAndConfirm)throw new Error("Rpc is not initialized yet.");return q.sendAndConfirm}function _i(){if(!q.computeEstimate)throw new Error("Rpc is not initialized yet");return q.computeEstimate}function xn(){return q.jitoTipsConfig?q.jitoTipsConfig:{blockEngineUrl:"https://mainnet.block-engine.jito.wtf/api/v1",getJitoTipsUrl:"https://bundles.jito.wtf/api/v1/bundles/tip_floor",priority:"landed_tips_75th_percentile"}}function LW(){Object.keys(q).forEach(e=>{q[e]=void 0;});}function OW({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){q.solanaRpcEndpoint=e,q.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});q.solanaRpc=t,q.sendAndConfirm=c,q.computeEstimate=estimateComputeUnitLimitFactory({rpc:t}),q.jitoTipsConfig=s??null;}var O=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}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(d.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.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=Ge().includes("devnet")?localTestActiveStateTreeInfos():await Be().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:a,queuePubkeyIndex:i,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,u=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=u);}for(let c of r){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:a,addressQueuePubkeyIndex:i});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function er(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await Li(e);return s&&n?.set(e.toString(),s),s}}async function me(e,n){let s=(await Promise.all(e.map(async t=>er(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new Error("Unable to find compressed account.");return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function v(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function oe(e,n,r,s,t){if(t.length===0)return [];let c=t.map((u,A)=>({treeInfo:n[A],root:r[A],rootIndex:s[A],address:u.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((u,A)=>({addressTreeInfo:a[A],outputStateTreeIndex:i,address:u.address,type:u.type}))}function ce(e,n,r,s,t,c,a){let i=[];for(let A=0;A<n.length;A++)i.push({treeInfo:n[A],rootIndex:s[A],leafIndex:r[A],proveByIndex:t[A],hash:c[A].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((A,g)=>({data:a.decode(A.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(A.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function ae(e,n,r,s,t){let c=null,a=null,i=null,o=new O;if(e){await o.addSystemAccounts();let{address:u}=await se(n,r),A=(await me([{address:u,type:"Settings"}],t))[0];s?i={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)))}}:i=await K([A],[]);let g=o.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:A.hash}],[]).stateTrees;if(!g)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(A.address),treeInfo:g.packedTreeInfos[0]},data:te().decode(A.data?.data)},a={accountMeta:{address:new Uint8Array(A.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:te().decode(A.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:o,settingsMutArgs:a}}async function K(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await Be().getValidityProofV0(e,n)}catch(c){if(console.error(`Attempt ${t}, Get Validity Proof failed. ${c}`),t++,t>=r)throw new Error(`Failed to get validity proof after ${r} attempts: ${c}`);await new Promise(a=>setTimeout(a,s));}throw new Error(`Failed to get validity proof after ${r} attempts`)}async function Te(){return (await tr()).length-1}var In;async function tr(){if(!In){let{data:e}=await ks(ne(),await Oi());In=e.whitelistedAddressTrees;}return In}async function rr(e,n,r){let s=await dI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function dI(e,n,r){let{address:s}=await B(e,n),t=await er(s,r);return t?.data?.data?Y().decode(t.data.data):null}async function Dn(e,n,r){let s=await uI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function uI(e,n,r){try{let{address:s}=await se(e,n),t=await er(s,r);if(!t?.data?.data)throw new Error("No compressed settings account found.");let c=te().decode(t.data.data);if(c.data.__option==="None")throw new Error("No compressed settings account found.");return {...c.data.value,isCompressed:!0}}catch{let s=await zr(ne(),await X(e));return s.exists?{...s.data,index:getU128Decoder().decode(s.data.index),members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function Cn(e){let n=await tr();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function iL(e){let r=(await tr()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function Li(e){let n=await rpcRequest(Be().compressionApiEndpoint,versionedEndpoint("getCompressedAccount"),{hash:void 0,address:e?encodeBN254toBase58(e):void 0}),r;if(featureFlags.isV2()?r=create(n,jsonRpcResultAndContext(nullable(CompressedAccountResultV2))):r=create(n,jsonRpcResultAndContext(nullable(CompressedAccountResult))),"error"in r)throw new SolanaJSONRPCError(r.error,`failed to get info for compressed account ${e?e.toString():""}`);if(r.result.value===null)return null;let s=featureFlags.isV2()?r.result.value.merkleContext.tree:r.result.value.tree,t=Ge().includes("devnet")?localTestActiveStateTreeInfos():await Be().getStateTreeInfos(),c=getStateTreeInfoByPubkey(t,s),a=r.result.value;return createCompressedAccountWithMerkleContextLegacy(createMerkleContextLegacy(c,a.hash,a.leafIndex),a.owner,bn(a.lamports),a.data?parseAccountData(a.data):void 0,a.address||void 0)}async function se(e,n=0){let r=await Cn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("multi_wallet")),new Uint8Array(getU128Encoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(d)).toString(),"base58"),addressTree:new PublicKey(r)}}async function B(e,n=0){let r=await Cn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),e instanceof Ce?e.toTruncatedBuffer():new Uint8Array(getAddressEncoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(d.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function ze({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(new Uint8Array(getUtf8Encoder().encode(n)));else throw new Error("RpId not found.");if(!e)throw new Error("RpIdHash not found.");let[r]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function zi(){let[e]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function Oi(){let[e]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Ki(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof Ce?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function xe(e){let[n]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function X(e){let[n]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function fL(e){let n=await X(e);return await xe(n)}async function lL(){let[e]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}function sr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function mI(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 ji(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 qi(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let a=e[s]|e[s+1]<<8;if(s+=2,s+a>e.length)throw new Error("MaxLengthExceeded");let i=e.slice(s,s+a),o=t.decode(i);r.push(o),s+=a;}return r}function Zi(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 I=n&127;r+=I;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let a=e[r+1],i=r+2,o=e.slice(i,i+a),u=c[0]===0&&c.length>32?c.slice(1):c,A=o[0]===0&&o.length>32?o.slice(1):o;if(u.length>32||A.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(u,32-u.length);let p=p256.Point.CURVE().n>>1n,l=BigInt("0x"+sr(A)),D=(l>p?p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),S=mI(D);return new Uint8Array([...g,...S])}function or(e){return new Uint8Array([...new Uint8Array(Ee(e.response.authenticatorData)),...sha256(new Uint8Array(Ee(e.response.clientDataJSON)))])}function OL(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+sr(n.get(-2))),y:BigInt("0x"+sr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function BL(e){let r=p256.Point.fromBytes(new Uint8Array(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 wL(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Ee(n)),c=JSON.parse(new TextDecoder().decode(Ee(r))),a=ji(c),i=Zi(new Uint8Array(Ee(s))),o=await ze({rpIdHash:t.subarray(0,32)});return new E(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Ee(r)),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:Mn(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}async function kL(e,n){let{data:r}=await kn(ne(),e),t=qi(new Uint8Array(r.origins),r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Error("Origin not found in domain config");return t}function Mn(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function NL(e){return sha256(new Uint8Array(getUtf8Encoder().encode(JSON.stringify(e))))}function VL(e){return En(e.data.payload.authResponse)}function HL(e,n,r,s){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...Mn(n,r,s)]))}async function GL(e,n,r,s,t,c){let a;if(!t||!c){let o=(await ne().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed"}).send()).value?.data;if(!o)throw new Error("Unable to fetch slot sysvar");let u=getBase64Encoder().encode(o[0]);c=getU64Decoder().decode(u.subarray(8,16)).toString(),a=u.subarray(16,48),t=getBase58Decoder().decode(a);}else a=new Uint8Array(getBase58Encoder().encode(t));let i=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...sha256(typeof e.transactionMessageBytes=="string"?new Uint8Array(Ee(e.transactionMessageBytes)):e.transactionMessageBytes),...a,...Mn(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:i}}function En(e){return sha256(or(e))}function FL(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ee(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),a=new Uint8Array(c);for(let i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return c}async function Pn(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await ne().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(s.instructions,c),c=>setTransactionMessageFeePayerSigner(s.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let a=Math.ceil((s.unitsConsumed??0)*1.1)||8e5;return a>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:a})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function ed(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===AccountRole.WRITABLE||c.role===AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,a)=>c-a);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function td(e,n){if(e.length===0)throw new Error("Bundle is empty.");for(let c=0;c<e.length;c++){if(e[c].length>1644)throw new Error(`Transaction ${c} exceeds maximum length, ${e[c].length}. Retry again.`);console.log(`Transaction ${c} length: ${e[c].length}`);}let r=await 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:[]}))}]})});if(!r.ok)throw console.error(await r.json()),new Error("Failed to simulate bundle");let{result:s,error:t}=await r.json();if(!s||t)throw console.error(t??s),new Error(`Unable to simulate bundle: ${JSON.stringify(t??s)}`);if(typeof s.value.summary!="string"&&s.value.summary.failed){let{TransactionFailure:c}=s.value.summary.failed.error,[,a]=c;throw console.error(t??s),new Error(`Simulation failed: ${a}`)}return s.value.transactionResults.map(c=>c.unitsConsumed)}function V(e,n=0){let r=e instanceof E?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}):null,t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,a=r?.authData&&r.verifyArgs?.clientDataJson?or(r.authResponse):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function Je(e){if(e instanceof Ce)return {keyType:bt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:bt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function $i(e){return e instanceof E?e.toString():e.address.toString()}function ie(e){let n=new Set,r=[];for(let s of e)n.has($i(s))||(r.push(s),n.add($i(s)));if(r.filter(s=>s instanceof E).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function rd({payer:e,tipAmount:n}){let r=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],s=r[Math.floor(Math.random()*r.length)];return getTransferSolInstruction({source:e,destination:address(s),amount:n})}async function cO(e){let n=await Pn(e,true),r=await td(n.map(getBase64EncodedWireTransaction),Ge()),s=await Pn(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await ZI(s.map(getBase64EncodedWireTransaction))}async function aO({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await ne().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(e,c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([_i()(c),ed(ne(),c.instructions.flatMap(u=>u.accounts??[]))]),o=Math.ceil(a*1.1);return prependTransactionMessageInstructions([...o>2e5?[getSetComputeUnitLimitInstruction({units:o})]:[],...i>0?[getSetComputeUnitPriceInstruction({microLamports:i})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await vi()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}async function ZI(e,n=10,r=1e3,s=xn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/bundles`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})});if(a.status===429&&c<n){await new Promise(o=>setTimeout(o,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);return i.result}throw new Error("Failed to send bundle after retries.")}async function iO(e,n=30,r=3e3,s=xn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/getBundleStatuses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});if(a.status===429&&c<n){await new Promise(u=>setTimeout(u,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);let o=i.result;if(o.value.length){let u=o.value[0];if(u.confirmation_status==="confirmed"||u.confirmation_status==="finalized")return u.transactions[u.transactions.length-1]}if(c<n){await new Promise(u=>setTimeout(u,r));continue}}throw new Error("Failed to get bundle status after retries.")}function dO(e,n){if(n.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:r}=n.members.find(i=>sd(i.pubkey)===e)??{};if(!r)throw new Error("No permissions found for the current member.");let s=De.has(r,Se.InitiateTransaction),t=De.has(r,Se.VoteTransaction),c=De.has(r,Se.ExecuteTransaction);if(s&&t&&c)return {};if(!t||!c)throw new Error("Signer lacks the required Vote/Execute permissions.");let a=n.members.find(i=>i.role===2);if(!a)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:address(sd(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function uO({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await rr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return YI(n,c.transactionManagerUrl.value,e,s)}function YI(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=getBase64Decoder().decode(s)),r&&(c.authResponses=r);let i=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json();if("error"in i)throw new Error(i.error);return i.signatures.map(o=>({[e]:getBase58Encoder().encode(o)}))}}}function sd(e){return e.keyType===bt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}var je=33,qe=64,_n=14,nD=2,sD=address("Secp256r1SigVerify1111111111111111111111111");function oD(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function cD(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function id(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let s=getU8Decoder().decode(e,n);n+=1;let t=[],c=cD();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=_n;let a=[];for(let i=0;i<r;i++){let o=fixDecoderSize(getBytesDecoder(),je).decode(e,n);n+=je;let u=fixDecoderSize(getBytesDecoder(),qe).decode(e,n);n+=qe;let A=t[i].messageDataSize,g=fixDecoderSize(getBytesDecoder(),A).decode(e,n);n+=A,a.push({publicKey:o,signature:u,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function dd(){return createEncoder({getSizeFromValue:e=>{let n=_n*e.offsets.length,r=e.payload.reduce((s,t)=>s+je+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=oD();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),je).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),qe).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function IO(){return combineCodec(dd(),id())}function w(e,n){let r=e.length,s=nD+r*_n,t=[];for(let o=0;o<r;o++){let{message:u}=e[o],A=s,g=A+je,p=g+qe;t.push({publicKeyOffset:A,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:u.length,messageInstructionIndex:65535}),s+=je+qe+u.length;}let c=n?.programAddress??sD,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:dd().encode(a)}}function DO(e){return {programAddress:e.programAddress,accounts:{},data:id().decode(e.data)}}async function LO({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,signers:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await aD(r),o=new O,u=null,A=null,g=[];if(i.length||c){let U=await iD({packedAccounts:o,userAccounts:i,compressed:c,index:e,settingsAddressTreeIndex:n,cachedAccounts:a});u=U.proof,A=U.settingsMutArgs??null,g=U.userMutArgs??[];}let p=ie(s),l=p.filter(U=>!(U instanceof E));o.addPreAccounts(l.map(U=>({address:U.address,role:AccountRole.READONLY_SIGNER,signer:U})));let f=p.filter(U=>U instanceof E),D=[],S=[];for(let U of f){let L=S.length,{domainConfig:J,verifyArgs:Z,signature:re,publicKey:ue,message:pe}=V(U,L);pe&&re&&ue&&S.push({message:pe,signature:re,publicKey:ue}),J&&(o.addPreAccounts([{address:J,role:AccountRole.READONLY}]),Z?.__option==="Some"&&D.push({domainConfigKey:J,verifyArgs:Z.value}));}let I=await dD({configActionsArgs:r,userMutArgs:g,index:e}),{remainingAccounts:b,systemOffset:x}=o.toAccountMetas(),_=v(u,x),W=[];return S.length>0&&W.push(w(S)),W.push(c?co({configActions:I,payer:t,compressedProofArgs:_,settingsMut:A,remainingAccounts:b,secp256r1VerifyArgs:D}):await Qs({settingsIndex:e,configActions:I,payer:t,compressedProofArgs:_,remainingAccounts:b,secp256r1VerifyArgs:D})),W}async function aD(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>B(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=>B(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function iD({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let a=[];if(r){let l=(await se(s,t)).address;a.push({address:l,type:"Settings"});}n.length&&a.push(...n);let i=a.length?await me(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await K(i,[]),u=[],A=[];for(let l of i)l.type==="Settings"?u.push(l):l.type==="User"&&A.push(l);let g,p=[];if(r&&o&&(g=ce(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),u,te())[0]),A.length&&o){let l=r?1:0;p=ce(e,o.treeInfos.slice(l),o.leafIndices.slice(l),o.rootIndices.slice(l),o.proveByIndices.slice(l),A,Y());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function dD({index:e,configActionsArgs:n,userMutArgs:r}){let s=[];for(let t of n)switch(t.type){case "AddMembers":{let c=[];for(let a of t.members){let i=await B(a.member,a.userAddressTreeIndex).then(o=>r.find(u=>new ud(new Uint8Array(u.accountMeta.address)).eq(o.address)));if(!i)throw new Error("Unable to find user account");c.push(gD({permissionArgs:a.permissions,userMutArgs:i,pubkey:a.member}));}s.push({__kind:t.type,fields:[c]});break}case "RemoveMembers":{let c=await Promise.all(t.members.map(a=>B(a.member,a.userAddressTreeIndex).then(i=>{let o=r.find(u=>new ud(new Uint8Array(u.accountMeta.address)).eq(i.address));if(!o)throw new Error("Unable to find user account");return AD({pubkey:a.member,userMutArgs:o,index:e})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(a=>uD({permissionArgs:a.permissions,pubkey:a.member}));s.push({__kind:t.type,fields:[c]});break}default:s.push({__kind:t.type,fields:[t.threshold]});}return s}function uD({pubkey:e,permissionArgs:n}){return {memberKey:Je(e),permissions:gd(n)}}function AD({pubkey:e,userMutArgs:n,index:r}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");let s=n.data.delegatedTo.__option==="Some"?Number(n.data.delegatedTo.value.index.toString())===r:false;return {memberKey:Je(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function gD({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===1)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===2&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:Je(e),permissions:gd(n),userReadonlyArgs:r}}function gd(e){let n=[];return e.initiate&&n.push(Se.InitiateTransaction),e.vote&&n.push(Se.VoteTransaction),e.execute&&n.push(Se.ExecuteTransaction),De.fromPermissions(n)}async function FO({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=await X(e),{packedAccounts:a,proof:i,settingsMutArgs:o}=await ae(true,e,n,false,t);if(!o)throw new Error("Proof args is missing");let u=ie(s),A=u.filter(I=>I instanceof E),g=[],p=[];for(let I of A){let b=g.length,{domainConfig:x,verifyArgs:_,signature:W,publicKey:U,message:L}=V(I,b);L&&W&&U&&g.push({message:L,signature:W,publicKey:U}),x&&(a.addPreAccounts([{address:x,role:AccountRole.READONLY}]),_?.__option==="Some"&&p.push({domainConfigKey:x,verifyArgs:_.value}));}a.addPreAccounts(u.filter(I=>"address"in I).map(I=>({address:I.address,role:AccountRole.READONLY_SIGNER,signer:I})));let{remainingAccounts:l,systemOffset:f}=a.toAccountMetas(),D=v(i,f),S=[];return g.length>0&&S.push(w(g)),S.push(yo({settings:c,settingsMutArgs:o,compressedProofArgs:D,payer:r,secp256r1VerifyArgs:p,remainingAccounts:l})),S}async function JO({admin:e,addressTree:n}){return zs({payer:e,addressTree:n,remainingAccounts:[]})}async function $O({payer:e,rpId:n,origins:r,authority:s}){let t=await ze({rpId:n}),c=new O;await c.addSystemAccounts();let a=await Te(),{address:i,addressTree:o}=await B(s.address,a),u=[{address:i,tree:o,queue:o,type:"User"}],A=await K([],u),g=(await oe(c,A.treeInfos,A.roots,A.rootIndices,u))[0],{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),f=v(A,l);return await Co({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:f,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function dB({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new O;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await se(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await B(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await me(a,t):[],o=await Te(),{address:u,addressTree:A}=await B(r.member,o),g=[{address:u,type:"User",tree:A,queue:A}],p=await K(i,g),l=null,f=null,D=i.filter(W=>W.type==="Settings"),S=i.filter(W=>W.type==="User");D.length&&(l=ce(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),D,te())[0]),S.length&&(f=ce(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),S,Y())[0]);let I=await oe(c,p.treeInfos.slice(i.length),p.roots.slice(i.length),p.rootIndices.slice(i.length),g),{remainingAccounts:b,systemOffset:x}=c.toAccountMetas(),_=v(p,x);return await ho({payer:n,authority:e,compressedProofArgs:_,member:mt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:l?some({settingsMutArgs:l,transactionManager:f?some(f):none()}):none(),userAccountCreationArgs:I[0],domainConfig:s,remainingAccounts:b})}async function yB({payer:e}){let n=await zi();return _o({payer:e,globalCounter:n})}async function xB({createUserArgs:e,payer:n}){let r=new O;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:g,addressTree:p}=await B(A.member.address,s);return {address:g,tree:p,queue:p,type:"User"}})),c=await K([],t),a=await oe(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),u=v(c,o);return await Vo({compressedProofArgs:u,payer:n,createUserArgs:e.map((A,g)=>({member:A.member.address,role:A.role,userCreationArgs:a[g],transactionManagerUrl:A.role===2?A.transactionManagerUrl:null})),remainingAccounts:i})}async function MB({admin:e,rpId:n,disable:r}){let s=await ze({rpId:n});return Qo({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function _B({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new O;await a.addSystemAccounts();let i=await Te(),{address:o,addressTree:u}=await B(r.address,i),A=[{address:o,tree:u,queue:u,type:"User"}],g=await K([],A),p=(await oe(a,g.treeInfos,g.roots,g.rootIndices,A))[0],l=a.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:v(g,l.systemOffset),authorityCreationArgs:p};}return sc({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function wB({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new O;await s.addSystemAccounts();let t=await me([{address:(await B(e.address,n)).address,type:"User"}]),c=await K(t,[]),a=ce(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,Y())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),u=v(c,o);return uc({authority:e,transactionManagerUrl:r,compressedProofArgs:u,userMutArgs:a,remainingAccounts:i})}async function jB({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:a,message:i,signature:o,publicKey:u}=V(n),A=[];i&&o&&u&&A.push({message:i,signature:o,publicKey:u});let g=await rr(n instanceof E?n:n.address,r,t),p=[];p.push({address:(await B(n instanceof E?n:n.address,r)).address,type:"User"});let l,f=null,D,S=null;g.delegatedTo.__option==="Some"&&((await Dn(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await se(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),f={start:p.length-1,end:p.length}):l=await X(g.delegatedTo.value.index)),s&&((await Dn(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await se(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):D=await X(s.index));let I=new O;await I.addSystemAccounts();let b=await me(p,t),x=await K(b,[]),_=ce(I,x.treeInfos.slice(0,1),x.leafIndices.slice(0,1),x.rootIndices.slice(0,1),x.proveByIndices.slice(0,1),b.slice(0,1),Y())[0],W=f?some(ce(I,x.treeInfos.slice(f.start,f.end),x.leafIndices.slice(f.start,f.end),x.rootIndices.slice(f.start,f.end),x.proveByIndices.slice(f.start,f.end),b.slice(f.start,f.end),te())[0]):none(),U=S?some(ce(I,x.treeInfos.slice(S.start,S.end),x.leafIndices.slice(S.start,S.end),x.rootIndices.slice(S.start,S.end),x.proveByIndices.slice(S.start,S.end),b.slice(S.start,S.end),te())[0]):none(),{remainingAccounts:L,systemOffset:J}=I.toAccountMetas(),Z=v(x,J),re=[];return A.length>0&&re.push(w(A)),re.push(Tc({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof E?void 0:n,oldSettings:l,oldSettingsMutArgs:W,newSettings:D,newSettingsMutArgs:U,compressedProofArgs:Z,userMutArgs:_,remainingAccounts:L})),re}async function ew({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new O;await t.addSystemAccounts();let{address:c,addressTree:a}=await se(r,s),i=[{address:c,tree:a,queue:a,type:"Settings"}],o=await K([],i),u=(await oe(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:A,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Dc({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:u,remainingAccounts:A})}async function aw({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new O;await t.addSystemAccounts();let{address:c,addressTree:a}=await B(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await K([],i),u=(await oe(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:A,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Rc({compressedProofArgs:p,args:e,authority:n,userCreationArgs:u,remainingAccounts:A})}async function Pw({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new O;await c.addSystemAccounts();let a=[],i=[];i.push(...await me([{address:(await B(r.address,s)).address,type:"User"}],t));let o=await Te(),{address:u,addressTree:A}=await se(e,o);a.push({address:u,queue:A,tree:A,type:"Settings"});let g=i.length,p=await K(i,a),l=ce(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),i.filter(_=>_.type==="User"),Y())[0],D=(await oe(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),a)).find(_=>_.type==="Settings")??null,{remainingAccounts:S,systemOffset:I}=c.toAccountMetas(),b=v(p,I),x=[];if(!D)throw new Error("Settings creation args is missing.");return x.push(await Bo({settingsIndex:e,payer:n,initialMember:r,userReadonlyArgs:l,compressedProofArgs:b,settingsCreation:D,remainingAccounts:S})),x}async function Ow({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:a,settingsMutArgs:i}=await ae(true,e,n,false,t);if(!i)throw new Error("Proof args is missing");let o=ie(s),u=o.filter(I=>I instanceof E),A=[],g=[];for(let I of u){let b=A.length,{domainConfig:x,verifyArgs:_,signature:W,publicKey:U,message:L}=V(I,b);L&&W&&U&&A.push({message:L,signature:W,publicKey:U}),x&&(c.addPreAccounts([{address:x,role:AccountRole.READONLY}]),_?.__option==="Some"&&g.push({domainConfigKey:x,verifyArgs:_.value}));}c.addPreAccounts(o.filter(I=>"address"in I).map(I=>({address:I.address,role:AccountRole.READONLY_SIGNER,signer:I})));let{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),f=v(a,l),D=[];A.length>0&&D.push(w(A));let S=await X(e);return D.push(Jo({settings:S,payer:r,settingsMut:i,compressedProofArgs:f,secp256r1VerifyArgs:g,remainingAccounts:p})),D}function fD(e,n,r,s){let t=lD(e,n),c=SD(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function lD(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,a=s-t,i=r-s-c;return n>=r?false:n<a?true:n>=s?n-s<i:false}function SD(e,n){return n<e.header.numSignerAccounts}async function ar({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=bi(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(i=>i.lookupTableAddress),ne()):{}),a=[];a.push(...t.addressTableLookups?.map(i=>({role:AccountRole.READONLY,address:i.lookupTableAddress}))??[]);for(let[i,o]of t.staticAccounts.entries())a.push({address:o,role:fD(t,i,o,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let o=c[i.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let u of i.writableIndexes){let A=o[u];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:A,role:AccountRole.WRITABLE});}for(let u of i.readonlyIndexes){let A=o[u];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:A,role:AccountRole.READONLY});}}for(let i of s?.filter(o=>o.address!==e)??[]){let o=a.findIndex(u=>u.address===i.address);o===-1?a.push({address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}):a[o].role===AccountRole.READONLY||a[o].role===AccountRole.READONLY_SIGNER?a[o]={address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}:(a[o].role===AccountRole.WRITABLE||a[o].role===AccountRole.WRITABLE_SIGNER)&&(a[o]={address:i.address,role:AccountRole.WRITABLE_SIGNER,signer:i});}return {accountMetas:a,addressLookupTableAccounts:c,transactionMessage:t}}async function fd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let u=await xe(e),{accountMetas:A,addressLookupTableAccounts:g}=await ar({transactionMessageBytes:r,walletAddress:u,additionalSigners:a,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(w(c)),p.push(o?gi({transactionBuffer:n,payer:s.address,remainingAccounts:A,settingsKey:e}):ci({transactionBuffer:n,payer:s.address,settings:e})),i&&p.push(rd({payer:s,tipAmount:i})),{instructions:p,addressLookupTableAccounts:g}}async function ld({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:u}){let A=ie(s),g=await X(e),p=await xe(g),[{accountMetas:l,addressLookupTableAccounts:f,transactionMessage:D},{settingsMutArgs:S,proof:I,packedAccounts:b}]=await Promise.all([ar({transactionMessageBytes:r,walletAddress:p,additionalSigners:A.filter(Z=>!(Z instanceof E)),addressesByLookupTableAddress:c}),ae(i,e,n,o,u)]);b.addPreAccounts(l);let x=A.filter(Z=>Z instanceof E),_=[];for(let Z of x){let re=a.length,{domainConfig:ue,verifyArgs:pe,signature:Pe,publicKey:Ie,message:Ut}=V(Z,re);Ut&&Pe&&Ie&&a.push({message:Ut,signature:Pe,publicKey:Ie}),ue&&(b.addPreAccounts([{address:ue,role:AccountRole.READONLY}]),pe?.__option==="Some"&&_.push({domainConfigKey:ue,verifyArgs:pe.value}));}let{remainingAccounts:W,systemOffset:U}=b.toAccountMetas(),L=[];a.length>0&&L.push(w(a));let J=ID(D,l);if(i){if(!t||!S)throw new Error("Payer not found or proof args is missing.");let Z=v(I,U);L.push(Mi({secp256r1VerifyArgs:_,transactionMessage:J,settingsMutArgs:S,compressedProofArgs:Z,payer:t,remainingAccounts:W}));}else L.push(li({secp256r1VerifyArgs:_,settings:g,transactionMessage:J,remainingAccounts:W}));return {instructions:L,addressLookupTableAccounts:f}}function ID(e,n){if(e.version==="legacy")throw new Error("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:new Uint8Array(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 dk({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=ie(s),u=await X(e),A=await xe(u),{packedAccounts:g,proof:p,settingsMutArgs:l}=await ae(i,e,n,false,t),f=[],D=[];for(let x of o)if(x instanceof E){let _=f.length,{domainConfig:W,verifyArgs:U,signature:L,publicKey:J,message:Z}=V(x,_);Z&&L&&J&&f.push({message:Z,signature:L,publicKey:J}),W&&(g.addPreAccounts([{address:W,role:AccountRole.READONLY}]),U?.__option==="Some"&&D.push({domainConfigKey:W,verifyArgs:U.value}));}else g.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:S,systemOffset:I}=g.toAccountMetas(),b=[];if(f.length>0&&b.push(w(f)),i){if(!a||!l)throw new Error("Payer not found or proof args is missing.");let x=v(p,I);b.push(kc({amount:c,settingsMutArgs:l,compressedProofArgs:x,payer:a,secp256r1VerifyArgs:D,source:A,destination:r,remainingAccounts:S}));}else b.push(Uc({amount:c,secp256r1VerifyArgs:D,source:A,destination:r,settings:u,remainingAccounts:S}));return b}async function Sk({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,createAtaIfNeeded:u=true,compressed:A=false}){let g=ie(t),p=await X(e),l=await xe(p),[f,D]=await Promise.all([getAssociatedTokenAccountAddress(s,l,o),getAssociatedTokenAccountAddress(s,r,o)]),{packedAccounts:S,proof:I,settingsMutArgs:b}=await ae(A,e,n,false,c),x=[],_=[];for(let J of g)if(J instanceof E){let Z=x.length,{domainConfig:re,verifyArgs:ue,signature:pe,publicKey:Pe,message:Ie}=V(J,Z);Ie&&pe&&Pe&&x.push({message:Ie,signature:pe,publicKey:Pe}),re&&(S.addPreAccounts([{address:re,role:AccountRole.READONLY}]),ue?.__option==="Some"&&_.push({domainConfigKey:re,verifyArgs:ue.value}));}else S.addPreAccounts([{address:J.address,role:AccountRole.READONLY_SIGNER,signer:J}]);let{remainingAccounts:W,systemOffset:U}=S.toAccountMetas(),L=[];if(x.length>0&&L.push(w(x)),A){if(!i||!b)throw new Error("Payer not found or proof args is missing.");let J=v(I,U);L.push(qc({amount:a,createAtaIfNeeded:u,settingsMutArgs:b,compressedProofArgs:J,payer:i,secp256r1VerifyArgs:_,source:l,sourceTokenAccount:f,destination:r,destinationTokenAccount:D,mint:s,tokenProgram:o,remainingAccounts:W}));}else L.push(Gc({amount:a,createAtaIfNeeded:u,secp256r1VerifyArgs:_,source:l,sourceTokenAccount:f,destination:r,destinationTokenAccount:D,settings:p,mint:s,tokenProgram:o,remainingAccounts:W}));return L}async function vk({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await Us(ne(),s),o=i.data.multiWalletSettings,{packedAccounts:u,proof:A,settingsMutArgs:g}=await ae(c,e,n,false,a),{remainingAccounts:p,systemOffset:l}=u.toAccountMetas(),{domainConfig:f,verifyArgs:D,message:S,signature:I,publicKey:b}=V(r),x=[];if(S&&I&&b&&x.push(w([{message:S,signature:I,publicKey:b}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let _=v(A,l);x.push(ca({transactionBuffer:s,domainConfig:f,closer:r instanceof E?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:D,settingsMutArgs:g,payer:t,compressedProofArgs:_,remainingAccounts:p}));}else x.push(ea({transactionBuffer:s,domainConfig:f,closer:r instanceof E?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:D,remainingAccounts:[]}));return x}function Dd({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:u,expectedSecp256r1Signers:A}){let{domainConfig:g,verifyArgs:p,message:l,signature:f,publicKey:D}=V(n),S=[];if(l&&f&&D&&S.push(w([{message:l,signature:f,publicKey:D}])),u){let{settingsReadonlyArgs:I,compressedProofArgs:b,remainingAccounts:x}=u;S.push(la({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof E?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:A},settingsReadonlyArgs:I,compressedProofArgs:b,remainingAccounts:x}));}else S.push(ga({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof E?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:A},remainingAccounts:[]}));return S}function Cd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=V(e),u=[];return i&&a&&o&&u.push(w([{message:i,signature:a,publicKey:o}])),s?u.push(va({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof E?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(Ma({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof E?void 0:e,remainingAccounts:[]})),u}function Md({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Ga({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Ba({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Ed({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=V(n),u=[];return o&&a&&i&&u.push(w([{message:o,signature:a,publicKey:i}])),s?u.push(ei({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof E?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(qa({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof E?void 0:n,remainingAccounts:[]})),u}async function lN({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:u=false,additionalVoters:A=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:l}){let f=await X(n),D=Math.floor(Math.random()*255),S=await Ki(f,t instanceof E?t:t.address,D),I=[],b=[];for(let Q=0;Q<s.length;Q+=p){let Ln=s.subarray(Q,Q+p);I.push(Ln),b.push(sha256(Ln));}let x=sha256(new Uint8Array(s)),{settingsReadonlyArgs:_,settingsMutArgs:W,proof:U,packedAccounts:L}=await ae(u,n,r,false,l),{remainingAccounts:J,systemOffset:Z}=L.toAccountMetas(),re=U&&_&&W?{settingsReadonlyArgs:_,settingsMutArgs:W,compressedProofArgs:v(U,Z),remainingAccounts:J,payer:e}:null,ue=ie([t,...c?[c]:[],...A]).filter(Q=>Q instanceof E).map(Q=>({memberKey:Je(Q),messageHash:En(Q.authResponse)})),pe=Dd({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:D,payer:e,transactionBufferAddress:S,settings:f,creator:t,preauthorizeExecution:!c,bufferExtendHashes:b,compressedArgs:re,expectedSecp256r1Signers:ue}),Pe=I.map(Q=>Md({transactionMessageBytes:Q,transactionBufferAddress:S,settings:f,compressed:u})),Ie=A.map(Q=>Ed({voter:Q,transactionBufferAddress:S,settings:f,compressedArgs:re})),Ut=Cd({compressedArgs:re,settings:f,executor:c,transactionBufferAddress:S}),{instructions:Rd,addressLookupTableAccounts:bd}=await fd({compressed:u,settings:f,transactionMessageBytes:s,transactionBufferAddress:S,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),T=Q=>({payer:e,instructions:Q,addressesByLookupTableAddress:bd});return [T(pe),...Pe.map(Q=>T([Q])),...Ie.length?[T(Ie.flat())]:[],T(Ut),T(Rd)]}var dr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=a=>{let i=s.get(a);return i===void 0&&(i={isSigner:false,isWritable:false,isInvoked:false},s.set(a,i)),i},c=t(r);c.isSigner=true,c.isWritable=true;for(let a of n){t(a.programAddress).isInvoked=false;for(let i of a.accounts??[]){let o=t(i.address);o.isSigner||=i.role===AccountRole.READONLY_SIGNER||i.role===AccountRole.WRITABLE_SIGNER,o.isWritable||=i.role===AccountRole.WRITABLE||i.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(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),a={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let i=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [a,i]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&a.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&!a.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,a]of this.keyMetaMap.entries())if(r(a)){let i=c,o=n.findIndex(u=>u===i);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(i),this.keyMetaMap.delete(c);}}return [s,t]}};var ur=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((c,a)=>{s.set(c,a);});let t=c=>{let a=s.get(c);if(a===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return a};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(a=>t(a.address))??[],data:c.data}))}};function hd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=dr.compile(r,e),c=new Array,a={writable:[],readonly:[]},i=Object.entries(s??{});for(let p of i){let l=t.extractTableLookup(p);if(l!==void 0){let{addressTableLookup:f,drainedKeys:D}=l;c.push({readonlyIndexes:f.readonlyIndexes,readableIndices:f.readonlyIndexes,writableIndexes:f.writableIndexes,writableIndices:f.writableIndexes,lookupTableAddress:address(f.lookupTableAddress)}),a.writable.push(...D.writable),a.readonly.push(...D.readonly);}}let[o,u]=t.getMessageComponents(),g=new ur(u,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:u,addressTableLookups:c}}function _N({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=hd({instructions:e,payer:n,recentBlockhash:d,addressesByLookupTableAddress:r});return Ri(s)}async function BN({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:u=false}){let{instructions:A,addressLookupTableAccounts:g}=await ld({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:i});return {payer:e,instructions:A,addressesByLookupTableAddress:g}}
|
|
2
|
-
export{Gs as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,no as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,Ys as CHANGE_CONFIG_DISCRIMINATOR,uo as COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Io as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Eo as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,bo as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Lo as CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR,ko as CREATE_USER_ACCOUNTS_DISCRIMINATOR,Fo as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Zo as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,On as DOMAIN_CONFIG_DISCRIMINATOR,rc as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,ac as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,yc as EDIT_USER_DELEGATE_DISCRIMINATOR,Hn as GLOBAL_COUNTER_DISCRIMINATOR,bt as KeyType,Sc as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,Ec as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,Ax as MULTI_WALLET_ERROR__ALREADY_DELEGATED,GS as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,_x as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,Ux as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,KS as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,zS as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,tx as MULTI_WALLET_ERROR__EMPTY_MEMBERS,$S as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,FS as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,XS as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,xx as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,Ix as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,Dx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,mx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,gx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,yx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,cx as MULTI_WALLET_ERROR__INVALID_ACCOUNT,Ox as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,ex as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,ix as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,Sx as MULTI_WALLET_ERROR__INVALID_BUFFER,px as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,ox as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,qS as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,BS as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,NS as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,OS as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,kS as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,vx as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,Rx as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,nx as MULTI_WALLET_ERROR__INVALID_THRESHOLD,QS as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,YS as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,sx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,ax as MULTI_WALLET_ERROR__INVALID_USER_ROLE,VS as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,Px as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,Wx as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,dx as MULTI_WALLET_ERROR__MISSING_ACCOUNT,ux as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,hx as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,fx as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,jS as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,ZS as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,Lx as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,JS as MULTI_WALLET_ERROR__PERMANENT_MEMBER,Ex as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,HS as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,wS as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,bx as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,rx as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,Cx as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,Mx as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,lx as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,Tx as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,d as MULTI_WALLET_PROGRAM_ADDRESS,US as MultiWalletAccount,WS as MultiWalletInstruction,Oc as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,vc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Se as Permission,De as Permissions,Ds as SETTINGS_DISCRIMINATOR,Ce as Secp256r1Key,E as SignedSecp256r1Key,Jc as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Vc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,na as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,Xc as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,pa as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,da as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,bs as TRANSACTION_BUFFER_DISCRIMINATOR,ha as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Ia as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Na as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Wa as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Xa as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Ka as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,di as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,ni as TRANSACTION_EXECUTE_DISCRIMINATOR,Ii as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,pi as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Ve as UserRole,Os as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,JO as addWhitelistedAddressTrees,Ee as base64URLStringToBuffer,FL as bufferToBase64URLString,LO as changeConfig,vk as closeTransactionBuffer,FO as compressSettingsAccount,gC as configAction,sd as convertMemberKeyToString,BL as convertPubkeyCompressedToCose,OL as convertPubkeyCoseToCompressed,VL as createClientAuthorizationCompleteRequestChallenge,NL as createClientAuthorizationStartRequestChallenge,$O as createDomainConfig,dB as createDomainUserAccounts,yB as createGlobalCounter,HL as createMessageChallenge,Dd as createTransactionBuffer,GL as createTransactionChallenge,YI as createTransactionManagerSigner,xB as createUserAccounts,Pw as createWallet,wn as decodeDomainConfig,Fn as decodeGlobalCounter,Ms as decodeSettings,_s as decodeTransactionBuffer,ws as decodeWhitelistedAddressTree,Ow as decompressSettingsAccount,MB as disableDomainConfig,_B as editDomainConfig,wB as editTransactionManagerUrl,jB as editUserDelegate,fd as executeTransaction,Cd as executeTransactionBuffer,ld as executeTransactionSync,Md as extendTransactionBuffer,hD as fetchAllDomainConfig,LD as fetchAllGlobalCounter,Fd as fetchAllMaybeDomainConfig,ou as fetchAllMaybeGlobalCounter,my as fetchAllMaybeSettings,By as fetchAllMaybeTransactionBuffer,rm as fetchAllMaybeWhitelistedAddressTree,eP as fetchAllSettings,aP as fetchAllTransactionBuffer,gP as fetchAllWhitelistedAddressTree,Li as fetchCompressedAccount,kn as fetchDomainConfig,WD as fetchGlobalCounter,Gd as fetchMaybeDomainConfig,su as fetchMaybeGlobalCounter,zr as fetchMaybeSettings,uI as fetchMaybeSettingsAccountData,Oy as fetchMaybeTransactionBuffer,dI as fetchMaybeUserAccountData,tm as fetchMaybeWhitelistedAddressTree,$E as fetchSettings,Dn as fetchSettingsAccountData,Us as fetchTransactionBuffer,rr as fetchUserAccountData,ks as fetchWhitelistedAddressTree,ND as getAddMemberArgsCodec,gr as getAddMemberArgsDecoder,Ar as getAddMemberArgsEncoder,bP as getAddWhitelistedAddressTreesDiscriminatorBytes,_P as getAddWhitelistedAddressTreesInstruction,zs as getAddWhitelistedAddressTreesInstructionAsync,vP as getAddWhitelistedAddressTreesInstructionDataCodec,Fs as getAddWhitelistedAddressTreesInstructionDataDecoder,Qr as getAddWhitelistedAddressTreesInstructionDataEncoder,ZP as getChangeConfigCompressedDiscriminatorBytes,co as getChangeConfigCompressedInstruction,YP as getChangeConfigCompressedInstructionDataCodec,oo as getChangeConfigCompressedInstructionDataDecoder,so as getChangeConfigCompressedInstructionDataEncoder,NP as getChangeConfigDiscriminatorBytes,HP as getChangeConfigInstruction,Qs as getChangeConfigInstructionAsync,VP as getChangeConfigInstructionDataCodec,Xs as getChangeConfigInstructionDataDecoder,$r as getChangeConfigInstructionDataEncoder,Mn as getClientAndDeviceHash,GD as getCompiledInstructionCodec,mr as getCompiledInstructionDecoder,yr as getCompiledInstructionEncoder,sh as getCompressSettingsAccountDiscriminatorBytes,yo as getCompressSettingsAccountInstruction,oh as getCompressSettingsAccountInstructionDataCodec,go as getCompressSettingsAccountInstructionDataDecoder,Ao as getCompressSettingsAccountInstructionDataEncoder,JD as getCompressedAccountMetaCodec,Qe as getCompressedAccountMetaDecoder,Xe as getCompressedAccountMetaEncoder,YD as getCompressedAccountMetaReadOnlyCodec,rt as getCompressedAccountMetaReadOnlyDecoder,tt as getCompressedAccountMetaReadOnlyEncoder,$D as getCompressedProofCodec,xr as getCompressedProofDecoder,Sr as getCompressedProofEncoder,se as getCompressedSettingsAddressFromIndex,nC as getCompressedSettingsCodec,aC as getCompressedSettingsDataCodec,ot as getCompressedSettingsDataDecoder,st as getCompressedSettingsDataEncoder,te as getCompressedSettingsDecoder,nt as getCompressedSettingsEncoder,_i as getComputeBudgetEstimate,AC as getConfigActionCodec,dt as getConfigActionDecoder,it as getConfigActionEncoder,yh as getCreateDomainConfigDiscriminatorBytes,ph as getCreateDomainConfigInstruction,Co as getCreateDomainConfigInstructionAsync,mh as getCreateDomainConfigInstructionDataCodec,Do as getCreateDomainConfigInstructionDataDecoder,tn as getCreateDomainConfigInstructionDataEncoder,Ch as getCreateDomainUserAccountDiscriminatorBytes,Eh as getCreateDomainUserAccountInstruction,ho as getCreateDomainUserAccountInstructionAsync,Mh as getCreateDomainUserAccountInstructionDataCodec,Po as getCreateDomainUserAccountInstructionDataDecoder,nn as getCreateDomainUserAccountInstructionDataEncoder,Uh as getCreateGlobalCounterDiscriminatorBytes,Lh as getCreateGlobalCounterInstruction,_o as getCreateGlobalCounterInstructionAsync,Wh as getCreateGlobalCounterInstructionDataCodec,vo as getCreateGlobalCounterInstructionDataDecoder,on as getCreateGlobalCounterInstructionDataEncoder,Gh as getCreateMultiWalletCompressedDiscriminatorBytes,zh as getCreateMultiWalletCompressedInstruction,Bo as getCreateMultiWalletCompressedInstructionAsync,Fh as getCreateMultiWalletCompressedInstructionDataCodec,Oo as getCreateMultiWalletCompressedInstructionDataDecoder,cn as getCreateMultiWalletCompressedInstructionDataEncoder,fC as getCreateUserAccountArgsCodec,Rr as getCreateUserAccountArgsDecoder,hr as getCreateUserAccountArgsEncoder,Qh as getCreateUserAccountsDiscriminatorBytes,eR as getCreateUserAccountsInstruction,Vo as getCreateUserAccountsInstructionAsync,$h as getCreateUserAccountsInstructionDataCodec,No as getCreateUserAccountsInstructionDataDecoder,dn as getCreateUserAccountsInstructionDataEncoder,iR as getDecompressSettingsAccountDiscriminatorBytes,Jo as getDecompressSettingsAccountInstruction,dR as getDecompressSettingsAccountInstructionDataCodec,Ko as getDecompressSettingsAccountInstructionDataDecoder,zo as getDecompressSettingsAccountInstructionDataEncoder,TR as getDisableDomainConfigDiscriminatorBytes,Qo as getDisableDomainConfigInstruction,fR as getDisableDomainConfigInstructionDataCodec,Xo as getDisableDomainConfigInstructionDataDecoder,Yo as getDisableDomainConfigInstructionDataEncoder,ze as getDomainConfigAddress,PD as getDomainConfigCodec,Bn as getDomainConfigDecoder,ED as getDomainConfigDiscriminatorBytes,Hd as getDomainConfigEncoder,RD as getDomainConfigSize,ER as getEditDomainConfigDiscriminatorBytes,sc as getEditDomainConfigInstruction,hR as getEditDomainConfigInstructionAsync,PR as getEditDomainConfigInstructionDataCodec,nc as getEditDomainConfigInstructionDataDecoder,An as getEditDomainConfigInstructionDataEncoder,IC as getEditMemberArgsCodec,Mr as getEditMemberArgsDecoder,Cr as getEditMemberArgsEncoder,OR as getEditTransactionManagerUrlDiscriminatorBytes,uc as getEditTransactionManagerUrlInstruction,BR as getEditTransactionManagerUrlInstructionDataCodec,dc as getEditTransactionManagerUrlInstructionDataDecoder,ic as getEditTransactionManagerUrlInstructionDataEncoder,zR as getEditUserDelegateDiscriminatorBytes,Tc as getEditUserDelegateInstruction,KR as getEditUserDelegateInstructionDataCodec,pc as getEditUserDelegateInstructionDataDecoder,mc as getEditUserDelegateInstructionDataEncoder,EC as getExpectedSecp256r1SignersCodec,At as getExpectedSecp256r1SignersDecoder,ut as getExpectedSecp256r1SignersEncoder,zi as getGlobalCounterAddress,UD as getGlobalCounterCodec,Gn as getGlobalCounterDecoder,_D as getGlobalCounterDiscriminatorBytes,nu as getGlobalCounterEncoder,OD as getGlobalCounterSize,xn as getJitoTipsConfig,lL as getLightCpiSigner,Be as getLightProtocolRpc,bC as getLinkWalletArgsCodec,vr as getLinkWalletArgsDecoder,br as getLinkWalletArgsEncoder,WC as getMemberCodec,at as getMemberDecoder,ct as getMemberEncoder,BC as getMemberKeyCodec,ee as getMemberKeyDecoder,$ as getMemberKeyEncoder,$R as getMigrateCompressedSettingsDiscriminatorBytes,Dc as getMigrateCompressedSettingsInstruction,eb as getMigrateCompressedSettingsInstructionDataCodec,Ic as getMigrateCompressedSettingsInstructionDataDecoder,xc as getMigrateCompressedSettingsInstructionDataEncoder,ib as getMigrateCompressedUsersDiscriminatorBytes,Rc as getMigrateCompressedUsersInstruction,db as getMigrateCompressedUsersInstructionDataCodec,hc as getMigrateCompressedUsersInstructionDataDecoder,Pc as getMigrateCompressedUsersInstructionDataEncoder,tW as getMultiWalletErrorMessage,hb as getNativeTransferIntentCompressedDiscriminatorBytes,kc as getNativeTransferIntentCompressedInstruction,Rb as getNativeTransferIntentCompressedInstructionDataCodec,wc as getNativeTransferIntentCompressedInstructionDataDecoder,Bc as getNativeTransferIntentCompressedInstructionDataEncoder,fb as getNativeTransferIntentDiscriminatorBytes,Uc as getNativeTransferIntentInstruction,Sb as getNativeTransferIntentInstructionAsync,lb as getNativeTransferIntentInstructionDataCodec,_c as getNativeTransferIntentInstructionDataDecoder,gn as getNativeTransferIntentInstructionDataEncoder,VC as getNewAuthorityArgsCodec,Lr as getNewAuthorityArgsDecoder,Wr as getNewAuthorityArgsEncoder,kL as getOriginIndex,FC as getPackedAddressTreeInfoCodec,yt as getPackedAddressTreeInfoDecoder,gt as getPackedAddressTreeInfoEncoder,JC as getPackedStateTreeInfoCodec,et as getPackedStateTreeInfoDecoder,$e as getPackedStateTreeInfoEncoder,ZC as getPermissionsCodec,Re as getPermissionsDecoder,he as getPermissionsEncoder,$C as getProofArgsCodec,M as getProofArgsDecoder,C as getProofArgsEncoder,nM as getRemoveMemberArgsCodec,Pr as getRemoveMemberArgsDecoder,Er as getRemoveMemberArgsEncoder,En as getSecp256r1MessageHash,cM as getSecp256r1PubkeyCodec,mt as getSecp256r1PubkeyDecoder,wr as getSecp256r1PubkeyEncoder,cD as getSecp256r1SignatureOffsetsDataDecoder,oD as getSecp256r1SignatureOffsetsDataEncoder,dM as getSecp256r1VerifyArgsCodec,G as getSecp256r1VerifyArgsDecoder,H as getSecp256r1VerifyArgsEncoder,yM as getSecp256r1VerifyArgsWithDomainAddressCodec,z as getSecp256r1VerifyArgsWithDomainAddressDecoder,F as getSecp256r1VerifyArgsWithDomainAddressEncoder,w as getSecp256r1VerifyInstruction,IO as getSecp256r1VerifyInstructionDataCodec,id as getSecp256r1VerifyInstructionDataDecoder,dd as getSecp256r1VerifyInstructionDataEncoder,vi as getSendAndConfirmTransaction,QE as getSettingsCodec,fM as getSettingsCreationArgsCodec,Tt as getSettingsCreationArgsDecoder,pt as getSettingsCreationArgsEncoder,Cs as getSettingsDecoder,XE as getSettingsDiscriminatorBytes,yy as getSettingsEncoder,X as getSettingsFromIndex,xM as getSettingsIndexWithAddressCodec,lt as getSettingsIndexWithAddressDecoder,ft as getSettingsIndexWithAddressEncoder,MM as getSettingsMutArgsCodec,N as getSettingsMutArgsDecoder,k as getSettingsMutArgsEncoder,RM as getSettingsReadonlyArgsCodec,xt as getSettingsReadonlyArgsDecoder,St as getSettingsReadonlyArgsEncoder,tP as getSettingsSize,wL as getSignedSecp256r1Key,uO as getSignedTransactionManager,ne as getSolanaRpc,Ge as getSolanaRpcEndpoint,Jb as getTokenTransferIntentCompressedDiscriminatorBytes,qc as getTokenTransferIntentCompressedInstruction,qb as getTokenTransferIntentCompressedInstructionAsync,jb as getTokenTransferIntentCompressedInstructionDataCodec,jc as getTokenTransferIntentCompressedInstructionDataDecoder,pn as getTokenTransferIntentCompressedInstructionDataEncoder,Bb as getTokenTransferIntentDiscriminatorBytes,Gc as getTokenTransferIntentInstruction,kb as getTokenTransferIntentInstructionAsync,wb as getTokenTransferIntentInstructionDataCodec,Hc as getTokenTransferIntentInstructionDataDecoder,mn as getTokenTransferIntentInstructionDataEncoder,Ki as getTransactionBufferAddress,Av as getTransactionBufferCloseCompressedDiscriminatorBytes,ca as getTransactionBufferCloseCompressedInstruction,gv as getTransactionBufferCloseCompressedInstructionDataCodec,oa as getTransactionBufferCloseCompressedInstructionDataDecoder,sa as getTransactionBufferCloseCompressedInstructionDataEncoder,rv as getTransactionBufferCloseDiscriminatorBytes,ea as getTransactionBufferCloseInstruction,nv as getTransactionBufferCloseInstructionDataCodec,$c as getTransactionBufferCloseInstructionDataDecoder,Qc as getTransactionBufferCloseInstructionDataEncoder,cP as getTransactionBufferCodec,UM as getTransactionBufferCreateArgsCodec,Dt as getTransactionBufferCreateArgsDecoder,It as getTransactionBufferCreateArgsEncoder,bv as getTransactionBufferCreateCompressedDiscriminatorBytes,la as getTransactionBufferCreateCompressedInstruction,vv as getTransactionBufferCreateCompressedInstructionDataCodec,fa as getTransactionBufferCreateCompressedInstructionDataDecoder,Ta as getTransactionBufferCreateCompressedInstructionDataEncoder,xv as getTransactionBufferCreateDiscriminatorBytes,ga as getTransactionBufferCreateInstruction,Iv as getTransactionBufferCreateInstructionDataCodec,Aa as getTransactionBufferCreateInstructionDataDecoder,ua as getTransactionBufferCreateInstructionDataEncoder,vs as getTransactionBufferDecoder,oP as getTransactionBufferDiscriminatorBytes,Ly as getTransactionBufferEncoder,jv as getTransactionBufferExecuteCompressedDiscriminatorBytes,va as getTransactionBufferExecuteCompressedInstruction,qv as getTransactionBufferExecuteCompressedInstructionDataCodec,ba as getTransactionBufferExecuteCompressedInstructionDataDecoder,Ra as getTransactionBufferExecuteCompressedInstructionDataEncoder,kv as getTransactionBufferExecuteDiscriminatorBytes,Ma as getTransactionBufferExecuteInstruction,Nv as getTransactionBufferExecuteInstructionDataCodec,Ca as getTransactionBufferExecuteInstructionDataDecoder,Da as getTransactionBufferExecuteInstructionDataEncoder,d_ as getTransactionBufferExtendCompressedDiscriminatorBytes,Ga as getTransactionBufferExtendCompressedInstruction,u_ as getTransactionBufferExtendCompressedInstructionDataCodec,Ha as getTransactionBufferExtendCompressedInstructionDataDecoder,Va as getTransactionBufferExtendCompressedInstructionDataEncoder,t_ as getTransactionBufferExtendDiscriminatorBytes,Ba as getTransactionBufferExtendInstruction,r_ as getTransactionBufferExtendInstructionDataCodec,Oa as getTransactionBufferExtendInstructionDataDecoder,La as getTransactionBufferExtendInstructionDataEncoder,h_ as getTransactionBufferVoteCompressedDiscriminatorBytes,ei as getTransactionBufferVoteCompressedInstruction,R_ as getTransactionBufferVoteCompressedInstructionDataCodec,$a as getTransactionBufferVoteCompressedInstructionDataDecoder,Qa as getTransactionBufferVoteCompressedInstructionDataEncoder,l_ as getTransactionBufferVoteDiscriminatorBytes,qa as getTransactionBufferVoteInstruction,S_ as getTransactionBufferVoteInstructionDataCodec,ja as getTransactionBufferVoteInstructionDataDecoder,Ja as getTransactionBufferVoteInstructionDataEncoder,F_ as getTransactionExecuteCompressedDiscriminatorBytes,gi as getTransactionExecuteCompressedInstruction,z_ as getTransactionExecuteCompressedInstructionDataCodec,Ai as getTransactionExecuteCompressedInstructionDataDecoder,ui as getTransactionExecuteCompressedInstructionDataEncoder,O_ as getTransactionExecuteDiscriminatorBytes,ci as getTransactionExecuteInstruction,B_ as getTransactionExecuteInstructionDataCodec,oi as getTransactionExecuteInstructionDataDecoder,si as getTransactionExecuteInstructionDataEncoder,aU as getTransactionExecuteSyncCompressedDiscriminatorBytes,Mi as getTransactionExecuteSyncCompressedInstruction,iU as getTransactionExecuteSyncCompressedInstructionDataCodec,Ci as getTransactionExecuteSyncCompressedInstructionDataDecoder,Di as getTransactionExecuteSyncCompressedInstructionDataEncoder,Q_ as getTransactionExecuteSyncDiscriminatorBytes,li as getTransactionExecuteSyncInstruction,$_ as getTransactionExecuteSyncInstructionDataCodec,fi as getTransactionExecuteSyncInstructionDataDecoder,Ti as getTransactionExecuteSyncInstructionDataEncoder,NM as getTransactionMessageAddressTableLookupCodec,Nr as getTransactionMessageAddressTableLookupDecoder,kr as getTransactionMessageAddressTableLookupEncoder,BM as getTransactionMessageCodec,Mt as getTransactionMessageDecoder,Ct as getTransactionMessageEncoder,B as getUserAccountAddress,FM as getUserCodec,jM as getUserCreationArgsCodec,ye as getUserCreationArgsDecoder,ge as getUserCreationArgsEncoder,Y as getUserDecoder,We as getUserEncoder,XM as getUserMutArgsCodec,le as getUserMutArgsDecoder,fe as getUserMutArgsEncoder,tE as getUserReadOnlyArgsCodec,ve as getUserReadOnlyArgsDecoder,be as getUserReadOnlyArgsEncoder,oE as getUserReadOnlyOrMutateArgsCodec,Br as getUserReadOnlyOrMutateArgsDecoder,Or as getUserReadOnlyOrMutateArgsEncoder,uE as getUserRoleCodec,Ue as getUserRoleDecoder,_e as getUserRoleEncoder,fL as getWalletAddressFromIndex,xe as getWalletAddressFromSettings,AP as getWhitelistedAddressTreeCodec,Bs as getWhitelistedAddressTreeDecoder,uP as getWhitelistedAddressTreeDiscriminatorBytes,em as getWhitelistedAddressTreeEncoder,Cn as getWhitelistedAddressTreeFromIndex,iL as getWhitelistedAddressTreeIndexFromAddress,Oi as getWhitelistedAddressTreesAddress,qU as identifyMultiWalletAccount,ZU as identifyMultiWalletInstruction,OW as initialize,yC as isConfigAction,rW as isMultiWalletError,aE as isUserReadOnlyOrMutateArgs,ew as migrateSettings,aw as migrateUsers,dk as nativeTransferIntent,UP as parseAddWhitelistedAddressTreesInstruction,XP as parseChangeConfigCompressedInstruction,GP as parseChangeConfigInstruction,ch as parseCompressSettingsAccountInstruction,Th as parseCreateDomainConfigInstruction,Ph as parseCreateDomainUserAccountInstruction,Oh as parseCreateGlobalCounterInstruction,Kh as parseCreateMultiWalletCompressedInstruction,tR as parseCreateUserAccountsInstruction,uR as parseDecompressSettingsAccountInstruction,lR as parseDisableDomainConfigInstruction,RR as parseEditDomainConfigInstruction,wR as parseEditTransactionManagerUrlInstruction,JR as parseEditUserDelegateInstruction,tb as parseMigrateCompressedSettingsInstruction,ub as parseMigrateCompressedUsersInstruction,bb as parseNativeTransferIntentCompressedInstruction,xb as parseNativeTransferIntentInstruction,DO as parseSecp256r1VerifyInstruction,Zb as parseTokenTransferIntentCompressedInstruction,Nb as parseTokenTransferIntentInstruction,yv as parseTransactionBufferCloseCompressedInstruction,sv as parseTransactionBufferCloseInstruction,_v as parseTransactionBufferCreateCompressedInstruction,Dv as parseTransactionBufferCreateInstruction,Zv as parseTransactionBufferExecuteCompressedInstruction,Vv as parseTransactionBufferExecuteInstruction,A_ as parseTransactionBufferExtendCompressedInstruction,n_ as parseTransactionBufferExtendInstruction,b_ as parseTransactionBufferVoteCompressedInstruction,x_ as parseTransactionBufferVoteInstruction,K_ as parseTransactionExecuteCompressedInstruction,w_ as parseTransactionExecuteInstruction,dU as parseTransactionExecuteSyncCompressedInstruction,eU as parseTransactionExecuteSyncInstruction,iO as pollJitoBundleConfirmation,lN as prepareTransactionBundle,_N as prepareTransactionMessage,BN as prepareTransactionSync,dO as retrieveTransactionManager,ZI as sendJitoBundle,cO as signAndSendBundledTransactions,aO as signAndSendTransaction,Sk as tokenTransferIntent,LW as uninitialize,cE as userReadOnlyOrMutateArgs,bi as vaultTransactionMessageDeserialize,Ri as vaultTransactionMessageSerialize,Ed as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
1
|
+
import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,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,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,getBase64Decoder,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,getBlockhashDecoder,compileTransaction,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {VERSION,featureFlags,createRpc,rpcRequest,versionedEndpoint,encodeBN254toBase58,jsonRpcResultAndContext,CompressedAccountResultV2,CompressedAccountResult,localTestActiveStateTreeInfos,getStateTreeInfoByPubkey,createCompressedAccountWithMerkleContextLegacy,createMerkleContextLegacy,bn,parseAccountData,deriveAddressSeedV2,createBN254,deriveAddressV2,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {SolanaJSONRPCError,PublicKey}from'@solana/web3.js';import {create,nullable}from'superstruct';import {estimateComputeUnitLimitFactory,getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTransferSolInstruction}from'gill/programs';import Md from'bn.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {p256}from'@noble/curves/nist.js';var On=new Uint8Array([201,232,212,229,59,241,106,197]);function hC(){return fixEncoderSize(getBytesEncoder(),8).encode(On)}function Hd(){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:On}))}function Bn(){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 RC(){return combineCodec(Hd(),Bn())}function wn(e){return decodeAccount(e,Bn())}async function kn(e,n,r){let s=await Gd(e,n,r);return assertAccountExists(s),s}async function Gd(e,n,r){let s=await fetchEncodedAccount(e,n,r);return wn(s)}async function bC(e,n,r){let s=await Fd(e,n,r);return assertAccountsExist(s),s}async function Fd(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>wn(t))}function vC(){return 846}var Hn=new Uint8Array([42,206,176,58,175,129,130,233]);function WC(){return fixEncoderSize(getBytesEncoder(),8).encode(Hn)}function nu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Hn}))}function Gn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function LC(){return combineCodec(nu(),Gn())}function Fn(e){return decodeAccount(e,Gn())}async function OC(e,n,r){let s=await su(e,n,r);return assertAccountExists(s),s}async function su(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Fn(s)}async function BC(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=>Fn(t))}function wC(){return 24}function Ar(){return getStructEncoder([["memberKey",Q()],["permissions",he()],["userReadonlyArgs",be()]])}function gr(){return getStructDecoder([["memberKey",$()],["permissions",Re()],["userReadonlyArgs",ve()]])}function HC(){return combineCodec(Ar(),gr())}function yr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function mr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function zC(){return combineCodec(yr(),mr())}function $e(){return getStructEncoder([["treeInfo",tt()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function et(){return getStructDecoder([["treeInfo",rt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function qC(){return combineCodec($e(),et())}function nt(){return getStructEncoder([["treeInfo",tt()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function st(){return getStructDecoder([["treeInfo",rt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function QC(){return combineCodec(nt(),st())}function Sr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function xr(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function tD(){return combineCodec(Sr(),xr())}function ot(){return getStructEncoder([["data",getOptionEncoder(ct())]])}function ee(){return getStructDecoder([["data",getOptionDecoder(at())]])}function oD(){return combineCodec(ot(),ee())}function ct(){return getStructEncoder([["threshold",getU8Encoder()],["bump",getU8Encoder()],["index",getU128Encoder()],["multiWalletBump",getU8Encoder()],["members",getArrayEncoder(it())],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function at(){return getStructDecoder([["threshold",getU8Decoder()],["bump",getU8Decoder()],["index",getU128Decoder()],["multiWalletBump",getU8Decoder()],["members",getArrayDecoder(dt())],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function dD(){return combineCodec(ct(),at())}function _e(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Dr())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Ar())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Er())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Ue(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Mr())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(gr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Pr())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function yD(){return combineCodec(_e(),Ue())}function mD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function pD(e,n){return n.__kind===e}function hr(){return getStructEncoder([["member",getAddressEncoder()],["role",We()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Ae()]])}function Rr(){return getStructDecoder([["member",getAddressDecoder()],["role",Le()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",ge()]])}function SD(){return combineCodec(hr(),Rr())}function Dr(){return getStructEncoder([["memberKey",Q()],["permissions",he()]])}function Mr(){return getStructDecoder([["memberKey",$()],["permissions",Re()]])}function DD(){return combineCodec(Dr(),Mr())}function ut(){return getStructEncoder([["memberKey",Q()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function At(){return getStructDecoder([["memberKey",$()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function hD(){return combineCodec(ut(),At())}function br(){return getStructEncoder([["settingsMutArgs",w()],["transactionManager",getOptionEncoder(Te())]])}function vr(){return getStructDecoder([["settingsMutArgs",k()],["transactionManager",getOptionDecoder(fe())]])}function _D(){return combineCodec(br(),vr())}function it(){return getStructEncoder([["pubkey",Q()],["permissions",he()],["role",getU8Encoder()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function dt(){return getStructDecoder([["pubkey",$()],["permissions",Re()],["role",getU8Decoder()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function OD(){return combineCodec(it(),dt())}function Q(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function $(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function kD(){return combineCodec(Q(),$())}function Wr(){return getStructEncoder([["authorityCreationArgs",Ae()],["compressedProofArgs",D()]])}function Lr(){return getStructDecoder([["authorityCreationArgs",ge()],["compressedProofArgs",M()]])}function GD(){return combineCodec(Wr(),Lr())}function gt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function yt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function KD(){return combineCodec(gt(),yt())}function tt(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function rt(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function qD(){return combineCodec(tt(),rt())}function he(){return getStructEncoder([["mask",getU8Encoder()]])}function Re(){return getStructDecoder([["mask",getU8Decoder()]])}function XD(){return combineCodec(he(),Re())}function D(){return getStructEncoder([["proof",getOptionEncoder(Sr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function M(){return getStructDecoder([["proof",getOptionDecoder(xr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function tM(){return combineCodec(D(),M())}function Er(){return getStructEncoder([["memberKey",Q()],["userArgs",Or()]])}function Pr(){return getStructDecoder([["memberKey",$()],["userArgs",Br()]])}function oM(){return combineCodec(Er(),Pr())}function wr(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function mt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function iM(){return combineCodec(wr(),mt())}function V(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function H(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function AM(){return combineCodec(V(),H())}function G(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",V()]])}function F(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",H()]])}function pM(){return combineCodec(G(),F())}function pt(){return getStructEncoder([["addressTreeInfo",gt()],["outputStateTreeIndex",getU8Encoder()]])}function Tt(){return getStructDecoder([["addressTreeInfo",yt()],["outputStateTreeIndex",getU8Decoder()]])}function SM(){return combineCodec(pt(),Tt())}function ft(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function lt(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function CM(){return combineCodec(ft(),lt())}function w(){return getStructEncoder([["accountMeta",$e()],["data",ot()]])}function k(){return getStructDecoder([["accountMeta",et()],["data",ee()]])}function PM(){return combineCodec(w(),k())}function St(){return getStructEncoder([["accountMeta",nt()],["data",ot()]])}function xt(){return getStructDecoder([["accountMeta",st()],["data",ee()]])}function vM(){return combineCodec(St(),xt())}function It(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getOptionEncoder(getArrayEncoder(ut()))]])}function Ct(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(At()))]])}function LM(){return combineCodec(It(),Ct())}function Dt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(yr())],["addressTableLookups",getArrayEncoder(kr())]])}function Mt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(mr())],["addressTableLookups",getArrayDecoder(Nr())]])}function kM(){return combineCodec(Dt(),Mt())}function kr(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Nr(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function HM(){return combineCodec(kr(),Nr())}function Oe(){return getStructEncoder([["member",Q()],["domainConfig",getOptionEncoder(getAddressEncoder())],["role",We()],["delegatedTo",getOptionEncoder(ft())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function Z(){return getStructDecoder([["member",$()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",Le()],["delegatedTo",getOptionDecoder(lt())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function KM(){return combineCodec(Oe(),Z())}function Ae(){return getStructEncoder([["addressTreeInfo",gt()],["outputStateTreeIndex",getU8Encoder()]])}function ge(){return getStructDecoder([["addressTreeInfo",yt()],["outputStateTreeIndex",getU8Decoder()]])}function ZM(){return combineCodec(Ae(),ge())}function Te(){return getStructEncoder([["accountMeta",$e()],["data",Oe()]])}function fe(){return getStructDecoder([["accountMeta",et()],["data",Z()]])}function $M(){return combineCodec(Te(),fe())}function be(){return getStructEncoder([["accountMeta",nt()],["data",Oe()]])}function ve(){return getStructDecoder([["accountMeta",st()],["data",Z()]])}function nE(){return combineCodec(be(),ve())}function Or(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([be()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([Te()])]])]])}function Br(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([ve()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([fe()])]])]])}function aE(){return combineCodec(Or(),Br())}function iE(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function dE(e,n){return n.__kind===e}var Ge=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(Ge||{});function We(){return getEnumEncoder(Ge)}function Le(){return getEnumDecoder(Ge)}function gE(){return combineCodec(We(),Le())}var Cs=new Uint8Array([223,179,163,190,177,224,67,173]);function $E(){return fixEncoderSize(getBytesEncoder(),8).encode(Cs)}function yy(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",fixEncoderSize(getBytesEncoder(),16)],["members",getArrayEncoder(it(),{size:4})],["membersLen",getU8Encoder()],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["padding",fixEncoderSize(getBytesEncoder(),3)],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:Cs}))}function Ds(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",fixDecoderSize(getBytesDecoder(),16)],["members",getArrayDecoder(dt(),{size:4})],["membersLen",getU8Decoder()],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["padding",fixDecoderSize(getBytesDecoder(),3)],["latestSlotNumber",getU64Decoder()]])}function eP(){return combineCodec(yy(),Ds())}function Ms(e){return decodeAccount(e,Ds())}async function tP(e,n,r){let s=await zr(e,n,r);return assertAccountExists(s),s}async function zr(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Ms(s)}async function rP(e,n,r){let s=await my(e,n,r);return assertAccountsExist(s),s}async function my(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ms(t))}function nP(){return 192}var bs=new Uint8Array([90,36,35,219,93,225,110,96]);function aP(){return fixEncoderSize(getBytesEncoder(),8).encode(bs)}function Ly(){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",Q()],["executor",Q()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(Q())],["expectedSecp256r1Signers",getOptionEncoder(getArrayEncoder(ut()))],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:bs}))}function vs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multiWalletSettings",getAddressDecoder()],["multiWalletBump",getU8Decoder()],["canExecute",getBooleanDecoder()],["preauthorizeExecution",getBooleanDecoder()],["validTill",getU64Decoder()],["payer",getAddressDecoder()],["bump",getU8Decoder()],["bufferIndex",getU8Decoder()],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["creator",$()],["executor",$()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder($())],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(At()))],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function iP(){return combineCodec(Ly(),vs())}function _s(e){return decodeAccount(e,vs())}async function Us(e,n,r){let s=await Oy(e,n,r);return assertAccountExists(s),s}async function Oy(e,n,r){let s=await fetchEncodedAccount(e,n,r);return _s(s)}async function dP(e,n,r){let s=await By(e,n,r);return assertAccountsExist(s),s}async function By(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>_s(t))}var Os=new Uint8Array([105,23,173,2,197,255,80,87]);function gP(){return fixEncoderSize(getBytesEncoder(),8).encode(Os)}function em(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Os}))}function Bs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function yP(){return combineCodec(em(),Bs())}function ws(e){return decodeAccount(e,Bs())}async function ks(e,n,r){let s=await tm(e,n,r);return assertAccountExists(s),s}async function tm(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ws(s)}async function mP(e,n,r){let s=await rm(e,n,r);return assertAccountsExist(s),s}async function rm(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ws(t))}function m({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function Vs(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}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 p(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:Ns(r.value)?upgradeRoleToSigner(s):s,...Ns(r.value)?{signer:r.value}:{}})}}function Ns(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Gs=new Uint8Array([8]);function _P(){return fixEncoderSize(getBytesEncoder(),1).encode(Gs)}function Qr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Gs}))}function Fs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function UP(){return combineCodec(Qr(),Fs())}async function zs(e,n){let r=n?.programAddress??d,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:Qr().encode(c),programAddress:r})}function WP(e,n){let r=n?.programAddress??d,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:Qr().encode(c),programAddress:r})}function LP(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:Fs().decode(e.data)}}var Ys=new Uint8Array([9]);function HP(){return fixEncoderSize(getBytesEncoder(),1).encode(Ys)}function $r(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(_e())],["secp256r1VerifyArgs",getArrayEncoder(G())],["compressedProofArgs",getOptionEncoder(D())]]),e=>({...e,discriminator:Ys}))}function Xs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(Ue())],["secp256r1VerifyArgs",getArrayDecoder(F())],["compressedProofArgs",getOptionDecoder(M())]])}function GP(){return combineCodec($r(),Xs())}async function Qs(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.settings.value||(t.settings.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getU128Encoder().encode(Vs(c.settingsIndex))]})),t.authority.value||(t.authority.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"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:$r().encode(c),programAddress:r})}function FP(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:$r().encode(c),programAddress:r})}function zP(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Xs().decode(e.data)}}var no=new Uint8Array([20]);function XP(){return fixEncoderSize(getBytesEncoder(),1).encode(no)}function so(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(_e())],["secp256r1VerifyArgs",getArrayEncoder(G())],["settingsMutArgs",w()],["compressedProofArgs",D()]]),e=>({...e,discriminator:no}))}function oo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Ue())],["secp256r1VerifyArgs",getArrayDecoder(F())],["settingsMutArgs",k()],["compressedProofArgs",M()]])}function QP(){return combineCodec(so(),oo())}function co(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:so().encode(c),programAddress:r})}function $P(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:oo().decode(e.data)}}var uo=new Uint8Array([17]);function ch(){return fixEncoderSize(getBytesEncoder(),1).encode(uo)}function Ao(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["settingsMutArgs",w()],["secp256r1VerifyArgs",getArrayEncoder(G())]]),e=>({...e,discriminator:uo}))}function go(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",k()],["secp256r1VerifyArgs",getArrayDecoder(F())]])}function ah(){return combineCodec(Ao(),go())}function yo(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ao().encode(c),programAddress:r})}function ih(e){if(e.accounts.length<4)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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:go().decode(e.data)}}var Io=new Uint8Array([0]);function ph(){return fixEncoderSize(getBytesEncoder(),1).encode(Io)}function tn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",Ae()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Io}))}function Co(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",ge()],["compressedProofArgs",M()]])}function Th(){return combineCodec(tn(),Co())}async function Do(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:tn().encode(c),programAddress:r})}function fh(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:tn().encode(c),programAddress:r})}function lh(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:Co().decode(e.data)}}var Eo=new Uint8Array([4]);function Eh(){return fixEncoderSize(getBytesEncoder(),1).encode(Eo)}function nn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["member",wr()],["role",We()],["userAccountCreationArgs",Ae()],["linkWalletArgs",getOptionEncoder(br())]]),e=>({...e,discriminator:Eo}))}function Po(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["member",mt()],["role",Le()],["userAccountCreationArgs",ge()],["linkWalletArgs",getOptionDecoder(vr())]])}function Ph(){return combineCodec(nn(),Po())}async function ho(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:nn().encode(c),programAddress:r})}function hh(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:nn().encode(c),programAddress:r})}function Rh(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:Po().decode(e.data)}}var bo=new Uint8Array([3]);function Lh(){return fixEncoderSize(getBytesEncoder(),1).encode(bo)}function on(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:bo}))}function vo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function Oh(){return combineCodec(on(),vo())}async function _o(e,n){let r=n?.programAddress??d,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=p(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:on().encode({}),programAddress:r})}function Bh(e,n){let r=n?.programAddress??d,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=p(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:on().encode({}),programAddress:r})}function wh(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:vo().decode(e.data)}}var Lo=new Uint8Array([19]);function zh(){return fixEncoderSize(getBytesEncoder(),1).encode(Lo)}function cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["settingsCreation",pt()],["userReadonlyArgs",be()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Lo}))}function Oo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["settingsCreation",Tt()],["userReadonlyArgs",ve()],["settingsIndex",getU128Decoder()]])}function Kh(){return combineCodec(cn(),Oo())}async function Bo(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:cn().encode(c),programAddress:r})}function Jh(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:cn().encode(c),programAddress:r})}function jh(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:Oo().decode(e.data)}}var ko=new Uint8Array([5]);function eR(){return fixEncoderSize(getBytesEncoder(),1).encode(ko)}function dn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["createUserArgs",getArrayEncoder(hr())]]),e=>({...e,discriminator:ko}))}function No(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayDecoder(Rr())]])}function tR(){return combineCodec(dn(),No())}async function Vo(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:dn().encode(c),programAddress:r})}function rR(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:dn().encode(c),programAddress:r})}function nR(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:No().decode(e.data)}}var Fo=new Uint8Array([18]);function uR(){return fixEncoderSize(getBytesEncoder(),1).encode(Fo)}function zo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",w()],["compressedProofArgs",D()],["secp256r1VerifyArgs",getArrayEncoder(G())]]),e=>({...e,discriminator:Fo}))}function Ko(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",k()],["compressedProofArgs",M()],["secp256r1VerifyArgs",getArrayDecoder(F())]])}function AR(){return combineCodec(zo(),Ko())}function Jo(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:zo().encode(c),programAddress:r})}function gR(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Ko().decode(e.data)}}var Zo=new Uint8Array([2]);function lR(){return fixEncoderSize(getBytesEncoder(),1).encode(Zo)}function Yo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:Zo}))}function Xo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function SR(){return combineCodec(Yo(),Xo())}function Qo(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:Yo().encode(c),programAddress:r})}function xR(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:Xo().decode(e.data)}}var rc=new Uint8Array([1]);function hR(){return fixEncoderSize(getBytesEncoder(),1).encode(rc)}function An(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Wr())]]),e=>({...e,discriminator:rc}))}function nc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Lr())]])}function RR(){return combineCodec(An(),nc())}async function bR(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:An().encode(c),programAddress:r})}function sc(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:An().encode(c),programAddress:r})}function vR(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:nc().decode(e.data)}}var ac=new Uint8Array([6]);function wR(){return fixEncoderSize(getBytesEncoder(),1).encode(ac)}function ic(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Te()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",D()]]),e=>({...e,discriminator:ac}))}function dc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",fe()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",M()]])}function kR(){return combineCodec(ic(),dc())}function uc(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.authority),...i],data:ic().encode(c),programAddress:r})}function NR(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:dc().decode(e.data)}}var yc=new Uint8Array([7]);function JR(){return fixEncoderSize(getBytesEncoder(),1).encode(yc)}function mc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Te()],["secp256r1VerifyArgs",getOptionEncoder(V())],["delegateTo",getOptionEncoder(ft())],["oldSettingsMutArgs",getOptionEncoder(w())],["newSettingsMutArgs",getOptionEncoder(w())],["compressedProofArgs",D()]]),e=>({...e,discriminator:yc}))}function pc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",fe()],["secp256r1VerifyArgs",getOptionDecoder(H())],["delegateTo",getOptionDecoder(lt())],["oldSettingsMutArgs",getOptionDecoder(k())],["newSettingsMutArgs",getOptionDecoder(k())],["compressedProofArgs",M()]])}function jR(){return combineCodec(mc(),pc())}function Tc(e,n){let r=n?.programAddress??d,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...i],data:mc().encode(c),programAddress:r})}function qR(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:pc().decode(e.data)}}var Sc=new Uint8Array([33]);function tb(){return fixEncoderSize(getBytesEncoder(),1).encode(Sc)}function xc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",ct()],["compressedProofArgs",D()],["settingsCreationArgs",pt()]]),e=>({...e,discriminator:Sc}))}function Ic(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",at()],["compressedProofArgs",M()],["settingsCreationArgs",Tt()]])}function rb(){return combineCodec(xc(),Ic())}function Cc(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.authority),...i],data:xc().encode(c),programAddress:r})}function nb(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:Ic().decode(e.data)}}var Ec=new Uint8Array([32]);function ub(){return fixEncoderSize(getBytesEncoder(),1).encode(Ec)}function Pc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Oe()],["compressedProofArgs",D()],["userCreationArgs",Ae()]]),e=>({...e,discriminator:Ec}))}function hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Z()],["compressedProofArgs",M()],["userCreationArgs",ge()]])}function Ab(){return combineCodec(Pc(),hc())}function Rc(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.authority),...i],data:Pc().encode(c),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:hc().decode(e.data)}}var vc=new Uint8Array([30]);function Sb(){return fixEncoderSize(getBytesEncoder(),1).encode(vc)}function gn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(G())]]),e=>({...e,discriminator:vc}))}function _c(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(F())]])}function xb(){return combineCodec(gn(),_c())}async function Ib(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(J(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:gn().encode(c),programAddress:r})}function Uc(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:gn().encode(c),programAddress:r})}function Cb(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:_c().decode(e.data)}}var Oc=new Uint8Array([28]);function bb(){return fixEncoderSize(getBytesEncoder(),1).encode(Oc)}function Bc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(G())],["settingsMutArgs",w()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Oc}))}function wc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(F())],["settingsMutArgs",k()],["compressedProofArgs",M()]])}function vb(){return combineCodec(Bc(),wc())}function kc(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Bc().encode(c),programAddress:r})}function _b(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:wc().decode(e.data)}}var Vc=new Uint8Array([31]);function kb(){return fixEncoderSize(getBytesEncoder(),1).encode(Vc)}function mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(G())]]),e=>({...e,discriminator:Vc}))}function Hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(F())]])}function Nb(){return combineCodec(mn(),Hc())}async function Vb(e,n){let r=n?.programAddress??d,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},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(J(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceTokenAccount.value||(t.sourceTokenAccount.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.destinationTokenAccount.value||(t.destinationTokenAccount.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.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:mn().encode(c),programAddress:r})}function Gc(e,n){let r=n?.programAddress??d,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},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:mn().encode(c),programAddress:r})}function Hb(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:Hc().decode(e.data)}}var Jc=new Uint8Array([29]);function qb(){return fixEncoderSize(getBytesEncoder(),1).encode(Jc)}function pn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(G())],["settingsMutArgs",w()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Jc}))}function jc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(F())],["settingsMutArgs",k()],["compressedProofArgs",M()]])}function Zb(){return combineCodec(pn(),jc())}async function Yb(e,n){let r=n?.programAddress??d,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},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceTokenAccount.value||(t.sourceTokenAccount.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.destinationTokenAccount.value||(t.destinationTokenAccount.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.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:pn().encode(c),programAddress:r})}function qc(e,n){let r=n?.programAddress??d,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},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:pn().encode(c),programAddress:r})}function Xb(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:jc().decode(e.data)}}var Xc=new Uint8Array([13]);function sv(){return fixEncoderSize(getBytesEncoder(),1).encode(Xc)}function Qc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:Xc}))}function $c(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())]])}function ov(){return combineCodec(Qc(),$c())}function ea(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Qc().encode(c),programAddress:r})}function cv(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:$c().decode(e.data)}}var na=new Uint8Array([24]);function yv(){return fixEncoderSize(getBytesEncoder(),1).encode(na)}function sa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsMutArgs",w()],["compressedProofArgs",D()]]),e=>({...e,discriminator:na}))}function oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())],["settingsMutArgs",k()],["compressedProofArgs",M()]])}function mv(){return combineCodec(sa(),oa())}function ca(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:sa().encode(c),programAddress:r})}function pv(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:oa().decode(e.data)}}var da=new Uint8Array([10]);function Cv(){return fixEncoderSize(getBytesEncoder(),1).encode(da)}function ua(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",It()],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:da}))}function Aa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Ct()],["secp256r1VerifyArgs",getOptionDecoder(H())]])}function Dv(){return combineCodec(ua(),Aa())}function ga(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:ua().encode(c),programAddress:r})}function Mv(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===d?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:Aa().decode(e.data)}}var pa=new Uint8Array([21]);function _v(){return fixEncoderSize(getBytesEncoder(),1).encode(pa)}function Ta(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",It()],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsReadonlyArgs",St()],["compressedProofArgs",D()]]),e=>({...e,discriminator:pa}))}function fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Ct()],["secp256r1VerifyArgs",getOptionDecoder(H())],["settingsReadonlyArgs",xt()],["compressedProofArgs",M()]])}function Uv(){return combineCodec(Ta(),fa())}function la(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:Ta().encode(c),programAddress:r})}function Wv(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:fa().decode(e.data)}}var Ia=new Uint8Array([14]);function Vv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ia)}function Ca(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:Ia}))}function Da(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())]])}function Hv(){return combineCodec(Ca(),Da())}function Ma(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ca().encode(c),programAddress:r})}function Gv(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Da().decode(e.data)}}var ha=new Uint8Array([25]);function Zv(){return fixEncoderSize(getBytesEncoder(),1).encode(ha)}function Ra(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsMutArgs",w()],["compressedProofArgs",D()]]),e=>({...e,discriminator:ha}))}function ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())],["settingsMutArgs",k()],["compressedProofArgs",M()]])}function Yv(){return combineCodec(Ra(),ba())}function va(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ra().encode(c),programAddress:r})}function Xv(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ba().decode(e.data)}}var Wa=new Uint8Array([12]);function n_(){return fixEncoderSize(getBytesEncoder(),1).encode(Wa)}function La(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Wa}))}function Oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function s_(){return combineCodec(La(),Oa())}function Ba(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:La().encode(c),programAddress:r})}function o_(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:Oa().decode(e.data)}}var Na=new Uint8Array([23]);function A_(){return fixEncoderSize(getBytesEncoder(),1).encode(Na)}function Va(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Na}))}function Ha(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function g_(){return combineCodec(Va(),Ha())}function Ga(e,n){let r=n?.programAddress??d,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:Va().encode(c),programAddress:r})}function y_(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:Ha().decode(e.data)}}var Ka=new Uint8Array([11]);function x_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ka)}function Ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:Ka}))}function ja(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())]])}function I_(){return combineCodec(Ja(),ja())}function qa(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ja().encode(c),programAddress:r})}function C_(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ja().decode(e.data)}}var Xa=new Uint8Array([22]);function b_(){return fixEncoderSize(getBytesEncoder(),1).encode(Xa)}function Qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsReadonlyArgs",St()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Xa}))}function $a(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())],["settingsReadonlyArgs",xt()],["compressedProofArgs",M()]])}function v_(){return combineCodec(Qa(),$a())}function ei(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Qa().encode(c),programAddress:r})}function __(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:$a().decode(e.data)}}var ni=new Uint8Array([15]);function w_(){return fixEncoderSize(getBytesEncoder(),1).encode(ni)}function si(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:ni}))}function oi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function k_(){return combineCodec(si(),oi())}function ci(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=m({}),i=p(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:si().encode({}),programAddress:r})}function N_(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:oi().decode(e.data)}}var di=new Uint8Array([26]);function K_(){return fixEncoderSize(getBytesEncoder(),1).encode(di)}function ui(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:di}))}function Ai(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function J_(){return combineCodec(ui(),Ai())}function gi(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:ui().encode(c),programAddress:r})}function j_(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:Ai().decode(e.data)}}var pi=new Uint8Array([16]);function eU(){return fixEncoderSize(getBytesEncoder(),1).encode(pi)}function Ti(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Dt()],["secp256r1VerifyArgs",getArrayEncoder(G())]]),e=>({...e,discriminator:pi}))}function fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Mt()],["secp256r1VerifyArgs",getArrayDecoder(F())]])}function tU(){return combineCodec(Ti(),fi())}function li(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ti().encode(c),programAddress:r})}function rU(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:fi().decode(e.data)}}var Ii=new Uint8Array([27]);function dU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ii)}function Ci(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Dt()],["secp256r1VerifyArgs",getArrayEncoder(G())],["settingsMutArgs",w()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Ii}))}function Di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Mt()],["secp256r1VerifyArgs",getArrayDecoder(F())],["settingsMutArgs",k()],["compressedProofArgs",M()]])}function uU(){return combineCodec(Ci(),Di())}function Mi(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ci().encode(c),programAddress:r})}function AU(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Di().decode(e.data)}}var d="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",US=(c=>(c[c.DomainConfig=0]="DomainConfig",c[c.GlobalCounter=1]="GlobalCounter",c[c.Settings=2]="Settings",c[c.TransactionBuffer=3]="TransactionBuffer",c[c.WhitelistedAddressTree=4]="WhitelistedAddressTree",c))(US||{});function YU(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 WS=(T=>(T[T.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",T[T.ChangeConfig=1]="ChangeConfig",T[T.ChangeConfigCompressed=2]="ChangeConfigCompressed",T[T.CompressSettingsAccount=3]="CompressSettingsAccount",T[T.CreateDomainConfig=4]="CreateDomainConfig",T[T.CreateDomainUserAccount=5]="CreateDomainUserAccount",T[T.CreateGlobalCounter=6]="CreateGlobalCounter",T[T.CreateMultiWalletCompressed=7]="CreateMultiWalletCompressed",T[T.CreateUserAccounts=8]="CreateUserAccounts",T[T.DecompressSettingsAccount=9]="DecompressSettingsAccount",T[T.DisableDomainConfig=10]="DisableDomainConfig",T[T.EditDomainConfig=11]="EditDomainConfig",T[T.EditTransactionManagerUrl=12]="EditTransactionManagerUrl",T[T.EditUserDelegate=13]="EditUserDelegate",T[T.MigrateCompressedSettings=14]="MigrateCompressedSettings",T[T.MigrateCompressedUsers=15]="MigrateCompressedUsers",T[T.NativeTransferIntent=16]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=17]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=18]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=19]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=20]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=21]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=22]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=23]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=24]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=25]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=26]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=27]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=28]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=29]="TransactionBufferVoteCompressed",T[T.TransactionExecute=30]="TransactionExecute",T[T.TransactionExecuteCompressed=31]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=32]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=33]="TransactionExecuteSyncCompressed",T))(WS||{});function XU(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([20])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([17])),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([19])),0))return 7;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 8;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 9;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 10;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 11;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 12;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 13;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([33])),0))return 14;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([32])),0))return 15;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 16;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 17;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([31])),0))return 18;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 19;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 20;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 21;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 22;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 23;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 24;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 25;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 26;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 27;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 28;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 29;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 30;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 31;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 32;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 33;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var OS=6e3,BS=6001,wS=6002,kS=6003,NS=6004,VS=6005,HS=6006,GS=6007,FS=6008,zS=6009,KS=6010,JS=6011,jS=6012,qS=6013,ZS=6014,YS=6015,XS=6016,QS=6017,$S=6018,ex=6019,tx=6020,rx=6021,nx=6022,sx=6023,ox=6024,cx=6025,ax=6026,ix=6027,dx=6028,ux=6029,Ax=6030,gx=6031,yx=6032,mx=6033,px=6034,Tx=6035,fx=6036,lx=6037,Sx=6038,xx=6039,Ix=6040,Cx=6041,Dx=6042,Mx=6043,Ex=6044,Px=6045,hx=6046,Rx=6047,bx=6048,vx=6049,_x=6050,Ux=6051,Wx=6052,Lx=6053,Ox=6054,Ei;process.env.NODE_ENV!=="production"&&(Ei={[Ax]:"This member is already delegated to another wallet.",[GS]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[_x]:"The domain configuration account is disabled. Please contact support or try again later.",[Ux]:"Missing domain configuration account.",[KS]:"Duplicate public keys detected among members. Each member must have a unique key.",[zS]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[tx]:"No members provided. A multisig wallet must contain at least one member.",[$S]:"Expected a User with Administrator role for this instruction.",[FS]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[XS]:"Expected a User with Transaction Manager role for this instruction.",[xx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[Ix]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Cx]:"Declared buffer size does not match the actual serialized size.",[mx]:"Not enough members with vote permission to meet the approval threshold.",[gx]:"At least one signer with execute permission is required to proceed.",[yx]:"At least one signer with initiate permission is required to perform this action.",[cx]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[Ox]:"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.",[ix]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Sx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[px]:"Only delegated members are allowed for this transaction.",[ox]:"Unexpected number of accounts provided for this instruction.",[qS]:"User with Permanent Member role requires a must have a delegated wallet.",[BS]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[NS]:"The extracted public key has an invalid length or encoding.",[OS]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[kS]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[vx]:"The specified slot number is not recent.",[Rx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[nx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[QS]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[YS]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[sx]:"Malformed transaction message: structure or formatting does not match the expected layout.",[ax]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[VS]:"The extracted WebAuthn signed message payload is malformed.",[Px]:"An input string exceeds the maximum allowed character length.",[Wx]:"This member is not registered under the provided domain configuration.",[dx]:"A required account is missing from the instruction context.",[ux]:"User mutation arguments are required when performing add or remove delegate operations.",[hx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[fx]:"No valid signer found in this transaction.",[jS]:"Only one permanent member is allowed per wallet.",[ZS]:"Only one transaction manager is allowed per wallet.",[Lx]:"The given origin index is not in the whitelisted origins.",[JS]:"Permanent members cannot be removed from a wallet.",[Ex]:"Writable CPI calls to protected accounts are not permitted.",[HS]:"The rpIdHash extracted from the signed message does not match the expected value.",[wS]:"The signature index provided is out of bounds for the secp256r1 instruction.",[bx]:"The specified slot number was not found in the provided slot history.",[rx]:"Too many members: a maximum of 4 members are supported.",[Dx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[Mx]:"This transaction has not yet reached the required approval threshold.",[lx]:"Only the transaction creator or rent payer may close this transaction buffer.",[Tx]:"Member is not part of the expected signers for this transaction."});function nW(e){return process.env.NODE_ENV!=="production"?Ei[e]:"Error message not available in production bundles."}function sW(e,n,r){return isProgramError(e,n,d,r)}async function pW({admin:e,addressTree:n}){return zs({payer:e,addressTree:n,remainingAccounts:[]})}var bt={Ed25519:1,Secp256r1:2};var le={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Ie=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(le).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var ln=33,Ce=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!==ln)throw new Error(`Invalid public key length, expected ${ln} 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===ln)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()}},E=class extends Ce{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 kx(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function Nx(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var hi=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(kx())],["addressTableLookups",getArrayCodec(Nx())]]);function Ri(e){return hi.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 bi(e){let n=hi.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:d,staticAccounts:n.accountKeys,version:0}}featureFlags.version=VERSION.V2;var j={};function ze(){if(!j.solanaRpcEndpoint)throw new Error("Rpc is not initialized yet.");return j.solanaRpcEndpoint}function ke(){if(!j.lightProtocolRpc)throw new Error("Rpc is not initialized yet");return j.lightProtocolRpc}function re(){if(!j.solanaRpc)throw new Error("Rpc is not initialized yet");return j.solanaRpc}function vi(){if(!j.sendAndConfirm)throw new Error("Rpc is not initialized yet.");return j.sendAndConfirm}function _i(){if(!j.computeEstimate)throw new Error("Rpc is not initialized yet");return j.computeEstimate}function xn(){return j.jitoTipsConfig?j.jitoTipsConfig:{blockEngineUrl:"https://mainnet.block-engine.jito.wtf/api/v1",getJitoTipsUrl:"https://bundles.jito.wtf/api/v1/bundles/tip_floor",priority:"landed_tips_75th_percentile"}}function NW(){Object.keys(j).forEach(e=>{j[e]=void 0;});}function VW({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){j.solanaRpcEndpoint=e,j.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});j.solanaRpc=t,j.sendAndConfirm=c,j.computeEstimate=estimateComputeUnitLimitFactory({rpc:t}),j.jitoTipsConfig=s??null;}var L=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}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(d.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.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=ze().includes("devnet")?localTestActiveStateTreeInfos():await ke().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:a,queuePubkeyIndex:i,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,u=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=u);}for(let c of r){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:a,addressQueuePubkeyIndex:i});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function er(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await Li(e);return s&&n?.set(e.toString(),s),s}}async function ye(e,n){let s=(await Promise.all(e.map(async t=>er(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new Error("Unable to find compressed account.");return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function v(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function se(e,n,r,s,t){if(t.length===0)return [];let c=t.map((u,A)=>({treeInfo:n[A],root:r[A],rootIndex:s[A],address:u.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((u,A)=>({addressTreeInfo:a[A],outputStateTreeIndex:i,address:u.address,type:u.type}))}function oe(e,n,r,s,t,c,a){let i=[];for(let A=0;A<n.length;A++)i.push({treeInfo:n[A],rootIndex:s[A],leafIndex:r[A],proveByIndex:t[A],hash:c[A].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((A,g)=>({data:a.decode(A.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(A.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function ce(e,n,r,s,t){let c=null,a=null,i=null,o=new L;if(e){await o.addSystemAccounts();let{address:u}=await ne(n,r),A=(await ye([{address:u,type:"Settings"}],t))[0];s?i={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)))}}:i=await z([A],[]);let g=o.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:A.hash}],[]).stateTrees;if(!g)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(A.address),treeInfo:g.packedTreeInfos[0]},data:ee().decode(A.data?.data)},a={accountMeta:{address:new Uint8Array(A.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:ee().decode(A.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:o,settingsMutArgs:a}}async function z(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await ke().getValidityProofV0(e,n)}catch(c){if(console.error(`Attempt ${t}, Get Validity Proof failed. ${c}`),t++,t>=r)throw new Error(`Failed to get validity proof after ${r} attempts: ${c}`);await new Promise(a=>setTimeout(a,s));}throw new Error(`Failed to get validity proof after ${r} attempts`)}async function pe(){return (await tr()).length-1}var In;async function tr(){if(!In){let{data:e}=await ks(re(),await Oi());In=e.whitelistedAddressTrees;}return In}async function rr(e,n,r){let s=await dI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function dI(e,n,r){let{address:s}=await O(e,n),t=await er(s,r);return t?.data?.data?Z().decode(t.data.data):null}async function Cn(e,n,r){let s=await uI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function uI(e,n,r){try{let{address:s}=await ne(e,n),t=await er(s,r);if(!t?.data?.data)throw new Error("No compressed settings account found.");let c=ee().decode(t.data.data);if(c.data.__option==="None")throw new Error("No compressed settings account found.");return {...c.data.value,isCompressed:!0}}catch{let s=await zr(re(),await Y(e));return s.exists?{...s.data,index:getU128Decoder().decode(s.data.index),members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function Dn(e){let n=await tr();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function yL(e){let r=(await tr()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function Li(e){let n=await rpcRequest(ke().compressionApiEndpoint,versionedEndpoint("getCompressedAccount"),{hash:void 0,address:e?encodeBN254toBase58(e):void 0}),r;if(featureFlags.isV2()?r=create(n,jsonRpcResultAndContext(nullable(CompressedAccountResultV2))):r=create(n,jsonRpcResultAndContext(nullable(CompressedAccountResult))),"error"in r)throw new SolanaJSONRPCError(r.error,`failed to get info for compressed account ${e?e.toString():""}`);if(r.result.value===null)return null;let s=featureFlags.isV2()?r.result.value.merkleContext.tree:r.result.value.tree,t=ze().includes("devnet")?localTestActiveStateTreeInfos():await ke().getStateTreeInfos(),c=getStateTreeInfoByPubkey(t,s),a=r.result.value;return createCompressedAccountWithMerkleContextLegacy(createMerkleContextLegacy(c,a.hash,a.leafIndex),a.owner,bn(a.lamports),a.data?parseAccountData(a.data):void 0,a.address||void 0)}async function ne(e,n=0){let r=await Dn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("multi_wallet")),new Uint8Array(getU128Encoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(d)).toString(),"base58"),addressTree:new PublicKey(r)}}async function O(e,n=0){let r=await Dn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),e instanceof Ce?e.toTruncatedBuffer():new Uint8Array(getAddressEncoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(d.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function Je({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(new Uint8Array(getUtf8Encoder().encode(n)));else throw new Error("RpId not found.");if(!e)throw new Error("RpIdHash not found.");let[r]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function zi(){let[e]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function Oi(){let[e]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Ki(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof Ce?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function Se(e){let[n]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function Y(e){let[n]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function CL(e){let n=await Y(e);return await Se(n)}async function DL(){let[e]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}function sr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function mI(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 ji(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 qi(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let a=e[s]|e[s+1]<<8;if(s+=2,s+a>e.length)throw new Error("MaxLengthExceeded");let i=e.slice(s,s+a),o=t.decode(i);r.push(o),s+=a;}return r}function Zi(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 I=n&127;r+=I;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let a=e[r+1],i=r+2,o=e.slice(i,i+a),u=c[0]===0&&c.length>32?c.slice(1):c,A=o[0]===0&&o.length>32?o.slice(1):o;if(u.length>32||A.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(u,32-u.length);let y=p256.Point.CURVE().n>>1n,f=BigInt("0x"+sr(A)),P=(f>y?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),S=mI(P);return new Uint8Array([...g,...S])}function or(e){return new Uint8Array([...new Uint8Array(Me(e.response.authenticatorData)),...sha256(new Uint8Array(Me(e.response.clientDataJSON)))])}function VL(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+sr(n.get(-2))),y:BigInt("0x"+sr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function HL(e){let r=p256.Point.fromBytes(new Uint8Array(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 GL(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Me(n)),c=JSON.parse(new TextDecoder().decode(Me(r))),a=ji(c),i=Zi(new Uint8Array(Me(s))),o=await Je({rpIdHash:t.subarray(0,32)});return new E(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Me(r)),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:Mn(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}async function FL(e,n){let{data:r}=await kn(re(),e),t=qi(new Uint8Array(r.origins),r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Error("Origin not found in domain config");return t}function Mn(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function zL(e){return sha256(new Uint8Array(getUtf8Encoder().encode(JSON.stringify(e))))}function KL(e){return En(e.data.payload.authResponse)}function JL(e,n,r,s){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...Mn(n,r,s)]))}async function jL(e,n,r,s,t,c){let a;if(!t||!c){let o=(await re().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed"}).send()).value?.data;if(!o)throw new Error("Unable to fetch slot sysvar");let u=getBase64Encoder().encode(o[0]);c=getU64Decoder().decode(u.subarray(8,16)).toString(),a=u.subarray(16,48),t=getBase58Decoder().decode(a);}else a=new Uint8Array(getBase58Encoder().encode(t));let i=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...sha256(typeof e.transactionMessageBytes=="string"?new Uint8Array(Me(e.transactionMessageBytes)):e.transactionMessageBytes),...a,...Mn(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:i}}function En(e){return sha256(or(e))}function qL(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Me(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),a=new Uint8Array(c);for(let i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return c}async function Pn(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await re().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(s.instructions,c),c=>setTransactionMessageFeePayerSigner(s.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let a=Math.ceil((s.unitsConsumed??0)*1.1)||8e5;return a>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:a})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function ed(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===AccountRole.WRITABLE||c.role===AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,a)=>c-a);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function td(e,n){if(e.length===0)throw new Error("Bundle is empty.");for(let c=0;c<e.length;c++){if(e[c].length>1644)throw new Error(`Transaction ${c} exceeds maximum length, ${e[c].length}. Retry again.`);console.log(`Transaction ${c} length: ${e[c].length}`);}let r=await 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:[]}))}]})});if(!r.ok)throw console.error(await r.json()),new Error("Failed to simulate bundle");let{result:s,error:t}=await r.json();if(!s||t)throw console.error(t??s),new Error(`Unable to simulate bundle: ${JSON.stringify(t??s)}`);if(typeof s.value.summary!="string"&&s.value.summary.failed){let{TransactionFailure:c}=s.value.summary.failed.error,[,a]=c;throw console.error(t??s),new Error(`Simulation failed: ${a}`)}return s.value.transactionResults.map(c=>c.unitsConsumed)}function N(e,n=0){let r=e instanceof E?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}):null,t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,a=r?.authData&&r.verifyArgs?.clientDataJson?or(r.authResponse):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function qe(e){if(e instanceof Ce)return {keyType:bt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:bt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function $i(e){return e instanceof E?e.toString():e.address.toString()}function ae(e){let n=new Set,r=[];for(let s of e)n.has($i(s))||(r.push(s),n.add($i(s)));if(r.filter(s=>s instanceof E).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function rd({payer:e,tipAmount:n}){let r=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],s=r[Math.floor(Math.random()*r.length)];return getTransferSolInstruction({source:e,destination:address(s),amount:n})}async function AO(e){let n=await Pn(e,true),r=await td(n.map(getBase64EncodedWireTransaction),ze()),s=await Pn(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await XI(s.map(getBase64EncodedWireTransaction))}async function gO({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await re().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(e,c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([_i()(c),ed(re(),c.instructions.flatMap(u=>u.accounts??[]))]),o=Math.ceil(a*1.1);return prependTransactionMessageInstructions([...o>2e5?[getSetComputeUnitLimitInstruction({units:o})]:[],...i>0?[getSetComputeUnitPriceInstruction({microLamports:i})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await vi()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}async function XI(e,n=10,r=1e3,s=xn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/bundles`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})});if(a.status===429&&c<n){await new Promise(o=>setTimeout(o,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);return i.result}throw new Error("Failed to send bundle after retries.")}async function yO(e,n=30,r=3e3,s=xn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/getBundleStatuses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});if(a.status===429&&c<n){await new Promise(u=>setTimeout(u,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);let o=i.result;if(o.value.length){let u=o.value[0];if(u.confirmation_status==="confirmed"||u.confirmation_status==="finalized")return u.transactions[u.transactions.length-1]}if(c<n){await new Promise(u=>setTimeout(u,r));continue}}throw new Error("Failed to get bundle status after retries.")}function mO(e,n){if(n.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:r}=n.members.find(i=>sd(i.pubkey)===e)??{};if(!r)throw new Error("No permissions found for the current member.");let s=Ie.has(r,le.InitiateTransaction),t=Ie.has(r,le.VoteTransaction),c=Ie.has(r,le.ExecuteTransaction);if(s&&t&&c)return {};if(!t||!c)throw new Error("Signer lacks the required Vote/Execute permissions.");let a=n.members.find(i=>i.role===2);if(!a)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:address(sd(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function pO({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await rr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return QI(n,c.transactionManagerUrl.value,e,s)}function QI(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=getBase64Decoder().decode(s)),r&&(c.authResponses=r);let i=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json();if("error"in i)throw new Error(i.error);return i.signatures.map(o=>({[e]:getBase58Encoder().encode(o)}))}}}function sd(e){return e.keyType===bt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function TO(e){let n=e.map(c=>_e().encode(c)),r=4+n.reduce((c,a)=>c+a.length,0),s=new Uint8Array(r),t=0;s.set(getU32Encoder().encode(e.length),t),t+=4;for(let c of n)s.set(c,t),t+=c.length;return s}function fO(e){let n=0,[r,s]=getU32Decoder().read(e,n);n=s;let t=new Array(r);for(let c=0;c<r;c++){let a=Ue().read(e,n);t[c]=a[0],n=a[1];}if(n!==e.length)throw new Error(`Trailing bytes: ${e.length-n}`);return t}async function UO({payer:e,rpId:n,origins:r,authority:s}){let t=await Je({rpId:n}),c=new L;await c.addSystemAccounts();let a=await pe(),{address:i,addressTree:o}=await O(s.address,a),u=[{address:i,tree:o,queue:o,type:"User"}],A=await z([],u),g=(await se(c,A.treeInfos,A.roots,A.rootIndices,u))[0],{remainingAccounts:y,systemOffset:f}=c.toAccountMetas(),l=v(A,f);return await Do({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:l,payer:e,domainConfig:t,rpId:n,remainingAccounts:y})}async function GO({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new L;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await ne(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await O(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await ye(a,t):[],o=await pe(),{address:u,addressTree:A}=await O(r.member,o),g=[{address:u,type:"User",tree:A,queue:A}],y=await z(i,g),f=null,l=null,P=i.filter(U=>U.type==="Settings"),S=i.filter(U=>U.type==="User");P.length&&(f=oe(c,y.treeInfos.slice(0,1),y.leafIndices.slice(0,1),y.rootIndices.slice(0,1),y.proveByIndices.slice(0,1),P,ee())[0]),S.length&&(l=oe(c,y.treeInfos.slice(1,2),y.leafIndices.slice(1,2),y.rootIndices.slice(1,2),y.proveByIndices.slice(1,2),S,Z())[0]);let I=await se(c,y.treeInfos.slice(i.length),y.roots.slice(i.length),y.rootIndices.slice(i.length),g),{remainingAccounts:C,systemOffset:x}=c.toAccountMetas(),_=v(y,x);return await ho({payer:n,authority:e,compressedProofArgs:_,member:mt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:f?some({settingsMutArgs:f,transactionManager:l?some(l):none()}):none(),userAccountCreationArgs:I[0],domainConfig:s,remainingAccounts:C})}async function JO({payer:e}){let n=await zi();return _o({payer:e,globalCounter:n})}async function YO({admin:e,rpId:n,disable:r}){let s=await Je({rpId:n});return Qo({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function nB({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new L;await t.addSystemAccounts();let{address:c,addressTree:a}=await ne(r,s),i=[{address:c,tree:a,queue:a,type:"Settings"}],o=await z([],i),u=(await se(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:A,systemOffset:g}=t.toAccountMetas(),y=v(o,g);return Cc({compressedProofArgs:y,args:e,authority:n,settingsCreationArgs:u,remainingAccounts:A})}async function uB({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new L;await t.addSystemAccounts();let{address:c,addressTree:a}=await O(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await z([],i),u=(await se(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:A,systemOffset:g}=t.toAccountMetas(),y=v(o,g);return Rc({compressedProofArgs:y,args:e,authority:n,userCreationArgs:u,remainingAccounts:A})}var Ze=33,Ye=64,_n=14,oC=2,cC=address("Secp256r1SigVerify1111111111111111111111111");function aC(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function iC(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function ud(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let s=getU8Decoder().decode(e,n);n+=1;let t=[],c=iC();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=_n;let a=[];for(let i=0;i<r;i++){let o=fixDecoderSize(getBytesDecoder(),Ze).decode(e,n);n+=Ze;let u=fixDecoderSize(getBytesDecoder(),Ye).decode(e,n);n+=Ye;let A=t[i].messageDataSize,g=fixDecoderSize(getBytesDecoder(),A).decode(e,n);n+=A,a.push({publicKey:o,signature:u,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function Ad(){return createEncoder({getSizeFromValue:e=>{let n=_n*e.offsets.length,r=e.payload.reduce((s,t)=>s+Ze+Ye+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=aC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),Ze).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),Ye).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function IB(){return combineCodec(Ad(),ud())}function B(e,n){let r=e.length,s=oC+r*_n,t=[];for(let o=0;o<r;o++){let{message:u}=e[o],A=s,g=A+Ze,y=g+Ye;t.push({publicKeyOffset:A,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:y,messageDataSize:u.length,messageInstructionIndex:65535}),s+=Ze+Ye+u.length;}let c=n?.programAddress??cC,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:Ad().encode(a)}}function CB(e){return {programAddress:e.programAddress,accounts:{},data:ud().decode(e.data)}}async function _B({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=await Y(e),{packedAccounts:a,proof:i,settingsMutArgs:o}=await ce(true,e,n,false,t);if(!o)throw new Error("Proof args is missing");let u=ae(s),A=u.filter(I=>I instanceof E),g=[],y=[];for(let I of A){let C=g.length,{domainConfig:x,verifyArgs:_,signature:U,publicKey:K,message:W}=N(I,C);W&&U&&K&&g.push({message:W,signature:U,publicKey:K}),x&&(a.addPreAccounts([{address:x,role:AccountRole.READONLY}]),_?.__option==="Some"&&y.push({domainConfigKey:x,verifyArgs:_.value}));}a.addPreAccounts(u.filter(I=>"address"in I).map(I=>({address:I.address,role:AccountRole.READONLY_SIGNER,signer:I})));let{remainingAccounts:f,systemOffset:l}=a.toAccountMetas(),P=v(i,l),S=[];return g.length>0&&S.push(B(g)),S.push(yo({settings:c,settingsMutArgs:o,compressedProofArgs:P,payer:r,secp256r1VerifyArgs:y,remainingAccounts:f})),S}async function NB({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:a,proof:i,settingsMutArgs:o}=r,u=ae(e),A=u.filter(C=>!(C instanceof E));a.addPreAccounts(A.map(C=>({address:C.address,role:AccountRole.READONLY_SIGNER,signer:C})));let g=u.filter(C=>C instanceof E),y=[],f=[];for(let C of g){let x=f.length,{domainConfig:_,verifyArgs:U,signature:K,publicKey:W,message:q}=N(C,x);q&&K&&W&&f.push({message:q,signature:K,publicKey:W}),_&&(a.addPreAccounts([{address:_,role:AccountRole.READONLY}]),U?.__option==="Some"&&y.push({domainConfigKey:_,verifyArgs:U.value}));}let{remainingAccounts:l,systemOffset:P}=a.toAccountMetas(),S=v(i,P),I=[];if(f.length>0&&I.push(B(f)),c){if(!o)throw new Error("Payer not found or proof args is missing.");I.push(co({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:o,remainingAccounts:l,secp256r1VerifyArgs:y}));}else I.push(await Qs({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:l,secp256r1VerifyArgs:y}));return I}async function JB({createUserArgs:e,payer:n}){let r=new L;await r.addSystemAccounts(),r.addPreAccounts(e.map(A=>({address:A.member.address,role:AccountRole.READONLY_SIGNER,signer:A.member})));let s=await pe(),t=await Promise.all(e.map(async A=>{let{address:g,addressTree:y}=await O(A.member.address,s);return {address:g,tree:y,queue:y,type:"User"}})),c=await z([],t),a=await se(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),u=v(c,o);return await Vo({compressedProofArgs:u,payer:n,createUserArgs:e.map((A,g)=>({member:A.member.address,role:A.role,userCreationArgs:a[g],transactionManagerUrl:A.role===2?A.transactionManagerUrl:null})),remainingAccounts:i})}async function $B({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new L;await a.addSystemAccounts();let i=await pe(),{address:o,addressTree:u}=await O(r.address,i),A=[{address:o,tree:u,queue:u,type:"User"}],g=await z([],A),y=(await se(a,g.treeInfos,g.roots,g.rootIndices,A))[0],f=a.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:v(g,f.systemOffset),authorityCreationArgs:y};}return sc({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function ow({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new L;await s.addSystemAccounts();let t=await ye([{address:(await O(e.address,n)).address,type:"User"}]),c=await z(t,[]),a=oe(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,Z())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),u=v(c,o);return uc({authority:e,transactionManagerUrl:r,compressedProofArgs:u,userMutArgs:a,remainingAccounts:i})}async function pw({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:a,message:i,signature:o,publicKey:u}=N(n),A=[];i&&o&&u&&A.push({message:i,signature:o,publicKey:u});let g=await rr(n instanceof E?n:n.address,r,t),y=[];y.push({address:(await O(n instanceof E?n:n.address,r)).address,type:"User"});let f,l=null,P,S=null;g.delegatedTo.__option==="Some"&&((await Cn(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(y.push({address:(await ne(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),l={start:y.length-1,end:y.length}):f=await Y(g.delegatedTo.value.index)),s&&((await Cn(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(y.push({address:(await ne(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:y.length-1,end:y.length}):P=await Y(s.index));let I=new L;await I.addSystemAccounts();let C=await ye(y,t),x=await z(C,[]),_=oe(I,x.treeInfos.slice(0,1),x.leafIndices.slice(0,1),x.rootIndices.slice(0,1),x.proveByIndices.slice(0,1),C.slice(0,1),Z())[0],U=l?some(oe(I,x.treeInfos.slice(l.start,l.end),x.leafIndices.slice(l.start,l.end),x.rootIndices.slice(l.start,l.end),x.proveByIndices.slice(l.start,l.end),C.slice(l.start,l.end),ee())[0]):none(),K=S?some(oe(I,x.treeInfos.slice(S.start,S.end),x.leafIndices.slice(S.start,S.end),x.rootIndices.slice(S.start,S.end),x.proveByIndices.slice(S.start,S.end),C.slice(S.start,S.end),ee())[0]):none(),{remainingAccounts:W,systemOffset:q}=I.toAccountMetas(),te=v(x,q),de=[];return A.length>0&&de.push(B(A)),de.push(Tc({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof E?void 0:n,oldSettings:f,oldSettingsMutArgs:U,newSettings:P,newSettingsMutArgs:K,compressedProofArgs:te,userMutArgs:_,remainingAccounts:W})),de}async function Rw({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new L;await c.addSystemAccounts();let a=[],i=[];i.push(...await ye([{address:(await O(r.address,s)).address,type:"User"}],t));let o=await pe(),{address:u,addressTree:A}=await ne(e,o);a.push({address:u,queue:A,tree:A,type:"Settings"});let g=i.length,y=await z(i,a),f=oe(c,y.treeInfos.slice(0,g),y.leafIndices.slice(0,g),y.rootIndices.slice(0,g),y.proveByIndices.slice(0,g),i.filter(_=>_.type==="User"),Z())[0],P=(await se(c,y.treeInfos.slice(g),y.roots.slice(g),y.rootIndices.slice(g),a)).find(_=>_.type==="Settings")??null,{remainingAccounts:S,systemOffset:I}=c.toAccountMetas(),C=v(y,I),x=[];if(!P)throw new Error("Settings creation args is missing.");return x.push(await Bo({settingsIndex:e,payer:n,initialMember:r,userReadonlyArgs:f,compressedProofArgs:C,settingsCreation:P,remainingAccounts:S})),x}async function ww({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:a,settingsMutArgs:i}=await ce(true,e,n,false,t);if(!i)throw new Error("Proof args is missing");let o=ae(s),u=o.filter(I=>I instanceof E),A=[],g=[];for(let I of u){let C=A.length,{domainConfig:x,verifyArgs:_,signature:U,publicKey:K,message:W}=N(I,C);W&&U&&K&&A.push({message:W,signature:U,publicKey:K}),x&&(c.addPreAccounts([{address:x,role:AccountRole.READONLY}]),_?.__option==="Some"&&g.push({domainConfigKey:x,verifyArgs:_.value}));}c.addPreAccounts(o.filter(I=>"address"in I).map(I=>({address:I.address,role:AccountRole.READONLY_SIGNER,signer:I})));let{remainingAccounts:y,systemOffset:f}=c.toAccountMetas(),l=v(a,f),P=[];A.length>0&&P.push(B(A));let S=await Y(e);return P.push(Jo({settings:S,payer:r,settingsMutArgs:i,compressedProofArgs:l,secp256r1VerifyArgs:g,remainingAccounts:y})),P}function yC(e,n,r,s){let t=mC(e,n),c=pC(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function mC(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,a=s-t,i=r-s-c;return n>=r?false:n<a?true:n>=s?n-s<i:false}function pC(e,n){return n<e.header.numSignerAccounts}async function ar({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=bi(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(i=>i.lookupTableAddress),re()):{}),a=[];a.push(...t.addressTableLookups?.map(i=>({role:AccountRole.READONLY,address:i.lookupTableAddress}))??[]);for(let[i,o]of t.staticAccounts.entries())a.push({address:o,role:yC(t,i,o,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let o=c[i.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let u of i.writableIndexes){let A=o[u];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:A,role:AccountRole.WRITABLE});}for(let u of i.readonlyIndexes){let A=o[u];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:A,role:AccountRole.READONLY});}}for(let i of s?.filter(o=>o.address!==e)??[]){let o=a.findIndex(u=>u.address===i.address);o===-1?a.push({address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}):a[o].role===AccountRole.READONLY||a[o].role===AccountRole.READONLY_SIGNER?a[o]={address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}:(a[o].role===AccountRole.WRITABLE||a[o].role===AccountRole.WRITABLE_SIGNER)&&(a[o]={address:i.address,role:AccountRole.WRITABLE_SIGNER,signer:i});}return {accountMetas:a,addressLookupTableAccounts:c,transactionMessage:t}}async function pd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let u=await Se(e),{accountMetas:A,addressLookupTableAccounts:g}=await ar({transactionMessageBytes:r,walletAddress:u,additionalSigners:a,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(B(c)),y.push(o?gi({transactionBuffer:n,payer:s.address,remainingAccounts:A,settingsKey:e}):ci({transactionBuffer:n,payer:s.address,settings:e})),i&&y.push(rd({payer:s,tipAmount:i})),{instructions:y,addressLookupTableAccounts:g}}async function Td({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:u}){let A=ae(s),g=await Y(e),y=await Se(g),[{accountMetas:f,addressLookupTableAccounts:l,transactionMessage:P},{settingsMutArgs:S,proof:I,packedAccounts:C}]=await Promise.all([ar({transactionMessageBytes:r,walletAddress:y,additionalSigners:A.filter(te=>!(te instanceof E)),addressesByLookupTableAddress:c}),ce(i,e,n,o,u)]);C.addPreAccounts(f);let x=A.filter(te=>te instanceof E),_=[];for(let te of x){let de=a.length,{domainConfig:me,verifyArgs:Ee,signature:Pe,publicKey:xe,message:Ut}=N(te,de);Ut&&Pe&&xe&&a.push({message:Ut,signature:Pe,publicKey:xe}),me&&(C.addPreAccounts([{address:me,role:AccountRole.READONLY}]),Ee?.__option==="Some"&&_.push({domainConfigKey:me,verifyArgs:Ee.value}));}let{remainingAccounts:U,systemOffset:K}=C.toAccountMetas(),W=[];a.length>0&&W.push(B(a));let q=fC(P,f);if(i){if(!t||!S)throw new Error("Payer not found or proof args is missing.");let te=v(I,K);W.push(Mi({secp256r1VerifyArgs:_,transactionMessage:q,settingsMutArgs:S,compressedProofArgs:te,payer:t,remainingAccounts:U}));}else W.push(li({secp256r1VerifyArgs:_,settings:g,transactionMessage:q,remainingAccounts:U}));return {instructions:W,addressLookupTableAccounts:l}}function fC(e,n){if(e.version==="legacy")throw new Error("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:new Uint8Array(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 Ak({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=ae(s),u=await Y(e),A=await Se(u),{packedAccounts:g,proof:y,settingsMutArgs:f}=await ce(i,e,n,false,t),l=[],P=[];for(let x of o)if(x instanceof E){let _=l.length,{domainConfig:U,verifyArgs:K,signature:W,publicKey:q,message:te}=N(x,_);te&&W&&q&&l.push({message:te,signature:W,publicKey:q}),U&&(g.addPreAccounts([{address:U,role:AccountRole.READONLY}]),K?.__option==="Some"&&P.push({domainConfigKey:U,verifyArgs:K.value}));}else g.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:S,systemOffset:I}=g.toAccountMetas(),C=[];if(l.length>0&&C.push(B(l)),i){if(!a||!f)throw new Error("Payer not found or proof args is missing.");let x=v(y,I);C.push(kc({amount:c,settingsMutArgs:f,compressedProofArgs:x,payer:a,secp256r1VerifyArgs:P,source:A,destination:r,remainingAccounts:S}));}else C.push(Uc({amount:c,secp256r1VerifyArgs:P,source:A,destination:r,settings:u,remainingAccounts:S}));return C}async function Ik({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,createAtaIfNeeded:u=true,compressed:A=false}){let g=ae(t),y=await Y(e),f=await Se(y),[l,P]=await Promise.all([getAssociatedTokenAccountAddress(s,f,o),getAssociatedTokenAccountAddress(s,r,o)]),{packedAccounts:S,proof:I,settingsMutArgs:C}=await ce(A,e,n,false,c),x=[],_=[];for(let q of g)if(q instanceof E){let te=x.length,{domainConfig:de,verifyArgs:me,signature:Ee,publicKey:Pe,message:xe}=N(q,te);xe&&Ee&&Pe&&x.push({message:xe,signature:Ee,publicKey:Pe}),de&&(S.addPreAccounts([{address:de,role:AccountRole.READONLY}]),me?.__option==="Some"&&_.push({domainConfigKey:de,verifyArgs:me.value}));}else S.addPreAccounts([{address:q.address,role:AccountRole.READONLY_SIGNER,signer:q}]);let{remainingAccounts:U,systemOffset:K}=S.toAccountMetas(),W=[];if(x.length>0&&W.push(B(x)),A){if(!i||!C)throw new Error("Payer not found or proof args is missing.");let q=v(I,K);W.push(qc({amount:a,createAtaIfNeeded:u,settingsMutArgs:C,compressedProofArgs:q,payer:i,secp256r1VerifyArgs:_,source:f,sourceTokenAccount:l,destination:r,destinationTokenAccount:P,mint:s,tokenProgram:o,remainingAccounts:U}));}else W.push(Gc({amount:a,createAtaIfNeeded:u,secp256r1VerifyArgs:_,source:f,sourceTokenAccount:l,destination:r,destinationTokenAccount:P,settings:y,mint:s,tokenProgram:o,remainingAccounts:U}));return W}async function Uk({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await Us(re(),s),o=i.data.multiWalletSettings,{packedAccounts:u,proof:A,settingsMutArgs:g}=await ce(c,e,n,false,a),{remainingAccounts:y,systemOffset:f}=u.toAccountMetas(),{domainConfig:l,verifyArgs:P,message:S,signature:I,publicKey:C}=N(r),x=[];if(S&&I&&C&&x.push(B([{message:S,signature:I,publicKey:C}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let _=v(A,f);x.push(ca({transactionBuffer:s,domainConfig:l,closer:r instanceof E?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:P,settingsMutArgs:g,payer:t,compressedProofArgs:_,remainingAccounts:y}));}else x.push(ea({transactionBuffer:s,domainConfig:l,closer:r instanceof E?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:P,remainingAccounts:[]}));return x}function xd({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:u,expectedSecp256r1Signers:A}){let{domainConfig:g,verifyArgs:y,message:f,signature:l,publicKey:P}=N(n),S=[];if(f&&l&&P&&S.push(B([{message:f,signature:l,publicKey:P}])),u){let{settingsReadonlyArgs:I,compressedProofArgs:C,remainingAccounts:x}=u;S.push(la({transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof E?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:A},settingsReadonlyArgs:I,compressedProofArgs:C,remainingAccounts:x}));}else S.push(ga({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof E?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:A},remainingAccounts:[]}));return S}function Id({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=N(e),u=[];return i&&a&&o&&u.push(B([{message:i,signature:a,publicKey:o}])),s?u.push(va({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof E?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(Ma({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof E?void 0:e,remainingAccounts:[]})),u}function Cd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Ga({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Ba({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Dd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=N(n),u=[];return o&&a&&i&&u.push(B([{message:o,signature:a,publicKey:i}])),s?u.push(ei({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof E?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(qa({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof E?void 0:n,remainingAccounts:[]})),u}async function DN({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await lC(r),a=new L,i=null,o=null,u=[];if(c.length||t){let g=await SC({packedAccounts:a,userAccounts:c,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:s});i=g.proof,o=g.settingsMutArgs??null,u=g.userMutArgs??[];}return {configActions:await xC({configActionsArgs:r,userMutArgs:u,index:e}),index:e,proof:i,settingsMutArgs:o,packedAccounts:a,compressed:t}}async function lC(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 SC({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let a=[];if(r){let f=(await ne(s,t)).address;a.push({address:f,type:"Settings"});}n.length&&a.push(...n);let i=a.length?await ye(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await z(i,[]),u=[],A=[];for(let f of i)f.type==="Settings"?u.push(f):f.type==="User"&&A.push(f);let g,y=[];if(r&&o&&(g=oe(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),u,ee())[0]),A.length&&o){let f=r?1:0;y=oe(e,o.treeInfos.slice(f),o.leafIndices.slice(f),o.rootIndices.slice(f),o.proveByIndices.slice(f),A,Z());}return {proof:o,settingsMutArgs:g,userMutArgs:y}}async function xC({index:e,configActionsArgs:n,userMutArgs:r}){let s=[];for(let t of n)switch(t.type){case "AddMembers":{let c=[];for(let a of t.members){let i=await O(a.member,a.userAddressTreeIndex).then(o=>r.find(u=>new Md(new Uint8Array(u.accountMeta.address)).eq(o.address)));if(!i)throw new Error("Unable to find user account");c.push(DC({permissionArgs:a.permissions,userMutArgs:i,pubkey:a.member}));}s.push({__kind:t.type,fields:[c]});break}case "RemoveMembers":{let c=await Promise.all(t.members.map(a=>O(a.member,a.userAddressTreeIndex).then(i=>{let o=r.find(u=>new Md(new Uint8Array(u.accountMeta.address)).eq(i.address));if(!o)throw new Error("Unable to find user account");return CC({pubkey:a.member,userMutArgs:o,index:e})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(a=>IC({permissionArgs:a.permissions,pubkey:a.member}));s.push({__kind:t.type,fields:[c]});break}default:s.push({__kind:t.type,fields:[t.threshold]});}return s}function IC({pubkey:e,permissionArgs:n}){return {memberKey:qe(e),permissions:Ed(n)}}function CC({pubkey:e,userMutArgs:n,index:r}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");let s=n.data.delegatedTo.__option==="Some"?Number(n.data.delegatedTo.value.index.toString())===r:false;return {memberKey:qe(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function DC({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===1)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===2&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:qe(e),permissions:Ed(n),userReadonlyArgs:r}}function Ed(e){let n=[];return e.initiate&&n.push(le.InitiateTransaction),e.vote&&n.push(le.VoteTransaction),e.execute&&n.push(le.ExecuteTransaction),Ie.fromPermissions(n)}async function _N({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:u=false,additionalVoters:A=[],additionalSigners:g=[],chunkSize:y=Math.ceil(s.length/2),cachedAccounts:f}){let l=await Y(n),P=Math.floor(Math.random()*255),S=await Ki(l,t instanceof E?t:t.address,P),I=[],C=[];for(let X=0;X<s.length;X+=y){let Ln=s.subarray(X,X+y);I.push(Ln),C.push(sha256(Ln));}let x=sha256(new Uint8Array(s)),{settingsReadonlyArgs:_,settingsMutArgs:U,proof:K,packedAccounts:W}=await ce(u,n,r,false,f),{remainingAccounts:q,systemOffset:te}=W.toAccountMetas(),de=K&&_&&U?{settingsReadonlyArgs:_,settingsMutArgs:U,compressedProofArgs:v(K,te),remainingAccounts:q,payer:e}:null,me=ae([t,...c?[c]:[],...A]).filter(X=>X instanceof E).map(X=>({memberKey:qe(X),messageHash:En(X.authResponse)})),Ee=xd({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:P,payer:e,transactionBufferAddress:S,settings:l,creator:t,preauthorizeExecution:!c,bufferExtendHashes:C,compressedArgs:de,expectedSecp256r1Signers:me}),Pe=I.map(X=>Cd({transactionMessageBytes:X,transactionBufferAddress:S,settings:l,compressed:u})),xe=A.map(X=>Dd({voter:X,transactionBufferAddress:S,settings:l,compressedArgs:de})),Ut=Id({compressedArgs:de,settings:l,executor:c,transactionBufferAddress:S}),{instructions:Rd,addressLookupTableAccounts:bd}=await pd({compressed:u,settings:l,transactionMessageBytes:s,transactionBufferAddress:S,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),T=X=>({payer:e,instructions:X,addressesByLookupTableAddress:bd});return [T(Ee),...Pe.map(X=>T([X])),...xe.length?[T(xe.flat())]:[],T(Ut),T(Rd)]}var dr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=a=>{let i=s.get(a);return i===void 0&&(i={isSigner:false,isWritable:false,isInvoked:false},s.set(a,i)),i},c=t(r);c.isSigner=true,c.isWritable=true;for(let a of n){t(a.programAddress).isInvoked=false;for(let i of a.accounts??[]){let o=t(i.address);o.isSigner||=i.role===AccountRole.READONLY_SIGNER||i.role===AccountRole.WRITABLE_SIGNER,o.isWritable||=i.role===AccountRole.WRITABLE||i.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(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),a={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let i=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [a,i]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&a.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&!a.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,a]of this.keyMetaMap.entries())if(r(a)){let i=c,o=n.findIndex(u=>u===i);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(i),this.keyMetaMap.delete(c);}}return [s,t]}};var ur=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((c,a)=>{s.set(c,a);});let t=c=>{let a=s.get(c);if(a===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return a};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(a=>t(a.address))??[],data:c.data}))}};function hd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=dr.compile(r,e),c=new Array,a={writable:[],readonly:[]},i=Object.entries(s??{});for(let y of i){let f=t.extractTableLookup(y);if(f!==void 0){let{addressTableLookup:l,drainedKeys:P}=f;c.push({readonlyIndexes:l.readonlyIndexes,readableIndices:l.readonlyIndexes,writableIndexes:l.writableIndexes,writableIndices:l.writableIndexes,lookupTableAddress:address(l.lookupTableAddress)}),a.writable.push(...P.writable),a.readonly.push(...P.readonly);}}let[o,u]=t.getMessageComponents(),g=new ur(u,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:u,addressTableLookups:c}}function zN({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=hd({instructions:e,payer:n,recentBlockhash:d,addressesByLookupTableAddress:r});return Ri(s)}async function ZN({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:u=false}){let{instructions:A,addressLookupTableAccounts:g}=await Td({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:i});return {payer:e,instructions:A,addressesByLookupTableAddress:g}}
|
|
2
|
+
export{Gs as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,no as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,Ys as CHANGE_CONFIG_DISCRIMINATOR,uo as COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Io as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Eo as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,bo as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Lo as CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR,ko as CREATE_USER_ACCOUNTS_DISCRIMINATOR,Fo as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Zo as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,On as DOMAIN_CONFIG_DISCRIMINATOR,rc as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,ac as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,yc as EDIT_USER_DELEGATE_DISCRIMINATOR,Hn as GLOBAL_COUNTER_DISCRIMINATOR,bt as KeyType,Sc as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,Ec as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,Ax as MULTI_WALLET_ERROR__ALREADY_DELEGATED,GS as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,_x as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,Ux as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,KS as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,zS as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,tx as MULTI_WALLET_ERROR__EMPTY_MEMBERS,$S as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,FS as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,XS as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,xx as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,Ix as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,Cx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,mx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,gx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,yx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,cx as MULTI_WALLET_ERROR__INVALID_ACCOUNT,Ox as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,ex as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,ix as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,Sx as MULTI_WALLET_ERROR__INVALID_BUFFER,px as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,ox as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,qS as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,BS as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,NS as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,OS as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,kS as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,vx as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,Rx as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,nx as MULTI_WALLET_ERROR__INVALID_THRESHOLD,QS as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,YS as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,sx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,ax as MULTI_WALLET_ERROR__INVALID_USER_ROLE,VS as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,Px as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,Wx as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,dx as MULTI_WALLET_ERROR__MISSING_ACCOUNT,ux as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,hx as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,fx as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,jS as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,ZS as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,Lx as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,JS as MULTI_WALLET_ERROR__PERMANENT_MEMBER,Ex as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,HS as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,wS as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,bx as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,rx as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,Dx as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,Mx as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,lx as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,Tx as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,d as MULTI_WALLET_PROGRAM_ADDRESS,US as MultiWalletAccount,WS as MultiWalletInstruction,Oc as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,vc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,le as Permission,Ie as Permissions,Cs as SETTINGS_DISCRIMINATOR,Ce as Secp256r1Key,E as SignedSecp256r1Key,Jc as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Vc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,na as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,Xc as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,pa as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,da as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,bs as TRANSACTION_BUFFER_DISCRIMINATOR,ha as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Ia as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Na as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Wa as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Xa as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Ka as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,di as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,ni as TRANSACTION_EXECUTE_DISCRIMINATOR,Ii as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,pi as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Ge as UserRole,Os as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,pW as addWhitelistedAddressTrees,Me as base64URLStringToBuffer,qL as bufferToBase64URLString,NB as changeConfig,Uk as closeTransactionBuffer,_B as compressSettingsAccount,mD as configAction,sd as convertMemberKeyToString,HL as convertPubkeyCompressedToCose,VL as convertPubkeyCoseToCompressed,KL as createClientAuthorizationCompleteRequestChallenge,zL as createClientAuthorizationStartRequestChallenge,UO as createDomainConfig,GO as createDomainUserAccounts,JO as createGlobalCounter,JL as createMessageChallenge,xd as createTransactionBuffer,jL as createTransactionChallenge,QI as createTransactionManagerSigner,JB as createUserAccounts,Rw as createWallet,wn as decodeDomainConfig,Fn as decodeGlobalCounter,Ms as decodeSettings,_s as decodeTransactionBuffer,ws as decodeWhitelistedAddressTree,ww as decompressSettingsAccount,fO as deserializeConfigActions,YO as disableDomainConfig,$B as editDomainConfig,ow as editTransactionManagerUrl,pw as editUserDelegate,pd as executeTransaction,Id as executeTransactionBuffer,Td as executeTransactionSync,Cd as extendTransactionBuffer,bC as fetchAllDomainConfig,BC as fetchAllGlobalCounter,Fd as fetchAllMaybeDomainConfig,ou as fetchAllMaybeGlobalCounter,my as fetchAllMaybeSettings,By as fetchAllMaybeTransactionBuffer,rm as fetchAllMaybeWhitelistedAddressTree,rP as fetchAllSettings,dP as fetchAllTransactionBuffer,mP as fetchAllWhitelistedAddressTree,Li as fetchCompressedAccount,kn as fetchDomainConfig,OC as fetchGlobalCounter,Gd as fetchMaybeDomainConfig,su as fetchMaybeGlobalCounter,zr as fetchMaybeSettings,uI as fetchMaybeSettingsAccountData,Oy as fetchMaybeTransactionBuffer,dI as fetchMaybeUserAccountData,tm as fetchMaybeWhitelistedAddressTree,tP as fetchSettings,Cn as fetchSettingsAccountData,Us as fetchTransactionBuffer,rr as fetchUserAccountData,ks as fetchWhitelistedAddressTree,HC as getAddMemberArgsCodec,gr as getAddMemberArgsDecoder,Ar as getAddMemberArgsEncoder,_P as getAddWhitelistedAddressTreesDiscriminatorBytes,WP as getAddWhitelistedAddressTreesInstruction,zs as getAddWhitelistedAddressTreesInstructionAsync,UP as getAddWhitelistedAddressTreesInstructionDataCodec,Fs as getAddWhitelistedAddressTreesInstructionDataDecoder,Qr as getAddWhitelistedAddressTreesInstructionDataEncoder,XP as getChangeConfigCompressedDiscriminatorBytes,co as getChangeConfigCompressedInstruction,QP as getChangeConfigCompressedInstructionDataCodec,oo as getChangeConfigCompressedInstructionDataDecoder,so as getChangeConfigCompressedInstructionDataEncoder,HP as getChangeConfigDiscriminatorBytes,FP as getChangeConfigInstruction,Qs as getChangeConfigInstructionAsync,GP as getChangeConfigInstructionDataCodec,Xs as getChangeConfigInstructionDataDecoder,$r as getChangeConfigInstructionDataEncoder,Mn as getClientAndDeviceHash,zC as getCompiledInstructionCodec,mr as getCompiledInstructionDecoder,yr as getCompiledInstructionEncoder,ch as getCompressSettingsAccountDiscriminatorBytes,yo as getCompressSettingsAccountInstruction,ah as getCompressSettingsAccountInstructionDataCodec,go as getCompressSettingsAccountInstructionDataDecoder,Ao as getCompressSettingsAccountInstructionDataEncoder,qC as getCompressedAccountMetaCodec,et as getCompressedAccountMetaDecoder,$e as getCompressedAccountMetaEncoder,QC as getCompressedAccountMetaReadOnlyCodec,st as getCompressedAccountMetaReadOnlyDecoder,nt as getCompressedAccountMetaReadOnlyEncoder,tD as getCompressedProofCodec,xr as getCompressedProofDecoder,Sr as getCompressedProofEncoder,ne as getCompressedSettingsAddressFromIndex,oD as getCompressedSettingsCodec,dD as getCompressedSettingsDataCodec,at as getCompressedSettingsDataDecoder,ct as getCompressedSettingsDataEncoder,ee as getCompressedSettingsDecoder,ot as getCompressedSettingsEncoder,_i as getComputeBudgetEstimate,yD as getConfigActionCodec,Ue as getConfigActionDecoder,_e as getConfigActionEncoder,ph as getCreateDomainConfigDiscriminatorBytes,fh as getCreateDomainConfigInstruction,Do as getCreateDomainConfigInstructionAsync,Th as getCreateDomainConfigInstructionDataCodec,Co as getCreateDomainConfigInstructionDataDecoder,tn as getCreateDomainConfigInstructionDataEncoder,Eh as getCreateDomainUserAccountDiscriminatorBytes,hh as getCreateDomainUserAccountInstruction,ho as getCreateDomainUserAccountInstructionAsync,Ph as getCreateDomainUserAccountInstructionDataCodec,Po as getCreateDomainUserAccountInstructionDataDecoder,nn as getCreateDomainUserAccountInstructionDataEncoder,Lh as getCreateGlobalCounterDiscriminatorBytes,Bh as getCreateGlobalCounterInstruction,_o as getCreateGlobalCounterInstructionAsync,Oh as getCreateGlobalCounterInstructionDataCodec,vo as getCreateGlobalCounterInstructionDataDecoder,on as getCreateGlobalCounterInstructionDataEncoder,zh as getCreateMultiWalletCompressedDiscriminatorBytes,Jh as getCreateMultiWalletCompressedInstruction,Bo as getCreateMultiWalletCompressedInstructionAsync,Kh as getCreateMultiWalletCompressedInstructionDataCodec,Oo as getCreateMultiWalletCompressedInstructionDataDecoder,cn as getCreateMultiWalletCompressedInstructionDataEncoder,SD as getCreateUserAccountArgsCodec,Rr as getCreateUserAccountArgsDecoder,hr as getCreateUserAccountArgsEncoder,eR as getCreateUserAccountsDiscriminatorBytes,rR as getCreateUserAccountsInstruction,Vo as getCreateUserAccountsInstructionAsync,tR as getCreateUserAccountsInstructionDataCodec,No as getCreateUserAccountsInstructionDataDecoder,dn as getCreateUserAccountsInstructionDataEncoder,uR as getDecompressSettingsAccountDiscriminatorBytes,Jo as getDecompressSettingsAccountInstruction,AR as getDecompressSettingsAccountInstructionDataCodec,Ko as getDecompressSettingsAccountInstructionDataDecoder,zo as getDecompressSettingsAccountInstructionDataEncoder,lR as getDisableDomainConfigDiscriminatorBytes,Qo as getDisableDomainConfigInstruction,SR as getDisableDomainConfigInstructionDataCodec,Xo as getDisableDomainConfigInstructionDataDecoder,Yo as getDisableDomainConfigInstructionDataEncoder,Je as getDomainConfigAddress,RC as getDomainConfigCodec,Bn as getDomainConfigDecoder,hC as getDomainConfigDiscriminatorBytes,Hd as getDomainConfigEncoder,vC as getDomainConfigSize,hR as getEditDomainConfigDiscriminatorBytes,sc as getEditDomainConfigInstruction,bR as getEditDomainConfigInstructionAsync,RR as getEditDomainConfigInstructionDataCodec,nc as getEditDomainConfigInstructionDataDecoder,An as getEditDomainConfigInstructionDataEncoder,DD as getEditMemberArgsCodec,Mr as getEditMemberArgsDecoder,Dr as getEditMemberArgsEncoder,wR as getEditTransactionManagerUrlDiscriminatorBytes,uc as getEditTransactionManagerUrlInstruction,kR as getEditTransactionManagerUrlInstructionDataCodec,dc as getEditTransactionManagerUrlInstructionDataDecoder,ic as getEditTransactionManagerUrlInstructionDataEncoder,JR as getEditUserDelegateDiscriminatorBytes,Tc as getEditUserDelegateInstruction,jR as getEditUserDelegateInstructionDataCodec,pc as getEditUserDelegateInstructionDataDecoder,mc as getEditUserDelegateInstructionDataEncoder,hD as getExpectedSecp256r1SignersCodec,At as getExpectedSecp256r1SignersDecoder,ut as getExpectedSecp256r1SignersEncoder,zi as getGlobalCounterAddress,LC as getGlobalCounterCodec,Gn as getGlobalCounterDecoder,WC as getGlobalCounterDiscriminatorBytes,nu as getGlobalCounterEncoder,wC as getGlobalCounterSize,xn as getJitoTipsConfig,DL as getLightCpiSigner,ke as getLightProtocolRpc,_D as getLinkWalletArgsCodec,vr as getLinkWalletArgsDecoder,br as getLinkWalletArgsEncoder,OD as getMemberCodec,dt as getMemberDecoder,it as getMemberEncoder,kD as getMemberKeyCodec,$ as getMemberKeyDecoder,Q as getMemberKeyEncoder,tb as getMigrateCompressedSettingsDiscriminatorBytes,Cc as getMigrateCompressedSettingsInstruction,rb as getMigrateCompressedSettingsInstructionDataCodec,Ic as getMigrateCompressedSettingsInstructionDataDecoder,xc as getMigrateCompressedSettingsInstructionDataEncoder,ub as getMigrateCompressedUsersDiscriminatorBytes,Rc as getMigrateCompressedUsersInstruction,Ab as getMigrateCompressedUsersInstructionDataCodec,hc as getMigrateCompressedUsersInstructionDataDecoder,Pc as getMigrateCompressedUsersInstructionDataEncoder,nW as getMultiWalletErrorMessage,bb as getNativeTransferIntentCompressedDiscriminatorBytes,kc as getNativeTransferIntentCompressedInstruction,vb as getNativeTransferIntentCompressedInstructionDataCodec,wc as getNativeTransferIntentCompressedInstructionDataDecoder,Bc as getNativeTransferIntentCompressedInstructionDataEncoder,Sb as getNativeTransferIntentDiscriminatorBytes,Uc as getNativeTransferIntentInstruction,Ib as getNativeTransferIntentInstructionAsync,xb as getNativeTransferIntentInstructionDataCodec,_c as getNativeTransferIntentInstructionDataDecoder,gn as getNativeTransferIntentInstructionDataEncoder,GD as getNewAuthorityArgsCodec,Lr as getNewAuthorityArgsDecoder,Wr as getNewAuthorityArgsEncoder,FL as getOriginIndex,KD as getPackedAddressTreeInfoCodec,yt as getPackedAddressTreeInfoDecoder,gt as getPackedAddressTreeInfoEncoder,qD as getPackedStateTreeInfoCodec,rt as getPackedStateTreeInfoDecoder,tt as getPackedStateTreeInfoEncoder,XD as getPermissionsCodec,Re as getPermissionsDecoder,he as getPermissionsEncoder,tM as getProofArgsCodec,M as getProofArgsDecoder,D as getProofArgsEncoder,oM as getRemoveMemberArgsCodec,Pr as getRemoveMemberArgsDecoder,Er as getRemoveMemberArgsEncoder,En as getSecp256r1MessageHash,iM as getSecp256r1PubkeyCodec,mt as getSecp256r1PubkeyDecoder,wr as getSecp256r1PubkeyEncoder,iC as getSecp256r1SignatureOffsetsDataDecoder,aC as getSecp256r1SignatureOffsetsDataEncoder,AM as getSecp256r1VerifyArgsCodec,H as getSecp256r1VerifyArgsDecoder,V as getSecp256r1VerifyArgsEncoder,pM as getSecp256r1VerifyArgsWithDomainAddressCodec,F as getSecp256r1VerifyArgsWithDomainAddressDecoder,G as getSecp256r1VerifyArgsWithDomainAddressEncoder,B as getSecp256r1VerifyInstruction,IB as getSecp256r1VerifyInstructionDataCodec,ud as getSecp256r1VerifyInstructionDataDecoder,Ad as getSecp256r1VerifyInstructionDataEncoder,vi as getSendAndConfirmTransaction,eP as getSettingsCodec,SM as getSettingsCreationArgsCodec,Tt as getSettingsCreationArgsDecoder,pt as getSettingsCreationArgsEncoder,Ds as getSettingsDecoder,$E as getSettingsDiscriminatorBytes,yy as getSettingsEncoder,Y as getSettingsFromIndex,CM as getSettingsIndexWithAddressCodec,lt as getSettingsIndexWithAddressDecoder,ft as getSettingsIndexWithAddressEncoder,PM as getSettingsMutArgsCodec,k as getSettingsMutArgsDecoder,w as getSettingsMutArgsEncoder,vM as getSettingsReadonlyArgsCodec,xt as getSettingsReadonlyArgsDecoder,St as getSettingsReadonlyArgsEncoder,nP as getSettingsSize,GL as getSignedSecp256r1Key,pO as getSignedTransactionManager,re as getSolanaRpc,ze as getSolanaRpcEndpoint,qb as getTokenTransferIntentCompressedDiscriminatorBytes,qc as getTokenTransferIntentCompressedInstruction,Yb as getTokenTransferIntentCompressedInstructionAsync,Zb as getTokenTransferIntentCompressedInstructionDataCodec,jc as getTokenTransferIntentCompressedInstructionDataDecoder,pn as getTokenTransferIntentCompressedInstructionDataEncoder,kb as getTokenTransferIntentDiscriminatorBytes,Gc as getTokenTransferIntentInstruction,Vb as getTokenTransferIntentInstructionAsync,Nb as getTokenTransferIntentInstructionDataCodec,Hc as getTokenTransferIntentInstructionDataDecoder,mn as getTokenTransferIntentInstructionDataEncoder,Ki as getTransactionBufferAddress,yv as getTransactionBufferCloseCompressedDiscriminatorBytes,ca as getTransactionBufferCloseCompressedInstruction,mv as getTransactionBufferCloseCompressedInstructionDataCodec,oa as getTransactionBufferCloseCompressedInstructionDataDecoder,sa as getTransactionBufferCloseCompressedInstructionDataEncoder,sv as getTransactionBufferCloseDiscriminatorBytes,ea as getTransactionBufferCloseInstruction,ov as getTransactionBufferCloseInstructionDataCodec,$c as getTransactionBufferCloseInstructionDataDecoder,Qc as getTransactionBufferCloseInstructionDataEncoder,iP as getTransactionBufferCodec,LM as getTransactionBufferCreateArgsCodec,Ct as getTransactionBufferCreateArgsDecoder,It as getTransactionBufferCreateArgsEncoder,_v as getTransactionBufferCreateCompressedDiscriminatorBytes,la as getTransactionBufferCreateCompressedInstruction,Uv as getTransactionBufferCreateCompressedInstructionDataCodec,fa as getTransactionBufferCreateCompressedInstructionDataDecoder,Ta as getTransactionBufferCreateCompressedInstructionDataEncoder,Cv as getTransactionBufferCreateDiscriminatorBytes,ga as getTransactionBufferCreateInstruction,Dv as getTransactionBufferCreateInstructionDataCodec,Aa as getTransactionBufferCreateInstructionDataDecoder,ua as getTransactionBufferCreateInstructionDataEncoder,vs as getTransactionBufferDecoder,aP as getTransactionBufferDiscriminatorBytes,Ly as getTransactionBufferEncoder,Zv as getTransactionBufferExecuteCompressedDiscriminatorBytes,va as getTransactionBufferExecuteCompressedInstruction,Yv as getTransactionBufferExecuteCompressedInstructionDataCodec,ba as getTransactionBufferExecuteCompressedInstructionDataDecoder,Ra as getTransactionBufferExecuteCompressedInstructionDataEncoder,Vv as getTransactionBufferExecuteDiscriminatorBytes,Ma as getTransactionBufferExecuteInstruction,Hv as getTransactionBufferExecuteInstructionDataCodec,Da as getTransactionBufferExecuteInstructionDataDecoder,Ca as getTransactionBufferExecuteInstructionDataEncoder,A_ as getTransactionBufferExtendCompressedDiscriminatorBytes,Ga as getTransactionBufferExtendCompressedInstruction,g_ as getTransactionBufferExtendCompressedInstructionDataCodec,Ha as getTransactionBufferExtendCompressedInstructionDataDecoder,Va as getTransactionBufferExtendCompressedInstructionDataEncoder,n_ as getTransactionBufferExtendDiscriminatorBytes,Ba as getTransactionBufferExtendInstruction,s_ as getTransactionBufferExtendInstructionDataCodec,Oa as getTransactionBufferExtendInstructionDataDecoder,La as getTransactionBufferExtendInstructionDataEncoder,b_ as getTransactionBufferVoteCompressedDiscriminatorBytes,ei as getTransactionBufferVoteCompressedInstruction,v_ as getTransactionBufferVoteCompressedInstructionDataCodec,$a as getTransactionBufferVoteCompressedInstructionDataDecoder,Qa as getTransactionBufferVoteCompressedInstructionDataEncoder,x_ as getTransactionBufferVoteDiscriminatorBytes,qa as getTransactionBufferVoteInstruction,I_ as getTransactionBufferVoteInstructionDataCodec,ja as getTransactionBufferVoteInstructionDataDecoder,Ja as getTransactionBufferVoteInstructionDataEncoder,K_ as getTransactionExecuteCompressedDiscriminatorBytes,gi as getTransactionExecuteCompressedInstruction,J_ as getTransactionExecuteCompressedInstructionDataCodec,Ai as getTransactionExecuteCompressedInstructionDataDecoder,ui as getTransactionExecuteCompressedInstructionDataEncoder,w_ as getTransactionExecuteDiscriminatorBytes,ci as getTransactionExecuteInstruction,k_ as getTransactionExecuteInstructionDataCodec,oi as getTransactionExecuteInstructionDataDecoder,si as getTransactionExecuteInstructionDataEncoder,dU as getTransactionExecuteSyncCompressedDiscriminatorBytes,Mi as getTransactionExecuteSyncCompressedInstruction,uU as getTransactionExecuteSyncCompressedInstructionDataCodec,Di as getTransactionExecuteSyncCompressedInstructionDataDecoder,Ci as getTransactionExecuteSyncCompressedInstructionDataEncoder,eU as getTransactionExecuteSyncDiscriminatorBytes,li as getTransactionExecuteSyncInstruction,tU as getTransactionExecuteSyncInstructionDataCodec,fi as getTransactionExecuteSyncInstructionDataDecoder,Ti as getTransactionExecuteSyncInstructionDataEncoder,HM as getTransactionMessageAddressTableLookupCodec,Nr as getTransactionMessageAddressTableLookupDecoder,kr as getTransactionMessageAddressTableLookupEncoder,kM as getTransactionMessageCodec,Mt as getTransactionMessageDecoder,Dt as getTransactionMessageEncoder,O as getUserAccountAddress,KM as getUserCodec,ZM as getUserCreationArgsCodec,ge as getUserCreationArgsDecoder,Ae as getUserCreationArgsEncoder,Z as getUserDecoder,Oe as getUserEncoder,$M as getUserMutArgsCodec,fe as getUserMutArgsDecoder,Te as getUserMutArgsEncoder,nE as getUserReadOnlyArgsCodec,ve as getUserReadOnlyArgsDecoder,be as getUserReadOnlyArgsEncoder,aE as getUserReadOnlyOrMutateArgsCodec,Br as getUserReadOnlyOrMutateArgsDecoder,Or as getUserReadOnlyOrMutateArgsEncoder,gE as getUserRoleCodec,Le as getUserRoleDecoder,We as getUserRoleEncoder,CL as getWalletAddressFromIndex,Se as getWalletAddressFromSettings,yP as getWhitelistedAddressTreeCodec,Bs as getWhitelistedAddressTreeDecoder,gP as getWhitelistedAddressTreeDiscriminatorBytes,em as getWhitelistedAddressTreeEncoder,Dn as getWhitelistedAddressTreeFromIndex,yL as getWhitelistedAddressTreeIndexFromAddress,Oi as getWhitelistedAddressTreesAddress,YU as identifyMultiWalletAccount,XU as identifyMultiWalletInstruction,VW as initialize,pD as isConfigAction,sW as isMultiWalletError,dE as isUserReadOnlyOrMutateArgs,nB as migrateSettings,uB as migrateUsers,Ak as nativeTransferIntent,LP as parseAddWhitelistedAddressTreesInstruction,$P as parseChangeConfigCompressedInstruction,zP as parseChangeConfigInstruction,ih as parseCompressSettingsAccountInstruction,lh as parseCreateDomainConfigInstruction,Rh as parseCreateDomainUserAccountInstruction,wh as parseCreateGlobalCounterInstruction,jh as parseCreateMultiWalletCompressedInstruction,nR as parseCreateUserAccountsInstruction,gR as parseDecompressSettingsAccountInstruction,xR as parseDisableDomainConfigInstruction,vR as parseEditDomainConfigInstruction,NR as parseEditTransactionManagerUrlInstruction,qR as parseEditUserDelegateInstruction,nb as parseMigrateCompressedSettingsInstruction,gb as parseMigrateCompressedUsersInstruction,_b as parseNativeTransferIntentCompressedInstruction,Cb as parseNativeTransferIntentInstruction,CB as parseSecp256r1VerifyInstruction,Xb as parseTokenTransferIntentCompressedInstruction,Hb as parseTokenTransferIntentInstruction,pv as parseTransactionBufferCloseCompressedInstruction,cv as parseTransactionBufferCloseInstruction,Wv as parseTransactionBufferCreateCompressedInstruction,Mv as parseTransactionBufferCreateInstruction,Xv as parseTransactionBufferExecuteCompressedInstruction,Gv as parseTransactionBufferExecuteInstruction,y_ as parseTransactionBufferExtendCompressedInstruction,o_ as parseTransactionBufferExtendInstruction,__ as parseTransactionBufferVoteCompressedInstruction,C_ as parseTransactionBufferVoteInstruction,j_ as parseTransactionExecuteCompressedInstruction,N_ as parseTransactionExecuteInstruction,AU as parseTransactionExecuteSyncCompressedInstruction,rU as parseTransactionExecuteSyncInstruction,yO as pollJitoBundleConfirmation,DN as prepareChangeConfigArgs,_N as prepareTransactionBundle,zN as prepareTransactionMessage,ZN as prepareTransactionSync,mO as retrieveTransactionManager,XI as sendJitoBundle,TO as serializeConfigActions,AO as signAndSendBundledTransactions,gO as signAndSendTransaction,Ik as tokenTransferIntent,NW as uninitialize,iE as userReadOnlyOrMutateArgs,bi as vaultTransactionMessageDeserialize,Ri as vaultTransactionMessageSerialize,Dd as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|