@revibase/core 0.0.16 → 0.0.17
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 +44 -9
- package/dist/index.d.ts +44 -9
- 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,getOptionEncoder,getOptionDecoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getArrayEncoder,getArrayDecoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getU16Encoder,getU16Decoder,getBooleanEncoder,getBooleanDecoder,getU64Encoder,getU64Decoder,getEnumEncoder,getEnumDecoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,getBase64Decoder,createNoopSigner,AccountRole,some,none,createDecoder,createEncoder,upgradeRoleToSigner,getTransactionEncoder,getBlockhashDecoder,compileTransaction,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import Rn 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';import {ed25519}from'@noble/curves/ed25519.js';import {verifyAuthenticationResponse}from'@simplewebauthn/server';var On=new Uint8Array([201,232,212,229,59,241,106,197]);function WC(){return fixEncoderSize(getBytesEncoder(),8).encode(On)}function Jd(){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 wn(){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 LC(){return combineCodec(Jd(),wn())}function kn(e){return decodeAccount(e,wn())}async function Nn(e,n,r){let s=await jd(e,n,r);return assertAccountExists(s),s}async function jd(e,n,r){let s=await fetchEncodedAccount(e,n,r);return kn(s)}async function BC(e,n,r){let s=await qd(e,n,r);return assertAccountsExist(s),s}async function qd(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>kn(t))}function OC(){return 846}var Gn=new Uint8Array([42,206,176,58,175,129,130,233]);function NC(){return fixEncoderSize(getBytesEncoder(),8).encode(Gn)}function iu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Gn}))}function Fn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function HC(){return combineCodec(iu(),Fn())}function zn(e){return decodeAccount(e,Fn())}async function VC(e,n,r){let s=await du(e,n,r);return assertAccountExists(s),s}async function du(e,n,r){let s=await fetchEncodedAccount(e,n,r);return zn(s)}async function GC(e,n,r){let s=await uu(e,n,r);return assertAccountsExist(s),s}async function uu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>zn(t))}function FC(){return 24}function ur(){return getStructEncoder([["memberKey",X()],["permissions",ve()],["verifyArgs",getOptionEncoder(O())],["userMutArgs",de()]])}function Ar(){return getStructDecoder([["memberKey",$()],["permissions",be()],["verifyArgs",getOptionDecoder(w())],["userMutArgs",ue()]])}function jC(){return combineCodec(ur(),Ar())}function gr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function yr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function ZC(){return combineCodec(gr(),yr())}function et(){return getStructEncoder([["treeInfo",rt()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function tt(){return getStructDecoder([["treeInfo",nt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function eD(){return combineCodec(et(),tt())}function mr(){return getStructEncoder([["treeInfo",rt()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function pr(){return getStructDecoder([["treeInfo",nt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function sD(){return combineCodec(mr(),pr())}function xr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function Ir(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function aD(){return combineCodec(xr(),Ir())}function st(){return getStructEncoder([["data",getOptionEncoder(ot())]])}function z(){return getStructDecoder([["data",getOptionDecoder(ct())]])}function AD(){return combineCodec(st(),z())}function ot(){return getStructEncoder([["threshold",getU8Encoder()],["bump",getU8Encoder()],["index",getU128Encoder()],["multiWalletBump",getU8Encoder()],["members",getArrayEncoder(at())],["settingsAddressTreeIndex",getU8Encoder()]])}function ct(){return getStructDecoder([["threshold",getU8Decoder()],["bump",getU8Decoder()],["index",getU128Decoder()],["multiWalletBump",getU8Decoder()],["members",getArrayDecoder(it())],["settingsAddressTreeIndex",getU8Decoder()]])}function pD(){return combineCodec(ot(),ct())}function dt(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Mr())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(ur())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(hr())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function ut(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Er())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Ar())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Pr())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function SD(){return combineCodec(dt(),ut())}function xD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function ID(e,n){return n.__kind===e}function Rr(){return getStructEncoder([["member",getAddressEncoder()],["role",_e()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Te()]])}function vr(){return getStructDecoder([["member",getAddressDecoder()],["role",Ue()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",fe()]])}function ED(){return combineCodec(Rr(),vr())}function Mr(){return getStructEncoder([["memberKey",X()],["permissions",ve()]])}function Er(){return getStructDecoder([["memberKey",$()],["permissions",be()]])}function vD(){return combineCodec(Mr(),Er())}function At(){return getStructEncoder([["memberKey",X()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function gt(){return getStructDecoder([["memberKey",$()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function WD(){return combineCodec(At(),gt())}function br(){return getStructEncoder([["settingsMutArgs",Ae()],["transactionManager",getOptionEncoder(de())]])}function _r(){return getStructDecoder([["settingsMutArgs",ge()],["transactionManager",getOptionDecoder(ue())]])}function wD(){return combineCodec(br(),_r())}function at(){return getStructEncoder([["pubkey",X()],["permissions",ve()],["role",getU8Encoder()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function it(){return getStructDecoder([["pubkey",$()],["permissions",be()],["role",getU8Decoder()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function VD(){return combineCodec(at(),it())}function X(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function $(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function zD(){return combineCodec(X(),$())}function Lr(){return getStructEncoder([["authorityCreationArgs",Te()],["compressedProofArgs",M()]])}function Br(){return getStructDecoder([["authorityCreationArgs",fe()],["compressedProofArgs",E()]])}function qD(){return combineCodec(Lr(),Br())}function yt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function mt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function XD(){return combineCodec(yt(),mt())}function rt(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function nt(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function eM(){return combineCodec(rt(),nt())}function ve(){return getStructEncoder([["mask",getU8Encoder()]])}function be(){return getStructDecoder([["mask",getU8Decoder()]])}function nM(){return combineCodec(ve(),be())}function M(){return getStructEncoder([["proof",getOptionEncoder(xr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function E(){return getStructDecoder([["proof",getOptionDecoder(Ir())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function aM(){return combineCodec(M(),E())}function hr(){return getStructEncoder([["memberKey",X()],["userMutArgs",de()]])}function Pr(){return getStructDecoder([["memberKey",$()],["userMutArgs",ue()]])}function AM(){return combineCodec(hr(),Pr())}function Or(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function pt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function mM(){return combineCodec(Or(),pt())}function O(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function w(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function fM(){return combineCodec(O(),w())}function Q(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",O()]])}function ee(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",w()]])}function IM(){return combineCodec(Q(),ee())}function Tt(){return getStructEncoder([["addressTreeInfo",yt()],["outputStateTreeIndex",getU8Encoder()]])}function ft(){return getStructDecoder([["addressTreeInfo",mt()],["outputStateTreeIndex",getU8Decoder()]])}function EM(){return combineCodec(Tt(),ft())}function lt(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function St(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function RM(){return combineCodec(lt(),St())}function Ae(){return getStructEncoder([["accountMeta",et()],["data",st()]])}function ge(){return getStructDecoder([["accountMeta",tt()],["data",z()]])}function UM(){return combineCodec(Ae(),ge())}function ne(){return getStructEncoder([["accountMeta",mr()],["data",st()]])}function se(){return getStructDecoder([["accountMeta",pr()],["data",z()]])}function OM(){return combineCodec(ne(),se())}function xt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getOptionEncoder(getArrayEncoder(At()))]])}function It(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(gt()))]])}function HM(){return combineCodec(xt(),It())}function Ct(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(gr())],["addressTableLookups",getArrayEncoder(wr())]])}function Dt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(yr())],["addressTableLookups",getArrayDecoder(kr())]])}function zM(){return combineCodec(Ct(),Dt())}function wr(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function kr(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function jM(){return combineCodec(wr(),kr())}function Mt(){return getStructEncoder([["member",X()],["domainConfig",getOptionEncoder(getAddressEncoder())],["role",_e()],["delegatedTo",getOptionEncoder(lt())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function te(){return getStructDecoder([["member",$()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",Ue()],["delegatedTo",getOptionDecoder(St())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function XM(){return combineCodec(Mt(),te())}function Te(){return getStructEncoder([["addressTreeInfo",yt()],["outputStateTreeIndex",getU8Encoder()]])}function fe(){return getStructDecoder([["addressTreeInfo",mt()],["outputStateTreeIndex",getU8Decoder()]])}function tE(){return combineCodec(Te(),fe())}function de(){return getStructEncoder([["accountMeta",et()],["data",Mt()]])}function ue(){return getStructDecoder([["accountMeta",tt()],["data",te()]])}function oE(){return combineCodec(de(),ue())}var He=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(He||{});function _e(){return getEnumEncoder(He)}function Ue(){return getEnumDecoder(He)}function iE(){return combineCodec(_e(),Ue())}var Is=new Uint8Array([223,179,163,190,177,224,67,173]);function jE(){return fixEncoderSize(getBytesEncoder(),8).encode(Is)}function gy(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(at(),{size:4})],["membersLen",getU8Encoder()],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["padding",fixEncoderSize(getBytesEncoder(),3)]]),e=>({...e,discriminator:Is}))}function Cs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(it(),{size:4})],["membersLen",getU8Decoder()],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["padding",fixDecoderSize(getBytesDecoder(),3)]])}function qE(){return combineCodec(gy(),Cs())}function Ds(e){return decodeAccount(e,Cs())}async function YE(e,n,r){let s=await Fr(e,n,r);return assertAccountExists(s),s}async function Fr(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Ds(s)}async function ZE(e,n,r){let s=await yy(e,n,r);return assertAccountsExist(s),s}async function yy(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ds(t))}function XE(){return 184}var Rs=new Uint8Array([90,36,35,219,93,225,110,96]);function th(){return fixEncoderSize(getBytesEncoder(),8).encode(Rs)}function Wy(){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",X()],["executor",X()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(X())],["expectedSecp256r1Signers",getOptionEncoder(getArrayEncoder(At()))],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Rs}))}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(gt()))],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function rh(){return combineCodec(Wy(),vs())}function bs(e){return decodeAccount(e,vs())}async function _s(e,n,r){let s=await Ly(e,n,r);return assertAccountExists(s),s}async function Ly(e,n,r){let s=await fetchEncodedAccount(e,n,r);return bs(s)}async function nh(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=>bs(t))}var Ls=new Uint8Array([105,23,173,2,197,255,80,87]);function ch(){return fixEncoderSize(getBytesEncoder(),8).encode(Ls)}function Qy(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Ls}))}function Bs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function ah(){return combineCodec(Qy(),Bs())}function Os(e){return decodeAccount(e,Bs())}async function ws(e,n,r){let s=await em(e,n,r);return assertAccountExists(s),s}async function em(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Os(s)}async function ih(e,n,r){let s=await tm(e,n,r);return assertAccountsExist(s),s}async function tm(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Os(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 Ns(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function K(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:K(r.value),role:ks(r.value)?upgradeRoleToSigner(s):s,...ks(r.value)?{signer:r.value}:{}})}}function ks(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Vs=new Uint8Array([8]);function Eh(){return fixEncoderSize(getBytesEncoder(),1).encode(Vs)}function Xr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Vs}))}function Gs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function hh(){return combineCodec(Xr(),Gs())}async function Fs(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:Xr().encode(c),programAddress:r})}function Ph(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:Xr().encode(c),programAddress:r})}function Rh(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:Gs().decode(e.data)}}var js=new Uint8Array([9]);function Bh(){return fixEncoderSize(getBytesEncoder(),1).encode(js)}function $r(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(dt())],["compressedProofArgs",getOptionEncoder(M())]]),e=>({...e,discriminator:js}))}function qs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(ut())],["compressedProofArgs",getOptionDecoder(E())]])}function Oh(){return combineCodec($r(),qs())}async function Ys(e,n){let r=n?.programAddress??A,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},i={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(Ns(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(K(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 a=m(i),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),...a],data:$r().encode(c),programAddress:r})}function wh(e,n){let r=n?.programAddress??A,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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),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),...a],data:$r().encode(c),programAddress:r})}function kh(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:qs().decode(e.data)}}var $s=new Uint8Array([20]);function Kh(){return fixEncoderSize(getBytesEncoder(),1).encode($s)}function Qs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(dt())],["settingsMut",Ae()],["compressedProofArgs",M()]]),e=>({...e,discriminator:$s}))}function eo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(ut())],["settingsMut",ge()],["compressedProofArgs",E()]])}function Jh(){return combineCodec(Qs(),eo())}function to(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.authority),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Qs().encode(c),programAddress:r})}function jh(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),authority:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:eo().decode(e.data)}}var so=new Uint8Array([17]);function eP(){return fixEncoderSize(getBytesEncoder(),1).encode(so)}function oo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",Ae()],["secp256r1VerifyArgs",getArrayEncoder(Q())]]),e=>({...e,discriminator:so}))}function co(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["settingsMutArgs",ge()],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function tP(){return combineCodec(oo(),co())}function ao(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:oo().encode(c),programAddress:r})}function rP(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:co().decode(e.data)}}var To=new Uint8Array([0]);function dP(){return fixEncoderSize(getBytesEncoder(),1).encode(To)}function en(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",Te()],["compressedProofArgs",M()]]),e=>({...e,discriminator:To}))}function fo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",fe()],["compressedProofArgs",E()]])}function uP(){return combineCodec(en(),fo())}async function lo(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:en().encode(c),programAddress:r})}function AP(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:en().encode(c),programAddress:r})}function gP(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:fo().decode(e.data)}}var xo=new Uint8Array([4]);function SP(){return fixEncoderSize(getBytesEncoder(),1).encode(xo)}function rn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["member",Or()],["role",_e()],["userAccountCreationArgs",Te()],["linkWalletArgs",getOptionEncoder(br())]]),e=>({...e,discriminator:xo}))}function Io(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["member",pt()],["role",Ue()],["userAccountCreationArgs",fe()],["linkWalletArgs",getOptionDecoder(_r())]])}function xP(){return combineCodec(rn(),Io())}async function Co(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:rn().encode(c),programAddress:r})}function IP(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:rn().encode(c),programAddress:r})}function CP(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:Io().decode(e.data)}}var Mo=new Uint8Array([3]);function RP(){return fixEncoderSize(getBytesEncoder(),1).encode(Mo)}function sn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Mo}))}function Eo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function vP(){return combineCodec(sn(),Eo())}async function ho(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=p(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:sn().encode({}),programAddress:r})}function bP(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=p(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:sn().encode({}),programAddress:r})}function _P(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:Eo().decode(e.data)}}var vo=new Uint8Array([19]);function kP(){return fixEncoderSize(getBytesEncoder(),1).encode(vo)}function on(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(O())],["compressedProofArgs",M()],["settingsCreation",Tt()],["userMutArgs",de()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:vo}))}function bo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["compressedProofArgs",E()],["settingsCreation",ft()],["userMutArgs",ue()],["settingsIndex",getU128Decoder()]])}function NP(){return combineCodec(on(),bo())}async function _o(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:on().encode(c),programAddress:r})}function HP(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:on().encode(c),programAddress:r})}function VP(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s(),globalCounter:r(),whitelistedAddressTrees:r()},data:bo().decode(e.data)}}var Wo=new Uint8Array([5]);function qP(){return fixEncoderSize(getBytesEncoder(),1).encode(Wo)}function an(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayEncoder(Rr())]]),e=>({...e,discriminator:Wo}))}function Lo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["createUserArgs",getArrayDecoder(vr())]])}function YP(){return combineCodec(an(),Lo())}async function Bo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:an().encode(c),programAddress:r})}function ZP(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:an().encode(c),programAddress:r})}function XP(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Lo().decode(e.data)}}var ko=new Uint8Array([18]);function sR(){return fixEncoderSize(getBytesEncoder(),1).encode(ko)}function No(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMut",Ae()],["compressedProofArgs",M()],["secp256r1VerifyArgs",getArrayEncoder(Q())]]),e=>({...e,discriminator:ko}))}function Ho(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMut",ge()],["compressedProofArgs",E()],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function oR(){return combineCodec(No(),Ho())}function Vo(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:No().encode(c),programAddress:r})}function cR(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Ho().decode(e.data)}}var zo=new Uint8Array([2]);function gR(){return fixEncoderSize(getBytesEncoder(),1).encode(zo)}function Ko(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:zo}))}function Jo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function yR(){return combineCodec(Ko(),Jo())}function jo(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...a],data:Ko().encode(c),programAddress:r})}function mR(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:Jo().decode(e.data)}}var Xo=new Uint8Array([1]);function IR(){return fixEncoderSize(getBytesEncoder(),1).encode(Xo)}function un(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Lr())]]),e=>({...e,discriminator:Xo}))}function $o(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Br())]])}function CR(){return combineCodec(un(),$o())}async function DR(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:un().encode(c),programAddress:r})}function Qo(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:un().encode(c),programAddress:r})}function MR(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:$o().decode(e.data)}}var rc=new Uint8Array([6]);function _R(){return fixEncoderSize(getBytesEncoder(),1).encode(rc)}function nc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",de()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",M()]]),e=>({...e,discriminator:rc}))}function sc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",ue()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",E()]])}function UR(){return combineCodec(nc(),sc())}function oc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.authority),...a],data:nc().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:sc().decode(e.data)}}var ic=new Uint8Array([7]);function HR(){return fixEncoderSize(getBytesEncoder(),1).encode(ic)}function dc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",de()],["secp256r1VerifyArgs",getOptionEncoder(O())],["delegateTo",getOptionEncoder(lt())],["oldSettingsMutArgs",getOptionEncoder(Ae())],["newSettingsMutArgs",getOptionEncoder(Ae())],["compressedProofArgs",M()]]),e=>({...e,discriminator:ic}))}function uc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",ue()],["secp256r1VerifyArgs",getOptionDecoder(w())],["delegateTo",getOptionDecoder(St())],["oldSettingsMutArgs",getOptionDecoder(ge())],["newSettingsMutArgs",getOptionDecoder(ge())],["compressedProofArgs",E()]])}function VR(){return combineCodec(dc(),uc())}function Ac(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),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),...a],data:dc().encode(c),programAddress:r})}function GR(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:uc().decode(e.data)}}var mc=new Uint8Array([33]);function YR(){return fixEncoderSize(getBytesEncoder(),1).encode(mc)}function pc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",ot()],["compressedProofArgs",M()],["settingsCreationArgs",Tt()]]),e=>({...e,discriminator:mc}))}function Tc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",ct()],["compressedProofArgs",E()],["settingsCreationArgs",ft()]])}function ZR(){return combineCodec(pc(),Tc())}function fc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.authority),...a],data:pc().encode(c),programAddress:r})}function XR(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:Tc().decode(e.data)}}var xc=new Uint8Array([32]);function sv(){return fixEncoderSize(getBytesEncoder(),1).encode(xc)}function Ic(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Mt()],["compressedProofArgs",M()],["userCreationArgs",Te()]]),e=>({...e,discriminator:xc}))}function Cc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",te()],["compressedProofArgs",E()],["userCreationArgs",fe()]])}function ov(){return combineCodec(Ic(),Cc())}function Dc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.authority),...a],data:Ic().encode(c),programAddress:r})}function cv(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:Cc().decode(e.data)}}var Ec=new Uint8Array([30]);function yv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ec)}function An(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Q())]]),e=>({...e,discriminator:Ec}))}function hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function mv(){return combineCodec(An(),hc())}async function pv(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(K(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),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),...a],data:An().encode(c),programAddress:r})}function Pc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),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),...a],data:An().encode(c),programAddress:r})}function Tv(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:hc().decode(e.data)}}var bc=new Uint8Array([28]);function Dv(){return fixEncoderSize(getBytesEncoder(),1).encode(bc)}function _c(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Q())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:bc}))}function Uc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(ee())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function Mv(){return combineCodec(_c(),Uc())}function Wc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),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),...a],data:_c().encode(c),programAddress:r})}function Ev(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Uc().decode(e.data)}}var Bc=new Uint8Array([31]);function Uv(){return fixEncoderSize(getBytesEncoder(),1).encode(Bc)}function yn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(Q())]]),e=>({...e,discriminator:Bc}))}function Oc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function Wv(){return combineCodec(yn(),Oc())}async function Lv(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(K(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(K(t.source.value)),getAddressEncoder().encode(K(t.tokenProgram.value)),getAddressEncoder().encode(K(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(K(t.destination.value)),getAddressEncoder().encode(K(t.tokenProgram.value)),getAddressEncoder().encode(K(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=m(i),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),...a],data:yn().encode(c),programAddress:r})}function wc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=m(i),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),...a],data:yn().encode(c),programAddress:r})}function Bv(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===A?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:Oc().decode(e.data)}}var Vc=new Uint8Array([29]);function Gv(){return fixEncoderSize(getBytesEncoder(),1).encode(Vc)}function mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(Q())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Vc}))}function Gc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(ee())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function Fv(){return combineCodec(mn(),Gc())}async function zv(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceTokenAccount.value||(t.sourceTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(K(t.source.value)),getAddressEncoder().encode(K(t.tokenProgram.value)),getAddressEncoder().encode(K(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(K(t.destination.value)),getAddressEncoder().encode(K(t.tokenProgram.value)),getAddressEncoder().encode(K(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=m(i),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),...a],data:mn().encode(c),programAddress:r})}function Fc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=m(i),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),...a],data:mn().encode(c),programAddress:r})}function Kv(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===A?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:Gc().decode(e.data)}}var Jc=new Uint8Array([13]);function $v(){return fixEncoderSize(getBytesEncoder(),1).encode(Jc)}function jc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(O())]]),e=>({...e,discriminator:Jc}))}function qc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Qv(){return combineCodec(jc(),qc())}function Yc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),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),...a],data:jc().encode(c),programAddress:r})}function eb(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:qc().decode(e.data)}}var $c=new Uint8Array([24]);function ab(){return fixEncoderSize(getBytesEncoder(),1).encode($c)}function Qc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(O())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:$c}))}function ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function ib(){return combineCodec(Qc(),ea())}function ta(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),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),...a],data:Qc().encode(c),programAddress:r})}function db(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ea().decode(e.data)}}var sa=new Uint8Array([10]);function Tb(){return fixEncoderSize(getBytesEncoder(),1).encode(sa)}function oa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",xt()],["secp256r1VerifyArgs",getOptionEncoder(O())]]),e=>({...e,discriminator:sa}))}function ca(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",It()],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function fb(){return combineCodec(oa(),ca())}function aa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),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),...a],data:oa().encode(c),programAddress:r})}function lb(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===A?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:ca().decode(e.data)}}var ua=new Uint8Array([21]);function Eb(){return fixEncoderSize(getBytesEncoder(),1).encode(ua)}function Aa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",xt()],["secp256r1VerifyArgs",getOptionEncoder(O())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ua}))}function ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",It()],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function hb(){return combineCodec(Aa(),ga())}function ya(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),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),...a],data:Aa().encode(c),programAddress:r})}function Pb(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:ga().decode(e.data)}}var Ta=new Uint8Array([14]);function Lb(){return fixEncoderSize(getBytesEncoder(),1).encode(Ta)}function fa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(O())]]),e=>({...e,discriminator:Ta}))}function la(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Bb(){return combineCodec(fa(),la())}function Sa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),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),...a],data:fa().encode(c),programAddress:r})}function Ob(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:la().decode(e.data)}}var Ca=new Uint8Array([25]);function Fb(){return fixEncoderSize(getBytesEncoder(),1).encode(Ca)}function Da(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(O())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ca}))}function Ma(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function zb(){return combineCodec(Da(),Ma())}function Ea(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),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),...a],data:Da().encode(c),programAddress:r})}function Kb(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ma().decode(e.data)}}var Ra=new Uint8Array([12]);function Xb(){return fixEncoderSize(getBytesEncoder(),1).encode(Ra)}function va(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Ra}))}function ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function $b(){return combineCodec(va(),ba())}function _a(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...a],data:va().encode(c),programAddress:r})}function Qb(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:ba().decode(e.data)}}var La=new Uint8Array([23]);function o_(){return fixEncoderSize(getBytesEncoder(),1).encode(La)}function Ba(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:La}))}function Oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function c_(){return combineCodec(Ba(),Oa())}function wa(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.transactionBuffer),...a],data:Ba().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:Oa().decode(e.data)}}var Ha=new Uint8Array([11]);function m_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ha)}function Va(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(O())]]),e=>({...e,discriminator:Ha}))}function Ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function p_(){return combineCodec(Va(),Ga())}function Fa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),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),...a],data:Va().encode(c),programAddress:r})}function T_(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ga().decode(e.data)}}var Ja=new Uint8Array([22]);function D_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ja)}function ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(O())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ja}))}function qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function M_(){return combineCodec(ja(),qa())}function Ya(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),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),...a],data:ja().encode(c),programAddress:r})}function E_(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:qa().decode(e.data)}}var $a=new Uint8Array([15]);function __(){return fixEncoderSize(getBytesEncoder(),1).encode($a)}function Qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:$a}))}function ei(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function U_(){return combineCodec(Qa(),ei())}function ti(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=m({}),a=p(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:Qa().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:ei().decode(e.data)}}var si=new Uint8Array([26]);function N_(){return fixEncoderSize(getBytesEncoder(),1).encode(si)}function oi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:si}))}function ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function H_(){return combineCodec(oi(),ci())}function ai(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...a],data:oi().encode(c),programAddress:r})}function V_(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:ci().decode(e.data)}}var ui=new Uint8Array([16]);function q_(){return fixEncoderSize(getBytesEncoder(),1).encode(ui)}function Ai(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Ct()],["secp256r1VerifyArgs",getArrayEncoder(Q())]]),e=>({...e,discriminator:ui}))}function gi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Dt()],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function Y_(){return combineCodec(Ai(),gi())}function yi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ai().encode(c),programAddress:r})}function Z_(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:gi().decode(e.data)}}var Ti=new Uint8Array([27]);function nU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ti)}function fi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Ct()],["secp256r1VerifyArgs",getArrayEncoder(Q())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ti}))}function li(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Dt()],["secp256r1VerifyArgs",getArrayDecoder(ee())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function sU(){return combineCodec(fi(),li())}function Si(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:fi().encode(c),programAddress:r})}function oU(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:li().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",wS=(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))(wS||{});function zU(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 kS=(f=>(f[f.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",f[f.ChangeConfig=1]="ChangeConfig",f[f.ChangeConfigCompressed=2]="ChangeConfigCompressed",f[f.CompressSettingsAccount=3]="CompressSettingsAccount",f[f.CreateDomainConfig=4]="CreateDomainConfig",f[f.CreateDomainUserAccount=5]="CreateDomainUserAccount",f[f.CreateGlobalCounter=6]="CreateGlobalCounter",f[f.CreateMultiWalletCompressed=7]="CreateMultiWalletCompressed",f[f.CreateUserAccounts=8]="CreateUserAccounts",f[f.DecompressSettingsAccount=9]="DecompressSettingsAccount",f[f.DisableDomainConfig=10]="DisableDomainConfig",f[f.EditDomainConfig=11]="EditDomainConfig",f[f.EditTransactionManagerUrl=12]="EditTransactionManagerUrl",f[f.EditUserDelegate=13]="EditUserDelegate",f[f.MigrateCompressedSettings=14]="MigrateCompressedSettings",f[f.MigrateCompressedUsers=15]="MigrateCompressedUsers",f[f.NativeTransferIntent=16]="NativeTransferIntent",f[f.NativeTransferIntentCompressed=17]="NativeTransferIntentCompressed",f[f.TokenTransferIntent=18]="TokenTransferIntent",f[f.TokenTransferIntentCompressed=19]="TokenTransferIntentCompressed",f[f.TransactionBufferClose=20]="TransactionBufferClose",f[f.TransactionBufferCloseCompressed=21]="TransactionBufferCloseCompressed",f[f.TransactionBufferCreate=22]="TransactionBufferCreate",f[f.TransactionBufferCreateCompressed=23]="TransactionBufferCreateCompressed",f[f.TransactionBufferExecute=24]="TransactionBufferExecute",f[f.TransactionBufferExecuteCompressed=25]="TransactionBufferExecuteCompressed",f[f.TransactionBufferExtend=26]="TransactionBufferExtend",f[f.TransactionBufferExtendCompressed=27]="TransactionBufferExtendCompressed",f[f.TransactionBufferVote=28]="TransactionBufferVote",f[f.TransactionBufferVoteCompressed=29]="TransactionBufferVoteCompressed",f[f.TransactionExecute=30]="TransactionExecute",f[f.TransactionExecuteCompressed=31]="TransactionExecuteCompressed",f[f.TransactionExecuteSync=32]="TransactionExecuteSync",f[f.TransactionExecuteSyncCompressed=33]="TransactionExecuteSyncCompressed",f))(kS||{});function KU(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 HS=6e3,VS=6001,GS=6002,FS=6003,zS=6004,KS=6005,JS=6006,jS=6007,qS=6008,YS=6009,ZS=6010,XS=6011,$S=6012,QS=6013,ex=6014,tx=6015,rx=6016,nx=6017,sx=6018,ox=6019,cx=6020,ax=6021,ix=6022,dx=6023,ux=6024,Ax=6025,gx=6026,yx=6027,mx=6028,px=6029,Tx=6030,fx=6031,lx=6032,Sx=6033,xx=6034,Ix=6035,Cx=6036,Dx=6037,Mx=6038,Ex=6039,hx=6040,Px=6041,Rx=6042,vx=6043,bx=6044,_x=6045,Ux=6046,Wx=6047,Lx=6048,Bx=6049,Ox=6050,wx=6051,kx=6052,Nx=6053,xi;process.env.NODE_ENV!=="production"&&(xi={[Tx]:"This member is already delegated to another wallet.",[jS]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[Bx]:"The domain configuration account is disabled. Please contact support or try again later.",[Ox]:"Missing domain configuration account.",[ZS]:"Duplicate public keys detected among members. Each member must have a unique key.",[YS]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[cx]:"No members provided. A multisig wallet must contain at least one member.",[sx]:"Expected a User with Administrator role for this instruction.",[qS]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[rx]:"Expected a User with Transaction Manager role for this instruction.",[Ex]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[hx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Px]:"Declared buffer size does not match the actual serialized size.",[Sx]:"Not enough members with vote permission to meet the approval threshold.",[fx]:"At least one signer with execute permission is required to proceed.",[lx]:"At least one signer with initiate permission is required to perform this action.",[Ax]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[Nx]:"Address Tree supplied is not part of the whitelisted address trees",[ox]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[yx]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Mx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[xx]:"Only delegated members are allowed for this transaction.",[ux]:"Unexpected number of accounts provided for this instruction.",[QS]:"User with Permanent Member role requires a must have a delegated wallet.",[VS]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[zS]:"The extracted public key has an invalid length or encoding.",[HS]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[FS]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[Wx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[ix]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[nx]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[tx]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[dx]:"Malformed transaction message: structure or formatting does not match the expected layout.",[gx]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[KS]:"The extracted WebAuthn signed message payload is malformed.",[_x]:"An input string exceeds the maximum allowed character length.",[wx]:"This member is not registered under the provided domain configuration.",[mx]:"A required account is missing from the instruction context.",[Ux]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[px]:"User mutation arguments are required when performing add or remove delegate operations.",[Cx]:"No valid signer found in this transaction.",[$S]:"Only one permanent member is allowed per wallet.",[ex]:"Only one transaction manager is allowed per wallet.",[kx]:"The given origin index is not in the whitelisted origins.",[XS]:"Permanent members cannot be removed from a wallet.",[bx]:"Writable CPI calls to protected accounts are not permitted.",[JS]:"The rpIdHash extracted from the signed message does not match the expected value.",[GS]:"The signature index provided is out of bounds for the secp256r1 instruction.",[Lx]:"The specified slot number was not found in the provided slot history.",[ax]:"Too many members: a maximum of 4 members are supported.",[Rx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[vx]:"This transaction has not yet reached the required approval threshold.",[Dx]:"Only the transaction creator or rent payer may close this transaction buffer.",[Ix]:"Member is not part of the expected signers for this transaction."});function XU(e){return process.env.NODE_ENV!=="production"?xi[e]:"Error message not available in production bundles."}function $U(e,n,r){return isProgramError(e,n,A,r)}var vt={Ed25519:1,Secp256r1:2};var Ie={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Me=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(Ie).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var fn=33,ye=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!==fn)throw new Error(`Invalid public key length, expected ${fn} 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===fn)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()}},C=class extends ye{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 Gx(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function Fx(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var Ci=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(Gx())],["addressTableLookups",getArrayCodec(Fx())]]);function Di(e){return Ci.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 Mi(e){let n=Ci.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}featureFlags.version=VERSION.V2;var Ei="revibase.com",hi="https://auth.revibase.com",Pi="https://api.revibase.com";var Ge=null,vi=2e3,bi=3e3,Jx=300*1e3;async function $t({authUrl:e,signer:n,popUp:r=null,data:s}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");return new Promise((t,c)=>{let i=new URL(e).origin,a=null,o=setInterval(()=>{r&&r.closed&&(u(),c(new Error("User closed the authentication window")));},500),d=setTimeout(()=>{u(),c(new Error("Authentication timed out"));},Jx);function u(){clearInterval(o),clearTimeout(d),a&&clearTimeout(a),Ge&&window.removeEventListener("message",Ge),r&&r.close();}if(r?r.location.replace(e):r=Li(e),!r){c(new Error("Disable your popup blocker to continue."));return}let y=g=>{let l=g.origin===i,T=g.source===r;if(!(!l||!T||!g.isTrusted||!r))switch(g.data.type){case "popup-ready":r.postMessage({type:"popup-init",payload:{signer:n?.toString(),data:s}},i),a=setTimeout(()=>{u(),c(new Error("User closed the authentication window"));},vi+bi);break;case "popup-complete":try{let D=JSON.parse(g.data.payload);u(),t(D);}catch{c(new Error("Failed to parse response payload"));}break;case "popup-heartbeat":a&&(clearTimeout(a),a=setTimeout(()=>{u(),c(new Error("User closed the authentication window"));},vi+bi));break;case "popup-closed":u(),c(new Error("User closed the authentication window"));break}};Ge&&window.removeEventListener("message",Ge),Ge=y,window.addEventListener("message",Ge);})}function Qt(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Be(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),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return c}function er(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function jx(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 _i(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 Ui(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 i=e[s]|e[s+1]<<8;if(s+=2,s+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(s,s+i),o=t.decode(a);r.push(o),s+=i;}return r}function Wi(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 v=n&127;r+=v;}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 i=e[r+1],a=r+2,o=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let y=new Uint8Array(32);y.set(d,32-d.length);let g=p256.Point.CURVE().n>>1n,l=BigInt("0x"+er(u)),D=(l>g?p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),I=jx(D);return new Uint8Array([...y,...I])}function Li(e=`${he()}/loading`){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let n=window.innerWidth||screen.availWidth,r=window.innerHeight||screen.availHeight,s=n<=768,t,c,i,a;if(s)t=n,c=r,i=0,a=0;else {let u=window.screenLeft??window.screenX,y=window.screenTop??window.screenY,g=window.innerWidth??document.documentElement.clientWidth??screen.width,l=window.innerHeight??document.documentElement.clientHeight??screen.height;t=500,c=600,a=u+(g-t)/2,i=y+(l-c)/2;}let o=[`width=${t}`,`height=${c}`,`top=${i}`,`left=${a}`,"toolbar=no","location=no","status=no","menubar=no","scrollbars=yes","resizable=yes"].join(","),d=window.open(e,"_blank",o);return d&&d.focus(),d}function FW(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+er(n.get(-2))),y:BigInt("0x"+er(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function Oi(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 zW(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Be(n)),c=JSON.parse(new TextDecoder().decode(Be(r))),i=_i(c),a=Wi(new Uint8Array(Be(s))),o=await ze({rpIdHash:t.subarray(0,32)});return new C(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Be(r)),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:xn(e.clientId,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}async function KW(e,n){let{data:r}=await Nn(oe(),e),t=Ui(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 xn(e,n,r){return sha256(new Uint8Array([...getBase58Encoder().encode(e),...getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function Fe(e){return sha256(In(e))}function In(e){return new Uint8Array([...new Uint8Array(Be(e.response.authenticatorData)),...sha256(new Uint8Array(Be(e.response.clientDataJSON)))])}async function Dn(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await oe().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 i=Math.ceil((s.unitsConsumed??0)*1.1)||8e5;return i>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:i})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function Ni(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,i)=>c-i);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function Hi(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,[,i]=c;throw console.error(t??s),new Error(`Simulation failed: ${i}`)}return s.value.transactionResults.map(c=>c.unitsConsumed)}function G(e,n=0){let r=e instanceof C?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,i=r?.authData&&r.verifyArgs?.clientDataJson?In(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:i,publicKey:a}}function Ke(e){if(e instanceof ye)return {keyType:vt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:vt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function ki(e){return e instanceof C?e.toString():e.address.toString()}function me(e){let n=new Set,r=[];for(let s of e)n.has(ki(s))||(r.push(s),n.add(ki(s)));if(r.filter(s=>s instanceof C).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function Vi({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 Gi(e){let n=await fetch(`${e}/getRandomPayer`),{randomPayer:r}=await n.json();return {address:address(r),async signTransactions(s){let t={publicKey:r,transactions:s.map(a=>getBase64Decoder().decode(getTransactionEncoder().encode(a)))},i=await(await fetch(`${e}/sign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json();if("error"in i)throw new Error(i.error);return i.signatures.map(a=>({[address(r)]:getBase58Encoder().encode(a)}))}}}var _={};function Je(){if(!_.solanaRpcEndpoint)throw new Error("Rpc is not initialized yet.");return _.solanaRpcEndpoint}function Oe(){if(!_.lightProtocolRpc)throw new Error("Rpc is not initialized yet");return _.lightProtocolRpc}function oe(){if(!_.solanaRpc)throw new Error("Rpc is not initialized yet");return _.solanaRpc}function Fi(){if(!_.sendAndConfirm)throw new Error("Rpc is not initialized yet.");return _.sendAndConfirm}function zi(){if(!_.computeEstimate)throw new Error("Rpc is not initialized yet");return _.computeEstimate}async function aL(){return _.feePayer||(_.feePayer=await Gi(_.apiEndpoint??Pi)),_.feePayer}function Mn(){if(!_.jitoTipsConfig)throw new Error("Jito Bundle Config is not set.");return _.jitoTipsConfig}function he(){return _.authEndpoint??hi}function Ki(){return _.rpId??Ei}function je(){if(!_.clientSettings)throw new Error("No client settings found.");return _.clientSettings}function iL(){Object.keys(_).forEach(e=>{_[e]=void 0;});}function dL({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,rpId:i,clientSettings:a}){_.solanaRpcEndpoint=e,_.lightProtocolRpc=createRpc(e,r,n);let{rpc:o,sendAndConfirmTransaction:d}=createSolanaClient({urlOrMoniker:e});_.solanaRpc=o,_.sendAndConfirm=d,_.computeEstimate=estimateComputeUnitLimitFactory({rpc:o}),_.apiEndpoint=t??null,_.jitoTipsConfig=s??null,_.authEndpoint=c??null,_.rpId=i??null,_.clientSettings=a??null;}var U=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(A.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=Je().includes("devnet")?localTestActiveStateTreeInfos():await Oe().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees: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 rr(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await qi(e);return s&&n?.set(e.toString(),s),s}}async function ce(e,n){let s=(await Promise.all(e.map(async t=>rr(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 b(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 ae(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:s[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function q(e,n,r,s,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:s[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let o=e.packTreeInfos(a,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((u,y)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:o.packedTreeInfos[y],address:new Uint8Array(u.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Se(e,n,r,s,t){let c=null,i=null,a=new U;if(e){await a.addSystemAccounts();let{address:o}=await J(n,r),d=(await ce([{address:o,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[d.leafIndex],leaves:[],treeInfos:[d.treeInfo],proveByIndices:[d.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([d],[]);let u=a.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!u)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:u.packedTreeInfos[0]},data:z().decode(d.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:a}}async function k(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await Oe().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(i=>setTimeout(i,s));}throw new Error(`Failed to get validity proof after ${r} attempts`)}async function xe(){return (await nr()).length-1}var En;async function nr(){if(!En){let{data:e}=await ws(oe(),await Yi());En=e.whitelistedAddressTrees;}return En}async function sr(e,n,r){let s=await LI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function LI(e,n,r){let{address:s}=await N(e,n),t=await rr(s,r);return t?.data?.data?te().decode(t.data.data):null}async function _t(e,n,r){let s=await BI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function BI(e,n,r){try{let{address:s}=await J(e,n),t=await rr(s,r);if(!t?.data?.data)return null;let c=z().decode(t.data.data);return c.data.__option==="None"?null:{...c.data.value,isCompressed:!0}}catch{let s=await Fr(oe(),await Y(e));return s.exists?{...s.data,members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function hn(e){let n=await nr();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function BL(e){let r=(await nr()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function qi(e){let n=await rpcRequest(Oe().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=Je().includes("devnet")?localTestActiveStateTreeInfos():await Oe().getStateTreeInfos(),c=getStateTreeInfoByPubkey(t,s),i=r.result.value;return createCompressedAccountWithMerkleContextLegacy(createMerkleContextLegacy(c,i.hash,i.leafIndex),i.owner,bn(i.lamports),i.data?parseAccountData(i.data):void 0,i.address||void 0)}async function J(e,n=0){let r=await hn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("multi_wallet")),new Uint8Array(getU128Encoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(A)).toString(),"base58"),addressTree:new PublicKey(r)}}async function N(e,n=0){let r=await hn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),e instanceof ye?e.toTruncatedBuffer():new Uint8Array(getAddressEncoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(A.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:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function sd(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function Yi(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function od(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof ye?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function Ce(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function Y(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function cd(e){let n=await Y(e);return await Ce(n)}async function zL(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function nB(e){let n=await Dn(e,true),r=await Hi(n.map(getBase64EncodedWireTransaction),Je()),s=await Dn(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await XI(s.map(getBase64EncodedWireTransaction))}async function sB({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await oe().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[i,a]=await Promise.all([zi()(c),Ni(oe(),c.instructions.flatMap(d=>d.accounts??[]))]),o=Math.ceil(i*1.1);return prependTransactionMessageInstructions([...o>2e5?[getSetComputeUnitLimitInstruction({units:o})]:[],...a>0?[getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await Fi()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}async function XI(e,n=10,r=1e3,s=Mn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let i=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(i.status===429&&c<n){await new Promise(o=>setTimeout(o,r));continue}let a=await i.json();if(a.error)throw new Error(`Error sending bundles: ${JSON.stringify(a.error,null,2)}`);return a.result}throw new Error("Failed to send bundle after retries.")}async function oB(e,n=30,r=3e3,s=Mn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let i=await fetch(`${t}/getBundleStatuses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});if(i.status===429&&c<n){await new Promise(d=>setTimeout(d,r));continue}let a=await i.json();if(a.error)throw new Error(`Error sending bundles: ${JSON.stringify(a.error,null,2)}`);let o=a.result;if(o.value.length){let d=o.value[0];if(d.confirmation_status==="confirmed"||d.confirmation_status==="finalized")return d.transactions[d.transactions.length-1]}if(c<n){await new Promise(d=>setTimeout(d,r));continue}}throw new Error("Failed to get bundle status after retries.")}async function cB(e,n,r,s){let t=await _t(n,r,s);if(t.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:c}=t.members.find(u=>dd(u.pubkey)===e.toString())??{};if(!c)throw new Error("No permissions found for the current member.");let i=Me.has(c,Ie.InitiateTransaction),a=Me.has(c,Ie.VoteTransaction),o=Me.has(c,Ie.ExecuteTransaction);if(i&&a&&o)return {};if(!a||!o)throw new Error("Signer lacks the required Vote/Execute permissions.");let d=t.members.find(u=>u.role===2);if(!d)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:address(dd(d.pubkey)),userAddressTreeIndex:d.userAddressTreeIndex}}async function aB({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await sr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return $I(n,c.transactionManagerUrl.value,e,s)}function $I(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(getBase64EncodedWireTransaction)};if(s&&(c.transactionMessageBytes=getBase64Decoder().decode(s)),r){let{clientId:o,signClientMessage:d}=je();c.authResponses=await Promise.all(r.map(async u=>({...u,clientSignature:{clientId:o,signature:(await d("complete",getBase64Decoder().decode(Fe(u.authResponse)))).signature}})));}let a=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json();if("error"in a)throw new Error(a.error);return a.signatures.map(o=>({[e]:getBase58Encoder().encode(o)}))}}}function dd(e){return e.keyType===vt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}async function hB({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let{addDelegates:i,removeDelegates:a}=await nC(r),o=new U,d=null,u=null,y=[];if(i.length||a.length||t){let S=await sC({packedAccounts:o,addDelegates:i,removeDelegates:a,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:c});d=S.proof,u=S.settingsMutArgs??null,y=S.userMutArgs??[];}let{configActions:g,secp256r1VerifyInput:l}=await oC({configActionsArgs:r,packedAccounts:o,userMutArgs:y}),{remainingAccounts:T,systemOffset:D}=o.toAccountMetas(),I=b(d,D);return {instructions:t?[to({configActions:g,payer:s,authority:createNoopSigner(await cd(e)),compressedProofArgs:I,settingsMut:u,remainingAccounts:T})]:[await Ys({settingsIndex:e,configActions:g,payer:s,compressedProofArgs:I,remainingAccounts:T})],secp256r1VerifyInput:l}}async function nC(e){let n=[],r=[];for(let s of e)switch(s.type){case "AddMembers":{let t=await Promise.all(s.members.map(c=>N(c.member,c.userAddressTreeIndex)));for(let c of t)n.push({address:c.address,type:"User"});break}case "RemoveMembers":{let t=await Promise.all(s.members.map(c=>N(c.member,c.userAddressTreeIndex)));for(let c of t)r.push({address:c.address,type:"User"});break}}return {addDelegates:n,removeDelegates:r}}async function sC({packedAccounts:e,addDelegates:n,removeDelegates:r,compressed:s,index:t,settingsAddressTreeIndex:c,cachedAccounts:i}){await e.addSystemAccounts();let a=[];if(s){let T=(await J(t,c)).address;a.push({address:T,type:"Settings"});}r.length&&a.push(...r),n.length&&a.push(...n);let o=a.length?await ce(a,i):[];if(!o.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let d=await k(o,[]),u=[],y=[];for(let T of o)T.type==="Settings"?u.push(T):T.type==="User"&&y.push(T);let g,l=[];if(s&&d&&(g=q(e,d.treeInfos.slice(0,1),d.leafIndices.slice(0,1),d.rootIndices.slice(0,1),d.proveByIndices.slice(0,1),u,z())[0]),y.length&&d){let T=s?1:0;l=q(e,d.treeInfos.slice(T),d.leafIndices.slice(T),d.rootIndices.slice(T),d.proveByIndices.slice(T),y,te());}return {proof:d,settingsMutArgs:g,userMutArgs:l}}async function oC({configActionsArgs:e,packedAccounts:n,userMutArgs:r}){let s=[],t=[];for(let c of e)switch(c.type){case "AddMembers":{let i=[];for(let a of c.members)if(a.member instanceof C){let o=s.length,{message:d,signature:u,publicKey:y,domainConfig:g}=G(a.member,o);d&&u&&y&&s.push({message:d,signature:u,publicKey:y}),g&&n.addPreAccounts([{address:g,role:AccountRole.READONLY}]);let l=await N(a.member,a.userAddressTreeIndex).then(T=>r.find(D=>new Rn(new Uint8Array(D.accountMeta.address)).eq(T.address)));if(!l)throw new Error("Unable to find user account");i.push(ud({permissionArgs:a.permissions,index:o,userMutArgs:l,pubkey:a.member}));}else {let o=await N(a.member,a.userAddressTreeIndex).then(d=>r.find(u=>new Rn(new Uint8Array(u.accountMeta.address)).eq(d.address)));if(!o)throw new Error("Unable to find user account");i.push(ud({permissionArgs:a.permissions,index:-1,userMutArgs:o,pubkey:a.member}));}t.push({__kind:c.type,fields:[i]});break}case "RemoveMembers":{let i=await Promise.all(c.members.map(a=>N(a.member,a.userAddressTreeIndex).then(o=>{let d=r.find(u=>new Rn(new Uint8Array(u.accountMeta.address)).eq(o.address));if(!d)throw new Error("Unable to find user account");return aC({pubkey:a.member,userMutArgs:d})})));t.push({__kind:c.type,fields:[i]});break}case "EditPermissions":{let i=c.members.map(a=>cC({permissionArgs:a.permissions,pubkey:a.member}));t.push({__kind:c.type,fields:[i]});break}default:t.push({__kind:c.type,fields:[c.threshold]});}return {configActions:t,secp256r1VerifyInput:s}}function cC({pubkey:e,permissionArgs:n}){return {memberKey:Ke(e),permissions:Ad(n)}}function aC({pubkey:e,userMutArgs:n}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:Ke(e),userMutArgs:n}}function ud({pubkey:e,permissionArgs:n,index:r,userMutArgs:s}){if(s.data.role===1){if(s.data.delegatedTo.__option==="Some")throw new Error("This user is already registered as a permanent member in another wallet. A permanent member can only belong to one wallet.")}else if(s.data.role===2&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:Ke(e),permissions:Ad(n),verifyArgs:e instanceof C&&e.verifyArgs&&r!==-1?some({truncatedClientDataJson:e.verifyArgs.truncatedClientDataJson,slotNumber:e.verifyArgs.slotNumber,signedMessageIndex:r,originIndex:e.originIndex,crossOrigin:e.crossOrigin,clientAndDeviceHash:e.clientAndDeviceHash}):none(),userMutArgs:s}}function Ad(e){let n=[];return e.initiate&&n.push(Ie.InitiateTransaction),e.vote&&n.push(Ie.VoteTransaction),e.execute&&n.push(Ie.ExecuteTransaction),Me.fromPermissions(n)}var Ye=33,Ze=64,Un=14,mC=2,pC=address("Secp256r1SigVerify1111111111111111111111111");function TC(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function fC(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function pd(){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=fC();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=Un;let i=[];for(let a=0;a<r;a++){let o=fixDecoderSize(getBytesDecoder(),Ye).decode(e,n);n+=Ye;let d=fixDecoderSize(getBytesDecoder(),Ze).decode(e,n);n+=Ze;let u=t[a].messageDataSize,y=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:o,signature:d,message:y});}return [{numSignatures:r,padding:s,offsets:t,payload:i},n]}})}function Td(){return createEncoder({getSizeFromValue:e=>{let n=Un*e.offsets.length,r=e.payload.reduce((s,t)=>s+Ye+Ze+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=TC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),Ye).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),Ze).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function vB(){return combineCodec(Td(),pd())}function F(e,n){let r=e.length,s=mC+r*Un,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,y=u+Ye,g=y+Ze;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:y,signatureInstructionIndex:65535,messageDataOffset:g,messageDataSize:d.length,messageInstructionIndex:65535}),s+=Ye+Ze+d.length;}let c=n?.programAddress??pC,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:Td().encode(i)}}function bB(e){return {programAddress:e.programAddress,accounts:{},data:pd().decode(e.data)}}async function HB({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=await Y(e),{address:a}=await J(e,n),o=await ce([{address:a,type:"Settings"}],t),d=await k(o,[]),u=q(c,d.treeInfos,d.leafIndices,d.rootIndices,d.proveByIndices,o.filter(x=>x.type==="Settings"),z())[0],y=me(s),g=y.filter(x=>x instanceof C),l=[],T=[];for(let x of g){let L=l.length,{domainConfig:W,verifyArgs:j,signature:H,publicKey:V,message:B}=G(x,L);B&&H&&V&&l.push({message:B,signature:H,publicKey:V}),W&&(c.addPreAccounts([{address:W,role:AccountRole.READONLY}]),j?.__option==="Some"&&T.push({domainConfigKey:W,verifyArgs:j.value}));}c.addPreAccounts(y.filter(x=>"address"in x).map(x=>({address:x.address,role:AccountRole.READONLY_SIGNER,signer:x})));let{remainingAccounts:D,systemOffset:I}=c.toAccountMetas(),v=b(d,I),S=[];return l.length>0&&S.push(F(l)),S.push(ao({settings:i,settingsMutArgs:u,compressedProofArgs:v,payer:r,secp256r1VerifyArgs:T,remainingAccounts:D})),S}async function FB({admin:e,addressTree:n}){return Fs({payer:e,addressTree:n,remainingAccounts:[]})}async function ZB({payer:e,rpId:n,origins:r,authority:s}){let t=await ze({rpId:n}),c=new U;await c.addSystemAccounts();let i=await xe(),{address:a,addressTree:o}=await N(s.address,i),d=[{address:a,tree:o,queue:o,type:"User"}],u=await k([],d),y=(await ae(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:g,systemOffset:l}=c.toAccountMetas(),T=b(u,l);return await lo({origins:r,authorityCreationArgs:y,authority:s,compressedProofArgs:T,payer:e,domainConfig:t,rpId:n,remainingAccounts:g})}async function cO({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=[];r.index&&(i.push({address:(await J(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&i.push({address:(await N(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let a=i.length?await ce(i,t):[],o=await xe(),{address:d,addressTree:u}=await N(r.member,o),y=[{address:d,type:"User",tree:u,queue:u}],g=await k(a,y),l=null,T=null,D=a.filter(W=>W.type==="Settings"),I=a.filter(W=>W.type==="User");D.length&&(l=q(c,g.treeInfos.slice(0,1),g.leafIndices.slice(0,1),g.rootIndices.slice(0,1),g.proveByIndices.slice(0,1),D,z())[0]),I.length&&(T=q(c,g.treeInfos.slice(1,2),g.leafIndices.slice(1,2),g.rootIndices.slice(1,2),g.proveByIndices.slice(1,2),I,te())[0]);let v=await ae(c,g.treeInfos.slice(a.length),g.roots.slice(a.length),g.rootIndices.slice(a.length),y),{remainingAccounts:S,systemOffset:x}=c.toAccountMetas(),L=b(g,x);return await Co({payer:n,authority:e,compressedProofArgs:L,member:pt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:l?some({settingsMutArgs:l,transactionManager:T?some(T):none()}):none(),userAccountCreationArgs:v[0],domainConfig:s,remainingAccounts:S})}async function uO({payer:e}){let n=await sd();return ho({payer:e,globalCounter:n})}async function fO({createUserArgs:e,payer:n}){let r=new U;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:AccountRole.READONLY_SIGNER,signer:u.member})));let s=await xe(),t=await Promise.all(e.map(async u=>{let{address:y,addressTree:g}=await N(u.member.address,s);return {address:y,tree:g,queue:g,type:"User"}})),c=await k([],t),i=await ae(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:o}=r.toAccountMetas(),d=b(c,o);return await Bo({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,y)=>({member:u.member.address,role:u.role,userCreationArgs:i[y],transactionManagerUrl:u.role===2?u.transactionManagerUrl:null})),remainingAccounts:a})}async function IO({admin:e,rpId:n,disable:r}){let s=await ze({rpId:n});return jo({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function RO({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let i=new U;await i.addSystemAccounts();let a=await xe(),{address:o,addressTree:d}=await N(r.address,a),u=[{address:o,tree:d,queue:d,type:"User"}],y=await k([],u),g=(await ae(i,y.treeInfos,y.roots,y.rootIndices,u))[0],l=i.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:b(y,l.systemOffset),authorityCreationArgs:g};}return Qo({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function LO({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new U;await s.addSystemAccounts();let t=await ce([{address:(await N(e.address,n)).address,type:"User"}]),c=await k(t,[]),i=q(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,te())[0],{remainingAccounts:a,systemOffset:o}=s.toAccountMetas(),d=b(c,o);return oc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function zO({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:o,publicKey:d}=G(n),u=[];a&&o&&d&&u.push({message:a,signature:o,publicKey:d});let y=await sr(n instanceof C?n:n.address,r,t),g=[];g.push({address:(await N(n instanceof C?n:n.address,r)).address,type:"User"});let l,T=null,D,I=null;y.delegatedTo.__option==="Some"&&((await _t(y.delegatedTo.value.index,y.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(g.push({address:(await J(y.delegatedTo.value.index,y.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),T={start:g.length-1,end:g.length}):l=await Y(y.delegatedTo.value.index)),s&&((await _t(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(g.push({address:(await J(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),I={start:g.length-1,end:g.length}):D=await Y(s.index));let v=new U;await v.addSystemAccounts();let S=await ce(g,t),x=await k(S,[]),L=q(v,x.treeInfos.slice(0,1),x.leafIndices.slice(0,1),x.rootIndices.slice(0,1),x.proveByIndices.slice(0,1),S.slice(0,1),te())[0],W=T?some(q(v,x.treeInfos.slice(T.start,T.end),x.leafIndices.slice(T.start,T.end),x.rootIndices.slice(T.start,T.end),x.proveByIndices.slice(T.start,T.end),S.slice(T.start,T.end),z())[0]):none(),j=I?some(q(v,x.treeInfos.slice(I.start,I.end),x.leafIndices.slice(I.start,I.end),x.rootIndices.slice(I.start,I.end),x.proveByIndices.slice(I.start,I.end),S.slice(I.start,I.end),z())[0]):none(),{remainingAccounts:H,systemOffset:V}=v.toAccountMetas(),B=b(x,V),re=[];return u.length>0&&re.push(F(u)),re.push(Ac({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof C?void 0:n,oldSettings:l,oldSettingsMutArgs:W,newSettings:D,newSettingsMutArgs:j,compressedProofArgs:B,userMutArgs:L,remainingAccounts:H})),re}async function XO({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new U;await t.addSystemAccounts();let{address:c,addressTree:i}=await J(r,s),a=[{address:c,tree:i,queue:i,type:"Settings"}],o=await k([],a),d=(await ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:y}=t.toAccountMetas(),g=b(o,y);return fc({compressedProofArgs:g,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function sw({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new U;await t.addSystemAccounts();let{address:c,addressTree:i}=await N(r,s),a=[{address:c,tree:i,queue:i,type:"User"}],o=await k([],a),d=(await ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:y}=t.toAccountMetas(),g=b(o,y);return Dc({compressedProofArgs:g,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}async function hw({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let{domainConfig:c,verifyArgs:i,message:a,signature:o,publicKey:d}=G(r),u=[];a&&o&&d&&u.push({message:a,signature:o,publicKey:d});let y=new U;await y.addSystemAccounts();let g=[],l=[];l.push(...await ce([{address:(await N("address"in r?r.address:r,s)).address,type:"User"}],t));let T=await xe(),{address:D,addressTree:I}=await J(e,T);g.push({address:D,queue:I,tree:I,type:"Settings"});let v=l.length,S=await k(l,g),x=q(y,S.treeInfos.slice(0,v),S.leafIndices.slice(0,v),S.rootIndices.slice(0,v),S.proveByIndices.slice(0,v),l.filter(re=>re.type==="User"),te())[0],W=(await ae(y,S.treeInfos.slice(v),S.roots.slice(v),S.rootIndices.slice(v),g)).find(re=>re.type==="Settings")??null;c?y.addPreAccounts([{address:c,role:AccountRole.READONLY}]):"address"in r&&y.addPreAccounts([{address:r.address,role:AccountRole.READONLY_SIGNER,signer:r}]);let{remainingAccounts:j,systemOffset:H}=y.toAccountMetas(),V=b(S,H),B=[];if(!W)throw new Error("Settings creation args is missing.");return u.length>0&&B.push(F(u)),B.push(await _o({settingsIndex:e,payer:n,initialMember:r instanceof C?void 0:r,secp256r1VerifyArgs:i,domainConfig:c,userMutArgs:x,compressedProofArgs:V,settingsCreation:W,remainingAccounts:j})),B}async function Ow({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=await ce([{address:(await J(e,n)).address,type:"Settings"}],t),a=await k(i,[]),o=q(c,a.treeInfos,a.leafIndices,a.rootIndices,a.proveByIndices,i.filter(S=>S.type==="Settings"),z())[0],d=me(s),u=d.filter(S=>S instanceof C),y=[],g=[];for(let S of u){let x=y.length,{domainConfig:L,verifyArgs:W,signature:j,publicKey:H,message:V}=G(S,x);V&&j&&H&&y.push({message:V,signature:j,publicKey:H}),L&&(c.addPreAccounts([{address:L,role:AccountRole.READONLY}]),W?.__option==="Some"&&g.push({domainConfigKey:L,verifyArgs:W.value}));}c.addPreAccounts(d.filter(S=>"address"in S).map(S=>({address:S.address,role:AccountRole.READONLY_SIGNER,signer:S})));let{remainingAccounts:l,systemOffset:T}=c.toAccountMetas(),D=b(a,T),I=[];y.length>0&&I.push(F(y));let v=await Y(e);return I.push(Vo({settings:v,payer:r,settingsMut:o,compressedProofArgs:D,secp256r1VerifyArgs:g,remainingAccounts:l})),I}function CC(e,n,r,s){let t=DC(e,n),c=MC(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function DC(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=s-t,a=r-s-c;return n>=r?false:n<i?true:n>=s?n-s<a:false}function MC(e,n){return n<e.header.numSignerAccounts}async function cr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Mi(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),oe()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,o]of t.staticAccounts.entries())i.push({address:o,role:CC(t,a,o,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let o=c[a.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.READONLY});}}for(let a of s?.filter(o=>o.address!==e)??[]){let o=i.findIndex(d=>d.address===a.address);o===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[o].role===AccountRole.READONLY||i[o].role===AccountRole.READONLY_SIGNER?i[o]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[o].role===AccountRole.WRITABLE||i[o].role===AccountRole.WRITABLE_SIGNER)&&(i[o]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}async function Cd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:o=false}){let d=await Ce(e),{accountMetas:u,addressLookupTableAccounts:y}=await cr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),g=[];return c.length>0&&g.push(F(c)),g.push(o?ai({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):ti({transactionBuffer:n,payer:s.address,settings:e})),a&&g.push(Vi({payer:s,tipAmount:a})),{instructions:g,addressLookupTableAccounts:y}}async function Dd({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:i=[],compressed:a=false,simulateProof:o=false,cachedAccounts:d}){let u=me(s),y=await Y(e),g=await Ce(y),[{accountMetas:l,addressLookupTableAccounts:T,transactionMessage:D},{settingsReadonlyArgs:I,proof:v,packedAccounts:S}]=await Promise.all([cr({transactionMessageBytes:r,walletAddress:g,additionalSigners:u.filter(B=>!(B instanceof C)),addressesByLookupTableAddress:c}),Se(a,e,n,o,d)]);S.addPreAccounts(l);let x=u.filter(B=>B instanceof C),L=[];for(let B of x){let re=i.length,{domainConfig:le,verifyArgs:Pe,signature:De,publicKey:Re,message:Ut}=G(B,re);Ut&&De&&Re&&i.push({message:Ut,signature:De,publicKey:Re}),le&&(S.addPreAccounts([{address:le,role:AccountRole.READONLY}]),Pe?.__option==="Some"&&L.push({domainConfigKey:le,verifyArgs:Pe.value}));}let{remainingAccounts:W,systemOffset:j}=S.toAccountMetas(),H=[];i.length>0&&H.push(F(i));let V=hC(D,l);if(a){if(!t||!I)throw new Error("Payer not found or proof args is missing.");let B=b(v,j);H.push(Si({secp256r1VerifyArgs:L,transactionMessage:V,settingsReadonlyArgs:I,compressedProofArgs:B,payer:t,remainingAccounts:W}));}else H.push(yi({secp256r1VerifyArgs:L,settings:y,transactionMessage:V,remainingAccounts:W}));return {instructions:H,addressLookupTableAccounts:T}}function hC(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 uk({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let o=me(s),d=await Y(e),u=await Ce(d),{settingsReadonlyArgs:y,proof:g,packedAccounts:l}=await Se(a,e,n,false,t),T=[],D=[];for(let x of o)if(x instanceof C){let L=T.length,{domainConfig:W,verifyArgs:j,signature:H,publicKey:V,message:B}=G(x,L);B&&H&&V&&T.push({message:B,signature:H,publicKey:V}),W&&(l.addPreAccounts([{address:W,role:AccountRole.READONLY}]),j?.__option==="Some"&&D.push({domainConfigKey:W,verifyArgs:j.value}));}else l.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:I,systemOffset:v}=l.toAccountMetas(),S=[];if(T.length>0&&S.push(F(T)),a){if(!i||!y)throw new Error("Payer not found or proof args is missing.");let x=b(g,v);S.push(Wc({amount:c,settingsReadonlyArgs:y,compressedProofArgs:x,payer:i,secp256r1VerifyArgs:D,source:u,destination:r,remainingAccounts:I}));}else S.push(Pc({amount:c,secp256r1VerifyArgs:D,source:u,destination:r,settings:d,remainingAccounts:I}));return S}async function xk({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:o,createAtaIfNeeded:d=true,compressed:u=false}){let y=me(t),g=await Y(e),l=await Ce(g),[T,D]=await Promise.all([getAssociatedTokenAccountAddress(s,l,o),getAssociatedTokenAccountAddress(s,r,o)]),{settingsReadonlyArgs:I,proof:v,packedAccounts:S}=await Se(u,e,n,false,c),x=[],L=[];for(let V of y)if(V instanceof C){let B=x.length,{domainConfig:re,verifyArgs:le,signature:Pe,publicKey:De,message:Re}=G(V,B);Re&&Pe&&De&&x.push({message:Re,signature:Pe,publicKey:De}),re&&(S.addPreAccounts([{address:re,role:AccountRole.READONLY}]),le?.__option==="Some"&&L.push({domainConfigKey:re,verifyArgs:le.value}));}else S.addPreAccounts([{address:V.address,role:AccountRole.READONLY_SIGNER,signer:V}]);let{remainingAccounts:W,systemOffset:j}=S.toAccountMetas(),H=[];if(x.length>0&&H.push(F(x)),u){if(!a||!I)throw new Error("Payer not found or proof args is missing.");let V=b(v,j);H.push(Fc({amount:i,createAtaIfNeeded:d,settingsReadonlyArgs:I,compressedProofArgs:V,payer:a,secp256r1VerifyArgs:L,source:l,sourceTokenAccount:T,destination:r,destinationTokenAccount:D,mint:s,tokenProgram:o,remainingAccounts:W}));}else H.push(wc({amount:i,createAtaIfNeeded:d,secp256r1VerifyArgs:L,source:l,sourceTokenAccount:T,destination:r,destinationTokenAccount:D,settings:g,mint:s,tokenProgram:o,remainingAccounts:W}));return H}async function _k({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:i}){let a=await _s(oe(),s),o=a.data.multiWalletSettings,{settingsReadonlyArgs:d,proof:u,packedAccounts:y}=await Se(c,e,n,false,i),{remainingAccounts:g,systemOffset:l}=y.toAccountMetas(),{domainConfig:T,verifyArgs:D,message:I,signature:v,publicKey:S}=G(r),x=[];if(I&&v&&S&&x.push(F([{message:I,signature:v,publicKey:S}])),c){if(!t||!d)throw new Error("Payer not found or proof args is missing.");let L=b(u,l);x.push(ta({transactionBuffer:s,domainConfig:T,closer:r instanceof C?void 0:r,rentCollector:a.data.payer,secp256r1VerifyArgs:D,settingsReadonlyArgs:d,payer:t,compressedProofArgs:L,remainingAccounts:g}));}else x.push(Yc({transactionBuffer:s,domainConfig:T,closer:r instanceof C?void 0:r,settings:o,payer:a.data.payer,secp256r1VerifyArgs:D,remainingAccounts:[]}));return x}function Pd({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:y,verifyArgs:g,message:l,signature:T,publicKey:D}=G(n),I=[];if(l&&T&&D&&I.push(F([{message:l,signature:T,publicKey:D}])),d){let{settingsReadonlyArgs:v,compressedProofArgs:S,remainingAccounts:x}=d;I.push(ya({transactionBuffer:t,payer:e,secp256r1VerifyArgs:g,creator:n instanceof C?void 0:n,domainConfig:y,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},settingsReadonlyArgs:v,compressedProofArgs:S,remainingAccounts:x}));}else I.push(aa({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:g,creator:n instanceof C?void 0:n,domainConfig:y,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},remainingAccounts:[]}));return I}function Rd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:o}=G(e),d=[];return a&&i&&o&&d.push(F([{message:a,signature:i,publicKey:o}])),s?d.push(Ea({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Sa({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,remainingAccounts:[]})),d}function vd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?wa({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):_a({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function bd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:o}=G(n),d=[];return o&&i&&a&&d.push(F([{message:o,signature:i,publicKey:a}])),s?d.push(Ya({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Fa({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,remainingAccounts:[]})),d}async function fN({message:e,signer:n,popUp:r}){let{clientId:s,signClientMessage:t}=je(),c={type:"message",payload:e},i=getBase64Decoder().decode(new Uint8Array([...new TextEncoder().encode(JSON.stringify(c)),...n?n.toBuffer():[]])),{signature:a,expiry:o}=await t("start",i),d=`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}&clientId=${encodeURIComponent(s)}&signature=${encodeURIComponent(a)}&expiry=${encodeURIComponent(o)}`,u=await $t({authUrl:d,data:c,signer:n,popUp:r});return {...u,signer:new ye(u.signer)}}async function DN({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){let{clientId:c,signClientMessage:i}=je(),a={type:"transaction",payload:JSON.stringify({transactionActionType:e,transactionAddress:n,transactionMessageBytes:Qt(r)})},o=getBase64Decoder().decode(new Uint8Array([...new TextEncoder().encode(JSON.stringify(a)),...s?s.toBuffer():[]])),{signature:d,expiry:u}=await i("start",o),y=`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}&clientId=${encodeURIComponent(c)}&signature=${encodeURIComponent(d)}&expiry=${encodeURIComponent(u)}`,g=await $t({authUrl:y,data:a,signer:s,popUp:t});return {...g,signer:new ye(g.signer)}}async function bN({message:e,response:n,expectedRPID:r=Ki(),expectedOrigin:s=he()}){let t=new Uint8Array([...new TextEncoder().encode(e),...xn(n.clientId,n.deviceSignature.publicKey,n.nonce)]),{verified:c}=await verifyAuthenticationResponse({response:n.authResponse,expectedChallenge:Qt(t),expectedOrigin:s,expectedRPID:r,requireUserVerification:false,credential:{id:n.authResponse.id,publicKey:Oi(n.signer.toString()),counter:0}}),i=ed25519.verify(new Uint8Array(getBase58Encoder().encode(n.deviceSignature.signature)),Fe(n.authResponse),new Uint8Array(getBase58Encoder().encode(n.deviceSignature.publicKey)));return c&&i}async function GN({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o,compressed:d=false,additionalVoters:u=[],additionalSigners:y=[],chunkSize:g=Math.ceil(s.length/2),cachedAccounts:l}){let T=await Y(n),D=Math.floor(Math.random()*255),I=await od(T,t instanceof C?t:t.address,D),v=[],S=[];for(let Z=0;Z<s.length;Z+=g){let Bn=s.subarray(Z,Z+g);v.push(Bn),S.push(sha256(Bn));}let x=sha256(new Uint8Array(s)),{settingsReadonlyArgs:L,proof:W,packedAccounts:j}=await Se(d,n,r,false,l),{remainingAccounts:H,systemOffset:V}=j.toAccountMetas(),B=L?{settingsReadonlyArgs:L,compressedProofArgs:b(W,V),remainingAccounts:H,payer:e}:null,re=me([t,...c?[c]:[],...u]).filter(Z=>Z instanceof C).map(Z=>({memberKey:Ke(Z),messageHash:Fe(Z.authResponse)})),le=Pd({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:D,payer:e,transactionBufferAddress:I,settings:T,creator:t,preauthorizeExecution:!c,bufferExtendHashes:S,compressedArgs:B,expectedSecp256r1Signers:re}),Pe=v.map(Z=>vd({transactionMessageBytes:Z,transactionBufferAddress:I,settings:T,compressed:d})),De=u.map(Z=>bd({voter:Z,transactionBufferAddress:I,settings:T,compressedArgs:B})),Re=Rd({compressedArgs:B,settings:T,executor:c,transactionBufferAddress:I}),{instructions:Ut,addressLookupTableAccounts:Ld}=await Cd({compressed:d,settings:T,transactionMessageBytes:s,transactionBufferAddress:I,payer:e,additionalSigners:y,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o}),Xe=Z=>({payer:e,instructions:Z,addressesByLookupTableAddress:Ld});return [Xe(le),...Pe.map(Z=>Xe([Z])),...De.length?[Xe(De.flat())]:[],Xe(Re),Xe(Ut)]}var ir=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=i=>{let a=s.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},s.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let o=t(a.address);o.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,o.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,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),i={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 a=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [i,a]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,o=n.findIndex(d=>d===a);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(a),this.keyMetaMap.delete(c);}}return [s,t]}};var dr=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,i)=>{s.set(c,i);});let t=c=>{let i=s.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function Wd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=ir.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(s??{});for(let g of a){let l=t.extractTableLookup(g);if(l!==void 0){let{addressTableLookup:T,drainedKeys:D}=l;c.push({readonlyIndexes:T.readonlyIndexes,readableIndices:T.readonlyIndexes,writableIndexes:T.writableIndexes,writableIndices:T.writableIndexes,lookupTableAddress:address(T.lookupTableAddress)}),i.writable.push(...D.writable),i.readonly.push(...D.readonly);}}let[o,d]=t.getMessageComponents(),y=new dr(d,i).compileInstructions(r);return {version:0,header:o,instructions:y,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function t2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Wd({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return Di(s)}async function c2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i,cachedAccounts:a,compressed:o=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:y}=await Dd({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:i,simulateProof:d,cachedAccounts:a});return {payer:e,instructions:u,addressesByLookupTableAddress:y}}
|
|
2
|
-
export{Vs as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,$s as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,js as CHANGE_CONFIG_DISCRIMINATOR,so as COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,To as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,xo as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Mo as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,vo as CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR,Wo as CREATE_USER_ACCOUNTS_DISCRIMINATOR,ko as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,zo as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,On as DOMAIN_CONFIG_DISCRIMINATOR,Xo as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,rc as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,ic as EDIT_USER_DELEGATE_DISCRIMINATOR,Gn as GLOBAL_COUNTER_DISCRIMINATOR,vt as KeyType,mc as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,xc as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,Tx as MULTI_WALLET_ERROR__ALREADY_DELEGATED,jS as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,Bx as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,Ox as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,ZS as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,YS as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,cx as MULTI_WALLET_ERROR__EMPTY_MEMBERS,sx as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,qS as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,rx as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,Ex as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,hx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,Px as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,Sx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,fx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,lx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,Ax as MULTI_WALLET_ERROR__INVALID_ACCOUNT,Nx as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,ox as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,yx as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,Mx as MULTI_WALLET_ERROR__INVALID_BUFFER,xx as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,ux as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,QS as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,VS as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,zS as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,HS as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,FS as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,Wx as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,ix as MULTI_WALLET_ERROR__INVALID_THRESHOLD,nx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,tx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,dx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,gx as MULTI_WALLET_ERROR__INVALID_USER_ROLE,KS as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,_x as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,wx as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,mx as MULTI_WALLET_ERROR__MISSING_ACCOUNT,Ux as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,px as MULTI_WALLET_ERROR__MISSING_USER_ARGS,Cx as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,$S as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,ex as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,kx as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,XS as MULTI_WALLET_ERROR__PERMANENT_MEMBER,bx as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,JS as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,GS as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,Lx as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,ax as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,Rx as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,vx as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,Dx as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,Ix as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,wS as MultiWalletAccount,kS as MultiWalletInstruction,bc as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Ec as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Ie as Permission,Me as Permissions,Is as SETTINGS_DISCRIMINATOR,ye as Secp256r1Key,C as SignedSecp256r1Key,Vc as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Bc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,$c as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,Jc as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,ua as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,sa as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Rs as TRANSACTION_BUFFER_DISCRIMINATOR,Ca as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Ta as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,La as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Ra as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Ja as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Ha as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,si as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,$a as TRANSACTION_EXECUTE_DISCRIMINATOR,Ti as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,ui as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,He as UserRole,Ls as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,FB as addWhitelistedAddressTrees,hB as changeConfig,_k as closeTransactionBuffer,HB as compressSettingsAccount,xD as configAction,dd as convertMemberKeyToString,Oi as convertPubkeyCompressedToCose,FW as convertPubkeyCoseToCompressed,ZB as createDomainConfig,cO as createDomainUserAccounts,uO as createGlobalCounter,Li as createPopUp,Pd as createTransactionBuffer,$I as createTransactionManagerSigner,fO as createUserAccounts,hw as createWallet,kn as decodeDomainConfig,zn as decodeGlobalCounter,Ds as decodeSettings,bs as decodeTransactionBuffer,Os as decodeWhitelistedAddressTree,Ow as decompressSettingsAccount,IO as disableDomainConfig,RO as editDomainConfig,LO as editTransactionManagerUrl,zO as editUserDelegate,Cd as executeTransaction,Rd as executeTransactionBuffer,Dd as executeTransactionSync,vd as extendTransactionBuffer,BC as fetchAllDomainConfig,GC as fetchAllGlobalCounter,qd as fetchAllMaybeDomainConfig,uu as fetchAllMaybeGlobalCounter,yy as fetchAllMaybeSettings,By as fetchAllMaybeTransactionBuffer,tm as fetchAllMaybeWhitelistedAddressTree,ZE as fetchAllSettings,nh as fetchAllTransactionBuffer,ih as fetchAllWhitelistedAddressTree,qi as fetchCompressedAccount,Nn as fetchDomainConfig,VC as fetchGlobalCounter,jd as fetchMaybeDomainConfig,du as fetchMaybeGlobalCounter,Fr as fetchMaybeSettings,BI as fetchMaybeSettingsAccountData,Ly as fetchMaybeTransactionBuffer,LI as fetchMaybeUserAccountData,em as fetchMaybeWhitelistedAddressTree,YE as fetchSettings,_t as fetchSettingsAccountData,_s as fetchTransactionBuffer,sr as fetchUserAccountData,ws as fetchWhitelistedAddressTree,jC as getAddMemberArgsCodec,Ar as getAddMemberArgsDecoder,ur as getAddMemberArgsEncoder,Eh as getAddWhitelistedAddressTreesDiscriminatorBytes,Ph as getAddWhitelistedAddressTreesInstruction,Fs as getAddWhitelistedAddressTreesInstructionAsync,hh as getAddWhitelistedAddressTreesInstructionDataCodec,Gs as getAddWhitelistedAddressTreesInstructionDataDecoder,Xr as getAddWhitelistedAddressTreesInstructionDataEncoder,he as getAuthEndpoint,Kh as getChangeConfigCompressedDiscriminatorBytes,to as getChangeConfigCompressedInstruction,Jh as getChangeConfigCompressedInstructionDataCodec,eo as getChangeConfigCompressedInstructionDataDecoder,Qs as getChangeConfigCompressedInstructionDataEncoder,Bh as getChangeConfigDiscriminatorBytes,wh as getChangeConfigInstruction,Ys as getChangeConfigInstructionAsync,Oh as getChangeConfigInstructionDataCodec,qs as getChangeConfigInstructionDataDecoder,$r as getChangeConfigInstructionDataEncoder,xn as getClientAndDeviceHash,je as getClientSettings,ZC as getCompiledInstructionCodec,yr as getCompiledInstructionDecoder,gr as getCompiledInstructionEncoder,eP as getCompressSettingsAccountDiscriminatorBytes,ao as getCompressSettingsAccountInstruction,tP as getCompressSettingsAccountInstructionDataCodec,co as getCompressSettingsAccountInstructionDataDecoder,oo as getCompressSettingsAccountInstructionDataEncoder,eD as getCompressedAccountMetaCodec,tt as getCompressedAccountMetaDecoder,et as getCompressedAccountMetaEncoder,sD as getCompressedAccountMetaReadOnlyCodec,pr as getCompressedAccountMetaReadOnlyDecoder,mr as getCompressedAccountMetaReadOnlyEncoder,aD as getCompressedProofCodec,Ir as getCompressedProofDecoder,xr as getCompressedProofEncoder,J as getCompressedSettingsAddressFromIndex,AD as getCompressedSettingsCodec,pD as getCompressedSettingsDataCodec,ct as getCompressedSettingsDataDecoder,ot as getCompressedSettingsDataEncoder,z as getCompressedSettingsDecoder,st as getCompressedSettingsEncoder,zi as getComputeBudgetEstimate,SD as getConfigActionCodec,ut as getConfigActionDecoder,dt as getConfigActionEncoder,dP as getCreateDomainConfigDiscriminatorBytes,AP as getCreateDomainConfigInstruction,lo as getCreateDomainConfigInstructionAsync,uP as getCreateDomainConfigInstructionDataCodec,fo as getCreateDomainConfigInstructionDataDecoder,en as getCreateDomainConfigInstructionDataEncoder,SP as getCreateDomainUserAccountDiscriminatorBytes,IP as getCreateDomainUserAccountInstruction,Co as getCreateDomainUserAccountInstructionAsync,xP as getCreateDomainUserAccountInstructionDataCodec,Io as getCreateDomainUserAccountInstructionDataDecoder,rn as getCreateDomainUserAccountInstructionDataEncoder,RP as getCreateGlobalCounterDiscriminatorBytes,bP as getCreateGlobalCounterInstruction,ho as getCreateGlobalCounterInstructionAsync,vP as getCreateGlobalCounterInstructionDataCodec,Eo as getCreateGlobalCounterInstructionDataDecoder,sn as getCreateGlobalCounterInstructionDataEncoder,kP as getCreateMultiWalletCompressedDiscriminatorBytes,HP as getCreateMultiWalletCompressedInstruction,_o as getCreateMultiWalletCompressedInstructionAsync,NP as getCreateMultiWalletCompressedInstructionDataCodec,bo as getCreateMultiWalletCompressedInstructionDataDecoder,on as getCreateMultiWalletCompressedInstructionDataEncoder,ED as getCreateUserAccountArgsCodec,vr as getCreateUserAccountArgsDecoder,Rr as getCreateUserAccountArgsEncoder,qP as getCreateUserAccountsDiscriminatorBytes,ZP as getCreateUserAccountsInstruction,Bo as getCreateUserAccountsInstructionAsync,YP as getCreateUserAccountsInstructionDataCodec,Lo as getCreateUserAccountsInstructionDataDecoder,an as getCreateUserAccountsInstructionDataEncoder,sR as getDecompressSettingsAccountDiscriminatorBytes,Vo as getDecompressSettingsAccountInstruction,oR as getDecompressSettingsAccountInstructionDataCodec,Ho as getDecompressSettingsAccountInstructionDataDecoder,No as getDecompressSettingsAccountInstructionDataEncoder,gR as getDisableDomainConfigDiscriminatorBytes,jo as getDisableDomainConfigInstruction,yR as getDisableDomainConfigInstructionDataCodec,Jo as getDisableDomainConfigInstructionDataDecoder,Ko as getDisableDomainConfigInstructionDataEncoder,ze as getDomainConfigAddress,LC as getDomainConfigCodec,wn as getDomainConfigDecoder,WC as getDomainConfigDiscriminatorBytes,Jd as getDomainConfigEncoder,OC as getDomainConfigSize,IR as getEditDomainConfigDiscriminatorBytes,Qo as getEditDomainConfigInstruction,DR as getEditDomainConfigInstructionAsync,CR as getEditDomainConfigInstructionDataCodec,$o as getEditDomainConfigInstructionDataDecoder,un as getEditDomainConfigInstructionDataEncoder,vD as getEditMemberArgsCodec,Er as getEditMemberArgsDecoder,Mr as getEditMemberArgsEncoder,_R as getEditTransactionManagerUrlDiscriminatorBytes,oc as getEditTransactionManagerUrlInstruction,UR as getEditTransactionManagerUrlInstructionDataCodec,sc as getEditTransactionManagerUrlInstructionDataDecoder,nc as getEditTransactionManagerUrlInstructionDataEncoder,HR as getEditUserDelegateDiscriminatorBytes,Ac as getEditUserDelegateInstruction,VR as getEditUserDelegateInstructionDataCodec,uc as getEditUserDelegateInstructionDataDecoder,dc as getEditUserDelegateInstructionDataEncoder,WD as getExpectedSecp256r1SignersCodec,gt as getExpectedSecp256r1SignersDecoder,At as getExpectedSecp256r1SignersEncoder,aL as getFeePayer,sd as getGlobalCounterAddress,HC as getGlobalCounterCodec,Fn as getGlobalCounterDecoder,NC as getGlobalCounterDiscriminatorBytes,iu as getGlobalCounterEncoder,FC as getGlobalCounterSize,Mn as getJitoTipsConfig,zL as getLightCpiSigner,Oe as getLightProtocolRpc,wD as getLinkWalletArgsCodec,_r as getLinkWalletArgsDecoder,br as getLinkWalletArgsEncoder,VD as getMemberCodec,it as getMemberDecoder,at as getMemberEncoder,zD as getMemberKeyCodec,$ as getMemberKeyDecoder,X as getMemberKeyEncoder,YR as getMigrateCompressedSettingsDiscriminatorBytes,fc as getMigrateCompressedSettingsInstruction,ZR as getMigrateCompressedSettingsInstructionDataCodec,Tc as getMigrateCompressedSettingsInstructionDataDecoder,pc as getMigrateCompressedSettingsInstructionDataEncoder,sv as getMigrateCompressedUsersDiscriminatorBytes,Dc as getMigrateCompressedUsersInstruction,ov as getMigrateCompressedUsersInstructionDataCodec,Cc as getMigrateCompressedUsersInstructionDataDecoder,Ic as getMigrateCompressedUsersInstructionDataEncoder,XU as getMultiWalletErrorMessage,Dv as getNativeTransferIntentCompressedDiscriminatorBytes,Wc as getNativeTransferIntentCompressedInstruction,Mv as getNativeTransferIntentCompressedInstructionDataCodec,Uc as getNativeTransferIntentCompressedInstructionDataDecoder,_c as getNativeTransferIntentCompressedInstructionDataEncoder,yv as getNativeTransferIntentDiscriminatorBytes,Pc as getNativeTransferIntentInstruction,pv as getNativeTransferIntentInstructionAsync,mv as getNativeTransferIntentInstructionDataCodec,hc as getNativeTransferIntentInstructionDataDecoder,An as getNativeTransferIntentInstructionDataEncoder,qD as getNewAuthorityArgsCodec,Br as getNewAuthorityArgsDecoder,Lr as getNewAuthorityArgsEncoder,KW as getOriginIndex,XD as getPackedAddressTreeInfoCodec,mt as getPackedAddressTreeInfoDecoder,yt as getPackedAddressTreeInfoEncoder,eM as getPackedStateTreeInfoCodec,nt as getPackedStateTreeInfoDecoder,rt as getPackedStateTreeInfoEncoder,nM as getPermissionsCodec,be as getPermissionsDecoder,ve as getPermissionsEncoder,aM as getProofArgsCodec,E as getProofArgsDecoder,M as getProofArgsEncoder,AM as getRemoveMemberArgsCodec,Pr as getRemoveMemberArgsDecoder,hr as getRemoveMemberArgsEncoder,Ki as getRpId,In as getSecp256r1Message,Fe as getSecp256r1MessageHash,mM as getSecp256r1PubkeyCodec,pt as getSecp256r1PubkeyDecoder,Or as getSecp256r1PubkeyEncoder,fC as getSecp256r1SignatureOffsetsDataDecoder,TC as getSecp256r1SignatureOffsetsDataEncoder,fM as getSecp256r1VerifyArgsCodec,w as getSecp256r1VerifyArgsDecoder,O as getSecp256r1VerifyArgsEncoder,IM as getSecp256r1VerifyArgsWithDomainAddressCodec,ee as getSecp256r1VerifyArgsWithDomainAddressDecoder,Q as getSecp256r1VerifyArgsWithDomainAddressEncoder,F as getSecp256r1VerifyInstruction,vB as getSecp256r1VerifyInstructionDataCodec,pd as getSecp256r1VerifyInstructionDataDecoder,Td as getSecp256r1VerifyInstructionDataEncoder,Fi as getSendAndConfirmTransaction,qE as getSettingsCodec,EM as getSettingsCreationArgsCodec,ft as getSettingsCreationArgsDecoder,Tt as getSettingsCreationArgsEncoder,Cs as getSettingsDecoder,jE as getSettingsDiscriminatorBytes,gy as getSettingsEncoder,Y as getSettingsFromIndex,RM as getSettingsIndexWithAddressCodec,St as getSettingsIndexWithAddressDecoder,lt as getSettingsIndexWithAddressEncoder,UM as getSettingsMutArgsCodec,ge as getSettingsMutArgsDecoder,Ae as getSettingsMutArgsEncoder,OM as getSettingsReadonlyArgsCodec,se as getSettingsReadonlyArgsDecoder,ne as getSettingsReadonlyArgsEncoder,XE as getSettingsSize,zW as getSignedSecp256r1Key,aB as getSignedTransactionManager,oe as getSolanaRpc,Je as getSolanaRpcEndpoint,Gv as getTokenTransferIntentCompressedDiscriminatorBytes,Fc as getTokenTransferIntentCompressedInstruction,zv as getTokenTransferIntentCompressedInstructionAsync,Fv as getTokenTransferIntentCompressedInstructionDataCodec,Gc as getTokenTransferIntentCompressedInstructionDataDecoder,mn as getTokenTransferIntentCompressedInstructionDataEncoder,Uv as getTokenTransferIntentDiscriminatorBytes,wc as getTokenTransferIntentInstruction,Lv as getTokenTransferIntentInstructionAsync,Wv as getTokenTransferIntentInstructionDataCodec,Oc as getTokenTransferIntentInstructionDataDecoder,yn as getTokenTransferIntentInstructionDataEncoder,od as getTransactionBufferAddress,ab as getTransactionBufferCloseCompressedDiscriminatorBytes,ta as getTransactionBufferCloseCompressedInstruction,ib as getTransactionBufferCloseCompressedInstructionDataCodec,ea as getTransactionBufferCloseCompressedInstructionDataDecoder,Qc as getTransactionBufferCloseCompressedInstructionDataEncoder,$v as getTransactionBufferCloseDiscriminatorBytes,Yc as getTransactionBufferCloseInstruction,Qv as getTransactionBufferCloseInstructionDataCodec,qc as getTransactionBufferCloseInstructionDataDecoder,jc as getTransactionBufferCloseInstructionDataEncoder,rh as getTransactionBufferCodec,HM as getTransactionBufferCreateArgsCodec,It as getTransactionBufferCreateArgsDecoder,xt as getTransactionBufferCreateArgsEncoder,Eb as getTransactionBufferCreateCompressedDiscriminatorBytes,ya as getTransactionBufferCreateCompressedInstruction,hb as getTransactionBufferCreateCompressedInstructionDataCodec,ga as getTransactionBufferCreateCompressedInstructionDataDecoder,Aa as getTransactionBufferCreateCompressedInstructionDataEncoder,Tb as getTransactionBufferCreateDiscriminatorBytes,aa as getTransactionBufferCreateInstruction,fb as getTransactionBufferCreateInstructionDataCodec,ca as getTransactionBufferCreateInstructionDataDecoder,oa as getTransactionBufferCreateInstructionDataEncoder,vs as getTransactionBufferDecoder,th as getTransactionBufferDiscriminatorBytes,Wy as getTransactionBufferEncoder,Fb as getTransactionBufferExecuteCompressedDiscriminatorBytes,Ea as getTransactionBufferExecuteCompressedInstruction,zb as getTransactionBufferExecuteCompressedInstructionDataCodec,Ma as getTransactionBufferExecuteCompressedInstructionDataDecoder,Da as getTransactionBufferExecuteCompressedInstructionDataEncoder,Lb as getTransactionBufferExecuteDiscriminatorBytes,Sa as getTransactionBufferExecuteInstruction,Bb as getTransactionBufferExecuteInstructionDataCodec,la as getTransactionBufferExecuteInstructionDataDecoder,fa as getTransactionBufferExecuteInstructionDataEncoder,o_ as getTransactionBufferExtendCompressedDiscriminatorBytes,wa as getTransactionBufferExtendCompressedInstruction,c_ as getTransactionBufferExtendCompressedInstructionDataCodec,Oa as getTransactionBufferExtendCompressedInstructionDataDecoder,Ba as getTransactionBufferExtendCompressedInstructionDataEncoder,Xb as getTransactionBufferExtendDiscriminatorBytes,_a as getTransactionBufferExtendInstruction,$b as getTransactionBufferExtendInstructionDataCodec,ba as getTransactionBufferExtendInstructionDataDecoder,va as getTransactionBufferExtendInstructionDataEncoder,D_ as getTransactionBufferVoteCompressedDiscriminatorBytes,Ya as getTransactionBufferVoteCompressedInstruction,M_ as getTransactionBufferVoteCompressedInstructionDataCodec,qa as getTransactionBufferVoteCompressedInstructionDataDecoder,ja as getTransactionBufferVoteCompressedInstructionDataEncoder,m_ as getTransactionBufferVoteDiscriminatorBytes,Fa as getTransactionBufferVoteInstruction,p_ as getTransactionBufferVoteInstructionDataCodec,Ga as getTransactionBufferVoteInstructionDataDecoder,Va as getTransactionBufferVoteInstructionDataEncoder,N_ as getTransactionExecuteCompressedDiscriminatorBytes,ai as getTransactionExecuteCompressedInstruction,H_ as getTransactionExecuteCompressedInstructionDataCodec,ci as getTransactionExecuteCompressedInstructionDataDecoder,oi as getTransactionExecuteCompressedInstructionDataEncoder,__ as getTransactionExecuteDiscriminatorBytes,ti as getTransactionExecuteInstruction,U_ as getTransactionExecuteInstructionDataCodec,ei as getTransactionExecuteInstructionDataDecoder,Qa as getTransactionExecuteInstructionDataEncoder,nU as getTransactionExecuteSyncCompressedDiscriminatorBytes,Si as getTransactionExecuteSyncCompressedInstruction,sU as getTransactionExecuteSyncCompressedInstructionDataCodec,li as getTransactionExecuteSyncCompressedInstructionDataDecoder,fi as getTransactionExecuteSyncCompressedInstructionDataEncoder,q_ as getTransactionExecuteSyncDiscriminatorBytes,yi as getTransactionExecuteSyncInstruction,Y_ as getTransactionExecuteSyncInstructionDataCodec,gi as getTransactionExecuteSyncInstructionDataDecoder,Ai as getTransactionExecuteSyncInstructionDataEncoder,jM as getTransactionMessageAddressTableLookupCodec,kr as getTransactionMessageAddressTableLookupDecoder,wr as getTransactionMessageAddressTableLookupEncoder,zM as getTransactionMessageCodec,Dt as getTransactionMessageDecoder,Ct as getTransactionMessageEncoder,N as getUserAccountAddress,XM as getUserCodec,tE as getUserCreationArgsCodec,fe as getUserCreationArgsDecoder,Te as getUserCreationArgsEncoder,te as getUserDecoder,Mt as getUserEncoder,oE as getUserMutArgsCodec,ue as getUserMutArgsDecoder,de as getUserMutArgsEncoder,iE as getUserRoleCodec,Ue as getUserRoleDecoder,_e as getUserRoleEncoder,cd as getWalletAddressFromIndex,Ce as getWalletAddressFromSettings,ah as getWhitelistedAddressTreeCodec,Bs as getWhitelistedAddressTreeDecoder,ch as getWhitelistedAddressTreeDiscriminatorBytes,Qy as getWhitelistedAddressTreeEncoder,hn as getWhitelistedAddressTreeFromIndex,BL as getWhitelistedAddressTreeIndexFromAddress,Yi as getWhitelistedAddressTreesAddress,zU as identifyMultiWalletAccount,KU as identifyMultiWalletInstruction,dL as initialize,ID as isConfigAction,$U as isMultiWalletError,XO as migrateSettings,sw as migrateUsers,uk as nativeTransferIntent,Rh as parseAddWhitelistedAddressTreesInstruction,jh as parseChangeConfigCompressedInstruction,kh as parseChangeConfigInstruction,rP as parseCompressSettingsAccountInstruction,gP as parseCreateDomainConfigInstruction,CP as parseCreateDomainUserAccountInstruction,_P as parseCreateGlobalCounterInstruction,VP as parseCreateMultiWalletCompressedInstruction,XP as parseCreateUserAccountsInstruction,cR as parseDecompressSettingsAccountInstruction,mR as parseDisableDomainConfigInstruction,MR as parseEditDomainConfigInstruction,WR as parseEditTransactionManagerUrlInstruction,GR as parseEditUserDelegateInstruction,XR as parseMigrateCompressedSettingsInstruction,cv as parseMigrateCompressedUsersInstruction,Ev as parseNativeTransferIntentCompressedInstruction,Tv as parseNativeTransferIntentInstruction,bB as parseSecp256r1VerifyInstruction,Kv as parseTokenTransferIntentCompressedInstruction,Bv as parseTokenTransferIntentInstruction,db as parseTransactionBufferCloseCompressedInstruction,eb as parseTransactionBufferCloseInstruction,Pb as parseTransactionBufferCreateCompressedInstruction,lb as parseTransactionBufferCreateInstruction,Kb as parseTransactionBufferExecuteCompressedInstruction,Ob as parseTransactionBufferExecuteInstruction,a_ as parseTransactionBufferExtendCompressedInstruction,Qb as parseTransactionBufferExtendInstruction,E_ as parseTransactionBufferVoteCompressedInstruction,T_ as parseTransactionBufferVoteInstruction,V_ as parseTransactionExecuteCompressedInstruction,W_ as parseTransactionExecuteInstruction,oU as parseTransactionExecuteSyncCompressedInstruction,Z_ as parseTransactionExecuteSyncInstruction,oB as pollJitoBundleConfirmation,GN as prepareTransactionBundle,t2 as prepareTransactionMessage,c2 as prepareTransactionSync,cB as retrieveTransactionManager,XI as sendJitoBundle,nB as signAndSendBundledTransactions,sB as signAndSendTransaction,fN as signMessageWithPasskey,DN as signTransactionWithPasskey,xk as tokenTransferIntent,iL as uninitialize,Mi as vaultTransactionMessageDeserialize,Di as vaultTransactionMessageSerialize,bN as verifyMessage,bd 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,getOptionEncoder,getOptionDecoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getArrayEncoder,getArrayDecoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getU16Encoder,getU16Decoder,getBooleanEncoder,getBooleanDecoder,getU64Encoder,getU64Decoder,getEnumEncoder,getEnumDecoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,getBase64Decoder,createNoopSigner,AccountRole,some,none,createDecoder,createEncoder,upgradeRoleToSigner,getTransactionEncoder,getBlockhashDecoder,compileTransaction,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import Un from'bn.js';import {VERSION,featureFlags,createRpc,rpcRequest,versionedEndpoint,encodeBN254toBase58,jsonRpcResultAndContext,CompressedAccountResultV2,CompressedAccountResult,localTestActiveStateTreeInfos,getStateTreeInfoByPubkey,createCompressedAccountWithMerkleContextLegacy,createMerkleContextLegacy,bn as bn$1,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';import {ed25519}from'@noble/curves/ed25519.js';import {verifyAuthenticationResponse}from'@simplewebauthn/server';var Hn=new Uint8Array([201,232,212,229,59,241,106,197]);function jC(){return fixEncoderSize(getBytesEncoder(),8).encode(Hn)}function eu(){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:Hn}))}function Vn(){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 qC(){return combineCodec(eu(),Vn())}function Gn(e){return decodeAccount(e,Vn())}async function Fn(e,n,r){let s=await tu(e,n,r);return assertAccountExists(s),s}async function tu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Gn(s)}async function YC(e,n,r){let s=await ru(e,n,r);return assertAccountsExist(s),s}async function ru(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Gn(t))}function ZC(){return 846}var Jn=new Uint8Array([42,206,176,58,175,129,130,233]);function QC(){return fixEncoderSize(getBytesEncoder(),8).encode(Jn)}function Tu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Jn}))}function jn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function eD(){return combineCodec(Tu(),jn())}function qn(e){return decodeAccount(e,jn())}async function tD(e,n,r){let s=await fu(e,n,r);return assertAccountExists(s),s}async function fu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return qn(s)}async function rD(e,n,r){let s=await lu(e,n,r);return assertAccountsExist(s),s}async function lu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>qn(t))}function nD(){return 24}function pr(){return getStructEncoder([["memberKey",$()],["permissions",ve()],["verifyArgs",getOptionEncoder(B())],["userArgs",_e()]])}function mr(){return getStructDecoder([["memberKey",Q()],["permissions",be()],["verifyArgs",getOptionDecoder(w())],["userArgs",Ue()]])}function aD(){return combineCodec(pr(),mr())}function Tr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function fr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function uD(){return combineCodec(Tr(),fr())}function nt(){return getStructEncoder([["treeInfo",ot()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function st(){return getStructDecoder([["treeInfo",ct()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function pD(){return combineCodec(nt(),st())}function at(){return getStructEncoder([["treeInfo",ot()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function it(){return getStructDecoder([["treeInfo",ct()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function lD(){return combineCodec(at(),it())}function Cr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function Dr(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function ID(){return combineCodec(Cr(),Dr())}function dt(){return getStructEncoder([["data",getOptionEncoder(ut())]])}function z(){return getStructDecoder([["data",getOptionDecoder(At())]])}function ED(){return combineCodec(dt(),z())}function ut(){return getStructEncoder([["threshold",getU8Encoder()],["bump",getU8Encoder()],["index",getU128Encoder()],["multiWalletBump",getU8Encoder()],["members",getArrayEncoder(gt())],["settingsAddressTreeIndex",getU8Encoder()]])}function At(){return getStructDecoder([["threshold",getU8Decoder()],["bump",getU8Decoder()],["index",getU128Decoder()],["multiWalletBump",getU8Decoder()],["members",getArrayDecoder(yt())],["settingsAddressTreeIndex",getU8Decoder()]])}function vD(){return combineCodec(ut(),At())}function pt(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(hr())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(pr())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Rr())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function mt(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Pr())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(mr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(vr())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function WD(){return combineCodec(pt(),mt())}function LD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function OD(e,n){return n.__kind===e}function br(){return getStructEncoder([["member",getAddressEncoder()],["role",We()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",pe()]])}function _r(){return getStructDecoder([["member",getAddressDecoder()],["role",Le()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",me()]])}function ND(){return combineCodec(br(),_r())}function hr(){return getStructEncoder([["memberKey",$()],["permissions",ve()]])}function Pr(){return getStructDecoder([["memberKey",Q()],["permissions",be()]])}function FD(){return combineCodec(hr(),Pr())}function Tt(){return getStructEncoder([["memberKey",$()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function ft(){return getStructDecoder([["memberKey",Q()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function jD(){return combineCodec(Tt(),ft())}function Ur(){return getStructEncoder([["settingsMutArgs",de()],["transactionManager",getOptionEncoder(Se())]])}function Wr(){return getStructDecoder([["settingsMutArgs",ue()],["transactionManager",getOptionDecoder(xe())]])}function XD(){return combineCodec(Ur(),Wr())}function gt(){return getStructEncoder([["pubkey",$()],["permissions",ve()],["role",getU8Encoder()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function yt(){return getStructDecoder([["pubkey",Q()],["permissions",be()],["role",getU8Decoder()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function tM(){return combineCodec(gt(),yt())}function $(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function Q(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function sM(){return combineCodec($(),Q())}function Br(){return getStructEncoder([["authorityCreationArgs",pe()],["compressedProofArgs",M()]])}function wr(){return getStructDecoder([["authorityCreationArgs",me()],["compressedProofArgs",E()]])}function iM(){return combineCodec(Br(),wr())}function lt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function St(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function AM(){return combineCodec(lt(),St())}function ot(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function ct(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function pM(){return combineCodec(ot(),ct())}function ve(){return getStructEncoder([["mask",getU8Encoder()]])}function be(){return getStructDecoder([["mask",getU8Decoder()]])}function fM(){return combineCodec(ve(),be())}function M(){return getStructEncoder([["proof",getOptionEncoder(Cr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function E(){return getStructDecoder([["proof",getOptionDecoder(Dr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function IM(){return combineCodec(M(),E())}function Rr(){return getStructEncoder([["memberKey",$()],["userArgs",_e()]])}function vr(){return getStructDecoder([["memberKey",Q()],["userArgs",Ue()]])}function EM(){return combineCodec(Rr(),vr())}function kr(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function xt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function RM(){return combineCodec(kr(),xt())}function B(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function w(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function _M(){return combineCodec(B(),w())}function ee(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",B()]])}function te(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",w()]])}function OM(){return combineCodec(ee(),te())}function It(){return getStructEncoder([["addressTreeInfo",lt()],["outputStateTreeIndex",getU8Encoder()]])}function Ct(){return getStructDecoder([["addressTreeInfo",St()],["outputStateTreeIndex",getU8Decoder()]])}function NM(){return combineCodec(It(),Ct())}function Dt(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function Mt(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function GM(){return combineCodec(Dt(),Mt())}function de(){return getStructEncoder([["accountMeta",nt()],["data",dt()]])}function ue(){return getStructDecoder([["accountMeta",st()],["data",z()]])}function JM(){return combineCodec(de(),ue())}function ne(){return getStructEncoder([["accountMeta",at()],["data",dt()]])}function se(){return getStructDecoder([["accountMeta",it()],["data",z()]])}function ZM(){return combineCodec(ne(),se())}function Et(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getOptionEncoder(getArrayEncoder(Tt()))]])}function ht(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(ft()))]])}function eE(){return combineCodec(Et(),ht())}function Pt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(Tr())],["addressTableLookups",getArrayEncoder(Nr())]])}function Rt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(fr())],["addressTableLookups",getArrayDecoder(Hr())]])}function sE(){return combineCodec(Pt(),Rt())}function Nr(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Hr(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function aE(){return combineCodec(Nr(),Hr())}function Oe(){return getStructEncoder([["member",$()],["domainConfig",getOptionEncoder(getAddressEncoder())],["role",We()],["delegatedTo",getOptionEncoder(Dt())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function J(){return getStructDecoder([["member",Q()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",Le()],["delegatedTo",getOptionDecoder(Mt())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function AE(){return combineCodec(Oe(),J())}function pe(){return getStructEncoder([["addressTreeInfo",lt()],["outputStateTreeIndex",getU8Encoder()]])}function me(){return getStructDecoder([["addressTreeInfo",St()],["outputStateTreeIndex",getU8Decoder()]])}function mE(){return combineCodec(pe(),me())}function Se(){return getStructEncoder([["accountMeta",nt()],["data",Oe()]])}function xe(){return getStructDecoder([["accountMeta",st()],["data",J()]])}function SE(){return combineCodec(Se(),xe())}function Fr(){return getStructEncoder([["accountMeta",at()],["data",Oe()]])}function zr(){return getStructDecoder([["accountMeta",it()],["data",J()]])}function DE(){return combineCodec(Fr(),zr())}function _e(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Fr()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([Se()])]])]])}function Ue(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([zr()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([xe()])]])]])}function PE(){return combineCodec(_e(),Ue())}function RE(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function vE(e,n){return n.__kind===e}var Be=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(Be||{});function We(){return getEnumEncoder(Be)}function Le(){return getEnumDecoder(Be)}function UE(){return combineCodec(We(),Le())}var vs=new Uint8Array([223,179,163,190,177,224,67,173]);function Sh(){return fixEncoderSize(getBytesEncoder(),8).encode(vs)}function hy(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(gt(),{size:4})],["membersLen",getU8Encoder()],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["padding",fixEncoderSize(getBytesEncoder(),3)]]),e=>({...e,discriminator:vs}))}function bs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(yt(),{size:4})],["membersLen",getU8Decoder()],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["padding",fixDecoderSize(getBytesDecoder(),3)]])}function xh(){return combineCodec(hy(),bs())}function _s(e){return decodeAccount(e,bs())}async function Ih(e,n,r){let s=await jr(e,n,r);return assertAccountExists(s),s}async function jr(e,n,r){let s=await fetchEncodedAccount(e,n,r);return _s(s)}async function Ch(e,n,r){let s=await Py(e,n,r);return assertAccountsExist(s),s}async function Py(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>_s(t))}function Dh(){return 184}var Bs=new Uint8Array([90,36,35,219,93,225,110,96]);function Ph(){return fixEncoderSize(getBytesEncoder(),8).encode(Bs)}function jy(){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(Tt()))],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Bs}))}function ws(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multiWalletSettings",getAddressDecoder()],["multiWalletBump",getU8Decoder()],["canExecute",getBooleanDecoder()],["preauthorizeExecution",getBooleanDecoder()],["validTill",getU64Decoder()],["payer",getAddressDecoder()],["bump",getU8Decoder()],["bufferIndex",getU8Decoder()],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["creator",Q()],["executor",Q()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(Q())],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(ft()))],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Rh(){return combineCodec(jy(),ws())}function ks(e){return decodeAccount(e,ws())}async function Ns(e,n,r){let s=await qy(e,n,r);return assertAccountExists(s),s}async function qy(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ks(s)}async function vh(e,n,r){let s=await Yy(e,n,r);return assertAccountsExist(s),s}async function Yy(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ks(t))}var Gs=new Uint8Array([105,23,173,2,197,255,80,87]);function Uh(){return fixEncoderSize(getBytesEncoder(),8).encode(Gs)}function yp(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Gs}))}function Fs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function Wh(){return combineCodec(yp(),Fs())}function zs(e){return decodeAccount(e,Fs())}async function Ks(e,n,r){let s=await pp(e,n,r);return assertAccountExists(s),s}async function pp(e,n,r){let s=await fetchEncodedAccount(e,n,r);return zs(s)}async function Lh(e,n,r){let s=await mp(e,n,r);return assertAccountsExist(s),s}async function mp(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>zs(t))}function p({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 js(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function K(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:K(r.value),role:Js(r.value)?upgradeRoleToSigner(s):s,...Js(r.value)?{signer:r.value}:{}})}}function Js(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Ys=new Uint8Array([8]);function Xh(){return fixEncoderSize(getBytesEncoder(),1).encode(Ys)}function tn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Ys}))}function Zs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function $h(){return combineCodec(tn(),Zs())}async function Xs(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:tn().encode(c),programAddress:r})}function Qh(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:tn().encode(c),programAddress:r})}function eP(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:Zs().decode(e.data)}}var to=new Uint8Array([9]);function aP(){return fixEncoderSize(getBytesEncoder(),1).encode(to)}function rn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(pt())],["compressedProofArgs",getOptionEncoder(M())]]),e=>({...e,discriminator:to}))}function ro(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(mt())],["compressedProofArgs",getOptionDecoder(E())]])}function iP(){return combineCodec(rn(),ro())}async function no(e,n){let r=n?.programAddress??A,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},i={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(js(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(K(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 a=p(i),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),...a],data:rn().encode(c),programAddress:r})}function dP(e,n){let r=n?.programAddress??A,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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),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),...a],data:rn().encode(c),programAddress:r})}function uP(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ro().decode(e.data)}}var co=new Uint8Array([20]);function fP(){return fixEncoderSize(getBytesEncoder(),1).encode(co)}function ao(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(pt())],["settingsMut",de()],["compressedProofArgs",M()]]),e=>({...e,discriminator:co}))}function io(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(mt())],["settingsMut",ue()],["compressedProofArgs",E()]])}function lP(){return combineCodec(ao(),io())}function uo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.authority),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:ao().encode(c),programAddress:r})}function SP(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),authority:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:io().decode(e.data)}}var yo=new Uint8Array([17]);function hP(){return fixEncoderSize(getBytesEncoder(),1).encode(yo)}function po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",de()],["secp256r1VerifyArgs",getArrayEncoder(ee())]]),e=>({...e,discriminator:yo}))}function mo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["settingsMutArgs",ue()],["secp256r1VerifyArgs",getArrayDecoder(te())]])}function PP(){return combineCodec(po(),mo())}function To(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:po().encode(c),programAddress:r})}function RP(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:mo().decode(e.data)}}var Mo=new Uint8Array([0]);function OP(){return fixEncoderSize(getBytesEncoder(),1).encode(Mo)}function sn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",pe()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Mo}))}function Eo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",me()],["compressedProofArgs",E()]])}function BP(){return combineCodec(sn(),Eo())}async function ho(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:sn().encode(c),programAddress:r})}function wP(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:sn().encode(c),programAddress:r})}function kP(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:Eo().decode(e.data)}}var Ro=new Uint8Array([4]);function KP(){return fixEncoderSize(getBytesEncoder(),1).encode(Ro)}function cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["member",kr()],["role",We()],["userAccountCreationArgs",pe()],["linkWalletArgs",getOptionEncoder(Ur())]]),e=>({...e,discriminator:Ro}))}function vo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["member",xt()],["role",Le()],["userAccountCreationArgs",me()],["linkWalletArgs",getOptionDecoder(Wr())]])}function JP(){return combineCodec(cn(),vo())}async function bo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:cn().encode(c),programAddress:r})}function jP(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:cn().encode(c),programAddress:r})}function qP(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:vo().decode(e.data)}}var Uo=new Uint8Array([3]);function eR(){return fixEncoderSize(getBytesEncoder(),1).encode(Uo)}function dn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Uo}))}function Wo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function tR(){return combineCodec(dn(),Wo())}async function Lo(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=p(c),a=m(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:dn().encode({}),programAddress:r})}function rR(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=p(c),a=m(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:dn().encode({}),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:{globalCounter:r(),payer:r(),systemProgram:r()},data:Wo().decode(e.data)}}var wo=new Uint8Array([19]);function uR(){return fixEncoderSize(getBytesEncoder(),1).encode(wo)}function un(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["compressedProofArgs",M()],["settingsCreation",It()],["userArgs",_e()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:wo}))}function ko(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["compressedProofArgs",E()],["settingsCreation",Ct()],["userArgs",Ue()],["settingsIndex",getU128Decoder()]])}function AR(){return combineCodec(un(),ko())}async function No(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:un().encode(c),programAddress:r})}function gR(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:un().encode(c),programAddress:r})}function yR(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s(),globalCounter:r(),whitelistedAddressTrees:r()},data:ko().decode(e.data)}}var Vo=new Uint8Array([5]);function xR(){return fixEncoderSize(getBytesEncoder(),1).encode(Vo)}function gn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayEncoder(br())]]),e=>({...e,discriminator:Vo}))}function Go(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["createUserArgs",getArrayDecoder(_r())]])}function IR(){return combineCodec(gn(),Go())}async function Fo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:gn().encode(c),programAddress:r})}function CR(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:gn().encode(c),programAddress:r})}function DR(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:Go().decode(e.data)}}var Jo=new Uint8Array([18]);function bR(){return fixEncoderSize(getBytesEncoder(),1).encode(Jo)}function jo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMut",de()],["compressedProofArgs",M()],["secp256r1VerifyArgs",getArrayEncoder(ee())]]),e=>({...e,discriminator:Jo}))}function qo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMut",ue()],["compressedProofArgs",E()],["secp256r1VerifyArgs",getArrayDecoder(te())]])}function _R(){return combineCodec(jo(),qo())}function Yo(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:jo().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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:qo().decode(e.data)}}var $o=new Uint8Array([2]);function kR(){return fixEncoderSize(getBytesEncoder(),1).encode($o)}function Qo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:$o}))}function ec(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function NR(){return combineCodec(Qo(),ec())}function tc(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...a],data:Qo().encode(c),programAddress:r})}function HR(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:ec().decode(e.data)}}var oc=new Uint8Array([1]);function jR(){return fixEncoderSize(getBytesEncoder(),1).encode(oc)}function pn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Br())]]),e=>({...e,discriminator:oc}))}function cc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(wr())]])}function qR(){return combineCodec(pn(),cc())}async function YR(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:pn().encode(c),programAddress:r})}function ac(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:pn().encode(c),programAddress:r})}function ZR(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:cc().decode(e.data)}}var uc=new Uint8Array([6]);function nv(){return fixEncoderSize(getBytesEncoder(),1).encode(uc)}function Ac(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Se()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",M()]]),e=>({...e,discriminator:uc}))}function gc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",xe()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",E()]])}function sv(){return combineCodec(Ac(),gc())}function yc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.authority),...a],data:Ac().encode(c),programAddress:r})}function ov(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:gc().decode(e.data)}}var Tc=new Uint8Array([7]);function gv(){return fixEncoderSize(getBytesEncoder(),1).encode(Tc)}function fc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Se()],["secp256r1VerifyArgs",getOptionEncoder(B())],["delegateTo",getOptionEncoder(Dt())],["oldSettingsMutArgs",getOptionEncoder(de())],["newSettingsMutArgs",getOptionEncoder(de())],["compressedProofArgs",M()]]),e=>({...e,discriminator:Tc}))}function lc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",xe()],["secp256r1VerifyArgs",getOptionDecoder(w())],["delegateTo",getOptionDecoder(Mt())],["oldSettingsMutArgs",getOptionDecoder(ue())],["newSettingsMutArgs",getOptionDecoder(ue())],["compressedProofArgs",E()]])}function yv(){return combineCodec(fc(),lc())}function Sc(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),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),...a],data:fc().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===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:lc().decode(e.data)}}var Cc=new Uint8Array([33]);function Iv(){return fixEncoderSize(getBytesEncoder(),1).encode(Cc)}function Dc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",ut()],["compressedProofArgs",M()],["settingsCreationArgs",It()]]),e=>({...e,discriminator:Cc}))}function Mc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",At()],["compressedProofArgs",E()],["settingsCreationArgs",Ct()]])}function Cv(){return combineCodec(Dc(),Mc())}function Ec(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.authority),...a],data:Dc().encode(c),programAddress:r})}function Dv(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:Mc().decode(e.data)}}var Rc=new Uint8Array([32]);function bv(){return fixEncoderSize(getBytesEncoder(),1).encode(Rc)}function vc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Oe()],["compressedProofArgs",M()],["userCreationArgs",pe()]]),e=>({...e,discriminator:Rc}))}function bc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",J()],["compressedProofArgs",E()],["userCreationArgs",me()]])}function _v(){return combineCodec(vc(),bc())}function _c(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.authority),...a],data:vc().encode(c),programAddress:r})}function Uv(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:bc().decode(e.data)}}var Wc=new Uint8Array([30]);function Nv(){return fixEncoderSize(getBytesEncoder(),1).encode(Wc)}function mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(ee())]]),e=>({...e,discriminator:Wc}))}function Lc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(te())]])}function Hv(){return combineCodec(mn(),Lc())}async function Vv(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(K(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),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),...a],data:mn().encode(c),programAddress:r})}function Oc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),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),...a],data:mn().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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Lc().decode(e.data)}}var kc=new Uint8Array([28]);function Yv(){return fixEncoderSize(getBytesEncoder(),1).encode(kc)}function Nc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(ee())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:kc}))}function Hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(te())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function Zv(){return combineCodec(Nc(),Hc())}function Vc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),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),...a],data:Nc().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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Hc().decode(e.data)}}var Fc=new Uint8Array([31]);function sb(){return fixEncoderSize(getBytesEncoder(),1).encode(Fc)}function fn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(ee())]]),e=>({...e,discriminator:Fc}))}function zc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(te())]])}function ob(){return combineCodec(fn(),zc())}async function cb(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(K(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(K(t.source.value)),getAddressEncoder().encode(K(t.tokenProgram.value)),getAddressEncoder().encode(K(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(K(t.destination.value)),getAddressEncoder().encode(K(t.tokenProgram.value)),getAddressEncoder().encode(K(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=p(i),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),...a],data:fn().encode(c),programAddress:r})}function Kc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=p(i),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),...a],data:fn().encode(c),programAddress:r})}function ab(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===A?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:zc().decode(e.data)}}var Yc=new Uint8Array([29]);function pb(){return fixEncoderSize(getBytesEncoder(),1).encode(Yc)}function ln(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(ee())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Yc}))}function Zc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(te())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function mb(){return combineCodec(ln(),Zc())}async function Tb(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceTokenAccount.value||(t.sourceTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(K(t.source.value)),getAddressEncoder().encode(K(t.tokenProgram.value)),getAddressEncoder().encode(K(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(K(t.destination.value)),getAddressEncoder().encode(K(t.tokenProgram.value)),getAddressEncoder().encode(K(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=p(i),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),...a],data:ln().encode(c),programAddress:r})}function Xc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=p(i),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),...a],data:ln().encode(c),programAddress:r})}function fb(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===A?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:Zc().decode(e.data)}}var ea=new Uint8Array([13]);function Mb(){return fixEncoderSize(getBytesEncoder(),1).encode(ea)}function ta(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:ea}))}function ra(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Eb(){return combineCodec(ta(),ra())}function na(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),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),...a],data:ta().encode(c),programAddress:r})}function hb(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ra().decode(e.data)}}var ca=new Uint8Array([24]);function Wb(){return fixEncoderSize(getBytesEncoder(),1).encode(ca)}function aa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ca}))}function ia(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function Lb(){return combineCodec(aa(),ia())}function da(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),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),...a],data:aa().encode(c),programAddress:r})}function Ob(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ia().decode(e.data)}}var ga=new Uint8Array([10]);function Gb(){return fixEncoderSize(getBytesEncoder(),1).encode(ga)}function ya(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Et()],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:ga}))}function pa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",ht()],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Fb(){return combineCodec(ya(),pa())}function ma(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=p(i),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),...a],data:ya().encode(c),programAddress:r})}function zb(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===A?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:pa().decode(e.data)}}var la=new Uint8Array([21]);function Xb(){return fixEncoderSize(getBytesEncoder(),1).encode(la)}function Sa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Et()],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:la}))}function xa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",ht()],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function $b(){return combineCodec(Sa(),xa())}function Ia(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=p(i),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),...a],data:Sa().encode(c),programAddress:r})}function Qb(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:xa().decode(e.data)}}var Ma=new Uint8Array([14]);function c_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ma)}function Ea(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:Ma}))}function ha(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function a_(){return combineCodec(Ea(),ha())}function Pa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),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),...a],data:Ea().encode(c),programAddress:r})}function i_(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ha().decode(e.data)}}var ba=new Uint8Array([25]);function m_(){return fixEncoderSize(getBytesEncoder(),1).encode(ba)}function _a(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ba}))}function Ua(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function T_(){return combineCodec(_a(),Ua())}function Wa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),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),...a],data:_a().encode(c),programAddress:r})}function f_(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ua().decode(e.data)}}var Ba=new Uint8Array([12]);function D_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ba)}function wa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Ba}))}function ka(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function M_(){return combineCodec(wa(),ka())}function Na(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...a],data:wa().encode(c),programAddress:r})}function E_(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:ka().decode(e.data)}}var Ga=new Uint8Array([23]);function __(){return fixEncoderSize(getBytesEncoder(),1).encode(Ga)}function Fa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Ga}))}function za(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function U_(){return combineCodec(Fa(),za())}function Ka(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.transactionBuffer),...a],data:Fa().encode(c),programAddress:r})}function W_(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:za().decode(e.data)}}var qa=new Uint8Array([11]);function H_(){return fixEncoderSize(getBytesEncoder(),1).encode(qa)}function Ya(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:qa}))}function Za(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function V_(){return combineCodec(Ya(),Za())}function Xa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),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),...a],data:Ya().encode(c),programAddress:r})}function G_(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Za().decode(e.data)}}var ei=new Uint8Array([22]);function Y_(){return fixEncoderSize(getBytesEncoder(),1).encode(ei)}function ti(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ei}))}function ri(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function Z_(){return combineCodec(ti(),ri())}function ni(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),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),...a],data:ti().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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ri().decode(e.data)}}var ci=new Uint8Array([15]);function nU(){return fixEncoderSize(getBytesEncoder(),1).encode(ci)}function ai(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:ci}))}function ii(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function sU(){return combineCodec(ai(),ii())}function di(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=p({}),a=m(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:ai().encode({}),programAddress:r})}function oU(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:ii().decode(e.data)}}var gi=new Uint8Array([26]);function AU(){return fixEncoderSize(getBytesEncoder(),1).encode(gi)}function yi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:gi}))}function pi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function gU(){return combineCodec(yi(),pi())}function mi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...a],data:yi().encode(c),programAddress:r})}function yU(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:pi().decode(e.data)}}var li=new Uint8Array([16]);function xU(){return fixEncoderSize(getBytesEncoder(),1).encode(li)}function Si(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Pt()],["secp256r1VerifyArgs",getArrayEncoder(ee())]]),e=>({...e,discriminator:li}))}function xi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Rt()],["secp256r1VerifyArgs",getArrayDecoder(te())]])}function IU(){return combineCodec(Si(),xi())}function Ii(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Si().encode(c),programAddress:r})}function CU(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:xi().decode(e.data)}}var Mi=new Uint8Array([27]);function vU(){return fixEncoderSize(getBytesEncoder(),1).encode(Mi)}function Ei(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Pt()],["secp256r1VerifyArgs",getArrayEncoder(ee())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Mi}))}function hi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Rt()],["secp256r1VerifyArgs",getArrayDecoder(te())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function bU(){return combineCodec(Ei(),hi())}function Pi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ei().encode(c),programAddress:r})}function _U(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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:hi().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",XS=(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))(XS||{});function TW(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 $S=(f=>(f[f.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",f[f.ChangeConfig=1]="ChangeConfig",f[f.ChangeConfigCompressed=2]="ChangeConfigCompressed",f[f.CompressSettingsAccount=3]="CompressSettingsAccount",f[f.CreateDomainConfig=4]="CreateDomainConfig",f[f.CreateDomainUserAccount=5]="CreateDomainUserAccount",f[f.CreateGlobalCounter=6]="CreateGlobalCounter",f[f.CreateMultiWalletCompressed=7]="CreateMultiWalletCompressed",f[f.CreateUserAccounts=8]="CreateUserAccounts",f[f.DecompressSettingsAccount=9]="DecompressSettingsAccount",f[f.DisableDomainConfig=10]="DisableDomainConfig",f[f.EditDomainConfig=11]="EditDomainConfig",f[f.EditTransactionManagerUrl=12]="EditTransactionManagerUrl",f[f.EditUserDelegate=13]="EditUserDelegate",f[f.MigrateCompressedSettings=14]="MigrateCompressedSettings",f[f.MigrateCompressedUsers=15]="MigrateCompressedUsers",f[f.NativeTransferIntent=16]="NativeTransferIntent",f[f.NativeTransferIntentCompressed=17]="NativeTransferIntentCompressed",f[f.TokenTransferIntent=18]="TokenTransferIntent",f[f.TokenTransferIntentCompressed=19]="TokenTransferIntentCompressed",f[f.TransactionBufferClose=20]="TransactionBufferClose",f[f.TransactionBufferCloseCompressed=21]="TransactionBufferCloseCompressed",f[f.TransactionBufferCreate=22]="TransactionBufferCreate",f[f.TransactionBufferCreateCompressed=23]="TransactionBufferCreateCompressed",f[f.TransactionBufferExecute=24]="TransactionBufferExecute",f[f.TransactionBufferExecuteCompressed=25]="TransactionBufferExecuteCompressed",f[f.TransactionBufferExtend=26]="TransactionBufferExtend",f[f.TransactionBufferExtendCompressed=27]="TransactionBufferExtendCompressed",f[f.TransactionBufferVote=28]="TransactionBufferVote",f[f.TransactionBufferVoteCompressed=29]="TransactionBufferVoteCompressed",f[f.TransactionExecute=30]="TransactionExecute",f[f.TransactionExecuteCompressed=31]="TransactionExecuteCompressed",f[f.TransactionExecuteSync=32]="TransactionExecuteSync",f[f.TransactionExecuteSyncCompressed=33]="TransactionExecuteSyncCompressed",f))($S||{});function fW(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 ex=6e3,tx=6001,rx=6002,nx=6003,sx=6004,ox=6005,cx=6006,ax=6007,ix=6008,dx=6009,ux=6010,Ax=6011,gx=6012,yx=6013,px=6014,mx=6015,Tx=6016,fx=6017,lx=6018,Sx=6019,xx=6020,Ix=6021,Cx=6022,Dx=6023,Mx=6024,Ex=6025,hx=6026,Px=6027,Rx=6028,vx=6029,bx=6030,_x=6031,Ux=6032,Wx=6033,Lx=6034,Ox=6035,Bx=6036,wx=6037,kx=6038,Nx=6039,Hx=6040,Vx=6041,Gx=6042,Fx=6043,zx=6044,Kx=6045,Jx=6046,jx=6047,qx=6048,Yx=6049,Zx=6050,Xx=6051,$x=6052,Qx=6053,Ri;process.env.NODE_ENV!=="production"&&(Ri={[bx]:"This member is already delegated to another wallet.",[ax]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[Yx]:"The domain configuration account is disabled. Please contact support or try again later.",[Zx]:"Missing domain configuration account.",[ux]:"Duplicate public keys detected among members. Each member must have a unique key.",[dx]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[xx]:"No members provided. A multisig wallet must contain at least one member.",[lx]:"Expected a User with Administrator role for this instruction.",[ix]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[Tx]:"Expected a User with Transaction Manager role for this instruction.",[Nx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[Hx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Vx]:"Declared buffer size does not match the actual serialized size.",[Wx]:"Not enough members with vote permission to meet the approval threshold.",[_x]:"At least one signer with execute permission is required to proceed.",[Ux]:"At least one signer with initiate permission is required to perform this action.",[Ex]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[Qx]:"Address Tree supplied is not part of the whitelisted address trees",[Sx]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[Px]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[kx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[Lx]:"Only delegated members are allowed for this transaction.",[Mx]:"Unexpected number of accounts provided for this instruction.",[yx]:"User with Permanent Member role requires a must have a delegated wallet.",[tx]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[sx]:"The extracted public key has an invalid length or encoding.",[ex]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[nx]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[jx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[Cx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[fx]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[mx]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[Dx]:"Malformed transaction message: structure or formatting does not match the expected layout.",[hx]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[ox]:"The extracted WebAuthn signed message payload is malformed.",[Kx]:"An input string exceeds the maximum allowed character length.",[Xx]:"This member is not registered under the provided domain configuration.",[Rx]:"A required account is missing from the instruction context.",[Jx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[vx]:"User mutation arguments are required when performing add or remove delegate operations.",[Bx]:"No valid signer found in this transaction.",[gx]:"Only one permanent member is allowed per wallet.",[px]:"Only one transaction manager is allowed per wallet.",[$x]:"The given origin index is not in the whitelisted origins.",[Ax]:"Permanent members cannot be removed from a wallet.",[zx]:"Writable CPI calls to protected accounts are not permitted.",[cx]:"The rpIdHash extracted from the signed message does not match the expected value.",[rx]:"The signature index provided is out of bounds for the secp256r1 instruction.",[qx]:"The specified slot number was not found in the provided slot history.",[Ix]:"Too many members: a maximum of 4 members are supported.",[Gx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[Fx]:"This transaction has not yet reached the required approval threshold.",[wx]:"Only the transaction creator or rent payer may close this transaction buffer.",[Ox]:"Member is not part of the expected signers for this transaction."});function DW(e){return process.env.NODE_ENV!=="production"?Ri[e]:"Error message not available in production bundles."}function MW(e,n,r){return isProgramError(e,n,A,r)}var Wt={Ed25519:1,Secp256r1:2};var Ie={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Me=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(Ie).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var In=33,Ae=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!==In)throw new Error(`Invalid public key length, expected ${In} 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===In)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()}},C=class extends Ae{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 rI(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function nI(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var bi=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(rI())],["addressTableLookups",getArrayCodec(nI())]]);function _i(e){return bi.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 Ui(e){let n=bi.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}featureFlags.version=VERSION.V2;var Wi="revibase.com",Li="https://auth.revibase.com",Oi="https://api.revibase.com";var Ke=null,wi=2e3,ki=3e3,cI=300*1e3;async function rr({authUrl:e,signer:n,popUp:r=null,data:s}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");return new Promise((t,c)=>{let i=new URL(e).origin,a=null,o=setInterval(()=>{r&&r.closed&&(u(),c(new Error("User closed the authentication window")));},500),d=setTimeout(()=>{u(),c(new Error("Authentication timed out"));},cI);function u(){clearInterval(o),clearTimeout(d),a&&clearTimeout(a),Ke&&window.removeEventListener("message",Ke),r&&r.close();}if(r?r.location.replace(e):r=Gi(e),!r){c(new Error("Disable your popup blocker to continue."));return}let g=y=>{let T=y.origin===i,l=y.source===r;if(!(!T||!l||!y.isTrusted||!r))switch(y.data.type){case "popup-ready":r.postMessage({type:"popup-init",payload:{signer:n?.toString(),data:s}},i),a=setTimeout(()=>{u(),c(new Error("User closed the authentication window"));},wi+ki);break;case "popup-complete":try{let D=JSON.parse(y.data.payload);u(),t(D);}catch{c(new Error("Failed to parse response payload"));}break;case "popup-heartbeat":a&&(clearTimeout(a),a=setTimeout(()=>{u(),c(new Error("User closed the authentication window"));},wi+ki));break;case "popup-closed":u(),c(new Error("User closed the authentication window"));break}};Ke&&window.removeEventListener("message",Ke),Ke=g,window.addEventListener("message",Ke);})}function nr(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ne(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),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return c}function sr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function aI(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 Ni(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 Hi(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 i=e[s]|e[s+1]<<8;if(s+=2,s+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(s,s+i),o=t.decode(a);r.push(o),s+=i;}return r}function Vi(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let h=n&127;r+=h;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let 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 i=e[r+1],a=r+2,o=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let y=p256.Point.CURVE().n>>1n,T=BigInt("0x"+sr(u)),D=(T>y?p256.Point.CURVE().n-T:T).toString(16).padStart(64,"0"),x=aI(D);return new Uint8Array([...g,...x])}function Gi(e=`${he()}/loading`){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let n=window.innerWidth||screen.availWidth,r=window.innerHeight||screen.availHeight,s=n<=768,t,c,i,a;if(s)t=n,c=r,i=0,a=0;else {let u=window.screenLeft??window.screenX,g=window.screenTop??window.screenY,y=window.innerWidth??document.documentElement.clientWidth??screen.width,T=window.innerHeight??document.documentElement.clientHeight??screen.height;t=500,c=600,a=u+(y-t)/2,i=g+(T-c)/2;}let o=[`width=${t}`,`height=${c}`,`top=${i}`,`left=${a}`,"toolbar=no","location=no","status=no","menubar=no","scrollbars=yes","resizable=yes"].join(","),d=window.open(e,"_blank",o);return d&&d.focus(),d}function mL(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 zi(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 TL(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Ne(n)),c=JSON.parse(new TextDecoder().decode(Ne(r))),i=Ni(c),a=Vi(new Uint8Array(Ne(s))),o=await je({rpIdHash:t.subarray(0,32)});return new C(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Ne(r)),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:Mn(e.clientId,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}async function fL(e,n){let{data:r}=await Fn(oe(),e),t=Hi(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([...getBase58Encoder().encode(e),...getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function Je(e){return sha256(En(e))}function En(e){return new Uint8Array([...new Uint8Array(Ne(e.response.authenticatorData)),...sha256(new Uint8Array(Ne(e.response.clientDataJSON)))])}async function Pn(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await oe().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 i=Math.ceil((s.unitsConsumed??0)*1.1)||8e5;return i>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:i})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function ji(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,i)=>c-i);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function qi(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,[,i]=c;throw console.error(t??s),new Error(`Simulation failed: ${i}`)}return s.value.transactionResults.map(c=>c.unitsConsumed)}function G(e,n=0){let r=e instanceof C?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,i=r?.authData&&r.verifyArgs?.clientDataJson?En(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:i,publicKey:a}}function qe(e){if(e instanceof Ae)return {keyType:Wt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Wt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function Ji(e){return e instanceof C?e.toString():e.address.toString()}function ge(e){let n=new Set,r=[];for(let s of e)n.has(Ji(s))||(r.push(s),n.add(Ji(s)));if(r.filter(s=>s instanceof C).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function Yi({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 Zi(e){let n=await fetch(`${e}/getRandomPayer`),{randomPayer:r}=await n.json();return {address:address(r),async signTransactions(s){let t={publicKey:r,transactions:s.map(a=>getBase64Decoder().decode(getTransactionEncoder().encode(a)))},i=await(await fetch(`${e}/sign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json();if("error"in i)throw new Error(i.error);return i.signatures.map(a=>({[address(r)]:getBase58Encoder().encode(a)}))}}}var _={};function Ye(){if(!_.solanaRpcEndpoint)throw new Error("Rpc is not initialized yet.");return _.solanaRpcEndpoint}function He(){if(!_.lightProtocolRpc)throw new Error("Rpc is not initialized yet");return _.lightProtocolRpc}function oe(){if(!_.solanaRpc)throw new Error("Rpc is not initialized yet");return _.solanaRpc}function Xi(){if(!_.sendAndConfirm)throw new Error("Rpc is not initialized yet.");return _.sendAndConfirm}function $i(){if(!_.computeEstimate)throw new Error("Rpc is not initialized yet");return _.computeEstimate}async function WL(){return _.feePayer||(_.feePayer=await Zi(_.apiEndpoint??Oi)),_.feePayer}function Rn(){if(!_.jitoTipsConfig)throw new Error("Jito Bundle Config is not set.");return _.jitoTipsConfig}function he(){return _.authEndpoint??Li}function Qi(){return _.rpId??Wi}function Ze(){if(!_.clientSettings)throw new Error("No client settings found.");return _.clientSettings}function LL(){Object.keys(_).forEach(e=>{_[e]=void 0;});}function OL({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,rpId:i,clientSettings:a}){_.solanaRpcEndpoint=e,_.lightProtocolRpc=createRpc(e,r,n);let{rpc:o,sendAndConfirmTransaction:d}=createSolanaClient({urlOrMoniker:e});_.solanaRpc=o,_.sendAndConfirm=d,_.computeEstimate=estimateComputeUnitLimitFactory({rpc:o}),_.apiEndpoint=t??null,_.jitoTipsConfig=s??null,_.authEndpoint=c??null,_.rpId=i??null,_.clientSettings=a??null;}var U=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(A.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=Ye().includes("devnet")?localTestActiveStateTreeInfos():await He().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees: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 cr(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await rd(e);return s&&n?.set(e.toString(),s),s}}async function ce(e,n){let s=(await Promise.all(e.map(async t=>cr(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 b(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 ae(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:s[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function Y(e,n,r,s,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:s[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let o=e.packTreeInfos(a,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function fe(e,n,r,s,t){let c=null,i=null,a=new U;if(e){await a.addSystemAccounts();let{address:o}=await j(n,r),d=(await ce([{address:o,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[d.leafIndex],leaves:[],treeInfos:[d.treeInfo],proveByIndices:[d.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([d],[]);let u=a.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!u)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:u.packedTreeInfos[0]},data:z().decode(d.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:a}}async function k(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await He().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(i=>setTimeout(i,s));}throw new Error(`Failed to get validity proof after ${r} attempts`)}async function le(){return (await ar()).length-1}var vn;async function ar(){if(!vn){let{data:e}=await Ks(oe(),await nd());vn=e.whitelistedAddressTrees;}return vn}async function ir(e,n,r){let s=await qI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function qI(e,n,r){let{address:s}=await N(e,n),t=await cr(s,r);return t?.data?.data?J().decode(t.data.data):null}async function Ot(e,n,r){let s=await YI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function YI(e,n,r){try{let{address:s}=await j(e,n),t=await cr(s,r);if(!t?.data?.data)return null;let c=z().decode(t.data.data);return c.data.__option==="None"?null:{...c.data.value,isCompressed:!0}}catch{let s=await jr(oe(),await Z(e));return s.exists?{...s.data,members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function bn(e){let n=await ar();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function aO(e){let r=(await ar()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function rd(e){let n=await rpcRequest(He().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=Ye().includes("devnet")?localTestActiveStateTreeInfos():await He().getStateTreeInfos(),c=getStateTreeInfoByPubkey(t,s),i=r.result.value;return createCompressedAccountWithMerkleContextLegacy(createMerkleContextLegacy(c,i.hash,i.leafIndex),i.owner,bn$1(i.lamports),i.data?parseAccountData(i.data):void 0,i.address||void 0)}async function j(e,n=0){let r=await bn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("multi_wallet")),new Uint8Array(getU128Encoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(A)).toString(),"base58"),addressTree:new PublicKey(r)}}async function N(e,n=0){let r=await bn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),e instanceof Ae?e.toTruncatedBuffer():new Uint8Array(getAddressEncoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(A.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:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function gd(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function nd(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function yd(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof Ae?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function Ce(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function Z(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function pd(e){let n=await Z(e);return await Ce(n)}async function TO(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function vO(e){let n=await Pn(e,true),r=await qi(n.map(getBase64EncodedWireTransaction),Ye()),s=await Pn(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await AC(s.map(getBase64EncodedWireTransaction))}async function bO({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await oe().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[i,a]=await Promise.all([$i()(c),ji(oe(),c.instructions.flatMap(d=>d.accounts??[]))]),o=Math.ceil(i*1.1);return prependTransactionMessageInstructions([...o>2e5?[getSetComputeUnitLimitInstruction({units:o})]:[],...a>0?[getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await Xi()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}async function AC(e,n=10,r=1e3,s=Rn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let i=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(i.status===429&&c<n){await new Promise(o=>setTimeout(o,r));continue}let a=await i.json();if(a.error)throw new Error(`Error sending bundles: ${JSON.stringify(a.error,null,2)}`);return a.result}throw new Error("Failed to send bundle after retries.")}async function _O(e,n=30,r=3e3,s=Rn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let i=await fetch(`${t}/getBundleStatuses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});if(i.status===429&&c<n){await new Promise(d=>setTimeout(d,r));continue}let a=await i.json();if(a.error)throw new Error(`Error sending bundles: ${JSON.stringify(a.error,null,2)}`);let o=a.result;if(o.value.length){let d=o.value[0];if(d.confirmation_status==="confirmed"||d.confirmation_status==="finalized")return d.transactions[d.transactions.length-1]}if(c<n){await new Promise(d=>setTimeout(d,r));continue}}throw new Error("Failed to get bundle status after retries.")}async function UO(e,n,r,s){let t=await Ot(n,r,s);if(t.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:c}=t.members.find(u=>fd(u.pubkey)===e.toString())??{};if(!c)throw new Error("No permissions found for the current member.");let i=Me.has(c,Ie.InitiateTransaction),a=Me.has(c,Ie.VoteTransaction),o=Me.has(c,Ie.ExecuteTransaction);if(i&&a&&o)return {};if(!a||!o)throw new Error("Signer lacks the required Vote/Execute permissions.");let d=t.members.find(u=>u.role===2);if(!d)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:address(fd(d.pubkey)),userAddressTreeIndex:d.userAddressTreeIndex}}async function WO({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await ir(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return gC(n,c.transactionManagerUrl.value,e,s)}function gC(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(getBase64EncodedWireTransaction)};if(s&&(c.transactionMessageBytes=getBase64Decoder().decode(s)),r){let{clientId:o,signClientMessage:d}=Ze();c.authResponses=await Promise.all(r.map(async u=>({...u,clientSignature:{clientId:o,signature:(await d("complete",getBase64Decoder().decode(Je(u.authResponse)))).signature}})));}let a=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json();if("error"in a)throw new Error(a.error);return a.signatures.map(o=>({[e]:getBase58Encoder().encode(o)}))}}}function fd(e){return e.keyType===Wt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}async function $O({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let i=await fC(r),a=new U,o=null,d=null,u=[];if(i.length||t){let h=await lC({packedAccounts:a,userAccounts:i,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:c});o=h.proof,d=h.settingsMutArgs??null,u=h.userMutArgs??[];}let{configActions:g,secp256r1VerifyInput:y}=await SC({configActionsArgs:r,packedAccounts:a,userMutArgs:u,index:e}),{remainingAccounts:T,systemOffset:l}=a.toAccountMetas(),D=b(o,l);return {instructions:t?[uo({configActions:g,payer:s,authority:createNoopSigner(await pd(e)),compressedProofArgs:D,settingsMut:d,remainingAccounts:T})]:[await no({settingsIndex:e,configActions:g,payer:s,compressedProofArgs:D,remainingAccounts:T})],secp256r1VerifyInput:y}}async function fC(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>N(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=>N(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function lC({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let T=(await j(s,t)).address;i.push({address:T,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await ce(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await k(a,[]),d=[],u=[];for(let T of a)T.type==="Settings"?d.push(T):T.type==="User"&&u.push(T);let g,y=[];if(r&&o&&(g=Y(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),d,z())[0]),u.length&&o){let T=r?1:0;y=Y(e,o.treeInfos.slice(T),o.leafIndices.slice(T),o.rootIndices.slice(T),o.proveByIndices.slice(T),u,J());}return {proof:o,settingsMutArgs:g,userMutArgs:y}}async function SC({index:e,configActionsArgs:n,packedAccounts:r,userMutArgs:s}){let t=[],c=[];for(let i of n)switch(i.type){case "AddMembers":{let a=[];for(let o of i.members)if(o.member instanceof C){let d=t.length,{message:u,signature:g,publicKey:y,domainConfig:T}=G(o.member,d);u&&g&&y&&t.push({message:u,signature:g,publicKey:y}),T&&r.addPreAccounts([{address:T,role:AccountRole.READONLY}]);let l=await N(o.member,o.userAddressTreeIndex).then(D=>s.find(x=>new Un(new Uint8Array(x.accountMeta.address)).eq(D.address)));if(!l)throw new Error("Unable to find user account");a.push(ld({permissionArgs:o.permissions,index:d,userMutArgs:l,pubkey:o.member}));}else {let d=await N(o.member,o.userAddressTreeIndex).then(u=>s.find(g=>new Un(new Uint8Array(g.accountMeta.address)).eq(u.address)));if(!d)throw new Error("Unable to find user account");a.push(ld({permissionArgs:o.permissions,index:-1,userMutArgs:d,pubkey:o.member}));}c.push({__kind:i.type,fields:[a]});break}case "RemoveMembers":{let a=await Promise.all(i.members.map(o=>N(o.member,o.userAddressTreeIndex).then(d=>{let u=s.find(g=>new Un(new Uint8Array(g.accountMeta.address)).eq(d.address));if(!u)throw new Error("Unable to find user account");return IC({pubkey:o.member,userMutArgs:u,index:e})})));c.push({__kind:i.type,fields:[a]});break}case "EditPermissions":{let a=i.members.map(o=>xC({permissionArgs:o.permissions,pubkey:o.member}));c.push({__kind:i.type,fields:[a]});break}default:c.push({__kind:i.type,fields:[i.threshold]});}return {configActions:c,secp256r1VerifyInput:t}}function xC({pubkey:e,permissionArgs:n}){return {memberKey:qe(e),permissions:Sd(n)}}function IC({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 ld({pubkey:e,permissionArgs:n,index:r,userMutArgs:s}){if(s.data.role===1){if(s.data.delegatedTo.__option==="Some")throw new Error("This user is already registered as a permanent member in another wallet. A permanent member can only belong to one wallet.")}else if(s.data.role===2&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:qe(e),permissions:Sd(n),verifyArgs:e instanceof C&&e.verifyArgs&&r!==-1?some({truncatedClientDataJson:e.verifyArgs.truncatedClientDataJson,slotNumber:e.verifyArgs.slotNumber,signedMessageIndex:r,originIndex:e.originIndex,crossOrigin:e.crossOrigin,clientAndDeviceHash:e.clientAndDeviceHash}):none(),userArgs:s.data.role===1?{__kind:"Mutate",fields:[s]}:{__kind:"Read",fields:[s]}}}function Sd(e){let n=[];return e.initiate&&n.push(Ie.InitiateTransaction),e.vote&&n.push(Ie.VoteTransaction),e.execute&&n.push(Ie.ExecuteTransaction),Me.fromPermissions(n)}var $e=33,Qe=64,Bn=14,RC=2,vC=address("Secp256r1SigVerify1111111111111111111111111");function bC(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function _C(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function Dd(){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=_C();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=Bn;let i=[];for(let a=0;a<r;a++){let o=fixDecoderSize(getBytesDecoder(),$e).decode(e,n);n+=$e;let d=fixDecoderSize(getBytesDecoder(),Qe).decode(e,n);n+=Qe;let u=t[a].messageDataSize,g=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:i},n]}})}function Md(){return createEncoder({getSizeFromValue:e=>{let n=Bn*e.offsets.length,r=e.payload.reduce((s,t)=>s+$e+Qe+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=getU8Encoder().write(e.numSignatures,n,r),r=getU8Encoder().write(e.padding,n,r);let s=bC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),$e).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),Qe).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function tB(){return combineCodec(Md(),Dd())}function F(e,n){let r=e.length,s=RC+r*Bn,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,g=u+$e,y=g+Qe;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:y,messageDataSize:d.length,messageInstructionIndex:65535}),s+=$e+Qe+d.length;}let c=n?.programAddress??vC,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:Md().encode(i)}}function rB(e){return {programAddress:e.programAddress,accounts:{},data:Dd().decode(e.data)}}async function gB({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=await Z(e),{address:a}=await j(e,n),o=await ce([{address:a,type:"Settings"}],t),d=await k(o,[]),u=Y(c,d.treeInfos,d.leafIndices,d.rootIndices,d.proveByIndices,o.filter(S=>S.type==="Settings"),z())[0],g=ge(s),y=g.filter(S=>S instanceof C),T=[],l=[];for(let S of y){let L=T.length,{domainConfig:W,verifyArgs:q,signature:H,publicKey:V,message:O}=G(S,L);O&&H&&V&&T.push({message:O,signature:H,publicKey:V}),W&&(c.addPreAccounts([{address:W,role:AccountRole.READONLY}]),q?.__option==="Some"&&l.push({domainConfigKey:W,verifyArgs:q.value}));}c.addPreAccounts(g.filter(S=>"address"in S).map(S=>({address:S.address,role:AccountRole.READONLY_SIGNER,signer:S})));let{remainingAccounts:D,systemOffset:x}=c.toAccountMetas(),h=b(d,x),I=[];return T.length>0&&I.push(F(T)),I.push(To({settings:i,settingsMutArgs:u,compressedProofArgs:h,payer:r,secp256r1VerifyArgs:l,remainingAccounts:D})),I}async function mB({admin:e,addressTree:n}){return Xs({payer:e,addressTree:n,remainingAccounts:[]})}async function CB({payer:e,rpId:n,origins:r,authority:s}){let t=await je({rpId:n}),c=new U;await c.addSystemAccounts();let i=await le(),{address:a,addressTree:o}=await N(s.address,i),d=[{address:a,tree:o,queue:o,type:"User"}],u=await k([],d),g=(await ae(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:y,systemOffset:T}=c.toAccountMetas(),l=b(u,T);return await ho({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:l,payer:e,domainConfig:t,rpId:n,remainingAccounts:y})}async function UB({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=[];r.index&&(i.push({address:(await j(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&i.push({address:(await N(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let a=i.length?await ce(i,t):[],o=await le(),{address:d,addressTree:u}=await N(r.member,o),g=[{address:d,type:"User",tree:u,queue:u}],y=await k(a,g),T=null,l=null,D=a.filter(W=>W.type==="Settings"),x=a.filter(W=>W.type==="User");D.length&&(T=Y(c,y.treeInfos.slice(0,1),y.leafIndices.slice(0,1),y.rootIndices.slice(0,1),y.proveByIndices.slice(0,1),D,z())[0]),x.length&&(l=Y(c,y.treeInfos.slice(1,2),y.leafIndices.slice(1,2),y.rootIndices.slice(1,2),y.proveByIndices.slice(1,2),x,J())[0]);let h=await ae(c,y.treeInfos.slice(a.length),y.roots.slice(a.length),y.rootIndices.slice(a.length),g),{remainingAccounts:I,systemOffset:S}=c.toAccountMetas(),L=b(y,S);return await bo({payer:n,authority:e,compressedProofArgs:L,member:xt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:T?some({settingsMutArgs:T,transactionManager:l?some(l):none()}):none(),userAccountCreationArgs:h[0],domainConfig:s,remainingAccounts:I})}async function BB({payer:e}){let n=await gd();return Lo({payer:e,globalCounter:n})}async function FB({createUserArgs:e,payer:n}){let r=new U;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:AccountRole.READONLY_SIGNER,signer:u.member})));let s=await le(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:y}=await N(u.member.address,s);return {address:g,tree:y,queue:y,type:"User"}})),c=await k([],t),i=await ae(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:o}=r.toAccountMetas(),d=b(c,o);return await Fo({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:i[g],transactionManagerUrl:u.role===2?u.transactionManagerUrl:null})),remainingAccounts:a})}async function jB({admin:e,rpId:n,disable:r}){let s=await je({rpId:n});return tc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function ew({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let i=new U;await i.addSystemAccounts();let a=await le(),{address:o,addressTree:d}=await N(r.address,a),u=[{address:o,tree:d,queue:d,type:"User"}],g=await k([],u),y=(await ae(i,g.treeInfos,g.roots,g.rootIndices,u))[0],T=i.toAccountMetas();c=T.remainingAccounts,t={compressedProofArgs:b(g,T.systemOffset),authorityCreationArgs:y};}return ac({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function cw({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new U;await s.addSystemAccounts();let t=await ce([{address:(await N(e.address,n)).address,type:"User"}]),c=await k(t,[]),i=Y(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,J())[0],{remainingAccounts:a,systemOffset:o}=s.toAccountMetas(),d=b(c,o);return yc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function Tw({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:o,publicKey:d}=G(n),u=[];a&&o&&d&&u.push({message:a,signature:o,publicKey:d});let g=await ir(n instanceof C?n:n.address,r,t),y=[];y.push({address:(await N(n instanceof C?n:n.address,r)).address,type:"User"});let T,l=null,D,x=null;g.delegatedTo.__option==="Some"&&((await Ot(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(y.push({address:(await j(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),l={start:y.length-1,end:y.length}):T=await Z(g.delegatedTo.value.index)),s&&((await Ot(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(y.push({address:(await j(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:y.length-1,end:y.length}):D=await Z(s.index));let h=new U;await h.addSystemAccounts();let I=await ce(y,t),S=await k(I,[]),L=Y(h,S.treeInfos.slice(0,1),S.leafIndices.slice(0,1),S.rootIndices.slice(0,1),S.proveByIndices.slice(0,1),I.slice(0,1),J())[0],W=l?some(Y(h,S.treeInfos.slice(l.start,l.end),S.leafIndices.slice(l.start,l.end),S.rootIndices.slice(l.start,l.end),S.proveByIndices.slice(l.start,l.end),I.slice(l.start,l.end),z())[0]):none(),q=x?some(Y(h,S.treeInfos.slice(x.start,x.end),S.leafIndices.slice(x.start,x.end),S.rootIndices.slice(x.start,x.end),S.proveByIndices.slice(x.start,x.end),I.slice(x.start,x.end),z())[0]):none(),{remainingAccounts:H,systemOffset:V}=h.toAccountMetas(),O=b(S,V),re=[];return u.length>0&&re.push(F(u)),re.push(Sc({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof C?void 0:n,oldSettings:T,oldSettingsMutArgs:W,newSettings:D,newSettingsMutArgs:q,compressedProofArgs:O,userMutArgs:L,remainingAccounts:H})),re}async function Dw({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new U;await t.addSystemAccounts();let{address:c,addressTree:i}=await j(r,s),a=[{address:c,tree:i,queue:i,type:"Settings"}],o=await k([],a),d=(await ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),y=b(o,g);return Ec({compressedProofArgs:y,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function bw({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new U;await t.addSystemAccounts();let{address:c,addressTree:i}=await N(r,s),a=[{address:c,tree:i,queue:i,type:"User"}],o=await k([],a),d=(await ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),y=b(o,g);return _c({compressedProofArgs:y,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}async function $w({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let{domainConfig:c,verifyArgs:i,message:a,signature:o,publicKey:d}=G(r),u=[];a&&o&&d&&u.push({message:a,signature:o,publicKey:d});let g=new U;await g.addSystemAccounts();let y=[],T=[];T.push(...await ce([{address:(await N("address"in r?r.address:r,s)).address,type:"User"}],t));let l=await le(),{address:D,addressTree:x}=await j(e,l);y.push({address:D,queue:x,tree:x,type:"Settings"});let h=T.length,I=await k(T,y),S=Y(g,I.treeInfos.slice(0,h),I.leafIndices.slice(0,h),I.rootIndices.slice(0,h),I.proveByIndices.slice(0,h),T.filter(re=>re.type==="User"),J())[0],W=(await ae(g,I.treeInfos.slice(h),I.roots.slice(h),I.rootIndices.slice(h),y)).find(re=>re.type==="Settings")??null;c?g.addPreAccounts([{address:c,role:AccountRole.READONLY}]):"address"in r&&g.addPreAccounts([{address:r.address,role:AccountRole.READONLY_SIGNER,signer:r}]);let{remainingAccounts:q,systemOffset:H}=g.toAccountMetas(),V=b(I,H),O=[];if(!W)throw new Error("Settings creation args is missing.");return u.length>0&&O.push(F(u)),O.push(await No({settingsIndex:e,payer:n,initialMember:r instanceof C?void 0:r,secp256r1VerifyArgs:i,domainConfig:c,userArgs:S.data.role===1?{__kind:"Mutate",fields:[S]}:{__kind:"Read",fields:[S]},compressedProofArgs:V,settingsCreation:W,remainingAccounts:q})),O}async function ik({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=await ce([{address:(await j(e,n)).address,type:"Settings"}],t),a=await k(i,[]),o=Y(c,a.treeInfos,a.leafIndices,a.rootIndices,a.proveByIndices,i.filter(I=>I.type==="Settings"),z())[0],d=ge(s),u=d.filter(I=>I instanceof C),g=[],y=[];for(let I of u){let S=g.length,{domainConfig:L,verifyArgs:W,signature:q,publicKey:H,message:V}=G(I,S);V&&q&&H&&g.push({message:V,signature:q,publicKey:H}),L&&(c.addPreAccounts([{address:L,role:AccountRole.READONLY}]),W?.__option==="Some"&&y.push({domainConfigKey:L,verifyArgs:W.value}));}c.addPreAccounts(d.filter(I=>"address"in I).map(I=>({address:I.address,role:AccountRole.READONLY_SIGNER,signer:I})));let{remainingAccounts:T,systemOffset:l}=c.toAccountMetas(),D=b(a,l),x=[];g.length>0&&x.push(F(g));let h=await Z(e);return x.push(Yo({settings:h,payer:r,settingsMut:o,compressedProofArgs:D,secp256r1VerifyArgs:y,remainingAccounts:T})),x}function BC(e,n,r,s){let t=wC(e,n),c=kC(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function wC(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=s-t,a=r-s-c;return n>=r?false:n<i?true:n>=s?n-s<a:false}function kC(e,n){return n<e.header.numSignerAccounts}async function ur({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Ui(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),oe()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,o]of t.staticAccounts.entries())i.push({address:o,role:BC(t,a,o,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let o=c[a.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.READONLY});}}for(let a of s?.filter(o=>o.address!==e)??[]){let o=i.findIndex(d=>d.address===a.address);o===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[o].role===AccountRole.READONLY||i[o].role===AccountRole.READONLY_SIGNER?i[o]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[o].role===AccountRole.WRITABLE||i[o].role===AccountRole.WRITABLE_SIGNER)&&(i[o]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}async function bd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:o=false}){let d=await Ce(e),{accountMetas:u,addressLookupTableAccounts:g}=await ur({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(F(c)),y.push(o?mi({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):di({transactionBuffer:n,payer:s.address,settings:e})),a&&y.push(Yi({payer:s,tipAmount:a})),{instructions:y,addressLookupTableAccounts:g}}async function _d({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:i=[],compressed:a=false,simulateProof:o=false,cachedAccounts:d}){let u=ge(s),g=await Z(e),y=await Ce(g),[{accountMetas:T,addressLookupTableAccounts:l,transactionMessage:D},{settingsReadonlyArgs:x,proof:h,packedAccounts:I}]=await Promise.all([ur({transactionMessageBytes:r,walletAddress:y,additionalSigners:u.filter(O=>!(O instanceof C)),addressesByLookupTableAddress:c}),fe(a,e,n,o,d)]);I.addPreAccounts(T);let S=u.filter(O=>O instanceof C),L=[];for(let O of S){let re=i.length,{domainConfig:Te,verifyArgs:Pe,signature:De,publicKey:Re,message:Bt}=G(O,re);Bt&&De&&Re&&i.push({message:Bt,signature:De,publicKey:Re}),Te&&(I.addPreAccounts([{address:Te,role:AccountRole.READONLY}]),Pe?.__option==="Some"&&L.push({domainConfigKey:Te,verifyArgs:Pe.value}));}let{remainingAccounts:W,systemOffset:q}=I.toAccountMetas(),H=[];i.length>0&&H.push(F(i));let V=HC(D,T);if(a){if(!t||!x)throw new Error("Payer not found or proof args is missing.");let O=b(h,q);H.push(Pi({secp256r1VerifyArgs:L,transactionMessage:V,settingsReadonlyArgs:x,compressedProofArgs:O,payer:t,remainingAccounts:W}));}else H.push(Ii({secp256r1VerifyArgs:L,settings:g,transactionMessage:V,remainingAccounts:W}));return {instructions:H,addressLookupTableAccounts:l}}function HC(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 Bk({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let o=ge(s),d=await Z(e),u=await Ce(d),{settingsReadonlyArgs:g,proof:y,packedAccounts:T}=await fe(a,e,n,false,t),l=[],D=[];for(let S of o)if(S instanceof C){let L=l.length,{domainConfig:W,verifyArgs:q,signature:H,publicKey:V,message:O}=G(S,L);O&&H&&V&&l.push({message:O,signature:H,publicKey:V}),W&&(T.addPreAccounts([{address:W,role:AccountRole.READONLY}]),q?.__option==="Some"&&D.push({domainConfigKey:W,verifyArgs:q.value}));}else T.addPreAccounts([{address:S.address,role:AccountRole.READONLY_SIGNER,signer:S}]);let{remainingAccounts:x,systemOffset:h}=T.toAccountMetas(),I=[];if(l.length>0&&I.push(F(l)),a){if(!i||!g)throw new Error("Payer not found or proof args is missing.");let S=b(y,h);I.push(Vc({amount:c,settingsReadonlyArgs:g,compressedProofArgs:S,payer:i,secp256r1VerifyArgs:D,source:u,destination:r,remainingAccounts:x}));}else I.push(Oc({amount:c,secp256r1VerifyArgs:D,source:u,destination:r,settings:d,remainingAccounts:x}));return I}async function Jk({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:o,createAtaIfNeeded:d=true,compressed:u=false}){let g=ge(t),y=await Z(e),T=await Ce(y),[l,D]=await Promise.all([getAssociatedTokenAccountAddress(s,T,o),getAssociatedTokenAccountAddress(s,r,o)]),{settingsReadonlyArgs:x,proof:h,packedAccounts:I}=await fe(u,e,n,false,c),S=[],L=[];for(let V of g)if(V instanceof C){let O=S.length,{domainConfig:re,verifyArgs:Te,signature:Pe,publicKey:De,message:Re}=G(V,O);Re&&Pe&&De&&S.push({message:Re,signature:Pe,publicKey:De}),re&&(I.addPreAccounts([{address:re,role:AccountRole.READONLY}]),Te?.__option==="Some"&&L.push({domainConfigKey:re,verifyArgs:Te.value}));}else I.addPreAccounts([{address:V.address,role:AccountRole.READONLY_SIGNER,signer:V}]);let{remainingAccounts:W,systemOffset:q}=I.toAccountMetas(),H=[];if(S.length>0&&H.push(F(S)),u){if(!a||!x)throw new Error("Payer not found or proof args is missing.");let V=b(h,q);H.push(Xc({amount:i,createAtaIfNeeded:d,settingsReadonlyArgs:x,compressedProofArgs:V,payer:a,secp256r1VerifyArgs:L,source:T,sourceTokenAccount:l,destination:r,destinationTokenAccount:D,mint:s,tokenProgram:o,remainingAccounts:W}));}else H.push(Kc({amount:i,createAtaIfNeeded:d,secp256r1VerifyArgs:L,source:T,sourceTokenAccount:l,destination:r,destinationTokenAccount:D,settings:y,mint:s,tokenProgram:o,remainingAccounts:W}));return H}async function nN({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:i}){let a=await Ns(oe(),s),o=a.data.multiWalletSettings,{settingsReadonlyArgs:d,proof:u,packedAccounts:g}=await fe(c,e,n,false,i),{remainingAccounts:y,systemOffset:T}=g.toAccountMetas(),{domainConfig:l,verifyArgs:D,message:x,signature:h,publicKey:I}=G(r),S=[];if(x&&h&&I&&S.push(F([{message:x,signature:h,publicKey:I}])),c){if(!t||!d)throw new Error("Payer not found or proof args is missing.");let L=b(u,T);S.push(da({transactionBuffer:s,domainConfig:l,closer:r instanceof C?void 0:r,rentCollector:a.data.payer,secp256r1VerifyArgs:D,settingsReadonlyArgs:d,payer:t,compressedProofArgs:L,remainingAccounts:y}));}else S.push(na({transactionBuffer:s,domainConfig:l,closer:r instanceof C?void 0:r,settings:o,payer:a.data.payer,secp256r1VerifyArgs:D,remainingAccounts:[]}));return S}function Od({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:y,message:T,signature:l,publicKey:D}=G(n),x=[];if(T&&l&&D&&x.push(F([{message:T,signature:l,publicKey:D}])),d){let{settingsReadonlyArgs:h,compressedProofArgs:I,remainingAccounts:S}=d;x.push(Ia({transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof C?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},settingsReadonlyArgs:h,compressedProofArgs:I,remainingAccounts:S}));}else x.push(ma({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof C?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},remainingAccounts:[]}));return x}function Bd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:o}=G(e),d=[];return a&&i&&o&&d.push(F([{message:a,signature:i,publicKey:o}])),s?d.push(Wa({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Pa({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,remainingAccounts:[]})),d}function wd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Ka({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Na({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function kd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:o}=G(n),d=[];return o&&i&&a&&d.push(F([{message:o,signature:i,publicKey:a}])),s?d.push(ni({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Xa({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,remainingAccounts:[]})),d}async function FN({message:e,signer:n,popUp:r}){let{clientId:s,signClientMessage:t}=Ze(),c={type:"message",payload:e},i=getBase64Decoder().decode(new Uint8Array([...new TextEncoder().encode(JSON.stringify(c)),...n?n.toBuffer():[]])),{signature:a,expiry:o}=await t("start",i),d=`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}&clientId=${encodeURIComponent(s)}&signature=${encodeURIComponent(a)}&expiry=${encodeURIComponent(o)}`,u=await rr({authUrl:d,data:c,signer:n,popUp:r});return {...u,signer:new Ae(u.signer)}}async function YN({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){let{clientId:c,signClientMessage:i}=Ze(),a={type:"transaction",payload:JSON.stringify({transactionActionType:e,transactionAddress:n,transactionMessageBytes:nr(r)})},o=getBase64Decoder().decode(new Uint8Array([...new TextEncoder().encode(JSON.stringify(a)),...s?s.toBuffer():[]])),{signature:d,expiry:u}=await i("start",o),g=`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}&clientId=${encodeURIComponent(c)}&signature=${encodeURIComponent(d)}&expiry=${encodeURIComponent(u)}`,y=await rr({authUrl:g,data:a,signer:s,popUp:t});return {...y,signer:new Ae(y.signer)}}async function r2({message:e,response:n,expectedRPID:r=Qi(),expectedOrigin:s=he()}){let t=new Uint8Array([...new TextEncoder().encode(e),...Mn(n.clientId,n.deviceSignature.publicKey,n.nonce)]),{verified:c}=await verifyAuthenticationResponse({response:n.authResponse,expectedChallenge:nr(t),expectedOrigin:s,expectedRPID:r,requireUserVerification:false,credential:{id:n.authResponse.id,publicKey:zi(n.signer.toString()),counter:0}}),i=ed25519.verify(new Uint8Array(getBase58Encoder().encode(n.deviceSignature.signature)),Je(n.authResponse),new Uint8Array(getBase58Encoder().encode(n.deviceSignature.publicKey)));return c&&i}async function p2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:y=Math.ceil(s.length/2),cachedAccounts:T}){let l=await Z(n),D=Math.floor(Math.random()*255),x=await yd(l,t instanceof C?t:t.address,D),h=[],I=[];for(let X=0;X<s.length;X+=y){let Nn=s.subarray(X,X+y);h.push(Nn),I.push(sha256(Nn));}let S=sha256(new Uint8Array(s)),{settingsReadonlyArgs:L,proof:W,packedAccounts:q}=await fe(d,n,r,false,T),{remainingAccounts:H,systemOffset:V}=q.toAccountMetas(),O=L?{settingsReadonlyArgs:L,compressedProofArgs:b(W,V),remainingAccounts:H,payer:e}:null,re=ge([t,...c?[c]:[],...u]).filter(X=>X instanceof C).map(X=>({memberKey:qe(X),messageHash:Je(X.authResponse)})),Te=Od({finalBufferHash:S,finalBufferSize:s.length,bufferIndex:D,payer:e,transactionBufferAddress:x,settings:l,creator:t,preauthorizeExecution:!c,bufferExtendHashes:I,compressedArgs:O,expectedSecp256r1Signers:re}),Pe=h.map(X=>wd({transactionMessageBytes:X,transactionBufferAddress:x,settings:l,compressed:d})),De=u.map(X=>kd({voter:X,transactionBufferAddress:x,settings:l,compressedArgs:O})),Re=Bd({compressedArgs:O,settings:l,executor:c,transactionBufferAddress:x}),{instructions:Bt,addressLookupTableAccounts:Gd}=await bd({compressed:d,settings:l,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o}),et=X=>({payer:e,instructions:X,addressesByLookupTableAddress:Gd});return [et(Te),...Pe.map(X=>et([X])),...De.length?[et(De.flat())]:[],et(Re),et(Bt)]}var gr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=i=>{let a=s.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},s.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let o=t(a.address);o.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,o.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,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),i={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 a=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [i,a]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,o=n.findIndex(d=>d===a);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(a),this.keyMetaMap.delete(c);}}return [s,t]}};var yr=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,i)=>{s.set(c,i);});let t=c=>{let i=s.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function Vd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=gr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(s??{});for(let y of a){let T=t.extractTableLookup(y);if(T!==void 0){let{addressTableLookup:l,drainedKeys:D}=T;c.push({readonlyIndexes:l.readonlyIndexes,readableIndices:l.readonlyIndexes,writableIndexes:l.writableIndexes,writableIndices:l.writableIndexes,lookupTableAddress:address(l.lookupTableAddress)}),i.writable.push(...D.writable),i.readonly.push(...D.readonly);}}let[o,d]=t.getMessageComponents(),g=new yr(d,i).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function P2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Vd({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return _i(s)}async function U2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i,cachedAccounts:a,compressed:o=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await _d({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:i,simulateProof:d,cachedAccounts:a});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}
|
|
2
|
+
export{Ys as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,co as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,to as CHANGE_CONFIG_DISCRIMINATOR,yo as COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Mo as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Ro as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Uo as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,wo as CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR,Vo as CREATE_USER_ACCOUNTS_DISCRIMINATOR,Jo as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,$o as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Hn as DOMAIN_CONFIG_DISCRIMINATOR,oc as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,uc as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,Tc as EDIT_USER_DELEGATE_DISCRIMINATOR,Jn as GLOBAL_COUNTER_DISCRIMINATOR,Wt as KeyType,Cc as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,Rc as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,bx as MULTI_WALLET_ERROR__ALREADY_DELEGATED,ax as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,Yx as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,Zx as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,ux as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,dx as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,xx as MULTI_WALLET_ERROR__EMPTY_MEMBERS,lx as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,ix as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,Tx as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,Nx as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,Hx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,Vx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,Wx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,_x as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,Ux as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,Ex as MULTI_WALLET_ERROR__INVALID_ACCOUNT,Qx as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,Sx as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,Px as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,kx as MULTI_WALLET_ERROR__INVALID_BUFFER,Lx as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,Mx as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,yx as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,tx as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,sx as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,ex as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,nx as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,jx as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,Cx as MULTI_WALLET_ERROR__INVALID_THRESHOLD,fx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,mx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,Dx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,hx as MULTI_WALLET_ERROR__INVALID_USER_ROLE,ox as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,Kx as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,Xx as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,Rx as MULTI_WALLET_ERROR__MISSING_ACCOUNT,Jx as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,vx as MULTI_WALLET_ERROR__MISSING_USER_ARGS,Bx as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,gx as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,px as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,$x as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,Ax as MULTI_WALLET_ERROR__PERMANENT_MEMBER,zx as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,cx as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,rx as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,qx as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,Ix as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,Gx as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,Fx as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,wx as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,Ox as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,XS as MultiWalletAccount,$S as MultiWalletInstruction,kc as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Wc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Ie as Permission,Me as Permissions,vs as SETTINGS_DISCRIMINATOR,Ae as Secp256r1Key,C as SignedSecp256r1Key,Yc as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Fc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,ca as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,ea as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,la as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,ga as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Bs as TRANSACTION_BUFFER_DISCRIMINATOR,ba as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Ma as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Ga as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Ba as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,ei as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,qa as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,gi as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,ci as TRANSACTION_EXECUTE_DISCRIMINATOR,Mi as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,li as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Be as UserRole,Gs as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,mB as addWhitelistedAddressTrees,$O as changeConfig,nN as closeTransactionBuffer,gB as compressSettingsAccount,LD as configAction,fd as convertMemberKeyToString,zi as convertPubkeyCompressedToCose,mL as convertPubkeyCoseToCompressed,CB as createDomainConfig,UB as createDomainUserAccounts,BB as createGlobalCounter,Gi as createPopUp,Od as createTransactionBuffer,gC as createTransactionManagerSigner,FB as createUserAccounts,$w as createWallet,Gn as decodeDomainConfig,qn as decodeGlobalCounter,_s as decodeSettings,ks as decodeTransactionBuffer,zs as decodeWhitelistedAddressTree,ik as decompressSettingsAccount,jB as disableDomainConfig,ew as editDomainConfig,cw as editTransactionManagerUrl,Tw as editUserDelegate,bd as executeTransaction,Bd as executeTransactionBuffer,_d as executeTransactionSync,wd as extendTransactionBuffer,YC as fetchAllDomainConfig,rD as fetchAllGlobalCounter,ru as fetchAllMaybeDomainConfig,lu as fetchAllMaybeGlobalCounter,Py as fetchAllMaybeSettings,Yy as fetchAllMaybeTransactionBuffer,mp as fetchAllMaybeWhitelistedAddressTree,Ch as fetchAllSettings,vh as fetchAllTransactionBuffer,Lh as fetchAllWhitelistedAddressTree,rd as fetchCompressedAccount,Fn as fetchDomainConfig,tD as fetchGlobalCounter,tu as fetchMaybeDomainConfig,fu as fetchMaybeGlobalCounter,jr as fetchMaybeSettings,YI as fetchMaybeSettingsAccountData,qy as fetchMaybeTransactionBuffer,qI as fetchMaybeUserAccountData,pp as fetchMaybeWhitelistedAddressTree,Ih as fetchSettings,Ot as fetchSettingsAccountData,Ns as fetchTransactionBuffer,ir as fetchUserAccountData,Ks as fetchWhitelistedAddressTree,aD as getAddMemberArgsCodec,mr as getAddMemberArgsDecoder,pr as getAddMemberArgsEncoder,Xh as getAddWhitelistedAddressTreesDiscriminatorBytes,Qh as getAddWhitelistedAddressTreesInstruction,Xs as getAddWhitelistedAddressTreesInstructionAsync,$h as getAddWhitelistedAddressTreesInstructionDataCodec,Zs as getAddWhitelistedAddressTreesInstructionDataDecoder,tn as getAddWhitelistedAddressTreesInstructionDataEncoder,he as getAuthEndpoint,fP as getChangeConfigCompressedDiscriminatorBytes,uo as getChangeConfigCompressedInstruction,lP as getChangeConfigCompressedInstructionDataCodec,io as getChangeConfigCompressedInstructionDataDecoder,ao as getChangeConfigCompressedInstructionDataEncoder,aP as getChangeConfigDiscriminatorBytes,dP as getChangeConfigInstruction,no as getChangeConfigInstructionAsync,iP as getChangeConfigInstructionDataCodec,ro as getChangeConfigInstructionDataDecoder,rn as getChangeConfigInstructionDataEncoder,Mn as getClientAndDeviceHash,Ze as getClientSettings,uD as getCompiledInstructionCodec,fr as getCompiledInstructionDecoder,Tr as getCompiledInstructionEncoder,hP as getCompressSettingsAccountDiscriminatorBytes,To as getCompressSettingsAccountInstruction,PP as getCompressSettingsAccountInstructionDataCodec,mo as getCompressSettingsAccountInstructionDataDecoder,po as getCompressSettingsAccountInstructionDataEncoder,pD as getCompressedAccountMetaCodec,st as getCompressedAccountMetaDecoder,nt as getCompressedAccountMetaEncoder,lD as getCompressedAccountMetaReadOnlyCodec,it as getCompressedAccountMetaReadOnlyDecoder,at as getCompressedAccountMetaReadOnlyEncoder,ID as getCompressedProofCodec,Dr as getCompressedProofDecoder,Cr as getCompressedProofEncoder,j as getCompressedSettingsAddressFromIndex,ED as getCompressedSettingsCodec,vD as getCompressedSettingsDataCodec,At as getCompressedSettingsDataDecoder,ut as getCompressedSettingsDataEncoder,z as getCompressedSettingsDecoder,dt as getCompressedSettingsEncoder,$i as getComputeBudgetEstimate,WD as getConfigActionCodec,mt as getConfigActionDecoder,pt as getConfigActionEncoder,OP as getCreateDomainConfigDiscriminatorBytes,wP as getCreateDomainConfigInstruction,ho as getCreateDomainConfigInstructionAsync,BP as getCreateDomainConfigInstructionDataCodec,Eo as getCreateDomainConfigInstructionDataDecoder,sn as getCreateDomainConfigInstructionDataEncoder,KP as getCreateDomainUserAccountDiscriminatorBytes,jP as getCreateDomainUserAccountInstruction,bo as getCreateDomainUserAccountInstructionAsync,JP as getCreateDomainUserAccountInstructionDataCodec,vo as getCreateDomainUserAccountInstructionDataDecoder,cn as getCreateDomainUserAccountInstructionDataEncoder,eR as getCreateGlobalCounterDiscriminatorBytes,rR as getCreateGlobalCounterInstruction,Lo as getCreateGlobalCounterInstructionAsync,tR as getCreateGlobalCounterInstructionDataCodec,Wo as getCreateGlobalCounterInstructionDataDecoder,dn as getCreateGlobalCounterInstructionDataEncoder,uR as getCreateMultiWalletCompressedDiscriminatorBytes,gR as getCreateMultiWalletCompressedInstruction,No as getCreateMultiWalletCompressedInstructionAsync,AR as getCreateMultiWalletCompressedInstructionDataCodec,ko as getCreateMultiWalletCompressedInstructionDataDecoder,un as getCreateMultiWalletCompressedInstructionDataEncoder,ND as getCreateUserAccountArgsCodec,_r as getCreateUserAccountArgsDecoder,br as getCreateUserAccountArgsEncoder,xR as getCreateUserAccountsDiscriminatorBytes,CR as getCreateUserAccountsInstruction,Fo as getCreateUserAccountsInstructionAsync,IR as getCreateUserAccountsInstructionDataCodec,Go as getCreateUserAccountsInstructionDataDecoder,gn as getCreateUserAccountsInstructionDataEncoder,bR as getDecompressSettingsAccountDiscriminatorBytes,Yo as getDecompressSettingsAccountInstruction,_R as getDecompressSettingsAccountInstructionDataCodec,qo as getDecompressSettingsAccountInstructionDataDecoder,jo as getDecompressSettingsAccountInstructionDataEncoder,kR as getDisableDomainConfigDiscriminatorBytes,tc as getDisableDomainConfigInstruction,NR as getDisableDomainConfigInstructionDataCodec,ec as getDisableDomainConfigInstructionDataDecoder,Qo as getDisableDomainConfigInstructionDataEncoder,je as getDomainConfigAddress,qC as getDomainConfigCodec,Vn as getDomainConfigDecoder,jC as getDomainConfigDiscriminatorBytes,eu as getDomainConfigEncoder,ZC as getDomainConfigSize,jR as getEditDomainConfigDiscriminatorBytes,ac as getEditDomainConfigInstruction,YR as getEditDomainConfigInstructionAsync,qR as getEditDomainConfigInstructionDataCodec,cc as getEditDomainConfigInstructionDataDecoder,pn as getEditDomainConfigInstructionDataEncoder,FD as getEditMemberArgsCodec,Pr as getEditMemberArgsDecoder,hr as getEditMemberArgsEncoder,nv as getEditTransactionManagerUrlDiscriminatorBytes,yc as getEditTransactionManagerUrlInstruction,sv as getEditTransactionManagerUrlInstructionDataCodec,gc as getEditTransactionManagerUrlInstructionDataDecoder,Ac as getEditTransactionManagerUrlInstructionDataEncoder,gv as getEditUserDelegateDiscriminatorBytes,Sc as getEditUserDelegateInstruction,yv as getEditUserDelegateInstructionDataCodec,lc as getEditUserDelegateInstructionDataDecoder,fc as getEditUserDelegateInstructionDataEncoder,jD as getExpectedSecp256r1SignersCodec,ft as getExpectedSecp256r1SignersDecoder,Tt as getExpectedSecp256r1SignersEncoder,WL as getFeePayer,gd as getGlobalCounterAddress,eD as getGlobalCounterCodec,jn as getGlobalCounterDecoder,QC as getGlobalCounterDiscriminatorBytes,Tu as getGlobalCounterEncoder,nD as getGlobalCounterSize,Rn as getJitoTipsConfig,TO as getLightCpiSigner,He as getLightProtocolRpc,XD as getLinkWalletArgsCodec,Wr as getLinkWalletArgsDecoder,Ur as getLinkWalletArgsEncoder,tM as getMemberCodec,yt as getMemberDecoder,gt as getMemberEncoder,sM as getMemberKeyCodec,Q as getMemberKeyDecoder,$ as getMemberKeyEncoder,Iv as getMigrateCompressedSettingsDiscriminatorBytes,Ec as getMigrateCompressedSettingsInstruction,Cv as getMigrateCompressedSettingsInstructionDataCodec,Mc as getMigrateCompressedSettingsInstructionDataDecoder,Dc as getMigrateCompressedSettingsInstructionDataEncoder,bv as getMigrateCompressedUsersDiscriminatorBytes,_c as getMigrateCompressedUsersInstruction,_v as getMigrateCompressedUsersInstructionDataCodec,bc as getMigrateCompressedUsersInstructionDataDecoder,vc as getMigrateCompressedUsersInstructionDataEncoder,DW as getMultiWalletErrorMessage,Yv as getNativeTransferIntentCompressedDiscriminatorBytes,Vc as getNativeTransferIntentCompressedInstruction,Zv as getNativeTransferIntentCompressedInstructionDataCodec,Hc as getNativeTransferIntentCompressedInstructionDataDecoder,Nc as getNativeTransferIntentCompressedInstructionDataEncoder,Nv as getNativeTransferIntentDiscriminatorBytes,Oc as getNativeTransferIntentInstruction,Vv as getNativeTransferIntentInstructionAsync,Hv as getNativeTransferIntentInstructionDataCodec,Lc as getNativeTransferIntentInstructionDataDecoder,mn as getNativeTransferIntentInstructionDataEncoder,iM as getNewAuthorityArgsCodec,wr as getNewAuthorityArgsDecoder,Br as getNewAuthorityArgsEncoder,fL as getOriginIndex,AM as getPackedAddressTreeInfoCodec,St as getPackedAddressTreeInfoDecoder,lt as getPackedAddressTreeInfoEncoder,pM as getPackedStateTreeInfoCodec,ct as getPackedStateTreeInfoDecoder,ot as getPackedStateTreeInfoEncoder,fM as getPermissionsCodec,be as getPermissionsDecoder,ve as getPermissionsEncoder,IM as getProofArgsCodec,E as getProofArgsDecoder,M as getProofArgsEncoder,EM as getRemoveMemberArgsCodec,vr as getRemoveMemberArgsDecoder,Rr as getRemoveMemberArgsEncoder,Qi as getRpId,En as getSecp256r1Message,Je as getSecp256r1MessageHash,RM as getSecp256r1PubkeyCodec,xt as getSecp256r1PubkeyDecoder,kr as getSecp256r1PubkeyEncoder,_C as getSecp256r1SignatureOffsetsDataDecoder,bC as getSecp256r1SignatureOffsetsDataEncoder,_M as getSecp256r1VerifyArgsCodec,w as getSecp256r1VerifyArgsDecoder,B as getSecp256r1VerifyArgsEncoder,OM as getSecp256r1VerifyArgsWithDomainAddressCodec,te as getSecp256r1VerifyArgsWithDomainAddressDecoder,ee as getSecp256r1VerifyArgsWithDomainAddressEncoder,F as getSecp256r1VerifyInstruction,tB as getSecp256r1VerifyInstructionDataCodec,Dd as getSecp256r1VerifyInstructionDataDecoder,Md as getSecp256r1VerifyInstructionDataEncoder,Xi as getSendAndConfirmTransaction,xh as getSettingsCodec,NM as getSettingsCreationArgsCodec,Ct as getSettingsCreationArgsDecoder,It as getSettingsCreationArgsEncoder,bs as getSettingsDecoder,Sh as getSettingsDiscriminatorBytes,hy as getSettingsEncoder,Z as getSettingsFromIndex,GM as getSettingsIndexWithAddressCodec,Mt as getSettingsIndexWithAddressDecoder,Dt as getSettingsIndexWithAddressEncoder,JM as getSettingsMutArgsCodec,ue as getSettingsMutArgsDecoder,de as getSettingsMutArgsEncoder,ZM as getSettingsReadonlyArgsCodec,se as getSettingsReadonlyArgsDecoder,ne as getSettingsReadonlyArgsEncoder,Dh as getSettingsSize,TL as getSignedSecp256r1Key,WO as getSignedTransactionManager,oe as getSolanaRpc,Ye as getSolanaRpcEndpoint,pb as getTokenTransferIntentCompressedDiscriminatorBytes,Xc as getTokenTransferIntentCompressedInstruction,Tb as getTokenTransferIntentCompressedInstructionAsync,mb as getTokenTransferIntentCompressedInstructionDataCodec,Zc as getTokenTransferIntentCompressedInstructionDataDecoder,ln as getTokenTransferIntentCompressedInstructionDataEncoder,sb as getTokenTransferIntentDiscriminatorBytes,Kc as getTokenTransferIntentInstruction,cb as getTokenTransferIntentInstructionAsync,ob as getTokenTransferIntentInstructionDataCodec,zc as getTokenTransferIntentInstructionDataDecoder,fn as getTokenTransferIntentInstructionDataEncoder,yd as getTransactionBufferAddress,Wb as getTransactionBufferCloseCompressedDiscriminatorBytes,da as getTransactionBufferCloseCompressedInstruction,Lb as getTransactionBufferCloseCompressedInstructionDataCodec,ia as getTransactionBufferCloseCompressedInstructionDataDecoder,aa as getTransactionBufferCloseCompressedInstructionDataEncoder,Mb as getTransactionBufferCloseDiscriminatorBytes,na as getTransactionBufferCloseInstruction,Eb as getTransactionBufferCloseInstructionDataCodec,ra as getTransactionBufferCloseInstructionDataDecoder,ta as getTransactionBufferCloseInstructionDataEncoder,Rh as getTransactionBufferCodec,eE as getTransactionBufferCreateArgsCodec,ht as getTransactionBufferCreateArgsDecoder,Et as getTransactionBufferCreateArgsEncoder,Xb as getTransactionBufferCreateCompressedDiscriminatorBytes,Ia as getTransactionBufferCreateCompressedInstruction,$b as getTransactionBufferCreateCompressedInstructionDataCodec,xa as getTransactionBufferCreateCompressedInstructionDataDecoder,Sa as getTransactionBufferCreateCompressedInstructionDataEncoder,Gb as getTransactionBufferCreateDiscriminatorBytes,ma as getTransactionBufferCreateInstruction,Fb as getTransactionBufferCreateInstructionDataCodec,pa as getTransactionBufferCreateInstructionDataDecoder,ya as getTransactionBufferCreateInstructionDataEncoder,ws as getTransactionBufferDecoder,Ph as getTransactionBufferDiscriminatorBytes,jy as getTransactionBufferEncoder,m_ as getTransactionBufferExecuteCompressedDiscriminatorBytes,Wa as getTransactionBufferExecuteCompressedInstruction,T_ as getTransactionBufferExecuteCompressedInstructionDataCodec,Ua as getTransactionBufferExecuteCompressedInstructionDataDecoder,_a as getTransactionBufferExecuteCompressedInstructionDataEncoder,c_ as getTransactionBufferExecuteDiscriminatorBytes,Pa as getTransactionBufferExecuteInstruction,a_ as getTransactionBufferExecuteInstructionDataCodec,ha as getTransactionBufferExecuteInstructionDataDecoder,Ea as getTransactionBufferExecuteInstructionDataEncoder,__ as getTransactionBufferExtendCompressedDiscriminatorBytes,Ka as getTransactionBufferExtendCompressedInstruction,U_ as getTransactionBufferExtendCompressedInstructionDataCodec,za as getTransactionBufferExtendCompressedInstructionDataDecoder,Fa as getTransactionBufferExtendCompressedInstructionDataEncoder,D_ as getTransactionBufferExtendDiscriminatorBytes,Na as getTransactionBufferExtendInstruction,M_ as getTransactionBufferExtendInstructionDataCodec,ka as getTransactionBufferExtendInstructionDataDecoder,wa as getTransactionBufferExtendInstructionDataEncoder,Y_ as getTransactionBufferVoteCompressedDiscriminatorBytes,ni as getTransactionBufferVoteCompressedInstruction,Z_ as getTransactionBufferVoteCompressedInstructionDataCodec,ri as getTransactionBufferVoteCompressedInstructionDataDecoder,ti as getTransactionBufferVoteCompressedInstructionDataEncoder,H_ as getTransactionBufferVoteDiscriminatorBytes,Xa as getTransactionBufferVoteInstruction,V_ as getTransactionBufferVoteInstructionDataCodec,Za as getTransactionBufferVoteInstructionDataDecoder,Ya as getTransactionBufferVoteInstructionDataEncoder,AU as getTransactionExecuteCompressedDiscriminatorBytes,mi as getTransactionExecuteCompressedInstruction,gU as getTransactionExecuteCompressedInstructionDataCodec,pi as getTransactionExecuteCompressedInstructionDataDecoder,yi as getTransactionExecuteCompressedInstructionDataEncoder,nU as getTransactionExecuteDiscriminatorBytes,di as getTransactionExecuteInstruction,sU as getTransactionExecuteInstructionDataCodec,ii as getTransactionExecuteInstructionDataDecoder,ai as getTransactionExecuteInstructionDataEncoder,vU as getTransactionExecuteSyncCompressedDiscriminatorBytes,Pi as getTransactionExecuteSyncCompressedInstruction,bU as getTransactionExecuteSyncCompressedInstructionDataCodec,hi as getTransactionExecuteSyncCompressedInstructionDataDecoder,Ei as getTransactionExecuteSyncCompressedInstructionDataEncoder,xU as getTransactionExecuteSyncDiscriminatorBytes,Ii as getTransactionExecuteSyncInstruction,IU as getTransactionExecuteSyncInstructionDataCodec,xi as getTransactionExecuteSyncInstructionDataDecoder,Si as getTransactionExecuteSyncInstructionDataEncoder,aE as getTransactionMessageAddressTableLookupCodec,Hr as getTransactionMessageAddressTableLookupDecoder,Nr as getTransactionMessageAddressTableLookupEncoder,sE as getTransactionMessageCodec,Rt as getTransactionMessageDecoder,Pt as getTransactionMessageEncoder,N as getUserAccountAddress,AE as getUserCodec,mE as getUserCreationArgsCodec,me as getUserCreationArgsDecoder,pe as getUserCreationArgsEncoder,J as getUserDecoder,Oe as getUserEncoder,SE as getUserMutArgsCodec,xe as getUserMutArgsDecoder,Se as getUserMutArgsEncoder,DE as getUserReadOnlyArgsCodec,zr as getUserReadOnlyArgsDecoder,Fr as getUserReadOnlyArgsEncoder,PE as getUserReadOnlyOrMutateArgsCodec,Ue as getUserReadOnlyOrMutateArgsDecoder,_e as getUserReadOnlyOrMutateArgsEncoder,UE as getUserRoleCodec,Le as getUserRoleDecoder,We as getUserRoleEncoder,pd as getWalletAddressFromIndex,Ce as getWalletAddressFromSettings,Wh as getWhitelistedAddressTreeCodec,Fs as getWhitelistedAddressTreeDecoder,Uh as getWhitelistedAddressTreeDiscriminatorBytes,yp as getWhitelistedAddressTreeEncoder,bn as getWhitelistedAddressTreeFromIndex,aO as getWhitelistedAddressTreeIndexFromAddress,nd as getWhitelistedAddressTreesAddress,TW as identifyMultiWalletAccount,fW as identifyMultiWalletInstruction,OL as initialize,OD as isConfigAction,MW as isMultiWalletError,vE as isUserReadOnlyOrMutateArgs,Dw as migrateSettings,bw as migrateUsers,Bk as nativeTransferIntent,eP as parseAddWhitelistedAddressTreesInstruction,SP as parseChangeConfigCompressedInstruction,uP as parseChangeConfigInstruction,RP as parseCompressSettingsAccountInstruction,kP as parseCreateDomainConfigInstruction,qP as parseCreateDomainUserAccountInstruction,nR as parseCreateGlobalCounterInstruction,yR as parseCreateMultiWalletCompressedInstruction,DR as parseCreateUserAccountsInstruction,UR as parseDecompressSettingsAccountInstruction,HR as parseDisableDomainConfigInstruction,ZR as parseEditDomainConfigInstruction,ov as parseEditTransactionManagerUrlInstruction,pv as parseEditUserDelegateInstruction,Dv as parseMigrateCompressedSettingsInstruction,Uv as parseMigrateCompressedUsersInstruction,Xv as parseNativeTransferIntentCompressedInstruction,Gv as parseNativeTransferIntentInstruction,rB as parseSecp256r1VerifyInstruction,fb as parseTokenTransferIntentCompressedInstruction,ab as parseTokenTransferIntentInstruction,Ob as parseTransactionBufferCloseCompressedInstruction,hb as parseTransactionBufferCloseInstruction,Qb as parseTransactionBufferCreateCompressedInstruction,zb as parseTransactionBufferCreateInstruction,f_ as parseTransactionBufferExecuteCompressedInstruction,i_ as parseTransactionBufferExecuteInstruction,W_ as parseTransactionBufferExtendCompressedInstruction,E_ as parseTransactionBufferExtendInstruction,X_ as parseTransactionBufferVoteCompressedInstruction,G_ as parseTransactionBufferVoteInstruction,yU as parseTransactionExecuteCompressedInstruction,oU as parseTransactionExecuteInstruction,_U as parseTransactionExecuteSyncCompressedInstruction,CU as parseTransactionExecuteSyncInstruction,_O as pollJitoBundleConfirmation,p2 as prepareTransactionBundle,P2 as prepareTransactionMessage,U2 as prepareTransactionSync,UO as retrieveTransactionManager,AC as sendJitoBundle,vO as signAndSendBundledTransactions,bO as signAndSendTransaction,FN as signMessageWithPasskey,YN as signTransactionWithPasskey,Jk as tokenTransferIntent,LL as uninitialize,RE as userReadOnlyOrMutateArgs,Ui as vaultTransactionMessageDeserialize,_i as vaultTransactionMessageSerialize,r2 as verifyMessage,kd as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|