@revibase/core 0.0.19 → 0.0.20
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 +89 -92
- package/dist/index.d.ts +89 -92
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
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,getBase64Decoder,createSolanaClient,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,createNoopSigner,AccountRole,some,none,createDecoder,createEncoder,upgradeRoleToSigner,getTransactionEncoder,getBlockhashDecoder,compileTransaction,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import Ln 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 Gn=new Uint8Array([201,232,212,229,59,241,106,197]);function qC(){return fixEncoderSize(getBytesEncoder(),8).encode(Gn)}function ru(){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:Gn}))}function Fn(){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 YC(){return combineCodec(ru(),Fn())}function zn(e){return decodeAccount(e,Fn())}async function Kn(e,n,r){let s=await nu(e,n,r);return assertAccountExists(s),s}async function nu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return zn(s)}async function ZC(e,n,r){let s=await su(e,n,r);return assertAccountsExist(s),s}async function su(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>zn(t))}function XC(){return 846}var qn=new Uint8Array([42,206,176,58,175,129,130,233]);function eD(){return fixEncoderSize(getBytesEncoder(),8).encode(qn)}function fu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:qn}))}function Yn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function tD(){return combineCodec(fu(),Yn())}function Zn(e){return decodeAccount(e,Yn())}async function rD(e,n,r){let s=await Su(e,n,r);return assertAccountExists(s),s}async function Su(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Zn(s)}async function nD(e,n,r){let s=await xu(e,n,r);return assertAccountsExist(s),s}async function xu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Zn(t))}function sD(){return 24}function Tr(){return getStructEncoder([["memberKey",$()],["permissions",ve()],["verifyArgs",getOptionEncoder(B())],["userArgs",_e()]])}function lr(){return getStructDecoder([["memberKey",Q()],["permissions",be()],["verifyArgs",getOptionDecoder(w())],["userArgs",Ue()]])}function iD(){return combineCodec(Tr(),lr())}function fr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Sr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function AD(){return combineCodec(fr(),Sr())}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 mD(){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 SD(){return combineCodec(at(),it())}function Mr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function Er(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function CD(){return combineCodec(Mr(),Er())}function dt(){return getStructEncoder([["data",getOptionEncoder(ut())]])}function z(){return getStructDecoder([["data",getOptionDecoder(At())]])}function hD(){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 bD(){return combineCodec(ut(),At())}function pt(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Rr())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Tr())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(br())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function mt(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(vr())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(lr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(_r())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function LD(){return combineCodec(pt(),mt())}function OD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function BD(e,n){return n.__kind===e}function Ur(){return getStructEncoder([["member",getAddressEncoder()],["role",We()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",pe()]])}function Wr(){return getStructDecoder([["member",getAddressDecoder()],["role",Le()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",me()]])}function HD(){return combineCodec(Ur(),Wr())}function Rr(){return getStructEncoder([["memberKey",$()],["permissions",ve()]])}function vr(){return getStructDecoder([["memberKey",Q()],["permissions",be()]])}function zD(){return combineCodec(Rr(),vr())}function Tt(){return getStructEncoder([["memberKey",$()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function lt(){return getStructDecoder([["memberKey",Q()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function qD(){return combineCodec(Tt(),lt())}function Lr(){return getStructEncoder([["settingsMutArgs",de()],["transactionManager",getOptionEncoder(Se())]])}function Or(){return getStructDecoder([["settingsMutArgs",ue()],["transactionManager",getOptionDecoder(xe())]])}function $D(){return combineCodec(Lr(),Or())}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 rM(){return combineCodec(gt(),yt())}function $(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function Q(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function oM(){return combineCodec($(),Q())}function kr(){return getStructEncoder([["authorityCreationArgs",pe()],["compressedProofArgs",M()]])}function Nr(){return getStructDecoder([["authorityCreationArgs",me()],["compressedProofArgs",E()]])}function dM(){return combineCodec(kr(),Nr())}function ft(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function St(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function gM(){return combineCodec(ft(),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 mM(){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(Mr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function E(){return getStructDecoder([["proof",getOptionDecoder(Er())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function CM(){return combineCodec(M(),E())}function br(){return getStructEncoder([["memberKey",$()],["userArgs",_e()]])}function _r(){return getStructDecoder([["memberKey",Q()],["userArgs",Ue()]])}function hM(){return combineCodec(br(),_r())}function Hr(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function xt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function vM(){return combineCodec(Hr(),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 UM(){return combineCodec(B(),w())}function ee(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",B()]])}function te(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",w()]])}function BM(){return combineCodec(ee(),te())}function It(){return getStructEncoder([["addressTreeInfo",ft()],["outputStateTreeIndex",getU8Encoder()]])}function Ct(){return getStructDecoder([["addressTreeInfo",St()],["outputStateTreeIndex",getU8Decoder()]])}function HM(){return combineCodec(It(),Ct())}function Dt(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function Mt(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function FM(){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 XM(){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(lt()))]])}function tE(){return combineCodec(Et(),ht())}function Pt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(fr())],["addressTableLookups",getArrayEncoder(Vr())]])}function Rt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Sr())],["addressTableLookups",getArrayDecoder(Gr())]])}function oE(){return combineCodec(Pt(),Rt())}function Vr(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Gr(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function iE(){return combineCodec(Vr(),Gr())}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 gE(){return combineCodec(Oe(),J())}function pe(){return getStructEncoder([["addressTreeInfo",ft()],["outputStateTreeIndex",getU8Encoder()]])}function me(){return getStructDecoder([["addressTreeInfo",St()],["outputStateTreeIndex",getU8Decoder()]])}function TE(){return combineCodec(pe(),me())}function Se(){return getStructEncoder([["accountMeta",nt()],["data",Oe()]])}function xe(){return getStructDecoder([["accountMeta",st()],["data",J()]])}function xE(){return combineCodec(Se(),xe())}function Kr(){return getStructEncoder([["accountMeta",at()],["data",Oe()]])}function Jr(){return getStructDecoder([["accountMeta",it()],["data",J()]])}function ME(){return combineCodec(Kr(),Jr())}function _e(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Kr()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([Se()])]])]])}function Ue(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Jr()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([xe()])]])]])}function RE(){return combineCodec(_e(),Ue())}function vE(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function bE(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 WE(){return combineCodec(We(),Le())}var _s=new Uint8Array([223,179,163,190,177,224,67,173]);function xh(){return fixEncoderSize(getBytesEncoder(),8).encode(_s)}function Ry(){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:_s}))}function Us(){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 Ih(){return combineCodec(Ry(),Us())}function Ws(e){return decodeAccount(e,Us())}async function Ch(e,n,r){let s=await Yr(e,n,r);return assertAccountExists(s),s}async function Yr(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Ws(s)}async function Dh(e,n,r){let s=await vy(e,n,r);return assertAccountsExist(s),s}async function vy(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ws(t))}function Mh(){return 184}var ks=new Uint8Array([90,36,35,219,93,225,110,96]);function Rh(){return fixEncoderSize(getBytesEncoder(),8).encode(ks)}function Yy(){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:ks}))}function Ns(){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(lt()))],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function vh(){return combineCodec(Yy(),Ns())}function Hs(e){return decodeAccount(e,Ns())}async function Vs(e,n,r){let s=await Zy(e,n,r);return assertAccountExists(s),s}async function Zy(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Hs(s)}async function bh(e,n,r){let s=await Xy(e,n,r);return assertAccountsExist(s),s}async function Xy(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Hs(t))}var zs=new Uint8Array([105,23,173,2,197,255,80,87]);function Wh(){return fixEncoderSize(getBytesEncoder(),8).encode(zs)}function mp(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:zs}))}function Ks(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function Lh(){return combineCodec(mp(),Ks())}function Js(e){return decodeAccount(e,Ks())}async function js(e,n,r){let s=await Tp(e,n,r);return assertAccountExists(s),s}async function Tp(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Js(s)}async function Oh(e,n,r){let s=await lp(e,n,r);return assertAccountsExist(s),s}async function lp(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Js(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 Ys(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:qs(r.value)?upgradeRoleToSigner(s):s,...qs(r.value)?{signer:r.value}:{}})}}function qs(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Xs=new Uint8Array([8]);function $h(){return fixEncoderSize(getBytesEncoder(),1).encode(Xs)}function nn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Xs}))}function $s(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function Qh(){return combineCodec(nn(),$s())}async function Qs(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:nn().encode(c),programAddress:r})}function eP(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:nn().encode(c),programAddress:r})}function tP(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:$s().decode(e.data)}}var no=new Uint8Array([9]);function iP(){return fixEncoderSize(getBytesEncoder(),1).encode(no)}function sn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(pt())],["compressedProofArgs",getOptionEncoder(M())]]),e=>({...e,discriminator:no}))}function so(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(mt())],["compressedProofArgs",getOptionDecoder(E())]])}function dP(){return combineCodec(sn(),so())}async function oo(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(Ys(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:sn().encode(c),programAddress:r})}function uP(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:sn().encode(c),programAddress:r})}function AP(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:so().decode(e.data)}}var io=new Uint8Array([20]);function fP(){return fixEncoderSize(getBytesEncoder(),1).encode(io)}function uo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(pt())],["settingsMut",de()],["compressedProofArgs",M()]]),e=>({...e,discriminator:io}))}function Ao(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(mt())],["settingsMut",ue()],["compressedProofArgs",E()]])}function SP(){return combineCodec(uo(),Ao())}function go(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:uo().encode(c),programAddress:r})}function xP(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:Ao().decode(e.data)}}var mo=new Uint8Array([17]);function PP(){return fixEncoderSize(getBytesEncoder(),1).encode(mo)}function To(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",de()],["secp256r1VerifyArgs",getArrayEncoder(ee())]]),e=>({...e,discriminator:mo}))}function lo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["settingsMutArgs",ue()],["secp256r1VerifyArgs",getArrayDecoder(te())]])}function RP(){return combineCodec(To(),lo())}function fo(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:To().encode(c),programAddress:r})}function vP(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:lo().decode(e.data)}}var ho=new Uint8Array([0]);function BP(){return fixEncoderSize(getBytesEncoder(),1).encode(ho)}function cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",pe()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ho}))}function Po(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",me()],["compressedProofArgs",E()]])}function wP(){return combineCodec(cn(),Po())}async function Ro(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:cn().encode(c),programAddress:r})}function kP(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:cn().encode(c),programAddress:r})}function NP(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:Po().decode(e.data)}}var bo=new Uint8Array([4]);function JP(){return fixEncoderSize(getBytesEncoder(),1).encode(bo)}function dn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["member",Hr()],["role",We()],["userAccountCreationArgs",pe()],["linkWalletArgs",getOptionEncoder(Lr())]]),e=>({...e,discriminator:bo}))}function _o(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["member",xt()],["role",Le()],["userAccountCreationArgs",me()],["linkWalletArgs",getOptionDecoder(Or())]])}function jP(){return combineCodec(dn(),_o())}async function Uo(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:dn().encode(c),programAddress:r})}function qP(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:dn().encode(c),programAddress:r})}function YP(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:_o().decode(e.data)}}var Lo=new Uint8Array([3]);function tR(){return fixEncoderSize(getBytesEncoder(),1).encode(Lo)}function An(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Lo}))}function Oo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function rR(){return combineCodec(An(),Oo())}async function Bo(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:An().encode({}),programAddress:r})}function nR(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:An().encode({}),programAddress:r})}function sR(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:Oo().decode(e.data)}}var No=new Uint8Array([19]);function AR(){return fixEncoderSize(getBytesEncoder(),1).encode(No)}function gn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["compressedProofArgs",M()],["settingsCreation",It()],["userArgs",_e()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:No}))}function Ho(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["compressedProofArgs",E()],["settingsCreation",Ct()],["userArgs",Ue()],["settingsIndex",getU128Decoder()]])}function gR(){return combineCodec(gn(),Ho())}async function Vo(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:gn().encode(c),programAddress:r})}function yR(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:gn().encode(c),programAddress:r})}function pR(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:Ho().decode(e.data)}}var Fo=new Uint8Array([5]);function IR(){return fixEncoderSize(getBytesEncoder(),1).encode(Fo)}function pn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayEncoder(Ur())]]),e=>({...e,discriminator:Fo}))}function zo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["createUserArgs",getArrayDecoder(Wr())]])}function CR(){return combineCodec(pn(),zo())}async function Ko(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:pn().encode(c),programAddress:r})}function DR(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:pn().encode(c),programAddress:r})}function MR(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:zo().decode(e.data)}}var qo=new Uint8Array([18]);function _R(){return fixEncoderSize(getBytesEncoder(),1).encode(qo)}function Yo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMut",de()],["compressedProofArgs",M()],["secp256r1VerifyArgs",getArrayEncoder(ee())]]),e=>({...e,discriminator:qo}))}function Zo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMut",ue()],["compressedProofArgs",E()],["secp256r1VerifyArgs",getArrayDecoder(te())]])}function UR(){return combineCodec(Yo(),Zo())}function Xo(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:Yo().encode(c),programAddress:r})}function WR(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:Zo().decode(e.data)}}var ec=new Uint8Array([2]);function NR(){return fixEncoderSize(getBytesEncoder(),1).encode(ec)}function tc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:ec}))}function rc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function HR(){return combineCodec(tc(),rc())}function nc(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:tc().encode(c),programAddress:r})}function VR(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:rc().decode(e.data)}}var ac=new Uint8Array([1]);function qR(){return fixEncoderSize(getBytesEncoder(),1).encode(ac)}function Tn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(kr())]]),e=>({...e,discriminator:ac}))}function ic(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Nr())]])}function YR(){return combineCodec(Tn(),ic())}async function ZR(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:Tn().encode(c),programAddress:r})}function dc(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:Tn().encode(c),programAddress:r})}function XR(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:ic().decode(e.data)}}var gc=new Uint8Array([6]);function sv(){return fixEncoderSize(getBytesEncoder(),1).encode(gc)}function yc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Se()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",M()]]),e=>({...e,discriminator:gc}))}function pc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",xe()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",E()]])}function ov(){return combineCodec(yc(),pc())}function mc(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:yc().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:pc().decode(e.data)}}var fc=new Uint8Array([7]);function yv(){return fixEncoderSize(getBytesEncoder(),1).encode(fc)}function Sc(){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:fc}))}function xc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",xe()],["secp256r1VerifyArgs",getOptionDecoder(w())],["delegateTo",getOptionDecoder(Mt())],["oldSettingsMutArgs",getOptionDecoder(ue())],["newSettingsMutArgs",getOptionDecoder(ue())],["compressedProofArgs",E()]])}function pv(){return combineCodec(Sc(),xc())}function Ic(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:Sc().encode(c),programAddress:r})}function mv(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:xc().decode(e.data)}}var Mc=new Uint8Array([33]);function Cv(){return fixEncoderSize(getBytesEncoder(),1).encode(Mc)}function Ec(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",ut()],["compressedProofArgs",M()],["settingsCreationArgs",It()]]),e=>({...e,discriminator:Mc}))}function hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",At()],["compressedProofArgs",E()],["settingsCreationArgs",Ct()]])}function Dv(){return combineCodec(Ec(),hc())}function Pc(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:Ec().encode(c),programAddress:r})}function Mv(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:hc().decode(e.data)}}var bc=new Uint8Array([32]);function _v(){return fixEncoderSize(getBytesEncoder(),1).encode(bc)}function _c(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Oe()],["compressedProofArgs",M()],["userCreationArgs",pe()]]),e=>({...e,discriminator:bc}))}function Uc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",J()],["compressedProofArgs",E()],["userCreationArgs",me()]])}function Uv(){return combineCodec(_c(),Uc())}function Wc(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:_c().encode(c),programAddress:r})}function Wv(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:Uc().decode(e.data)}}var Oc=new Uint8Array([30]);function Hv(){return fixEncoderSize(getBytesEncoder(),1).encode(Oc)}function ln(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(ee())]]),e=>({...e,discriminator:Oc}))}function Bc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(te())]])}function Vv(){return combineCodec(ln(),Bc())}async function Gv(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:ln().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},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:ln().encode(c),programAddress:r})}function Fv(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:Bc().decode(e.data)}}var Hc=new Uint8Array([28]);function Zv(){return fixEncoderSize(getBytesEncoder(),1).encode(Hc)}function Vc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(ee())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Hc}))}function Gc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(te())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function Xv(){return combineCodec(Vc(),Gc())}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},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:Vc().encode(c),programAddress:r})}function $v(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:Gc().decode(e.data)}}var Kc=new Uint8Array([31]);function ob(){return fixEncoderSize(getBytesEncoder(),1).encode(Kc)}function Sn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(ee())]]),e=>({...e,discriminator:Kc}))}function Jc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(te())]])}function cb(){return combineCodec(Sn(),Jc())}async function ab(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:Sn().encode(c),programAddress:r})}function jc(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:Sn().encode(c),programAddress:r})}function ib(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:Jc().decode(e.data)}}var Xc=new Uint8Array([29]);function mb(){return fixEncoderSize(getBytesEncoder(),1).encode(Xc)}function xn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(ee())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Xc}))}function $c(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(te())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function Tb(){return combineCodec(xn(),$c())}async function lb(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:xn().encode(c),programAddress:r})}function Qc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},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:xn().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:$c().decode(e.data)}}var ra=new Uint8Array([13]);function Eb(){return fixEncoderSize(getBytesEncoder(),1).encode(ra)}function na(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:ra}))}function sa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function hb(){return combineCodec(na(),sa())}function oa(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:na().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:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:sa().decode(e.data)}}var ia=new Uint8Array([24]);function Lb(){return fixEncoderSize(getBytesEncoder(),1).encode(ia)}function da(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ia}))}function ua(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function Ob(){return combineCodec(da(),ua())}function Aa(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:da().encode(c),programAddress:r})}function Bb(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:ua().decode(e.data)}}var pa=new Uint8Array([10]);function Fb(){return fixEncoderSize(getBytesEncoder(),1).encode(pa)}function ma(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Et()],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:pa}))}function Ta(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",ht()],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function zb(){return combineCodec(ma(),Ta())}function la(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:ma().encode(c),programAddress:r})}function Kb(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:Ta().decode(e.data)}}var xa=new Uint8Array([21]);function $b(){return fixEncoderSize(getBytesEncoder(),1).encode(xa)}function Ia(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Et()],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:xa}))}function Ca(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",ht()],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function Qb(){return combineCodec(Ia(),Ca())}function Da(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:Ia().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(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Ca().decode(e.data)}}var ha=new Uint8Array([14]);function a_(){return fixEncoderSize(getBytesEncoder(),1).encode(ha)}function Pa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:ha}))}function Ra(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function i_(){return combineCodec(Pa(),Ra())}function va(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:Pa().encode(c),programAddress:r})}function d_(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:Ra().decode(e.data)}}var Ua=new Uint8Array([25]);function T_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ua)}function Wa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ua}))}function La(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function l_(){return combineCodec(Wa(),La())}function Oa(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:Wa().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:La().decode(e.data)}}var ka=new Uint8Array([12]);function M_(){return fixEncoderSize(getBytesEncoder(),1).encode(ka)}function Na(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:ka}))}function Ha(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function E_(){return combineCodec(Na(),Ha())}function Va(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:Na().encode(c),programAddress:r})}function h_(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:Ha().decode(e.data)}}var za=new Uint8Array([23]);function U_(){return fixEncoderSize(getBytesEncoder(),1).encode(za)}function Ka(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:za}))}function Ja(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function W_(){return combineCodec(Ka(),Ja())}function ja(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:Ka().encode(c),programAddress:r})}function L_(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:Ja().decode(e.data)}}var Za=new Uint8Array([11]);function V_(){return fixEncoderSize(getBytesEncoder(),1).encode(Za)}function Xa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:Za}))}function $a(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function G_(){return combineCodec(Xa(),$a())}function Qa(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:Xa().encode(c),programAddress:r})}function F_(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:$a().decode(e.data)}}var ri=new Uint8Array([22]);function Z_(){return fixEncoderSize(getBytesEncoder(),1).encode(ri)}function ni(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ri}))}function si(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function X_(){return combineCodec(ni(),si())}function oi(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:ni().encode(c),programAddress:r})}function $_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:si().decode(e.data)}}var ii=new Uint8Array([15]);function sU(){return fixEncoderSize(getBytesEncoder(),1).encode(ii)}function di(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:ii}))}function ui(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function oU(){return combineCodec(di(),ui())}function Ai(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:di().encode({}),programAddress:r})}function cU(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:ui().decode(e.data)}}var pi=new Uint8Array([26]);function gU(){return fixEncoderSize(getBytesEncoder(),1).encode(pi)}function mi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:pi}))}function Ti(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function yU(){return combineCodec(mi(),Ti())}function li(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:mi().encode(c),programAddress:r})}function pU(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:Ti().decode(e.data)}}var xi=new Uint8Array([16]);function IU(){return fixEncoderSize(getBytesEncoder(),1).encode(xi)}function Ii(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Pt()],["secp256r1VerifyArgs",getArrayEncoder(ee())]]),e=>({...e,discriminator:xi}))}function Ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Rt()],["secp256r1VerifyArgs",getArrayDecoder(te())]])}function CU(){return combineCodec(Ii(),Ci())}function Di(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:Ii().encode(c),programAddress:r})}function DU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Ci().decode(e.data)}}var hi=new Uint8Array([27]);function bU(){return fixEncoderSize(getBytesEncoder(),1).encode(hi)}function Pi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Pt()],["secp256r1VerifyArgs",getArrayEncoder(ee())],["settingsReadonlyArgs",ne()],["compressedProofArgs",M()]]),e=>({...e,discriminator:hi}))}function Ri(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Rt()],["secp256r1VerifyArgs",getArrayDecoder(te())],["settingsReadonlyArgs",se()],["compressedProofArgs",E()]])}function _U(){return combineCodec(Pi(),Ri())}function vi(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:Pi().encode(c),programAddress:r})}function UU(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:Ri().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",QS=(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))(QS||{});function lW(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 ex=(l=>(l[l.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",l[l.ChangeConfig=1]="ChangeConfig",l[l.ChangeConfigCompressed=2]="ChangeConfigCompressed",l[l.CompressSettingsAccount=3]="CompressSettingsAccount",l[l.CreateDomainConfig=4]="CreateDomainConfig",l[l.CreateDomainUserAccount=5]="CreateDomainUserAccount",l[l.CreateGlobalCounter=6]="CreateGlobalCounter",l[l.CreateMultiWalletCompressed=7]="CreateMultiWalletCompressed",l[l.CreateUserAccounts=8]="CreateUserAccounts",l[l.DecompressSettingsAccount=9]="DecompressSettingsAccount",l[l.DisableDomainConfig=10]="DisableDomainConfig",l[l.EditDomainConfig=11]="EditDomainConfig",l[l.EditTransactionManagerUrl=12]="EditTransactionManagerUrl",l[l.EditUserDelegate=13]="EditUserDelegate",l[l.MigrateCompressedSettings=14]="MigrateCompressedSettings",l[l.MigrateCompressedUsers=15]="MigrateCompressedUsers",l[l.NativeTransferIntent=16]="NativeTransferIntent",l[l.NativeTransferIntentCompressed=17]="NativeTransferIntentCompressed",l[l.TokenTransferIntent=18]="TokenTransferIntent",l[l.TokenTransferIntentCompressed=19]="TokenTransferIntentCompressed",l[l.TransactionBufferClose=20]="TransactionBufferClose",l[l.TransactionBufferCloseCompressed=21]="TransactionBufferCloseCompressed",l[l.TransactionBufferCreate=22]="TransactionBufferCreate",l[l.TransactionBufferCreateCompressed=23]="TransactionBufferCreateCompressed",l[l.TransactionBufferExecute=24]="TransactionBufferExecute",l[l.TransactionBufferExecuteCompressed=25]="TransactionBufferExecuteCompressed",l[l.TransactionBufferExtend=26]="TransactionBufferExtend",l[l.TransactionBufferExtendCompressed=27]="TransactionBufferExtendCompressed",l[l.TransactionBufferVote=28]="TransactionBufferVote",l[l.TransactionBufferVoteCompressed=29]="TransactionBufferVoteCompressed",l[l.TransactionExecute=30]="TransactionExecute",l[l.TransactionExecuteCompressed=31]="TransactionExecuteCompressed",l[l.TransactionExecuteSync=32]="TransactionExecuteSync",l[l.TransactionExecuteSyncCompressed=33]="TransactionExecuteSyncCompressed",l))(ex||{});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 rx=6e3,nx=6001,sx=6002,ox=6003,cx=6004,ax=6005,ix=6006,dx=6007,ux=6008,Ax=6009,gx=6010,yx=6011,px=6012,mx=6013,Tx=6014,lx=6015,fx=6016,Sx=6017,xx=6018,Ix=6019,Cx=6020,Dx=6021,Mx=6022,Ex=6023,hx=6024,Px=6025,Rx=6026,vx=6027,bx=6028,_x=6029,Ux=6030,Wx=6031,Lx=6032,Ox=6033,Bx=6034,wx=6035,kx=6036,Nx=6037,Hx=6038,Vx=6039,Gx=6040,Fx=6041,zx=6042,Kx=6043,Jx=6044,jx=6045,qx=6046,Yx=6047,Zx=6048,Xx=6049,$x=6050,Qx=6051,eI=6052,tI=6053,bi;process.env.NODE_ENV!=="production"&&(bi={[Ux]:"This member is already delegated to another wallet.",[dx]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[Xx]:"The domain configuration account is disabled. Please contact support or try again later.",[$x]:"Missing domain configuration account.",[gx]:"Duplicate public keys detected among members. Each member must have a unique key.",[Ax]:"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.",[xx]:"Expected a User with Administrator role for this instruction.",[ux]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[fx]:"Expected a User with Transaction Manager role for this instruction.",[Vx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[Gx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Fx]:"Declared buffer size does not match the actual serialized size.",[Ox]:"Not enough members with vote permission to meet the approval threshold.",[Wx]:"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.",[Px]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[tI]:"Address Tree supplied is not part of the whitelisted address trees",[Ix]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[vx]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Hx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[Bx]:"Only delegated members are allowed for this transaction.",[hx]:"Unexpected number of accounts provided for this instruction.",[mx]:"User with Permanent Member role requires a must have a delegated wallet.",[nx]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[cx]:"The extracted public key has an invalid length or encoding.",[rx]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[ox]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[Yx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[Mx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[Sx]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[lx]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[Ex]:"Malformed transaction message: structure or formatting does not match the expected layout.",[Rx]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[ax]:"The extracted WebAuthn signed message payload is malformed.",[jx]:"An input string exceeds the maximum allowed character length.",[Qx]:"This member is not registered under the provided domain configuration.",[bx]:"A required account is missing from the instruction context.",[qx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[_x]:"User mutation arguments are required when performing add or remove delegate operations.",[kx]:"No valid signer found in this transaction.",[px]:"Only one permanent member is allowed per wallet.",[Tx]:"Only one transaction manager is allowed per wallet.",[eI]:"The given origin index is not in the whitelisted origins.",[yx]:"Permanent members cannot be removed from a wallet.",[Jx]:"Writable CPI calls to protected accounts are not permitted.",[ix]:"The rpIdHash extracted from the signed message does not match the expected value.",[sx]:"The signature index provided is out of bounds for the secp256r1 instruction.",[Zx]:"The specified slot number was not found in the provided slot history.",[Dx]:"Too many members: a maximum of 4 members are supported.",[zx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[Kx]:"This transaction has not yet reached the required approval threshold.",[Nx]:"Only the transaction creator or rent payer may close this transaction buffer.",[wx]:"Member is not part of the expected signers for this transaction."});function MW(e){return process.env.NODE_ENV!=="production"?bi[e]:"Error message not available in production bundles."}function EW(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 Dn=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!==Dn)throw new Error(`Invalid public key length, expected ${Dn} 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===Dn)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 sI(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function oI(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var Ui=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(sI())],["addressTableLookups",getArrayCodec(oI())]]);function Wi(e){return Ui.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 Li(e){let n=Ui.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 Oi="revibase.com",Bi="https://auth.revibase.com",wi="https://api.revibase.com";var Ke=null,Ni=2e3,Hi=3e3,iI=300*1e3;async function nr({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"));},iI);function u(){clearInterval(o),clearTimeout(d),a&&clearTimeout(a),Ke&&window.removeEventListener("message",Ke),r&&r.close();}if(r?r.location.replace(e):r=zi(e),!r){c(new Error("Disable your popup blocker to continue."));return}let g=y=>{let T=y.origin===i,f=y.source===r;if(!(!T||!f||!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"));},Ni+Hi);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"));},Ni+Hi));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 sr(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 or(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function dI(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 Vi(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 Gi(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 Fi(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"+or(u)),D=(T>y?p256.Point.CURVE().n-T:T).toString(16).padStart(64,"0"),x=dI(D);return new Uint8Array([...g,...x])}function zi(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 TL(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+or(n.get(-2))),y:BigInt("0x"+or(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function Ji(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 lL(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=Vi(c),a=Fi(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:hn(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 Kn(oe(),e),t=Gi(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 hn(e,n,r){return sha256(new Uint8Array([...getBase58Encoder().encode(e),...getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function Je(e){return sha256(Pn(e))}function Pn(e){return new Uint8Array([...new Uint8Array(Ne(e.response.authenticatorData)),...sha256(new Uint8Array(Ne(e.response.clientDataJSON)))])}function ar(e,n,r,s){return getBase64Decoder().decode(sha256(new Uint8Array([...getUtf8Encoder().encode(JSON.stringify(e)),...getUtf8Encoder().encode(n),...getUtf8Encoder().encode(r),...s?getBase58Encoder().encode(s):[]])))}async function vn(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 Yi(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 Zi(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?Pn(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 qi(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(qi(s))||(r.push(s),n.add(qi(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 Xi({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 $i(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 Qi(){if(!_.sendAndConfirm)throw new Error("Rpc is not initialized yet.");return _.sendAndConfirm}function ed(){if(!_.computeEstimate)throw new Error("Rpc is not initialized yet");return _.computeEstimate}async function LL(){return _.feePayer||(_.feePayer=await $i(_.apiEndpoint??wi)),_.feePayer}function bn(){if(!_.jitoTipsConfig)throw new Error("Jito Bundle Config is not set.");return _.jitoTipsConfig}function he(){return _.authEndpoint??Bi}function td(){return _.rpId??Oi}function Ze(){if(!_.clientSettings)throw new Error("No client settings found.");return _.clientSettings}function OL(){Object.keys(_).forEach(e=>{_[e]=void 0;});}function BL({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 ir(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await sd(e);return s&&n?.set(e.toString(),s),s}}async function ce(e,n){let s=(await Promise.all(e.map(async t=>ir(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 le(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 fe(){return (await dr()).length-1}var _n;async function dr(){if(!_n){let{data:e}=await js(oe(),await od());_n=e.whitelistedAddressTrees;}return _n}async function ur(e,n,r){let s=await XI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function XI(e,n,r){let{address:s}=await N(e,n),t=await ir(s,r);return t?.data?.data?J().decode(t.data.data):null}async function Bt(e,n,r){let s=await $I(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function $I(e,n,r){try{let{address:s}=await j(e,n),t=await ir(s,r);if(!t?.data?.data)throw new Error("No compressed settings account found.");let c=z().decode(t.data.data);if(c.data.__option==="None")throw new Error("No compressed settings account found.");return {...c.data.value,isCompressed:!0}}catch{let s=await Yr(oe(),await Z(e));return s.exists?{...s.data,members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function Un(e){let n=await dr();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function iO(e){let r=(await dr()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function sd(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 Un(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 Un(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 pd(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function od(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function md(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 Td(e){let n=await Z(e);return await Ce(n)}async function lO(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function bO(e){let n=await vn(e,true),r=await Zi(n.map(getBase64EncodedWireTransaction),Ye()),s=await vn(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await pC(s.map(getBase64EncodedWireTransaction))}async function _O({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([ed()(c),Yi(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 Qi()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}async function pC(e,n=10,r=1e3,s=bn()){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 UO(e,n=30,r=3e3,s=bn()){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 WO(e,n,r,s){let t=await Bt(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=>Sd(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(Sd(d.pubkey)),userAddressTreeIndex:d.userAddressTreeIndex}}async function LO({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await ur(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return mC(n,c.transactionManagerUrl.value,e,s)}function mC(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 Sd(e){return e.keyType===Wt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}async function QO({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let i=await xC(r),a=new U,o=null,d=null,u=[];if(i.length||t){let h=await IC({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 CC({configActionsArgs:r,packedAccounts:a,userMutArgs:u,index:e}),{remainingAccounts:T,systemOffset:f}=a.toAccountMetas(),D=b(o,f);return {instructions:t?[go({configActions:g,payer:s,authority:createNoopSigner(await Td(e)),compressedProofArgs:D,settingsMut:d,remainingAccounts:T})]:[await oo({settingsIndex:e,configActions:g,payer:s,compressedProofArgs:D,remainingAccounts:T})],secp256r1VerifyInput:y}}async function xC(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 IC({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 CC({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 f=await N(o.member,o.userAddressTreeIndex).then(D=>s.find(x=>new Ln(new Uint8Array(x.accountMeta.address)).eq(D.address)));if(!f)throw new Error("Unable to find user account");a.push(xd({permissionArgs:o.permissions,index:d,userMutArgs:f,pubkey:o.member}));}else {let d=await N(o.member,o.userAddressTreeIndex).then(u=>s.find(g=>new Ln(new Uint8Array(g.accountMeta.address)).eq(u.address)));if(!d)throw new Error("Unable to find user account");a.push(xd({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 Ln(new Uint8Array(g.accountMeta.address)).eq(d.address));if(!u)throw new Error("Unable to find user account");return MC({pubkey:o.member,userMutArgs:u,index:e})})));c.push({__kind:i.type,fields:[a]});break}case "EditPermissions":{let a=i.members.map(o=>DC({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 DC({pubkey:e,permissionArgs:n}){return {memberKey:qe(e),permissions:Id(n)}}function MC({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 xd({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:Id(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 Id(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,kn=14,_C=2,UC=address("Secp256r1SigVerify1111111111111111111111111");function WC(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function LC(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function Ed(){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=LC();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=kn;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 hd(){return createEncoder({getSizeFromValue:e=>{let n=kn*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=WC();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 rB(){return combineCodec(hd(),Ed())}function F(e,n){let r=e.length,s=_C+r*kn,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??UC,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:hd().encode(i)}}function nB(e){return {programAddress:e.programAddress,accounts:{},data:Ed().decode(e.data)}}async function yB({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=[],f=[];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"&&f.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(fo({settings:i,settingsMutArgs:u,compressedProofArgs:h,payer:r,secp256r1VerifyArgs:f,remainingAccounts:D})),I}async function TB({admin:e,addressTree:n}){return Qs({payer:e,addressTree:n,remainingAccounts:[]})}async function DB({payer:e,rpId:n,origins:r,authority:s}){let t=await je({rpId:n}),c=new U;await c.addSystemAccounts();let i=await fe(),{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(),f=b(u,T);return await Ro({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:f,payer:e,domainConfig:t,rpId:n,remainingAccounts:y})}async function WB({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 fe(),{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,f=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&&(f=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 Uo({payer:n,authority:e,compressedProofArgs:L,member:xt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:T?some({settingsMutArgs:T,transactionManager:f?some(f):none()}):none(),userAccountCreationArgs:h[0],domainConfig:s,remainingAccounts:I})}async function wB({payer:e}){let n=await pd();return Bo({payer:e,globalCounter:n})}async function zB({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 fe(),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 Ko({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 qB({admin:e,rpId:n,disable:r}){let s=await je({rpId:n});return nc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function tw({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let i=new U;await i.addSystemAccounts();let a=await fe(),{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 dc({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function aw({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 mc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function lw({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 ur(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,f=null,D,x=null;g.delegatedTo.__option==="Some"&&((await Bt(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"}),f={start:y.length-1,end:y.length}):T=await Z(g.delegatedTo.value.index)),s&&((await Bt(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=f?some(Y(h,S.treeInfos.slice(f.start,f.end),S.leafIndices.slice(f.start,f.end),S.rootIndices.slice(f.start,f.end),S.proveByIndices.slice(f.start,f.end),I.slice(f.start,f.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(Ic({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 Mw({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 Pc({compressedProofArgs:y,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function _w({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 Wc({compressedProofArgs:y,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}async function Qw({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 f=await fe(),{address:D,addressTree:x}=await j(e,f);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 Vo({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 dk({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:f}=c.toAccountMetas(),D=b(a,f),x=[];g.length>0&&x.push(F(g));let h=await Z(e);return x.push(Xo({settings:h,payer:r,settingsMut:o,compressedProofArgs:D,secp256r1VerifyArgs:y,remainingAccounts:T})),x}function NC(e,n,r,s){let t=HC(e,n),c=VC(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function HC(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 VC(e,n){return n<e.header.numSignerAccounts}async function gr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Li(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:NC(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 Ud({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 gr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(F(c)),y.push(o?li({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):Ai({transactionBuffer:n,payer:s.address,settings:e})),a&&y.push(Xi({payer:s,tipAmount:a})),{instructions:y,addressLookupTableAccounts:g}}async function Wd({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:f,transactionMessage:D},{settingsReadonlyArgs:x,proof:h,packedAccounts:I}]=await Promise.all([gr({transactionMessageBytes:r,walletAddress:y,additionalSigners:u.filter(O=>!(O instanceof C)),addressesByLookupTableAddress:c}),le(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:wt}=G(O,re);wt&&De&&Re&&i.push({message:wt,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=FC(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(vi({secp256r1VerifyArgs:L,transactionMessage:V,settingsReadonlyArgs:x,compressedProofArgs:O,payer:t,remainingAccounts:W}));}else H.push(Di({secp256r1VerifyArgs:L,settings:g,transactionMessage:V,remainingAccounts:W}));return {instructions:H,addressLookupTableAccounts:f}}function FC(e,n){if(e.version==="legacy")throw new Error("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:new Uint8Array(r.data??[])})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(s=>s.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function wk({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 le(a,e,n,false,t),f=[],D=[];for(let S of o)if(S instanceof C){let L=f.length,{domainConfig:W,verifyArgs:q,signature:H,publicKey:V,message:O}=G(S,L);O&&H&&V&&f.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(f.length>0&&I.push(F(f)),a){if(!i||!g)throw new Error("Payer not found or proof args is missing.");let S=b(y,h);I.push(Fc({amount:c,settingsReadonlyArgs:g,compressedProofArgs:S,payer:i,secp256r1VerifyArgs:D,source:u,destination:r,remainingAccounts:x}));}else I.push(wc({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),[f,D]=await Promise.all([getAssociatedTokenAccountAddress(s,T,o),getAssociatedTokenAccountAddress(s,r,o)]),{settingsReadonlyArgs:x,proof:h,packedAccounts:I}=await le(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(Qc({amount:i,createAtaIfNeeded:d,settingsReadonlyArgs:x,compressedProofArgs:V,payer:a,secp256r1VerifyArgs:L,source:T,sourceTokenAccount:f,destination:r,destinationTokenAccount:D,mint:s,tokenProgram:o,remainingAccounts:W}));}else H.push(jc({amount:i,createAtaIfNeeded:d,secp256r1VerifyArgs:L,source:T,sourceTokenAccount:f,destination:r,destinationTokenAccount:D,settings:y,mint:s,tokenProgram:o,remainingAccounts:W}));return H}async function sN({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:i}){let a=await Vs(oe(),s),o=a.data.multiWalletSettings,{settingsReadonlyArgs:d,proof:u,packedAccounts:g}=await le(c,e,n,false,i),{remainingAccounts:y,systemOffset:T}=g.toAccountMetas(),{domainConfig:f,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(Aa({transactionBuffer:s,domainConfig:f,closer:r instanceof C?void 0:r,rentCollector:a.data.payer,secp256r1VerifyArgs:D,settingsReadonlyArgs:d,payer:t,compressedProofArgs:L,remainingAccounts:y}));}else S.push(oa({transactionBuffer:s,domainConfig:f,closer:r instanceof C?void 0:r,settings:o,payer:a.data.payer,secp256r1VerifyArgs:D,remainingAccounts:[]}));return S}function wd({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:f,publicKey:D}=G(n),x=[];if(T&&f&&D&&x.push(F([{message:T,signature:f,publicKey:D}])),d){let{settingsReadonlyArgs:h,compressedProofArgs:I,remainingAccounts:S}=d;x.push(Da({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(la({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 kd({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(Oa({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(va({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,remainingAccounts:[]})),d}function Nd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?ja({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Va({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Hd({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(oi({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(Qa({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}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let{clientId:s,signClientMessage:t}=Ze(),c={type:"message",payload:e},i=window.origin,a=ar(c,s,i,n?.toString()),{signature:o,expiry:d}=await t("start",a),u=`${he()}/?redirectUrl=${encodeURIComponent(i)}&clientId=${encodeURIComponent(s)}&signature=${encodeURIComponent(o)}&expiry=${encodeURIComponent(d)}&messageHash=${encodeURIComponent(a)}`,g=await nr({authUrl:u,data:c,signer:n,popUp:r});return {...g,signer:new Ae(g.signer)}}async function qN({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let{clientId:c,signClientMessage:i}=Ze(),a=window.origin,o={type:"transaction",payload:JSON.stringify({transactionActionType:e,transactionAddress:n,transactionMessageBytes:sr(r)})},d=ar(o,c,a,s?.toString()),{signature:u,expiry:g}=await i("start",d),y=`${he()}/?redirectUrl=${encodeURIComponent(a)}&clientId=${encodeURIComponent(c)}&signature=${encodeURIComponent(u)}&expiry=${encodeURIComponent(g)}&messageHash=${encodeURIComponent(d)}`,T=await nr({authUrl:y,data:o,signer:s,popUp:t});return {...T,signer:new Ae(T.signer)}}async function t2({message:e,response:n,expectedRPID:r=td(),expectedOrigin:s=he()}){let t=new Uint8Array([...new TextEncoder().encode(e),...hn(n.clientId,n.deviceSignature.publicKey,n.nonce)]),{verified:c}=await verifyAuthenticationResponse({response:n.authResponse,expectedChallenge:sr(t),expectedOrigin:s,expectedRPID:r,requireUserVerification:false,credential:{id:n.authResponse.id,publicKey:Ji(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 y2({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 f=await Z(n),D=Math.floor(Math.random()*255),x=await md(f,t instanceof C?t:t.address,D),h=[],I=[];for(let X=0;X<s.length;X+=y){let Vn=s.subarray(X,X+y);h.push(Vn),I.push(sha256(Vn));}let S=sha256(new Uint8Array(s)),{settingsReadonlyArgs:L,proof:W,packedAccounts:q}=await le(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=wd({finalBufferHash:S,finalBufferSize:s.length,bufferIndex:D,payer:e,transactionBufferAddress:x,settings:f,creator:t,preauthorizeExecution:!c,bufferExtendHashes:I,compressedArgs:O,expectedSecp256r1Signers:re}),Pe=h.map(X=>Nd({transactionMessageBytes:X,transactionBufferAddress:x,settings:f,compressed:d})),De=u.map(X=>Hd({voter:X,transactionBufferAddress:x,settings:f,compressedArgs:O})),Re=kd({compressedArgs:O,settings:f,executor:c,transactionBufferAddress:x}),{instructions:wt,addressLookupTableAccounts:zd}=await Ud({compressed:d,settings:f,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o}),et=X=>({payer:e,instructions:X,addressesByLookupTableAddress:zd});return [et(Te),...Pe.map(X=>et([X])),...De.length?[et(De.flat())]:[],et(Re),et(wt)]}var pr=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 mr=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 Fd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=pr.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:f,drainedKeys:D}=T;c.push({readonlyIndexes:f.readonlyIndexes,readableIndices:f.readonlyIndexes,writableIndexes:f.writableIndexes,writableIndices:f.writableIndexes,lookupTableAddress:address(f.lookupTableAddress)}),i.writable.push(...D.writable),i.readonly.push(...D.readonly);}}let[o,d]=t.getMessageComponents(),g=new mr(d,i).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function h2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Fd({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return Wi(s)}async function _2({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 Wd({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{Xs as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,io as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,no as CHANGE_CONFIG_DISCRIMINATOR,mo as COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,ho as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,bo as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Lo as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,No as CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR,Fo as CREATE_USER_ACCOUNTS_DISCRIMINATOR,qo as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,ec as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Gn as DOMAIN_CONFIG_DISCRIMINATOR,ac as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,gc as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,fc as EDIT_USER_DELEGATE_DISCRIMINATOR,qn as GLOBAL_COUNTER_DISCRIMINATOR,Wt as KeyType,Mc as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,bc as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,Ux as MULTI_WALLET_ERROR__ALREADY_DELEGATED,dx as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,Xx as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,$x as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,gx as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,Ax as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,Cx as MULTI_WALLET_ERROR__EMPTY_MEMBERS,xx as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,ux as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,fx as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,Vx as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,Gx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,Fx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,Ox as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,Wx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,Lx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,Px as MULTI_WALLET_ERROR__INVALID_ACCOUNT,tI as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,Ix as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,vx as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,Hx as MULTI_WALLET_ERROR__INVALID_BUFFER,Bx as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,hx as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,mx as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,nx as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,cx as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,rx as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,ox as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,Yx as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,Mx as MULTI_WALLET_ERROR__INVALID_THRESHOLD,Sx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,lx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,Ex as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,Rx as MULTI_WALLET_ERROR__INVALID_USER_ROLE,ax as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,jx as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,Qx as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,bx as MULTI_WALLET_ERROR__MISSING_ACCOUNT,qx as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,_x as MULTI_WALLET_ERROR__MISSING_USER_ARGS,kx as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,px as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,Tx as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,eI as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,yx as MULTI_WALLET_ERROR__PERMANENT_MEMBER,Jx as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,ix as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,sx as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,Zx as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,Dx as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,zx as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,Kx as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,Nx as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,wx as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,QS as MultiWalletAccount,ex as MultiWalletInstruction,Hc as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Oc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Ie as Permission,Me as Permissions,_s as SETTINGS_DISCRIMINATOR,Ae as Secp256r1Key,C as SignedSecp256r1Key,Xc as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Kc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,ia as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,ra as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,xa as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,pa as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,ks as TRANSACTION_BUFFER_DISCRIMINATOR,Ua as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,ha as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,za as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,ka as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,ri as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Za as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,pi as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,ii as TRANSACTION_EXECUTE_DISCRIMINATOR,hi as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,xi as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Be as UserRole,zs as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,TB as addWhitelistedAddressTrees,QO as changeConfig,sN as closeTransactionBuffer,yB as compressSettingsAccount,OD as configAction,Sd as convertMemberKeyToString,Ji as convertPubkeyCompressedToCose,TL as convertPubkeyCoseToCompressed,DB as createDomainConfig,WB as createDomainUserAccounts,wB as createGlobalCounter,zi as createPopUp,wd as createTransactionBuffer,mC as createTransactionManagerSigner,zB as createUserAccounts,Qw as createWallet,zn as decodeDomainConfig,Zn as decodeGlobalCounter,Ws as decodeSettings,Hs as decodeTransactionBuffer,Js as decodeWhitelistedAddressTree,dk as decompressSettingsAccount,qB as disableDomainConfig,tw as editDomainConfig,aw as editTransactionManagerUrl,lw as editUserDelegate,Ud as executeTransaction,kd as executeTransactionBuffer,Wd as executeTransactionSync,Nd as extendTransactionBuffer,ZC as fetchAllDomainConfig,nD as fetchAllGlobalCounter,su as fetchAllMaybeDomainConfig,xu as fetchAllMaybeGlobalCounter,vy as fetchAllMaybeSettings,Xy as fetchAllMaybeTransactionBuffer,lp as fetchAllMaybeWhitelistedAddressTree,Dh as fetchAllSettings,bh as fetchAllTransactionBuffer,Oh as fetchAllWhitelistedAddressTree,sd as fetchCompressedAccount,Kn as fetchDomainConfig,rD as fetchGlobalCounter,nu as fetchMaybeDomainConfig,Su as fetchMaybeGlobalCounter,Yr as fetchMaybeSettings,$I as fetchMaybeSettingsAccountData,Zy as fetchMaybeTransactionBuffer,XI as fetchMaybeUserAccountData,Tp as fetchMaybeWhitelistedAddressTree,Ch as fetchSettings,Bt as fetchSettingsAccountData,Vs as fetchTransactionBuffer,ur as fetchUserAccountData,js as fetchWhitelistedAddressTree,iD as getAddMemberArgsCodec,lr as getAddMemberArgsDecoder,Tr as getAddMemberArgsEncoder,$h as getAddWhitelistedAddressTreesDiscriminatorBytes,eP as getAddWhitelistedAddressTreesInstruction,Qs as getAddWhitelistedAddressTreesInstructionAsync,Qh as getAddWhitelistedAddressTreesInstructionDataCodec,$s as getAddWhitelistedAddressTreesInstructionDataDecoder,nn as getAddWhitelistedAddressTreesInstructionDataEncoder,he as getAuthEndpoint,fP as getChangeConfigCompressedDiscriminatorBytes,go as getChangeConfigCompressedInstruction,SP as getChangeConfigCompressedInstructionDataCodec,Ao as getChangeConfigCompressedInstructionDataDecoder,uo as getChangeConfigCompressedInstructionDataEncoder,iP as getChangeConfigDiscriminatorBytes,uP as getChangeConfigInstruction,oo as getChangeConfigInstructionAsync,dP as getChangeConfigInstructionDataCodec,so as getChangeConfigInstructionDataDecoder,sn as getChangeConfigInstructionDataEncoder,hn as getClientAndDeviceHash,ar as getClientMessageHash,Ze as getClientSettings,AD as getCompiledInstructionCodec,Sr as getCompiledInstructionDecoder,fr as getCompiledInstructionEncoder,PP as getCompressSettingsAccountDiscriminatorBytes,fo as getCompressSettingsAccountInstruction,RP as getCompressSettingsAccountInstructionDataCodec,lo as getCompressSettingsAccountInstructionDataDecoder,To as getCompressSettingsAccountInstructionDataEncoder,mD as getCompressedAccountMetaCodec,st as getCompressedAccountMetaDecoder,nt as getCompressedAccountMetaEncoder,SD as getCompressedAccountMetaReadOnlyCodec,it as getCompressedAccountMetaReadOnlyDecoder,at as getCompressedAccountMetaReadOnlyEncoder,CD as getCompressedProofCodec,Er as getCompressedProofDecoder,Mr as getCompressedProofEncoder,j as getCompressedSettingsAddressFromIndex,hD as getCompressedSettingsCodec,bD as getCompressedSettingsDataCodec,At as getCompressedSettingsDataDecoder,ut as getCompressedSettingsDataEncoder,z as getCompressedSettingsDecoder,dt as getCompressedSettingsEncoder,ed as getComputeBudgetEstimate,LD as getConfigActionCodec,mt as getConfigActionDecoder,pt as getConfigActionEncoder,BP as getCreateDomainConfigDiscriminatorBytes,kP as getCreateDomainConfigInstruction,Ro as getCreateDomainConfigInstructionAsync,wP as getCreateDomainConfigInstructionDataCodec,Po as getCreateDomainConfigInstructionDataDecoder,cn as getCreateDomainConfigInstructionDataEncoder,JP as getCreateDomainUserAccountDiscriminatorBytes,qP as getCreateDomainUserAccountInstruction,Uo as getCreateDomainUserAccountInstructionAsync,jP as getCreateDomainUserAccountInstructionDataCodec,_o as getCreateDomainUserAccountInstructionDataDecoder,dn as getCreateDomainUserAccountInstructionDataEncoder,tR as getCreateGlobalCounterDiscriminatorBytes,nR as getCreateGlobalCounterInstruction,Bo as getCreateGlobalCounterInstructionAsync,rR as getCreateGlobalCounterInstructionDataCodec,Oo as getCreateGlobalCounterInstructionDataDecoder,An as getCreateGlobalCounterInstructionDataEncoder,AR as getCreateMultiWalletCompressedDiscriminatorBytes,yR as getCreateMultiWalletCompressedInstruction,Vo as getCreateMultiWalletCompressedInstructionAsync,gR as getCreateMultiWalletCompressedInstructionDataCodec,Ho as getCreateMultiWalletCompressedInstructionDataDecoder,gn as getCreateMultiWalletCompressedInstructionDataEncoder,HD as getCreateUserAccountArgsCodec,Wr as getCreateUserAccountArgsDecoder,Ur as getCreateUserAccountArgsEncoder,IR as getCreateUserAccountsDiscriminatorBytes,DR as getCreateUserAccountsInstruction,Ko as getCreateUserAccountsInstructionAsync,CR as getCreateUserAccountsInstructionDataCodec,zo as getCreateUserAccountsInstructionDataDecoder,pn as getCreateUserAccountsInstructionDataEncoder,_R as getDecompressSettingsAccountDiscriminatorBytes,Xo as getDecompressSettingsAccountInstruction,UR as getDecompressSettingsAccountInstructionDataCodec,Zo as getDecompressSettingsAccountInstructionDataDecoder,Yo as getDecompressSettingsAccountInstructionDataEncoder,NR as getDisableDomainConfigDiscriminatorBytes,nc as getDisableDomainConfigInstruction,HR as getDisableDomainConfigInstructionDataCodec,rc as getDisableDomainConfigInstructionDataDecoder,tc as getDisableDomainConfigInstructionDataEncoder,je as getDomainConfigAddress,YC as getDomainConfigCodec,Fn as getDomainConfigDecoder,qC as getDomainConfigDiscriminatorBytes,ru as getDomainConfigEncoder,XC as getDomainConfigSize,qR as getEditDomainConfigDiscriminatorBytes,dc as getEditDomainConfigInstruction,ZR as getEditDomainConfigInstructionAsync,YR as getEditDomainConfigInstructionDataCodec,ic as getEditDomainConfigInstructionDataDecoder,Tn as getEditDomainConfigInstructionDataEncoder,zD as getEditMemberArgsCodec,vr as getEditMemberArgsDecoder,Rr as getEditMemberArgsEncoder,sv as getEditTransactionManagerUrlDiscriminatorBytes,mc as getEditTransactionManagerUrlInstruction,ov as getEditTransactionManagerUrlInstructionDataCodec,pc as getEditTransactionManagerUrlInstructionDataDecoder,yc as getEditTransactionManagerUrlInstructionDataEncoder,yv as getEditUserDelegateDiscriminatorBytes,Ic as getEditUserDelegateInstruction,pv as getEditUserDelegateInstructionDataCodec,xc as getEditUserDelegateInstructionDataDecoder,Sc as getEditUserDelegateInstructionDataEncoder,qD as getExpectedSecp256r1SignersCodec,lt as getExpectedSecp256r1SignersDecoder,Tt as getExpectedSecp256r1SignersEncoder,LL as getFeePayer,pd as getGlobalCounterAddress,tD as getGlobalCounterCodec,Yn as getGlobalCounterDecoder,eD as getGlobalCounterDiscriminatorBytes,fu as getGlobalCounterEncoder,sD as getGlobalCounterSize,bn as getJitoTipsConfig,lO as getLightCpiSigner,He as getLightProtocolRpc,$D as getLinkWalletArgsCodec,Or as getLinkWalletArgsDecoder,Lr as getLinkWalletArgsEncoder,rM as getMemberCodec,yt as getMemberDecoder,gt as getMemberEncoder,oM as getMemberKeyCodec,Q as getMemberKeyDecoder,$ as getMemberKeyEncoder,Cv as getMigrateCompressedSettingsDiscriminatorBytes,Pc as getMigrateCompressedSettingsInstruction,Dv as getMigrateCompressedSettingsInstructionDataCodec,hc as getMigrateCompressedSettingsInstructionDataDecoder,Ec as getMigrateCompressedSettingsInstructionDataEncoder,_v as getMigrateCompressedUsersDiscriminatorBytes,Wc as getMigrateCompressedUsersInstruction,Uv as getMigrateCompressedUsersInstructionDataCodec,Uc as getMigrateCompressedUsersInstructionDataDecoder,_c as getMigrateCompressedUsersInstructionDataEncoder,MW as getMultiWalletErrorMessage,Zv as getNativeTransferIntentCompressedDiscriminatorBytes,Fc as getNativeTransferIntentCompressedInstruction,Xv as getNativeTransferIntentCompressedInstructionDataCodec,Gc as getNativeTransferIntentCompressedInstructionDataDecoder,Vc as getNativeTransferIntentCompressedInstructionDataEncoder,Hv as getNativeTransferIntentDiscriminatorBytes,wc as getNativeTransferIntentInstruction,Gv as getNativeTransferIntentInstructionAsync,Vv as getNativeTransferIntentInstructionDataCodec,Bc as getNativeTransferIntentInstructionDataDecoder,ln as getNativeTransferIntentInstructionDataEncoder,dM as getNewAuthorityArgsCodec,Nr as getNewAuthorityArgsDecoder,kr as getNewAuthorityArgsEncoder,fL as getOriginIndex,gM as getPackedAddressTreeInfoCodec,St as getPackedAddressTreeInfoDecoder,ft as getPackedAddressTreeInfoEncoder,mM as getPackedStateTreeInfoCodec,ct as getPackedStateTreeInfoDecoder,ot as getPackedStateTreeInfoEncoder,fM as getPermissionsCodec,be as getPermissionsDecoder,ve as getPermissionsEncoder,CM as getProofArgsCodec,E as getProofArgsDecoder,M as getProofArgsEncoder,hM as getRemoveMemberArgsCodec,_r as getRemoveMemberArgsDecoder,br as getRemoveMemberArgsEncoder,td as getRpId,Pn as getSecp256r1Message,Je as getSecp256r1MessageHash,vM as getSecp256r1PubkeyCodec,xt as getSecp256r1PubkeyDecoder,Hr as getSecp256r1PubkeyEncoder,LC as getSecp256r1SignatureOffsetsDataDecoder,WC as getSecp256r1SignatureOffsetsDataEncoder,UM as getSecp256r1VerifyArgsCodec,w as getSecp256r1VerifyArgsDecoder,B as getSecp256r1VerifyArgsEncoder,BM as getSecp256r1VerifyArgsWithDomainAddressCodec,te as getSecp256r1VerifyArgsWithDomainAddressDecoder,ee as getSecp256r1VerifyArgsWithDomainAddressEncoder,F as getSecp256r1VerifyInstruction,rB as getSecp256r1VerifyInstructionDataCodec,Ed as getSecp256r1VerifyInstructionDataDecoder,hd as getSecp256r1VerifyInstructionDataEncoder,Qi as getSendAndConfirmTransaction,Ih as getSettingsCodec,HM as getSettingsCreationArgsCodec,Ct as getSettingsCreationArgsDecoder,It as getSettingsCreationArgsEncoder,Us as getSettingsDecoder,xh as getSettingsDiscriminatorBytes,Ry as getSettingsEncoder,Z as getSettingsFromIndex,FM as getSettingsIndexWithAddressCodec,Mt as getSettingsIndexWithAddressDecoder,Dt as getSettingsIndexWithAddressEncoder,jM as getSettingsMutArgsCodec,ue as getSettingsMutArgsDecoder,de as getSettingsMutArgsEncoder,XM as getSettingsReadonlyArgsCodec,se as getSettingsReadonlyArgsDecoder,ne as getSettingsReadonlyArgsEncoder,Mh as getSettingsSize,lL as getSignedSecp256r1Key,LO as getSignedTransactionManager,oe as getSolanaRpc,Ye as getSolanaRpcEndpoint,mb as getTokenTransferIntentCompressedDiscriminatorBytes,Qc as getTokenTransferIntentCompressedInstruction,lb as getTokenTransferIntentCompressedInstructionAsync,Tb as getTokenTransferIntentCompressedInstructionDataCodec,$c as getTokenTransferIntentCompressedInstructionDataDecoder,xn as getTokenTransferIntentCompressedInstructionDataEncoder,ob as getTokenTransferIntentDiscriminatorBytes,jc as getTokenTransferIntentInstruction,ab as getTokenTransferIntentInstructionAsync,cb as getTokenTransferIntentInstructionDataCodec,Jc as getTokenTransferIntentInstructionDataDecoder,Sn as getTokenTransferIntentInstructionDataEncoder,md as getTransactionBufferAddress,Lb as getTransactionBufferCloseCompressedDiscriminatorBytes,Aa as getTransactionBufferCloseCompressedInstruction,Ob as getTransactionBufferCloseCompressedInstructionDataCodec,ua as getTransactionBufferCloseCompressedInstructionDataDecoder,da as getTransactionBufferCloseCompressedInstructionDataEncoder,Eb as getTransactionBufferCloseDiscriminatorBytes,oa as getTransactionBufferCloseInstruction,hb as getTransactionBufferCloseInstructionDataCodec,sa as getTransactionBufferCloseInstructionDataDecoder,na as getTransactionBufferCloseInstructionDataEncoder,vh as getTransactionBufferCodec,tE as getTransactionBufferCreateArgsCodec,ht as getTransactionBufferCreateArgsDecoder,Et as getTransactionBufferCreateArgsEncoder,$b as getTransactionBufferCreateCompressedDiscriminatorBytes,Da as getTransactionBufferCreateCompressedInstruction,Qb as getTransactionBufferCreateCompressedInstructionDataCodec,Ca as getTransactionBufferCreateCompressedInstructionDataDecoder,Ia as getTransactionBufferCreateCompressedInstructionDataEncoder,Fb as getTransactionBufferCreateDiscriminatorBytes,la as getTransactionBufferCreateInstruction,zb as getTransactionBufferCreateInstructionDataCodec,Ta as getTransactionBufferCreateInstructionDataDecoder,ma as getTransactionBufferCreateInstructionDataEncoder,Ns as getTransactionBufferDecoder,Rh as getTransactionBufferDiscriminatorBytes,Yy as getTransactionBufferEncoder,T_ as getTransactionBufferExecuteCompressedDiscriminatorBytes,Oa as getTransactionBufferExecuteCompressedInstruction,l_ as getTransactionBufferExecuteCompressedInstructionDataCodec,La as getTransactionBufferExecuteCompressedInstructionDataDecoder,Wa as getTransactionBufferExecuteCompressedInstructionDataEncoder,a_ as getTransactionBufferExecuteDiscriminatorBytes,va as getTransactionBufferExecuteInstruction,i_ as getTransactionBufferExecuteInstructionDataCodec,Ra as getTransactionBufferExecuteInstructionDataDecoder,Pa as getTransactionBufferExecuteInstructionDataEncoder,U_ as getTransactionBufferExtendCompressedDiscriminatorBytes,ja as getTransactionBufferExtendCompressedInstruction,W_ as getTransactionBufferExtendCompressedInstructionDataCodec,Ja as getTransactionBufferExtendCompressedInstructionDataDecoder,Ka as getTransactionBufferExtendCompressedInstructionDataEncoder,M_ as getTransactionBufferExtendDiscriminatorBytes,Va as getTransactionBufferExtendInstruction,E_ as getTransactionBufferExtendInstructionDataCodec,Ha as getTransactionBufferExtendInstructionDataDecoder,Na as getTransactionBufferExtendInstructionDataEncoder,Z_ as getTransactionBufferVoteCompressedDiscriminatorBytes,oi as getTransactionBufferVoteCompressedInstruction,X_ as getTransactionBufferVoteCompressedInstructionDataCodec,si as getTransactionBufferVoteCompressedInstructionDataDecoder,ni as getTransactionBufferVoteCompressedInstructionDataEncoder,V_ as getTransactionBufferVoteDiscriminatorBytes,Qa as getTransactionBufferVoteInstruction,G_ as getTransactionBufferVoteInstructionDataCodec,$a as getTransactionBufferVoteInstructionDataDecoder,Xa as getTransactionBufferVoteInstructionDataEncoder,gU as getTransactionExecuteCompressedDiscriminatorBytes,li as getTransactionExecuteCompressedInstruction,yU as getTransactionExecuteCompressedInstructionDataCodec,Ti as getTransactionExecuteCompressedInstructionDataDecoder,mi as getTransactionExecuteCompressedInstructionDataEncoder,sU as getTransactionExecuteDiscriminatorBytes,Ai as getTransactionExecuteInstruction,oU as getTransactionExecuteInstructionDataCodec,ui as getTransactionExecuteInstructionDataDecoder,di as getTransactionExecuteInstructionDataEncoder,bU as getTransactionExecuteSyncCompressedDiscriminatorBytes,vi as getTransactionExecuteSyncCompressedInstruction,_U as getTransactionExecuteSyncCompressedInstructionDataCodec,Ri as getTransactionExecuteSyncCompressedInstructionDataDecoder,Pi as getTransactionExecuteSyncCompressedInstructionDataEncoder,IU as getTransactionExecuteSyncDiscriminatorBytes,Di as getTransactionExecuteSyncInstruction,CU as getTransactionExecuteSyncInstructionDataCodec,Ci as getTransactionExecuteSyncInstructionDataDecoder,Ii as getTransactionExecuteSyncInstructionDataEncoder,iE as getTransactionMessageAddressTableLookupCodec,Gr as getTransactionMessageAddressTableLookupDecoder,Vr as getTransactionMessageAddressTableLookupEncoder,oE as getTransactionMessageCodec,Rt as getTransactionMessageDecoder,Pt as getTransactionMessageEncoder,N as getUserAccountAddress,gE as getUserCodec,TE as getUserCreationArgsCodec,me as getUserCreationArgsDecoder,pe as getUserCreationArgsEncoder,J as getUserDecoder,Oe as getUserEncoder,xE as getUserMutArgsCodec,xe as getUserMutArgsDecoder,Se as getUserMutArgsEncoder,ME as getUserReadOnlyArgsCodec,Jr as getUserReadOnlyArgsDecoder,Kr as getUserReadOnlyArgsEncoder,RE as getUserReadOnlyOrMutateArgsCodec,Ue as getUserReadOnlyOrMutateArgsDecoder,_e as getUserReadOnlyOrMutateArgsEncoder,WE as getUserRoleCodec,Le as getUserRoleDecoder,We as getUserRoleEncoder,Td as getWalletAddressFromIndex,Ce as getWalletAddressFromSettings,Lh as getWhitelistedAddressTreeCodec,Ks as getWhitelistedAddressTreeDecoder,Wh as getWhitelistedAddressTreeDiscriminatorBytes,mp as getWhitelistedAddressTreeEncoder,Un as getWhitelistedAddressTreeFromIndex,iO as getWhitelistedAddressTreeIndexFromAddress,od as getWhitelistedAddressTreesAddress,lW as identifyMultiWalletAccount,fW as identifyMultiWalletInstruction,BL as initialize,BD as isConfigAction,EW as isMultiWalletError,bE as isUserReadOnlyOrMutateArgs,Mw as migrateSettings,_w as migrateUsers,wk as nativeTransferIntent,tP as parseAddWhitelistedAddressTreesInstruction,xP as parseChangeConfigCompressedInstruction,AP as parseChangeConfigInstruction,vP as parseCompressSettingsAccountInstruction,NP as parseCreateDomainConfigInstruction,YP as parseCreateDomainUserAccountInstruction,sR as parseCreateGlobalCounterInstruction,pR as parseCreateMultiWalletCompressedInstruction,MR as parseCreateUserAccountsInstruction,WR as parseDecompressSettingsAccountInstruction,VR as parseDisableDomainConfigInstruction,XR as parseEditDomainConfigInstruction,cv as parseEditTransactionManagerUrlInstruction,mv as parseEditUserDelegateInstruction,Mv as parseMigrateCompressedSettingsInstruction,Wv as parseMigrateCompressedUsersInstruction,$v as parseNativeTransferIntentCompressedInstruction,Fv as parseNativeTransferIntentInstruction,nB as parseSecp256r1VerifyInstruction,fb as parseTokenTransferIntentCompressedInstruction,ib as parseTokenTransferIntentInstruction,Bb as parseTransactionBufferCloseCompressedInstruction,Pb as parseTransactionBufferCloseInstruction,e_ as parseTransactionBufferCreateCompressedInstruction,Kb as parseTransactionBufferCreateInstruction,f_ as parseTransactionBufferExecuteCompressedInstruction,d_ as parseTransactionBufferExecuteInstruction,L_ as parseTransactionBufferExtendCompressedInstruction,h_ as parseTransactionBufferExtendInstruction,$_ as parseTransactionBufferVoteCompressedInstruction,F_ as parseTransactionBufferVoteInstruction,pU as parseTransactionExecuteCompressedInstruction,cU as parseTransactionExecuteInstruction,UU as parseTransactionExecuteSyncCompressedInstruction,DU as parseTransactionExecuteSyncInstruction,UO as pollJitoBundleConfirmation,y2 as prepareTransactionBundle,h2 as prepareTransactionMessage,_2 as prepareTransactionSync,WO as retrieveTransactionManager,pC as sendJitoBundle,bO as signAndSendBundledTransactions,_O as signAndSendTransaction,FN as signMessageWithPasskey,qN as signTransactionWithPasskey,jk as tokenTransferIntent,OL as uninitialize,vE as userReadOnlyOrMutateArgs,Li as vaultTransactionMessageDeserialize,Wi as vaultTransactionMessageSerialize,t2 as verifyMessage,Hd 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 vn from'bn.js';import {VERSION,featureFlags,createRpc,rpcRequest,versionedEndpoint,encodeBN254toBase58,jsonRpcResultAndContext,CompressedAccountResultV2,CompressedAccountResult,localTestActiveStateTreeInfos,getStateTreeInfoByPubkey,createCompressedAccountWithMerkleContextLegacy,createMerkleContextLegacy,bn,parseAccountData,deriveAddressSeedV2,createBN254,deriveAddressV2,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {SolanaJSONRPCError,PublicKey}from'@solana/web3.js';import {create,nullable}from'superstruct';import {estimateComputeUnitLimitFactory,getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTransferSolInstruction}from'gill/programs';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {p256}from'@noble/curves/nist.js';var wn=new Uint8Array([201,232,212,229,59,241,106,197]);function VC(){return fixEncoderSize(getBytesEncoder(),8).encode(wn)}function Yd(){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:wn}))}function kn(){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 GC(){return combineCodec(Yd(),kn())}function Nn(e){return decodeAccount(e,kn())}async function Hn(e,n,r){let s=await Zd(e,n,r);return assertAccountExists(s),s}async function Zd(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Nn(s)}async function FC(e,n,r){let s=await Xd(e,n,r);return assertAccountsExist(s),s}async function Xd(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Nn(t))}function zC(){return 846}var Fn=new Uint8Array([42,206,176,58,175,129,130,233]);function jC(){return fixEncoderSize(getBytesEncoder(),8).encode(Fn)}function Au(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Fn}))}function zn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function qC(){return combineCodec(Au(),zn())}function Kn(e){return decodeAccount(e,zn())}async function YC(e,n,r){let s=await gu(e,n,r);return assertAccountExists(s),s}async function gu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Kn(s)}async function ZC(e,n,r){let s=await yu(e,n,r);return assertAccountsExist(s),s}async function yu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Kn(t))}function XC(){return 24}function Ar(){return getStructEncoder([["memberKey",$()],["permissions",Re()],["verifyArgs",getOptionEncoder(B())],["userArgs",be()]])}function gr(){return getStructDecoder([["memberKey",Q()],["permissions",ve()],["verifyArgs",getOptionDecoder(w())],["userArgs",_e()]])}function tD(){return combineCodec(Ar(),gr())}function yr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function mr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function sD(){return combineCodec(yr(),mr())}function rt(){return getStructEncoder([["treeInfo",st()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function nt(){return getStructDecoder([["treeInfo",ot()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function iD(){return combineCodec(rt(),nt())}function ct(){return getStructEncoder([["treeInfo",st()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function at(){return getStructDecoder([["treeInfo",ot()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function gD(){return combineCodec(ct(),at())}function Sr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function xr(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function pD(){return combineCodec(Sr(),xr())}function it(){return getStructEncoder([["data",getOptionEncoder(dt())]])}function z(){return getStructDecoder([["data",getOptionDecoder(ut())]])}function SD(){return combineCodec(it(),z())}function dt(){return getStructEncoder([["threshold",getU8Encoder()],["bump",getU8Encoder()],["index",getU128Encoder()],["multiWalletBump",getU8Encoder()],["members",getArrayEncoder(At())],["settingsAddressTreeIndex",getU8Encoder()]])}function ut(){return getStructDecoder([["threshold",getU8Decoder()],["bump",getU8Decoder()],["index",getU128Decoder()],["multiWalletBump",getU8Decoder()],["members",getArrayDecoder(gt())],["settingsAddressTreeIndex",getU8Decoder()]])}function DD(){return combineCodec(dt(),ut())}function yt(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Dr())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Ar())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Er())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function mt(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Mr())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(gr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(hr())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function PD(){return combineCodec(yt(),mt())}function RD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function vD(e,n){return n.__kind===e}function Pr(){return getStructEncoder([["member",getAddressEncoder()],["role",Ue()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",ye()]])}function Rr(){return getStructDecoder([["member",getAddressDecoder()],["role",We()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",me()]])}function WD(){return combineCodec(Pr(),Rr())}function Dr(){return getStructEncoder([["memberKey",$()],["permissions",Re()]])}function Mr(){return getStructDecoder([["memberKey",Q()],["permissions",ve()]])}function wD(){return combineCodec(Dr(),Mr())}function pt(){return getStructEncoder([["memberKey",$()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function Tt(){return getStructDecoder([["memberKey",Q()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function VD(){return combineCodec(pt(),Tt())}function vr(){return getStructEncoder([["settingsMutArgs",de()],["transactionManager",getOptionEncoder(fe())]])}function br(){return getStructDecoder([["settingsMutArgs",ue()],["transactionManager",getOptionDecoder(Se())]])}function KD(){return combineCodec(vr(),br())}function At(){return getStructEncoder([["pubkey",$()],["permissions",Re()],["role",getU8Encoder()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function gt(){return getStructDecoder([["pubkey",Q()],["permissions",ve()],["role",getU8Decoder()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function YD(){return combineCodec(At(),gt())}function $(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function Q(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function $D(){return combineCodec($(),Q())}function Wr(){return getStructEncoder([["authorityCreationArgs",ye()],["compressedProofArgs",D()]])}function Lr(){return getStructDecoder([["authorityCreationArgs",me()],["compressedProofArgs",M()]])}function rM(){return combineCodec(Wr(),Lr())}function lt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function ft(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function oM(){return combineCodec(lt(),ft())}function st(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function ot(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function iM(){return combineCodec(st(),ot())}function Re(){return getStructEncoder([["mask",getU8Encoder()]])}function ve(){return getStructDecoder([["mask",getU8Decoder()]])}function AM(){return combineCodec(Re(),ve())}function D(){return getStructEncoder([["proof",getOptionEncoder(Sr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function M(){return getStructDecoder([["proof",getOptionDecoder(xr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function pM(){return combineCodec(D(),M())}function Er(){return getStructEncoder([["memberKey",$()],["userArgs",be()]])}function hr(){return getStructDecoder([["memberKey",Q()],["userArgs",_e()]])}function SM(){return combineCodec(Er(),hr())}function Or(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function St(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function CM(){return combineCodec(Or(),St())}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 EM(){return combineCodec(B(),w())}function ee(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",B()]])}function te(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",w()]])}function vM(){return combineCodec(ee(),te())}function xt(){return getStructEncoder([["addressTreeInfo",lt()],["outputStateTreeIndex",getU8Encoder()]])}function It(){return getStructDecoder([["addressTreeInfo",ft()],["outputStateTreeIndex",getU8Decoder()]])}function WM(){return combineCodec(xt(),It())}function Ct(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function Dt(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function BM(){return combineCodec(Ct(),Dt())}function de(){return getStructEncoder([["accountMeta",rt()],["data",it()]])}function ue(){return getStructDecoder([["accountMeta",nt()],["data",z()]])}function HM(){return combineCodec(de(),ue())}function ne(){return getStructEncoder([["accountMeta",ct()],["data",it()]])}function se(){return getStructDecoder([["accountMeta",at()],["data",z()]])}function zM(){return combineCodec(ne(),se())}function Mt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getOptionEncoder(getArrayEncoder(pt()))]])}function Et(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(Tt()))]])}function qM(){return combineCodec(Mt(),Et())}function ht(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(yr())],["addressTableLookups",getArrayEncoder(Br())]])}function Pt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(mr())],["addressTableLookups",getArrayDecoder(wr())]])}function $M(){return combineCodec(ht(),Pt())}function Br(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function wr(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function tE(){return combineCodec(Br(),wr())}function Le(){return getStructEncoder([["member",$()],["domainConfig",getOptionEncoder(getAddressEncoder())],["role",Ue()],["delegatedTo",getOptionEncoder(Ct())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function J(){return getStructDecoder([["member",Q()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",We()],["delegatedTo",getOptionDecoder(Dt())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function oE(){return combineCodec(Le(),J())}function ye(){return getStructEncoder([["addressTreeInfo",lt()],["outputStateTreeIndex",getU8Encoder()]])}function me(){return getStructDecoder([["addressTreeInfo",ft()],["outputStateTreeIndex",getU8Decoder()]])}function dE(){return combineCodec(ye(),me())}function fe(){return getStructEncoder([["accountMeta",rt()],["data",Le()]])}function Se(){return getStructDecoder([["accountMeta",nt()],["data",J()]])}function yE(){return combineCodec(fe(),Se())}function Hr(){return getStructEncoder([["accountMeta",ct()],["data",Le()]])}function Vr(){return getStructDecoder([["accountMeta",at()],["data",J()]])}function lE(){return combineCodec(Hr(),Vr())}function be(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Hr()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([fe()])]])]])}function _e(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Vr()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([Se()])]])]])}function IE(){return combineCodec(be(),_e())}function CE(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function DE(e,n){return n.__kind===e}var Oe=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(Oe||{});function Ue(){return getEnumEncoder(Oe)}function We(){return getEnumDecoder(Oe)}function hE(){return combineCodec(Ue(),We())}var hs=new Uint8Array([223,179,163,190,177,224,67,173]);function yh(){return fixEncoderSize(getBytesEncoder(),8).encode(hs)}function Iy(){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:hs}))}function Ps(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(gt(),{size:4})],["membersLen",getU8Decoder()],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["padding",fixDecoderSize(getBytesDecoder(),3)]])}function mh(){return combineCodec(Iy(),Ps())}function Rs(e){return decodeAccount(e,Ps())}async function ph(e,n,r){let s=await zr(e,n,r);return assertAccountExists(s),s}async function zr(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Rs(s)}async function Th(e,n,r){let s=await Cy(e,n,r);return assertAccountsExist(s),s}async function Cy(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Rs(t))}function lh(){return 184}var Ws=new Uint8Array([90,36,35,219,93,225,110,96]);function Ih(){return fixEncoderSize(getBytesEncoder(),8).encode(Ws)}function Gy(){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(pt()))],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Ws}))}function Ls(){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(Tt()))],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Ch(){return combineCodec(Gy(),Ls())}function Os(e){return decodeAccount(e,Ls())}async function Bs(e,n,r){let s=await Fy(e,n,r);return assertAccountExists(s),s}async function Fy(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Os(s)}async function Dh(e,n,r){let s=await zy(e,n,r);return assertAccountsExist(s),s}async function zy(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Os(t))}var Ns=new Uint8Array([105,23,173,2,197,255,80,87]);function hh(){return fixEncoderSize(getBytesEncoder(),8).encode(Ns)}function im(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Ns}))}function Hs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function Ph(){return combineCodec(im(),Hs())}function Vs(e){return decodeAccount(e,Hs())}async function Gs(e,n,r){let s=await dm(e,n,r);return assertAccountExists(s),s}async function dm(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Vs(s)}async function Rh(e,n,r){let s=await um(e,n,r);return assertAccountsExist(s),s}async function um(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Vs(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 zs(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:Fs(r.value)?upgradeRoleToSigner(s):s,...Fs(r.value)?{signer:r.value}:{}})}}function Fs(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Js=new Uint8Array([8]);function Kh(){return fixEncoderSize(getBytesEncoder(),1).encode(Js)}function $r(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Js}))}function js(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function Jh(){return combineCodec($r(),js())}async function qs(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:$r().encode(c),programAddress:r})}function jh(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:$r().encode(c),programAddress:r})}function qh(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:js().decode(e.data)}}var $s=new Uint8Array([9]);function tP(){return fixEncoderSize(getBytesEncoder(),1).encode($s)}function Qr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(yt())],["compressedProofArgs",getOptionEncoder(D())]]),e=>({...e,discriminator:$s}))}function Qs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(mt())],["compressedProofArgs",getOptionDecoder(M())]])}function rP(){return combineCodec(Qr(),Qs())}async function eo(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(zs(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:Qr().encode(c),programAddress:r})}function nP(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:Qr().encode(c),programAddress:r})}function sP(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 no=new Uint8Array([20]);function AP(){return fixEncoderSize(getBytesEncoder(),1).encode(no)}function so(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(yt())],["settingsMut",de()],["compressedProofArgs",D()]]),e=>({...e,discriminator:no}))}function oo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(mt())],["settingsMut",ue()],["compressedProofArgs",M()]])}function gP(){return combineCodec(so(),oo())}function co(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:so().encode(c),programAddress:r})}function yP(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:oo().decode(e.data)}}var uo=new Uint8Array([17]);function xP(){return fixEncoderSize(getBytesEncoder(),1).encode(uo)}function Ao(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["settingsMutArgs",de()],["secp256r1VerifyArgs",getArrayEncoder(ee())]]),e=>({...e,discriminator:uo}))}function go(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",ue()],["secp256r1VerifyArgs",getArrayDecoder(te())]])}function IP(){return combineCodec(Ao(),go())}function yo(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:Ao().encode(c),programAddress:r})}function CP(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:go().decode(e.data)}}var Io=new Uint8Array([0]);function vP(){return fixEncoderSize(getBytesEncoder(),1).encode(Io)}function tn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",ye()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Io}))}function Co(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",me()],["compressedProofArgs",M()]])}function bP(){return combineCodec(tn(),Co())}async function Do(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:tn().encode(c),programAddress:r})}function _P(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:tn().encode(c),programAddress:r})}function UP(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Co().decode(e.data)}}var Eo=new Uint8Array([4]);function NP(){return fixEncoderSize(getBytesEncoder(),1).encode(Eo)}function nn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["member",Or()],["role",Ue()],["userAccountCreationArgs",ye()],["linkWalletArgs",getOptionEncoder(vr())]]),e=>({...e,discriminator:Eo}))}function ho(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["member",St()],["role",We()],["userAccountCreationArgs",me()],["linkWalletArgs",getOptionDecoder(br())]])}function HP(){return combineCodec(nn(),ho())}async function Po(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:nn().encode(c),programAddress:r})}function VP(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:nn().encode(c),programAddress:r})}function GP(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:ho().decode(e.data)}}var vo=new Uint8Array([3]);function qP(){return fixEncoderSize(getBytesEncoder(),1).encode(vo)}function on(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:vo}))}function bo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function YP(){return combineCodec(on(),bo())}async function _o(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:on().encode({}),programAddress:r})}function ZP(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:on().encode({}),programAddress:r})}function XP(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:bo().decode(e.data)}}var Lo=new Uint8Array([19]);function sR(){return fixEncoderSize(getBytesEncoder(),1).encode(Lo)}function cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["compressedProofArgs",D()],["settingsCreation",xt()],["userArgs",be()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Lo}))}function Oo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["compressedProofArgs",M()],["settingsCreation",It()],["userArgs",_e()],["settingsIndex",getU128Decoder()]])}function oR(){return combineCodec(cn(),Oo())}async function Bo(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:cn().encode(c),programAddress:r})}function cR(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:cn().encode(c),programAddress:r})}function aR(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:Oo().decode(e.data)}}var ko=new Uint8Array([5]);function mR(){return fixEncoderSize(getBytesEncoder(),1).encode(ko)}function dn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",D()],["createUserArgs",getArrayEncoder(Pr())]]),e=>({...e,discriminator:ko}))}function No(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayDecoder(Rr())]])}function pR(){return combineCodec(dn(),No())}async function Ho(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:dn().encode(c),programAddress:r})}function TR(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:dn().encode(c),programAddress:r})}function lR(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:No().decode(e.data)}}var Fo=new Uint8Array([18]);function MR(){return fixEncoderSize(getBytesEncoder(),1).encode(Fo)}function zo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMut",de()],["compressedProofArgs",D()],["secp256r1VerifyArgs",getArrayEncoder(ee())]]),e=>({...e,discriminator:Fo}))}function Ko(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMut",ue()],["compressedProofArgs",M()],["secp256r1VerifyArgs",getArrayDecoder(te())]])}function ER(){return combineCodec(zo(),Ko())}function Jo(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:zo().encode(c),programAddress:r})}function hR(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:Ko().decode(e.data)}}var Yo=new Uint8Array([2]);function UR(){return fixEncoderSize(getBytesEncoder(),1).encode(Yo)}function Zo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:Yo}))}function Xo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function WR(){return combineCodec(Zo(),Xo())}function $o(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:Zo().encode(c),programAddress:r})}function LR(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:Xo().decode(e.data)}}var rc=new Uint8Array([1]);function VR(){return fixEncoderSize(getBytesEncoder(),1).encode(rc)}function An(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Wr())]]),e=>({...e,discriminator:rc}))}function nc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Lr())]])}function GR(){return combineCodec(An(),nc())}async function FR(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:An().encode(c),programAddress:r})}function sc(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:An().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:nc().decode(e.data)}}var ac=new Uint8Array([6]);function XR(){return fixEncoderSize(getBytesEncoder(),1).encode(ac)}function ic(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",fe()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",D()]]),e=>({...e,discriminator:ac}))}function dc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Se()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",M()]])}function $R(){return combineCodec(ic(),dc())}function uc(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:ic().encode(c),programAddress:r})}function QR(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:dc().decode(e.data)}}var yc=new Uint8Array([7]);function cv(){return fixEncoderSize(getBytesEncoder(),1).encode(yc)}function mc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",fe()],["secp256r1VerifyArgs",getOptionEncoder(B())],["delegateTo",getOptionEncoder(Ct())],["oldSettingsMutArgs",getOptionEncoder(de())],["newSettingsMutArgs",getOptionEncoder(de())],["compressedProofArgs",D()]]),e=>({...e,discriminator:yc}))}function pc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Se()],["secp256r1VerifyArgs",getOptionDecoder(w())],["delegateTo",getOptionDecoder(Dt())],["oldSettingsMutArgs",getOptionDecoder(ue())],["newSettingsMutArgs",getOptionDecoder(ue())],["compressedProofArgs",M()]])}function av(){return combineCodec(mc(),pc())}function Tc(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:mc().encode(c),programAddress:r})}function iv(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:pc().decode(e.data)}}var Sc=new Uint8Array([33]);function pv(){return fixEncoderSize(getBytesEncoder(),1).encode(Sc)}function xc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",dt()],["compressedProofArgs",D()],["settingsCreationArgs",xt()]]),e=>({...e,discriminator:Sc}))}function Ic(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",ut()],["compressedProofArgs",M()],["settingsCreationArgs",It()]])}function Tv(){return combineCodec(xc(),Ic())}function Cc(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:xc().encode(c),programAddress:r})}function lv(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Ic().decode(e.data)}}var Ec=new Uint8Array([32]);function Mv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ec)}function hc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Le()],["compressedProofArgs",D()],["userCreationArgs",ye()]]),e=>({...e,discriminator:Ec}))}function Pc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",J()],["compressedProofArgs",M()],["userCreationArgs",me()]])}function Ev(){return combineCodec(hc(),Pc())}function Rc(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:hc().encode(c),programAddress:r})}function hv(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:Pc().decode(e.data)}}var bc=new Uint8Array([30]);function Wv(){return fixEncoderSize(getBytesEncoder(),1).encode(bc)}function gn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(ee())]]),e=>({...e,discriminator:bc}))}function _c(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(te())]])}function Lv(){return combineCodec(gn(),_c())}async function Ov(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:gn().encode(c),programAddress:r})}function Uc(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:gn().encode(c),programAddress:r})}function Bv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:_c().decode(e.data)}}var Oc=new Uint8Array([28]);function Fv(){return fixEncoderSize(getBytesEncoder(),1).encode(Oc)}function Bc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(ee())],["settingsReadonlyArgs",ne()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Oc}))}function wc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(te())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]])}function zv(){return combineCodec(Bc(),wc())}function kc(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:Bc().encode(c),programAddress:r})}function Kv(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:wc().decode(e.data)}}var Hc=new Uint8Array([31]);function $v(){return fixEncoderSize(getBytesEncoder(),1).encode(Hc)}function mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(ee())]]),e=>({...e,discriminator:Hc}))}function Vc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(te())]])}function Qv(){return combineCodec(mn(),Vc())}async function eb(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:mn().encode(c),programAddress:r})}function Gc(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:mn().encode(c),programAddress:r})}function tb(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:Vc().decode(e.data)}}var Jc=new Uint8Array([29]);function ib(){return fixEncoderSize(getBytesEncoder(),1).encode(Jc)}function pn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(ee())],["settingsReadonlyArgs",ne()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Jc}))}function jc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(te())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]])}function db(){return combineCodec(pn(),jc())}async function ub(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:pn().encode(c),programAddress:r})}function qc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},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:pn().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:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:jc().decode(e.data)}}var Xc=new Uint8Array([13]);function fb(){return fixEncoderSize(getBytesEncoder(),1).encode(Xc)}function $c(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:Xc}))}function Qc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Sb(){return combineCodec($c(),Qc())}function ea(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:$c().encode(c),programAddress:r})}function xb(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 na=new Uint8Array([24]);function Pb(){return fixEncoderSize(getBytesEncoder(),1).encode(na)}function sa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",D()]]),e=>({...e,discriminator:na}))}function oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]])}function Rb(){return combineCodec(sa(),oa())}function ca(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:sa().encode(c),programAddress:r})}function vb(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:oa().decode(e.data)}}var da=new Uint8Array([10]);function Bb(){return fixEncoderSize(getBytesEncoder(),1).encode(da)}function ua(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Mt()],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:da}))}function Aa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Et()],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function wb(){return combineCodec(ua(),Aa())}function ga(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:ua().encode(c),programAddress:r})}function kb(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:Aa().decode(e.data)}}var pa=new Uint8Array([21]);function Kb(){return fixEncoderSize(getBytesEncoder(),1).encode(pa)}function Ta(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Mt()],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",D()]]),e=>({...e,discriminator:pa}))}function la(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Et()],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]])}function Jb(){return combineCodec(Ta(),la())}function fa(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:Ta().encode(c),programAddress:r})}function jb(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:la().decode(e.data)}}var Ia=new Uint8Array([14]);function e_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ia)}function Ca(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:Ia}))}function Da(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function t_(){return combineCodec(Ca(),Da())}function Ma(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:Ca().encode(c),programAddress:r})}function r_(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:Da().decode(e.data)}}var Pa=new Uint8Array([25]);function d_(){return fixEncoderSize(getBytesEncoder(),1).encode(Pa)}function Ra(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Pa}))}function va(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]])}function u_(){return combineCodec(Ra(),va())}function ba(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:Ra().encode(c),programAddress:r})}function A_(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:va().decode(e.data)}}var Wa=new Uint8Array([12]);function l_(){return fixEncoderSize(getBytesEncoder(),1).encode(Wa)}function La(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Wa}))}function Oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function f_(){return combineCodec(La(),Oa())}function Ba(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:La().encode(c),programAddress:r})}function S_(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:Oa().decode(e.data)}}var Na=new Uint8Array([23]);function E_(){return fixEncoderSize(getBytesEncoder(),1).encode(Na)}function Ha(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Na}))}function Va(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function h_(){return combineCodec(Ha(),Va())}function Ga(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:Ha().encode(c),programAddress:r})}function P_(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:Va().decode(e.data)}}var Ka=new Uint8Array([11]);function L_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ka)}function Ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:Ka}))}function ja(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function O_(){return combineCodec(Ja(),ja())}function qa(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:Ja().encode(c),programAddress:r})}function B_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ja().decode(e.data)}}var Xa=new Uint8Array([22]);function F_(){return fixEncoderSize(getBytesEncoder(),1).encode(Xa)}function $a(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ne()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Xa}))}function Qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]])}function z_(){return combineCodec($a(),Qa())}function ei(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:$a().encode(c),programAddress:r})}function K_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===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 ni=new Uint8Array([15]);function X_(){return fixEncoderSize(getBytesEncoder(),1).encode(ni)}function si(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:ni}))}function oi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function $_(){return combineCodec(si(),oi())}function ci(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:si().encode({}),programAddress:r})}function Q_(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:oi().decode(e.data)}}var di=new Uint8Array([26]);function oU(){return fixEncoderSize(getBytesEncoder(),1).encode(di)}function ui(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:di}))}function Ai(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function cU(){return combineCodec(ui(),Ai())}function gi(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:ui().encode(c),programAddress:r})}function aU(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:Ai().decode(e.data)}}var pi=new Uint8Array([16]);function mU(){return fixEncoderSize(getBytesEncoder(),1).encode(pi)}function Ti(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",ht()],["secp256r1VerifyArgs",getArrayEncoder(ee())]]),e=>({...e,discriminator:pi}))}function li(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Pt()],["secp256r1VerifyArgs",getArrayDecoder(te())]])}function pU(){return combineCodec(Ti(),li())}function fi(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:Ti().encode(c),programAddress:r})}function TU(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:li().decode(e.data)}}var Ii=new Uint8Array([27]);function DU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ii)}function Ci(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",ht()],["secp256r1VerifyArgs",getArrayEncoder(ee())],["settingsReadonlyArgs",ne()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Ii}))}function Di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Pt()],["secp256r1VerifyArgs",getArrayDecoder(te())],["settingsReadonlyArgs",se()],["compressedProofArgs",M()]])}function MU(){return combineCodec(Ci(),Di())}function Mi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},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:Ci().encode(c),programAddress:r})}function EU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Di().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",JS=(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))(JS||{});function uW(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 jS=(l=>(l[l.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",l[l.ChangeConfig=1]="ChangeConfig",l[l.ChangeConfigCompressed=2]="ChangeConfigCompressed",l[l.CompressSettingsAccount=3]="CompressSettingsAccount",l[l.CreateDomainConfig=4]="CreateDomainConfig",l[l.CreateDomainUserAccount=5]="CreateDomainUserAccount",l[l.CreateGlobalCounter=6]="CreateGlobalCounter",l[l.CreateMultiWalletCompressed=7]="CreateMultiWalletCompressed",l[l.CreateUserAccounts=8]="CreateUserAccounts",l[l.DecompressSettingsAccount=9]="DecompressSettingsAccount",l[l.DisableDomainConfig=10]="DisableDomainConfig",l[l.EditDomainConfig=11]="EditDomainConfig",l[l.EditTransactionManagerUrl=12]="EditTransactionManagerUrl",l[l.EditUserDelegate=13]="EditUserDelegate",l[l.MigrateCompressedSettings=14]="MigrateCompressedSettings",l[l.MigrateCompressedUsers=15]="MigrateCompressedUsers",l[l.NativeTransferIntent=16]="NativeTransferIntent",l[l.NativeTransferIntentCompressed=17]="NativeTransferIntentCompressed",l[l.TokenTransferIntent=18]="TokenTransferIntent",l[l.TokenTransferIntentCompressed=19]="TokenTransferIntentCompressed",l[l.TransactionBufferClose=20]="TransactionBufferClose",l[l.TransactionBufferCloseCompressed=21]="TransactionBufferCloseCompressed",l[l.TransactionBufferCreate=22]="TransactionBufferCreate",l[l.TransactionBufferCreateCompressed=23]="TransactionBufferCreateCompressed",l[l.TransactionBufferExecute=24]="TransactionBufferExecute",l[l.TransactionBufferExecuteCompressed=25]="TransactionBufferExecuteCompressed",l[l.TransactionBufferExtend=26]="TransactionBufferExtend",l[l.TransactionBufferExtendCompressed=27]="TransactionBufferExtendCompressed",l[l.TransactionBufferVote=28]="TransactionBufferVote",l[l.TransactionBufferVoteCompressed=29]="TransactionBufferVoteCompressed",l[l.TransactionExecute=30]="TransactionExecute",l[l.TransactionExecuteCompressed=31]="TransactionExecuteCompressed",l[l.TransactionExecuteSync=32]="TransactionExecuteSync",l[l.TransactionExecuteSyncCompressed=33]="TransactionExecuteSyncCompressed",l))(jS||{});function AW(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 YS=6e3,ZS=6001,XS=6002,$S=6003,QS=6004,ex=6005,tx=6006,rx=6007,nx=6008,sx=6009,ox=6010,cx=6011,ax=6012,ix=6013,dx=6014,ux=6015,Ax=6016,gx=6017,yx=6018,mx=6019,px=6020,Tx=6021,lx=6022,fx=6023,Sx=6024,xx=6025,Ix=6026,Cx=6027,Dx=6028,Mx=6029,Ex=6030,hx=6031,Px=6032,Rx=6033,vx=6034,bx=6035,_x=6036,Ux=6037,Wx=6038,Lx=6039,Ox=6040,Bx=6041,wx=6042,kx=6043,Nx=6044,Hx=6045,Vx=6046,Gx=6047,Fx=6048,zx=6049,Kx=6050,Jx=6051,jx=6052,qx=6053,Ei;process.env.NODE_ENV!=="production"&&(Ei={[Ex]:"This member is already delegated to another wallet.",[rx]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[zx]:"The domain configuration account is disabled. Please contact support or try again later.",[Kx]:"Missing domain configuration account.",[ox]:"Duplicate public keys detected among members. Each member must have a unique key.",[sx]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[px]:"No members provided. A multisig wallet must contain at least one member.",[yx]:"Expected a User with Administrator role for this instruction.",[nx]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[Ax]:"Expected a User with Transaction Manager role for this instruction.",[Lx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[Ox]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Bx]:"Declared buffer size does not match the actual serialized size.",[Rx]:"Not enough members with vote permission to meet the approval threshold.",[hx]:"At least one signer with execute permission is required to proceed.",[Px]:"At least one signer with initiate permission is required to perform this action.",[xx]:"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",[mx]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[Cx]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Wx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[vx]:"Only delegated members are allowed for this transaction.",[Sx]:"Unexpected number of accounts provided for this instruction.",[ix]:"User with Permanent Member role requires a must have a delegated wallet.",[ZS]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[QS]:"The extracted public key has an invalid length or encoding.",[YS]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[$S]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[Gx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[lx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[gx]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[ux]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[fx]:"Malformed transaction message: structure or formatting does not match the expected layout.",[Ix]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[ex]:"The extracted WebAuthn signed message payload is malformed.",[Hx]:"An input string exceeds the maximum allowed character length.",[Jx]:"This member is not registered under the provided domain configuration.",[Dx]:"A required account is missing from the instruction context.",[Vx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[Mx]:"User mutation arguments are required when performing add or remove delegate operations.",[_x]:"No valid signer found in this transaction.",[ax]:"Only one permanent member is allowed per wallet.",[dx]:"Only one transaction manager is allowed per wallet.",[jx]:"The given origin index is not in the whitelisted origins.",[cx]:"Permanent members cannot be removed from a wallet.",[Nx]:"Writable CPI calls to protected accounts are not permitted.",[tx]:"The rpIdHash extracted from the signed message does not match the expected value.",[XS]:"The signature index provided is out of bounds for the secp256r1 instruction.",[Fx]:"The specified slot number was not found in the provided slot history.",[Tx]:"Too many members: a maximum of 4 members are supported.",[wx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[kx]:"This transaction has not yet reached the required approval threshold.",[Ux]:"Only the transaction creator or rent payer may close this transaction buffer.",[bx]:"Member is not part of the expected signers for this transaction."});function lW(e){return process.env.NODE_ENV!=="production"?Ei[e]:"Error message not available in production bundles."}function fW(e,n,r){return isProgramError(e,n,A,r)}var Ut={Ed25519:1,Secp256r1:2};var xe={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},De=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(xe).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var fn=33,Me=class{_bn;constructor(n){typeof n=="string"?this._bn=new Uint8Array(getBase58Encoder().encode(n)):this._bn=new Uint8Array(n),this.validateKeyLength(this._bn);}validateKeyLength(n){if(n.length!==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 Me{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(n,r){super(n),this.verifyArgs=r.verifyArgs,this.domainConfig=r.domainConfig,this.authData=r.authData,this.signature=r.signature,this.originIndex=r.originIndex,this.crossOrigin=r.crossOrigin,this.clientAndDeviceHash=r.clientAndDeviceHash,this.authResponse=r.authResponse;}};function Xx(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function $x(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var Pi=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(Xx())],["addressTableLookups",getArrayCodec($x())]]);function Ri(e){return Pi.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 vi(e){let n=Pi.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 bi="revibase.com",_i="https://auth.revibase.com",Ui="https://api.revibase.com";var ze=null,Li=2e3,Oi=3e3,tI=300*1e3;async function tr({authUrl:e,popUp:n=null}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");return new Promise((r,s)=>{let t=new URL(e).origin,c=null,i=setInterval(()=>{n&&n.closed&&(o(),s(new Error("User closed the authentication window")));},500),a=setTimeout(()=>{o(),s(new Error("Authentication timed out"));},tI);function o(){clearInterval(i),clearTimeout(a),c&&clearTimeout(c),ze&&window.removeEventListener("message",ze),n&&n.close();}if(n?n.location.replace(e):n=Hi(e),!n){s(new Error("Disable your popup blocker to continue."));return}let d=u=>{let g=u.origin===t,y=u.source===n;if(!(!g||!y||!u.isTrusted||!n))switch(u.data.type){case "popup-ready":c=setTimeout(()=>{o(),s(new Error("User closed the authentication window"));},Li+Oi);break;case "popup-complete":try{o(),r({result:"approved"});}catch{s(new Error("Failed to parse response payload"));}break;case "popup-heartbeat":c&&(clearTimeout(c),c=setTimeout(()=>{o(),s(new Error("User closed the authentication window"));},Li+Oi));break;case "popup-closed":o(),s(new Error("User closed the authentication window"));break}};ze&&window.removeEventListener("message",ze),ze=d,window.addEventListener("message",ze);})}function Bi(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function ke(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 rr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function rI(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 wi(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 ki(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 Ni(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"+rr(u)),E=(T>y?p256.Point.CURVE().n-T:T).toString(16).padStart(64,"0"),x=rI(E);return new Uint8Array([...g,...x])}function Hi(e=`${Ke()}/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 aL(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+rr(n.get(-2))),y:BigInt("0x"+rr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function iL(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 dL(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(ke(n)),c=JSON.parse(new TextDecoder().decode(ke(r))),i=wi(c),a=Ni(new Uint8Array(ke(s))),o=await Je({rpIdHash:t.subarray(0,32)});return new C(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(ke(r)),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:aI(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}async function uL(e,n){let{data:r}=await Hn(oe(),e),t=ki(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 aI(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function Gi(e){return sha256(Cn(e))}function Cn(e){return new Uint8Array([...new Uint8Array(ke(e.response.authenticatorData)),...sha256(new Uint8Array(ke(e.response.clientDataJSON)))])}async function Mn(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 Ki(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 Ji(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?Cn(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:i,publicKey:a}}function je(e){if(e instanceof Me)return {keyType:Ut.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Ut.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function zi(e){return e instanceof C?e.toString():e.address.toString()}function Ae(e){let n=new Set,r=[];for(let s of e)n.has(zi(s))||(r.push(s),n.add(zi(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 ji({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 qi(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 qe(){if(!_.solanaRpcEndpoint)throw new Error("Rpc is not initialized yet.");return _.solanaRpcEndpoint}function Ne(){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 Yi(){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 hL(){return _.feePayer||(_.feePayer=await qi(_.apiEndpoint??Ui)),_.feePayer}function En(){if(!_.jitoTipsConfig)throw new Error("Jito Bundle Config is not set.");return _.jitoTipsConfig}function Ke(){return _.authEndpoint??_i}function PL(){return _.rpId??bi}function Ye(){if(!_.onClientAuthorizationCallback)throw new Error("No client transaction callback found.");return _.onClientAuthorizationCallback}function RL(){Object.keys(_).forEach(e=>{_[e]=void 0;});}function vL({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,rpId:i,onClientTransactionCallback: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,_.onClientAuthorizationCallback=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=qe().includes("devnet")?localTestActiveStateTreeInfos():await Ne().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 nr(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=>nr(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 Te(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 Ne().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 sr()).length-1}var hn;async function sr(){if(!hn){let{data:e}=await Gs(oe(),await ed());hn=e.whitelistedAddressTrees;}return hn}async function or(e,n,r){let s=await KI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function KI(e,n,r){let{address:s}=await N(e,n),t=await nr(s,r);return t?.data?.data?J().decode(t.data.data):null}async function Lt(e,n,r){let s=await JI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function JI(e,n,r){try{let{address:s}=await j(e,n),t=await nr(s,r);if(!t?.data?.data)throw new Error("No compressed settings account found.");let c=z().decode(t.data.data);if(c.data.__option==="None")throw new Error("No compressed settings account found.");return {...c.data.value,isCompressed:!0}}catch{let s=await zr(oe(),await Z(e));return s.exists?{...s.data,members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function Pn(e){let n=await sr();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function tO(e){let r=(await sr()).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(Ne().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=qe().includes("devnet")?localTestActiveStateTreeInfos():await Ne().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 Pn(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 Pn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),e instanceof Me?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 dd(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function ed(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function ud(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 Me?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function Ie(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 Ad(e){let n=await Z(e);return await Ie(n)}async function uO(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function IO(e){let n=await Mn(e,true),r=await Ji(n.map(getBase64EncodedWireTransaction),qe()),s=await Mn(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await dC(s.map(getBase64EncodedWireTransaction))}async function CO({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),Ki(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 Yi()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}async function dC(e,n=10,r=1e3,s=En()){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 DO(e,n=30,r=3e3,s=En()){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 MO(e,n,r,s){let t=await Lt(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=>yd(u.pubkey)===e)??{};if(!c)throw new Error("No permissions found for the current member.");let i=De.has(c,xe.InitiateTransaction),a=De.has(c,xe.VoteTransaction),o=De.has(c,xe.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(yd(d.pubkey)),userAddressTreeIndex:d.userAddressTreeIndex}}async function EO({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await or(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return uC(n,c.transactionManagerUrl.value,e,s)}function uC(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=getBase64Decoder().decode(s)),r&&(c.authResponses=r);let 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 yd(e){return e.keyType===Ut.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}async function zO({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let i=await pC(r),a=new U,o=null,d=null,u=[];if(i.length||t){let h=await TC({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 lC({configActionsArgs:r,packedAccounts:a,userMutArgs:u,index:e}),{remainingAccounts:T,systemOffset:f}=a.toAccountMetas(),E=b(o,f);return {instructions:t?[co({configActions:g,payer:s,authority:createNoopSigner(await Ad(e)),compressedProofArgs:E,settingsMut:d,remainingAccounts:T})]:[await eo({settingsIndex:e,configActions:g,payer:s,compressedProofArgs:E,remainingAccounts:T})],secp256r1VerifyInput:y}}async function pC(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 TC({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 lC({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 f=await N(o.member,o.userAddressTreeIndex).then(E=>s.find(x=>new vn(new Uint8Array(x.accountMeta.address)).eq(E.address)));if(!f)throw new Error("Unable to find user account");a.push(md({permissionArgs:o.permissions,index:d,userMutArgs:f,pubkey:o.member}));}else {let d=await N(o.member,o.userAddressTreeIndex).then(u=>s.find(g=>new vn(new Uint8Array(g.accountMeta.address)).eq(u.address)));if(!d)throw new Error("Unable to find user account");a.push(md({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 vn(new Uint8Array(g.accountMeta.address)).eq(d.address));if(!u)throw new Error("Unable to find user account");return SC({pubkey:o.member,userMutArgs:u,index:e})})));c.push({__kind:i.type,fields:[a]});break}case "EditPermissions":{let a=i.members.map(o=>fC({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 fC({pubkey:e,permissionArgs:n}){return {memberKey:je(e),permissions:pd(n)}}function SC({pubkey:e,userMutArgs:n,index:r}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");let s=n.data.delegatedTo.__option==="Some"?Number(n.data.delegatedTo.value.index.toString())===r:false;return {memberKey:je(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function md({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:je(e),permissions:pd(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 pd(e){let n=[];return e.initiate&&n.push(xe.InitiateTransaction),e.vote&&n.push(xe.VoteTransaction),e.execute&&n.push(xe.ExecuteTransaction),De.fromPermissions(n)}var Xe=33,$e=64,Wn=14,hC=2,PC=address("Secp256r1SigVerify1111111111111111111111111");function RC(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function vC(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function Sd(){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=vC();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=Wn;let i=[];for(let a=0;a<r;a++){let o=fixDecoderSize(getBytesDecoder(),Xe).decode(e,n);n+=Xe;let d=fixDecoderSize(getBytesDecoder(),$e).decode(e,n);n+=$e;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 xd(){return createEncoder({getSizeFromValue:e=>{let n=Wn*e.offsets.length,r=e.payload.reduce((s,t)=>s+Xe+$e+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=RC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),Xe).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),$e).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function jO(){return combineCodec(xd(),Sd())}function F(e,n){let r=e.length,s=hC+r*Wn,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,g=u+Xe,y=g+$e;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:y,messageDataSize:d.length,messageInstructionIndex:65535}),s+=Xe+$e+d.length;}let c=n?.programAddress??PC,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:xd().encode(i)}}function qO(e){return {programAddress:e.programAddress,accounts:{},data:Sd().decode(e.data)}}async function sB({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=Ae(s),y=g.filter(S=>S instanceof C),T=[],f=[];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"&&f.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:E,systemOffset:x}=c.toAccountMetas(),h=b(d,x),I=[];return T.length>0&&I.push(F(T)),I.push(yo({settings:i,settingsMutArgs:u,compressedProofArgs:h,payer:r,secp256r1VerifyArgs:f,remainingAccounts:E})),I}async function aB({admin:e,addressTree:n}){return qs({payer:e,addressTree:n,remainingAccounts:[]})}async function mB({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(),f=b(u,T);return await Do({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:f,payer:e,domainConfig:t,rpId:n,remainingAccounts:y})}async function MB({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,f=null,E=a.filter(W=>W.type==="Settings"),x=a.filter(W=>W.type==="User");E.length&&(T=Y(c,y.treeInfos.slice(0,1),y.leafIndices.slice(0,1),y.rootIndices.slice(0,1),y.proveByIndices.slice(0,1),E,z())[0]),x.length&&(f=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 Po({payer:n,authority:e,compressedProofArgs:L,member:St().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:T?some({settingsMutArgs:T,transactionManager:f?some(f):none()}):none(),userAccountCreationArgs:h[0],domainConfig:s,remainingAccounts:I})}async function RB({payer:e}){let n=await dd();return _o({payer:e,globalCounter:n})}async function OB({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 Ho({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 NB({admin:e,rpId:n,disable:r}){let s=await Je({rpId:n});return $o({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function JB({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 sc({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function $B({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 uc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function iw({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 or(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,f=null,E,x=null;g.delegatedTo.__option==="Some"&&((await Lt(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"}),f={start:y.length-1,end:y.length}):T=await Z(g.delegatedTo.value.index)),s&&((await Lt(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}):E=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=f?some(Y(h,S.treeInfos.slice(f.start,f.end),S.leafIndices.slice(f.start,f.end),S.rootIndices.slice(f.start,f.end),S.proveByIndices.slice(f.start,f.end),I.slice(f.start,f.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(Tc({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof C?void 0:n,oldSettings:T,oldSettingsMutArgs:W,newSettings:E,newSettingsMutArgs:q,compressedProofArgs:O,userMutArgs:L,remainingAccounts:H})),re}async function pw({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 Cc({compressedProofArgs:y,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function Cw({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 Rc({compressedProofArgs:y,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}async function zw({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 f=await le(),{address:E,addressTree:x}=await j(e,f);y.push({address:E,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 Bo({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 ek({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=Ae(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:f}=c.toAccountMetas(),E=b(a,f),x=[];g.length>0&&x.push(F(g));let h=await Z(e);return x.push(Jo({settings:h,payer:r,settingsMut:o,compressedProofArgs:E,secp256r1VerifyArgs:y,remainingAccounts:T})),x}function LC(e,n,r,s){let t=OC(e,n),c=BC(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function OC(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 BC(e,n){return n<e.header.numSignerAccounts}async function ar({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=vi(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:LC(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 hd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:o=false}){let d=await Ie(e),{accountMetas:u,addressLookupTableAccounts:g}=await ar({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(F(c)),y.push(o?gi({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):ci({transactionBuffer:n,payer:s.address,settings:e})),a&&y.push(ji({payer:s,tipAmount:a})),{instructions:y,addressLookupTableAccounts:g}}async function Pd({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:i=[],compressed:a=false,simulateProof:o=false,cachedAccounts:d}){let u=Ae(s),g=await Z(e),y=await Ie(g),[{accountMetas:T,addressLookupTableAccounts:f,transactionMessage:E},{settingsReadonlyArgs:x,proof:h,packedAccounts:I}]=await Promise.all([ar({transactionMessageBytes:r,walletAddress:y,additionalSigners:u.filter(O=>!(O instanceof C)),addressesByLookupTableAddress:c}),Te(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:pe,verifyArgs:he,signature:Ce,publicKey:Pe,message:Ot}=G(O,re);Ot&&Ce&&Pe&&i.push({message:Ot,signature:Ce,publicKey:Pe}),pe&&(I.addPreAccounts([{address:pe,role:AccountRole.READONLY}]),he?.__option==="Some"&&L.push({domainConfigKey:pe,verifyArgs:he.value}));}let{remainingAccounts:W,systemOffset:q}=I.toAccountMetas(),H=[];i.length>0&&H.push(F(i));let V=kC(E,T);if(a){if(!t||!x)throw new Error("Payer not found or proof args is missing.");let O=b(h,q);H.push(Mi({secp256r1VerifyArgs:L,transactionMessage:V,settingsReadonlyArgs:x,compressedProofArgs:O,payer:t,remainingAccounts:W}));}else H.push(fi({secp256r1VerifyArgs:L,settings:g,transactionMessage:V,remainingAccounts:W}));return {instructions:H,addressLookupTableAccounts:f}}function kC(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 Rk({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let o=Ae(s),d=await Z(e),u=await Ie(d),{settingsReadonlyArgs:g,proof:y,packedAccounts:T}=await Te(a,e,n,false,t),f=[],E=[];for(let S of o)if(S instanceof C){let L=f.length,{domainConfig:W,verifyArgs:q,signature:H,publicKey:V,message:O}=G(S,L);O&&H&&V&&f.push({message:O,signature:H,publicKey:V}),W&&(T.addPreAccounts([{address:W,role:AccountRole.READONLY}]),q?.__option==="Some"&&E.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(f.length>0&&I.push(F(f)),a){if(!i||!g)throw new Error("Payer not found or proof args is missing.");let S=b(y,h);I.push(kc({amount:c,settingsReadonlyArgs:g,compressedProofArgs:S,payer:i,secp256r1VerifyArgs:E,source:u,destination:r,remainingAccounts:x}));}else I.push(Uc({amount:c,secp256r1VerifyArgs:E,source:u,destination:r,settings:d,remainingAccounts:x}));return I}async function kk({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=Ae(t),y=await Z(e),T=await Ie(y),[f,E]=await Promise.all([getAssociatedTokenAccountAddress(s,T,o),getAssociatedTokenAccountAddress(s,r,o)]),{settingsReadonlyArgs:x,proof:h,packedAccounts:I}=await Te(u,e,n,false,c),S=[],L=[];for(let V of g)if(V instanceof C){let O=S.length,{domainConfig:re,verifyArgs:pe,signature:he,publicKey:Ce,message:Pe}=G(V,O);Pe&&he&&Ce&&S.push({message:Pe,signature:he,publicKey:Ce}),re&&(I.addPreAccounts([{address:re,role:AccountRole.READONLY}]),pe?.__option==="Some"&&L.push({domainConfigKey:re,verifyArgs:pe.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(qc({amount:i,createAtaIfNeeded:d,settingsReadonlyArgs:x,compressedProofArgs:V,payer:a,secp256r1VerifyArgs:L,source:T,sourceTokenAccount:f,destination:r,destinationTokenAccount:E,mint:s,tokenProgram:o,remainingAccounts:W}));}else H.push(Gc({amount:i,createAtaIfNeeded:d,secp256r1VerifyArgs:L,source:T,sourceTokenAccount:f,destination:r,destinationTokenAccount:E,settings:y,mint:s,tokenProgram:o,remainingAccounts:W}));return H}async function Yk({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:i}){let a=await Bs(oe(),s),o=a.data.multiWalletSettings,{settingsReadonlyArgs:d,proof:u,packedAccounts:g}=await Te(c,e,n,false,i),{remainingAccounts:y,systemOffset:T}=g.toAccountMetas(),{domainConfig:f,verifyArgs:E,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(ca({transactionBuffer:s,domainConfig:f,closer:r instanceof C?void 0:r,rentCollector:a.data.payer,secp256r1VerifyArgs:E,settingsReadonlyArgs:d,payer:t,compressedProofArgs:L,remainingAccounts:y}));}else S.push(ea({transactionBuffer:s,domainConfig:f,closer:r instanceof C?void 0:r,settings:o,payer:a.data.payer,secp256r1VerifyArgs:E,remainingAccounts:[]}));return S}function _d({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:f,publicKey:E}=G(n),x=[];if(T&&f&&E&&x.push(F([{message:T,signature:f,publicKey:E}])),d){let{settingsReadonlyArgs:h,compressedProofArgs:I,remainingAccounts:S}=d;x.push(fa({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(ga({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 Ud({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(ba({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(Ma({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?Ga({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Ba({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Ld({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(ei({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(qa({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,remainingAccounts:[]})),d}async function LN({message:e,signer:n,popUp:r}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let s=window.origin,t={type:"message",payload:e},c=await Ye()({phase:"start",data:t,redirectOrigin:s,signer:n});return await tr({authUrl:`${Ke()}&sessionToken=${c}`,popUp:r}),await Ye()({phase:"complete",data:{type:"message",sessionToken:c}})}async function NN({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let c=window.origin,i={type:"transaction",payload:{transactionActionType:e,transactionAddress:n,transactionMessageBytes:Bi(r)}},a=await Ye()({phase:"start",data:i,redirectOrigin:c,signer:s});return await tr({authUrl:`${Ke()}&sessionToken=${a}`,popUp:t}),await Ye()({phase:"complete",data:{type:"transaction",sessionToken:a}})}async function ZN({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 f=await Z(n),E=Math.floor(Math.random()*255),x=await ud(f,t instanceof C?t:t.address,E),h=[],I=[];for(let X=0;X<s.length;X+=y){let Bn=s.subarray(X,X+y);h.push(Bn),I.push(sha256(Bn));}let S=sha256(new Uint8Array(s)),{settingsReadonlyArgs:L,proof:W,packedAccounts:q}=await Te(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=Ae([t,...c?[c]:[],...u]).filter(X=>X instanceof C).map(X=>({memberKey:je(X),messageHash:Gi(X.authResponse)})),pe=_d({finalBufferHash:S,finalBufferSize:s.length,bufferIndex:E,payer:e,transactionBufferAddress:x,settings:f,creator:t,preauthorizeExecution:!c,bufferExtendHashes:I,compressedArgs:O,expectedSecp256r1Signers:re}),he=h.map(X=>Wd({transactionMessageBytes:X,transactionBufferAddress:x,settings:f,compressed:d})),Ce=u.map(X=>Ld({voter:X,transactionBufferAddress:x,settings:f,compressedArgs:O})),Pe=Ud({compressedArgs:O,settings:f,executor:c,transactionBufferAddress:x}),{instructions:Ot,addressLookupTableAccounts:wd}=await hd({compressed:d,settings:f,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o}),Qe=X=>({payer:e,instructions:X,addressesByLookupTableAddress:wd});return [Qe(pe),...he.map(X=>Qe([X])),...Ce.length?[Qe(Ce.flat())]:[],Qe(Pe),Qe(Ot)]}var dr=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 ur=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,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 Bd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=dr.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:f,drainedKeys:E}=T;c.push({readonlyIndexes:f.readonlyIndexes,readableIndices:f.readonlyIndexes,writableIndexes:f.writableIndexes,writableIndices:f.writableIndexes,lookupTableAddress:address(f.lookupTableAddress)}),i.writable.push(...E.writable),i.readonly.push(...E.readonly);}}let[o,d]=t.getMessageComponents(),g=new ur(d,i).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function d2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Bd({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return Ri(s)}async function m2({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 Pd({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{Js as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,no as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,$s as CHANGE_CONFIG_DISCRIMINATOR,uo as COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Io as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Eo as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,vo as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Lo as CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR,ko as CREATE_USER_ACCOUNTS_DISCRIMINATOR,Fo as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Yo as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,wn as DOMAIN_CONFIG_DISCRIMINATOR,rc as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,ac as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,yc as EDIT_USER_DELEGATE_DISCRIMINATOR,Fn as GLOBAL_COUNTER_DISCRIMINATOR,Ut as KeyType,Sc as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,Ec as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,Ex as MULTI_WALLET_ERROR__ALREADY_DELEGATED,rx as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,zx as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,Kx as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,ox as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,sx as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,px as MULTI_WALLET_ERROR__EMPTY_MEMBERS,yx as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,nx as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,Ax as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,Lx as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,Ox as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,Bx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,Rx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,hx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,Px as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,xx as MULTI_WALLET_ERROR__INVALID_ACCOUNT,qx as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,mx as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,Cx as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,Wx as MULTI_WALLET_ERROR__INVALID_BUFFER,vx as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,Sx as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,ix as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,ZS as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,QS as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,YS as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,$S as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,Gx as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,lx as MULTI_WALLET_ERROR__INVALID_THRESHOLD,gx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,ux as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,fx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,Ix as MULTI_WALLET_ERROR__INVALID_USER_ROLE,ex as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,Hx as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,Jx as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,Dx as MULTI_WALLET_ERROR__MISSING_ACCOUNT,Vx as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,Mx as MULTI_WALLET_ERROR__MISSING_USER_ARGS,_x as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,ax as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,dx as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,jx as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,cx as MULTI_WALLET_ERROR__PERMANENT_MEMBER,Nx as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,tx as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,XS as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,Fx as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,Tx as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,wx as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,kx as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,Ux as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,bx as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,JS as MultiWalletAccount,jS as MultiWalletInstruction,Oc as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,bc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,xe as Permission,De as Permissions,hs as SETTINGS_DISCRIMINATOR,Me as Secp256r1Key,C as SignedSecp256r1Key,Jc as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Hc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,na as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,Xc as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,pa as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,da as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Ws as TRANSACTION_BUFFER_DISCRIMINATOR,Pa as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Ia as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Na as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Wa as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Xa as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Ka as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,di as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,ni as TRANSACTION_EXECUTE_DISCRIMINATOR,Ii as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,pi as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Oe as UserRole,Ns as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,aB as addWhitelistedAddressTrees,zO as changeConfig,Yk as closeTransactionBuffer,sB as compressSettingsAccount,RD as configAction,yd as convertMemberKeyToString,iL as convertPubkeyCompressedToCose,aL as convertPubkeyCoseToCompressed,mB as createDomainConfig,MB as createDomainUserAccounts,RB as createGlobalCounter,Hi as createPopUp,_d as createTransactionBuffer,uC as createTransactionManagerSigner,OB as createUserAccounts,zw as createWallet,Nn as decodeDomainConfig,Kn as decodeGlobalCounter,Rs as decodeSettings,Os as decodeTransactionBuffer,Vs as decodeWhitelistedAddressTree,ek as decompressSettingsAccount,NB as disableDomainConfig,JB as editDomainConfig,$B as editTransactionManagerUrl,iw as editUserDelegate,hd as executeTransaction,Ud as executeTransactionBuffer,Pd as executeTransactionSync,Wd as extendTransactionBuffer,FC as fetchAllDomainConfig,ZC as fetchAllGlobalCounter,Xd as fetchAllMaybeDomainConfig,yu as fetchAllMaybeGlobalCounter,Cy as fetchAllMaybeSettings,zy as fetchAllMaybeTransactionBuffer,um as fetchAllMaybeWhitelistedAddressTree,Th as fetchAllSettings,Dh as fetchAllTransactionBuffer,Rh as fetchAllWhitelistedAddressTree,Qi as fetchCompressedAccount,Hn as fetchDomainConfig,YC as fetchGlobalCounter,Zd as fetchMaybeDomainConfig,gu as fetchMaybeGlobalCounter,zr as fetchMaybeSettings,JI as fetchMaybeSettingsAccountData,Fy as fetchMaybeTransactionBuffer,KI as fetchMaybeUserAccountData,dm as fetchMaybeWhitelistedAddressTree,ph as fetchSettings,Lt as fetchSettingsAccountData,Bs as fetchTransactionBuffer,or as fetchUserAccountData,Gs as fetchWhitelistedAddressTree,tD as getAddMemberArgsCodec,gr as getAddMemberArgsDecoder,Ar as getAddMemberArgsEncoder,Kh as getAddWhitelistedAddressTreesDiscriminatorBytes,jh as getAddWhitelistedAddressTreesInstruction,qs as getAddWhitelistedAddressTreesInstructionAsync,Jh as getAddWhitelistedAddressTreesInstructionDataCodec,js as getAddWhitelistedAddressTreesInstructionDataDecoder,$r as getAddWhitelistedAddressTreesInstructionDataEncoder,Ke as getAuthEndpoint,AP as getChangeConfigCompressedDiscriminatorBytes,co as getChangeConfigCompressedInstruction,gP as getChangeConfigCompressedInstructionDataCodec,oo as getChangeConfigCompressedInstructionDataDecoder,so as getChangeConfigCompressedInstructionDataEncoder,tP as getChangeConfigDiscriminatorBytes,nP as getChangeConfigInstruction,eo as getChangeConfigInstructionAsync,rP as getChangeConfigInstructionDataCodec,Qs as getChangeConfigInstructionDataDecoder,Qr as getChangeConfigInstructionDataEncoder,aI as getClientAndDeviceHash,sD as getCompiledInstructionCodec,mr as getCompiledInstructionDecoder,yr as getCompiledInstructionEncoder,xP as getCompressSettingsAccountDiscriminatorBytes,yo as getCompressSettingsAccountInstruction,IP as getCompressSettingsAccountInstructionDataCodec,go as getCompressSettingsAccountInstructionDataDecoder,Ao as getCompressSettingsAccountInstructionDataEncoder,iD as getCompressedAccountMetaCodec,nt as getCompressedAccountMetaDecoder,rt as getCompressedAccountMetaEncoder,gD as getCompressedAccountMetaReadOnlyCodec,at as getCompressedAccountMetaReadOnlyDecoder,ct as getCompressedAccountMetaReadOnlyEncoder,pD as getCompressedProofCodec,xr as getCompressedProofDecoder,Sr as getCompressedProofEncoder,j as getCompressedSettingsAddressFromIndex,SD as getCompressedSettingsCodec,DD as getCompressedSettingsDataCodec,ut as getCompressedSettingsDataDecoder,dt as getCompressedSettingsDataEncoder,z as getCompressedSettingsDecoder,it as getCompressedSettingsEncoder,Zi as getComputeBudgetEstimate,PD as getConfigActionCodec,mt as getConfigActionDecoder,yt as getConfigActionEncoder,vP as getCreateDomainConfigDiscriminatorBytes,_P as getCreateDomainConfigInstruction,Do as getCreateDomainConfigInstructionAsync,bP as getCreateDomainConfigInstructionDataCodec,Co as getCreateDomainConfigInstructionDataDecoder,tn as getCreateDomainConfigInstructionDataEncoder,NP as getCreateDomainUserAccountDiscriminatorBytes,VP as getCreateDomainUserAccountInstruction,Po as getCreateDomainUserAccountInstructionAsync,HP as getCreateDomainUserAccountInstructionDataCodec,ho as getCreateDomainUserAccountInstructionDataDecoder,nn as getCreateDomainUserAccountInstructionDataEncoder,qP as getCreateGlobalCounterDiscriminatorBytes,ZP as getCreateGlobalCounterInstruction,_o as getCreateGlobalCounterInstructionAsync,YP as getCreateGlobalCounterInstructionDataCodec,bo as getCreateGlobalCounterInstructionDataDecoder,on as getCreateGlobalCounterInstructionDataEncoder,sR as getCreateMultiWalletCompressedDiscriminatorBytes,cR as getCreateMultiWalletCompressedInstruction,Bo as getCreateMultiWalletCompressedInstructionAsync,oR as getCreateMultiWalletCompressedInstructionDataCodec,Oo as getCreateMultiWalletCompressedInstructionDataDecoder,cn as getCreateMultiWalletCompressedInstructionDataEncoder,WD as getCreateUserAccountArgsCodec,Rr as getCreateUserAccountArgsDecoder,Pr as getCreateUserAccountArgsEncoder,mR as getCreateUserAccountsDiscriminatorBytes,TR as getCreateUserAccountsInstruction,Ho as getCreateUserAccountsInstructionAsync,pR as getCreateUserAccountsInstructionDataCodec,No as getCreateUserAccountsInstructionDataDecoder,dn as getCreateUserAccountsInstructionDataEncoder,MR as getDecompressSettingsAccountDiscriminatorBytes,Jo as getDecompressSettingsAccountInstruction,ER as getDecompressSettingsAccountInstructionDataCodec,Ko as getDecompressSettingsAccountInstructionDataDecoder,zo as getDecompressSettingsAccountInstructionDataEncoder,UR as getDisableDomainConfigDiscriminatorBytes,$o as getDisableDomainConfigInstruction,WR as getDisableDomainConfigInstructionDataCodec,Xo as getDisableDomainConfigInstructionDataDecoder,Zo as getDisableDomainConfigInstructionDataEncoder,Je as getDomainConfigAddress,GC as getDomainConfigCodec,kn as getDomainConfigDecoder,VC as getDomainConfigDiscriminatorBytes,Yd as getDomainConfigEncoder,zC as getDomainConfigSize,VR as getEditDomainConfigDiscriminatorBytes,sc as getEditDomainConfigInstruction,FR as getEditDomainConfigInstructionAsync,GR as getEditDomainConfigInstructionDataCodec,nc as getEditDomainConfigInstructionDataDecoder,An as getEditDomainConfigInstructionDataEncoder,wD as getEditMemberArgsCodec,Mr as getEditMemberArgsDecoder,Dr as getEditMemberArgsEncoder,XR as getEditTransactionManagerUrlDiscriminatorBytes,uc as getEditTransactionManagerUrlInstruction,$R as getEditTransactionManagerUrlInstructionDataCodec,dc as getEditTransactionManagerUrlInstructionDataDecoder,ic as getEditTransactionManagerUrlInstructionDataEncoder,cv as getEditUserDelegateDiscriminatorBytes,Tc as getEditUserDelegateInstruction,av as getEditUserDelegateInstructionDataCodec,pc as getEditUserDelegateInstructionDataDecoder,mc as getEditUserDelegateInstructionDataEncoder,VD as getExpectedSecp256r1SignersCodec,Tt as getExpectedSecp256r1SignersDecoder,pt as getExpectedSecp256r1SignersEncoder,hL as getFeePayer,dd as getGlobalCounterAddress,qC as getGlobalCounterCodec,zn as getGlobalCounterDecoder,jC as getGlobalCounterDiscriminatorBytes,Au as getGlobalCounterEncoder,XC as getGlobalCounterSize,En as getJitoTipsConfig,uO as getLightCpiSigner,Ne as getLightProtocolRpc,KD as getLinkWalletArgsCodec,br as getLinkWalletArgsDecoder,vr as getLinkWalletArgsEncoder,YD as getMemberCodec,gt as getMemberDecoder,At as getMemberEncoder,$D as getMemberKeyCodec,Q as getMemberKeyDecoder,$ as getMemberKeyEncoder,pv as getMigrateCompressedSettingsDiscriminatorBytes,Cc as getMigrateCompressedSettingsInstruction,Tv as getMigrateCompressedSettingsInstructionDataCodec,Ic as getMigrateCompressedSettingsInstructionDataDecoder,xc as getMigrateCompressedSettingsInstructionDataEncoder,Mv as getMigrateCompressedUsersDiscriminatorBytes,Rc as getMigrateCompressedUsersInstruction,Ev as getMigrateCompressedUsersInstructionDataCodec,Pc as getMigrateCompressedUsersInstructionDataDecoder,hc as getMigrateCompressedUsersInstructionDataEncoder,lW as getMultiWalletErrorMessage,Fv as getNativeTransferIntentCompressedDiscriminatorBytes,kc as getNativeTransferIntentCompressedInstruction,zv as getNativeTransferIntentCompressedInstructionDataCodec,wc as getNativeTransferIntentCompressedInstructionDataDecoder,Bc as getNativeTransferIntentCompressedInstructionDataEncoder,Wv as getNativeTransferIntentDiscriminatorBytes,Uc as getNativeTransferIntentInstruction,Ov as getNativeTransferIntentInstructionAsync,Lv as getNativeTransferIntentInstructionDataCodec,_c as getNativeTransferIntentInstructionDataDecoder,gn as getNativeTransferIntentInstructionDataEncoder,rM as getNewAuthorityArgsCodec,Lr as getNewAuthorityArgsDecoder,Wr as getNewAuthorityArgsEncoder,Ye as getOnClientAuthorizationCallback,uL as getOriginIndex,oM as getPackedAddressTreeInfoCodec,ft as getPackedAddressTreeInfoDecoder,lt as getPackedAddressTreeInfoEncoder,iM as getPackedStateTreeInfoCodec,ot as getPackedStateTreeInfoDecoder,st as getPackedStateTreeInfoEncoder,AM as getPermissionsCodec,ve as getPermissionsDecoder,Re as getPermissionsEncoder,pM as getProofArgsCodec,M as getProofArgsDecoder,D as getProofArgsEncoder,SM as getRemoveMemberArgsCodec,hr as getRemoveMemberArgsDecoder,Er as getRemoveMemberArgsEncoder,PL as getRpId,Cn as getSecp256r1Message,Gi as getSecp256r1MessageHash,CM as getSecp256r1PubkeyCodec,St as getSecp256r1PubkeyDecoder,Or as getSecp256r1PubkeyEncoder,vC as getSecp256r1SignatureOffsetsDataDecoder,RC as getSecp256r1SignatureOffsetsDataEncoder,EM as getSecp256r1VerifyArgsCodec,w as getSecp256r1VerifyArgsDecoder,B as getSecp256r1VerifyArgsEncoder,vM as getSecp256r1VerifyArgsWithDomainAddressCodec,te as getSecp256r1VerifyArgsWithDomainAddressDecoder,ee as getSecp256r1VerifyArgsWithDomainAddressEncoder,F as getSecp256r1VerifyInstruction,jO as getSecp256r1VerifyInstructionDataCodec,Sd as getSecp256r1VerifyInstructionDataDecoder,xd as getSecp256r1VerifyInstructionDataEncoder,Yi as getSendAndConfirmTransaction,mh as getSettingsCodec,WM as getSettingsCreationArgsCodec,It as getSettingsCreationArgsDecoder,xt as getSettingsCreationArgsEncoder,Ps as getSettingsDecoder,yh as getSettingsDiscriminatorBytes,Iy as getSettingsEncoder,Z as getSettingsFromIndex,BM as getSettingsIndexWithAddressCodec,Dt as getSettingsIndexWithAddressDecoder,Ct as getSettingsIndexWithAddressEncoder,HM as getSettingsMutArgsCodec,ue as getSettingsMutArgsDecoder,de as getSettingsMutArgsEncoder,zM as getSettingsReadonlyArgsCodec,se as getSettingsReadonlyArgsDecoder,ne as getSettingsReadonlyArgsEncoder,lh as getSettingsSize,dL as getSignedSecp256r1Key,EO as getSignedTransactionManager,oe as getSolanaRpc,qe as getSolanaRpcEndpoint,ib as getTokenTransferIntentCompressedDiscriminatorBytes,qc as getTokenTransferIntentCompressedInstruction,ub as getTokenTransferIntentCompressedInstructionAsync,db as getTokenTransferIntentCompressedInstructionDataCodec,jc as getTokenTransferIntentCompressedInstructionDataDecoder,pn as getTokenTransferIntentCompressedInstructionDataEncoder,$v as getTokenTransferIntentDiscriminatorBytes,Gc as getTokenTransferIntentInstruction,eb as getTokenTransferIntentInstructionAsync,Qv as getTokenTransferIntentInstructionDataCodec,Vc as getTokenTransferIntentInstructionDataDecoder,mn as getTokenTransferIntentInstructionDataEncoder,ud as getTransactionBufferAddress,Pb as getTransactionBufferCloseCompressedDiscriminatorBytes,ca as getTransactionBufferCloseCompressedInstruction,Rb as getTransactionBufferCloseCompressedInstructionDataCodec,oa as getTransactionBufferCloseCompressedInstructionDataDecoder,sa as getTransactionBufferCloseCompressedInstructionDataEncoder,fb as getTransactionBufferCloseDiscriminatorBytes,ea as getTransactionBufferCloseInstruction,Sb as getTransactionBufferCloseInstructionDataCodec,Qc as getTransactionBufferCloseInstructionDataDecoder,$c as getTransactionBufferCloseInstructionDataEncoder,Ch as getTransactionBufferCodec,qM as getTransactionBufferCreateArgsCodec,Et as getTransactionBufferCreateArgsDecoder,Mt as getTransactionBufferCreateArgsEncoder,Kb as getTransactionBufferCreateCompressedDiscriminatorBytes,fa as getTransactionBufferCreateCompressedInstruction,Jb as getTransactionBufferCreateCompressedInstructionDataCodec,la as getTransactionBufferCreateCompressedInstructionDataDecoder,Ta as getTransactionBufferCreateCompressedInstructionDataEncoder,Bb as getTransactionBufferCreateDiscriminatorBytes,ga as getTransactionBufferCreateInstruction,wb as getTransactionBufferCreateInstructionDataCodec,Aa as getTransactionBufferCreateInstructionDataDecoder,ua as getTransactionBufferCreateInstructionDataEncoder,Ls as getTransactionBufferDecoder,Ih as getTransactionBufferDiscriminatorBytes,Gy as getTransactionBufferEncoder,d_ as getTransactionBufferExecuteCompressedDiscriminatorBytes,ba as getTransactionBufferExecuteCompressedInstruction,u_ as getTransactionBufferExecuteCompressedInstructionDataCodec,va as getTransactionBufferExecuteCompressedInstructionDataDecoder,Ra as getTransactionBufferExecuteCompressedInstructionDataEncoder,e_ as getTransactionBufferExecuteDiscriminatorBytes,Ma as getTransactionBufferExecuteInstruction,t_ as getTransactionBufferExecuteInstructionDataCodec,Da as getTransactionBufferExecuteInstructionDataDecoder,Ca as getTransactionBufferExecuteInstructionDataEncoder,E_ as getTransactionBufferExtendCompressedDiscriminatorBytes,Ga as getTransactionBufferExtendCompressedInstruction,h_ as getTransactionBufferExtendCompressedInstructionDataCodec,Va as getTransactionBufferExtendCompressedInstructionDataDecoder,Ha as getTransactionBufferExtendCompressedInstructionDataEncoder,l_ as getTransactionBufferExtendDiscriminatorBytes,Ba as getTransactionBufferExtendInstruction,f_ as getTransactionBufferExtendInstructionDataCodec,Oa as getTransactionBufferExtendInstructionDataDecoder,La as getTransactionBufferExtendInstructionDataEncoder,F_ as getTransactionBufferVoteCompressedDiscriminatorBytes,ei as getTransactionBufferVoteCompressedInstruction,z_ as getTransactionBufferVoteCompressedInstructionDataCodec,Qa as getTransactionBufferVoteCompressedInstructionDataDecoder,$a as getTransactionBufferVoteCompressedInstructionDataEncoder,L_ as getTransactionBufferVoteDiscriminatorBytes,qa as getTransactionBufferVoteInstruction,O_ as getTransactionBufferVoteInstructionDataCodec,ja as getTransactionBufferVoteInstructionDataDecoder,Ja as getTransactionBufferVoteInstructionDataEncoder,oU as getTransactionExecuteCompressedDiscriminatorBytes,gi as getTransactionExecuteCompressedInstruction,cU as getTransactionExecuteCompressedInstructionDataCodec,Ai as getTransactionExecuteCompressedInstructionDataDecoder,ui as getTransactionExecuteCompressedInstructionDataEncoder,X_ as getTransactionExecuteDiscriminatorBytes,ci as getTransactionExecuteInstruction,$_ as getTransactionExecuteInstructionDataCodec,oi as getTransactionExecuteInstructionDataDecoder,si as getTransactionExecuteInstructionDataEncoder,DU as getTransactionExecuteSyncCompressedDiscriminatorBytes,Mi as getTransactionExecuteSyncCompressedInstruction,MU as getTransactionExecuteSyncCompressedInstructionDataCodec,Di as getTransactionExecuteSyncCompressedInstructionDataDecoder,Ci as getTransactionExecuteSyncCompressedInstructionDataEncoder,mU as getTransactionExecuteSyncDiscriminatorBytes,fi as getTransactionExecuteSyncInstruction,pU as getTransactionExecuteSyncInstructionDataCodec,li as getTransactionExecuteSyncInstructionDataDecoder,Ti as getTransactionExecuteSyncInstructionDataEncoder,tE as getTransactionMessageAddressTableLookupCodec,wr as getTransactionMessageAddressTableLookupDecoder,Br as getTransactionMessageAddressTableLookupEncoder,$M as getTransactionMessageCodec,Pt as getTransactionMessageDecoder,ht as getTransactionMessageEncoder,N as getUserAccountAddress,oE as getUserCodec,dE as getUserCreationArgsCodec,me as getUserCreationArgsDecoder,ye as getUserCreationArgsEncoder,J as getUserDecoder,Le as getUserEncoder,yE as getUserMutArgsCodec,Se as getUserMutArgsDecoder,fe as getUserMutArgsEncoder,lE as getUserReadOnlyArgsCodec,Vr as getUserReadOnlyArgsDecoder,Hr as getUserReadOnlyArgsEncoder,IE as getUserReadOnlyOrMutateArgsCodec,_e as getUserReadOnlyOrMutateArgsDecoder,be as getUserReadOnlyOrMutateArgsEncoder,hE as getUserRoleCodec,We as getUserRoleDecoder,Ue as getUserRoleEncoder,Ad as getWalletAddressFromIndex,Ie as getWalletAddressFromSettings,Ph as getWhitelistedAddressTreeCodec,Hs as getWhitelistedAddressTreeDecoder,hh as getWhitelistedAddressTreeDiscriminatorBytes,im as getWhitelistedAddressTreeEncoder,Pn as getWhitelistedAddressTreeFromIndex,tO as getWhitelistedAddressTreeIndexFromAddress,ed as getWhitelistedAddressTreesAddress,uW as identifyMultiWalletAccount,AW as identifyMultiWalletInstruction,vL as initialize,vD as isConfigAction,fW as isMultiWalletError,DE as isUserReadOnlyOrMutateArgs,pw as migrateSettings,Cw as migrateUsers,Rk as nativeTransferIntent,qh as parseAddWhitelistedAddressTreesInstruction,yP as parseChangeConfigCompressedInstruction,sP as parseChangeConfigInstruction,CP as parseCompressSettingsAccountInstruction,UP as parseCreateDomainConfigInstruction,GP as parseCreateDomainUserAccountInstruction,XP as parseCreateGlobalCounterInstruction,aR as parseCreateMultiWalletCompressedInstruction,lR as parseCreateUserAccountsInstruction,hR as parseDecompressSettingsAccountInstruction,LR as parseDisableDomainConfigInstruction,zR as parseEditDomainConfigInstruction,QR as parseEditTransactionManagerUrlInstruction,iv as parseEditUserDelegateInstruction,lv as parseMigrateCompressedSettingsInstruction,hv as parseMigrateCompressedUsersInstruction,Kv as parseNativeTransferIntentCompressedInstruction,Bv as parseNativeTransferIntentInstruction,qO as parseSecp256r1VerifyInstruction,Ab as parseTokenTransferIntentCompressedInstruction,tb as parseTokenTransferIntentInstruction,vb as parseTransactionBufferCloseCompressedInstruction,xb as parseTransactionBufferCloseInstruction,jb as parseTransactionBufferCreateCompressedInstruction,kb as parseTransactionBufferCreateInstruction,A_ as parseTransactionBufferExecuteCompressedInstruction,r_ as parseTransactionBufferExecuteInstruction,P_ as parseTransactionBufferExtendCompressedInstruction,S_ as parseTransactionBufferExtendInstruction,K_ as parseTransactionBufferVoteCompressedInstruction,B_ as parseTransactionBufferVoteInstruction,aU as parseTransactionExecuteCompressedInstruction,Q_ as parseTransactionExecuteInstruction,EU as parseTransactionExecuteSyncCompressedInstruction,TU as parseTransactionExecuteSyncInstruction,DO as pollJitoBundleConfirmation,ZN as prepareTransactionBundle,d2 as prepareTransactionMessage,m2 as prepareTransactionSync,MO as retrieveTransactionManager,dC as sendJitoBundle,IO as signAndSendBundledTransactions,CO as signAndSendTransaction,LN as signMessageWithPasskey,NN as signTransactionWithPasskey,kk as tokenTransferIntent,RL as uninitialize,CE as userReadOnlyOrMutateArgs,vi as vaultTransactionMessageDeserialize,Ri as vaultTransactionMessageSerialize,Ld as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|