@revibase/core 0.0.12 → 0.0.13
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 +53 -14
- package/dist/index.d.ts +53 -14
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
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,getEnumEncoder,getEnumDecoder,getU16Encoder,getU16Decoder,getBooleanEncoder,getBooleanDecoder,getU64Encoder,getU64Decoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64Encoder,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 gr 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/sha256';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/p256';import {equalBytes}from'@noble/curves/utils';import {sha256 as sha256$1}from'@noble/hashes/sha2';import {verifyAuthenticationResponse}from'@simplewebauthn/server';var Vn=new Uint8Array([201,232,212,229,59,241,106,197]);function GC(){return fixEncoderSize(getBytesEncoder(),8).encode(Vn)}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:Vn}))}function Gn(){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 FC(){return combineCodec(ru(),Gn())}function Fn(e){return decodeAccount(e,Gn())}async function zn(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 Fn(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=>Fn(t))}function KC(){return 846}var jn=new Uint8Array([42,206,176,58,175,129,130,233]);function qC(){return fixEncoderSize(getBytesEncoder(),8).encode(jn)}function fu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:jn}))}function qn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function YC(){return combineCodec(fu(),qn())}function Yn(e){return decodeAccount(e,qn())}async function ZC(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 Yn(s)}async function XC(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=>Yn(t))}function $C(){return 24}function fr(){return getStructEncoder([["memberKey",J()],["permissions",be()],["verifyArgs",getOptionEncoder(B())],["userArgs",et()],["delegateOperation",Re()]])}function Sr(){return getStructDecoder([["memberKey",j()],["permissions",_e()],["verifyArgs",getOptionDecoder(w())],["userArgs",tt()],["delegateOperation",ve()]])}function rD(){return combineCodec(fr(),Sr())}function xr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Ir(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function oD(){return combineCodec(xr(),Ir())}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 dD(){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 yD(){return combineCodec(ct(),at())}function hr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function Pr(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function TD(){return combineCodec(hr(),Pr())}function it(){return getStructEncoder([["data",getOptionEncoder(dt())]])}function q(){return getStructDecoder([["data",getOptionDecoder(ut())]])}function xD(){return combineCodec(it(),q())}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 MD(){return combineCodec(dt(),ut())}function yt(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(br())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(fr())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Ur())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function pt(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(_r())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Sr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Wr())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function RD(){return combineCodec(yt(),pt())}function vD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function bD(e,n){return n.__kind===e}function Lr(){return getStructEncoder([["member",getAddressEncoder()],["role",Ue()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Ae()]])}function Or(){return getStructDecoder([["member",getAddressDecoder()],["role",We()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",ge()]])}function LD(){return combineCodec(Lr(),Or())}var Kt=(s=>(s[s.Add=0]="Add",s[s.Remove=1]="Remove",s[s.Ignore=2]="Ignore",s))(Kt||{});function Re(){return getEnumEncoder(Kt)}function ve(){return getEnumDecoder(Kt)}function wD(){return combineCodec(Re(),ve())}function br(){return getStructEncoder([["memberKey",J()],["permissions",be()],["userArgs",getOptionEncoder(ye())],["delegateOperation",Re()]])}function _r(){return getStructDecoder([["memberKey",j()],["permissions",_e()],["userArgs",getOptionDecoder(pe())],["delegateOperation",ve()]])}function VD(){return combineCodec(br(),_r())}function mt(){return getStructEncoder([["memberKey",J()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function Tt(){return getStructDecoder([["memberKey",j()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function KD(){return combineCodec(mt(),Tt())}function Br(){return getStructEncoder([["settingsMutArgs",fe()],["transactionManager",getOptionEncoder(ye())]])}function wr(){return getStructDecoder([["settingsMutArgs",Se()],["transactionManager",getOptionDecoder(pe())]])}function YD(){return combineCodec(Br(),wr())}function At(){return getStructEncoder([["pubkey",J()],["permissions",be()],["role",getU8Encoder()],["userAddressTreeIndex",getU8Encoder()]])}function gt(){return getStructDecoder([["pubkey",j()],["permissions",_e()],["role",getU8Decoder()],["userAddressTreeIndex",getU8Decoder()]])}function QD(){return combineCodec(At(),gt())}function J(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function j(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function rM(){return combineCodec(J(),j())}function kr(){return getStructEncoder([["authorityCreationArgs",Ae()],["compressedProofArgs",M()]])}function Nr(){return getStructDecoder([["authorityCreationArgs",ge()],["compressedProofArgs",E()]])}function cM(){return combineCodec(kr(),Nr())}function lt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function ft(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function dM(){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 gM(){return combineCodec(st(),ot())}function be(){return getStructEncoder([["mask",getU8Encoder()]])}function _e(){return getStructDecoder([["mask",getU8Decoder()]])}function mM(){return combineCodec(be(),_e())}function M(){return getStructEncoder([["proof",getOptionEncoder(hr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function E(){return getStructDecoder([["proof",getOptionDecoder(Pr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function SM(){return combineCodec(M(),E())}function Ur(){return getStructEncoder([["memberKey",J()],["userArgs",et()]])}function Wr(){return getStructDecoder([["memberKey",j()],["userArgs",tt()]])}function DM(){return combineCodec(Ur(),Wr())}function Hr(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function St(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function hM(){return combineCodec(Hr(),St())}function B(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["requestedClientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function w(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["requestedClientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function vM(){return combineCodec(B(),w())}function Y(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",B()]])}function Z(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",w()]])}function WM(){return combineCodec(Y(),Z())}function xt(){return getStructEncoder([["addressTreeInfo",lt()],["outputStateTreeIndex",getU8Encoder()]])}function It(){return getStructDecoder([["addressTreeInfo",ft()],["outputStateTreeIndex",getU8Decoder()]])}function wM(){return combineCodec(xt(),It())}function Vr(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function Gr(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function HM(){return combineCodec(Vr(),Gr())}function fe(){return getStructEncoder([["accountMeta",rt()],["data",it()]])}function Se(){return getStructDecoder([["accountMeta",nt()],["data",q()]])}function zM(){return combineCodec(fe(),Se())}function Q(){return getStructEncoder([["accountMeta",ct()],["data",it()]])}function ee(){return getStructDecoder([["accountMeta",at()],["data",q()]])}function qM(){return combineCodec(Q(),ee())}function Ct(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getOptionEncoder(getArrayEncoder(mt()))]])}function Dt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(Tt()))]])}function $M(){return combineCodec(Ct(),Dt())}function Mt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(xr())],["addressTableLookups",getArrayEncoder(Fr())]])}function Et(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Ir())],["addressTableLookups",getArrayDecoder(zr())]])}function rE(){return combineCodec(Mt(),Et())}function Fr(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function zr(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function oE(){return combineCodec(Fr(),zr())}function Le(){return getStructEncoder([["member",J()],["domainConfig",getOptionEncoder(getAddressEncoder())],["role",Ue()],["delegatedTo",getOptionEncoder(Vr())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function X(){return getStructDecoder([["member",j()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",We()],["delegatedTo",getOptionDecoder(Gr())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function dE(){return combineCodec(Le(),X())}function Ae(){return getStructEncoder([["addressTreeInfo",lt()],["outputStateTreeIndex",getU8Encoder()]])}function ge(){return getStructDecoder([["addressTreeInfo",ft()],["outputStateTreeIndex",getU8Decoder()]])}function yE(){return combineCodec(Ae(),ge())}function ye(){return getStructEncoder([["accountMeta",rt()],["data",Le()]])}function pe(){return getStructDecoder([["accountMeta",nt()],["data",X()]])}function lE(){return combineCodec(ye(),pe())}function jr(){return getStructEncoder([["accountMeta",ct()],["data",Le()]])}function qr(){return getStructDecoder([["accountMeta",at()],["data",X()]])}function IE(){return combineCodec(jr(),qr())}function et(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([jr()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([ye()])]])]])}function tt(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([qr()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([pe()])]])]])}function EE(){return combineCodec(et(),tt())}function hE(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function PE(e,n){return n.__kind===e}var Ve=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(Ve||{});function Ue(){return getEnumEncoder(Ve)}function We(){return getEnumDecoder(Ve)}function bE(){return combineCodec(Ue(),We())}var Us=new Uint8Array([223,179,163,190,177,224,67,173]);function fh(){return fixEncoderSize(getBytesEncoder(),8).encode(Us)}function Wy(){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(),7)]]),e=>({...e,discriminator:Us}))}function Ws(){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(),7)]])}function Sh(){return combineCodec(Wy(),Ws())}function Ls(e){return decodeAccount(e,Ws())}async function xh(e,n,r){let s=await Xr(e,n,r);return assertAccountExists(s),s}async function Xr(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Ls(s)}async function Ih(e,n,r){let s=await Ly(e,n,r);return assertAccountsExist(s),s}async function Ly(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ls(t))}function Ch(){return 184}var Ns=new Uint8Array([90,36,35,219,93,225,110,96]);function hh(){return fixEncoderSize(getBytesEncoder(),8).encode(Ns)}function ep(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["multiWalletSettings",getAddressEncoder()],["multiWalletBump",getU8Encoder()],["canExecute",getBooleanEncoder()],["preauthorizeExecution",getBooleanEncoder()],["validTill",getU64Encoder()],["payer",getAddressEncoder()],["bump",getU8Encoder()],["bufferIndex",getU8Encoder()],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["creator",J()],["executor",J()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(J())],["expectedSecp256r1Signers",getOptionEncoder(getArrayEncoder(mt()))],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Ns}))}function Hs(){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",j()],["executor",j()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(j())],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(Tt()))],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Ph(){return combineCodec(ep(),Hs())}function Vs(e){return decodeAccount(e,Hs())}async function Gs(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 Vs(s)}async function Rh(e,n,r){let s=await rp(e,n,r);return assertAccountsExist(s),s}async function rp(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Vs(t))}var Ks=new Uint8Array([105,23,173,2,197,255,80,87]);function _h(){return fixEncoderSize(getBytesEncoder(),8).encode(Ks)}function xp(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Ks}))}function Js(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function Uh(){return combineCodec(xp(),Js())}function js(e){return decodeAccount(e,Js())}async function qs(e,n,r){let s=await Ip(e,n,r);return assertAccountExists(s),s}async function Ip(e,n,r){let s=await fetchEncodedAccount(e,n,r);return js(s)}async function Wh(e,n,r){let s=await Cp(e,n,r);return assertAccountsExist(s),s}async function Cp(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>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 Zs(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function G(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:G(r.value),role:Ys(r.value)?upgradeRoleToSigner(s):s,...Ys(r.value)?{signer:r.value}:{}})}}function Ys(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var $s=new Uint8Array([7]);function Zh(){return fixEncoderSize(getBytesEncoder(),1).encode($s)}function on(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:$s}))}function Qs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function Xh(){return combineCodec(on(),Qs())}async function eo(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:on().encode(c),programAddress:r})}function $h(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:on().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:Qs().decode(e.data)}}var so=new Uint8Array([8]);function cP(){return fixEncoderSize(getBytesEncoder(),1).encode(so)}function cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(yt())],["compressedProofArgs",getOptionEncoder(M())]]),e=>({...e,discriminator:so}))}function oo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(pt())],["compressedProofArgs",getOptionDecoder(E())]])}function aP(){return combineCodec(cn(),oo())}async function co(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.settings.value||(t.settings.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getU128Encoder().encode(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(G(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:cn().encode(c),programAddress:r})}function iP(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:cn().encode(c),programAddress:r})}function dP(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:oo().decode(e.data)}}var uo=new Uint8Array([19]);function TP(){return fixEncoderSize(getBytesEncoder(),1).encode(uo)}function Ao(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(yt())],["settingsMut",fe()],["compressedProofArgs",M()]]),e=>({...e,discriminator:uo}))}function go(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(pt())],["settingsMut",Se()],["compressedProofArgs",E()]])}function lP(){return combineCodec(Ao(),go())}function yo(e,n){let r=n?.programAddress??u,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},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.authority),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ao().encode(c),programAddress:r})}function fP(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),authority:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:go().decode(e.data)}}var To=new Uint8Array([16]);function EP(){return fixEncoderSize(getBytesEncoder(),1).encode(To)}function lo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",fe()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:To}))}function fo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["settingsMutArgs",Se()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}function hP(){return combineCodec(lo(),fo())}function So(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:lo().encode(c),programAddress:r})}function PP(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:fo().decode(e.data)}}var Po=new Uint8Array([0]);function LP(){return fixEncoderSize(getBytesEncoder(),1).encode(Po)}function dn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",Ae()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Po}))}function Ro(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",ge()],["compressedProofArgs",E()]])}function OP(){return combineCodec(dn(),Ro())}async function vo(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:dn().encode(c),programAddress:r})}function BP(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:dn().encode(c),programAddress:r})}function wP(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:Ro().decode(e.data)}}var _o=new Uint8Array([4]);function zP(){return fixEncoderSize(getBytesEncoder(),1).encode(_o)}function An(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["member",Hr()],["role",Ue()],["userAccountCreationArgs",Ae()],["linkWalletArgs",getOptionEncoder(Br())]]),e=>({...e,discriminator:_o}))}function Uo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["member",St()],["role",We()],["userAccountCreationArgs",ge()],["linkWalletArgs",getOptionDecoder(wr())]])}function KP(){return combineCodec(An(),Uo())}async function Wo(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:An().encode(c),programAddress:r})}function JP(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:An().encode(c),programAddress:r})}function jP(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:Uo().decode(e.data)}}var Oo=new Uint8Array([3]);function QP(){return fixEncoderSize(getBytesEncoder(),1).encode(Oo)}function yn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Oo}))}function Bo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function eR(){return combineCodec(yn(),Bo())}async function wo(e,n){let r=n?.programAddress??u,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(c),i=m(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:yn().encode({}),programAddress:r})}function tR(e,n){let r=n?.programAddress??u,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(c),i=m(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:yn().encode({}),programAddress:r})}function rR(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 Ho=new Uint8Array([18]);function dR(){return fixEncoderSize(getBytesEncoder(),1).encode(Ho)}function pn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["compressedProofArgs",M()],["settingsCreation",xt()],["userMutArgs",ye()],["settingsIndex",getU128Encoder()],["delegateOperation",Re()]]),e=>({...e,discriminator:Ho}))}function Vo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["compressedProofArgs",E()],["settingsCreation",It()],["userMutArgs",pe()],["settingsIndex",getU128Decoder()],["delegateOperation",ve()]])}function uR(){return combineCodec(pn(),Vo())}async function Go(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},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},a={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 i=p(a),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),...i],data:pn().encode(c),programAddress:r})}function AR(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},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},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=p(a),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),...i],data:pn().encode(c),programAddress:r})}function gR(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s(),globalCounter:r(),whitelistedAddressTrees:r()},data:Vo().decode(e.data)}}var zo=new Uint8Array([5]);function SR(){return fixEncoderSize(getBytesEncoder(),1).encode(zo)}function Tn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayEncoder(Lr())]]),e=>({...e,discriminator:zo}))}function Ko(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["createUserArgs",getArrayDecoder(Or())]])}function xR(){return combineCodec(Tn(),Ko())}async function Jo(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Tn().encode(c),programAddress:r})}function IR(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Tn().encode(c),programAddress:r})}function CR(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:Ko().decode(e.data)}}var Yo=new Uint8Array([17]);function vR(){return fixEncoderSize(getBytesEncoder(),1).encode(Yo)}function Zo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMut",fe()],["compressedProofArgs",M()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:Yo}))}function Xo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMut",Se()],["compressedProofArgs",E()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}function bR(){return combineCodec(Zo(),Xo())}function $o(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Zo().encode(c),programAddress:r})}function _R(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Xo().decode(e.data)}}var tc=new Uint8Array([2]);function wR(){return fixEncoderSize(getBytesEncoder(),1).encode(tc)}function rc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:tc}))}function nc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function kR(){return combineCodec(rc(),nc())}function sc(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:rc().encode(c),programAddress:r})}function NR(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:nc().decode(e.data)}}var ic=new Uint8Array([1]);function JR(){return fixEncoderSize(getBytesEncoder(),1).encode(ic)}function fn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(kr())]]),e=>({...e,discriminator:ic}))}function dc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Nr())]])}function jR(){return combineCodec(fn(),dc())}async function qR(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:fn().encode(c),programAddress:r})}function uc(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:fn().encode(c),programAddress:r})}function YR(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:dc().decode(e.data)}}var yc=new Uint8Array([6]);function rv(){return fixEncoderSize(getBytesEncoder(),1).encode(yc)}function pc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",ye()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",M()]]),e=>({...e,discriminator:yc}))}function mc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",pe()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",E()]])}function nv(){return combineCodec(pc(),mc())}function Tc(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:false}},c={...e},i=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.authority),...i],data:pc().encode(c),programAddress:r})}function sv(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:mc().decode(e.data)}}var Sc=new Uint8Array([32]);function Av(){return fixEncoderSize(getBytesEncoder(),1).encode(Sc)}function xc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",dt()],["compressedProofArgs",M()],["settingsCreationArgs",xt()]]),e=>({...e,discriminator:Sc}))}function Ic(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",ut()],["compressedProofArgs",E()],["settingsCreationArgs",It()]])}function gv(){return combineCodec(xc(),Ic())}function Cc(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.authority),...i],data:xc().encode(c),programAddress:r})}function yv(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([31]);function xv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ec)}function hc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Le()],["compressedProofArgs",M()],["userCreationArgs",Ae()]]),e=>({...e,discriminator:Ec}))}function Pc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",X()],["compressedProofArgs",E()],["userCreationArgs",ge()]])}function Iv(){return combineCodec(hc(),Pc())}function Rc(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.authority),...i],data:hc().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 bc=new Uint8Array([29]);function vv(){return fixEncoderSize(getBytesEncoder(),1).encode(bc)}function Sn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:bc}))}function _c(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}function bv(){return combineCodec(Sn(),_c())}async function _v(e,n){let r=n?.programAddress??u,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},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(G(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Sn().encode(c),programAddress:r})}function Uc(e,n){let r=n?.programAddress??u,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},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Sn().encode(c),programAddress:r})}function Uv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:_c().decode(e.data)}}var Oc=new Uint8Array([27]);function Nv(){return fixEncoderSize(getBytesEncoder(),1).encode(Oc)}function Bc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Y())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Oc}))}function wc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",E()]])}function Hv(){return combineCodec(Bc(),wc())}function kc(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Bc().encode(c),programAddress:r})}function Vv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?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([30]);function qv(){return fixEncoderSize(getBytesEncoder(),1).encode(Hc)}function In(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:Hc}))}function Vc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}function Yv(){return combineCodec(In(),Vc())}async function Zv(e,n){let r=n?.programAddress??u,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},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(G(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(G(t.source.value)),getAddressEncoder().encode(G(t.tokenProgram.value)),getAddressEncoder().encode(G(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(G(t.destination.value)),getAddressEncoder().encode(G(t.tokenProgram.value)),getAddressEncoder().encode(G(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:In().encode(c),programAddress:r})}function Gc(e,n){let r=n?.programAddress??u,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},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:In().encode(c),programAddress:r})}function Xv(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:Vc().decode(e.data)}}var Jc=new Uint8Array([28]);function sb(){return fixEncoderSize(getBytesEncoder(),1).encode(Jc)}function Cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Y())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Jc}))}function jc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",E()]])}function ob(){return combineCodec(Cn(),jc())}async function cb(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceTokenAccount.value||(t.sourceTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(G(t.source.value)),getAddressEncoder().encode(G(t.tokenProgram.value)),getAddressEncoder().encode(G(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(G(t.destination.value)),getAddressEncoder().encode(G(t.tokenProgram.value)),getAddressEncoder().encode(G(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:Cn().encode(c),programAddress:r})}function qc(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:Cn().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===u?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([12]);function pb(){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 mb(){return combineCodec($c(),Qc())}function ea(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:$c().encode(c),programAddress:r})}function Tb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Qc().decode(e.data)}}var na=new Uint8Array([23]);function Db(){return fixEncoderSize(getBytesEncoder(),1).encode(na)}function sa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:na}))}function oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",E()]])}function Mb(){return combineCodec(sa(),oa())}function ca(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:sa().encode(c),programAddress:r})}function Eb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?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([9]);function Ub(){return fixEncoderSize(getBytesEncoder(),1).encode(da)}function ua(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Ct()],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:da}))}function Aa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Dt()],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Wb(){return combineCodec(ua(),Aa())}function ga(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:ua().encode(c),programAddress:r})}function Lb(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Aa().decode(e.data)}}var ma=new Uint8Array([20]);function Vb(){return fixEncoderSize(getBytesEncoder(),1).encode(ma)}function Ta(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Ct()],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ma}))}function la(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Dt()],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",E()]])}function Gb(){return combineCodec(Ta(),la())}function fa(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:Ta().encode(c),programAddress:r})}function Fb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:la().decode(e.data)}}var Ia=new Uint8Array([13]);function Zb(){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 Xb(){return combineCodec(Ca(),Da())}function Ma(e,n){let r=n?.programAddress??u,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},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ca().encode(c),programAddress:r})}function $b(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?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([24]);function o_(){return fixEncoderSize(getBytesEncoder(),1).encode(Pa)}function Ra(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Pa}))}function va(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",E()]])}function c_(){return combineCodec(Ra(),va())}function ba(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ra().encode(c),programAddress:r})}function a_(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:va().decode(e.data)}}var Wa=new Uint8Array([11]);function y_(){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 p_(){return combineCodec(La(),Oa())}function Ba(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:La().encode(c),programAddress:r})}function m_(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([22]);function I_(){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 C_(){return combineCodec(Ha(),Va())}function Ga(e,n){let r=n?.programAddress??u,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:Ha().encode(c),programAddress:r})}function D_(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([10]);function b_(){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 __(){return combineCodec(Ja(),ja())}function qa(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ja().encode(c),programAddress:r})}function U_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ja().decode(e.data)}}var Xa=new Uint8Array([21]);function N_(){return fixEncoderSize(getBytesEncoder(),1).encode(Xa)}function $a(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Xa}))}function Qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",E()]])}function H_(){return combineCodec($a(),Qa())}function ei(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:$a().encode(c),programAddress:r})}function V_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?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([14]);function j_(){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 q_(){return combineCodec(si(),oi())}function ci(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=p({}),i=m(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:si().encode({}),programAddress:r})}function Y_(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([25]);function tU(){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 rU(){return combineCodec(ui(),Ai())}function gi(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:ui().encode(c),programAddress:r})}function nU(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 mi=new Uint8Array([15]);function uU(){return fixEncoderSize(getBytesEncoder(),1).encode(mi)}function Ti(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Mt()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:mi}))}function li(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Et()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}function AU(){return combineCodec(Ti(),li())}function fi(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ti().encode(c),programAddress:r})}function gU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:li().decode(e.data)}}var Ii=new Uint8Array([26]);function SU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ii)}function Ci(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Mt()],["secp256r1VerifyArgs",getArrayEncoder(Y())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ii}))}function Di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Et()],["secp256r1VerifyArgs",getArrayDecoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",E()]])}function xU(){return combineCodec(Ci(),Di())}function Mi(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=p(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ci().encode(c),programAddress:r})}function IU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Di().decode(e.data)}}var u="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 oW(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 YS=(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.MigrateCompressedSettings=13]="MigrateCompressedSettings",l[l.MigrateCompressedUsers=14]="MigrateCompressedUsers",l[l.NativeTransferIntent=15]="NativeTransferIntent",l[l.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",l[l.TokenTransferIntent=17]="TokenTransferIntent",l[l.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",l[l.TransactionBufferClose=19]="TransactionBufferClose",l[l.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",l[l.TransactionBufferCreate=21]="TransactionBufferCreate",l[l.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",l[l.TransactionBufferExecute=23]="TransactionBufferExecute",l[l.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",l[l.TransactionBufferExtend=25]="TransactionBufferExtend",l[l.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",l[l.TransactionBufferVote=27]="TransactionBufferVote",l[l.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",l[l.TransactionExecute=29]="TransactionExecute",l[l.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",l[l.TransactionExecuteSync=31]="TransactionExecuteSync",l[l.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",l))(YS||{});function cW(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),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([18])),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([17])),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([32])),0))return 13;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([31])),0))return 14;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 15;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 16;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 17;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 18;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 19;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 20;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 21;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 22;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 23;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 24;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 25;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 26;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 27;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 28;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 29;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 30;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 31;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 32;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var XS=6e3,$S=6001,QS=6002,ex=6003,tx=6004,rx=6005,nx=6006,sx=6007,ox=6008,cx=6009,ax=6010,ix=6011,dx=6012,ux=6013,Ax=6014,gx=6015,yx=6016,px=6017,mx=6018,Tx=6019,lx=6020,fx=6021,Sx=6022,xx=6023,Ix=6024,Cx=6025,Dx=6026,Mx=6027,Ex=6028,hx=6029,Px=6030,Rx=6031,vx=6032,bx=6033,_x=6034,Ux=6035,Wx=6036,Lx=6037,Ox=6038,Bx=6039,wx=6040,kx=6041,Nx=6042,Hx=6043,Vx=6044,Gx=6045,Fx=6046,zx=6047,Kx=6048,Jx=6049,jx=6050,qx=6051,Ei;process.env.NODE_ENV!=="production"&&(Ei={[hx]:"This member is already delegated to another wallet.",[sx]:"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.",[ax]:"Duplicate public keys detected among members. Each member must have a unique key.",[cx]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[Tx]:"No members provided. A multisig wallet must contain at least one member.",[px]:"Expected a User with Administrator role for this instruction.",[ox]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[gx]:"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.",[vx]:"Not enough members with vote permission to meet the approval threshold.",[Px]:"At least one signer with execute permission is required to proceed.",[Rx]:"At least one signer with initiate permission is required to perform this action.",[Ix]:"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.",[Dx]:"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).",[xx]:"Unexpected number of accounts provided for this instruction.",[$S]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[tx]:"The extracted public key has an invalid length or encoding.",[XS]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[ex]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[Gx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[fx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[yx]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[Ax]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[Sx]:"Malformed transaction message: structure or formatting does not match the expected layout.",[Cx]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[rx]:"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.",[Mx]:"A required account is missing from the instruction context.",[Vx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[Ex]:"User mutation arguments are required when performing add or remove delegate operations.",[_x]:"No valid signer found in this transaction.",[dx]:"Only one permanent member is allowed per wallet.",[ux]:"Only one transaction manager is allowed per wallet.",[jx]:"The given origin index is not in the whitelisted origins.",[ix]:"Permanent members cannot be removed from a wallet.",[Nx]:"Writable CPI calls to protected accounts are not permitted.",[nx]:"The rpIdHash extracted from the signed message does not match the expected value.",[QS]:"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.",[lx]:"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 gW(e){return process.env.NODE_ENV!=="production"?Ei[e]:"Error message not available in production bundles."}function yW(e,n,r){return isProgramError(e,n,u,r)}var bt={Ed25519:1,Secp256r1:2};var xe={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(xe).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var En=33,ie=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!==En)throw new Error(`Invalid public key length, expected ${En} 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===En)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()}},I=class extends ie{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;requestedClientAndDeviceHash;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.requestedClientAndDeviceHash=r.requestedClientAndDeviceHash;}};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:u,staticAccounts:n.accountKeys,version:0}}featureFlags.version=VERSION.V2;var bi="revibase.com",_i="https://auth.revibase.com",Ui="https://api.revibase.com";async function Rn(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await te().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(s.instructions,c),c=>setTransactionMessageFeePayerSigner(s.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let a=Math.ceil((s.unitsConsumed??0)*1.1)||8e5;return a>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:a})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function Oi(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===AccountRole.WRITABLE||c.role===AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,a)=>c-a);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function Bi(e,n){if(e.length===0)throw new Error("Bundle is empty.");for(let c=0;c<e.length;c++){if(e[c].length>1644)throw new Error(`Transaction ${c} exceeds maximum length, ${e[c].length}. Retry again.`);console.log(`Transaction ${c} length: ${e[c].length}`);}let r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})});if(!r.ok)throw console.error(await r.json()),new Error("Failed to simulate bundle");let{result:s,error:t}=await r.json();if(!s||t)throw console.error(t??s),new Error(`Unable to simulate bundle: ${JSON.stringify(t??s)}`);if(typeof s.value.summary!="string"&&s.value.summary.failed){let{TransactionFailure:c}=s.value.summary.failed.error,[,a]=c;throw console.error(t??s),new Error(`Simulation failed: ${a}`)}return s.value.transactionResults.map(c=>c.unitsConsumed)}function H(e,n=0){let r=e instanceof I?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,requestedClientAndDeviceHash:r.requestedClientAndDeviceHash}):null,t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,a=r?.authData&&r.verifyArgs?.clientDataJson?new Uint8Array([...r.authData,...sha256(r.verifyArgs.clientDataJson)]):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function Fe(e){if(e instanceof ie)return {keyType:bt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:bt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function Li(e){return e instanceof I?e.toString():e.address.toString()}function de(e){let n=new Set,r=[];for(let s of e)n.has(Li(s))||(r.push(s),n.add(Li(s)));if(r.filter(s=>s instanceof I).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function wi({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 ki(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(i=>getBase64Decoder().decode(getTransactionEncoder().encode(i)))},a=await(await fetch(`${e}/sign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json();if("error"in a)throw new Error(a.error);return a.signatures.map(i=>({[address(r)]:getBase58Encoder().encode(i)}))}}}var ze=null,er=null,tr=null,rr=null,nr,Qt=null,vn=null,sr=null,bn=null,_n=null,Ni=null;function Ke(){if(!ze)throw new Error("Rpc is not initialized yet.");return ze}function we(){if(!er)throw new Error("Rpc is not initialized yet");return er}function te(){if(!tr)throw new Error("Rpc is not initialized yet");return tr}function Hi(){if(!rr)throw new Error("Rpc is not initialized yet.");return rr}function Vi(){if(!nr)throw new Error("Rpc is not initialized yet");return nr}async function rL(){return Qt||(Qt=await ki(vn??Ui)),Qt}function Un(){if(!sr)throw new Error("Jito Bundle Config is not set.");return sr}function he(){return bn??_i}function Gi(){return _n??bi}function or(){return Ni}function nL(){er=null,tr=null,ze=null,Qt=null,vn=null,sr=null,bn=null,_n=null,rr=null,nr=null;}function sL({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,rpId:a,additionalInfo:i}){ze=e,er=createRpc(ze,r,n);let{rpc:o,sendAndConfirmTransaction:d}=createSolanaClient({urlOrMoniker:ze});rr=d,nr=estimateComputeUnitLimitFactory({rpc:o}),tr=o,vn=t??null,sr=s??null,bn=c??null,_n=a??null,Ni=i??null;}var _=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(u.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=Ke().includes("devnet")?localTestActiveStateTreeInfos():await we().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:a,queuePubkeyIndex:i,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:a,addressQueuePubkeyIndex:i});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function cr(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await Ki(e);return s&&n?.set(e.toString(),s),s}}async function ce(e,n){let s=(await Promise.all(e.map(async t=>cr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new Error("Unable to find compressed account.");return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function v(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function ne(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,A)=>({treeInfo:n[A],root:r[A],rootIndex:s[A],address:d.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((d,A)=>({addressTreeInfo:a[A],outputStateTreeIndex:i,address:d.address,type:d.type}))}function se(e,n,r,s,t,c,a){let i=[];for(let A=0;A<n.length;A++)i.push({treeInfo:n[A],rootIndex:s[A],leafIndex:r[A],proveByIndex:t[A],hash:c[A].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((A,g)=>({data:a.decode(A.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(A.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function me(e,n,r,s,t){let c=null,a=null,i=new _;if(e){await i.addSystemAccounts();let{address:o}=await $(n,r),d=(await ce([{address:o,type:"Settings"}],t))[0];s?a={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)))}}:a=await k([d],[]);let A=i.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!A)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:A.packedTreeInfos[0]},data:q().decode(d.data?.data)};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:i}}async function k(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await we().getValidityProofV0(e,n)}catch(c){if(console.error(`Attempt ${t}, Get Validity Proof failed. ${c}`),t++,t>=r)throw new Error(`Failed to get validity proof after ${r} attempts: ${c}`);await new Promise(a=>setTimeout(a,s));}throw new Error(`Failed to get validity proof after ${r} attempts`)}async function Te(){return (await ar()).length-1}var Wn;async function ar(){if(!Wn){let{data:e}=await qs(te(),await Ji());Wn=e.whitelistedAddressTrees;}return Wn}async function Xi(e,n,r){let s=await NI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function NI(e,n,r){let{address:s}=await U(e,n),t=await cr(s,r);return t?.data?.data?X().decode(t.data.data):null}async function $i(e,n,r){let s=await HI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function HI(e,n,r){try{let{address:s}=await $(e,n),t=await cr(s,r);if(!t?.data?.data)return null;let c=q().decode(t.data.data);return c.data.__option==="None"?null:{...c.data.value,isCompressed:!0}}catch{let s=await Xr(te(),await re(e));return s.exists?{...s.data,members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function Ln(e){let n=await ar();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function bL(e){let r=(await ar()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function Ki(e){let n=await rpcRequest(we().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=Ke().includes("devnet")?localTestActiveStateTreeInfos():await we().getStateTreeInfos(),c=getStateTreeInfoByPubkey(t,s),a=r.result.value;return createCompressedAccountWithMerkleContextLegacy(createMerkleContextLegacy(c,a.hash,a.leafIndex),a.owner,bn$1(a.lamports),a.data?parseAccountData(a.data):void 0,a.address||void 0)}async function $(e,n=0){let r=await Ln(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("multi_wallet")),new Uint8Array(getU128Encoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(u)).toString(),"base58"),addressTree:new PublicKey(r)}}async function U(e,n=0){let r=await Ln(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),e instanceof ie?e.toTruncatedBuffer():new Uint8Array(getAddressEncoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(u.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:u,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function nd(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function Ji(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function sd(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof ie?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function Ie(e){let[n]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function re(e){let[n]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function od(e){let n=await re(e);return await Ie(n)}async function NL(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}var qe=null,ad=2e3,id=3e3,FI=300*1e3;async function dr({authUrl:e,additionalInfo:n,signer:r,popUp:s=null,data:t}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");return new Promise((c,a)=>{let i=new URL(e).origin,o=null,d=setInterval(()=>{s&&s.closed&&(g(),a(new Error("User closed the authentication window")));},500),A=setTimeout(()=>{y("Authentication timeout."),g(),a(new Error("Authentication timed out"));},FI);function g(){clearInterval(d),clearTimeout(A),o&&clearTimeout(o),qe&&window.removeEventListener("message",qe),s&&s.close();}if(s?s.location.replace(e):s=gd(e),!s){a(new Error("Disable your popup blocker to continue."));return}function y(...T){n?.debug&&console.debug("[Popup]",...T);}let f=T=>{let C=T.origin===i,D=T.source===s;if(!C||!D||!T.isTrusted||!s){y("Ignored message from unknown source",T);return}switch(T.data.type){case "popup-ready":y("Popup is ready, sending auth data"),s.postMessage({type:"popup-init",payload:{signer:r?.toString(),data:t,additionalInfo:n}},i),o=setTimeout(()=>{g(),a(new Error("User closed the authentication window"));},ad+id);break;case "popup-complete":y("Received completion message");try{let b=JSON.parse(T.data.payload);g(),c(b);}catch{a(new Error("Failed to parse response payload"));}break;case "popup-heartbeat":y("Received heartbeat"),o&&(clearTimeout(o),o=setTimeout(()=>{g(),a(new Error("User closed the authentication window"));},ad+id));break;case "popup-closed":y("Popup explicitly closed"),g(),a(new Error("User closed the authentication window"));break;default:y("Unknown message type",T.data.type);}};qe&&window.removeEventListener("message",qe),qe=f,window.addEventListener("message",qe);})}function ur(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ce(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),a=new Uint8Array(c);for(let i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return c}function Ar(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function zI(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 dd(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 ud(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let a=e[s]|e[s+1]<<8;if(s+=2,s+a>e.length)throw new Error("MaxLengthExceeded");let i=e.slice(s,s+a),o=t.decode(i);r.push(o),s+=a;}return r}function Ad(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 b=n&127;r+=b;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let a=e[r+1],i=r+2,o=e.slice(i,i+a),d=c[0]===0&&c.length>32?c.slice(1):c,A=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||A.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,f=BigInt("0x"+Ar(A)),C=(f>y?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),D=zI(C);return new Uint8Array([...g,...D])}function gd(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,a,i;if(s)t=n,c=r,a=0,i=0;else {let A=window.screenLeft??window.screenX,g=window.screenTop??window.screenY,y=window.innerWidth??document.documentElement.clientWidth??screen.width,f=window.innerHeight??document.documentElement.clientHeight??screen.height;t=500,c=600,i=A+(y-t)/2,a=g+(f-c)/2;}let o=[`width=${t}`,`height=${c}`,`top=${a}`,`left=${i}`,"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 sO(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Ar(n.get(-2))),y:BigInt("0x"+Ar(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function Td(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 oO(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Ce(n)),c=JSON.parse(new TextDecoder().decode(Ce(r))),a=dd(c),i=Ad(new Uint8Array(Ce(s))),o=await je({rpIdHash:t.subarray(0,32)});return new I(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Ce(r)),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},requestedClientAndDeviceHash:sha256$1(new Uint8Array([...new TextEncoder().encode(e.requestedClient),...getBase58Encoder().encode(e.deviceSignature.publicKey)])),domainConfig:o,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin})}function cO(e,n){let{authResponse:r,transactionPayload:s,slotHash:t,requestedClient:c,deviceSignature:a}=e,{response:{authenticatorData:i,clientDataJSON:o}}=r,d=new Uint8Array(Ce(i)),A=JSON.parse(new TextDecoder().decode(Ce(o))),{transactionActionType:g,transactionAddress:y,transactionMessageBytes:f}=s,T=sha256$1(new Uint8Array([...getUtf8Encoder().encode(g),...getAddressEncoder().encode(address(y)),...sha256$1(new Uint8Array(getBase64Encoder().encode(f))),...getBase58Encoder().encode(t),...sha256$1(new Uint8Array([...getUtf8Encoder().encode(c),...getBase58Encoder().encode(a.publicKey)]))]));if(!equalBytes(new Uint8Array(Ce(A.challenge)),T))throw new Error("Invalid challenge");let C=sha256$1(new Uint8Array([...d,...sha256$1(new Uint8Array(Ce(o)))]));if(!equalBytes(C,n))throw new Error("Invalid message hash")}async function aO(e,n){let{data:r}=await zn(te(),e),t=ud(new Uint8Array(r.origins),r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Error("Origin not found in domain config");return t}async function SO(e){let n=await Rn(e,true),r=await Bi(n.map(getBase64EncodedWireTransaction),Ke()),s=await Rn(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await AC(s.map(getBase64EncodedWireTransaction))}async function xO({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await te().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions([...e],c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([Vi()(c),Oi(te(),c.instructions.flatMap(d=>d.accounts??[]))]),o=Math.ceil(a*1.1);return prependTransactionMessageInstructions([...o>2e5?[getSetComputeUnitLimitInstruction({units:o})]:[],...i>0?[getSetComputeUnitPriceInstruction({microLamports:i})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await Hi()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}async function AC(e,n=10,r=1e3,s=Un()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/bundles`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})});if(a.status===429&&c<n){await new Promise(o=>setTimeout(o,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);return i.result}throw new Error("Failed to send bundle after retries.")}async function IO(e,n=30,r=3e3,s=Un()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/getBundleStatuses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});if(a.status===429&&c<n){await new Promise(d=>setTimeout(d,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);let o=i.result;if(o.value.length){let 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 CO(e,n,r,s){let t=await $i(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(A=>fd(A.pubkey)===e.toString())??{};if(!c)throw new Error("No permissions found for the current member.");let a=Me.has(c,xe.InitiateTransaction),i=Me.has(c,xe.VoteTransaction),o=Me.has(c,xe.ExecuteTransaction);if(a&&i&&o)return {};if(!i||!o)throw new Error("Signer lacks the required Vote/Execute permissions.");let d=t.members.find(A=>A.role===2);if(!d)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:address(fd(d.pubkey)),userAddressTreeIndex:d.userAddressTreeIndex}}async function DO({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await Xi(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return gC(n,c.transactionManagerUrl.value,e,s)}function gC(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=getBase64Decoder().decode(s)),r&&(c.authResponses=r);let i=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json();if("error"in i)throw new Error(i.error);return i.signatures.map(o=>({[e]:getBase58Encoder().encode(o)}))}}}function fd(e){return e.keyType===bt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}async function GO({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let{addDelegates:a,removeDelegates:i}=await pC(r),o=new _,d=null,A=null,g=[];if(a.length||i.length||t){let S=await mC({packedAccounts:o,addDelegates:a,removeDelegates:i,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:c});d=S.proof,A=S.settingsMutArgs??null,g=S.userMutArgs??[];}let{configActions:y,secp256r1VerifyInput:f}=await TC({configActionsArgs:r,packedAccounts:o,userMutArgs:g}),{remainingAccounts:T,systemOffset:C}=o.toAccountMetas(),D=v(d,C);return {instructions:t?[yo({configActions:y,payer:s,authority:createNoopSigner(await od(e)),compressedProofArgs:D,settingsMut:A,remainingAccounts:T})]:[await co({settingsIndex:e,configActions:y,payer:s,compressedProofArgs:D,remainingAccounts:T})],secp256r1VerifyInput:f}}async function pC(e){let n=[],r=[];for(let s of e)switch(s.type){case "AddMembers":{let t=s.members.map(a=>U(a.member instanceof I?a.member:a.delegateOperation===0?a.member.address:a.member,a.userAddressTreeIndex)),c=await Promise.all(t);for(let a of c)n.push({address:a.address,type:"User"});break}case "RemoveMembers":{let t=s.members.map(a=>U(a.member,a.userAddressTreeIndex)),c=await Promise.all(t);for(let a of c)r.push({address:a.address,type:"User"});break}case "EditPermissions":{let t=s.members.map(a=>a.delegateOperation===2?Promise.resolve(void 0):U(a.member,a.userAddressTreeIndex)),c=await Promise.all(t);for(let a=0;a<c.length;a++){let i=c[a],o=s.members[a];i&&(o.delegateOperation===0?n.push({address:i.address,type:"User"}):r.push({address:i.address,type:"User"}));}break}}return {addDelegates:n,removeDelegates:r}}async function mC({packedAccounts:e,addDelegates:n,removeDelegates:r,compressed:s,index:t,settingsAddressTreeIndex:c,cachedAccounts:a}){await e.addSystemAccounts();let i=[];if(s){let T=(await $(t,c)).address;i.push({address:T,type:"Settings"});}r.length&&i.push(...r),n.length&&i.push(...n);let o=i.length?await ce(i,a):[];if(!o.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let d=await k(o,[]),A=[],g=[];for(let T of o)T.type==="Settings"?A.push(T):T.type==="User"&&g.push(T);let y,f=[];if(s&&d&&(y=se(e,d.treeInfos.slice(0,1),d.leafIndices.slice(0,1),d.rootIndices.slice(0,1),d.proveByIndices.slice(0,1),A,q())[0]),g.length&&d){let T=s?1:0;f=se(e,d.treeInfos.slice(T),d.leafIndices.slice(T),d.rootIndices.slice(T),d.proveByIndices.slice(T),g,X());}return {proof:d,settingsMutArgs:y,userMutArgs:f}}async function TC({configActionsArgs:e,packedAccounts:n,userMutArgs:r}){let s=[],t=[];for(let c of e)switch(c.type){case "AddMembers":{let a=[];for(let i of c.members)if(i.member instanceof I){let o=s.length,{message:d,signature:A,publicKey:g,domainConfig:y}=H(i.member,o);d&&A&&g&&s.push({message:d,signature:A,publicKey:g}),y&&n.addPreAccounts([{address:y,role:AccountRole.READONLY}]);let f=await U(i.member,i.userAddressTreeIndex).then(T=>r.find(C=>new gr(new Uint8Array(C.accountMeta.address)).eq(T.address)));if(!f)throw new Error("Unable to find user account");a.push(xd({permissionArgs:i.permissions,index:o,userMutArgs:f,pubkey:i.member,delegateOperation:i.delegateOperation}));}else {i.delegateOperation===0&&n.addPreAccounts([{address:i.member.address,role:AccountRole.READONLY_SIGNER,signer:i.member}]);let o=i.delegateOperation===0?i.member.address:i.member,d=await U(o,i.userAddressTreeIndex).then(A=>r.find(g=>new gr(new Uint8Array(g.accountMeta.address)).eq(A.address)));if(!d)throw new Error("Unable to find user account");a.push(xd({permissionArgs:i.permissions,index:-1,userMutArgs:d,pubkey:i.member,delegateOperation:i.delegateOperation}));}t.push({__kind:c.type,fields:[a]});break}case "RemoveMembers":{let a=c.members.map(o=>U(o.member,o.userAddressTreeIndex).then(d=>{let A=r.find(g=>new gr(new Uint8Array(g.accountMeta.address)).eq(d.address));if(!A)throw new Error("Unable to find user account");return fC({pubkey:o.member,userMutArgs:A})})),i=await Promise.all(a);t.push({__kind:c.type,fields:[i]});break}case "EditPermissions":{let a=c.members.map(o=>(o.delegateOperation!==2?U(o.member,o.userAddressTreeIndex).then(d=>r.find(A=>new gr(new Uint8Array(A.accountMeta.address)).eq(d.address))):Promise.resolve(void 0)).then(d=>lC({permissionArgs:o.permissions,userMutArgs:d,pubkey:o.member,delegateOperation:o.delegateOperation}))),i=await Promise.all(a);t.push({__kind:c.type,fields:[i]});break}default:t.push({__kind:c.type,fields:[c.threshold]});}return {configActions:t,secp256r1VerifyInput:s}}function lC({pubkey:e,permissionArgs:n,userMutArgs:r,delegateOperation:s}){if(s!==2){if(!r)throw new Error("User args is missing");if(r.data.role!==0)throw new Error("Only user with member role is allowed to change delegate.")}return {memberKey:Fe(e),permissions:Dd(n),userArgs:r?some(r):none(),delegateOperation:s}}function fC({pubkey:e,userMutArgs:n}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:Fe(e),userArgs:n.data.delegatedTo.__option==="Some"?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function xd({pubkey:e,permissionArgs:n,index:r,userMutArgs:s,delegateOperation:t}){if(s.data.role===1){if(t!==0)throw new Error("Permanent members must also be delegates");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){if(n.execute||n.vote)throw new Error("Transaction Manager can only have initiate permission");if(t!==2)throw new Error("Transaction Manager cannot be a delegate.")}else if(s.data.role===3&&t!==2)throw new Error("Administrator cannot be a delegate.");return {memberKey:Fe(e),permissions:Dd(n),verifyArgs:e instanceof I&&e.verifyArgs&&r!==-1?some({truncatedClientDataJson:e.verifyArgs.truncatedClientDataJson,slotNumber:e.verifyArgs.slotNumber,signedMessageIndex:r,originIndex:e.originIndex,crossOrigin:e.crossOrigin,requestedClientAndDeviceHash:e.requestedClientAndDeviceHash}):none(),userArgs:t===0?{__kind:"Mutate",fields:[s]}:{__kind:"Read",fields:[s]},delegateOperation:t}}function Dd(e){let n=[];return e.initiate&&n.push(xe.InitiateTransaction),e.vote&&n.push(xe.VoteTransaction),e.execute&&n.push(xe.ExecuteTransaction),Me.fromPermissions(n)}var Ze=33,Xe=64,Nn=14,EC=2,hC=address("Secp256r1SigVerify1111111111111111111111111");function PC(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function RC(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function Pd(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let s=getU8Decoder().decode(e,n);n+=1;let t=[],c=RC();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=Nn;let a=[];for(let i=0;i<r;i++){let o=fixDecoderSize(getBytesDecoder(),Ze).decode(e,n);n+=Ze;let d=fixDecoderSize(getBytesDecoder(),Xe).decode(e,n);n+=Xe;let A=t[i].messageDataSize,g=fixDecoderSize(getBytesDecoder(),A).decode(e,n);n+=A,a.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function Rd(){return createEncoder({getSizeFromValue:e=>{let n=Nn*e.offsets.length,r=e.payload.reduce((s,t)=>s+Ze+Xe+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=PC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),Ze).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),Xe).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function KO(){return combineCodec(Rd(),Pd())}function F(e,n){let r=e.length,s=EC+r*Nn,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],A=s,g=A+Ze,y=g+Xe;t.push({publicKeyOffset:A,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:y,messageDataSize:d.length,messageInstructionIndex:65535}),s+=Ze+Xe+d.length;}let c=n?.programAddress??hC,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:Rd().encode(a)}}function JO(e){return {programAddress:e.programAddress,accounts:{},data:Pd().decode(e.data)}}async function rB({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new _;await c.addSystemAccounts();let a=await re(e),{address:i}=await $(e,n),o=await ce([{address:i,type:"Settings"}],t),d=await k(o,[]),A=se(c,d.treeInfos,d.leafIndices,d.rootIndices,d.proveByIndices,o.filter(x=>x.type==="Settings"),q())[0],g=de(s),y=g.filter(x=>x instanceof I),f=[],T=[];for(let x of y){let L=f.length,{domainConfig:N,verifyArgs:V,signature:W,publicKey:K,message:O}=H(x,L);O&&W&&K&&f.push({message:O,signature:W,publicKey:K}),N&&(c.addPreAccounts([{address:N,role:AccountRole.READONLY}]),V?.__option==="Some"&&T.push({domainConfigKey:N,verifyArgs:V.value}));}c.addPreAccounts(g.filter(x=>"address"in x).map(x=>({address:x.address,role:AccountRole.READONLY_SIGNER,signer:x})));let{remainingAccounts:C,systemOffset:D}=c.toAccountMetas(),b=v(d,D),S=[];return f.length>0&&S.push(F(f)),S.push(So({settings:a,settingsMutArgs:A,compressedProofArgs:b,payer:r,secp256r1VerifyArgs:T,remainingAccounts:C})),S}async function oB({admin:e,addressTree:n}){return eo({payer:e,addressTree:n,remainingAccounts:[]})}async function gB({payer:e,rpId:n,origins:r,authority:s}){let t=await je({rpId:n}),c=new _;await c.addSystemAccounts();let a=await Te(),{address:i,addressTree:o}=await U(s.address,a),d=[{address:i,tree:o,queue:o,type:"User"}],A=await k([],d),g=(await ne(c,A.treeInfos,A.roots,A.rootIndices,d))[0],{remainingAccounts:y,systemOffset:f}=c.toAccountMetas(),T=v(A,f);return await vo({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:T,payer:e,domainConfig:t,rpId:n,remainingAccounts:y})}async function CB({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new _;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await $(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await U(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await ce(a,t):[],o=await Te(),{address:d,addressTree:A}=await U(r.member,o),g=[{address:d,type:"User",tree:A,queue:A}],y=await k(i,g),f=null,T=null,C=i.filter(N=>N.type==="Settings"),D=i.filter(N=>N.type==="User");C.length&&(f=se(c,y.treeInfos.slice(0,1),y.leafIndices.slice(0,1),y.rootIndices.slice(0,1),y.proveByIndices.slice(0,1),C,q())[0]),D.length&&(T=se(c,y.treeInfos.slice(1,2),y.leafIndices.slice(1,2),y.rootIndices.slice(1,2),y.proveByIndices.slice(1,2),D,X())[0]);let b=await ne(c,y.treeInfos.slice(i.length),y.roots.slice(i.length),y.rootIndices.slice(i.length),g),{remainingAccounts:S,systemOffset:x}=c.toAccountMetas(),L=v(y,x);return await Wo({payer:n,authority:e,compressedProofArgs:L,member:St().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:f?some({settingsMutArgs:f,transactionManager:T?some(T):none()}):none(),userAccountCreationArgs:b[0],domainConfig:s,remainingAccounts:S})}async function hB({payer:e}){let n=await nd();return wo({payer:e,globalCounter:n})}async function WB({createUserArgs:e,payer:n}){let r=new _;await r.addSystemAccounts(),r.addPreAccounts(e.map(A=>({address:A.member.address,role:AccountRole.READONLY_SIGNER,signer:A.member})));let s=await Te(),t=await Promise.all(e.map(async A=>{let{address:g,addressTree:y}=await U(A.member.address,s);return {address:g,tree:y,queue:y,type:"User"}})),c=await k([],t),a=await ne(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),d=v(c,o);return await Jo({compressedProofArgs:d,payer:n,createUserArgs:e.map((A,g)=>({member:A.member.address,role:A.role,userCreationArgs:a[g],transactionManagerUrl:A.role===2?A.transactionManagerUrl:null})),remainingAccounts:i})}async function wB({admin:e,rpId:n,disable:r}){let s=await je({rpId:n});return sc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function zB({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new _;await a.addSystemAccounts();let i=await Te(),{address:o,addressTree:d}=await U(r.address,i),A=[{address:o,tree:d,queue:d,type:"User"}],g=await k([],A),y=(await ne(a,g.treeInfos,g.roots,g.rootIndices,A))[0],f=a.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:v(g,f.systemOffset),authorityCreationArgs:y};}return uc({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function ZB({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new _;await s.addSystemAccounts();let t=await ce([{address:(await U(e.address,n)).address,type:"User"}]),c=await k(t,[]),a=se(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),d=v(c,o);return Tc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:a,remainingAccounts:i})}async function nw({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new _;await t.addSystemAccounts();let{address:c,addressTree:a}=await $(r,s),i=[{address:c,tree:a,queue:a,type:"Settings"}],o=await k([],i),d=(await ne(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:A,systemOffset:g}=t.toAccountMetas(),y=v(o,g);return Cc({compressedProofArgs:y,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:A})}async function uw({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new _;await t.addSystemAccounts();let{address:c,addressTree:a}=await U(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await k([],i),d=(await ne(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:A,systemOffset:g}=t.toAccountMetas(),y=v(o,g);return Rc({compressedProofArgs:y,args:e,authority:n,userCreationArgs:d,remainingAccounts:A})}async function _w({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,delegateOperation:t,cachedAccounts:c}){let{domainConfig:a,verifyArgs:i,message:o,signature:d,publicKey:A}=H(r),g=[];o&&d&&A&&g.push({message:o,signature:d,publicKey:A});let y=new _;await y.addSystemAccounts();let f=[],T=[];T.push(...await ce([{address:(await U("address"in r?r.address:r,s)).address,type:"User"}],c));let C=await Te(),{address:D,addressTree:b}=await $(e,C);f.push({address:D,queue:b,tree:b,type:"Settings"});let S=T.length,x=await k(T,f),L=se(y,x.treeInfos.slice(0,S),x.leafIndices.slice(0,S),x.rootIndices.slice(0,S),x.proveByIndices.slice(0,S),T.filter(ae=>ae.type==="User"),X())[0],V=(await ne(y,x.treeInfos.slice(S),x.roots.slice(S),x.rootIndices.slice(S),f)).find(ae=>ae.type==="Settings")??null;a?y.addPreAccounts([{address:a,role:AccountRole.READONLY}]):"address"in r&&y.addPreAccounts([{address:r.address,role:AccountRole.READONLY_SIGNER,signer:r}]);let{remainingAccounts:W,systemOffset:K}=y.toAccountMetas(),O=v(x,K),le=[];if(!V)throw new Error("Settings creation args is missing.");return le.push(await Go({settingsIndex:e,payer:n,initialMember:r instanceof I?void 0:r,secp256r1VerifyArgs:i,domainConfig:a,userMutArgs:L,compressedProofArgs:O,settingsCreation:V,delegateOperation:t,remainingAccounts:W})),{instructions:le,secp256r1VerifyInput:g}}async function Vw({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new _;await c.addSystemAccounts();let a=await ce([{address:(await $(e,n)).address,type:"Settings"}],t),i=await k(a,[]),o=se(c,i.treeInfos,i.leafIndices,i.rootIndices,i.proveByIndices,a.filter(S=>S.type==="Settings"),q())[0],d=de(s),A=d.filter(S=>S instanceof I),g=[],y=[];for(let S of A){let x=g.length,{domainConfig:L,verifyArgs:N,signature:V,publicKey:W,message:K}=H(S,x);K&&V&&W&&g.push({message:K,signature:V,publicKey:W}),L&&(c.addPreAccounts([{address:L,role:AccountRole.READONLY}]),N?.__option==="Some"&&y.push({domainConfigKey:L,verifyArgs:N.value}));}c.addPreAccounts(d.filter(S=>"address"in S).map(S=>({address:S.address,role:AccountRole.READONLY_SIGNER,signer:S})));let{remainingAccounts:f,systemOffset:T}=c.toAccountMetas(),C=v(i,T),D=[];g.length>0&&D.push(F(g));let b=await re(e);return D.push($o({settings:b,payer:r,settingsMut:o,compressedProofArgs:C,secp256r1VerifyArgs:y,remainingAccounts:f})),D}function WC(e,n,r,s){let t=LC(e,n),c=OC(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function LC(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,a=s-t,i=r-s-c;return n>=r?false:n<a?true:n>=s?n-s<i:false}function OC(e,n){return n<e.header.numSignerAccounts}async function yr({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(i=>i.lookupTableAddress),te()):{}),a=[];a.push(...t.addressTableLookups?.map(i=>({role:AccountRole.READONLY,address:i.lookupTableAddress}))??[]);for(let[i,o]of t.staticAccounts.entries())a.push({address:o,role:WC(t,i,o,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let o=c[i.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let d of i.writableIndexes){let A=o[d];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:A,role:AccountRole.WRITABLE});}for(let d of i.readonlyIndexes){let A=o[d];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:A,role:AccountRole.READONLY});}}for(let i of s?.filter(o=>o.address!==e)??[]){let o=a.findIndex(d=>d.address===i.address);o===-1?a.push({address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}):a[o].role===AccountRole.READONLY||a[o].role===AccountRole.READONLY_SIGNER?a[o]={address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}:(a[o].role===AccountRole.WRITABLE||a[o].role===AccountRole.WRITABLE_SIGNER)&&(a[o]={address:i.address,role:AccountRole.WRITABLE_SIGNER,signer:i});}return {accountMetas:a,addressLookupTableAccounts:c,transactionMessage:t}}async function Ld({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let d=await Ie(e),{accountMetas:A,addressLookupTableAccounts:g}=await yr({transactionMessageBytes:r,walletAddress:d,additionalSigners:a,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(F(c)),y.push(o?gi({transactionBuffer:n,payer:s.address,remainingAccounts:A,settingsKey:e}):ci({transactionBuffer:n,payer:s.address,settings:e})),i&&y.push(wi({payer:s,tipAmount:i})),{instructions:y,addressLookupTableAccounts:g}}async function Od({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:d}){let A=de(s),g=await re(e),y=await Ie(g),[{accountMetas:f,addressLookupTableAccounts:T,transactionMessage:C},{settingsReadonlyArgs:D,proof:b,packedAccounts:S}]=await Promise.all([yr({transactionMessageBytes:r,walletAddress:y,additionalSigners:A.filter(O=>!(O instanceof I)),addressesByLookupTableAddress:c}),me(i,e,n,o,d)]);S.addPreAccounts(f);let x=A.filter(O=>O instanceof I),L=[];for(let O of x){let le=a.length,{domainConfig:ae,verifyArgs:Pe,signature:De,publicKey:Wt,message:Lt}=H(O,le);Lt&&De&&Wt&&a.push({message:Lt,signature:De,publicKey:Wt}),ae&&(S.addPreAccounts([{address:ae,role:AccountRole.READONLY}]),Pe?.__option==="Some"&&L.push({domainConfigKey:ae,verifyArgs:Pe.value}));}let{remainingAccounts:N,systemOffset:V}=S.toAccountMetas(),W=[];a.length>0&&W.push(F(a));let K=wC(C,f);if(i){if(!t||!D)throw new Error("Payer not found or proof args is missing.");let O=v(b,V);W.push(Mi({secp256r1VerifyArgs:L,transactionMessage:K,settingsReadonlyArgs:D,compressedProofArgs:O,payer:t,remainingAccounts:N}));}else W.push(fi({secp256r1VerifyArgs:L,settings:g,transactionMessage:K,remainingAccounts:N}));return {instructions:W,addressLookupTableAccounts:T}}function wC(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 mk({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=de(s),d=await re(e),A=await Ie(d),{settingsReadonlyArgs:g,proof:y,packedAccounts:f}=await me(i,e,n,false,t),T=[],C=[];for(let x of o)if(x instanceof I){let L=T.length,{domainConfig:N,verifyArgs:V,signature:W,publicKey:K,message:O}=H(x,L);O&&W&&K&&T.push({message:O,signature:W,publicKey:K}),N&&(f.addPreAccounts([{address:N,role:AccountRole.READONLY}]),V?.__option==="Some"&&C.push({domainConfigKey:N,verifyArgs:V.value}));}else f.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:D,systemOffset:b}=f.toAccountMetas(),S=[];if(T.length>0&&S.push(F(T)),i){if(!a||!g)throw new Error("Payer not found or proof args is missing.");let x=v(y,b);S.push(kc({amount:c,settingsReadonlyArgs:g,compressedProofArgs:x,payer:a,secp256r1VerifyArgs:C,source:A,destination:r,remainingAccounts:D}));}else S.push(Uc({amount:c,secp256r1VerifyArgs:C,source:A,destination:r,settings:d,remainingAccounts:D}));return S}async function Ek({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,compressed:d=false}){let A=de(t),g=await re(e),y=await Ie(g),[f,T]=await Promise.all([getAssociatedTokenAccountAddress(s,y,o),getAssociatedTokenAccountAddress(s,r,o)]),{settingsReadonlyArgs:C,proof:D,packedAccounts:b}=await me(d,e,n,false,c),S=[],x=[];for(let W of A)if(W instanceof I){let K=S.length,{domainConfig:O,verifyArgs:le,signature:ae,publicKey:Pe,message:De}=H(W,K);De&&ae&&Pe&&S.push({message:De,signature:ae,publicKey:Pe}),O&&(b.addPreAccounts([{address:O,role:AccountRole.READONLY}]),le?.__option==="Some"&&x.push({domainConfigKey:O,verifyArgs:le.value}));}else b.addPreAccounts([{address:W.address,role:AccountRole.READONLY_SIGNER,signer:W}]);let{remainingAccounts:L,systemOffset:N}=b.toAccountMetas(),V=[];if(S.length>0&&V.push(F(S)),d){if(!i||!C)throw new Error("Payer not found or proof args is missing.");let W=v(D,N);V.push(qc({amount:a,settingsReadonlyArgs:C,compressedProofArgs:W,payer:i,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:f,destination:r,destinationTokenAccount:T,mint:s,tokenProgram:o,remainingAccounts:L}));}else V.push(Gc({amount:a,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:f,destination:r,destinationTokenAccount:T,settings:g,mint:s,tokenProgram:o,remainingAccounts:L}));return V}async function Bk({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await Gs(te(),s),o=i.data.multiWalletSettings,{settingsReadonlyArgs:d,proof:A,packedAccounts:g}=await me(c,e,n,false,a),{remainingAccounts:y,systemOffset:f}=g.toAccountMetas(),{domainConfig:T,verifyArgs:C,message:D,signature:b,publicKey:S}=H(r),x=[];if(D&&b&&S&&x.push(F([{message:D,signature:b,publicKey:S}])),c){if(!t||!d)throw new Error("Payer not found or proof args is missing.");let L=v(A,f);x.push(ca({transactionBuffer:s,domainConfig:T,closer:r instanceof I?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:C,settingsReadonlyArgs:d,payer:t,compressedProofArgs:L,remainingAccounts:y}));}else x.push(ea({transactionBuffer:s,domainConfig:T,closer:r instanceof I?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:C,remainingAccounts:[]}));return x}function Nd({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:A}){let{domainConfig:g,verifyArgs:y,message:f,signature:T,publicKey:C}=H(n),D=[];if(f&&T&&C&&D.push(F([{message:f,signature:T,publicKey:C}])),d){let{settingsReadonlyArgs:b,compressedProofArgs:S,remainingAccounts:x}=d;D.push(fa({transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof I?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:A},settingsReadonlyArgs:b,compressedProofArgs:S,remainingAccounts:x}));}else D.push(ga({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof I?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:A},remainingAccounts:[]}));return D}function Hd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=H(e),d=[];return i&&a&&o&&d.push(F([{message:i,signature:a,publicKey:o}])),s?d.push(ba({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof I?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 I?void 0:e,remainingAccounts:[]})),d}function Vd({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 Gd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=H(n),d=[];return o&&a&&i&&d.push(F([{message:o,signature:a,publicKey:i}])),s?d.push(ei({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof I?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 I?void 0:n,remainingAccounts:[]})),d}async function I2({message:e,signer:n,popUp:r}){let s=await dr({authUrl:`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"message",payload:e},signer:n,popUp:r,additionalInfo:or()});return {...s,signer:new ie(s.signer)}}async function h2({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){let c=await dr({authUrl:`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"transaction",payload:JSON.stringify({transactionActionType:e,transactionAddress:n,transactionMessageBytes:ur(r)})},additionalInfo:or(),signer:s,popUp:t});return {...c,signer:new ie(c.signer)}}async function _2({message:e,response:n,expectedRPID:r=Gi(),expectedOrigin:s=he()}){let{verified:t}=await verifyAuthenticationResponse({response:n.authResponse,expectedChallenge:ur(new Uint8Array([...new TextEncoder().encode(n.requestedClient),...new TextEncoder().encode(e)])),expectedOrigin:s,expectedRPID:r,requireUserVerification:false,credential:{id:n.authResponse.id,publicKey:Td(n.signer.toString()),counter:0}});return t}async function F2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:d=false,additionalVoters:A=[],additionalSigners:g=[],chunkSize:y=Math.ceil(s.length/2),cachedAccounts:f}){let T=await re(n),C=Math.floor(Math.random()*255),D=await sd(T,t instanceof I?t:t.address,C),b=[],S=[];for(let z=0;z<s.length;z+=y){let Hn=s.subarray(z,z+y);b.push(Hn),S.push(sha256(Hn));}let x=sha256(new Uint8Array(s)),{settingsReadonlyArgs:L,proof:N,packedAccounts:V}=await me(d,n,r,false,f),{remainingAccounts:W,systemOffset:K}=V.toAccountMetas(),O=L?{settingsReadonlyArgs:L,compressedProofArgs:v(N,K),remainingAccounts:W,payer:e}:null,le=de([t,...c?[c]:[],...A]).filter(z=>z instanceof I).map(z=>({memberKey:Fe(z),messageHash:sha256(new Uint8Array([...z.authData,...sha256(z.verifyArgs.clientDataJson)]))})),ae=Nd({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:C,payer:e,transactionBufferAddress:D,settings:T,creator:t,preauthorizeExecution:!c,bufferExtendHashes:S,compressedArgs:O,expectedSecp256r1Signers:le}),Pe=b.map(z=>Vd({transactionMessageBytes:z,transactionBufferAddress:D,settings:T,compressed:d})),De=A.map(z=>Gd({voter:z,transactionBufferAddress:D,settings:T,compressedArgs:O})),Wt=Hd({compressedArgs:O,settings:T,executor:c,transactionBufferAddress:D}),{instructions:Lt,addressLookupTableAccounts:zd}=await Ld({compressed:d,settings:T,transactionMessageBytes:s,transactionBufferAddress:D,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),l=z=>({payer:e,instructions:z,addressesByLookupTableAddress:zd});return [l(ae),...Pe.map(z=>l([z])),...De.length?[l(De.flat())]:[],l(Wt),l(Lt)]}var Tr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=a=>{let i=s.get(a);return i===void 0&&(i={isSigner:false,isWritable:false,isInvoked:false},s.set(a,i)),i},c=t(r);c.isSigner=true,c.isWritable=true;for(let a of n){t(a.programAddress).isInvoked=false;for(let i of a.accounts??[]){let o=t(i.address);o.isSigner||=i.role===AccountRole.READONLY_SIGNER||i.role===AccountRole.WRITABLE_SIGNER,o.isWritable||=i.role===AccountRole.WRITABLE||i.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),a={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let i=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [a,i]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&a.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&!a.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,a]of this.keyMetaMap.entries())if(r(a)){let i=c,o=n.findIndex(d=>d===i);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(i),this.keyMetaMap.delete(c);}}return [s,t]}};var lr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,a)=>{s.set(c,a);});let t=c=>{let a=s.get(c);if(a===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return a};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(a=>t(a.address))??[],data:c.data}))}};function Fd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Tr.compile(r,e),c=new Array,a={writable:[],readonly:[]},i=Object.entries(s??{});for(let y of i){let f=t.extractTableLookup(y);if(f!==void 0){let{addressTableLookup:T,drainedKeys:C}=f;c.push({readonlyIndexes:T.readonlyIndexes,readableIndices:T.readonlyIndexes,writableIndexes:T.writableIndexes,writableIndices:T.writableIndexes,lookupTableAddress:address(T.lookupTableAddress)}),a.writable.push(...C.writable),a.readonly.push(...C.readonly);}}let[o,d]=t.getMessageComponents(),g=new lr(d,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function rN({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Fd({instructions:e,payer:n,recentBlockhash:u,addressesByLookupTableAddress:r});return Ri(s)}async function aN({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:d=false}){let{instructions:A,addressLookupTableAccounts:g}=await Od({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:d,cachedAccounts:i});return {payer:e,instructions:A,addressesByLookupTableAddress:g}}
|
|
2
|
-
export{$s as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,uo as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,so as CHANGE_CONFIG_DISCRIMINATOR,To as COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Po as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,_o as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Oo as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Ho as CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR,zo as CREATE_USER_ACCOUNTS_DISCRIMINATOR,Yo as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,tc as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Vn as DOMAIN_CONFIG_DISCRIMINATOR,Kt as DelegateOp,ic as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,yc as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,jn as GLOBAL_COUNTER_DISCRIMINATOR,bt as KeyType,Sc as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,Ec as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,hx as MULTI_WALLET_ERROR__ALREADY_DELEGATED,sx 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,ax as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,cx as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,Tx as MULTI_WALLET_ERROR__EMPTY_MEMBERS,px as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,ox as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,gx 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,vx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,Px as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,Rx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,Ix as MULTI_WALLET_ERROR__INVALID_ACCOUNT,qx as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,mx as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,Dx as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,Wx as MULTI_WALLET_ERROR__INVALID_BUFFER,xx as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,$S as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,tx as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,XS as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,ex as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,Gx as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,fx as MULTI_WALLET_ERROR__INVALID_THRESHOLD,yx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,Ax as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,Sx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,Cx as MULTI_WALLET_ERROR__INVALID_USER_ROLE,rx 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,Mx as MULTI_WALLET_ERROR__MISSING_ACCOUNT,Vx as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,Ex as MULTI_WALLET_ERROR__MISSING_USER_ARGS,_x as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,dx as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,ux as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,jx as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,ix as MULTI_WALLET_ERROR__PERMANENT_MEMBER,Nx as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,nx as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,QS as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,Fx as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,lx 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,u as MULTI_WALLET_PROGRAM_ADDRESS,qS as MultiWalletAccount,YS as MultiWalletInstruction,Oc as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,bc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,xe as Permission,Me as Permissions,Us as SETTINGS_DISCRIMINATOR,ie as Secp256r1Key,I 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,ma as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,da as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Ns 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,mi as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Ve as UserRole,Ks as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,oB as addWhitelistedAddressTrees,GO as changeConfig,Bk as closeTransactionBuffer,rB as compressSettingsAccount,vD as configAction,fd as convertMemberKeyToString,Td as convertPubkeyCompressedToCose,sO as convertPubkeyCoseToCompressed,gB as createDomainConfig,CB as createDomainUserAccounts,hB as createGlobalCounter,gd as createPopUp,Nd as createTransactionBuffer,gC as createTransactionManagerSigner,WB as createUserAccounts,_w as createWallet,Fn as decodeDomainConfig,Yn as decodeGlobalCounter,Ls as decodeSettings,Vs as decodeTransactionBuffer,js as decodeWhitelistedAddressTree,Vw as decompressSettingsAccount,wB as disableDomainConfig,zB as editDomainConfig,ZB as editTransactionManagerUrl,Ld as executeTransaction,Hd as executeTransactionBuffer,Od as executeTransactionSync,Vd as extendTransactionBuffer,zC as fetchAllDomainConfig,XC as fetchAllGlobalCounter,su as fetchAllMaybeDomainConfig,xu as fetchAllMaybeGlobalCounter,Ly as fetchAllMaybeSettings,rp as fetchAllMaybeTransactionBuffer,Cp as fetchAllMaybeWhitelistedAddressTree,Ih as fetchAllSettings,Rh as fetchAllTransactionBuffer,Wh as fetchAllWhitelistedAddressTree,Ki as fetchCompressedAccount,zn as fetchDomainConfig,ZC as fetchGlobalCounter,nu as fetchMaybeDomainConfig,Su as fetchMaybeGlobalCounter,Xr as fetchMaybeSettings,HI as fetchMaybeSettingsAccountData,tp as fetchMaybeTransactionBuffer,NI as fetchMaybeUserAccountData,Ip as fetchMaybeWhitelistedAddressTree,xh as fetchSettings,$i as fetchSettingsAccountData,Gs as fetchTransactionBuffer,Xi as fetchUserAccountData,qs as fetchWhitelistedAddressTree,rD as getAddMemberArgsCodec,Sr as getAddMemberArgsDecoder,fr as getAddMemberArgsEncoder,Zh as getAddWhitelistedAddressTreesDiscriminatorBytes,$h as getAddWhitelistedAddressTreesInstruction,eo as getAddWhitelistedAddressTreesInstructionAsync,Xh as getAddWhitelistedAddressTreesInstructionDataCodec,Qs as getAddWhitelistedAddressTreesInstructionDataDecoder,on as getAddWhitelistedAddressTreesInstructionDataEncoder,he as getAuthEndpoint,TP as getChangeConfigCompressedDiscriminatorBytes,yo as getChangeConfigCompressedInstruction,lP as getChangeConfigCompressedInstructionDataCodec,go as getChangeConfigCompressedInstructionDataDecoder,Ao as getChangeConfigCompressedInstructionDataEncoder,cP as getChangeConfigDiscriminatorBytes,iP as getChangeConfigInstruction,co as getChangeConfigInstructionAsync,aP as getChangeConfigInstructionDataCodec,oo as getChangeConfigInstructionDataDecoder,cn as getChangeConfigInstructionDataEncoder,oD as getCompiledInstructionCodec,Ir as getCompiledInstructionDecoder,xr as getCompiledInstructionEncoder,EP as getCompressSettingsAccountDiscriminatorBytes,So as getCompressSettingsAccountInstruction,hP as getCompressSettingsAccountInstructionDataCodec,fo as getCompressSettingsAccountInstructionDataDecoder,lo as getCompressSettingsAccountInstructionDataEncoder,dD as getCompressedAccountMetaCodec,nt as getCompressedAccountMetaDecoder,rt as getCompressedAccountMetaEncoder,yD as getCompressedAccountMetaReadOnlyCodec,at as getCompressedAccountMetaReadOnlyDecoder,ct as getCompressedAccountMetaReadOnlyEncoder,TD as getCompressedProofCodec,Pr as getCompressedProofDecoder,hr as getCompressedProofEncoder,$ as getCompressedSettingsAddressFromIndex,xD as getCompressedSettingsCodec,MD as getCompressedSettingsDataCodec,ut as getCompressedSettingsDataDecoder,dt as getCompressedSettingsDataEncoder,q as getCompressedSettingsDecoder,it as getCompressedSettingsEncoder,Vi as getComputeBudgetEstimate,RD as getConfigActionCodec,pt as getConfigActionDecoder,yt as getConfigActionEncoder,LP as getCreateDomainConfigDiscriminatorBytes,BP as getCreateDomainConfigInstruction,vo as getCreateDomainConfigInstructionAsync,OP as getCreateDomainConfigInstructionDataCodec,Ro as getCreateDomainConfigInstructionDataDecoder,dn as getCreateDomainConfigInstructionDataEncoder,zP as getCreateDomainUserAccountDiscriminatorBytes,JP as getCreateDomainUserAccountInstruction,Wo as getCreateDomainUserAccountInstructionAsync,KP as getCreateDomainUserAccountInstructionDataCodec,Uo as getCreateDomainUserAccountInstructionDataDecoder,An as getCreateDomainUserAccountInstructionDataEncoder,QP as getCreateGlobalCounterDiscriminatorBytes,tR as getCreateGlobalCounterInstruction,wo as getCreateGlobalCounterInstructionAsync,eR as getCreateGlobalCounterInstructionDataCodec,Bo as getCreateGlobalCounterInstructionDataDecoder,yn as getCreateGlobalCounterInstructionDataEncoder,dR as getCreateMultiWalletCompressedDiscriminatorBytes,AR as getCreateMultiWalletCompressedInstruction,Go as getCreateMultiWalletCompressedInstructionAsync,uR as getCreateMultiWalletCompressedInstructionDataCodec,Vo as getCreateMultiWalletCompressedInstructionDataDecoder,pn as getCreateMultiWalletCompressedInstructionDataEncoder,LD as getCreateUserAccountArgsCodec,Or as getCreateUserAccountArgsDecoder,Lr as getCreateUserAccountArgsEncoder,SR as getCreateUserAccountsDiscriminatorBytes,IR as getCreateUserAccountsInstruction,Jo as getCreateUserAccountsInstructionAsync,xR as getCreateUserAccountsInstructionDataCodec,Ko as getCreateUserAccountsInstructionDataDecoder,Tn as getCreateUserAccountsInstructionDataEncoder,vR as getDecompressSettingsAccountDiscriminatorBytes,$o as getDecompressSettingsAccountInstruction,bR as getDecompressSettingsAccountInstructionDataCodec,Xo as getDecompressSettingsAccountInstructionDataDecoder,Zo as getDecompressSettingsAccountInstructionDataEncoder,wD as getDelegateOpCodec,ve as getDelegateOpDecoder,Re as getDelegateOpEncoder,wR as getDisableDomainConfigDiscriminatorBytes,sc as getDisableDomainConfigInstruction,kR as getDisableDomainConfigInstructionDataCodec,nc as getDisableDomainConfigInstructionDataDecoder,rc as getDisableDomainConfigInstructionDataEncoder,je as getDomainConfigAddress,FC as getDomainConfigCodec,Gn as getDomainConfigDecoder,GC as getDomainConfigDiscriminatorBytes,ru as getDomainConfigEncoder,KC as getDomainConfigSize,JR as getEditDomainConfigDiscriminatorBytes,uc as getEditDomainConfigInstruction,qR as getEditDomainConfigInstructionAsync,jR as getEditDomainConfigInstructionDataCodec,dc as getEditDomainConfigInstructionDataDecoder,fn as getEditDomainConfigInstructionDataEncoder,VD as getEditMemberArgsCodec,_r as getEditMemberArgsDecoder,br as getEditMemberArgsEncoder,rv as getEditTransactionManagerUrlDiscriminatorBytes,Tc as getEditTransactionManagerUrlInstruction,nv as getEditTransactionManagerUrlInstructionDataCodec,mc as getEditTransactionManagerUrlInstructionDataDecoder,pc as getEditTransactionManagerUrlInstructionDataEncoder,KD as getExpectedSecp256r1SignersCodec,Tt as getExpectedSecp256r1SignersDecoder,mt as getExpectedSecp256r1SignersEncoder,rL as getFeePayer,or as getGlobalAdditonalInfo,nd as getGlobalCounterAddress,YC as getGlobalCounterCodec,qn as getGlobalCounterDecoder,qC as getGlobalCounterDiscriminatorBytes,fu as getGlobalCounterEncoder,$C as getGlobalCounterSize,Un as getJitoTipsConfig,NL as getLightCpiSigner,we as getLightProtocolRpc,YD as getLinkWalletArgsCodec,wr as getLinkWalletArgsDecoder,Br as getLinkWalletArgsEncoder,QD as getMemberCodec,gt as getMemberDecoder,At as getMemberEncoder,rM as getMemberKeyCodec,j as getMemberKeyDecoder,J as getMemberKeyEncoder,Av as getMigrateCompressedSettingsDiscriminatorBytes,Cc as getMigrateCompressedSettingsInstruction,gv as getMigrateCompressedSettingsInstructionDataCodec,Ic as getMigrateCompressedSettingsInstructionDataDecoder,xc as getMigrateCompressedSettingsInstructionDataEncoder,xv as getMigrateCompressedUsersDiscriminatorBytes,Rc as getMigrateCompressedUsersInstruction,Iv as getMigrateCompressedUsersInstructionDataCodec,Pc as getMigrateCompressedUsersInstructionDataDecoder,hc as getMigrateCompressedUsersInstructionDataEncoder,gW as getMultiWalletErrorMessage,Nv as getNativeTransferIntentCompressedDiscriminatorBytes,kc as getNativeTransferIntentCompressedInstruction,Hv as getNativeTransferIntentCompressedInstructionDataCodec,wc as getNativeTransferIntentCompressedInstructionDataDecoder,Bc as getNativeTransferIntentCompressedInstructionDataEncoder,vv as getNativeTransferIntentDiscriminatorBytes,Uc as getNativeTransferIntentInstruction,_v as getNativeTransferIntentInstructionAsync,bv as getNativeTransferIntentInstructionDataCodec,_c as getNativeTransferIntentInstructionDataDecoder,Sn as getNativeTransferIntentInstructionDataEncoder,cM as getNewAuthorityArgsCodec,Nr as getNewAuthorityArgsDecoder,kr as getNewAuthorityArgsEncoder,aO as getOriginIndex,dM as getPackedAddressTreeInfoCodec,ft as getPackedAddressTreeInfoDecoder,lt as getPackedAddressTreeInfoEncoder,gM as getPackedStateTreeInfoCodec,ot as getPackedStateTreeInfoDecoder,st as getPackedStateTreeInfoEncoder,mM as getPermissionsCodec,_e as getPermissionsDecoder,be as getPermissionsEncoder,SM as getProofArgsCodec,E as getProofArgsDecoder,M as getProofArgsEncoder,DM as getRemoveMemberArgsCodec,Wr as getRemoveMemberArgsDecoder,Ur as getRemoveMemberArgsEncoder,Gi as getRpId,hM as getSecp256r1PubkeyCodec,St as getSecp256r1PubkeyDecoder,Hr as getSecp256r1PubkeyEncoder,RC as getSecp256r1SignatureOffsetsDataDecoder,PC as getSecp256r1SignatureOffsetsDataEncoder,vM as getSecp256r1VerifyArgsCodec,w as getSecp256r1VerifyArgsDecoder,B as getSecp256r1VerifyArgsEncoder,WM as getSecp256r1VerifyArgsWithDomainAddressCodec,Z as getSecp256r1VerifyArgsWithDomainAddressDecoder,Y as getSecp256r1VerifyArgsWithDomainAddressEncoder,F as getSecp256r1VerifyInstruction,KO as getSecp256r1VerifyInstructionDataCodec,Pd as getSecp256r1VerifyInstructionDataDecoder,Rd as getSecp256r1VerifyInstructionDataEncoder,Hi as getSendAndConfirmTransaction,Sh as getSettingsCodec,wM as getSettingsCreationArgsCodec,It as getSettingsCreationArgsDecoder,xt as getSettingsCreationArgsEncoder,Ws as getSettingsDecoder,fh as getSettingsDiscriminatorBytes,Wy as getSettingsEncoder,re as getSettingsFromIndex,HM as getSettingsIndexWithAddressCodec,Gr as getSettingsIndexWithAddressDecoder,Vr as getSettingsIndexWithAddressEncoder,zM as getSettingsMutArgsCodec,Se as getSettingsMutArgsDecoder,fe as getSettingsMutArgsEncoder,qM as getSettingsReadonlyArgsCodec,ee as getSettingsReadonlyArgsDecoder,Q as getSettingsReadonlyArgsEncoder,Ch as getSettingsSize,oO as getSignedSecp256r1Key,DO as getSignedTransactionManager,te as getSolanaRpc,Ke as getSolanaRpcEndpoint,sb as getTokenTransferIntentCompressedDiscriminatorBytes,qc as getTokenTransferIntentCompressedInstruction,cb as getTokenTransferIntentCompressedInstructionAsync,ob as getTokenTransferIntentCompressedInstructionDataCodec,jc as getTokenTransferIntentCompressedInstructionDataDecoder,Cn as getTokenTransferIntentCompressedInstructionDataEncoder,qv as getTokenTransferIntentDiscriminatorBytes,Gc as getTokenTransferIntentInstruction,Zv as getTokenTransferIntentInstructionAsync,Yv as getTokenTransferIntentInstructionDataCodec,Vc as getTokenTransferIntentInstructionDataDecoder,In as getTokenTransferIntentInstructionDataEncoder,sd as getTransactionBufferAddress,Db as getTransactionBufferCloseCompressedDiscriminatorBytes,ca as getTransactionBufferCloseCompressedInstruction,Mb as getTransactionBufferCloseCompressedInstructionDataCodec,oa as getTransactionBufferCloseCompressedInstructionDataDecoder,sa as getTransactionBufferCloseCompressedInstructionDataEncoder,pb as getTransactionBufferCloseDiscriminatorBytes,ea as getTransactionBufferCloseInstruction,mb as getTransactionBufferCloseInstructionDataCodec,Qc as getTransactionBufferCloseInstructionDataDecoder,$c as getTransactionBufferCloseInstructionDataEncoder,Ph as getTransactionBufferCodec,$M as getTransactionBufferCreateArgsCodec,Dt as getTransactionBufferCreateArgsDecoder,Ct as getTransactionBufferCreateArgsEncoder,Vb as getTransactionBufferCreateCompressedDiscriminatorBytes,fa as getTransactionBufferCreateCompressedInstruction,Gb as getTransactionBufferCreateCompressedInstructionDataCodec,la as getTransactionBufferCreateCompressedInstructionDataDecoder,Ta as getTransactionBufferCreateCompressedInstructionDataEncoder,Ub as getTransactionBufferCreateDiscriminatorBytes,ga as getTransactionBufferCreateInstruction,Wb as getTransactionBufferCreateInstructionDataCodec,Aa as getTransactionBufferCreateInstructionDataDecoder,ua as getTransactionBufferCreateInstructionDataEncoder,Hs as getTransactionBufferDecoder,hh as getTransactionBufferDiscriminatorBytes,ep as getTransactionBufferEncoder,o_ as getTransactionBufferExecuteCompressedDiscriminatorBytes,ba as getTransactionBufferExecuteCompressedInstruction,c_ as getTransactionBufferExecuteCompressedInstructionDataCodec,va as getTransactionBufferExecuteCompressedInstructionDataDecoder,Ra as getTransactionBufferExecuteCompressedInstructionDataEncoder,Zb as getTransactionBufferExecuteDiscriminatorBytes,Ma as getTransactionBufferExecuteInstruction,Xb as getTransactionBufferExecuteInstructionDataCodec,Da as getTransactionBufferExecuteInstructionDataDecoder,Ca as getTransactionBufferExecuteInstructionDataEncoder,I_ as getTransactionBufferExtendCompressedDiscriminatorBytes,Ga as getTransactionBufferExtendCompressedInstruction,C_ as getTransactionBufferExtendCompressedInstructionDataCodec,Va as getTransactionBufferExtendCompressedInstructionDataDecoder,Ha as getTransactionBufferExtendCompressedInstructionDataEncoder,y_ as getTransactionBufferExtendDiscriminatorBytes,Ba as getTransactionBufferExtendInstruction,p_ as getTransactionBufferExtendInstructionDataCodec,Oa as getTransactionBufferExtendInstructionDataDecoder,La as getTransactionBufferExtendInstructionDataEncoder,N_ as getTransactionBufferVoteCompressedDiscriminatorBytes,ei as getTransactionBufferVoteCompressedInstruction,H_ as getTransactionBufferVoteCompressedInstructionDataCodec,Qa as getTransactionBufferVoteCompressedInstructionDataDecoder,$a as getTransactionBufferVoteCompressedInstructionDataEncoder,b_ as getTransactionBufferVoteDiscriminatorBytes,qa as getTransactionBufferVoteInstruction,__ as getTransactionBufferVoteInstructionDataCodec,ja as getTransactionBufferVoteInstructionDataDecoder,Ja as getTransactionBufferVoteInstructionDataEncoder,tU as getTransactionExecuteCompressedDiscriminatorBytes,gi as getTransactionExecuteCompressedInstruction,rU as getTransactionExecuteCompressedInstructionDataCodec,Ai as getTransactionExecuteCompressedInstructionDataDecoder,ui as getTransactionExecuteCompressedInstructionDataEncoder,j_ as getTransactionExecuteDiscriminatorBytes,ci as getTransactionExecuteInstruction,q_ as getTransactionExecuteInstructionDataCodec,oi as getTransactionExecuteInstructionDataDecoder,si as getTransactionExecuteInstructionDataEncoder,SU as getTransactionExecuteSyncCompressedDiscriminatorBytes,Mi as getTransactionExecuteSyncCompressedInstruction,xU as getTransactionExecuteSyncCompressedInstructionDataCodec,Di as getTransactionExecuteSyncCompressedInstructionDataDecoder,Ci as getTransactionExecuteSyncCompressedInstructionDataEncoder,uU as getTransactionExecuteSyncDiscriminatorBytes,fi as getTransactionExecuteSyncInstruction,AU as getTransactionExecuteSyncInstructionDataCodec,li as getTransactionExecuteSyncInstructionDataDecoder,Ti as getTransactionExecuteSyncInstructionDataEncoder,oE as getTransactionMessageAddressTableLookupCodec,zr as getTransactionMessageAddressTableLookupDecoder,Fr as getTransactionMessageAddressTableLookupEncoder,rE as getTransactionMessageCodec,Et as getTransactionMessageDecoder,Mt as getTransactionMessageEncoder,U as getUserAccountAddress,dE as getUserCodec,yE as getUserCreationArgsCodec,ge as getUserCreationArgsDecoder,Ae as getUserCreationArgsEncoder,X as getUserDecoder,Le as getUserEncoder,lE as getUserMutArgsCodec,pe as getUserMutArgsDecoder,ye as getUserMutArgsEncoder,IE as getUserReadOnlyArgsCodec,qr as getUserReadOnlyArgsDecoder,jr as getUserReadOnlyArgsEncoder,EE as getUserReadOnlyOrMutateArgsCodec,tt as getUserReadOnlyOrMutateArgsDecoder,et as getUserReadOnlyOrMutateArgsEncoder,bE as getUserRoleCodec,We as getUserRoleDecoder,Ue as getUserRoleEncoder,od as getWalletAddressFromIndex,Ie as getWalletAddressFromSettings,Uh as getWhitelistedAddressTreeCodec,Js as getWhitelistedAddressTreeDecoder,_h as getWhitelistedAddressTreeDiscriminatorBytes,xp as getWhitelistedAddressTreeEncoder,Ln as getWhitelistedAddressTreeFromIndex,bL as getWhitelistedAddressTreeIndexFromAddress,Ji as getWhitelistedAddressTreesAddress,oW as identifyMultiWalletAccount,cW as identifyMultiWalletInstruction,sL as initialize,bD as isConfigAction,yW as isMultiWalletError,PE as isUserReadOnlyOrMutateArgs,nw as migrateSettings,uw as migrateUsers,mk as nativeTransferIntent,Qh as parseAddWhitelistedAddressTreesInstruction,fP as parseChangeConfigCompressedInstruction,dP as parseChangeConfigInstruction,PP as parseCompressSettingsAccountInstruction,wP as parseCreateDomainConfigInstruction,jP as parseCreateDomainUserAccountInstruction,rR as parseCreateGlobalCounterInstruction,gR as parseCreateMultiWalletCompressedInstruction,CR as parseCreateUserAccountsInstruction,_R as parseDecompressSettingsAccountInstruction,NR as parseDisableDomainConfigInstruction,YR as parseEditDomainConfigInstruction,sv as parseEditTransactionManagerUrlInstruction,yv as parseMigrateCompressedSettingsInstruction,Cv as parseMigrateCompressedUsersInstruction,Vv as parseNativeTransferIntentCompressedInstruction,Uv as parseNativeTransferIntentInstruction,JO as parseSecp256r1VerifyInstruction,ab as parseTokenTransferIntentCompressedInstruction,Xv as parseTokenTransferIntentInstruction,Eb as parseTransactionBufferCloseCompressedInstruction,Tb as parseTransactionBufferCloseInstruction,Fb as parseTransactionBufferCreateCompressedInstruction,Lb as parseTransactionBufferCreateInstruction,a_ as parseTransactionBufferExecuteCompressedInstruction,$b as parseTransactionBufferExecuteInstruction,D_ as parseTransactionBufferExtendCompressedInstruction,m_ as parseTransactionBufferExtendInstruction,V_ as parseTransactionBufferVoteCompressedInstruction,U_ as parseTransactionBufferVoteInstruction,nU as parseTransactionExecuteCompressedInstruction,Y_ as parseTransactionExecuteInstruction,IU as parseTransactionExecuteSyncCompressedInstruction,gU as parseTransactionExecuteSyncInstruction,IO as pollJitoBundleConfirmation,F2 as prepareTransactionBundle,rN as prepareTransactionMessage,aN as prepareTransactionSync,CO as retrieveTransactionManager,AC as sendJitoBundle,SO as signAndSendBundledTransactions,xO as signAndSendTransaction,I2 as signMessageWithPasskey,h2 as signTransactionWithPasskey,Ek as tokenTransferIntent,nL as uninitialize,hE as userReadOnlyOrMutateArgs,vi as vaultTransactionMessageDeserialize,Ri as vaultTransactionMessageSerialize,_2 as verifyMessage,cO as verifyTransactionAuthResponseWithMessageHash,Gd 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,getEnumEncoder,getEnumDecoder,getU16Encoder,getU16Decoder,getBooleanEncoder,getBooleanDecoder,getU64Encoder,getU64Decoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,getBase64Encoder,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 ir from'bn.js';import {VERSION,featureFlags,createRpc,rpcRequest,versionedEndpoint,encodeBN254toBase58,jsonRpcResultAndContext,CompressedAccountResultV2,CompressedAccountResult,localTestActiveStateTreeInfos,getStateTreeInfoByPubkey,createCompressedAccountWithMerkleContextLegacy,createMerkleContextLegacy,bn,parseAccountData,deriveAddressSeedV2,createBN254,deriveAddressV2,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {SolanaJSONRPCError,PublicKey}from'@solana/web3.js';import {create,nullable}from'superstruct';import {estimateComputeUnitLimitFactory,getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTransferSolInstruction}from'gill/programs';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {p256}from'@noble/curves/nist.js';import {equalBytes}from'@noble/curves/utils.js';import {ed25519}from'@noble/curves/ed25519.js';import {verifyAuthenticationResponse}from'@simplewebauthn/server';var On=new Uint8Array([201,232,212,229,59,241,106,197]);function GC(){return fixEncoderSize(getBytesEncoder(),8).encode(On)}function Zd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["rpIdHash",fixEncoderSize(getBytesEncoder(),32)],["bump",getU8Encoder()],["isDisabled",getU8Encoder()],["rpIdLength",getU8Encoder()],["numOrigins",getU8Encoder()],["rpId",fixEncoderSize(getBytesEncoder(),255)],["origins",fixEncoderSize(getBytesEncoder(),515)]]),e=>({...e,discriminator:On}))}function Ln(){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 FC(){return combineCodec(Zd(),Ln())}function Bn(e){return decodeAccount(e,Ln())}async function wn(e,n,r){let s=await Xd(e,n,r);return assertAccountExists(s),s}async function Xd(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Bn(s)}async function zC(e,n,r){let s=await $d(e,n,r);return assertAccountsExist(s),s}async function $d(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Bn(t))}function KC(){return 846}var Hn=new Uint8Array([42,206,176,58,175,129,130,233]);function qC(){return fixEncoderSize(getBytesEncoder(),8).encode(Hn)}function gu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Hn}))}function Vn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function YC(){return combineCodec(gu(),Vn())}function Gn(e){return decodeAccount(e,Vn())}async function ZC(e,n,r){let s=await yu(e,n,r);return assertAccountExists(s),s}async function yu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Gn(s)}async function XC(e,n,r){let s=await pu(e,n,r);return assertAccountsExist(s),s}async function pu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Gn(t))}function $C(){return 24}function yr(){return getStructEncoder([["memberKey",j()],["permissions",Ue()],["verifyArgs",getOptionEncoder(B())],["userArgs",tt()],["delegateOperation",be()]])}function pr(){return getStructDecoder([["memberKey",q()],["permissions",We()],["verifyArgs",getOptionDecoder(w())],["userArgs",rt()],["delegateOperation",_e()]])}function rD(){return combineCodec(yr(),pr())}function mr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Tr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function oD(){return combineCodec(mr(),Tr())}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 dD(){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 yD(){return combineCodec(at(),it())}function Ir(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function Cr(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function TD(){return combineCodec(Ir(),Cr())}function dt(){return getStructEncoder([["data",getOptionEncoder(ut())]])}function Y(){return getStructDecoder([["data",getOptionDecoder(At())]])}function xD(){return combineCodec(dt(),Y())}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 MD(){return combineCodec(ut(),At())}function pt(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Er())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(yr())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Pr())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function mt(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(hr())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(pr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Rr())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function RD(){return combineCodec(pt(),mt())}function vD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function bD(e,n){return n.__kind===e}function vr(){return getStructEncoder([["member",getAddressEncoder()],["role",Oe()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",ge()]])}function br(){return getStructDecoder([["member",getAddressDecoder()],["role",Le()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",ye()]])}function OD(){return combineCodec(vr(),br())}var Jt=(s=>(s[s.Add=0]="Add",s[s.Remove=1]="Remove",s[s.Ignore=2]="Ignore",s))(Jt||{});function be(){return getEnumEncoder(Jt)}function _e(){return getEnumDecoder(Jt)}function wD(){return combineCodec(be(),_e())}function Er(){return getStructEncoder([["memberKey",j()],["permissions",Ue()],["userArgs",getOptionEncoder(pe())],["delegateOperation",be()]])}function hr(){return getStructDecoder([["memberKey",q()],["permissions",We()],["userArgs",getOptionDecoder(me())],["delegateOperation",_e()]])}function VD(){return combineCodec(Er(),hr())}function Tt(){return getStructEncoder([["memberKey",j()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function ft(){return getStructDecoder([["memberKey",q()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function KD(){return combineCodec(Tt(),ft())}function _r(){return getStructEncoder([["settingsMutArgs",Se()],["transactionManager",getOptionEncoder(pe())]])}function Ur(){return getStructDecoder([["settingsMutArgs",xe()],["transactionManager",getOptionDecoder(me())]])}function YD(){return combineCodec(_r(),Ur())}function gt(){return getStructEncoder([["pubkey",j()],["permissions",Ue()],["role",getU8Encoder()],["userAddressTreeIndex",getU8Encoder()]])}function yt(){return getStructDecoder([["pubkey",q()],["permissions",We()],["role",getU8Decoder()],["userAddressTreeIndex",getU8Decoder()]])}function QD(){return combineCodec(gt(),yt())}function j(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function q(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function rM(){return combineCodec(j(),q())}function Wr(){return getStructEncoder([["authorityCreationArgs",ge()],["compressedProofArgs",C()]])}function Or(){return getStructDecoder([["authorityCreationArgs",ye()],["compressedProofArgs",D()]])}function cM(){return combineCodec(Wr(),Or())}function lt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function St(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function dM(){return combineCodec(lt(),St())}function ot(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function ct(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function gM(){return combineCodec(ot(),ct())}function Ue(){return getStructEncoder([["mask",getU8Encoder()]])}function We(){return getStructDecoder([["mask",getU8Decoder()]])}function mM(){return combineCodec(Ue(),We())}function C(){return getStructEncoder([["proof",getOptionEncoder(Ir())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function D(){return getStructDecoder([["proof",getOptionDecoder(Cr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function SM(){return combineCodec(C(),D())}function Pr(){return getStructEncoder([["memberKey",j()],["userArgs",tt()]])}function Rr(){return getStructDecoder([["memberKey",q()],["userArgs",rt()]])}function DM(){return combineCodec(Pr(),Rr())}function Lr(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function xt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function hM(){return combineCodec(Lr(),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 vM(){return combineCodec(B(),w())}function Z(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",B()]])}function X(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",w()]])}function WM(){return combineCodec(Z(),X())}function It(){return getStructEncoder([["addressTreeInfo",lt()],["outputStateTreeIndex",getU8Encoder()]])}function Ct(){return getStructDecoder([["addressTreeInfo",St()],["outputStateTreeIndex",getU8Decoder()]])}function wM(){return combineCodec(It(),Ct())}function Br(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function wr(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function HM(){return combineCodec(Br(),wr())}function Se(){return getStructEncoder([["accountMeta",nt()],["data",dt()]])}function xe(){return getStructDecoder([["accountMeta",st()],["data",Y()]])}function zM(){return combineCodec(Se(),xe())}function ee(){return getStructEncoder([["accountMeta",at()],["data",dt()]])}function te(){return getStructDecoder([["accountMeta",it()],["data",Y()]])}function qM(){return combineCodec(ee(),te())}function Dt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getOptionEncoder(getArrayEncoder(Tt()))]])}function Mt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(ft()))]])}function $M(){return combineCodec(Dt(),Mt())}function Et(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(mr())],["addressTableLookups",getArrayEncoder(kr())]])}function ht(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Tr())],["addressTableLookups",getArrayDecoder(Nr())]])}function rE(){return combineCodec(Et(),ht())}function kr(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Nr(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function oE(){return combineCodec(kr(),Nr())}function Be(){return getStructEncoder([["member",j()],["domainConfig",getOptionEncoder(getAddressEncoder())],["role",Oe()],["delegatedTo",getOptionEncoder(Br())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function $(){return getStructDecoder([["member",q()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",Le()],["delegatedTo",getOptionDecoder(wr())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function dE(){return combineCodec(Be(),$())}function ge(){return getStructEncoder([["addressTreeInfo",lt()],["outputStateTreeIndex",getU8Encoder()]])}function ye(){return getStructDecoder([["addressTreeInfo",St()],["outputStateTreeIndex",getU8Decoder()]])}function yE(){return combineCodec(ge(),ye())}function pe(){return getStructEncoder([["accountMeta",nt()],["data",Be()]])}function me(){return getStructDecoder([["accountMeta",st()],["data",$()]])}function fE(){return combineCodec(pe(),me())}function Gr(){return getStructEncoder([["accountMeta",at()],["data",Be()]])}function Fr(){return getStructDecoder([["accountMeta",it()],["data",$()]])}function IE(){return combineCodec(Gr(),Fr())}function tt(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Gr()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([pe()])]])]])}function rt(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Fr()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([me()])]])]])}function EE(){return combineCodec(tt(),rt())}function hE(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function PE(e,n){return n.__kind===e}var Fe=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(Fe||{});function Oe(){return getEnumEncoder(Fe)}function Le(){return getEnumDecoder(Fe)}function bE(){return combineCodec(Oe(),Le())}var Es=new Uint8Array([223,179,163,190,177,224,67,173]);function lh(){return fixEncoderSize(getBytesEncoder(),8).encode(Es)}function Py(){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(),7)]]),e=>({...e,discriminator:Es}))}function hs(){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(),7)]])}function Sh(){return combineCodec(Py(),hs())}function Ps(e){return decodeAccount(e,hs())}async function xh(e,n,r){let s=await Jr(e,n,r);return assertAccountExists(s),s}async function Jr(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Ps(s)}async function Ih(e,n,r){let s=await Ry(e,n,r);return assertAccountsExist(s),s}async function Ry(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ps(t))}function Ch(){return 184}var Us=new Uint8Array([90,36,35,219,93,225,110,96]);function hh(){return fixEncoderSize(getBytesEncoder(),8).encode(Us)}function qy(){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",j()],["executor",j()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(j())],["expectedSecp256r1Signers",getOptionEncoder(getArrayEncoder(Tt()))],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Us}))}function Ws(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multiWalletSettings",getAddressDecoder()],["multiWalletBump",getU8Decoder()],["canExecute",getBooleanDecoder()],["preauthorizeExecution",getBooleanDecoder()],["validTill",getU64Decoder()],["payer",getAddressDecoder()],["bump",getU8Decoder()],["bufferIndex",getU8Decoder()],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["creator",q()],["executor",q()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(q())],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(ft()))],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Ph(){return combineCodec(qy(),Ws())}function Os(e){return decodeAccount(e,Ws())}async function Ls(e,n,r){let s=await Yy(e,n,r);return assertAccountExists(s),s}async function Yy(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Os(s)}async function Rh(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 ks=new Uint8Array([105,23,173,2,197,255,80,87]);function _h(){return fixEncoderSize(getBytesEncoder(),8).encode(ks)}function pp(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:ks}))}function Ns(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function Uh(){return combineCodec(pp(),Ns())}function Hs(e){return decodeAccount(e,Ns())}async function Vs(e,n,r){let s=await mp(e,n,r);return assertAccountExists(s),s}async function mp(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Hs(s)}async function Wh(e,n,r){let s=await Tp(e,n,r);return assertAccountsExist(s),s}async function Tp(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Hs(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 Fs(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function F(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:F(r.value),role:Gs(r.value)?upgradeRoleToSigner(s):s,...Gs(r.value)?{signer:r.value}:{}})}}function Gs(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Ks=new Uint8Array([7]);function Zh(){return fixEncoderSize(getBytesEncoder(),1).encode(Ks)}function en(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Ks}))}function Js(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function Xh(){return combineCodec(en(),Js())}async function js(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:en().encode(c),programAddress:r})}function $h(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:en().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 Xs=new Uint8Array([8]);function cP(){return fixEncoderSize(getBytesEncoder(),1).encode(Xs)}function tn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(pt())],["compressedProofArgs",getOptionEncoder(C())]]),e=>({...e,discriminator:Xs}))}function $s(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(mt())],["compressedProofArgs",getOptionDecoder(D())]])}function aP(){return combineCodec(tn(),$s())}async function Qs(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(Fs(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(F(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:tn().encode(c),programAddress:r})}function iP(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:tn().encode(c),programAddress:r})}function dP(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:$s().decode(e.data)}}var ro=new Uint8Array([19]);function TP(){return fixEncoderSize(getBytesEncoder(),1).encode(ro)}function no(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(pt())],["settingsMut",Se()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ro}))}function so(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(mt())],["settingsMut",xe()],["compressedProofArgs",D()]])}function fP(){return combineCodec(no(),so())}function oo(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:no().encode(c),programAddress:r})}function lP(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:so().decode(e.data)}}var io=new Uint8Array([16]);function EP(){return fixEncoderSize(getBytesEncoder(),1).encode(io)}function uo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["settingsMutArgs",Se()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:io}))}function Ao(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["settingsMutArgs",xe()],["secp256r1VerifyArgs",getArrayDecoder(X())]])}function hP(){return combineCodec(uo(),Ao())}function go(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:uo().encode(c),programAddress:r})}function PP(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:Ao().decode(e.data)}}var xo=new Uint8Array([0]);function OP(){return fixEncoderSize(getBytesEncoder(),1).encode(xo)}function nn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",ge()],["compressedProofArgs",C()]]),e=>({...e,discriminator:xo}))}function Io(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",ye()],["compressedProofArgs",D()]])}function LP(){return combineCodec(nn(),Io())}async function Co(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:nn().encode(c),programAddress:r})}function BP(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:nn().encode(c),programAddress:r})}function wP(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:Io().decode(e.data)}}var Mo=new Uint8Array([4]);function zP(){return fixEncoderSize(getBytesEncoder(),1).encode(Mo)}function on(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["member",Lr()],["role",Oe()],["userAccountCreationArgs",ge()],["linkWalletArgs",getOptionEncoder(_r())]]),e=>({...e,discriminator:Mo}))}function Eo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["member",xt()],["role",Le()],["userAccountCreationArgs",ye()],["linkWalletArgs",getOptionDecoder(Ur())]])}function KP(){return combineCodec(on(),Eo())}async function ho(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:on().encode(c),programAddress:r})}function JP(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:on().encode(c),programAddress:r})}function jP(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:Eo().decode(e.data)}}var Ro=new Uint8Array([3]);function QP(){return fixEncoderSize(getBytesEncoder(),1).encode(Ro)}function an(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Ro}))}function vo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function eR(){return combineCodec(an(),vo())}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 tR(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 rR(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:vo().decode(e.data)}}var Wo=new Uint8Array([18]);function dR(){return fixEncoderSize(getBytesEncoder(),1).encode(Wo)}function dn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["compressedProofArgs",C()],["settingsCreation",It()],["userMutArgs",pe()],["settingsIndex",getU128Encoder()],["delegateOperation",be()]]),e=>({...e,discriminator:Wo}))}function Oo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["compressedProofArgs",D()],["settingsCreation",Ct()],["userMutArgs",me()],["settingsIndex",getU128Decoder()],["delegateOperation",_e()]])}function uR(){return combineCodec(dn(),Oo())}async function Lo(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:dn().encode(c),programAddress:r})}function AR(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:dn().encode(c),programAddress:r})}function gR(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 wo=new Uint8Array([5]);function SR(){return fixEncoderSize(getBytesEncoder(),1).encode(wo)}function An(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["createUserArgs",getArrayEncoder(vr())]]),e=>({...e,discriminator:wo}))}function ko(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["createUserArgs",getArrayDecoder(br())]])}function xR(){return combineCodec(An(),ko())}async function No(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:An().encode(c),programAddress:r})}function IR(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:An().encode(c),programAddress:r})}function CR(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:ko().decode(e.data)}}var Go=new Uint8Array([17]);function vR(){return fixEncoderSize(getBytesEncoder(),1).encode(Go)}function Fo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMut",Se()],["compressedProofArgs",C()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:Go}))}function zo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMut",xe()],["compressedProofArgs",D()],["secp256r1VerifyArgs",getArrayDecoder(X())]])}function bR(){return combineCodec(Fo(),zo())}function Ko(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:Fo().encode(c),programAddress:r})}function _R(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 qo=new Uint8Array([2]);function wR(){return fixEncoderSize(getBytesEncoder(),1).encode(qo)}function Yo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:qo}))}function Zo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function kR(){return combineCodec(Yo(),Zo())}function Xo(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:Yo().encode(c),programAddress:r})}function NR(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:Zo().decode(e.data)}}var tc=new Uint8Array([1]);function JR(){return fixEncoderSize(getBytesEncoder(),1).encode(tc)}function yn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Wr())]]),e=>({...e,discriminator:tc}))}function rc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Or())]])}function jR(){return combineCodec(yn(),rc())}async function qR(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:yn().encode(c),programAddress:r})}function nc(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:yn().encode(c),programAddress:r})}function YR(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:rc().decode(e.data)}}var cc=new Uint8Array([6]);function rv(){return fixEncoderSize(getBytesEncoder(),1).encode(cc)}function ac(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",pe()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",C()]]),e=>({...e,discriminator:cc}))}function ic(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",me()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",D()]])}function nv(){return combineCodec(ac(),ic())}function dc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:false}},c={...e},a=p({args:c}),o=m(r);return Object.freeze({accounts:[o(t.authority),...a],data:ac().encode(c),programAddress:r})}function sv(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 gc=new Uint8Array([32]);function Av(){return fixEncoderSize(getBytesEncoder(),1).encode(gc)}function yc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",ut()],["compressedProofArgs",C()],["settingsCreationArgs",It()]]),e=>({...e,discriminator:gc}))}function pc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",At()],["compressedProofArgs",D()],["settingsCreationArgs",Ct()]])}function gv(){return combineCodec(yc(),pc())}function mc(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:yc().encode(c),programAddress:r})}function yv(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 lc=new Uint8Array([31]);function xv(){return fixEncoderSize(getBytesEncoder(),1).encode(lc)}function Sc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Be()],["compressedProofArgs",C()],["userCreationArgs",ge()]]),e=>({...e,discriminator:lc}))}function xc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",$()],["compressedProofArgs",D()],["userCreationArgs",ye()]])}function Iv(){return combineCodec(Sc(),xc())}function Ic(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:Sc().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:xc().decode(e.data)}}var Dc=new Uint8Array([29]);function vv(){return fixEncoderSize(getBytesEncoder(),1).encode(Dc)}function pn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:Dc}))}function Mc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(X())]])}function bv(){return combineCodec(pn(),Mc())}async function _v(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(F(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:pn().encode(c),programAddress:r})}function Ec(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:pn().encode(c),programAddress:r})}function Uv(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:Mc().decode(e.data)}}var Rc=new Uint8Array([27]);function Nv(){return fixEncoderSize(getBytesEncoder(),1).encode(Rc)}function vc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Rc}))}function bc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(X())],["settingsReadonlyArgs",te()],["compressedProofArgs",D()]])}function Hv(){return combineCodec(vc(),bc())}function _c(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 Vv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:bc().decode(e.data)}}var Wc=new Uint8Array([30]);function qv(){return fixEncoderSize(getBytesEncoder(),1).encode(Wc)}function Tn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:Wc}))}function Oc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(X())]])}function Yv(){return combineCodec(Tn(),Oc())}async function Zv(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(F(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(F(t.source.value)),getAddressEncoder().encode(F(t.tokenProgram.value)),getAddressEncoder().encode(F(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(F(t.destination.value)),getAddressEncoder().encode(F(t.tokenProgram.value)),getAddressEncoder().encode(F(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:Tn().encode(c),programAddress:r})}function Lc(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:Tn().encode(c),programAddress:r})}function Xv(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:Oc().decode(e.data)}}var Nc=new Uint8Array([28]);function sb(){return fixEncoderSize(getBytesEncoder(),1).encode(Nc)}function fn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Nc}))}function Hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(X())],["settingsReadonlyArgs",te()],["compressedProofArgs",D()]])}function ob(){return combineCodec(fn(),Hc())}async function cb(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(F(t.source.value)),getAddressEncoder().encode(F(t.tokenProgram.value)),getAddressEncoder().encode(F(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(F(t.destination.value)),getAddressEncoder().encode(F(t.tokenProgram.value)),getAddressEncoder().encode(F(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:fn().encode(c),programAddress:r})}function Vc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},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:fn().encode(c),programAddress:r})}function ab(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:Hc().decode(e.data)}}var zc=new Uint8Array([12]);function pb(){return fixEncoderSize(getBytesEncoder(),1).encode(zc)}function Kc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:zc}))}function Jc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function mb(){return combineCodec(Kc(),Jc())}function jc(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:Kc().encode(c),programAddress:r})}function Tb(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:Jc().decode(e.data)}}var Zc=new Uint8Array([23]);function Db(){return fixEncoderSize(getBytesEncoder(),1).encode(Zc)}function Xc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ee()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Zc}))}function $c(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",te()],["compressedProofArgs",D()]])}function Mb(){return combineCodec(Xc(),$c())}function Qc(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:Xc().encode(c),programAddress:r})}function Eb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:$c().decode(e.data)}}var ra=new Uint8Array([9]);function Ub(){return fixEncoderSize(getBytesEncoder(),1).encode(ra)}function na(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Dt()],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:ra}))}function sa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Mt()],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Wb(){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},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:na().encode(c),programAddress:r})}function Ob(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:sa().decode(e.data)}}var ia=new Uint8Array([20]);function Vb(){return fixEncoderSize(getBytesEncoder(),1).encode(ia)}function da(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Dt()],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ee()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ia}))}function ua(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Mt()],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",te()],["compressedProofArgs",D()]])}function Gb(){return combineCodec(da(),ua())}function Aa(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:da().encode(c),programAddress:r})}function Fb(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:ua().decode(e.data)}}var pa=new Uint8Array([13]);function Zb(){return fixEncoderSize(getBytesEncoder(),1).encode(pa)}function ma(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:pa}))}function Ta(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Xb(){return combineCodec(ma(),Ta())}function fa(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:ma().encode(c),programAddress:r})}function $b(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ta().decode(e.data)}}var xa=new Uint8Array([24]);function o_(){return fixEncoderSize(getBytesEncoder(),1).encode(xa)}function Ia(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ee()],["compressedProofArgs",C()]]),e=>({...e,discriminator:xa}))}function Ca(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",te()],["compressedProofArgs",D()]])}function c_(){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},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:Ia().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:Ca().decode(e.data)}}var ha=new Uint8Array([11]);function y_(){return fixEncoderSize(getBytesEncoder(),1).encode(ha)}function Pa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:ha}))}function Ra(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function p_(){return combineCodec(Pa(),Ra())}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:Pa().encode(c),programAddress:r})}function m_(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:Ra().decode(e.data)}}var Ua=new Uint8Array([22]);function I_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ua)}function Wa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Ua}))}function Oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function C_(){return combineCodec(Wa(),Oa())}function La(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:Wa().encode(c),programAddress:r})}function D_(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:Oa().decode(e.data)}}var ka=new Uint8Array([10]);function b_(){return fixEncoderSize(getBytesEncoder(),1).encode(ka)}function Na(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:ka}))}function Ha(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function __(){return combineCodec(Na(),Ha())}function Va(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:Na().encode(c),programAddress:r})}function U_(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:Ha().decode(e.data)}}var za=new Uint8Array([21]);function N_(){return fixEncoderSize(getBytesEncoder(),1).encode(za)}function Ka(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",ee()],["compressedProofArgs",C()]]),e=>({...e,discriminator:za}))}function Ja(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",te()],["compressedProofArgs",D()]])}function H_(){return combineCodec(Ka(),Ja())}function ja(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:Ka().encode(c),programAddress:r})}function V_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ja().decode(e.data)}}var Za=new Uint8Array([14]);function j_(){return fixEncoderSize(getBytesEncoder(),1).encode(Za)}function Xa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Za}))}function $a(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function q_(){return combineCodec(Xa(),$a())}function Qa(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:Xa().encode({}),programAddress:r})}function Y_(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:$a().decode(e.data)}}var ri=new Uint8Array([25]);function tU(){return fixEncoderSize(getBytesEncoder(),1).encode(ri)}function ni(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:ri}))}function si(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function rU(){return combineCodec(ni(),si())}function oi(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:ni().encode(c),programAddress:r})}function nU(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:si().decode(e.data)}}var ii=new Uint8Array([15]);function uU(){return fixEncoderSize(getBytesEncoder(),1).encode(ii)}function di(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Et()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:ii}))}function ui(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",ht()],["secp256r1VerifyArgs",getArrayDecoder(X())]])}function AU(){return combineCodec(di(),ui())}function Ai(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:di().encode(c),programAddress:r})}function gU(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:ui().decode(e.data)}}var pi=new Uint8Array([26]);function SU(){return fixEncoderSize(getBytesEncoder(),1).encode(pi)}function mi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Et()],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",C()]]),e=>({...e,discriminator:pi}))}function Ti(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",ht()],["secp256r1VerifyArgs",getArrayDecoder(X())],["settingsReadonlyArgs",te()],["compressedProofArgs",D()]])}function xU(){return combineCodec(mi(),Ti())}function fi(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:mi().encode(c),programAddress:r})}function IU(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:Ti().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 oW(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=(T=>(T[T.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",T[T.ChangeConfig=1]="ChangeConfig",T[T.ChangeConfigCompressed=2]="ChangeConfigCompressed",T[T.CompressSettingsAccount=3]="CompressSettingsAccount",T[T.CreateDomainConfig=4]="CreateDomainConfig",T[T.CreateDomainUserAccount=5]="CreateDomainUserAccount",T[T.CreateGlobalCounter=6]="CreateGlobalCounter",T[T.CreateMultiWalletCompressed=7]="CreateMultiWalletCompressed",T[T.CreateUserAccounts=8]="CreateUserAccounts",T[T.DecompressSettingsAccount=9]="DecompressSettingsAccount",T[T.DisableDomainConfig=10]="DisableDomainConfig",T[T.EditDomainConfig=11]="EditDomainConfig",T[T.EditTransactionManagerUrl=12]="EditTransactionManagerUrl",T[T.MigrateCompressedSettings=13]="MigrateCompressedSettings",T[T.MigrateCompressedUsers=14]="MigrateCompressedUsers",T[T.NativeTransferIntent=15]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=17]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=19]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=21]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=23]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=25]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=27]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",T[T.TransactionExecute=29]="TransactionExecute",T[T.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=31]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",T))(jS||{});function cW(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),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([18])),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([17])),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([32])),0))return 13;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([31])),0))return 14;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 15;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 16;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 17;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 18;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 19;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 20;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 21;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 22;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 23;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 24;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 25;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 26;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 27;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 28;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 29;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 30;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 31;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 32;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,px=6019,mx=6020,Tx=6021,fx=6022,lx=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,Ox=6039,Lx=6040,Bx=6041,wx=6042,kx=6043,Nx=6044,Hx=6045,Vx=6046,Gx=6047,Fx=6048,zx=6049,Kx=6050,Jx=6051,li;process.env.NODE_ENV!=="production"&&(li={[Mx]:"This member is already delegated to another wallet.",[rx]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[Gx]:"The domain configuration account is disabled. Please contact support or try again later.",[Fx]:"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.",[gx]:"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.",[ux]:"Expected a User with Transaction Manager role for this instruction.",[Ux]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[Wx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Ox]:"Declared buffer size does not match the actual serialized size.",[Px]:"Not enough members with vote permission to meet the approval threshold.",[Ex]:"At least one signer with execute permission is required to proceed.",[hx]:"At least one signer with initiate permission is required to perform this action.",[Sx]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[Jx]:"Address Tree supplied is not part of the whitelisted address trees",[yx]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[Ix]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[_x]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[lx]:"Unexpected number of accounts provided for this instruction.",[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.",[Hx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[Tx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[Ax]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[dx]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[fx]:"Malformed transaction message: structure or formatting does not match the expected layout.",[xx]:"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.",[kx]:"An input string exceeds the maximum allowed character length.",[zx]:"This member is not registered under the provided domain configuration.",[Cx]:"A required account is missing from the instruction context.",[Nx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[Dx]:"User mutation arguments are required when performing add or remove delegate operations.",[vx]:"No valid signer found in this transaction.",[ax]:"Only one permanent member is allowed per wallet.",[ix]:"Only one transaction manager is allowed per wallet.",[Kx]:"The given origin index is not in the whitelisted origins.",[cx]:"Permanent members cannot be removed from a wallet.",[wx]:"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.",[Vx]:"The specified slot number was not found in the provided slot history.",[mx]:"Too many members: a maximum of 4 members are supported.",[Lx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[Bx]:"This transaction has not yet reached the required approval threshold.",[bx]:"Only the transaction creator or rent payer may close this transaction buffer.",[Rx]:"Member is not part of the expected signers for this transaction."});function gW(e){return process.env.NODE_ENV!=="production"?li[e]:"Error message not available in production bundles."}function yW(e,n,r){return isProgramError(e,n,A,r)}var _t={Ed25519:1,Secp256r1:2};var Ie={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Ee=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 xn=33,de=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!==xn)throw new Error(`Invalid public key length, expected ${xn} 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===xn)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()}},I=class extends de{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 Yx(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function Zx(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var xi=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(Yx())],["addressTableLookups",getArrayCodec(Zx())]]);function Ii(e){return xi.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 Ci(e){let n=xi.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 Di="revibase.com",Mi="https://auth.revibase.com",Ei="https://api.revibase.com";var Ke=null,Pi=2e3,Ri=3e3,Qx=300*1e3;async function er({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"));},Qx);function u(){clearInterval(o),clearTimeout(d),a&&clearTimeout(a),Ke&&window.removeEventListener("message",Ke),r&&r.close();}if(r?r.location.replace(e):r=Ui(e),!r){c(new Error("Disable your popup blocker to continue."));return}let y=g=>{let l=g.origin===i,f=g.source===r;if(!(!l||!f||!g.isTrusted||!r))switch(g.data.type){case "popup-ready":r.postMessage({type:"popup-init",payload:{signer:n?.toString(),data:s}},i),a=setTimeout(()=>{u(),c(new Error("User closed the authentication window"));},Pi+Ri);break;case "popup-complete":try{let M=JSON.parse(g.data.payload);u(),t(M);}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"));},Pi+Ri));break;case "popup-closed":u(),c(new Error("User closed the authentication window"));break}};Ke&&window.removeEventListener("message",Ke),Ke=y,window.addEventListener("message",Ke);})}function tr(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ce(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 eI(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 bi(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 _i(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 U=n&127;r+=U;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,o=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let y=new Uint8Array(32);y.set(d,32-d.length);let g=p256.Point.CURVE().n>>1n,l=BigInt("0x"+rr(u)),M=(l>g?p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),E=eI(M);return new Uint8Array([...y,...E])}function Ui(e=`${Pe()}/loading`){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let n=window.innerWidth||screen.availWidth,r=window.innerHeight||screen.availHeight,s=n<=768,t,c,i,a;if(s)t=n,c=r,i=0,a=0;else {let u=window.screenLeft??window.screenX,y=window.screenTop??window.screenY,g=window.innerWidth??document.documentElement.clientWidth??screen.width,l=window.innerHeight??document.documentElement.clientHeight??screen.height;t=500,c=600,a=u+(g-t)/2,i=y+(l-c)/2;}let o=[`width=${t}`,`height=${c}`,`top=${i}`,`left=${a}`,"toolbar=no","location=no","status=no","menubar=no","scrollbars=yes","resizable=yes"].join(","),d=window.open(e,"_blank",o);return d&&d.focus(),d}function oO(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 Li(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 cO(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Ce(n)),c=JSON.parse(new TextDecoder().decode(Ce(r))),i=vi(c),a=_i(new Uint8Array(Ce(s))),o=await Je({rpIdHash:t.subarray(0,32)});return new I(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Ce(r)),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:sr(e.clientId,e.deviceSignature.publicKey),domainConfig:o,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function aO(e,n){let{authResponse:r,transactionPayload:s,slotHash:t,clientId:c,deviceSignature:i}=e,{response:{clientDataJSON:a}}=r,o=JSON.parse(new TextDecoder().decode(Ce(a))),{transactionActionType:d,transactionAddress:u,transactionMessageBytes:y}=s,g=sha256(new Uint8Array([...getUtf8Encoder().encode(d),...getAddressEncoder().encode(address(u)),...sha256(new Uint8Array(getBase64Encoder().encode(y))),...getBase58Encoder().encode(t),...sr(c,i.publicKey)]));if(!equalBytes(new Uint8Array(Ce(o.challenge)),g))throw new Error("Invalid challenge");let l=Wt(r);if(!equalBytes(l,n))throw new Error("Invalid message hash")}async function iO(e,n){let{data:r}=await wn(re(),e),t=bi(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 sr(e,n){return sha256(new Uint8Array([...new TextEncoder().encode(e),...getBase58Encoder().encode(n)]))}function Wt(e){return sha256(Cn(e))}function Cn(e){return new Uint8Array([...new Uint8Array(Ce(e.response.authenticatorData)),...sha256(new Uint8Array(Ce(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 re().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(s.instructions,c),c=>setTransactionMessageFeePayerSigner(s.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let 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 Ni(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 V(e,n=0){let r=e instanceof I?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 de)return {keyType:_t.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:_t.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function wi(e){return e instanceof I?e.toString():e.address.toString()}function ue(e){let n=new Set,r=[];for(let s of e)n.has(wi(s))||(r.push(s),n.add(wi(s)));if(r.filter(s=>s instanceof I).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function Hi({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 Vi(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 v={};function qe(){if(!v.solanaRpcEndpoint)throw new Error("Rpc is not initialized yet.");return v.solanaRpcEndpoint}function Ne(){if(!v.lightProtocolRpc)throw new Error("Rpc is not initialized yet");return v.lightProtocolRpc}function re(){if(!v.solanaRpc)throw new Error("Rpc is not initialized yet");return v.solanaRpc}function Gi(){if(!v.sendAndConfirm)throw new Error("Rpc is not initialized yet.");return v.sendAndConfirm}function Fi(){if(!v.computeEstimate)throw new Error("Rpc is not initialized yet");return v.computeEstimate}async function MO(){return v.feePayer||(v.feePayer=await Vi(v.apiEndpoint??Ei)),v.feePayer}function En(){if(!v.jitoTipsConfig)throw new Error("Jito Bundle Config is not set.");return v.jitoTipsConfig}function Pe(){return v.authEndpoint??Mi}function zi(){return v.rpId??Di}function Ye(){if(!v.clientSettings)throw new Error("No client settings found.");return v.clientSettings}function EO(){Object.keys(v).forEach(e=>{v[e]=void 0;});}function hO({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,rpId:i,clientSettings:a}){v.solanaRpcEndpoint=e,v.lightProtocolRpc=createRpc(e,r,n);let{rpc:o,sendAndConfirmTransaction:d}=createSolanaClient({urlOrMoniker:e});v.solanaRpc=o,v.sendAndConfirm=d,v.computeEstimate=estimateComputeUnitLimitFactory({rpc:o}),v.apiEndpoint=t??null,v.jitoTipsConfig=s??null,v.authEndpoint=c??null,v.rpId=i??null,v.clientSettings=a??null;}var _=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 or(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await ji(e);return s&&n?.set(e.toString(),s),s}}async function ae(e,n){let s=(await Promise.all(e.map(async t=>or(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 se(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 oe(e,n,r,s,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:s[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let o=e.packTreeInfos(a,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((u,y)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:o.packedTreeInfos[y],address:new Uint8Array(u.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function fe(e,n,r,s,t){let c=null,i=null,a=new _;if(e){await a.addSystemAccounts();let{address:o}=await Q(n,r),d=(await ae([{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:Y().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 cr()).length-1}var hn;async function cr(){if(!hn){let{data:e}=await Vs(re(),await qi());hn=e.whitelistedAddressTrees;}return hn}async function Qi(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 W(e,n),t=await or(s,r);return t?.data?.data?$().decode(t.data.data):null}async function ed(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 Q(e,n),t=await or(s,r);if(!t?.data?.data)return null;let c=Y().decode(t.data.data);return c.data.__option==="None"?null:{...c.data.value,isCompressed:!0}}catch{let s=await Jr(re(),await ne(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 cr();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function $O(e){let r=(await cr()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function ji(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 Q(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 W(e,n=0){let r=await Pn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),e instanceof de?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 od(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function qi(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function cd(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 de?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function De(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function ne(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function ad(e){let n=await ne(e);return await De(n)}async function aL(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function xL(e){let n=await Mn(e,true),r=await Ni(n.map(getBase64EncodedWireTransaction),qe()),s=await Mn(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await iC(s.map(getBase64EncodedWireTransaction))}async function IL({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await re().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions([...e],c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([Fi()(c),ki(re(),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 Gi()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}async function iC(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 CL(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 DL(e,n,r,s){let t=await ed(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=>ud(u.pubkey)===e.toString())??{};if(!c)throw new Error("No permissions found for the current member.");let i=Ee.has(c,Ie.InitiateTransaction),a=Ee.has(c,Ie.VoteTransaction),o=Ee.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(ud(d.pubkey)),userAddressTreeIndex:d.userAddressTreeIndex}}async function ML({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await Qi(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return dC(n,c.transactionManagerUrl.value,e,s)}function dC(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}=Ye();c.authResponses=await Promise.all(r.map(async u=>({...u,clientSignature:{clientId:o,signature:(await d("complete",getBase64Decoder().decode(Wt(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 ud(e){return e.keyType===_t.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}async function FL({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let{addDelegates:i,removeDelegates:a}=await AC(r),o=new _,d=null,u=null,y=[];if(i.length||a.length||t){let S=await gC({packedAccounts:o,addDelegates:i,removeDelegates:a,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:c});d=S.proof,u=S.settingsMutArgs??null,y=S.userMutArgs??[];}let{configActions:g,secp256r1VerifyInput:l}=await yC({configActionsArgs:r,packedAccounts:o,userMutArgs:y}),{remainingAccounts:f,systemOffset:M}=o.toAccountMetas(),E=b(d,M);return {instructions:t?[oo({configActions:g,payer:s,authority:createNoopSigner(await ad(e)),compressedProofArgs:E,settingsMut:u,remainingAccounts:f})]:[await Qs({settingsIndex:e,configActions:g,payer:s,compressedProofArgs:E,remainingAccounts:f})],secp256r1VerifyInput:l}}async function AC(e){let n=[],r=[];for(let s of e)switch(s.type){case "AddMembers":{let t=s.members.map(i=>W(i.member instanceof I?i.member:i.delegateOperation===0?i.member.address:i.member,i.userAddressTreeIndex)),c=await Promise.all(t);for(let i of c)n.push({address:i.address,type:"User"});break}case "RemoveMembers":{let t=s.members.map(i=>W(i.member,i.userAddressTreeIndex)),c=await Promise.all(t);for(let i of c)r.push({address:i.address,type:"User"});break}case "EditPermissions":{let t=s.members.map(i=>i.delegateOperation===2?Promise.resolve(void 0):W(i.member,i.userAddressTreeIndex)),c=await Promise.all(t);for(let i=0;i<c.length;i++){let a=c[i],o=s.members[i];a&&(o.delegateOperation===0?n.push({address:a.address,type:"User"}):r.push({address:a.address,type:"User"}));}break}}return {addDelegates:n,removeDelegates:r}}async function gC({packedAccounts:e,addDelegates:n,removeDelegates:r,compressed:s,index:t,settingsAddressTreeIndex:c,cachedAccounts:i}){await e.addSystemAccounts();let a=[];if(s){let f=(await Q(t,c)).address;a.push({address:f,type:"Settings"});}r.length&&a.push(...r),n.length&&a.push(...n);let o=a.length?await ae(a,i):[];if(!o.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let d=await k(o,[]),u=[],y=[];for(let f of o)f.type==="Settings"?u.push(f):f.type==="User"&&y.push(f);let g,l=[];if(s&&d&&(g=oe(e,d.treeInfos.slice(0,1),d.leafIndices.slice(0,1),d.rootIndices.slice(0,1),d.proveByIndices.slice(0,1),u,Y())[0]),y.length&&d){let f=s?1:0;l=oe(e,d.treeInfos.slice(f),d.leafIndices.slice(f),d.rootIndices.slice(f),d.proveByIndices.slice(f),y,$());}return {proof:d,settingsMutArgs:g,userMutArgs:l}}async function yC({configActionsArgs:e,packedAccounts:n,userMutArgs:r}){let s=[],t=[];for(let c of e)switch(c.type){case "AddMembers":{let i=[];for(let a of c.members)if(a.member instanceof I){let o=s.length,{message:d,signature:u,publicKey:y,domainConfig:g}=V(a.member,o);d&&u&&y&&s.push({message:d,signature:u,publicKey:y}),g&&n.addPreAccounts([{address:g,role:AccountRole.READONLY}]);let l=await W(a.member,a.userAddressTreeIndex).then(f=>r.find(M=>new ir(new Uint8Array(M.accountMeta.address)).eq(f.address)));if(!l)throw new Error("Unable to find user account");i.push(gd({permissionArgs:a.permissions,index:o,userMutArgs:l,pubkey:a.member,delegateOperation:a.delegateOperation}));}else {a.delegateOperation===0&&n.addPreAccounts([{address:a.member.address,role:AccountRole.READONLY_SIGNER,signer:a.member}]);let o=a.delegateOperation===0?a.member.address:a.member,d=await W(o,a.userAddressTreeIndex).then(u=>r.find(y=>new ir(new Uint8Array(y.accountMeta.address)).eq(u.address)));if(!d)throw new Error("Unable to find user account");i.push(gd({permissionArgs:a.permissions,index:-1,userMutArgs:d,pubkey:a.member,delegateOperation:a.delegateOperation}));}t.push({__kind:c.type,fields:[i]});break}case "RemoveMembers":{let i=c.members.map(o=>W(o.member,o.userAddressTreeIndex).then(d=>{let u=r.find(y=>new ir(new Uint8Array(y.accountMeta.address)).eq(d.address));if(!u)throw new Error("Unable to find user account");return mC({pubkey:o.member,userMutArgs:u})})),a=await Promise.all(i);t.push({__kind:c.type,fields:[a]});break}case "EditPermissions":{let i=c.members.map(o=>(o.delegateOperation!==2?W(o.member,o.userAddressTreeIndex).then(d=>r.find(u=>new ir(new Uint8Array(u.accountMeta.address)).eq(d.address))):Promise.resolve(void 0)).then(d=>pC({permissionArgs:o.permissions,userMutArgs:d,pubkey:o.member,delegateOperation:o.delegateOperation}))),a=await Promise.all(i);t.push({__kind:c.type,fields:[a]});break}default:t.push({__kind:c.type,fields:[c.threshold]});}return {configActions:t,secp256r1VerifyInput:s}}function pC({pubkey:e,permissionArgs:n,userMutArgs:r,delegateOperation:s}){if(s!==2){if(!r)throw new Error("User args is missing");if(r.data.role!==0)throw new Error("Only user with member role is allowed to change delegate.")}return {memberKey:je(e),permissions:md(n),userArgs:r?some(r):none(),delegateOperation:s}}function mC({pubkey:e,userMutArgs:n}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:je(e),userArgs:n.data.delegatedTo.__option==="Some"?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function gd({pubkey:e,permissionArgs:n,index:r,userMutArgs:s,delegateOperation:t}){if(s.data.role===1){if(t!==0)throw new Error("Permanent members must also be delegates");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){if(n.execute||n.vote)throw new Error("Transaction Manager can only have initiate permission");if(t!==2)throw new Error("Transaction Manager cannot be a delegate.")}else if(s.data.role===3&&t!==2)throw new Error("Administrator cannot be a delegate.");return {memberKey:je(e),permissions:md(n),verifyArgs:e instanceof I&&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:t===0?{__kind:"Mutate",fields:[s]}:{__kind:"Read",fields:[s]},delegateOperation:t}}function md(e){let n=[];return e.initiate&&n.push(Ie.InitiateTransaction),e.vote&&n.push(Ie.VoteTransaction),e.execute&&n.push(Ie.ExecuteTransaction),Ee.fromPermissions(n)}var Xe=33,$e=64,Un=14,CC=2,DC=address("Secp256r1SigVerify1111111111111111111111111");function MC(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function EC(){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=EC();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=Un;let i=[];for(let a=0;a<r;a++){let o=fixDecoderSize(getBytesDecoder(),Xe).decode(e,n);n+=Xe;let d=fixDecoderSize(getBytesDecoder(),$e).decode(e,n);n+=$e;let u=t[a].messageDataSize,y=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:o,signature:d,message:y});}return [{numSignatures:r,padding:s,offsets:t,payload:i},n]}})}function xd(){return createEncoder({getSizeFromValue:e=>{let n=Un*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=MC();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 JL(){return combineCodec(xd(),Sd())}function z(e,n){let r=e.length,s=CC+r*Un,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,y=u+Xe,g=y+$e;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:y,signatureInstructionIndex:65535,messageDataOffset:g,messageDataSize:d.length,messageInstructionIndex:65535}),s+=Xe+$e+d.length;}let c=n?.programAddress??DC,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:xd().encode(i)}}function jL(e){return {programAddress:e.programAddress,accounts:{},data:Sd().decode(e.data)}}async function nB({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new _;await c.addSystemAccounts();let i=await ne(e),{address:a}=await Q(e,n),o=await ae([{address:a,type:"Settings"}],t),d=await k(o,[]),u=oe(c,d.treeInfos,d.leafIndices,d.rootIndices,d.proveByIndices,o.filter(x=>x.type==="Settings"),Y())[0],y=ue(s),g=y.filter(x=>x instanceof I),l=[],f=[];for(let x of g){let O=l.length,{domainConfig:L,verifyArgs:K,signature:N,publicKey:H,message:G}=V(x,O);G&&N&&H&&l.push({message:G,signature:N,publicKey:H}),L&&(c.addPreAccounts([{address:L,role:AccountRole.READONLY}]),K?.__option==="Some"&&f.push({domainConfigKey:L,verifyArgs:K.value}));}c.addPreAccounts(y.filter(x=>"address"in x).map(x=>({address:x.address,role:AccountRole.READONLY_SIGNER,signer:x})));let{remainingAccounts:M,systemOffset:E}=c.toAccountMetas(),U=b(d,E),S=[];return l.length>0&&S.push(z(l)),S.push(go({settings:i,settingsMutArgs:u,compressedProofArgs:U,payer:r,secp256r1VerifyArgs:f,remainingAccounts:M})),S}async function cB({admin:e,addressTree:n}){return js({payer:e,addressTree:n,remainingAccounts:[]})}async function yB({payer:e,rpId:n,origins:r,authority:s}){let t=await Je({rpId:n}),c=new _;await c.addSystemAccounts();let i=await le(),{address:a,addressTree:o}=await W(s.address,i),d=[{address:a,tree:o,queue:o,type:"User"}],u=await k([],d),y=(await se(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:g,systemOffset:l}=c.toAccountMetas(),f=b(u,l);return await Co({origins:r,authorityCreationArgs:y,authority:s,compressedProofArgs:f,payer:e,domainConfig:t,rpId:n,remainingAccounts:g})}async function DB({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new _;await c.addSystemAccounts();let i=[];r.index&&(i.push({address:(await Q(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&i.push({address:(await W(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let a=i.length?await ae(i,t):[],o=await le(),{address:d,addressTree:u}=await W(r.member,o),y=[{address:d,type:"User",tree:u,queue:u}],g=await k(a,y),l=null,f=null,M=a.filter(L=>L.type==="Settings"),E=a.filter(L=>L.type==="User");M.length&&(l=oe(c,g.treeInfos.slice(0,1),g.leafIndices.slice(0,1),g.rootIndices.slice(0,1),g.proveByIndices.slice(0,1),M,Y())[0]),E.length&&(f=oe(c,g.treeInfos.slice(1,2),g.leafIndices.slice(1,2),g.rootIndices.slice(1,2),g.proveByIndices.slice(1,2),E,$())[0]);let U=await se(c,g.treeInfos.slice(a.length),g.roots.slice(a.length),g.rootIndices.slice(a.length),y),{remainingAccounts:S,systemOffset:x}=c.toAccountMetas(),O=b(g,x);return await ho({payer:n,authority:e,compressedProofArgs:O,member:xt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:l?some({settingsMutArgs:l,transactionManager:f?some(f):none()}):none(),userAccountCreationArgs:U[0],domainConfig:s,remainingAccounts:S})}async function PB({payer:e}){let n=await od();return bo({payer:e,globalCounter:n})}async function OB({createUserArgs:e,payer:n}){let r=new _;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:y,addressTree:g}=await W(u.member.address,s);return {address:y,tree:g,queue:g,type:"User"}})),c=await k([],t),i=await se(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:o}=r.toAccountMetas(),d=b(c,o);return await No({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,y)=>({member:u.member.address,role:u.role,userCreationArgs:i[y],transactionManagerUrl:u.role===2?u.transactionManagerUrl:null})),remainingAccounts:a})}async function kB({admin:e,rpId:n,disable:r}){let s=await Je({rpId:n});return Xo({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function KB({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let i=new _;await i.addSystemAccounts();let a=await le(),{address:o,addressTree:d}=await W(r.address,a),u=[{address:o,tree:d,queue:d,type:"User"}],y=await k([],u),g=(await se(i,y.treeInfos,y.roots,y.rootIndices,u))[0],l=i.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:b(y,l.systemOffset),authorityCreationArgs:g};}return nc({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function XB({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new _;await s.addSystemAccounts();let t=await ae([{address:(await W(e.address,n)).address,type:"User"}]),c=await k(t,[]),i=oe(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,$())[0],{remainingAccounts:a,systemOffset:o}=s.toAccountMetas(),d=b(c,o);return dc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function sw({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new _;await t.addSystemAccounts();let{address:c,addressTree:i}=await Q(r,s),a=[{address:c,tree:i,queue:i,type:"Settings"}],o=await k([],a),d=(await se(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:y}=t.toAccountMetas(),g=b(o,y);return mc({compressedProofArgs:g,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function Aw({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new _;await t.addSystemAccounts();let{address:c,addressTree:i}=await W(r,s),a=[{address:c,tree:i,queue:i,type:"User"}],o=await k([],a),d=(await se(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:y}=t.toAccountMetas(),g=b(o,y);return Ic({compressedProofArgs:g,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}async function Uw({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,delegateOperation:t,cachedAccounts:c}){let{domainConfig:i,verifyArgs:a,message:o,signature:d,publicKey:u}=V(r),y=[];o&&d&&u&&y.push({message:o,signature:d,publicKey:u});let g=new _;await g.addSystemAccounts();let l=[],f=[];f.push(...await ae([{address:(await W("address"in r?r.address:r,s)).address,type:"User"}],c));let M=await le(),{address:E,addressTree:U}=await Q(e,M);l.push({address:E,queue:U,tree:U,type:"Settings"});let S=f.length,x=await k(f,l),O=oe(g,x.treeInfos.slice(0,S),x.leafIndices.slice(0,S),x.rootIndices.slice(0,S),x.proveByIndices.slice(0,S),f.filter(ie=>ie.type==="User"),$())[0],K=(await se(g,x.treeInfos.slice(S),x.roots.slice(S),x.rootIndices.slice(S),l)).find(ie=>ie.type==="Settings")??null;i?g.addPreAccounts([{address:i,role:AccountRole.READONLY}]):"address"in r&&g.addPreAccounts([{address:r.address,role:AccountRole.READONLY_SIGNER,signer:r}]);let{remainingAccounts:N,systemOffset:H}=g.toAccountMetas(),G=b(x,H),Te=[];if(!K)throw new Error("Settings creation args is missing.");return Te.push(await Lo({settingsIndex:e,payer:n,initialMember:r instanceof I?void 0:r,secp256r1VerifyArgs:a,domainConfig:i,userMutArgs:O,compressedProofArgs:G,settingsCreation:K,delegateOperation:t,remainingAccounts:N})),{instructions:Te,secp256r1VerifyInput:y}}async function Gw({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new _;await c.addSystemAccounts();let i=await ae([{address:(await Q(e,n)).address,type:"Settings"}],t),a=await k(i,[]),o=oe(c,a.treeInfos,a.leafIndices,a.rootIndices,a.proveByIndices,i.filter(S=>S.type==="Settings"),Y())[0],d=ue(s),u=d.filter(S=>S instanceof I),y=[],g=[];for(let S of u){let x=y.length,{domainConfig:O,verifyArgs:L,signature:K,publicKey:N,message:H}=V(S,x);H&&K&&N&&y.push({message:H,signature:K,publicKey:N}),O&&(c.addPreAccounts([{address:O,role:AccountRole.READONLY}]),L?.__option==="Some"&&g.push({domainConfigKey:O,verifyArgs:L.value}));}c.addPreAccounts(d.filter(S=>"address"in S).map(S=>({address:S.address,role:AccountRole.READONLY_SIGNER,signer:S})));let{remainingAccounts:l,systemOffset:f}=c.toAccountMetas(),M=b(a,f),E=[];y.length>0&&E.push(z(y));let U=await ne(e);return E.push(Ko({settings:U,payer:r,settingsMut:o,compressedProofArgs:M,secp256r1VerifyArgs:g,remainingAccounts:l})),E}function bC(e,n,r,s){let t=_C(e,n),c=UC(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function _C(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 UC(e,n){return n<e.header.numSignerAccounts}async function dr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Ci(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),re()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,o]of t.staticAccounts.entries())i.push({address:o,role:bC(t,a,o,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let o=c[a.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.READONLY});}}for(let a of s?.filter(o=>o.address!==e)??[]){let o=i.findIndex(d=>d.address===a.address);o===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[o].role===AccountRole.READONLY||i[o].role===AccountRole.READONLY_SIGNER?i[o]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[o].role===AccountRole.WRITABLE||i[o].role===AccountRole.WRITABLE_SIGNER)&&(i[o]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}async function hd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:o=false}){let d=await De(e),{accountMetas:u,addressLookupTableAccounts:y}=await dr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),g=[];return c.length>0&&g.push(z(c)),g.push(o?oi({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):Qa({transactionBuffer:n,payer:s.address,settings:e})),a&&g.push(Hi({payer:s,tipAmount:a})),{instructions:g,addressLookupTableAccounts:y}}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=ue(s),y=await ne(e),g=await De(y),[{accountMetas:l,addressLookupTableAccounts:f,transactionMessage:M},{settingsReadonlyArgs:E,proof:U,packedAccounts:S}]=await Promise.all([dr({transactionMessageBytes:r,walletAddress:g,additionalSigners:u.filter(G=>!(G instanceof I)),addressesByLookupTableAddress:c}),fe(a,e,n,o,d)]);S.addPreAccounts(l);let x=u.filter(G=>G instanceof I),O=[];for(let G of x){let Te=i.length,{domainConfig:ie,verifyArgs:Re,signature:Me,publicKey:ve,message:Lt}=V(G,Te);Lt&&Me&&ve&&i.push({message:Lt,signature:Me,publicKey:ve}),ie&&(S.addPreAccounts([{address:ie,role:AccountRole.READONLY}]),Re?.__option==="Some"&&O.push({domainConfigKey:ie,verifyArgs:Re.value}));}let{remainingAccounts:L,systemOffset:K}=S.toAccountMetas(),N=[];i.length>0&&N.push(z(i));let H=OC(M,l);if(a){if(!t||!E)throw new Error("Payer not found or proof args is missing.");let G=b(U,K);N.push(fi({secp256r1VerifyArgs:O,transactionMessage:H,settingsReadonlyArgs:E,compressedProofArgs:G,payer:t,remainingAccounts:L}));}else N.push(Ai({secp256r1VerifyArgs:O,settings:y,transactionMessage:H,remainingAccounts:L}));return {instructions:N,addressLookupTableAccounts:f}}function OC(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 Tk({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let o=ue(s),d=await ne(e),u=await De(d),{settingsReadonlyArgs:y,proof:g,packedAccounts:l}=await fe(a,e,n,false,t),f=[],M=[];for(let x of o)if(x instanceof I){let O=f.length,{domainConfig:L,verifyArgs:K,signature:N,publicKey:H,message:G}=V(x,O);G&&N&&H&&f.push({message:G,signature:N,publicKey:H}),L&&(l.addPreAccounts([{address:L,role:AccountRole.READONLY}]),K?.__option==="Some"&&M.push({domainConfigKey:L,verifyArgs:K.value}));}else l.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:E,systemOffset:U}=l.toAccountMetas(),S=[];if(f.length>0&&S.push(z(f)),a){if(!i||!y)throw new Error("Payer not found or proof args is missing.");let x=b(g,U);S.push(_c({amount:c,settingsReadonlyArgs:y,compressedProofArgs:x,payer:i,secp256r1VerifyArgs:M,source:u,destination:r,remainingAccounts:E}));}else S.push(Ec({amount:c,secp256r1VerifyArgs:M,source:u,destination:r,settings:d,remainingAccounts:E}));return S}async function hk({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:o,createAtaIfNeeded:d=true,compressed:u=false}){let y=ue(t),g=await ne(e),l=await De(g),[f,M]=await Promise.all([getAssociatedTokenAccountAddress(s,l,o),getAssociatedTokenAccountAddress(s,r,o)]),{settingsReadonlyArgs:E,proof:U,packedAccounts:S}=await fe(u,e,n,false,c),x=[],O=[];for(let H of y)if(H instanceof I){let G=x.length,{domainConfig:Te,verifyArgs:ie,signature:Re,publicKey:Me,message:ve}=V(H,G);ve&&Re&&Me&&x.push({message:ve,signature:Re,publicKey:Me}),Te&&(S.addPreAccounts([{address:Te,role:AccountRole.READONLY}]),ie?.__option==="Some"&&O.push({domainConfigKey:Te,verifyArgs:ie.value}));}else S.addPreAccounts([{address:H.address,role:AccountRole.READONLY_SIGNER,signer:H}]);let{remainingAccounts:L,systemOffset:K}=S.toAccountMetas(),N=[];if(x.length>0&&N.push(z(x)),u){if(!a||!E)throw new Error("Payer not found or proof args is missing.");let H=b(U,K);N.push(Vc({amount:i,createAtaIfNeeded:d,settingsReadonlyArgs:E,compressedProofArgs:H,payer:a,secp256r1VerifyArgs:O,source:l,sourceTokenAccount:f,destination:r,destinationTokenAccount:M,mint:s,tokenProgram:o,remainingAccounts:L}));}else N.push(Lc({amount:i,createAtaIfNeeded:d,secp256r1VerifyArgs:O,source:l,sourceTokenAccount:f,destination:r,destinationTokenAccount:M,settings:g,mint:s,tokenProgram:o,remainingAccounts:L}));return N}async function wk({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:i}){let a=await Ls(re(),s),o=a.data.multiWalletSettings,{settingsReadonlyArgs:d,proof:u,packedAccounts:y}=await fe(c,e,n,false,i),{remainingAccounts:g,systemOffset:l}=y.toAccountMetas(),{domainConfig:f,verifyArgs:M,message:E,signature:U,publicKey:S}=V(r),x=[];if(E&&U&&S&&x.push(z([{message:E,signature:U,publicKey:S}])),c){if(!t||!d)throw new Error("Payer not found or proof args is missing.");let O=b(u,l);x.push(Qc({transactionBuffer:s,domainConfig:f,closer:r instanceof I?void 0:r,rentCollector:a.data.payer,secp256r1VerifyArgs:M,settingsReadonlyArgs:d,payer:t,compressedProofArgs:O,remainingAccounts:g}));}else x.push(jc({transactionBuffer:s,domainConfig:f,closer:r instanceof I?void 0:r,settings:o,payer:a.data.payer,secp256r1VerifyArgs:M,remainingAccounts:[]}));return x}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:y,verifyArgs:g,message:l,signature:f,publicKey:M}=V(n),E=[];if(l&&f&&M&&E.push(z([{message:l,signature:f,publicKey:M}])),d){let{settingsReadonlyArgs:U,compressedProofArgs:S,remainingAccounts:x}=d;E.push(Aa({transactionBuffer:t,payer:e,secp256r1VerifyArgs:g,creator:n instanceof I?void 0:n,domainConfig:y,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},settingsReadonlyArgs:U,compressedProofArgs:S,remainingAccounts:x}));}else E.push(oa({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:g,creator:n instanceof I?void 0:n,domainConfig:y,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},remainingAccounts:[]}));return E}function Ud({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:o}=V(e),d=[];return a&&i&&o&&d.push(z([{message:a,signature:i,publicKey:o}])),s?d.push(Da({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof I?void 0:e,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(fa({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof I?void 0:e,remainingAccounts:[]})),d}function Wd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?La({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):va({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Od({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:o}=V(n),d=[];return o&&i&&a&&d.push(z([{message:o,signature:i,publicKey:a}])),s?d.push(ja({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof I?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Va({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof I?void 0:n,remainingAccounts:[]})),d}async function DN({message:e,signer:n,popUp:r}){let{clientId:s,signClientMessage:t}=Ye(),c={type:"message",payload:e},i=getBase64Decoder().decode(new Uint8Array([...new TextEncoder().encode(JSON.stringify(c)),...n?n.toBuffer():[]])),{signature:a,expiry:o}=await t("start",i),d=`${Pe()}/?redirectUrl=${encodeURIComponent(window.origin)}&clientId=${encodeURIComponent(s)}&signature=${encodeURIComponent(a)}&expiry=${encodeURIComponent(o)}`,u=await er({authUrl:d,data:c,signer:n,popUp:r});return {...u,signer:new de(u.signer)}}async function vN({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){let{clientId:c,signClientMessage:i}=Ye(),a={type:"transaction",payload:JSON.stringify({transactionActionType:e,transactionAddress:n,transactionMessageBytes:tr(r)})},o=getBase64Decoder().decode(new Uint8Array([...new TextEncoder().encode(JSON.stringify(a)),...s?s.toBuffer():[]])),{signature:d,expiry:u}=await i("start",o),y=`${Pe()}/?redirectUrl=${encodeURIComponent(window.origin)}&clientId=${encodeURIComponent(c)}&signature=${encodeURIComponent(d)}&expiry=${encodeURIComponent(u)}`,g=await er({authUrl:y,data:a,signer:s,popUp:t});return {...g,signer:new de(g.signer)}}async function BN({message:e,response:n,expectedRPID:r=zi(),expectedOrigin:s=Pe()}){let t=new Uint8Array([...new TextEncoder().encode(e),...sr(n.clientId,n.deviceSignature.publicKey)]),c=ed25519.verify(new Uint8Array(getBase58Encoder().encode(n.deviceSignature.signature)),t,new Uint8Array(getBase58Encoder().encode(n.deviceSignature.publicKey))),{verified:i}=await verifyAuthenticationResponse({response:n.authResponse,expectedChallenge:tr(t),expectedOrigin:s,expectedRPID:r,requireUserVerification:false,credential:{id:n.authResponse.id,publicKey:Li(n.signer.toString()),counter:0}});return i&&c}async function qN({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o,compressed:d=false,additionalVoters:u=[],additionalSigners:y=[],chunkSize:g=Math.ceil(s.length/2),cachedAccounts:l}){let f=await ne(n),M=Math.floor(Math.random()*255),E=await cd(f,t instanceof I?t:t.address,M),U=[],S=[];for(let J=0;J<s.length;J+=g){let Wn=s.subarray(J,J+g);U.push(Wn),S.push(sha256(Wn));}let x=sha256(new Uint8Array(s)),{settingsReadonlyArgs:O,proof:L,packedAccounts:K}=await fe(d,n,r,false,l),{remainingAccounts:N,systemOffset:H}=K.toAccountMetas(),G=O?{settingsReadonlyArgs:O,compressedProofArgs:b(L,H),remainingAccounts:N,payer:e}:null,Te=ue([t,...c?[c]:[],...u]).filter(J=>J instanceof I).map(J=>({memberKey:je(J),messageHash:Wt(J.authResponse)})),ie=_d({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:M,payer:e,transactionBufferAddress:E,settings:f,creator:t,preauthorizeExecution:!c,bufferExtendHashes:S,compressedArgs:G,expectedSecp256r1Signers:Te}),Re=U.map(J=>Wd({transactionMessageBytes:J,transactionBufferAddress:E,settings:f,compressed:d})),Me=u.map(J=>Od({voter:J,transactionBufferAddress:E,settings:f,compressedArgs:G})),ve=Ud({compressedArgs:G,settings:f,executor:c,transactionBufferAddress:E}),{instructions:Lt,addressLookupTableAccounts:kd}=await hd({compressed:d,settings:f,transactionMessageBytes:s,transactionBufferAddress:E,payer:e,additionalSigners:y,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o}),T=J=>({payer:e,instructions:J,addressesByLookupTableAddress:kd});return [T(ie),...Re.map(J=>T([J])),...Me.length?[T(Me.flat())]:[],T(ve),T(Lt)]}var Ar=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 gr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,i)=>{s.set(c,i);});let t=c=>{let i=s.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function wd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Ar.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(s??{});for(let g of a){let l=t.extractTableLookup(g);if(l!==void 0){let{addressTableLookup:f,drainedKeys:M}=l;c.push({readonlyIndexes:f.readonlyIndexes,readableIndices:f.readonlyIndexes,writableIndexes:f.writableIndexes,writableIndices:f.writableIndexes,lookupTableAddress:address(f.lookupTableAddress)}),i.writable.push(...M.writable),i.readonly.push(...M.readonly);}}let[o,d]=t.getMessageComponents(),y=new gr(d,i).compileInstructions(r);return {version:0,header:o,instructions:y,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function a2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=wd({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return Ii(s)}async function g2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i,cachedAccounts:a,compressed:o=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:y}=await 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:y}}
|
|
2
|
+
export{Ks as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,ro as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,Xs as CHANGE_CONFIG_DISCRIMINATOR,io as COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,xo as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Mo as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Ro as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Wo as CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR,wo as CREATE_USER_ACCOUNTS_DISCRIMINATOR,Go as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,qo as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,On as DOMAIN_CONFIG_DISCRIMINATOR,Jt as DelegateOp,tc as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,cc as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,Hn as GLOBAL_COUNTER_DISCRIMINATOR,_t as KeyType,gc as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,lc as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,Mx as MULTI_WALLET_ERROR__ALREADY_DELEGATED,rx as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,Gx as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,Fx 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,gx as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,nx as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,ux as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,Ux as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,Wx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,Ox as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,Px as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,Ex as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,hx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,Sx as MULTI_WALLET_ERROR__INVALID_ACCOUNT,Jx as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,yx as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,Ix as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,_x as MULTI_WALLET_ERROR__INVALID_BUFFER,lx as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,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,Hx as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,Tx as MULTI_WALLET_ERROR__INVALID_THRESHOLD,Ax as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,dx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,fx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,xx as MULTI_WALLET_ERROR__INVALID_USER_ROLE,ex as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,kx as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,zx as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,Cx as MULTI_WALLET_ERROR__MISSING_ACCOUNT,Nx as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,Dx as MULTI_WALLET_ERROR__MISSING_USER_ARGS,vx as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,ax as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,ix as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,Kx as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,cx as MULTI_WALLET_ERROR__PERMANENT_MEMBER,wx 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,Vx as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,mx as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,Lx as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,Bx as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,bx as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,Rx as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,JS as MultiWalletAccount,jS as MultiWalletInstruction,Rc as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Dc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Ie as Permission,Ee as Permissions,Es as SETTINGS_DISCRIMINATOR,de as Secp256r1Key,I as SignedSecp256r1Key,Nc as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Wc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Zc as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,zc as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,ia as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,ra as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Us as TRANSACTION_BUFFER_DISCRIMINATOR,xa as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,pa as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Ua as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,ha as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,za as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,ka as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,ri as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,Za as TRANSACTION_EXECUTE_DISCRIMINATOR,pi as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,ii as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Fe as UserRole,ks as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,cB as addWhitelistedAddressTrees,FL as changeConfig,wk as closeTransactionBuffer,nB as compressSettingsAccount,vD as configAction,ud as convertMemberKeyToString,Li as convertPubkeyCompressedToCose,oO as convertPubkeyCoseToCompressed,yB as createDomainConfig,DB as createDomainUserAccounts,PB as createGlobalCounter,Ui as createPopUp,_d as createTransactionBuffer,dC as createTransactionManagerSigner,OB as createUserAccounts,Uw as createWallet,Bn as decodeDomainConfig,Gn as decodeGlobalCounter,Ps as decodeSettings,Os as decodeTransactionBuffer,Hs as decodeWhitelistedAddressTree,Gw as decompressSettingsAccount,kB as disableDomainConfig,KB as editDomainConfig,XB as editTransactionManagerUrl,hd as executeTransaction,Ud as executeTransactionBuffer,Pd as executeTransactionSync,Wd as extendTransactionBuffer,zC as fetchAllDomainConfig,XC as fetchAllGlobalCounter,$d as fetchAllMaybeDomainConfig,pu as fetchAllMaybeGlobalCounter,Ry as fetchAllMaybeSettings,Zy as fetchAllMaybeTransactionBuffer,Tp as fetchAllMaybeWhitelistedAddressTree,Ih as fetchAllSettings,Rh as fetchAllTransactionBuffer,Wh as fetchAllWhitelistedAddressTree,ji as fetchCompressedAccount,wn as fetchDomainConfig,ZC as fetchGlobalCounter,Xd as fetchMaybeDomainConfig,yu as fetchMaybeGlobalCounter,Jr as fetchMaybeSettings,JI as fetchMaybeSettingsAccountData,Yy as fetchMaybeTransactionBuffer,KI as fetchMaybeUserAccountData,mp as fetchMaybeWhitelistedAddressTree,xh as fetchSettings,ed as fetchSettingsAccountData,Ls as fetchTransactionBuffer,Qi as fetchUserAccountData,Vs as fetchWhitelistedAddressTree,rD as getAddMemberArgsCodec,pr as getAddMemberArgsDecoder,yr as getAddMemberArgsEncoder,Zh as getAddWhitelistedAddressTreesDiscriminatorBytes,$h as getAddWhitelistedAddressTreesInstruction,js as getAddWhitelistedAddressTreesInstructionAsync,Xh as getAddWhitelistedAddressTreesInstructionDataCodec,Js as getAddWhitelistedAddressTreesInstructionDataDecoder,en as getAddWhitelistedAddressTreesInstructionDataEncoder,Pe as getAuthEndpoint,TP as getChangeConfigCompressedDiscriminatorBytes,oo as getChangeConfigCompressedInstruction,fP as getChangeConfigCompressedInstructionDataCodec,so as getChangeConfigCompressedInstructionDataDecoder,no as getChangeConfigCompressedInstructionDataEncoder,cP as getChangeConfigDiscriminatorBytes,iP as getChangeConfigInstruction,Qs as getChangeConfigInstructionAsync,aP as getChangeConfigInstructionDataCodec,$s as getChangeConfigInstructionDataDecoder,tn as getChangeConfigInstructionDataEncoder,sr as getClientAndDeviceHash,Ye as getClientSettings,oD as getCompiledInstructionCodec,Tr as getCompiledInstructionDecoder,mr as getCompiledInstructionEncoder,EP as getCompressSettingsAccountDiscriminatorBytes,go as getCompressSettingsAccountInstruction,hP as getCompressSettingsAccountInstructionDataCodec,Ao as getCompressSettingsAccountInstructionDataDecoder,uo as getCompressSettingsAccountInstructionDataEncoder,dD as getCompressedAccountMetaCodec,st as getCompressedAccountMetaDecoder,nt as getCompressedAccountMetaEncoder,yD as getCompressedAccountMetaReadOnlyCodec,it as getCompressedAccountMetaReadOnlyDecoder,at as getCompressedAccountMetaReadOnlyEncoder,TD as getCompressedProofCodec,Cr as getCompressedProofDecoder,Ir as getCompressedProofEncoder,Q as getCompressedSettingsAddressFromIndex,xD as getCompressedSettingsCodec,MD as getCompressedSettingsDataCodec,At as getCompressedSettingsDataDecoder,ut as getCompressedSettingsDataEncoder,Y as getCompressedSettingsDecoder,dt as getCompressedSettingsEncoder,Fi as getComputeBudgetEstimate,RD as getConfigActionCodec,mt as getConfigActionDecoder,pt as getConfigActionEncoder,OP as getCreateDomainConfigDiscriminatorBytes,BP as getCreateDomainConfigInstruction,Co as getCreateDomainConfigInstructionAsync,LP as getCreateDomainConfigInstructionDataCodec,Io as getCreateDomainConfigInstructionDataDecoder,nn as getCreateDomainConfigInstructionDataEncoder,zP as getCreateDomainUserAccountDiscriminatorBytes,JP as getCreateDomainUserAccountInstruction,ho as getCreateDomainUserAccountInstructionAsync,KP as getCreateDomainUserAccountInstructionDataCodec,Eo as getCreateDomainUserAccountInstructionDataDecoder,on as getCreateDomainUserAccountInstructionDataEncoder,QP as getCreateGlobalCounterDiscriminatorBytes,tR as getCreateGlobalCounterInstruction,bo as getCreateGlobalCounterInstructionAsync,eR as getCreateGlobalCounterInstructionDataCodec,vo as getCreateGlobalCounterInstructionDataDecoder,an as getCreateGlobalCounterInstructionDataEncoder,dR as getCreateMultiWalletCompressedDiscriminatorBytes,AR as getCreateMultiWalletCompressedInstruction,Lo as getCreateMultiWalletCompressedInstructionAsync,uR as getCreateMultiWalletCompressedInstructionDataCodec,Oo as getCreateMultiWalletCompressedInstructionDataDecoder,dn as getCreateMultiWalletCompressedInstructionDataEncoder,OD as getCreateUserAccountArgsCodec,br as getCreateUserAccountArgsDecoder,vr as getCreateUserAccountArgsEncoder,SR as getCreateUserAccountsDiscriminatorBytes,IR as getCreateUserAccountsInstruction,No as getCreateUserAccountsInstructionAsync,xR as getCreateUserAccountsInstructionDataCodec,ko as getCreateUserAccountsInstructionDataDecoder,An as getCreateUserAccountsInstructionDataEncoder,vR as getDecompressSettingsAccountDiscriminatorBytes,Ko as getDecompressSettingsAccountInstruction,bR as getDecompressSettingsAccountInstructionDataCodec,zo as getDecompressSettingsAccountInstructionDataDecoder,Fo as getDecompressSettingsAccountInstructionDataEncoder,wD as getDelegateOpCodec,_e as getDelegateOpDecoder,be as getDelegateOpEncoder,wR as getDisableDomainConfigDiscriminatorBytes,Xo as getDisableDomainConfigInstruction,kR as getDisableDomainConfigInstructionDataCodec,Zo as getDisableDomainConfigInstructionDataDecoder,Yo as getDisableDomainConfigInstructionDataEncoder,Je as getDomainConfigAddress,FC as getDomainConfigCodec,Ln as getDomainConfigDecoder,GC as getDomainConfigDiscriminatorBytes,Zd as getDomainConfigEncoder,KC as getDomainConfigSize,JR as getEditDomainConfigDiscriminatorBytes,nc as getEditDomainConfigInstruction,qR as getEditDomainConfigInstructionAsync,jR as getEditDomainConfigInstructionDataCodec,rc as getEditDomainConfigInstructionDataDecoder,yn as getEditDomainConfigInstructionDataEncoder,VD as getEditMemberArgsCodec,hr as getEditMemberArgsDecoder,Er as getEditMemberArgsEncoder,rv as getEditTransactionManagerUrlDiscriminatorBytes,dc as getEditTransactionManagerUrlInstruction,nv as getEditTransactionManagerUrlInstructionDataCodec,ic as getEditTransactionManagerUrlInstructionDataDecoder,ac as getEditTransactionManagerUrlInstructionDataEncoder,KD as getExpectedSecp256r1SignersCodec,ft as getExpectedSecp256r1SignersDecoder,Tt as getExpectedSecp256r1SignersEncoder,MO as getFeePayer,od as getGlobalCounterAddress,YC as getGlobalCounterCodec,Vn as getGlobalCounterDecoder,qC as getGlobalCounterDiscriminatorBytes,gu as getGlobalCounterEncoder,$C as getGlobalCounterSize,En as getJitoTipsConfig,aL as getLightCpiSigner,Ne as getLightProtocolRpc,YD as getLinkWalletArgsCodec,Ur as getLinkWalletArgsDecoder,_r as getLinkWalletArgsEncoder,QD as getMemberCodec,yt as getMemberDecoder,gt as getMemberEncoder,rM as getMemberKeyCodec,q as getMemberKeyDecoder,j as getMemberKeyEncoder,Av as getMigrateCompressedSettingsDiscriminatorBytes,mc as getMigrateCompressedSettingsInstruction,gv as getMigrateCompressedSettingsInstructionDataCodec,pc as getMigrateCompressedSettingsInstructionDataDecoder,yc as getMigrateCompressedSettingsInstructionDataEncoder,xv as getMigrateCompressedUsersDiscriminatorBytes,Ic as getMigrateCompressedUsersInstruction,Iv as getMigrateCompressedUsersInstructionDataCodec,xc as getMigrateCompressedUsersInstructionDataDecoder,Sc as getMigrateCompressedUsersInstructionDataEncoder,gW as getMultiWalletErrorMessage,Nv as getNativeTransferIntentCompressedDiscriminatorBytes,_c as getNativeTransferIntentCompressedInstruction,Hv as getNativeTransferIntentCompressedInstructionDataCodec,bc as getNativeTransferIntentCompressedInstructionDataDecoder,vc as getNativeTransferIntentCompressedInstructionDataEncoder,vv as getNativeTransferIntentDiscriminatorBytes,Ec as getNativeTransferIntentInstruction,_v as getNativeTransferIntentInstructionAsync,bv as getNativeTransferIntentInstructionDataCodec,Mc as getNativeTransferIntentInstructionDataDecoder,pn as getNativeTransferIntentInstructionDataEncoder,cM as getNewAuthorityArgsCodec,Or as getNewAuthorityArgsDecoder,Wr as getNewAuthorityArgsEncoder,iO as getOriginIndex,dM as getPackedAddressTreeInfoCodec,St as getPackedAddressTreeInfoDecoder,lt as getPackedAddressTreeInfoEncoder,gM as getPackedStateTreeInfoCodec,ct as getPackedStateTreeInfoDecoder,ot as getPackedStateTreeInfoEncoder,mM as getPermissionsCodec,We as getPermissionsDecoder,Ue as getPermissionsEncoder,SM as getProofArgsCodec,D as getProofArgsDecoder,C as getProofArgsEncoder,DM as getRemoveMemberArgsCodec,Rr as getRemoveMemberArgsDecoder,Pr as getRemoveMemberArgsEncoder,zi as getRpId,Cn as getSecp256r1Message,Wt as getSecp256r1MessageHash,hM as getSecp256r1PubkeyCodec,xt as getSecp256r1PubkeyDecoder,Lr as getSecp256r1PubkeyEncoder,EC as getSecp256r1SignatureOffsetsDataDecoder,MC as getSecp256r1SignatureOffsetsDataEncoder,vM as getSecp256r1VerifyArgsCodec,w as getSecp256r1VerifyArgsDecoder,B as getSecp256r1VerifyArgsEncoder,WM as getSecp256r1VerifyArgsWithDomainAddressCodec,X as getSecp256r1VerifyArgsWithDomainAddressDecoder,Z as getSecp256r1VerifyArgsWithDomainAddressEncoder,z as getSecp256r1VerifyInstruction,JL as getSecp256r1VerifyInstructionDataCodec,Sd as getSecp256r1VerifyInstructionDataDecoder,xd as getSecp256r1VerifyInstructionDataEncoder,Gi as getSendAndConfirmTransaction,Sh as getSettingsCodec,wM as getSettingsCreationArgsCodec,Ct as getSettingsCreationArgsDecoder,It as getSettingsCreationArgsEncoder,hs as getSettingsDecoder,lh as getSettingsDiscriminatorBytes,Py as getSettingsEncoder,ne as getSettingsFromIndex,HM as getSettingsIndexWithAddressCodec,wr as getSettingsIndexWithAddressDecoder,Br as getSettingsIndexWithAddressEncoder,zM as getSettingsMutArgsCodec,xe as getSettingsMutArgsDecoder,Se as getSettingsMutArgsEncoder,qM as getSettingsReadonlyArgsCodec,te as getSettingsReadonlyArgsDecoder,ee as getSettingsReadonlyArgsEncoder,Ch as getSettingsSize,cO as getSignedSecp256r1Key,ML as getSignedTransactionManager,re as getSolanaRpc,qe as getSolanaRpcEndpoint,sb as getTokenTransferIntentCompressedDiscriminatorBytes,Vc as getTokenTransferIntentCompressedInstruction,cb as getTokenTransferIntentCompressedInstructionAsync,ob as getTokenTransferIntentCompressedInstructionDataCodec,Hc as getTokenTransferIntentCompressedInstructionDataDecoder,fn as getTokenTransferIntentCompressedInstructionDataEncoder,qv as getTokenTransferIntentDiscriminatorBytes,Lc as getTokenTransferIntentInstruction,Zv as getTokenTransferIntentInstructionAsync,Yv as getTokenTransferIntentInstructionDataCodec,Oc as getTokenTransferIntentInstructionDataDecoder,Tn as getTokenTransferIntentInstructionDataEncoder,cd as getTransactionBufferAddress,Db as getTransactionBufferCloseCompressedDiscriminatorBytes,Qc as getTransactionBufferCloseCompressedInstruction,Mb as getTransactionBufferCloseCompressedInstructionDataCodec,$c as getTransactionBufferCloseCompressedInstructionDataDecoder,Xc as getTransactionBufferCloseCompressedInstructionDataEncoder,pb as getTransactionBufferCloseDiscriminatorBytes,jc as getTransactionBufferCloseInstruction,mb as getTransactionBufferCloseInstructionDataCodec,Jc as getTransactionBufferCloseInstructionDataDecoder,Kc as getTransactionBufferCloseInstructionDataEncoder,Ph as getTransactionBufferCodec,$M as getTransactionBufferCreateArgsCodec,Mt as getTransactionBufferCreateArgsDecoder,Dt as getTransactionBufferCreateArgsEncoder,Vb as getTransactionBufferCreateCompressedDiscriminatorBytes,Aa as getTransactionBufferCreateCompressedInstruction,Gb as getTransactionBufferCreateCompressedInstructionDataCodec,ua as getTransactionBufferCreateCompressedInstructionDataDecoder,da as getTransactionBufferCreateCompressedInstructionDataEncoder,Ub as getTransactionBufferCreateDiscriminatorBytes,oa as getTransactionBufferCreateInstruction,Wb as getTransactionBufferCreateInstructionDataCodec,sa as getTransactionBufferCreateInstructionDataDecoder,na as getTransactionBufferCreateInstructionDataEncoder,Ws as getTransactionBufferDecoder,hh as getTransactionBufferDiscriminatorBytes,qy as getTransactionBufferEncoder,o_ as getTransactionBufferExecuteCompressedDiscriminatorBytes,Da as getTransactionBufferExecuteCompressedInstruction,c_ as getTransactionBufferExecuteCompressedInstructionDataCodec,Ca as getTransactionBufferExecuteCompressedInstructionDataDecoder,Ia as getTransactionBufferExecuteCompressedInstructionDataEncoder,Zb as getTransactionBufferExecuteDiscriminatorBytes,fa as getTransactionBufferExecuteInstruction,Xb as getTransactionBufferExecuteInstructionDataCodec,Ta as getTransactionBufferExecuteInstructionDataDecoder,ma as getTransactionBufferExecuteInstructionDataEncoder,I_ as getTransactionBufferExtendCompressedDiscriminatorBytes,La as getTransactionBufferExtendCompressedInstruction,C_ as getTransactionBufferExtendCompressedInstructionDataCodec,Oa as getTransactionBufferExtendCompressedInstructionDataDecoder,Wa as getTransactionBufferExtendCompressedInstructionDataEncoder,y_ as getTransactionBufferExtendDiscriminatorBytes,va as getTransactionBufferExtendInstruction,p_ as getTransactionBufferExtendInstructionDataCodec,Ra as getTransactionBufferExtendInstructionDataDecoder,Pa as getTransactionBufferExtendInstructionDataEncoder,N_ as getTransactionBufferVoteCompressedDiscriminatorBytes,ja as getTransactionBufferVoteCompressedInstruction,H_ as getTransactionBufferVoteCompressedInstructionDataCodec,Ja as getTransactionBufferVoteCompressedInstructionDataDecoder,Ka as getTransactionBufferVoteCompressedInstructionDataEncoder,b_ as getTransactionBufferVoteDiscriminatorBytes,Va as getTransactionBufferVoteInstruction,__ as getTransactionBufferVoteInstructionDataCodec,Ha as getTransactionBufferVoteInstructionDataDecoder,Na as getTransactionBufferVoteInstructionDataEncoder,tU as getTransactionExecuteCompressedDiscriminatorBytes,oi as getTransactionExecuteCompressedInstruction,rU as getTransactionExecuteCompressedInstructionDataCodec,si as getTransactionExecuteCompressedInstructionDataDecoder,ni as getTransactionExecuteCompressedInstructionDataEncoder,j_ as getTransactionExecuteDiscriminatorBytes,Qa as getTransactionExecuteInstruction,q_ as getTransactionExecuteInstructionDataCodec,$a as getTransactionExecuteInstructionDataDecoder,Xa as getTransactionExecuteInstructionDataEncoder,SU as getTransactionExecuteSyncCompressedDiscriminatorBytes,fi as getTransactionExecuteSyncCompressedInstruction,xU as getTransactionExecuteSyncCompressedInstructionDataCodec,Ti as getTransactionExecuteSyncCompressedInstructionDataDecoder,mi as getTransactionExecuteSyncCompressedInstructionDataEncoder,uU as getTransactionExecuteSyncDiscriminatorBytes,Ai as getTransactionExecuteSyncInstruction,AU as getTransactionExecuteSyncInstructionDataCodec,ui as getTransactionExecuteSyncInstructionDataDecoder,di as getTransactionExecuteSyncInstructionDataEncoder,oE as getTransactionMessageAddressTableLookupCodec,Nr as getTransactionMessageAddressTableLookupDecoder,kr as getTransactionMessageAddressTableLookupEncoder,rE as getTransactionMessageCodec,ht as getTransactionMessageDecoder,Et as getTransactionMessageEncoder,W as getUserAccountAddress,dE as getUserCodec,yE as getUserCreationArgsCodec,ye as getUserCreationArgsDecoder,ge as getUserCreationArgsEncoder,$ as getUserDecoder,Be as getUserEncoder,fE as getUserMutArgsCodec,me as getUserMutArgsDecoder,pe as getUserMutArgsEncoder,IE as getUserReadOnlyArgsCodec,Fr as getUserReadOnlyArgsDecoder,Gr as getUserReadOnlyArgsEncoder,EE as getUserReadOnlyOrMutateArgsCodec,rt as getUserReadOnlyOrMutateArgsDecoder,tt as getUserReadOnlyOrMutateArgsEncoder,bE as getUserRoleCodec,Le as getUserRoleDecoder,Oe as getUserRoleEncoder,ad as getWalletAddressFromIndex,De as getWalletAddressFromSettings,Uh as getWhitelistedAddressTreeCodec,Ns as getWhitelistedAddressTreeDecoder,_h as getWhitelistedAddressTreeDiscriminatorBytes,pp as getWhitelistedAddressTreeEncoder,Pn as getWhitelistedAddressTreeFromIndex,$O as getWhitelistedAddressTreeIndexFromAddress,qi as getWhitelistedAddressTreesAddress,oW as identifyMultiWalletAccount,cW as identifyMultiWalletInstruction,hO as initialize,bD as isConfigAction,yW as isMultiWalletError,PE as isUserReadOnlyOrMutateArgs,sw as migrateSettings,Aw as migrateUsers,Tk as nativeTransferIntent,Qh as parseAddWhitelistedAddressTreesInstruction,lP as parseChangeConfigCompressedInstruction,dP as parseChangeConfigInstruction,PP as parseCompressSettingsAccountInstruction,wP as parseCreateDomainConfigInstruction,jP as parseCreateDomainUserAccountInstruction,rR as parseCreateGlobalCounterInstruction,gR as parseCreateMultiWalletCompressedInstruction,CR as parseCreateUserAccountsInstruction,_R as parseDecompressSettingsAccountInstruction,NR as parseDisableDomainConfigInstruction,YR as parseEditDomainConfigInstruction,sv as parseEditTransactionManagerUrlInstruction,yv as parseMigrateCompressedSettingsInstruction,Cv as parseMigrateCompressedUsersInstruction,Vv as parseNativeTransferIntentCompressedInstruction,Uv as parseNativeTransferIntentInstruction,jL as parseSecp256r1VerifyInstruction,ab as parseTokenTransferIntentCompressedInstruction,Xv as parseTokenTransferIntentInstruction,Eb as parseTransactionBufferCloseCompressedInstruction,Tb as parseTransactionBufferCloseInstruction,Fb as parseTransactionBufferCreateCompressedInstruction,Ob as parseTransactionBufferCreateInstruction,a_ as parseTransactionBufferExecuteCompressedInstruction,$b as parseTransactionBufferExecuteInstruction,D_ as parseTransactionBufferExtendCompressedInstruction,m_ as parseTransactionBufferExtendInstruction,V_ as parseTransactionBufferVoteCompressedInstruction,U_ as parseTransactionBufferVoteInstruction,nU as parseTransactionExecuteCompressedInstruction,Y_ as parseTransactionExecuteInstruction,IU as parseTransactionExecuteSyncCompressedInstruction,gU as parseTransactionExecuteSyncInstruction,CL as pollJitoBundleConfirmation,qN as prepareTransactionBundle,a2 as prepareTransactionMessage,g2 as prepareTransactionSync,DL as retrieveTransactionManager,iC as sendJitoBundle,xL as signAndSendBundledTransactions,IL as signAndSendTransaction,DN as signMessageWithPasskey,vN as signTransactionWithPasskey,hk as tokenTransferIntent,EO as uninitialize,hE as userReadOnlyOrMutateArgs,Ci as vaultTransactionMessageDeserialize,Ii as vaultTransactionMessageSerialize,BN as verifyMessage,aO as verifyTransactionAuthResponseWithMessageHash,Od as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|