@revibase/core 0.0.9 → 0.0.10

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.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,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 yr from'bn.js';import {VERSION,featureFlags,createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,getLightSystemAccountMetasV2,TreeType,localTestActiveStateTreeInfos,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha256';import {PublicKey}from'@solana/web3.js';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 Gn=new Uint8Array([201,232,212,229,59,241,106,197]);function pC(){return fixEncoderSize(getBytesEncoder(),8).encode(Gn)}function $d(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["rpIdHash",fixEncoderSize(getBytesEncoder(),32)],["bump",getU8Encoder()],["isDisabled",getU8Encoder()],["rpIdLength",getU8Encoder()],["numOrigins",getU8Encoder()],["rpId",fixEncoderSize(getBytesEncoder(),255)],["origins",fixEncoderSize(getBytesEncoder(),515)]]),e=>({...e,discriminator:Gn}))}function Fn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["rpIdHash",fixDecoderSize(getBytesDecoder(),32)],["bump",getU8Decoder()],["isDisabled",getU8Decoder()],["rpIdLength",getU8Decoder()],["numOrigins",getU8Decoder()],["rpId",fixDecoderSize(getBytesDecoder(),255)],["origins",fixDecoderSize(getBytesDecoder(),515)]])}function TC(){return combineCodec($d(),Fn())}function zn(e){return decodeAccount(e,Fn())}async function Kn(e,n,r){let s=await Qd(e,n,r);return assertAccountExists(s),s}async function Qd(e,n,r){let s=await fetchEncodedAccount(e,n,r);return zn(s)}async function lC(e,n,r){let s=await eu(e,n,r);return assertAccountsExist(s),s}async function eu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>zn(t))}function fC(){return 846}var qn=new Uint8Array([42,206,176,58,175,129,130,233]);function IC(){return fixEncoderSize(getBytesEncoder(),8).encode(qn)}function mu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:qn}))}function Yn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function CC(){return combineCodec(mu(),Yn())}function Zn(e){return decodeAccount(e,Yn())}async function DC(e,n,r){let s=await pu(e,n,r);return assertAccountExists(s),s}async function pu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Zn(s)}async function MC(e,n,r){let s=await Tu(e,n,r);return assertAccountsExist(s),s}async function Tu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Zn(t))}function hC(){return 24}function Sr(){return getStructEncoder([["memberKey",J()],["permissions",be()],["verifyArgs",getOptionEncoder(B())],["userArgs",$e()],["delegateOperation",Re()]])}function xr(){return getStructDecoder([["memberKey",j()],["permissions",Ue()],["verifyArgs",getOptionDecoder(w())],["userArgs",Qe()],["delegateOperation",ve()]])}function vC(){return combineCodec(Sr(),xr())}function Ir(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Cr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function WC(){return combineCodec(Ir(),Cr())}function et(){return getStructEncoder([["treeInfo",rt()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function tt(){return getStructDecoder([["treeInfo",nt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function BC(){return combineCodec(et(),tt())}function st(){return getStructEncoder([["treeInfo",rt()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function ot(){return getStructDecoder([["treeInfo",nt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function HC(){return combineCodec(st(),ot())}function Pr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function Rr(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function FC(){return combineCodec(Pr(),Rr())}function ct(){return getStructEncoder([["data",getOptionEncoder(at())]])}function q(){return getStructDecoder([["data",getOptionDecoder(it())]])}function jC(){return combineCodec(ct(),q())}function at(){return getStructEncoder([["threshold",getU8Encoder()],["bump",getU8Encoder()],["index",getU128Encoder()],["multiWalletBump",getU8Encoder()],["members",getArrayEncoder(dt())],["settingsAddressTreeIndex",getU8Encoder()]])}function it(){return getStructDecoder([["threshold",getU8Decoder()],["bump",getU8Decoder()],["index",getU128Decoder()],["multiWalletBump",getU8Decoder()],["members",getArrayDecoder(ut())],["settingsAddressTreeIndex",getU8Decoder()]])}function XC(){return combineCodec(at(),it())}function At(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Ur())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Sr())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(_r())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function gt(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Wr())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(xr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Or())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function tD(){return combineCodec(At(),gt())}function rD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function nD(e,n){return n.__kind===e}function Lr(){return getStructEncoder([["member",getAddressEncoder()],["role",We()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Ae()]])}function Br(){return getStructDecoder([["member",getAddressDecoder()],["role",_e()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",ge()]])}function aD(){return combineCodec(Lr(),Br())}var zt=(s=>(s[s.Add=0]="Add",s[s.Remove=1]="Remove",s[s.Ignore=2]="Ignore",s))(zt||{});function Re(){return getEnumEncoder(zt)}function ve(){return getEnumDecoder(zt)}function uD(){return combineCodec(Re(),ve())}function Ur(){return getStructEncoder([["memberKey",J()],["permissions",be()],["userArgs",getOptionEncoder(ye())],["delegateOperation",Re()]])}function Wr(){return getStructDecoder([["memberKey",j()],["permissions",Ue()],["userArgs",getOptionDecoder(me())],["delegateOperation",ve()]])}function mD(){return combineCodec(Ur(),Wr())}function yt(){return getStructEncoder([["memberKey",J()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function mt(){return getStructDecoder([["memberKey",j()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function fD(){return combineCodec(yt(),mt())}function wr(){return getStructEncoder([["settingsMutArgs",fe()],["transactionManager",getOptionEncoder(ye())]])}function kr(){return getStructDecoder([["settingsMutArgs",Se()],["transactionManager",getOptionDecoder(me())]])}function CD(){return combineCodec(wr(),kr())}function dt(){return getStructEncoder([["pubkey",J()],["permissions",be()],["role",getU8Encoder()],["userAddressTreeIndex",getU8Encoder()]])}function ut(){return getStructDecoder([["pubkey",j()],["permissions",Ue()],["role",getU8Decoder()],["userAddressTreeIndex",getU8Decoder()]])}function ED(){return combineCodec(dt(),ut())}function J(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function j(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function vD(){return combineCodec(J(),j())}function Nr(){return getStructEncoder([["authorityCreationArgs",Ae()],["compressedProofArgs",M()]])}function Hr(){return getStructDecoder([["authorityCreationArgs",ge()],["compressedProofArgs",h()]])}function _D(){return combineCodec(Nr(),Hr())}function pt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function Tt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function BD(){return combineCodec(pt(),Tt())}function rt(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function nt(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function ND(){return combineCodec(rt(),nt())}function be(){return getStructEncoder([["mask",getU8Encoder()]])}function Ue(){return getStructDecoder([["mask",getU8Decoder()]])}function GD(){return combineCodec(be(),Ue())}function M(){return getStructEncoder([["proof",getOptionEncoder(Pr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function h(){return getStructDecoder([["proof",getOptionDecoder(Rr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function JD(){return combineCodec(M(),h())}function _r(){return getStructEncoder([["memberKey",J()],["userArgs",$e()]])}function Or(){return getStructDecoder([["memberKey",j()],["userArgs",Qe()]])}function ZD(){return combineCodec(_r(),Or())}function Vr(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function lt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function QD(){return combineCodec(Vr(),lt())}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 rM(){return combineCodec(B(),w())}function Y(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",B()]])}function Z(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",w()]])}function cM(){return combineCodec(Y(),Z())}function ft(){return getStructEncoder([["addressTreeInfo",pt()],["outputStateTreeIndex",getU8Encoder()]])}function St(){return getStructDecoder([["addressTreeInfo",Tt()],["outputStateTreeIndex",getU8Decoder()]])}function uM(){return combineCodec(ft(),St())}function Gr(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function Fr(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function yM(){return combineCodec(Gr(),Fr())}function fe(){return getStructEncoder([["accountMeta",et()],["data",ct()]])}function Se(){return getStructDecoder([["accountMeta",tt()],["data",q()]])}function lM(){return combineCodec(fe(),Se())}function Q(){return getStructEncoder([["accountMeta",st()],["data",ct()]])}function ee(){return getStructDecoder([["accountMeta",ot()],["data",q()]])}function IM(){return combineCodec(Q(),ee())}function xt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getOptionEncoder(getArrayEncoder(yt()))]])}function It(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(mt()))]])}function hM(){return combineCodec(xt(),It())}function Ct(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(Ir())],["addressTableLookups",getArrayEncoder(zr())]])}function Dt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Cr())],["addressTableLookups",getArrayDecoder(Kr())]])}function vM(){return combineCodec(Ct(),Dt())}function zr(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Kr(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function WM(){return combineCodec(zr(),Kr())}function Oe(){return getStructEncoder([["member",J()],["domainConfig",getOptionEncoder(getAddressEncoder())],["role",We()],["delegatedTo",getOptionEncoder(Gr())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function X(){return getStructDecoder([["member",j()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",_e()],["delegatedTo",getOptionDecoder(Fr())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function BM(){return combineCodec(Oe(),X())}function Ae(){return getStructEncoder([["addressTreeInfo",pt()],["outputStateTreeIndex",getU8Encoder()]])}function ge(){return getStructDecoder([["addressTreeInfo",Tt()],["outputStateTreeIndex",getU8Decoder()]])}function HM(){return combineCodec(Ae(),ge())}function ye(){return getStructEncoder([["accountMeta",et()],["data",Oe()]])}function me(){return getStructDecoder([["accountMeta",tt()],["data",X()]])}function zM(){return combineCodec(ye(),me())}function qr(){return getStructEncoder([["accountMeta",st()],["data",Oe()]])}function Yr(){return getStructDecoder([["accountMeta",ot()],["data",X()]])}function qM(){return combineCodec(qr(),Yr())}function $e(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([qr()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([ye()])]])]])}function Qe(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Yr()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([me()])]])]])}function $M(){return combineCodec($e(),Qe())}function QM(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function eh(e,n){return n.__kind===e}var He=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(He||{});function We(){return getEnumEncoder(He)}function _e(){return getEnumDecoder(He)}function nh(){return combineCodec(We(),_e())}var _s=new Uint8Array([223,179,163,190,177,224,67,173]);function Kh(){return fixEncoderSize(getBytesEncoder(),8).encode(_s)}function vy(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(dt(),{size:4})],["membersLen",getU8Encoder()],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["padding",fixEncoderSize(getBytesEncoder(),7)]]),e=>({...e,discriminator:_s}))}function Os(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(ut(),{size:4})],["membersLen",getU8Decoder()],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["padding",fixDecoderSize(getBytesDecoder(),7)]])}function Jh(){return combineCodec(vy(),Os())}function Ls(e){return decodeAccount(e,Os())}async function jh(e,n,r){let s=await $r(e,n,r);return assertAccountExists(s),s}async function $r(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Ls(s)}async function qh(e,n,r){let s=await by(e,n,r);return assertAccountsExist(s),s}async function by(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ls(t))}function Yh(){return 184}var Hs=new Uint8Array([90,36,35,219,93,225,110,96]);function Qh(){return fixEncoderSize(getBytesEncoder(),8).encode(Hs)}function Zy(){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(yt()))],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Hs}))}function Vs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multiWalletSettings",getAddressDecoder()],["multiWalletBump",getU8Decoder()],["canExecute",getBooleanDecoder()],["preauthorizeExecution",getBooleanDecoder()],["validTill",getU64Decoder()],["payer",getAddressDecoder()],["bump",getU8Decoder()],["bufferIndex",getU8Decoder()],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["creator",j()],["executor",j()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(j())],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(mt()))],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function eE(){return combineCodec(Zy(),Vs())}function Gs(e){return decodeAccount(e,Vs())}async function Fs(e,n,r){let s=await Xy(e,n,r);return assertAccountExists(s),s}async function Xy(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Gs(s)}async function tE(e,n,r){let s=await $y(e,n,r);return assertAccountsExist(s),s}async function $y(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Gs(t))}var Js=new Uint8Array([105,23,173,2,197,255,80,87]);function sE(){return fixEncoderSize(getBytesEncoder(),8).encode(Js)}function Tm(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Js}))}function js(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function oE(){return combineCodec(Tm(),js())}function qs(e){return decodeAccount(e,js())}async function Ys(e,n,r){let s=await lm(e,n,r);return assertAccountExists(s),s}async function lm(e,n,r){let s=await fetchEncodedAccount(e,n,r);return qs(s)}async function cE(e,n,r){let s=await fm(e,n,r);return assertAccountsExist(s),s}async function fm(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>qs(t))}function m({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function Xs(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 p(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:AccountRole.READONLY});let s=r.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:G(r.value),role:Zs(r.value)?upgradeRoleToSigner(s):s,...Zs(r.value)?{signer:r.value}:{}})}}function Zs(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Qs=new Uint8Array([7]);function DE(){return fixEncoderSize(getBytesEncoder(),1).encode(Qs)}function cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Qs}))}function eo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function ME(){return combineCodec(cn(),eo())}async function to(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:cn().encode(c),programAddress:r})}function hE(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:cn().encode(c),programAddress:r})}function EE(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:eo().decode(e.data)}}var oo=new Uint8Array([8]);function _E(){return fixEncoderSize(getBytesEncoder(),1).encode(oo)}function an(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(At())],["compressedProofArgs",getOptionEncoder(M())]]),e=>({...e,discriminator:oo}))}function co(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(gt())],["compressedProofArgs",getOptionDecoder(h())]])}function OE(){return combineCodec(an(),co())}async function ao(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(Xs(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 a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:an().encode(c),programAddress:r})}function LE(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:an().encode(c),programAddress:r})}function BE(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:co().decode(e.data)}}var Ao=new Uint8Array([19]);function FE(){return fixEncoderSize(getBytesEncoder(),1).encode(Ao)}function go(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(At())],["settingsMut",fe()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ao}))}function yo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(gt())],["settingsMut",Se()],["compressedProofArgs",h()]])}function zE(){return combineCodec(go(),yo())}function mo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.authority),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:go().encode(c),programAddress:r})}function KE(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:yo().decode(e.data)}}var lo=new Uint8Array([16]);function $E(){return fixEncoderSize(getBytesEncoder(),1).encode(lo)}function fo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",fe()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:lo}))}function So(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",h()],["settingsMutArgs",Se()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}function QE(){return combineCodec(fo(),So())}function xo(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:fo().encode(c),programAddress:r})}function eP(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:So().decode(e.data)}}var Ro=new Uint8Array([0]);function aP(){return fixEncoderSize(getBytesEncoder(),1).encode(Ro)}function un(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",Ae()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ro}))}function vo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",ge()],["compressedProofArgs",h()]])}function iP(){return combineCodec(un(),vo())}async function bo(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:un().encode(c),programAddress:r})}function dP(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:un().encode(c),programAddress:r})}function uP(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:vo().decode(e.data)}}var Wo=new Uint8Array([4]);function lP(){return fixEncoderSize(getBytesEncoder(),1).encode(Wo)}function gn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["member",Vr()],["role",We()],["userAccountCreationArgs",Ae()],["linkWalletArgs",getOptionEncoder(wr())]]),e=>({...e,discriminator:Wo}))}function _o(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",h()],["member",lt()],["role",_e()],["userAccountCreationArgs",ge()],["linkWalletArgs",getOptionDecoder(kr())]])}function fP(){return combineCodec(gn(),_o())}async function Oo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:gn().encode(c),programAddress:r})}function SP(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:gn().encode(c),programAddress:r})}function xP(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:_o().decode(e.data)}}var Bo=new Uint8Array([3]);function EP(){return fixEncoderSize(getBytesEncoder(),1).encode(Bo)}function mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Bo}))}function wo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function PP(){return combineCodec(mn(),wo())}async function ko(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=p(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:mn().encode({}),programAddress:r})}function RP(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=p(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:mn().encode({}),programAddress:r})}function vP(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:wo().decode(e.data)}}var Vo=new Uint8Array([18]);function BP(){return fixEncoderSize(getBytesEncoder(),1).encode(Vo)}function pn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["compressedProofArgs",M()],["settingsCreation",ft()],["userMutArgs",ye()],["settingsIndex",getU128Encoder()],["delegateOperation",Re()]]),e=>({...e,discriminator:Vo}))}function Go(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["compressedProofArgs",h()],["settingsCreation",St()],["userMutArgs",me()],["settingsIndex",getU128Decoder()],["delegateOperation",ve()]])}function wP(){return combineCodec(pn(),Go())}async function Fo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:pn().encode(c),programAddress:r})}function kP(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:pn().encode(c),programAddress:r})}function NP(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:Go().decode(e.data)}}var Ko=new Uint8Array([5]);function JP(){return fixEncoderSize(getBytesEncoder(),1).encode(Ko)}function ln(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayEncoder(Lr())]]),e=>({...e,discriminator:Ko}))}function Jo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",h()],["createUserArgs",getArrayDecoder(Br())]])}function jP(){return combineCodec(ln(),Jo())}async function jo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:ln().encode(c),programAddress:r})}function qP(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:ln().encode(c),programAddress:r})}function YP(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:Jo().decode(e.data)}}var Zo=new Uint8Array([17]);function rR(){return fixEncoderSize(getBytesEncoder(),1).encode(Zo)}function Xo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMut",fe()],["compressedProofArgs",M()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:Zo}))}function $o(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMut",Se()],["compressedProofArgs",h()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}function nR(){return combineCodec(Xo(),$o())}function Qo(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Xo().encode(c),programAddress:r})}function sR(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:$o().decode(e.data)}}var rc=new Uint8Array([2]);function uR(){return fixEncoderSize(getBytesEncoder(),1).encode(rc)}function nc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:rc}))}function sc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function AR(){return combineCodec(nc(),sc())}function oc(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...a],data:nc().encode(c),programAddress:r})}function gR(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:sc().decode(e.data)}}var dc=new Uint8Array([1]);function SR(){return fixEncoderSize(getBytesEncoder(),1).encode(dc)}function Sn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Nr())]]),e=>({...e,discriminator:dc}))}function uc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Hr())]])}function xR(){return combineCodec(Sn(),uc())}async function IR(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:Sn().encode(c),programAddress:r})}function Ac(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:Sn().encode(c),programAddress:r})}function CR(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:uc().decode(e.data)}}var mc=new Uint8Array([6]);function vR(){return fixEncoderSize(getBytesEncoder(),1).encode(mc)}function pc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",ye()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",M()]]),e=>({...e,discriminator:mc}))}function Tc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",me()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",h()]])}function bR(){return combineCodec(pc(),Tc())}function lc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:false}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.authority),...a],data:pc().encode(c),programAddress:r})}function UR(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Tc().decode(e.data)}}var xc=new Uint8Array([32]);function kR(){return fixEncoderSize(getBytesEncoder(),1).encode(xc)}function Ic(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",at()],["compressedProofArgs",M()],["settingsCreationArgs",ft()]]),e=>({...e,discriminator:xc}))}function Cc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",it()],["compressedProofArgs",h()],["settingsCreationArgs",St()]])}function NR(){return combineCodec(Ic(),Cc())}function Dc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.authority),...a],data:Ic().encode(c),programAddress:r})}function HR(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Cc().decode(e.data)}}var Ec=new Uint8Array([31]);function jR(){return fixEncoderSize(getBytesEncoder(),1).encode(Ec)}function Pc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Oe()],["compressedProofArgs",M()],["userCreationArgs",Ae()]]),e=>({...e,discriminator:Ec}))}function Rc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",X()],["compressedProofArgs",h()],["userCreationArgs",ge()]])}function qR(){return combineCodec(Pc(),Rc())}function vc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.authority),...a],data:Pc().encode(c),programAddress:r})}function YR(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:Rc().decode(e.data)}}var Uc=new Uint8Array([29]);function rv(){return fixEncoderSize(getBytesEncoder(),1).encode(Uc)}function xn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:Uc}))}function Wc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}function nv(){return combineCodec(xn(),Wc())}async function sv(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(G(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:xn().encode(c),programAddress:r})}function _c(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:xn().encode(c),programAddress:r})}function ov(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:Wc().decode(e.data)}}var Bc=new Uint8Array([27]);function gv(){return fixEncoderSize(getBytesEncoder(),1).encode(Bc)}function wc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Y())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Bc}))}function kc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function yv(){return combineCodec(wc(),kc())}function Nc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:wc().encode(c),programAddress:r})}function mv(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:kc().decode(e.data)}}var Vc=new Uint8Array([30]);function Iv(){return fixEncoderSize(getBytesEncoder(),1).encode(Vc)}function Cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:Vc}))}function Gc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}function Cv(){return combineCodec(Cn(),Gc())}async function Dv(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(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 a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:Cn().encode(c),programAddress:r})}function Fc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:Cn().encode(c),programAddress:r})}function Mv(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:Gc().decode(e.data)}}var jc=new Uint8Array([28]);function Uv(){return fixEncoderSize(getBytesEncoder(),1).encode(jc)}function Dn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Y())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:jc}))}function qc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function Wv(){return combineCodec(Dn(),qc())}async function _v(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(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 a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:Dn().encode(c),programAddress:r})}function Yc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:Dn().encode(c),programAddress:r})}function Ov(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:qc().decode(e.data)}}var $c=new Uint8Array([12]);function Vv(){return fixEncoderSize(getBytesEncoder(),1).encode($c)}function Qc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:$c}))}function ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Gv(){return combineCodec(Qc(),ea())}function ta(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Qc().encode(c),programAddress:r})}function Fv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ea().decode(e.data)}}var sa=new Uint8Array([23]);function Zv(){return fixEncoderSize(getBytesEncoder(),1).encode(sa)}function oa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:sa}))}function ca(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function Xv(){return combineCodec(oa(),ca())}function aa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:oa().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(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ca().decode(e.data)}}var ua=new Uint8Array([9]);function ob(){return fixEncoderSize(getBytesEncoder(),1).encode(ua)}function Aa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",xt()],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:ua}))}function ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",It()],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function cb(){return combineCodec(Aa(),ga())}function ya(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...a],data:Aa().encode(c),programAddress:r})}function ab(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:ga().decode(e.data)}}var Ta=new Uint8Array([20]);function mb(){return fixEncoderSize(getBytesEncoder(),1).encode(Ta)}function la(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",xt()],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ta}))}function fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",It()],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function pb(){return combineCodec(la(),fa())}function Sa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...a],data:la().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:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:fa().decode(e.data)}}var Ca=new Uint8Array([13]);function Db(){return fixEncoderSize(getBytesEncoder(),1).encode(Ca)}function Da(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:Ca}))}function Ma(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Mb(){return combineCodec(Da(),Ma())}function ha(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Da().encode(c),programAddress:r})}function hb(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:Ma().decode(e.data)}}var Ra=new Uint8Array([24]);function Wb(){return fixEncoderSize(getBytesEncoder(),1).encode(Ra)}function va(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ra}))}function ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function _b(){return combineCodec(va(),ba())}function Ua(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:va().encode(c),programAddress:r})}function Ob(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ba().decode(e.data)}}var Oa=new Uint8Array([11]);function Hb(){return fixEncoderSize(getBytesEncoder(),1).encode(Oa)}function La(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Oa}))}function Ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Vb(){return combineCodec(La(),Ba())}function wa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...a],data:La().encode(c),programAddress:r})}function Gb(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:Ba().decode(e.data)}}var Ha=new Uint8Array([22]);function qb(){return fixEncoderSize(getBytesEncoder(),1).encode(Ha)}function Va(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Ha}))}function Ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function Yb(){return combineCodec(Va(),Ga())}function Fa(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.transactionBuffer),...a],data:Va().encode(c),programAddress:r})}function Zb(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:Ga().decode(e.data)}}var Ja=new Uint8Array([10]);function nU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ja)}function ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:Ja}))}function qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function sU(){return combineCodec(ja(),qa())}function Ya(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:ja().encode(c),programAddress:r})}function oU(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:qa().decode(e.data)}}var $a=new Uint8Array([21]);function gU(){return fixEncoderSize(getBytesEncoder(),1).encode($a)}function Qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:$a}))}function ei(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function yU(){return combineCodec(Qa(),ei())}function ti(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Qa().encode(c),programAddress:r})}function mU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ei().decode(e.data)}}var si=new Uint8Array([14]);function xU(){return fixEncoderSize(getBytesEncoder(),1).encode(si)}function oi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:si}))}function ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function IU(){return combineCodec(oi(),ci())}function ai(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=m({}),a=p(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:oi().encode({}),programAddress:r})}function CU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:ci().decode(e.data)}}var ui=new Uint8Array([25]);function RU(){return fixEncoderSize(getBytesEncoder(),1).encode(ui)}function Ai(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:ui}))}function gi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function vU(){return combineCodec(Ai(),gi())}function yi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...a],data:Ai().encode(c),programAddress:r})}function bU(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:gi().decode(e.data)}}var Ti=new Uint8Array([15]);function wU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ti)}function li(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Ct()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:Ti}))}function fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Dt()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}function kU(){return combineCodec(li(),fi())}function Si(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:li().encode(c),programAddress:r})}function NU(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:fi().decode(e.data)}}var Ci=new Uint8Array([26]);function JU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ci)}function Di(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Ct()],["secp256r1VerifyArgs",getArrayEncoder(Y())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ci}))}function Mi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Dt()],["secp256r1VerifyArgs",getArrayDecoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function jU(){return combineCodec(Di(),Mi())}function hi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Di().encode(c),programAddress:r})}function qU(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:Mi().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",zS=(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))(zS||{});function WW(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([201,232,212,229,59,241,106,197])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([42,206,176,58,175,129,130,233])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([223,179,163,190,177,224,67,173])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([90,36,35,219,93,225,110,96])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([105,23,173,2,197,255,80,87])),0))return 4;throw new Error("The provided account could not be identified as a multiWallet account.")}var KS=(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))(KS||{});function _W(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 jS=6e3,qS=6001,YS=6002,ZS=6003,XS=6004,$S=6005,QS=6006,ex=6007,tx=6008,rx=6009,nx=6010,sx=6011,ox=6012,cx=6013,ax=6014,ix=6015,dx=6016,ux=6017,Ax=6018,gx=6019,yx=6020,mx=6021,px=6022,Tx=6023,lx=6024,fx=6025,Sx=6026,xx=6027,Ix=6028,Cx=6029,Dx=6030,Mx=6031,hx=6032,Ex=6033,Px=6034,Rx=6035,vx=6036,bx=6037,Ux=6038,Wx=6039,_x=6040,Ox=6041,Ei;process.env.NODE_ENV!=="production"&&(Ei={[Ax]:"This member is already delegated to another wallet.",[vx]:"The domain configuration account is disabled. Please contact support or try again later.",[bx]:"Missing domain configuration account.",[ZS]:"Duplicate public keys detected among members. Each member must have a unique key.",[YS]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[rx]:"No members provided. A multisig wallet must contain at least one member.",[Sx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[xx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Ix]:"Declared buffer size does not match the actual serialized size.",[mx]:"Not enough members with vote permission to meet the approval threshold.",[gx]:"At least one signer with execute permission is required to proceed.",[yx]:"At least one signer with initiate permission is required to perform this action.",[ax]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[Ox]:"Address Tree supplied is not part of the whitelisted address trees",[ix]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[fx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[cx]:"Unexpected number of accounts provided for this instruction.",[qS]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[jS]:"Invalid signature: the provided signature does not match the expected message payload.",[Px]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[sx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[ox]:"Malformed transaction message: structure or formatting does not match the expected layout.",[hx]:"An input string exceeds the maximum allowed character length.",[Ux]:"This member is not registered under the provided domain configuration.",[dx]:"A required account is missing from the instruction context.",[Ex]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[ux]:"User mutation arguments are required when performing add or remove delegate operations.",[Tx]:"No valid signer found in this transaction.",[QS]:"Only one permanent member is allowed per wallet.",[ex]:"Only one transaction manager is allowed per wallet.",[_x]:"The given origin index is not in the whitelisted origins.",[XS]:"Permanent members cannot be removed from a wallet.",[$S]:"This operation cannot assign a permanent member.",[Mx]:"Writable CPI calls to protected accounts are not permitted.",[Wx]:"The relying party ID hash does not match the one defined in the domain configuration.",[Rx]:"The specified slot number was not found in the provided slot history.",[nx]:"Too many members: a maximum of 4 members are supported.",[Cx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[tx]:"Unable to assign a transaction manager.",[Dx]:"This transaction has not yet reached the required approval threshold.",[lx]:"Only the transaction creator or rent payer may close this transaction buffer.",[px]:"Member is not part of the expected signers for this transaction."});function NW(e){return process.env.NODE_ENV!=="production"?Ei[e]:"Error message not available in production bundles."}function HW(e,n,r){return isProgramError(e,n,A,r)}var Rt={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()}},C=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 wx(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function kx(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var Ri=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(wx())],["addressTableLookups",getArrayCodec(kx())]]);function vi(e){return Ri.encode({numSigners:e.header.numSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,accountKeys:e.staticAccounts,instructions:e.instructions.map(r=>({programAddressIndex:r.programAddressIndex,accountIndices:r.accountIndices??[],data:Array.from(r.data??[])})),addressTableLookups:e.version!=="legacy"?e.addressTableLookups?.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes,writableIndexes:r.writableIndexes}))??[]:[]})}function bi(e){let n=Ri.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 Ui="revibase.com",Wi="https://auth.revibase.com",_i="https://api.revibase.com";async function vn(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 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 Bi(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 wi(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 H(e,n=0){let r=e instanceof C?e:void 0,s=r?.verifyArgs&&n!==-1?some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,requestedClientAndDeviceHash:r.requestedClientAndDeviceHash}):null,t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs?.clientDataJson?new Uint8Array([...r.authData,...sha256(r.verifyArgs.clientDataJson)]):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:i,publicKey:a}}function Ge(e){if(e instanceof ie)return {keyType:Rt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Rt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function Li(e){return e instanceof C?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 C).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function ki({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 Ni(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 Fe=null,Qt=null,er=null,tr=null,rr,$t=null,bn=null,nr=null,Un=null,Wn=null,Hi=null;function sr(){if(!Fe)throw new Error("Rpc is not initialized yet.");return Fe}function vt(){if(!Qt)throw new Error("Rpc is not initialized yet");return Qt}function te(){if(!er)throw new Error("Rpc is not initialized yet");return er}function Vi(){if(!tr)throw new Error("Rpc is not initialized yet.");return tr}function Gi(){if(!rr)throw new Error("Rpc is not initialized yet");return rr}async function v_(){return $t||($t=await Ni(bn??_i)),$t}function _n(){if(!nr)throw new Error("Jito Bundle Config is not set.");return nr}function Ee(){return Un??Wi}function Fi(){return Wn??Ui}function or(){return Hi}function b_(){Qt=null,er=null,Fe=null,$t=null,bn=null,nr=null,Un=null,Wn=null,tr=null,rr=null;}function U_({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,rpId:i,additionalInfo:a}){Fe=e,Qt=createRpc(Fe,r,n);let{rpc:o,sendAndConfirmTransaction:d}=createSolanaClient({urlOrMoniker:Fe});tr=d,rr=estimateComputeUnitLimitFactory({rpc:o}),er=o,bn=t??null,nr=s??null,Un=c??null,Wn=i??null,Hi=a??null;}var U=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:r?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(A.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=sr().includes("devnet")?localTestActiveStateTreeInfos():await vt().getStateTreeInfos();return this.packOutputTreeIndex(selectStateTreeInfo(n))}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function cr(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await vt().getCompressedAccount(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,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 se(e,n,r,s,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:s[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let o=e.packTreeInfos(a,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function pe(e,n,r,s,t){let c=null,i=null,a=new U;if(e){await a.addSystemAccounts();let{address:o}=await $(n,r),d=(await ce([{address:o,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[d.leafIndex],leaves:[],treeInfos:[d.treeInfo],proveByIndices:[d.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:i=await k([d],[]);let u=a.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!u)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:u.packedTreeInfos[0]},data:q().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 vt().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 Te(){return (await ar()).length-1}var On;async function ar(){if(!On){let{data:e}=await Ys(te(),await Ji());On=e.whitelistedAddressTrees;}return On}async function ji(e,n,r){let s=await yI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function yI(e,n,r){let{address:s}=await W(e,n),t=await cr(s,r);return t?.data?.data?X().decode(t.data.data):null}async function qi(e,n,r){let s=await mI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function mI(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 $r(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 ir(e){let r=(await ar()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}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(A)).toString(),"base58"),addressTree:new PublicKey(r)}}async function W(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(A.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function Ke({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 Qi(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function Ji(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function ed(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 ie?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function Ie(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function re(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function td(e){let n=await re(e);return await Ie(n)}async function aO(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}var Je=null,nd=2e3,sd=3e3,lI=300*1e3;async function ur({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,i)=>{let a=new URL(e).origin,o=null,d=setInterval(()=>{s&&s.closed&&(g(),i(new Error("User closed the authentication window")));},500),u=setTimeout(()=>{y("Authentication timeout."),g(),i(new Error("Authentication timed out"));},lI);function g(){clearInterval(d),clearTimeout(u),o&&clearTimeout(o),Je&&window.removeEventListener("message",Je),s&&s.close();}if(s?s.location.replace(e):s=id(e),!s){i(new Error("Disable your popup blocker to continue."));return}function y(...l){n?.debug&&console.debug("[Popup]",...l);}let f=l=>{let I=l.origin===a,D=l.source===s;if(!I||!D||!l.isTrusted||!s){y("Ignored message from unknown source",l);return}switch(l.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}},a),o=setTimeout(()=>{g(),i(new Error("User closed the authentication window"));},nd+sd);break;case "popup-complete":y("Received completion message");try{let b=JSON.parse(l.data.payload);g(),c(b);}catch{i(new Error("Failed to parse response payload"));}break;case "popup-heartbeat":y("Received heartbeat"),o&&(clearTimeout(o),o=setTimeout(()=>{g(),i(new Error("User closed the authentication window"));},nd+sd));break;case "popup-closed":y("Popup explicitly closed"),g(),i(new Error("User closed the authentication window"));break;default:y("Unknown message type",l.data.type);}};Je&&window.removeEventListener("message",Je),Je=f,window.addEventListener("message",Je);})}function Ar(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 gr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function fI(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 od(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 cd(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 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 i=e[r+1],a=r+2,o=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let y=p256.Point.CURVE().n>>1n,f=BigInt("0x"+gr(u)),I=(f>y?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),D=fI(I);return new Uint8Array([...g,...D])}function id(e=`${Ee()}/loading`){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let n=window.innerWidth||screen.availWidth,r=window.innerHeight||screen.availHeight,s=n<=768,t,c,i,a;if(s)t=n,c=r,i=0,a=0;else {let u=window.screenLeft??window.screenX,g=window.screenTop??window.screenY,y=window.innerWidth??document.documentElement.clientWidth??screen.width,f=window.innerHeight??document.documentElement.clientHeight??screen.height;t=500,c=600,a=u+(y-t)/2,i=g+(f-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 EO(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+gr(n.get(-2))),y:BigInt("0x"+gr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function gd(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 PO(e,n=0,r=false){let{authenticatorData:s,clientDataJSON:t,signature:c}=e.authResponse.response,i=new Uint8Array(Ce(s)),a=JSON.parse(new TextDecoder().decode(Ce(t))),o=od(a),d=ad(new Uint8Array(Ce(c))),u=await Ke({rpIdHash:i.subarray(0,32)});return new C(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Ce(t)),truncatedClientDataJson:o,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:u,authData:i,signature:d,originIndex:n,crossOrigin:r})}function RO(e,n){let{authenticatorData:r,clientDataJSON:s}=e.authResponse.response,t=new Uint8Array(Ce(r)),c=JSON.parse(new TextDecoder().decode(Ce(s))),{transactionActionType:i,transactionAddress:a,transactionMessageBytes:o}=e.transactionPayload,d=sha256$1(new Uint8Array([...getUtf8Encoder().encode(i),...getAddressEncoder().encode(address(a)),...sha256$1(o),...getBase58Encoder().encode(e.slotHash),...sha256$1(new Uint8Array([...getUtf8Encoder().encode(e.requestedClient),...getBase58Encoder().encode(e.deviceSignature.publicKey)]))]));if(!equalBytes(new Uint8Array(Ce(c.challenge)),d))throw new Error("Invalid challenge");let u=sha256$1(new Uint8Array([...t,...sha256$1(new Uint8Array(Ce(s)))]));if(!equalBytes(u,n))throw new Error("Invalid message hash")}async function vO(e,n){let{data:r}=await Kn(te(),e),t=cd(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 VO(e){let n=await vn(e,true),r=await wi(n.map(getBase64EncodedWireTransaction),sr()),s=await vn(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await kI(s.map(getBase64EncodedWireTransaction))}async function GO({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[i,a]=await Promise.all([Gi()(c),Bi(te(),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 Vi()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}async function kI(e,n=10,r=1e3,s=_n()){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 FO(e,n=30,r=3e3,s=_n()){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 zO(e,n,r,s){let t=await qi(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=>md(u.pubkey)===e.toString())??{};if(!c)throw new Error("No permissions found for the current member.");let i=Me.has(c,xe.InitiateTransaction),a=Me.has(c,xe.VoteTransaction),o=Me.has(c,xe.ExecuteTransaction);if(i&&a&&o)return {};if(!a||!o)throw new Error("Signer lacks the required Vote/Execute permissions.");let d=t.members.find(u=>u.role===2);if(!d)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:address(md(d.pubkey)),userAddressTreeIndex:d.userAddressTreeIndex}}async function KO({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await ji(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return NI(n,c.transactionManagerUrl.value,e,s)}function NI(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=getBase64Decoder().decode(s)),r&&(c.authResponses=r);let a=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json();if("error"in a)throw new Error(a.error);return a.signatures.map(o=>({[e]:getBase58Encoder().encode(o)}))}}}function md(e){return e.keyType===Rt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}async function uL({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let{addDelegates:i,removeDelegates:a}=await VI(r),o=new U,d=null,u=null,g=[];if(i.length||a.length||t){let S=await GI({packedAccounts:o,addDelegates:i,removeDelegates:a,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:c});d=S.proof,u=S.settingsMutArgs??null,g=S.userMutArgs??[];}let{configActions:y,secp256r1VerifyInput:f}=await FI({configActionsArgs:r,packedAccounts:o,userMutArgs:g}),{remainingAccounts:l,systemOffset:I}=o.toAccountMetas(),D=v(d,I);return {instructions:t?[mo({configActions:y,payer:s,authority:createNoopSigner(await td(e)),compressedProofArgs:D,settingsMut:u,remainingAccounts:l})]:[await ao({settingsIndex:e,configActions:y,payer:s,compressedProofArgs:D,remainingAccounts:l})],secp256r1VerifyInput:f}}async function VI(e){let n=[],r=[];for(let s of e)switch(s.type){case "AddMembers":{let t=s.members.map(i=>W(i.member instanceof C?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 GI({packedAccounts:e,addDelegates:n,removeDelegates:r,compressed:s,index:t,settingsAddressTreeIndex:c,cachedAccounts:i}){await e.addSystemAccounts();let a=[];if(s){let l=(await $(t,c)).address;a.push({address:l,type:"Settings"});}r.length&&a.push(...r),n.length&&a.push(...n);let o=a.length?await ce(a,i):[];if(!o.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let d=await k(o,[]),u=[],g=[];for(let l of o)l.type==="Settings"?u.push(l):l.type==="User"&&g.push(l);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),u,q())[0]),g.length&&d){let l=s?1:0;f=se(e,d.treeInfos.slice(l),d.leafIndices.slice(l),d.rootIndices.slice(l),d.proveByIndices.slice(l),g,X());}return {proof:d,settingsMutArgs:y,userMutArgs:f}}async function FI({configActionsArgs:e,packedAccounts:n,userMutArgs:r}){let s=[],t=[];for(let c of e)switch(c.type){case "AddMembers":{let i=[];for(let a of c.members)if(a.member instanceof C){let o=s.length,{message:d,signature:u,publicKey:g,domainConfig:y}=H(a.member,o);d&&u&&g&&s.push({message:d,signature:u,publicKey:g}),y&&n.addPreAccounts([{address:y,role:AccountRole.READONLY}]);let f=await W(a.member,a.userAddressTreeIndex).then(l=>r.find(I=>new yr(new Uint8Array(I.accountMeta.address)).eq(l.address)));if(!f)throw new Error("Unable to find user account");i.push(Td({permissionArgs:a.permissions,index:o,userMutArgs:f,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(g=>new yr(new Uint8Array(g.accountMeta.address)).eq(u.address)));if(!d)throw new Error("Unable to find user account");i.push(Td({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(g=>new yr(new Uint8Array(g.accountMeta.address)).eq(d.address));if(!u)throw new Error("Unable to find user account");return KI({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 yr(new Uint8Array(u.accountMeta.address)).eq(d.address))):Promise.resolve(void 0)).then(d=>zI({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 zI({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:Ge(e),permissions:Sd(n),userArgs:r?some(r):none(),delegateOperation:s}}function KI({pubkey:e,userMutArgs:n}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:Ge(e),userArgs:n.data.delegatedTo.__option==="Some"?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function Td({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:Ge(e),permissions:Sd(n),verifyArgs:e instanceof C&&e.verifyArgs&&r!==-1?some({truncatedClientDataJson:e.verifyArgs.truncatedClientDataJson,slotNumber:e.verifyArgs.slotNumber,signedMessageIndex:r,originIndex:e.originIndex,crossOrigin:e.crossOrigin,requestedClientAndDeviceHash:e.requestedClientAndDeviceHash}):none(),userArgs:t===0?{__kind:"Mutate",fields:[s]}:{__kind:"Read",fields:[s]},delegateOperation:t}}function Sd(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 qe=33,Ye=64,Hn=14,$I=2,QI=address("Secp256r1SigVerify1111111111111111111111111");function eC(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function tC(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function Dd(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let s=getU8Decoder().decode(e,n);n+=1;let t=[],c=tC();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=Hn;let i=[];for(let a=0;a<r;a++){let o=fixDecoderSize(getBytesDecoder(),qe).decode(e,n);n+=qe;let d=fixDecoderSize(getBytesDecoder(),Ye).decode(e,n);n+=Ye;let u=t[a].messageDataSize,g=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:i},n]}})}function Md(){return createEncoder({getSizeFromValue:e=>{let n=Hn*e.offsets.length,r=e.payload.reduce((s,t)=>s+qe+Ye+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=getU8Encoder().write(e.numSignatures,n,r),r=getU8Encoder().write(e.padding,n,r);let s=eC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),qe).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),Ye).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function yL(){return combineCodec(Md(),Dd())}function F(e,n){let r=e.length,s=$I+r*Hn,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,g=u+qe,y=g+Ye;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:y,messageDataSize:d.length,messageInstructionIndex:65535}),s+=qe+Ye+d.length;}let c=n?.programAddress??QI,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:Md().encode(i)}}function mL(e){return {programAddress:e.programAddress,accounts:{},data:Dd().decode(e.data)}}async function ML({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=await re(e),{address:a}=await $(e,n),o=await ce([{address:a,type:"Settings"}],t),d=await k(o,[]),u=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 C),f=[],l=[];for(let x of y){let O=f.length,{domainConfig:N,verifyArgs:V,signature:_,publicKey:K,message:L}=H(x,O);L&&_&&K&&f.push({message:L,signature:_,publicKey:K}),N&&(c.addPreAccounts([{address:N,role:AccountRole.READONLY}]),V?.__option==="Some"&&l.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:I,systemOffset:D}=c.toAccountMetas(),b=v(d,D),S=[];return f.length>0&&S.push(F(f)),S.push(xo({settings:i,settingsMutArgs:u,compressedProofArgs:b,payer:r,secp256r1VerifyArgs:l,remainingAccounts:I})),S}async function PL({admin:e,addressTree:n}){return to({payer:e,addressTree:n,remainingAccounts:[]})}async function OL({payer:e,rpId:n,origins:r,authority:s}){let t=await Ke({rpId:n}),c=new U;await c.addSystemAccounts();let i=await Te(),{address:a,addressTree:o}=await W(s.address,i),d=[{address:a,tree:o,queue:o,type:"User"}],u=await k([],d),g=(await ne(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:y,systemOffset:f}=c.toAccountMetas(),l=v(u,f);return await bo({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:l,payer:e,domainConfig:t,rpId:n,remainingAccounts:y})}async function zL({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=[];r.index&&(i.push({address:(await $(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 ce(i,t):[],o=await Te(),{address:d,addressTree:u}=await W(r.member,o),g=[{address:d,type:"User",tree:u,queue:u}],y=await k(a,g),f=null,l=null,I=a.filter(N=>N.type==="Settings"),D=a.filter(N=>N.type==="User");I.length&&(f=se(c,y.treeInfos.slice(0,1),y.leafIndices.slice(0,1),y.rootIndices.slice(0,1),y.proveByIndices.slice(0,1),I,q())[0]),D.length&&(l=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(a.length),y.roots.slice(a.length),y.rootIndices.slice(a.length),g),{remainingAccounts:S,systemOffset:x}=c.toAccountMetas(),O=v(y,x);return await Oo({payer:n,authority:e,compressedProofArgs:O,member:lt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:f?some({settingsMutArgs:f,transactionManager:l?some(l):none()}):none(),userAccountCreationArgs:b[0],domainConfig:s,remainingAccounts:S})}async function qL({payer:e}){let n=await Qi();return ko({payer:e,globalCounter:n})}async function tB({createUserArgs:e,payer:n}){let r=new U;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:AccountRole.READONLY_SIGNER,signer:u.member})));let s=await Te(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:y}=await W(u.member.address,s);return {address:g,tree:y,queue:y,type:"User"}})),c=await k([],t),i=await ne(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:o}=r.toAccountMetas(),d=v(c,o);return await jo({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:i[g],transactionManagerUrl:u.role===2?u.transactionManagerUrl:null})),remainingAccounts:a})}async function oB({admin:e,rpId:n,disable:r}){let s=await Ke({rpId:n});return oc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function gB({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let i=new U;await i.addSystemAccounts();let a=await Te(),{address:o,addressTree:d}=await W(r.address,a),u=[{address:o,tree:d,queue:d,type:"User"}],g=await k([],u),y=(await ne(i,g.treeInfos,g.roots,g.rootIndices,u))[0],f=i.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:v(g,f.systemOffset),authorityCreationArgs:y};}return Ac({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function fB({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new U;await s.addSystemAccounts();let t=await ce([{address:(await W(e.address,n)).address,type:"User"}]),c=await k(t,[]),i=se(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:a,systemOffset:o}=s.toAccountMetas(),d=v(c,o);return lc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function hB({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new U;await t.addSystemAccounts();let{address:c,addressTree:i}=await $(r,s),a=[{address:c,tree:i,queue:i,type:"Settings"}],o=await k([],a),d=(await ne(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),y=v(o,g);return Dc({compressedProofArgs:y,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function WB({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new U;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 ne(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),y=v(o,g);return vc({compressedProofArgs:y,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}async function QB({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,delegateOperation:t,cachedAccounts:c}){let{domainConfig:i,verifyArgs:a,message:o,signature:d,publicKey:u}=H(r),g=[];o&&d&&u&&g.push({message:o,signature:d,publicKey:u});let y=new U;await y.addSystemAccounts();let f=[],l=[];l.push(...await ce([{address:(await W("address"in r?r.address:r,s)).address,type:"User"}],c));let I=await Te(),{address:D,addressTree:b}=await $(e,I);f.push({address:D,queue:b,tree:b,type:"Settings"});let S=l.length,x=await k(l,f),O=se(y,x.treeInfos.slice(0,S),x.leafIndices.slice(0,S),x.rootIndices.slice(0,S),x.proveByIndices.slice(0,S),l.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;i?y.addPreAccounts([{address:i,role:AccountRole.READONLY}]):"address"in r&&y.addPreAccounts([{address:r.address,role:AccountRole.READONLY_SIGNER,signer:r}]);let{remainingAccounts:_,systemOffset:K}=y.toAccountMetas(),L=v(x,K),le=[];if(!V)throw new Error("Settings creation args is missing.");return le.push(await Fo({settingsIndex:e,payer:n,initialMember:r instanceof C?void 0:r,secp256r1VerifyArgs:a,domainConfig:i,userMutArgs:O,compressedProofArgs:L,settingsCreation:V,delegateOperation:t,remainingAccounts:_})),{instructions:le,secp256r1VerifyInput:g}}async function dw({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=await ce([{address:(await $(e,n)).address,type:"Settings"}],t),a=await k(i,[]),o=se(c,a.treeInfos,a.leafIndices,a.rootIndices,a.proveByIndices,i.filter(S=>S.type==="Settings"),q())[0],d=de(s),u=d.filter(S=>S instanceof C),g=[],y=[];for(let S of u){let x=g.length,{domainConfig:O,verifyArgs:N,signature:V,publicKey:_,message:K}=H(S,x);K&&V&&_&&g.push({message:K,signature:V,publicKey:_}),O&&(c.addPreAccounts([{address:O,role:AccountRole.READONLY}]),N?.__option==="Some"&&y.push({domainConfigKey:O,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:l}=c.toAccountMetas(),I=v(a,l),D=[];g.length>0&&D.push(F(g));let b=await re(e);return D.push(Qo({settings:b,payer:r,settingsMut:o,compressedProofArgs:I,secp256r1VerifyArgs:y,remainingAccounts:f})),D}function cC(e,n,r,s){let t=aC(e,n),c=iC(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function aC(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 iC(e,n){return n<e.header.numSignerAccounts}async function mr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=bi(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),te()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,o]of t.staticAccounts.entries())i.push({address:o,role:cC(t,a,o,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let o=c[a.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:AccountRole.READONLY});}}for(let a of s?.filter(o=>o.address!==e)??[]){let o=i.findIndex(d=>d.address===a.address);o===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[o].role===AccountRole.READONLY||i[o].role===AccountRole.READONLY_SIGNER?i[o]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[o].role===AccountRole.WRITABLE||i[o].role===AccountRole.WRITABLE_SIGNER)&&(i[o]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}async function bd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:o=false}){let d=await Ie(e),{accountMetas:u,addressLookupTableAccounts:g}=await mr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(F(c)),y.push(o?yi({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):ai({transactionBuffer:n,payer:s.address,settings:e})),a&&y.push(ki({payer:s,tipAmount:a})),{instructions:y,addressLookupTableAccounts:g}}async function Ud({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:i=[],compressed:a=false,simulateProof:o=false,cachedAccounts:d}){let u=de(s),g=await re(e),y=await Ie(g),[{accountMetas:f,addressLookupTableAccounts:l,transactionMessage:I},{settingsReadonlyArgs:D,proof:b,packedAccounts:S}]=await Promise.all([mr({transactionMessageBytes:r,walletAddress:y,additionalSigners:u.filter(L=>!(L instanceof C)),addressesByLookupTableAddress:c}),pe(a,e,n,o,d)]);S.addPreAccounts(f);let x=u.filter(L=>L instanceof C),O=[];for(let L of x){let le=i.length,{domainConfig:ae,verifyArgs:Pe,signature:De,publicKey:Wt,message:_t}=H(L,le);_t&&De&&Wt&&i.push({message:_t,signature:De,publicKey:Wt}),ae&&(S.addPreAccounts([{address:ae,role:AccountRole.READONLY}]),Pe?.__option==="Some"&&O.push({domainConfigKey:ae,verifyArgs:Pe.value}));}let{remainingAccounts:N,systemOffset:V}=S.toAccountMetas(),_=[];i.length>0&&_.push(F(i));let K=uC(I,f);if(a){if(!t||!D)throw new Error("Payer not found or proof args is missing.");let L=v(b,V);_.push(hi({secp256r1VerifyArgs:O,transactionMessage:K,settingsReadonlyArgs:D,compressedProofArgs:L,payer:t,remainingAccounts:N}));}else _.push(Si({secp256r1VerifyArgs:O,settings:g,transactionMessage:K,remainingAccounts:N}));return {instructions:_,addressLookupTableAccounts:l}}function uC(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 ww({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let o=de(s),d=await re(e),u=await Ie(d),{settingsReadonlyArgs:g,proof:y,packedAccounts:f}=await pe(a,e,n,false,t),l=[],I=[];for(let x of o)if(x instanceof C){let O=l.length,{domainConfig:N,verifyArgs:V,signature:_,publicKey:K,message:L}=H(x,O);L&&_&&K&&l.push({message:L,signature:_,publicKey:K}),N&&(f.addPreAccounts([{address:N,role:AccountRole.READONLY}]),V?.__option==="Some"&&I.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(l.length>0&&S.push(F(l)),a){if(!i||!g)throw new Error("Payer not found or proof args is missing.");let x=v(y,b);S.push(Nc({amount:c,settingsReadonlyArgs:g,compressedProofArgs:x,payer:i,secp256r1VerifyArgs:I,source:u,destination:r,remainingAccounts:D}));}else S.push(_c({amount:c,secp256r1VerifyArgs:I,source:u,destination:r,settings:d,remainingAccounts:D}));return S}async function jw({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:o,compressed:d=false}){let u=de(t),g=await re(e),y=await Ie(g),[f,l]=await Promise.all([getAssociatedTokenAccountAddress(s,y,o),getAssociatedTokenAccountAddress(s,r,o)]),{settingsReadonlyArgs:I,proof:D,packedAccounts:b}=await pe(d,e,n,false,c),S=[],x=[];for(let _ of u)if(_ instanceof C){let K=S.length,{domainConfig:L,verifyArgs:le,signature:ae,publicKey:Pe,message:De}=H(_,K);De&&ae&&Pe&&S.push({message:De,signature:ae,publicKey:Pe}),L&&(b.addPreAccounts([{address:L,role:AccountRole.READONLY}]),le?.__option==="Some"&&x.push({domainConfigKey:L,verifyArgs:le.value}));}else b.addPreAccounts([{address:_.address,role:AccountRole.READONLY_SIGNER,signer:_}]);let{remainingAccounts:O,systemOffset:N}=b.toAccountMetas(),V=[];if(S.length>0&&V.push(F(S)),d){if(!a||!I)throw new Error("Payer not found or proof args is missing.");let _=v(D,N);V.push(Yc({amount:i,settingsReadonlyArgs:I,compressedProofArgs:_,payer:a,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:f,destination:r,destinationTokenAccount:l,mint:s,tokenProgram:o,remainingAccounts:O}));}else V.push(Fc({amount:i,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:f,destination:r,destinationTokenAccount:l,settings:g,mint:s,tokenProgram:o,remainingAccounts:O}));return V}async function sk({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:i}){let a=await Fs(te(),s),o=a.data.multiWalletSettings,{settingsReadonlyArgs:d,proof:u,packedAccounts:g}=await pe(c,e,n,false,i),{remainingAccounts:y,systemOffset:f}=g.toAccountMetas(),{domainConfig:l,verifyArgs:I,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 O=v(u,f);x.push(aa({transactionBuffer:s,domainConfig:l,closer:r instanceof C?void 0:r,rentCollector:a.data.payer,secp256r1VerifyArgs:I,settingsReadonlyArgs:d,payer:t,compressedProofArgs:O,remainingAccounts:y}));}else x.push(ta({transactionBuffer:s,domainConfig:l,closer:r instanceof C?void 0:r,settings:o,payer:a.data.payer,secp256r1VerifyArgs:I,remainingAccounts:[]}));return x}function Ld({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:y,message:f,signature:l,publicKey:I}=H(n),D=[];if(f&&l&&I&&D.push(F([{message:f,signature:l,publicKey:I}])),d){let{settingsReadonlyArgs:b,compressedProofArgs:S,remainingAccounts:x}=d;D.push(Sa({transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof C?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},settingsReadonlyArgs:b,compressedProofArgs:S,remainingAccounts:x}));}else D.push(ya({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof C?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},remainingAccounts:[]}));return D}function Bd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:o}=H(e),d=[];return a&&i&&o&&d.push(F([{message:a,signature:i,publicKey:o}])),s?d.push(Ua({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(ha({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,remainingAccounts:[]})),d}function wd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Fa({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):wa({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function kd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:o}=H(n),d=[];return o&&i&&a&&d.push(F([{message:o,signature:i,publicKey:a}])),s?d.push(ti({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Ya({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,remainingAccounts:[]})),d}async function Fk({message:e,signer:n,popUp:r}){let s=await ur({authUrl:`${Ee()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"message",payload:e},signer:n,popUp:r,additionalInfo:or()});return {...s,signer:new ie(s.signer),userAddressTreeIndex:s.userAddressTree?await ir(s.userAddressTree):void 0}}async function qk({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){let c=await ur({authUrl:`${Ee()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"transaction",payload:JSON.stringify({transactionActionType:e,transactionAddress:n,transactionMessageBytes:Ar(r)})},additionalInfo:or(),signer:s,popUp:t});return {...c,signer:new ie(c.signer),userAddressTreeIndex:c.userAddressTree?await ir(c.userAddressTree):void 0}}async function Qk({message:e,response:n,expectedRPID:r=Fi(),expectedOrigin:s=Ee()}){let{verified:t}=await verifyAuthenticationResponse({response:n.authResponse,expectedChallenge:Ar(new Uint8Array([...new TextEncoder().encode(n.requestedClient),...new TextEncoder().encode(e)])),expectedOrigin:s,expectedRPID:r,requireUserVerification:false,credential:{id:n.authResponse.id,publicKey:gd(n.signer.toString()),counter:0}});return t}async function A2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o,compressed:d=false,bufferIndex:u=Math.floor(Math.random()*255),additionalVoters:g=[],additionalSigners:y=[],chunkSize:f=Math.ceil(s.length/2),cachedAccounts:l}){let I=await re(n),D=await ed(I,t instanceof C?t:t.address,u),b=[],S=[];for(let z=0;z<s.length;z+=f){let Vn=s.subarray(z,z+f);b.push(Vn),S.push(sha256(Vn));}let x=sha256(new Uint8Array(s)),{settingsReadonlyArgs:O,proof:N,packedAccounts:V}=await pe(d,n,r,false,l),{remainingAccounts:_,systemOffset:K}=V.toAccountMetas(),L=O?{settingsReadonlyArgs:O,compressedProofArgs:v(N,K),remainingAccounts:_,payer:e}:null,le=de([t,...c?[c]:[],...g]).filter(z=>z instanceof C).map(z=>({memberKey:Ge(z),messageHash:sha256(new Uint8Array([...z.authData,...sha256(z.verifyArgs.clientDataJson)]))})),ae=Ld({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:u,payer:e,transactionBufferAddress:D,settings:I,creator:t,preauthorizeExecution:!c,bufferExtendHashes:S,compressedArgs:L,expectedSecp256r1Signers:le}),Pe=b.map(z=>wd({transactionMessageBytes:z,transactionBufferAddress:D,settings:I,compressed:d})),De=g.map(z=>kd({voter:z,transactionBufferAddress:D,settings:I,compressedArgs:L})),Wt=Bd({compressedArgs:L,settings:I,executor:c,transactionBufferAddress:D}),{instructions:_t,addressLookupTableAccounts:Hd}=await bd({compressed:d,settings:I,transactionMessageBytes:s,transactionBufferAddress:D,payer:e,additionalSigners:y,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o}),T=z=>({payer:e,instructions:z,addressesByLookupTableAddress:Hd});return [T(ae),...Pe.map(z=>T([z])),...De.length?[T(De.flat())]:[],T(Wt),T(_t)]}var lr=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 fr=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 Nd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=lr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(s??{});for(let y of a){let f=t.extractTableLookup(y);if(f!==void 0){let{addressTableLookup:l,drainedKeys:I}=f;c.push({readonlyIndexes:l.readonlyIndexes,readableIndices:l.readonlyIndexes,writableIndexes:l.writableIndexes,writableIndices:l.writableIndexes,lookupTableAddress:address(l.lookupTableAddress)}),i.writable.push(...I.writable),i.readonly.push(...I.readonly);}}let[o,d]=t.getMessageComponents(),g=new fr(d,i).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function M2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Nd({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return vi(s)}async function v2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i,cachedAccounts:a,compressed:o=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await Ud({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:i,simulateProof:d,cachedAccounts:a});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}
2
- export{Qs as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,Ao as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,oo as CHANGE_CONFIG_DISCRIMINATOR,lo as COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Ro as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Wo as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Bo as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Vo as CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR,Ko as CREATE_USER_ACCOUNTS_DISCRIMINATOR,Zo as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,rc as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Gn as DOMAIN_CONFIG_DISCRIMINATOR,zt as DelegateOp,dc as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,mc as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,qn as GLOBAL_COUNTER_DISCRIMINATOR,Rt as KeyType,xc as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,Ec as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,Ax as MULTI_WALLET_ERROR__ALREADY_DELEGATED,vx as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,bx as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,ZS as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,YS as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,rx as MULTI_WALLET_ERROR__EMPTY_MEMBERS,Sx as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,xx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,Ix as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,mx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,gx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,yx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,ax as MULTI_WALLET_ERROR__INVALID_ACCOUNT,Ox as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,ix as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,fx as MULTI_WALLET_ERROR__INVALID_BUFFER,cx as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,qS as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,jS as MULTI_WALLET_ERROR__INVALID_SIGNED_MESSAGE,Px as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,sx as MULTI_WALLET_ERROR__INVALID_THRESHOLD,ox as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,hx as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,Ux as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,dx as MULTI_WALLET_ERROR__MISSING_ACCOUNT,Ex as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,ux as MULTI_WALLET_ERROR__MISSING_USER_ARGS,Tx as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,QS as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,ex as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,_x as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,XS as MULTI_WALLET_ERROR__PERMANENT_MEMBER,$S as MULTI_WALLET_ERROR__PERMANENT_MEMBER_NOT_ALLOWED,Mx as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,Wx as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,Rx as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,nx as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,Cx as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,tx as MULTI_WALLET_ERROR__TRANSACTION_MANAGER_NOT_ALLOWED,Dx as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,lx as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,px as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,zS as MultiWalletAccount,KS as MultiWalletInstruction,Bc as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Uc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,xe as Permission,Me as Permissions,_s as SETTINGS_DISCRIMINATOR,ie as Secp256r1Key,C as SignedSecp256r1Key,jc as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Vc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,sa as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,$c as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,Ta as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,ua as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Hs as TRANSACTION_BUFFER_DISCRIMINATOR,Ra as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Ca as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Ha as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Oa as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,$a as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Ja as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,ui as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,si as TRANSACTION_EXECUTE_DISCRIMINATOR,Ci as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,Ti as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,He as UserRole,Js as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,PL as addWhitelistedAddressTrees,uL as changeConfig,sk as closeTransactionBuffer,ML as compressSettingsAccount,rD as configAction,md as convertMemberKeyToString,gd as convertPubkeyCompressedToCose,EO as convertPubkeyCoseToCompressed,OL as createDomainConfig,zL as createDomainUserAccounts,qL as createGlobalCounter,id as createPopUp,Ld as createTransactionBuffer,NI as createTransactionManagerSigner,tB as createUserAccounts,QB as createWallet,zn as decodeDomainConfig,Zn as decodeGlobalCounter,Ls as decodeSettings,Gs as decodeTransactionBuffer,qs as decodeWhitelistedAddressTree,dw as decompressSettingsAccount,oB as disableDomainConfig,gB as editDomainConfig,fB as editTransactionManagerUrl,bd as executeTransaction,Bd as executeTransactionBuffer,Ud as executeTransactionSync,wd as extendTransactionBuffer,lC as fetchAllDomainConfig,MC as fetchAllGlobalCounter,eu as fetchAllMaybeDomainConfig,Tu as fetchAllMaybeGlobalCounter,by as fetchAllMaybeSettings,$y as fetchAllMaybeTransactionBuffer,fm as fetchAllMaybeWhitelistedAddressTree,qh as fetchAllSettings,tE as fetchAllTransactionBuffer,cE as fetchAllWhitelistedAddressTree,Kn as fetchDomainConfig,DC as fetchGlobalCounter,Qd as fetchMaybeDomainConfig,pu as fetchMaybeGlobalCounter,$r as fetchMaybeSettings,mI as fetchMaybeSettingsAccountData,Xy as fetchMaybeTransactionBuffer,yI as fetchMaybeUserAccountData,lm as fetchMaybeWhitelistedAddressTree,jh as fetchSettings,qi as fetchSettingsAccountData,Fs as fetchTransactionBuffer,ji as fetchUserAccountData,Ys as fetchWhitelistedAddressTree,vC as getAddMemberArgsCodec,xr as getAddMemberArgsDecoder,Sr as getAddMemberArgsEncoder,DE as getAddWhitelistedAddressTreesDiscriminatorBytes,hE as getAddWhitelistedAddressTreesInstruction,to as getAddWhitelistedAddressTreesInstructionAsync,ME as getAddWhitelistedAddressTreesInstructionDataCodec,eo as getAddWhitelistedAddressTreesInstructionDataDecoder,cn as getAddWhitelistedAddressTreesInstructionDataEncoder,Ee as getAuthEndpoint,FE as getChangeConfigCompressedDiscriminatorBytes,mo as getChangeConfigCompressedInstruction,zE as getChangeConfigCompressedInstructionDataCodec,yo as getChangeConfigCompressedInstructionDataDecoder,go as getChangeConfigCompressedInstructionDataEncoder,_E as getChangeConfigDiscriminatorBytes,LE as getChangeConfigInstruction,ao as getChangeConfigInstructionAsync,OE as getChangeConfigInstructionDataCodec,co as getChangeConfigInstructionDataDecoder,an as getChangeConfigInstructionDataEncoder,WC as getCompiledInstructionCodec,Cr as getCompiledInstructionDecoder,Ir as getCompiledInstructionEncoder,$E as getCompressSettingsAccountDiscriminatorBytes,xo as getCompressSettingsAccountInstruction,QE as getCompressSettingsAccountInstructionDataCodec,So as getCompressSettingsAccountInstructionDataDecoder,fo as getCompressSettingsAccountInstructionDataEncoder,BC as getCompressedAccountMetaCodec,tt as getCompressedAccountMetaDecoder,et as getCompressedAccountMetaEncoder,HC as getCompressedAccountMetaReadOnlyCodec,ot as getCompressedAccountMetaReadOnlyDecoder,st as getCompressedAccountMetaReadOnlyEncoder,FC as getCompressedProofCodec,Rr as getCompressedProofDecoder,Pr as getCompressedProofEncoder,$ as getCompressedSettingsAddressFromIndex,jC as getCompressedSettingsCodec,XC as getCompressedSettingsDataCodec,it as getCompressedSettingsDataDecoder,at as getCompressedSettingsDataEncoder,q as getCompressedSettingsDecoder,ct as getCompressedSettingsEncoder,Gi as getComputeBudgetEstimate,tD as getConfigActionCodec,gt as getConfigActionDecoder,At as getConfigActionEncoder,aP as getCreateDomainConfigDiscriminatorBytes,dP as getCreateDomainConfigInstruction,bo as getCreateDomainConfigInstructionAsync,iP as getCreateDomainConfigInstructionDataCodec,vo as getCreateDomainConfigInstructionDataDecoder,un as getCreateDomainConfigInstructionDataEncoder,lP as getCreateDomainUserAccountDiscriminatorBytes,SP as getCreateDomainUserAccountInstruction,Oo as getCreateDomainUserAccountInstructionAsync,fP as getCreateDomainUserAccountInstructionDataCodec,_o as getCreateDomainUserAccountInstructionDataDecoder,gn as getCreateDomainUserAccountInstructionDataEncoder,EP as getCreateGlobalCounterDiscriminatorBytes,RP as getCreateGlobalCounterInstruction,ko as getCreateGlobalCounterInstructionAsync,PP as getCreateGlobalCounterInstructionDataCodec,wo as getCreateGlobalCounterInstructionDataDecoder,mn as getCreateGlobalCounterInstructionDataEncoder,BP as getCreateMultiWalletCompressedDiscriminatorBytes,kP as getCreateMultiWalletCompressedInstruction,Fo as getCreateMultiWalletCompressedInstructionAsync,wP as getCreateMultiWalletCompressedInstructionDataCodec,Go as getCreateMultiWalletCompressedInstructionDataDecoder,pn as getCreateMultiWalletCompressedInstructionDataEncoder,aD as getCreateUserAccountArgsCodec,Br as getCreateUserAccountArgsDecoder,Lr as getCreateUserAccountArgsEncoder,JP as getCreateUserAccountsDiscriminatorBytes,qP as getCreateUserAccountsInstruction,jo as getCreateUserAccountsInstructionAsync,jP as getCreateUserAccountsInstructionDataCodec,Jo as getCreateUserAccountsInstructionDataDecoder,ln as getCreateUserAccountsInstructionDataEncoder,rR as getDecompressSettingsAccountDiscriminatorBytes,Qo as getDecompressSettingsAccountInstruction,nR as getDecompressSettingsAccountInstructionDataCodec,$o as getDecompressSettingsAccountInstructionDataDecoder,Xo as getDecompressSettingsAccountInstructionDataEncoder,uD as getDelegateOpCodec,ve as getDelegateOpDecoder,Re as getDelegateOpEncoder,uR as getDisableDomainConfigDiscriminatorBytes,oc as getDisableDomainConfigInstruction,AR as getDisableDomainConfigInstructionDataCodec,sc as getDisableDomainConfigInstructionDataDecoder,nc as getDisableDomainConfigInstructionDataEncoder,Ke as getDomainConfigAddress,TC as getDomainConfigCodec,Fn as getDomainConfigDecoder,pC as getDomainConfigDiscriminatorBytes,$d as getDomainConfigEncoder,fC as getDomainConfigSize,SR as getEditDomainConfigDiscriminatorBytes,Ac as getEditDomainConfigInstruction,IR as getEditDomainConfigInstructionAsync,xR as getEditDomainConfigInstructionDataCodec,uc as getEditDomainConfigInstructionDataDecoder,Sn as getEditDomainConfigInstructionDataEncoder,mD as getEditMemberArgsCodec,Wr as getEditMemberArgsDecoder,Ur as getEditMemberArgsEncoder,vR as getEditTransactionManagerUrlDiscriminatorBytes,lc as getEditTransactionManagerUrlInstruction,bR as getEditTransactionManagerUrlInstructionDataCodec,Tc as getEditTransactionManagerUrlInstructionDataDecoder,pc as getEditTransactionManagerUrlInstructionDataEncoder,fD as getExpectedSecp256r1SignersCodec,mt as getExpectedSecp256r1SignersDecoder,yt as getExpectedSecp256r1SignersEncoder,v_ as getFeePayer,or as getGlobalAdditonalInfo,Qi as getGlobalCounterAddress,CC as getGlobalCounterCodec,Yn as getGlobalCounterDecoder,IC as getGlobalCounterDiscriminatorBytes,mu as getGlobalCounterEncoder,hC as getGlobalCounterSize,_n as getJitoTipsConfig,aO as getLightCpiSigner,vt as getLightProtocolRpc,CD as getLinkWalletArgsCodec,kr as getLinkWalletArgsDecoder,wr as getLinkWalletArgsEncoder,ED as getMemberCodec,ut as getMemberDecoder,dt as getMemberEncoder,vD as getMemberKeyCodec,j as getMemberKeyDecoder,J as getMemberKeyEncoder,kR as getMigrateCompressedSettingsDiscriminatorBytes,Dc as getMigrateCompressedSettingsInstruction,NR as getMigrateCompressedSettingsInstructionDataCodec,Cc as getMigrateCompressedSettingsInstructionDataDecoder,Ic as getMigrateCompressedSettingsInstructionDataEncoder,jR as getMigrateCompressedUsersDiscriminatorBytes,vc as getMigrateCompressedUsersInstruction,qR as getMigrateCompressedUsersInstructionDataCodec,Rc as getMigrateCompressedUsersInstructionDataDecoder,Pc as getMigrateCompressedUsersInstructionDataEncoder,NW as getMultiWalletErrorMessage,gv as getNativeTransferIntentCompressedDiscriminatorBytes,Nc as getNativeTransferIntentCompressedInstruction,yv as getNativeTransferIntentCompressedInstructionDataCodec,kc as getNativeTransferIntentCompressedInstructionDataDecoder,wc as getNativeTransferIntentCompressedInstructionDataEncoder,rv as getNativeTransferIntentDiscriminatorBytes,_c as getNativeTransferIntentInstruction,sv as getNativeTransferIntentInstructionAsync,nv as getNativeTransferIntentInstructionDataCodec,Wc as getNativeTransferIntentInstructionDataDecoder,xn as getNativeTransferIntentInstructionDataEncoder,_D as getNewAuthorityArgsCodec,Hr as getNewAuthorityArgsDecoder,Nr as getNewAuthorityArgsEncoder,vO as getOriginIndex,BD as getPackedAddressTreeInfoCodec,Tt as getPackedAddressTreeInfoDecoder,pt as getPackedAddressTreeInfoEncoder,ND as getPackedStateTreeInfoCodec,nt as getPackedStateTreeInfoDecoder,rt as getPackedStateTreeInfoEncoder,GD as getPermissionsCodec,Ue as getPermissionsDecoder,be as getPermissionsEncoder,JD as getProofArgsCodec,h as getProofArgsDecoder,M as getProofArgsEncoder,ZD as getRemoveMemberArgsCodec,Or as getRemoveMemberArgsDecoder,_r as getRemoveMemberArgsEncoder,Fi as getRpId,QD as getSecp256r1PubkeyCodec,lt as getSecp256r1PubkeyDecoder,Vr as getSecp256r1PubkeyEncoder,tC as getSecp256r1SignatureOffsetsDataDecoder,eC as getSecp256r1SignatureOffsetsDataEncoder,rM as getSecp256r1VerifyArgsCodec,w as getSecp256r1VerifyArgsDecoder,B as getSecp256r1VerifyArgsEncoder,cM as getSecp256r1VerifyArgsWithDomainAddressCodec,Z as getSecp256r1VerifyArgsWithDomainAddressDecoder,Y as getSecp256r1VerifyArgsWithDomainAddressEncoder,F as getSecp256r1VerifyInstruction,yL as getSecp256r1VerifyInstructionDataCodec,Dd as getSecp256r1VerifyInstructionDataDecoder,Md as getSecp256r1VerifyInstructionDataEncoder,Vi as getSendAndConfirmTransaction,Jh as getSettingsCodec,uM as getSettingsCreationArgsCodec,St as getSettingsCreationArgsDecoder,ft as getSettingsCreationArgsEncoder,Os as getSettingsDecoder,Kh as getSettingsDiscriminatorBytes,vy as getSettingsEncoder,re as getSettingsFromIndex,yM as getSettingsIndexWithAddressCodec,Fr as getSettingsIndexWithAddressDecoder,Gr as getSettingsIndexWithAddressEncoder,lM as getSettingsMutArgsCodec,Se as getSettingsMutArgsDecoder,fe as getSettingsMutArgsEncoder,IM as getSettingsReadonlyArgsCodec,ee as getSettingsReadonlyArgsDecoder,Q as getSettingsReadonlyArgsEncoder,Yh as getSettingsSize,PO as getSignedSecp256r1Key,KO as getSignedTransactionManager,te as getSolanaRpc,sr as getSolanaRpcEndpoint,Uv as getTokenTransferIntentCompressedDiscriminatorBytes,Yc as getTokenTransferIntentCompressedInstruction,_v as getTokenTransferIntentCompressedInstructionAsync,Wv as getTokenTransferIntentCompressedInstructionDataCodec,qc as getTokenTransferIntentCompressedInstructionDataDecoder,Dn as getTokenTransferIntentCompressedInstructionDataEncoder,Iv as getTokenTransferIntentDiscriminatorBytes,Fc as getTokenTransferIntentInstruction,Dv as getTokenTransferIntentInstructionAsync,Cv as getTokenTransferIntentInstructionDataCodec,Gc as getTokenTransferIntentInstructionDataDecoder,Cn as getTokenTransferIntentInstructionDataEncoder,ed as getTransactionBufferAddress,Zv as getTransactionBufferCloseCompressedDiscriminatorBytes,aa as getTransactionBufferCloseCompressedInstruction,Xv as getTransactionBufferCloseCompressedInstructionDataCodec,ca as getTransactionBufferCloseCompressedInstructionDataDecoder,oa as getTransactionBufferCloseCompressedInstructionDataEncoder,Vv as getTransactionBufferCloseDiscriminatorBytes,ta as getTransactionBufferCloseInstruction,Gv as getTransactionBufferCloseInstructionDataCodec,ea as getTransactionBufferCloseInstructionDataDecoder,Qc as getTransactionBufferCloseInstructionDataEncoder,eE as getTransactionBufferCodec,hM as getTransactionBufferCreateArgsCodec,It as getTransactionBufferCreateArgsDecoder,xt as getTransactionBufferCreateArgsEncoder,mb as getTransactionBufferCreateCompressedDiscriminatorBytes,Sa as getTransactionBufferCreateCompressedInstruction,pb as getTransactionBufferCreateCompressedInstructionDataCodec,fa as getTransactionBufferCreateCompressedInstructionDataDecoder,la as getTransactionBufferCreateCompressedInstructionDataEncoder,ob as getTransactionBufferCreateDiscriminatorBytes,ya as getTransactionBufferCreateInstruction,cb as getTransactionBufferCreateInstructionDataCodec,ga as getTransactionBufferCreateInstructionDataDecoder,Aa as getTransactionBufferCreateInstructionDataEncoder,Vs as getTransactionBufferDecoder,Qh as getTransactionBufferDiscriminatorBytes,Zy as getTransactionBufferEncoder,Wb as getTransactionBufferExecuteCompressedDiscriminatorBytes,Ua as getTransactionBufferExecuteCompressedInstruction,_b as getTransactionBufferExecuteCompressedInstructionDataCodec,ba as getTransactionBufferExecuteCompressedInstructionDataDecoder,va as getTransactionBufferExecuteCompressedInstructionDataEncoder,Db as getTransactionBufferExecuteDiscriminatorBytes,ha as getTransactionBufferExecuteInstruction,Mb as getTransactionBufferExecuteInstructionDataCodec,Ma as getTransactionBufferExecuteInstructionDataDecoder,Da as getTransactionBufferExecuteInstructionDataEncoder,qb as getTransactionBufferExtendCompressedDiscriminatorBytes,Fa as getTransactionBufferExtendCompressedInstruction,Yb as getTransactionBufferExtendCompressedInstructionDataCodec,Ga as getTransactionBufferExtendCompressedInstructionDataDecoder,Va as getTransactionBufferExtendCompressedInstructionDataEncoder,Hb as getTransactionBufferExtendDiscriminatorBytes,wa as getTransactionBufferExtendInstruction,Vb as getTransactionBufferExtendInstructionDataCodec,Ba as getTransactionBufferExtendInstructionDataDecoder,La as getTransactionBufferExtendInstructionDataEncoder,gU as getTransactionBufferVoteCompressedDiscriminatorBytes,ti as getTransactionBufferVoteCompressedInstruction,yU as getTransactionBufferVoteCompressedInstructionDataCodec,ei as getTransactionBufferVoteCompressedInstructionDataDecoder,Qa as getTransactionBufferVoteCompressedInstructionDataEncoder,nU as getTransactionBufferVoteDiscriminatorBytes,Ya as getTransactionBufferVoteInstruction,sU as getTransactionBufferVoteInstructionDataCodec,qa as getTransactionBufferVoteInstructionDataDecoder,ja as getTransactionBufferVoteInstructionDataEncoder,RU as getTransactionExecuteCompressedDiscriminatorBytes,yi as getTransactionExecuteCompressedInstruction,vU as getTransactionExecuteCompressedInstructionDataCodec,gi as getTransactionExecuteCompressedInstructionDataDecoder,Ai as getTransactionExecuteCompressedInstructionDataEncoder,xU as getTransactionExecuteDiscriminatorBytes,ai as getTransactionExecuteInstruction,IU as getTransactionExecuteInstructionDataCodec,ci as getTransactionExecuteInstructionDataDecoder,oi as getTransactionExecuteInstructionDataEncoder,JU as getTransactionExecuteSyncCompressedDiscriminatorBytes,hi as getTransactionExecuteSyncCompressedInstruction,jU as getTransactionExecuteSyncCompressedInstructionDataCodec,Mi as getTransactionExecuteSyncCompressedInstructionDataDecoder,Di as getTransactionExecuteSyncCompressedInstructionDataEncoder,wU as getTransactionExecuteSyncDiscriminatorBytes,Si as getTransactionExecuteSyncInstruction,kU as getTransactionExecuteSyncInstructionDataCodec,fi as getTransactionExecuteSyncInstructionDataDecoder,li as getTransactionExecuteSyncInstructionDataEncoder,WM as getTransactionMessageAddressTableLookupCodec,Kr as getTransactionMessageAddressTableLookupDecoder,zr as getTransactionMessageAddressTableLookupEncoder,vM as getTransactionMessageCodec,Dt as getTransactionMessageDecoder,Ct as getTransactionMessageEncoder,W as getUserAccountAddress,BM as getUserCodec,HM as getUserCreationArgsCodec,ge as getUserCreationArgsDecoder,Ae as getUserCreationArgsEncoder,X as getUserDecoder,Oe as getUserEncoder,zM as getUserMutArgsCodec,me as getUserMutArgsDecoder,ye as getUserMutArgsEncoder,qM as getUserReadOnlyArgsCodec,Yr as getUserReadOnlyArgsDecoder,qr as getUserReadOnlyArgsEncoder,$M as getUserReadOnlyOrMutateArgsCodec,Qe as getUserReadOnlyOrMutateArgsDecoder,$e as getUserReadOnlyOrMutateArgsEncoder,nh as getUserRoleCodec,_e as getUserRoleDecoder,We as getUserRoleEncoder,td as getWalletAddressFromIndex,Ie as getWalletAddressFromSettings,oE as getWhitelistedAddressTreeCodec,js as getWhitelistedAddressTreeDecoder,sE as getWhitelistedAddressTreeDiscriminatorBytes,Tm as getWhitelistedAddressTreeEncoder,Ln as getWhitelistedAddressTreeFromIndex,ir as getWhitelistedAddressTreeIndexFromAddress,Ji as getWhitelistedAddressTreesAddress,WW as identifyMultiWalletAccount,_W as identifyMultiWalletInstruction,U_ as initialize,nD as isConfigAction,HW as isMultiWalletError,eh as isUserReadOnlyOrMutateArgs,hB as migrateSettings,WB as migrateUsers,ww as nativeTransferIntent,EE as parseAddWhitelistedAddressTreesInstruction,KE as parseChangeConfigCompressedInstruction,BE as parseChangeConfigInstruction,eP as parseCompressSettingsAccountInstruction,uP as parseCreateDomainConfigInstruction,xP as parseCreateDomainUserAccountInstruction,vP as parseCreateGlobalCounterInstruction,NP as parseCreateMultiWalletCompressedInstruction,YP as parseCreateUserAccountsInstruction,sR as parseDecompressSettingsAccountInstruction,gR as parseDisableDomainConfigInstruction,CR as parseEditDomainConfigInstruction,UR as parseEditTransactionManagerUrlInstruction,HR as parseMigrateCompressedSettingsInstruction,YR as parseMigrateCompressedUsersInstruction,mv as parseNativeTransferIntentCompressedInstruction,ov as parseNativeTransferIntentInstruction,mL as parseSecp256r1VerifyInstruction,Ov as parseTokenTransferIntentCompressedInstruction,Mv as parseTokenTransferIntentInstruction,$v as parseTransactionBufferCloseCompressedInstruction,Fv as parseTransactionBufferCloseInstruction,Tb as parseTransactionBufferCreateCompressedInstruction,ab as parseTransactionBufferCreateInstruction,Ob as parseTransactionBufferExecuteCompressedInstruction,hb as parseTransactionBufferExecuteInstruction,Zb as parseTransactionBufferExtendCompressedInstruction,Gb as parseTransactionBufferExtendInstruction,mU as parseTransactionBufferVoteCompressedInstruction,oU as parseTransactionBufferVoteInstruction,bU as parseTransactionExecuteCompressedInstruction,CU as parseTransactionExecuteInstruction,qU as parseTransactionExecuteSyncCompressedInstruction,NU as parseTransactionExecuteSyncInstruction,FO as pollJitoBundleConfirmation,A2 as prepareTransactionBundle,M2 as prepareTransactionMessage,v2 as prepareTransactionSync,zO as retrieveTransactionManager,kI as sendJitoBundle,VO as signAndSendBundledTransactions,GO as signAndSendTransaction,Fk as signMessageWithPasskey,qk as signTransactionWithPasskey,jw as tokenTransferIntent,b_ as uninitialize,QM as userReadOnlyOrMutateArgs,bi as vaultTransactionMessageDeserialize,vi as vaultTransactionMessageSerialize,Qk as verifyMessage,RO as verifyTransactionAuthResponseWithMessageHash,kd 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,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 yr from'bn.js';import {VERSION,featureFlags,createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,rpcRequest,versionedEndpoint,encodeBN254toBase58,jsonRpcResultAndContext,CompressedAccountResultV2,CompressedAccountResult,localTestActiveStateTreeInfos,getStateTreeInfoByPubkey,createCompressedAccountWithMerkleContextLegacy,createMerkleContextLegacy,bn as bn$1,parseAccountData,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha256';import {PublicKey,SolanaJSONRPCError}from'@solana/web3.js';import {estimateComputeUnitLimitFactory,getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTransferSolInstruction}from'gill/programs';import {create,nullable}from'superstruct';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 Gn=new Uint8Array([201,232,212,229,59,241,106,197]);function GC(){return fixEncoderSize(getBytesEncoder(),8).encode(Gn)}function ru(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["rpIdHash",fixEncoderSize(getBytesEncoder(),32)],["bump",getU8Encoder()],["isDisabled",getU8Encoder()],["rpIdLength",getU8Encoder()],["numOrigins",getU8Encoder()],["rpId",fixEncoderSize(getBytesEncoder(),255)],["origins",fixEncoderSize(getBytesEncoder(),515)]]),e=>({...e,discriminator:Gn}))}function Fn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["rpIdHash",fixDecoderSize(getBytesDecoder(),32)],["bump",getU8Decoder()],["isDisabled",getU8Decoder()],["rpIdLength",getU8Decoder()],["numOrigins",getU8Decoder()],["rpId",fixDecoderSize(getBytesDecoder(),255)],["origins",fixDecoderSize(getBytesDecoder(),515)]])}function FC(){return combineCodec(ru(),Fn())}function zn(e){return decodeAccount(e,Fn())}async function Kn(e,n,r){let s=await nu(e,n,r);return assertAccountExists(s),s}async function nu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return zn(s)}async function zC(e,n,r){let s=await su(e,n,r);return assertAccountsExist(s),s}async function su(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>zn(t))}function KC(){return 846}var qn=new Uint8Array([42,206,176,58,175,129,130,233]);function qC(){return fixEncoderSize(getBytesEncoder(),8).encode(qn)}function fu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:qn}))}function Yn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function YC(){return combineCodec(fu(),Yn())}function Zn(e){return decodeAccount(e,Yn())}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 Zn(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=>Zn(t))}function $C(){return 24}function Sr(){return getStructEncoder([["memberKey",J()],["permissions",be()],["verifyArgs",getOptionEncoder(B())],["userArgs",et()],["delegateOperation",Re()]])}function xr(){return getStructDecoder([["memberKey",j()],["permissions",_e()],["verifyArgs",getOptionDecoder(w())],["userArgs",tt()],["delegateOperation",ve()]])}function rD(){return combineCodec(Sr(),xr())}function Ir(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Cr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function oD(){return combineCodec(Ir(),Cr())}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 Pr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function Rr(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function TD(){return combineCodec(Pr(),Rr())}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(_r())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Sr())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Wr())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function pt(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Ur())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(xr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Lr())])]])],["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 Or(){return getStructEncoder([["member",getAddressEncoder()],["role",Ue()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Ae()]])}function Br(){return getStructDecoder([["member",getAddressDecoder()],["role",We()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",ge()]])}function LD(){return combineCodec(Or(),Br())}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 _r(){return getStructEncoder([["memberKey",J()],["permissions",be()],["userArgs",getOptionEncoder(ye())],["delegateOperation",Re()]])}function Ur(){return getStructDecoder([["memberKey",j()],["permissions",_e()],["userArgs",getOptionDecoder(pe())],["delegateOperation",ve()]])}function VD(){return combineCodec(_r(),Ur())}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 wr(){return getStructEncoder([["settingsMutArgs",fe()],["transactionManager",getOptionEncoder(ye())]])}function kr(){return getStructDecoder([["settingsMutArgs",Se()],["transactionManager",getOptionDecoder(pe())]])}function YD(){return combineCodec(wr(),kr())}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 Nr(){return getStructEncoder([["authorityCreationArgs",Ae()],["compressedProofArgs",M()]])}function Hr(){return getStructDecoder([["authorityCreationArgs",ge()],["compressedProofArgs",E()]])}function cM(){return combineCodec(Nr(),Hr())}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(Pr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function E(){return getStructDecoder([["proof",getOptionDecoder(Rr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function SM(){return combineCodec(M(),E())}function Wr(){return getStructEncoder([["memberKey",J()],["userArgs",et()]])}function Lr(){return getStructDecoder([["memberKey",j()],["userArgs",tt()]])}function DM(){return combineCodec(Wr(),Lr())}function Vr(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function St(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function hM(){return combineCodec(Vr(),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 Gr(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function Fr(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function HM(){return combineCodec(Gr(),Fr())}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(Ir())],["addressTableLookups",getArrayEncoder(zr())]])}function Et(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Cr())],["addressTableLookups",getArrayDecoder(Kr())]])}function rE(){return combineCodec(Mt(),Et())}function zr(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Kr(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function oE(){return combineCodec(zr(),Kr())}function Le(){return getStructEncoder([["member",J()],["domainConfig",getOptionEncoder(getAddressEncoder())],["role",Ue()],["delegatedTo",getOptionEncoder(Gr())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function X(){return getStructDecoder([["member",j()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",We()],["delegatedTo",getOptionDecoder(Fr())],["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 qr(){return getStructEncoder([["accountMeta",ct()],["data",Le()]])}function Yr(){return getStructDecoder([["accountMeta",at()],["data",X()]])}function IE(){return combineCodec(qr(),Yr())}function et(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([qr()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([ye()])]])]])}function tt(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Yr()])]])],["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 He=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(He||{});function Ue(){return getEnumEncoder(He)}function We(){return getEnumDecoder(He)}function bE(){return combineCodec(Ue(),We())}var Ws=new Uint8Array([223,179,163,190,177,224,67,173]);function fh(){return fixEncoderSize(getBytesEncoder(),8).encode(Ws)}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:Ws}))}function Ls(){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(),Ls())}function Os(e){return decodeAccount(e,Ls())}async function xh(e,n,r){let s=await $r(e,n,r);return assertAccountExists(s),s}async function $r(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Os(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=>Os(t))}function Ch(){return 184}var Hs=new Uint8Array([90,36,35,219,93,225,110,96]);function hh(){return fixEncoderSize(getBytesEncoder(),8).encode(Hs)}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:Hs}))}function Vs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multiWalletSettings",getAddressDecoder()],["multiWalletBump",getU8Decoder()],["canExecute",getBooleanDecoder()],["preauthorizeExecution",getBooleanDecoder()],["validTill",getU64Decoder()],["payer",getAddressDecoder()],["bump",getU8Decoder()],["bufferIndex",getU8Decoder()],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["creator",j()],["executor",j()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(j())],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(Tt()))],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Ph(){return combineCodec(ep(),Vs())}function Gs(e){return decodeAccount(e,Vs())}async function Fs(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 Gs(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=>Gs(t))}var Js=new Uint8Array([105,23,173,2,197,255,80,87]);function _h(){return fixEncoderSize(getBytesEncoder(),8).encode(Js)}function xp(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Js}))}function js(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function Uh(){return combineCodec(xp(),js())}function qs(e){return decodeAccount(e,js())}async function Ys(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 qs(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=>qs(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 Xs(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:Zs(r.value)?upgradeRoleToSigner(s):s,...Zs(r.value)?{signer:r.value}:{}})}}function Zs(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Qs=new Uint8Array([7]);function Zh(){return fixEncoderSize(getBytesEncoder(),1).encode(Qs)}function cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Qs}))}function eo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function Xh(){return combineCodec(cn(),eo())}async function to(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:cn().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:cn().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:eo().decode(e.data)}}var oo=new Uint8Array([8]);function cP(){return fixEncoderSize(getBytesEncoder(),1).encode(oo)}function an(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(yt())],["compressedProofArgs",getOptionEncoder(M())]]),e=>({...e,discriminator:oo}))}function co(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(pt())],["compressedProofArgs",getOptionDecoder(E())]])}function aP(){return combineCodec(an(),co())}async function ao(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(Xs(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 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:an().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:an().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:co().decode(e.data)}}var Ao=new Uint8Array([19]);function TP(){return fixEncoderSize(getBytesEncoder(),1).encode(Ao)}function go(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(yt())],["settingsMut",fe()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ao}))}function yo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(pt())],["settingsMut",Se()],["compressedProofArgs",E()]])}function lP(){return combineCodec(go(),yo())}function po(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:go().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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),authority:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:yo().decode(e.data)}}var lo=new Uint8Array([16]);function EP(){return fixEncoderSize(getBytesEncoder(),1).encode(lo)}function fo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",fe()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:lo}))}function So(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["settingsMutArgs",Se()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}function hP(){return combineCodec(fo(),So())}function xo(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:fo().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:So().decode(e.data)}}var Ro=new Uint8Array([0]);function LP(){return fixEncoderSize(getBytesEncoder(),1).encode(Ro)}function un(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",Ae()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ro}))}function vo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",ge()],["compressedProofArgs",E()]])}function OP(){return combineCodec(un(),vo())}async function bo(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:un().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:un().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:vo().decode(e.data)}}var Uo=new Uint8Array([4]);function zP(){return fixEncoderSize(getBytesEncoder(),1).encode(Uo)}function gn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["member",Vr()],["role",Ue()],["userAccountCreationArgs",Ae()],["linkWalletArgs",getOptionEncoder(wr())]]),e=>({...e,discriminator:Uo}))}function Wo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["member",St()],["role",We()],["userAccountCreationArgs",ge()],["linkWalletArgs",getOptionDecoder(kr())]])}function KP(){return combineCodec(gn(),Wo())}async function Lo(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:gn().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:gn().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:Wo().decode(e.data)}}var Bo=new Uint8Array([3]);function QP(){return fixEncoderSize(getBytesEncoder(),1).encode(Bo)}function pn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Bo}))}function wo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function eR(){return combineCodec(pn(),wo())}async function ko(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:pn().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:pn().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:wo().decode(e.data)}}var Vo=new Uint8Array([18]);function dR(){return fixEncoderSize(getBytesEncoder(),1).encode(Vo)}function mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["compressedProofArgs",M()],["settingsCreation",xt()],["userMutArgs",ye()],["settingsIndex",getU128Encoder()],["delegateOperation",Re()]]),e=>({...e,discriminator:Vo}))}function Go(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["compressedProofArgs",E()],["settingsCreation",It()],["userMutArgs",pe()],["settingsIndex",getU128Decoder()],["delegateOperation",ve()]])}function uR(){return combineCodec(mn(),Go())}async function Fo(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:mn().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:mn().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:Go().decode(e.data)}}var Ko=new Uint8Array([5]);function SR(){return fixEncoderSize(getBytesEncoder(),1).encode(Ko)}function ln(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayEncoder(Or())]]),e=>({...e,discriminator:Ko}))}function Jo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["createUserArgs",getArrayDecoder(Br())]])}function xR(){return combineCodec(ln(),Jo())}async function jo(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:ln().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:ln().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:Jo().decode(e.data)}}var Zo=new Uint8Array([17]);function vR(){return fixEncoderSize(getBytesEncoder(),1).encode(Zo)}function Xo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMut",fe()],["compressedProofArgs",M()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:Zo}))}function $o(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMut",Se()],["compressedProofArgs",E()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}function bR(){return combineCodec(Xo(),$o())}function Qo(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:Xo().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:$o().decode(e.data)}}var rc=new Uint8Array([2]);function wR(){return fixEncoderSize(getBytesEncoder(),1).encode(rc)}function nc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:rc}))}function sc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function kR(){return combineCodec(nc(),sc())}function oc(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:nc().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:sc().decode(e.data)}}var dc=new Uint8Array([1]);function JR(){return fixEncoderSize(getBytesEncoder(),1).encode(dc)}function Sn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Nr())]]),e=>({...e,discriminator:dc}))}function uc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Hr())]])}function jR(){return combineCodec(Sn(),uc())}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:Sn().encode(c),programAddress:r})}function Ac(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:Sn().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:uc().decode(e.data)}}var pc=new Uint8Array([6]);function rv(){return fixEncoderSize(getBytesEncoder(),1).encode(pc)}function mc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",ye()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",M()]]),e=>({...e,discriminator:pc}))}function Tc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",pe()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",E()]])}function nv(){return combineCodec(mc(),Tc())}function lc(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:mc().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:Tc().decode(e.data)}}var xc=new Uint8Array([32]);function Av(){return fixEncoderSize(getBytesEncoder(),1).encode(xc)}function Ic(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",dt()],["compressedProofArgs",M()],["settingsCreationArgs",xt()]]),e=>({...e,discriminator:xc}))}function Cc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",ut()],["compressedProofArgs",E()],["settingsCreationArgs",It()]])}function gv(){return combineCodec(Ic(),Cc())}function Dc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.authority),...a],data:Ic().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:Cc().decode(e.data)}}var hc=new Uint8Array([31]);function xv(){return fixEncoderSize(getBytesEncoder(),1).encode(hc)}function Pc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Le()],["compressedProofArgs",M()],["userCreationArgs",Ae()]]),e=>({...e,discriminator:hc}))}function Rc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",X()],["compressedProofArgs",E()],["userCreationArgs",ge()]])}function Iv(){return combineCodec(Pc(),Rc())}function vc(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:Pc().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:Rc().decode(e.data)}}var _c=new Uint8Array([29]);function vv(){return fixEncoderSize(getBytesEncoder(),1).encode(_c)}function xn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:_c}))}function Uc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}function bv(){return combineCodec(xn(),Uc())}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(G(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:xn().encode(c),programAddress:r})}function Wc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:xn().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:Uc().decode(e.data)}}var Bc=new Uint8Array([27]);function Nv(){return fixEncoderSize(getBytesEncoder(),1).encode(Bc)}function wc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Y())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Bc}))}function kc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",E()]])}function Hv(){return combineCodec(wc(),kc())}function Nc(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:wc().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:kc().decode(e.data)}}var Vc=new Uint8Array([30]);function qv(){return fixEncoderSize(getBytesEncoder(),1).encode(Vc)}function Cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:Vc}))}function Gc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}function Yv(){return combineCodec(Cn(),Gc())}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(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 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:Cn().encode(c),programAddress:r})}function Fc(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:Cn().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:Gc().decode(e.data)}}var jc=new Uint8Array([28]);function sb(){return fixEncoderSize(getBytesEncoder(),1).encode(jc)}function Dn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Y())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:jc}))}function qc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",E()]])}function ob(){return combineCodec(Dn(),qc())}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(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 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:Dn().encode(c),programAddress:r})}function Yc(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:Dn().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:qc().decode(e.data)}}var $c=new Uint8Array([12]);function pb(){return fixEncoderSize(getBytesEncoder(),1).encode($c)}function Qc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:$c}))}function ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function mb(){return combineCodec(Qc(),ea())}function ta(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:Qc().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:ea().decode(e.data)}}var sa=new Uint8Array([23]);function Db(){return fixEncoderSize(getBytesEncoder(),1).encode(sa)}function oa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:sa}))}function ca(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",E()]])}function Mb(){return combineCodec(oa(),ca())}function aa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=p(i),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:oa().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:ca().decode(e.data)}}var ua=new Uint8Array([9]);function Ub(){return fixEncoderSize(getBytesEncoder(),1).encode(ua)}function Aa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Ct()],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:ua}))}function ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Dt()],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Wb(){return combineCodec(Aa(),ga())}function ya(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:Aa().encode(c),programAddress:r})}function Lb(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:ga().decode(e.data)}}var Ta=new Uint8Array([20]);function Vb(){return fixEncoderSize(getBytesEncoder(),1).encode(Ta)}function la(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Ct()],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ta}))}function fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Dt()],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",E()]])}function Gb(){return combineCodec(la(),fa())}function Sa(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:la().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:fa().decode(e.data)}}var Ca=new Uint8Array([13]);function Zb(){return fixEncoderSize(getBytesEncoder(),1).encode(Ca)}function Da(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:Ca}))}function Ma(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Xb(){return combineCodec(Da(),Ma())}function Ea(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:Da().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:Ma().decode(e.data)}}var Ra=new Uint8Array([24]);function o_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ra)}function va(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ra}))}function ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",E()]])}function c_(){return combineCodec(va(),ba())}function _a(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:va().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:ba().decode(e.data)}}var La=new Uint8Array([11]);function y_(){return fixEncoderSize(getBytesEncoder(),1).encode(La)}function Oa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:La}))}function Ba(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function p_(){return combineCodec(Oa(),Ba())}function wa(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:Oa().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:Ba().decode(e.data)}}var Ha=new Uint8Array([22]);function I_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ha)}function Va(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Ha}))}function Ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function C_(){return combineCodec(Va(),Ga())}function Fa(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:Va().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:Ga().decode(e.data)}}var Ja=new Uint8Array([10]);function b_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ja)}function ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:Ja}))}function qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function __(){return combineCodec(ja(),qa())}function Ya(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: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===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:qa().decode(e.data)}}var $a=new Uint8Array([21]);function N_(){return fixEncoderSize(getBytesEncoder(),1).encode($a)}function Qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:$a}))}function ei(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",E()]])}function H_(){return combineCodec(Qa(),ei())}function ti(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:Qa().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:ei().decode(e.data)}}var si=new Uint8Array([14]);function j_(){return fixEncoderSize(getBytesEncoder(),1).encode(si)}function oi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:si}))}function ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function q_(){return combineCodec(oi(),ci())}function ai(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=p({}),a=m(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:oi().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:ci().decode(e.data)}}var ui=new Uint8Array([25]);function tU(){return fixEncoderSize(getBytesEncoder(),1).encode(ui)}function Ai(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:ui}))}function gi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function rU(){return combineCodec(Ai(),gi())}function yi(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:Ai().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:gi().decode(e.data)}}var Ti=new Uint8Array([15]);function uU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ti)}function li(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Mt()],["secp256r1VerifyArgs",getArrayEncoder(Y())]]),e=>({...e,discriminator:Ti}))}function fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Et()],["secp256r1VerifyArgs",getArrayDecoder(Z())]])}function AU(){return combineCodec(li(),fi())}function Si(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:li().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:fi().decode(e.data)}}var Ci=new Uint8Array([26]);function SU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ci)}function Di(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Mt()],["secp256r1VerifyArgs",getArrayEncoder(Y())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ci}))}function Mi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Et()],["secp256r1VerifyArgs",getArrayDecoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",E()]])}function xU(){return combineCodec(Di(),Mi())}function Ei(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:Di().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:Mi().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",qS=(c=>(c[c.DomainConfig=0]="DomainConfig",c[c.GlobalCounter=1]="GlobalCounter",c[c.Settings=2]="Settings",c[c.TransactionBuffer=3]="TransactionBuffer",c[c.WhitelistedAddressTree=4]="WhitelistedAddressTree",c))(qS||{});function 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,hi;process.env.NODE_ENV!=="production"&&(hi={[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"?hi[e]:"Error message not available in production bundles."}function yW(e,n,r){return isProgramError(e,n,A,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 hn=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!==hn)throw new Error(`Invalid public key length, expected ${hn} 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===hn)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 Ri=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(Xx())],["addressTableLookups",getArrayCodec($x())]]);function vi(e){return Ri.encode({numSigners:e.header.numSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,accountKeys:e.staticAccounts,instructions:e.instructions.map(r=>({programAddressIndex:r.programAddressIndex,accountIndices:r.accountIndices??[],data:Array.from(r.data??[])})),addressTableLookups:e.version!=="legacy"?e.addressTableLookups?.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes,writableIndexes:r.writableIndexes}))??[]:[]})}function bi(e){let n=Ri.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 _i="revibase.com",Ui="https://auth.revibase.com",Wi="https://api.revibase.com";async function vn(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 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 Bi(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 wi(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 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,i=r?.authData&&r.verifyArgs?.clientDataJson?new Uint8Array([...r.authData,...sha256(r.verifyArgs.clientDataJson)]):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:i,publicKey:a}}function Ge(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 Oi(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(Oi(s))||(r.push(s),n.add(Oi(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 ki({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 Ni(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 Fe=null,er=null,tr=null,rr=null,nr,Qt=null,bn=null,sr=null,_n=null,Un=null,Hi=null;function ze(){if(!Fe)throw new Error("Rpc is not initialized yet.");return Fe}function Ke(){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 Vi(){if(!rr)throw new Error("Rpc is not initialized yet.");return rr}function Gi(){if(!nr)throw new Error("Rpc is not initialized yet");return nr}async function rL(){return Qt||(Qt=await Ni(bn??Wi)),Qt}function Wn(){if(!sr)throw new Error("Jito Bundle Config is not set.");return sr}function he(){return _n??Ui}function Fi(){return Un??_i}function or(){return Hi}function nL(){er=null,tr=null,Fe=null,Qt=null,bn=null,sr=null,_n=null,Un=null,rr=null,nr=null;}function sL({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,rpId:i,additionalInfo:a}){Fe=e,er=createRpc(Fe,r,n);let{rpc:o,sendAndConfirmTransaction:d}=createSolanaClient({urlOrMoniker:Fe});rr=d,nr=estimateComputeUnitLimitFactory({rpc:o}),tr=o,bn=t??null,sr=s??null,_n=c??null,Un=i??null,Hi=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=ze().includes("devnet")?localTestActiveStateTreeInfos():await Ke().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function cr(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await rpcRequest(Ke().compressionApiEndpoint,versionedEndpoint("getCompressedAccount"),{hash:void 0,address:e?encodeBN254toBase58(e):void 0}),t;if(featureFlags.isV2()?t=create(s,jsonRpcResultAndContext(nullable(CompressedAccountResultV2))):t=create(s,jsonRpcResultAndContext(nullable(CompressedAccountResult))),"error"in t)throw new SolanaJSONRPCError(t.error,`failed to get info for compressed account ${e?e.toString():""}`);if(t.result.value===null)return null;let c=featureFlags.isV2()?t.result.value.merkleContext.tree:t.result.value.tree,i=ze().includes("devnet")?localTestActiveStateTreeInfos():await Ke().getStateTreeInfos(),a=getStateTreeInfoByPubkey(i,c),o=t.result.value,d=createCompressedAccountWithMerkleContextLegacy(createMerkleContextLegacy(a,o.hash,o.leafIndex),o.owner,bn$1(o.lamports),o.data?parseAccountData(o.data):void 0,o.address||void 0);return d&&n?.set(e.toString(),d),d}}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,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 se(e,n,r,s,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:s[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let o=e.packTreeInfos(a,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function me(e,n,r,s,t){let c=null,i=null,a=new _;if(e){await a.addSystemAccounts();let{address:o}=await $(n,r),d=(await ce([{address:o,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[d.leafIndex],leaves:[],treeInfos:[d.treeInfo],proveByIndices:[d.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:i=await k([d],[]);let u=a.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!u)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:u.packedTreeInfos[0]},data:q().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 Ke().getValidityProofV0(e,n)}catch(c){if(console.error(`Attempt ${t}, Get Validity Proof failed. ${c}`),t++,t>=r)throw new Error(`Failed to get validity proof after ${r} attempts: ${c}`);await new Promise(i=>setTimeout(i,s));}throw new Error(`Failed to get validity proof after ${r} attempts`)}async function Te(){return (await ar()).length-1}var Ln;async function ar(){if(!Ln){let{data:e}=await Ys(te(),await Zi());Ln=e.whitelistedAddressTrees;}return Ln}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 $r(te(),await re(e));return s.exists?{...s.data,members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function On(e){let n=await ar();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function ir(e){let r=(await ar()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function $(e,n=0){let r=await On(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 U(e,n=0){let r=await On(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(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 nd(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function Zi(){let[e]=await getProgramDerivedAddress({programAddress:A,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:A,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:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function re(e){let[n]=await getProgramDerivedAddress({programAddress:A,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 BL(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}var qe=null,ad=2e3,id=3e3,FI=300*1e3;async function ur({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,i)=>{let a=new URL(e).origin,o=null,d=setInterval(()=>{s&&s.closed&&(g(),i(new Error("User closed the authentication window")));},500),u=setTimeout(()=>{y("Authentication timeout."),g(),i(new Error("Authentication timed out"));},FI);function g(){clearInterval(d),clearTimeout(u),o&&clearTimeout(o),qe&&window.removeEventListener("message",qe),s&&s.close();}if(s?s.location.replace(e):s=gd(e),!s){i(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===a,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}},a),o=setTimeout(()=>{g(),i(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{i(new Error("Failed to parse response payload"));}break;case "popup-heartbeat":y("Received heartbeat"),o&&(clearTimeout(o),o=setTimeout(()=>{g(),i(new Error("User closed the authentication window"));},ad+id));break;case "popup-closed":y("Popup explicitly closed"),g(),i(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 Ar(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 gr(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 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 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 i=e[r+1],a=r+2,o=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let y=p256.Point.CURVE().n>>1n,f=BigInt("0x"+gr(u)),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,i,a;if(s)t=n,c=r,i=0,a=0;else {let u=window.screenLeft??window.screenX,g=window.screenTop??window.screenY,y=window.innerWidth??document.documentElement.clientWidth??screen.width,f=window.innerHeight??document.documentElement.clientHeight??screen.height;t=500,c=600,a=u+(y-t)/2,i=g+(f-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 tO(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+gr(n.get(-2))),y:BigInt("0x"+gr(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 rO(e,n=0,r=false){let{authenticatorData:s,clientDataJSON:t,signature:c}=e.authResponse.response,i=new Uint8Array(Ce(s)),a=JSON.parse(new TextDecoder().decode(Ce(t))),o=dd(a),d=Ad(new Uint8Array(Ce(c))),u=await je({rpIdHash:i.subarray(0,32)});return new I(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Ce(t)),truncatedClientDataJson:o,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:u,authData:i,signature:d,originIndex:n,crossOrigin:r})}function nO(e,n){let{authResponse:r,transactionPayload:s,slotHash:t,requestedClient:c,deviceSignature:i}=e,{response:{authenticatorData:a,clientDataJSON:o}}=r,d=new Uint8Array(Ce(a)),u=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(i.publicKey)]))]));if(!equalBytes(new Uint8Array(Ce(u.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 sO(e,n){let{data:r}=await Kn(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 TO(e){let n=await vn(e,true),r=await wi(n.map(getBase64EncodedWireTransaction),ze()),s=await vn(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await AC(s.map(getBase64EncodedWireTransaction))}async function lO({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[i,a]=await Promise.all([Gi()(c),Bi(te(),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 Vi()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}async function AC(e,n=10,r=1e3,s=Wn()){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 fO(e,n=30,r=3e3,s=Wn()){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 SO(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(u=>fd(u.pubkey)===e.toString())??{};if(!c)throw new Error("No permissions found for the current member.");let i=Me.has(c,xe.InitiateTransaction),a=Me.has(c,xe.VoteTransaction),o=Me.has(c,xe.ExecuteTransaction);if(i&&a&&o)return {};if(!a||!o)throw new Error("Signer lacks the required Vote/Execute permissions.");let d=t.members.find(u=>u.role===2);if(!d)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:address(fd(d.pubkey)),userAddressTreeIndex:d.userAddressTreeIndex}}async function xO({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 a=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json();if("error"in a)throw new Error(a.error);return a.signatures.map(o=>({[e]:getBase58Encoder().encode(o)}))}}}function fd(e){return e.keyType===bt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}async function NO({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let{addDelegates:i,removeDelegates:a}=await pC(r),o=new _,d=null,u=null,g=[];if(i.length||a.length||t){let S=await mC({packedAccounts:o,addDelegates:i,removeDelegates:a,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:c});d=S.proof,u=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?[po({configActions:y,payer:s,authority:createNoopSigner(await od(e)),compressedProofArgs:D,settingsMut:u,remainingAccounts:T})]:[await ao({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(i=>U(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=>U(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):U(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 mC({packedAccounts:e,addDelegates:n,removeDelegates:r,compressed:s,index:t,settingsAddressTreeIndex:c,cachedAccounts:i}){await e.addSystemAccounts();let a=[];if(s){let T=(await $(t,c)).address;a.push({address:T,type:"Settings"});}r.length&&a.push(...r),n.length&&a.push(...n);let o=a.length?await ce(a,i):[];if(!o.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let d=await k(o,[]),u=[],g=[];for(let T of o)T.type==="Settings"?u.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),u,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 i=[];for(let a of c.members)if(a.member instanceof I){let o=s.length,{message:d,signature:u,publicKey:g,domainConfig:y}=H(a.member,o);d&&u&&g&&s.push({message:d,signature:u,publicKey:g}),y&&n.addPreAccounts([{address:y,role:AccountRole.READONLY}]);let f=await U(a.member,a.userAddressTreeIndex).then(T=>r.find(C=>new yr(new Uint8Array(C.accountMeta.address)).eq(T.address)));if(!f)throw new Error("Unable to find user account");i.push(xd({permissionArgs:a.permissions,index:o,userMutArgs:f,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 U(o,a.userAddressTreeIndex).then(u=>r.find(g=>new yr(new Uint8Array(g.accountMeta.address)).eq(u.address)));if(!d)throw new Error("Unable to find user account");i.push(xd({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=>U(o.member,o.userAddressTreeIndex).then(d=>{let u=r.find(g=>new yr(new Uint8Array(g.accountMeta.address)).eq(d.address));if(!u)throw new Error("Unable to find user account");return fC({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?U(o.member,o.userAddressTreeIndex).then(d=>r.find(u=>new yr(new Uint8Array(u.accountMeta.address)).eq(d.address))):Promise.resolve(void 0)).then(d=>lC({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 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:Ge(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:Ge(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:Ge(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,Hn=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 a=0;a<r;a++)t.push(c.decode(e,n)),n+=Hn;let i=[];for(let a=0;a<r;a++){let o=fixDecoderSize(getBytesDecoder(),Ze).decode(e,n);n+=Ze;let d=fixDecoderSize(getBytesDecoder(),Xe).decode(e,n);n+=Xe;let u=t[a].messageDataSize,g=fixDecoderSize(getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:i},n]}})}function Rd(){return createEncoder({getSizeFromValue:e=>{let n=Hn*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 GO(){return combineCodec(Rd(),Pd())}function F(e,n){let r=e.length,s=EC+r*Hn,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,g=u+Ze,y=g+Xe;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:y,messageDataSize:d.length,messageInstructionIndex:65535}),s+=Ze+Xe+d.length;}let c=n?.programAddress??hC,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:Rd().encode(i)}}function FO(e){return {programAddress:e.programAddress,accounts:{},data:Pd().decode(e.data)}}async function QO({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new _;await c.addSystemAccounts();let i=await re(e),{address:a}=await $(e,n),o=await ce([{address:a,type:"Settings"}],t),d=await k(o,[]),u=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(xo({settings:i,settingsMutArgs:u,compressedProofArgs:b,payer:r,secp256r1VerifyArgs:T,remainingAccounts:C})),S}async function rB({admin:e,addressTree:n}){return to({payer:e,addressTree:n,remainingAccounts:[]})}async function dB({payer:e,rpId:n,origins:r,authority:s}){let t=await je({rpId:n}),c=new _;await c.addSystemAccounts();let i=await Te(),{address:a,addressTree:o}=await U(s.address,i),d=[{address:a,tree:o,queue:o,type:"User"}],u=await k([],d),g=(await ne(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:y,systemOffset:f}=c.toAccountMetas(),T=v(u,f);return await bo({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:T,payer:e,domainConfig:t,rpId:n,remainingAccounts:y})}async function SB({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new _;await c.addSystemAccounts();let i=[];r.index&&(i.push({address:(await $(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&i.push({address:(await U(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let a=i.length?await ce(i,t):[],o=await Te(),{address:d,addressTree:u}=await U(r.member,o),g=[{address:d,type:"User",tree:u,queue:u}],y=await k(a,g),f=null,T=null,C=a.filter(N=>N.type==="Settings"),D=a.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(a.length),y.roots.slice(a.length),y.rootIndices.slice(a.length),g),{remainingAccounts:S,systemOffset:x}=c.toAccountMetas(),L=v(y,x);return await Lo({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 DB({payer:e}){let n=await nd();return ko({payer:e,globalCounter:n})}async function bB({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 Te(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:y}=await U(u.member.address,s);return {address:g,tree:y,queue:y,type:"User"}})),c=await k([],t),i=await ne(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:o}=r.toAccountMetas(),d=v(c,o);return await jo({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:i[g],transactionManagerUrl:u.role===2?u.transactionManagerUrl:null})),remainingAccounts:a})}async function LB({admin:e,rpId:n,disable:r}){let s=await je({rpId:n});return oc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function VB({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let i=new _;await i.addSystemAccounts();let a=await Te(),{address:o,addressTree:d}=await U(r.address,a),u=[{address:o,tree:d,queue:d,type:"User"}],g=await k([],u),y=(await ne(i,g.treeInfos,g.roots,g.rootIndices,u))[0],f=i.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:v(g,f.systemOffset),authorityCreationArgs:y};}return Ac({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function jB({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,[]),i=se(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:a,systemOffset:o}=s.toAccountMetas(),d=v(c,o);return lc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function ew({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new _;await t.addSystemAccounts();let{address:c,addressTree:i}=await $(r,s),a=[{address:c,tree:i,queue:i,type:"Settings"}],o=await k([],a),d=(await ne(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),y=v(o,g);return Dc({compressedProofArgs:y,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 U(r,s),a=[{address:c,tree:i,queue:i,type:"User"}],o=await k([],a),d=(await ne(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),y=v(o,g);return vc({compressedProofArgs:y,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}async function Rw({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,delegateOperation:t,cachedAccounts:c}){let{domainConfig:i,verifyArgs:a,message:o,signature:d,publicKey:u}=H(r),g=[];o&&d&&u&&g.push({message:o,signature:d,publicKey:u});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;i?y.addPreAccounts([{address:i,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 Fo({settingsIndex:e,payer:n,initialMember:r instanceof I?void 0:r,secp256r1VerifyArgs:a,domainConfig:i,userMutArgs:L,compressedProofArgs:O,settingsCreation:V,delegateOperation:t,remainingAccounts:W})),{instructions:le,secp256r1VerifyInput:g}}async function kw({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new _;await c.addSystemAccounts();let i=await ce([{address:(await $(e,n)).address,type:"Settings"}],t),a=await k(i,[]),o=se(c,a.treeInfos,a.leafIndices,a.rootIndices,a.proveByIndices,i.filter(S=>S.type==="Settings"),q())[0],d=de(s),u=d.filter(S=>S instanceof I),g=[],y=[];for(let S of u){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(a,T),D=[];g.length>0&&D.push(F(g));let b=await re(e);return D.push(Qo({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,i=s-t,a=r-s-c;return n>=r?false:n<i?true:n>=s?n-s<a:false}function OC(e,n){return n<e.header.numSignerAccounts}async function pr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=bi(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),te()):{}),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:WC(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 Ld({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:o=false}){let d=await Ie(e),{accountMetas:u,addressLookupTableAccounts:g}=await pr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(F(c)),y.push(o?yi({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):ai({transactionBuffer:n,payer:s.address,settings:e})),a&&y.push(ki({payer:s,tipAmount:a})),{instructions:y,addressLookupTableAccounts:g}}async function Od({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:i=[],compressed:a=false,simulateProof:o=false,cachedAccounts:d}){let u=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([pr({transactionMessageBytes:r,walletAddress:y,additionalSigners:u.filter(O=>!(O instanceof I)),addressesByLookupTableAddress:c}),me(a,e,n,o,d)]);S.addPreAccounts(f);let x=u.filter(O=>O instanceof I),L=[];for(let O of x){let le=i.length,{domainConfig:ae,verifyArgs:Pe,signature:De,publicKey:Wt,message:Lt}=H(O,le);Lt&&De&&Wt&&i.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=[];i.length>0&&W.push(F(i));let K=wC(C,f);if(a){if(!t||!D)throw new Error("Payer not found or proof args is missing.");let O=v(b,V);W.push(Ei({secp256r1VerifyArgs:L,transactionMessage:K,settingsReadonlyArgs:D,compressedProofArgs:O,payer:t,remainingAccounts:N}));}else W.push(Si({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 gk({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let o=de(s),d=await re(e),u=await Ie(d),{settingsReadonlyArgs:g,proof:y,packedAccounts:f}=await me(a,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)),a){if(!i||!g)throw new Error("Payer not found or proof args is missing.");let x=v(y,b);S.push(Nc({amount:c,settingsReadonlyArgs:g,compressedProofArgs:x,payer:i,secp256r1VerifyArgs:C,source:u,destination:r,remainingAccounts:D}));}else S.push(Wc({amount:c,secp256r1VerifyArgs:C,source:u,destination:r,settings:d,remainingAccounts:D}));return S}async function Ck({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:o,compressed:d=false}){let u=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 u)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(!a||!C)throw new Error("Payer not found or proof args is missing.");let W=v(D,N);V.push(Yc({amount:i,settingsReadonlyArgs:C,compressedProofArgs:W,payer:a,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:f,destination:r,destinationTokenAccount:T,mint:s,tokenProgram:o,remainingAccounts:L}));}else V.push(Fc({amount:i,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:f,destination:r,destinationTokenAccount:T,settings:g,mint:s,tokenProgram:o,remainingAccounts:L}));return V}async function Wk({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:i}){let a=await Fs(te(),s),o=a.data.multiWalletSettings,{settingsReadonlyArgs:d,proof:u,packedAccounts:g}=await me(c,e,n,false,i),{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(u,f);x.push(aa({transactionBuffer:s,domainConfig:T,closer:r instanceof I?void 0:r,rentCollector:a.data.payer,secp256r1VerifyArgs:C,settingsReadonlyArgs:d,payer:t,compressedProofArgs:L,remainingAccounts:y}));}else x.push(ta({transactionBuffer:s,domainConfig:T,closer:r instanceof I?void 0:r,settings:o,payer:a.data.payer,secp256r1VerifyArgs:C,remainingAccounts:[]}));return x}function Nd({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:y,message: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(Sa({transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof I?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},settingsReadonlyArgs:b,compressedProofArgs:S,remainingAccounts:x}));}else D.push(ya({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof I?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},remainingAccounts:[]}));return D}function Hd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:o}=H(e),d=[];return a&&i&&o&&d.push(F([{message:a,signature:i,publicKey:o}])),s?d.push(_a({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(Ea({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?Fa({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):wa({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Gd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:o}=H(n),d=[];return o&&i&&a&&d.push(F([{message:o,signature:i,publicKey:a}])),s?d.push(ti({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(Ya({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof I?void 0:n,remainingAccounts:[]})),d}async function f2({message:e,signer:n,popUp:r}){let s=await ur({authUrl:`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"message",payload:e},signer:n,popUp:r,additionalInfo:or()});return {...s,signer:new ie(s.signer),userAddressTreeIndex:s.userAddressTree?await ir(s.userAddressTree):void 0}}async function D2({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){let c=await ur({authUrl:`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"transaction",payload:JSON.stringify({transactionActionType:e,transactionAddress:n,transactionMessageBytes:Ar(r)})},additionalInfo:or(),signer:s,popUp:t});return {...c,signer:new ie(c.signer),userAddressTreeIndex:c.userAddressTree?await ir(c.userAddressTree):void 0}}async function R2({message:e,response:n,expectedRPID:r=Fi(),expectedOrigin:s=he()}){let{verified:t}=await verifyAuthenticationResponse({response:n.authResponse,expectedChallenge:Ar(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 H2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:y=Math.ceil(s.length/2),cachedAccounts: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 Vn=s.subarray(z,z+y);b.push(Vn),S.push(sha256(Vn));}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]:[],...u]).filter(z=>z instanceof I).map(z=>({memberKey:Ge(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=u.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:i,jitoBundlesTipAmount:a,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 lr=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 fr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,i)=>{s.set(c,i);});let t=c=>{let i=s.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function Fd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=lr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(s??{});for(let y of a){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)}),i.writable.push(...C.writable),i.readonly.push(...C.readonly);}}let[o,d]=t.getMessageComponents(),g=new fr(d,i).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function Q2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Fd({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return vi(s)}async function sN({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i,cachedAccounts:a,compressed:o=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await Od({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:i,simulateProof:d,cachedAccounts:a});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}
2
+ export{Qs as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,Ao as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,oo as CHANGE_CONFIG_DISCRIMINATOR,lo as COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Ro as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Uo as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Bo as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Vo as CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR,Ko as CREATE_USER_ACCOUNTS_DISCRIMINATOR,Zo as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,rc as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Gn as DOMAIN_CONFIG_DISCRIMINATOR,Kt as DelegateOp,dc as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,pc as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,qn as GLOBAL_COUNTER_DISCRIMINATOR,bt as KeyType,xc as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,hc 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,A as MULTI_WALLET_PROGRAM_ADDRESS,qS as MultiWalletAccount,YS as MultiWalletInstruction,Bc as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,_c as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,xe as Permission,Me as Permissions,Ws as SETTINGS_DISCRIMINATOR,ie as Secp256r1Key,I as SignedSecp256r1Key,jc as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Vc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,sa as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,$c as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,Ta as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,ua as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Hs as TRANSACTION_BUFFER_DISCRIMINATOR,Ra as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Ca as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Ha as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,La as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,$a as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Ja as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,ui as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,si as TRANSACTION_EXECUTE_DISCRIMINATOR,Ci as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,Ti as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,He as UserRole,Js as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,rB as addWhitelistedAddressTrees,NO as changeConfig,Wk as closeTransactionBuffer,QO as compressSettingsAccount,vD as configAction,fd as convertMemberKeyToString,Td as convertPubkeyCompressedToCose,tO as convertPubkeyCoseToCompressed,dB as createDomainConfig,SB as createDomainUserAccounts,DB as createGlobalCounter,gd as createPopUp,Nd as createTransactionBuffer,gC as createTransactionManagerSigner,bB as createUserAccounts,Rw as createWallet,zn as decodeDomainConfig,Zn as decodeGlobalCounter,Os as decodeSettings,Gs as decodeTransactionBuffer,qs as decodeWhitelistedAddressTree,kw as decompressSettingsAccount,LB as disableDomainConfig,VB as editDomainConfig,jB 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,Kn as fetchDomainConfig,ZC as fetchGlobalCounter,nu as fetchMaybeDomainConfig,Su as fetchMaybeGlobalCounter,$r as fetchMaybeSettings,HI as fetchMaybeSettingsAccountData,tp as fetchMaybeTransactionBuffer,NI as fetchMaybeUserAccountData,Ip as fetchMaybeWhitelistedAddressTree,xh as fetchSettings,$i as fetchSettingsAccountData,Fs as fetchTransactionBuffer,Xi as fetchUserAccountData,Ys as fetchWhitelistedAddressTree,rD as getAddMemberArgsCodec,xr as getAddMemberArgsDecoder,Sr as getAddMemberArgsEncoder,Zh as getAddWhitelistedAddressTreesDiscriminatorBytes,$h as getAddWhitelistedAddressTreesInstruction,to as getAddWhitelistedAddressTreesInstructionAsync,Xh as getAddWhitelistedAddressTreesInstructionDataCodec,eo as getAddWhitelistedAddressTreesInstructionDataDecoder,cn as getAddWhitelistedAddressTreesInstructionDataEncoder,he as getAuthEndpoint,TP as getChangeConfigCompressedDiscriminatorBytes,po as getChangeConfigCompressedInstruction,lP as getChangeConfigCompressedInstructionDataCodec,yo as getChangeConfigCompressedInstructionDataDecoder,go as getChangeConfigCompressedInstructionDataEncoder,cP as getChangeConfigDiscriminatorBytes,iP as getChangeConfigInstruction,ao as getChangeConfigInstructionAsync,aP as getChangeConfigInstructionDataCodec,co as getChangeConfigInstructionDataDecoder,an as getChangeConfigInstructionDataEncoder,oD as getCompiledInstructionCodec,Cr as getCompiledInstructionDecoder,Ir as getCompiledInstructionEncoder,EP as getCompressSettingsAccountDiscriminatorBytes,xo as getCompressSettingsAccountInstruction,hP as getCompressSettingsAccountInstructionDataCodec,So as getCompressSettingsAccountInstructionDataDecoder,fo as getCompressSettingsAccountInstructionDataEncoder,dD as getCompressedAccountMetaCodec,nt as getCompressedAccountMetaDecoder,rt as getCompressedAccountMetaEncoder,yD as getCompressedAccountMetaReadOnlyCodec,at as getCompressedAccountMetaReadOnlyDecoder,ct as getCompressedAccountMetaReadOnlyEncoder,TD as getCompressedProofCodec,Rr as getCompressedProofDecoder,Pr as getCompressedProofEncoder,$ as getCompressedSettingsAddressFromIndex,xD as getCompressedSettingsCodec,MD as getCompressedSettingsDataCodec,ut as getCompressedSettingsDataDecoder,dt as getCompressedSettingsDataEncoder,q as getCompressedSettingsDecoder,it as getCompressedSettingsEncoder,Gi as getComputeBudgetEstimate,RD as getConfigActionCodec,pt as getConfigActionDecoder,yt as getConfigActionEncoder,LP as getCreateDomainConfigDiscriminatorBytes,BP as getCreateDomainConfigInstruction,bo as getCreateDomainConfigInstructionAsync,OP as getCreateDomainConfigInstructionDataCodec,vo as getCreateDomainConfigInstructionDataDecoder,un as getCreateDomainConfigInstructionDataEncoder,zP as getCreateDomainUserAccountDiscriminatorBytes,JP as getCreateDomainUserAccountInstruction,Lo as getCreateDomainUserAccountInstructionAsync,KP as getCreateDomainUserAccountInstructionDataCodec,Wo as getCreateDomainUserAccountInstructionDataDecoder,gn as getCreateDomainUserAccountInstructionDataEncoder,QP as getCreateGlobalCounterDiscriminatorBytes,tR as getCreateGlobalCounterInstruction,ko as getCreateGlobalCounterInstructionAsync,eR as getCreateGlobalCounterInstructionDataCodec,wo as getCreateGlobalCounterInstructionDataDecoder,pn as getCreateGlobalCounterInstructionDataEncoder,dR as getCreateMultiWalletCompressedDiscriminatorBytes,AR as getCreateMultiWalletCompressedInstruction,Fo as getCreateMultiWalletCompressedInstructionAsync,uR as getCreateMultiWalletCompressedInstructionDataCodec,Go as getCreateMultiWalletCompressedInstructionDataDecoder,mn as getCreateMultiWalletCompressedInstructionDataEncoder,LD as getCreateUserAccountArgsCodec,Br as getCreateUserAccountArgsDecoder,Or as getCreateUserAccountArgsEncoder,SR as getCreateUserAccountsDiscriminatorBytes,IR as getCreateUserAccountsInstruction,jo as getCreateUserAccountsInstructionAsync,xR as getCreateUserAccountsInstructionDataCodec,Jo as getCreateUserAccountsInstructionDataDecoder,ln as getCreateUserAccountsInstructionDataEncoder,vR as getDecompressSettingsAccountDiscriminatorBytes,Qo as getDecompressSettingsAccountInstruction,bR as getDecompressSettingsAccountInstructionDataCodec,$o as getDecompressSettingsAccountInstructionDataDecoder,Xo as getDecompressSettingsAccountInstructionDataEncoder,wD as getDelegateOpCodec,ve as getDelegateOpDecoder,Re as getDelegateOpEncoder,wR as getDisableDomainConfigDiscriminatorBytes,oc as getDisableDomainConfigInstruction,kR as getDisableDomainConfigInstructionDataCodec,sc as getDisableDomainConfigInstructionDataDecoder,nc as getDisableDomainConfigInstructionDataEncoder,je as getDomainConfigAddress,FC as getDomainConfigCodec,Fn as getDomainConfigDecoder,GC as getDomainConfigDiscriminatorBytes,ru as getDomainConfigEncoder,KC as getDomainConfigSize,JR as getEditDomainConfigDiscriminatorBytes,Ac as getEditDomainConfigInstruction,qR as getEditDomainConfigInstructionAsync,jR as getEditDomainConfigInstructionDataCodec,uc as getEditDomainConfigInstructionDataDecoder,Sn as getEditDomainConfigInstructionDataEncoder,VD as getEditMemberArgsCodec,Ur as getEditMemberArgsDecoder,_r as getEditMemberArgsEncoder,rv as getEditTransactionManagerUrlDiscriminatorBytes,lc as getEditTransactionManagerUrlInstruction,nv as getEditTransactionManagerUrlInstructionDataCodec,Tc as getEditTransactionManagerUrlInstructionDataDecoder,mc as getEditTransactionManagerUrlInstructionDataEncoder,KD as getExpectedSecp256r1SignersCodec,Tt as getExpectedSecp256r1SignersDecoder,mt as getExpectedSecp256r1SignersEncoder,rL as getFeePayer,or as getGlobalAdditonalInfo,nd as getGlobalCounterAddress,YC as getGlobalCounterCodec,Yn as getGlobalCounterDecoder,qC as getGlobalCounterDiscriminatorBytes,fu as getGlobalCounterEncoder,$C as getGlobalCounterSize,Wn as getJitoTipsConfig,BL as getLightCpiSigner,Ke as getLightProtocolRpc,YD as getLinkWalletArgsCodec,kr as getLinkWalletArgsDecoder,wr as getLinkWalletArgsEncoder,QD as getMemberCodec,gt as getMemberDecoder,At as getMemberEncoder,rM as getMemberKeyCodec,j as getMemberKeyDecoder,J as getMemberKeyEncoder,Av as getMigrateCompressedSettingsDiscriminatorBytes,Dc as getMigrateCompressedSettingsInstruction,gv as getMigrateCompressedSettingsInstructionDataCodec,Cc as getMigrateCompressedSettingsInstructionDataDecoder,Ic as getMigrateCompressedSettingsInstructionDataEncoder,xv as getMigrateCompressedUsersDiscriminatorBytes,vc as getMigrateCompressedUsersInstruction,Iv as getMigrateCompressedUsersInstructionDataCodec,Rc as getMigrateCompressedUsersInstructionDataDecoder,Pc as getMigrateCompressedUsersInstructionDataEncoder,gW as getMultiWalletErrorMessage,Nv as getNativeTransferIntentCompressedDiscriminatorBytes,Nc as getNativeTransferIntentCompressedInstruction,Hv as getNativeTransferIntentCompressedInstructionDataCodec,kc as getNativeTransferIntentCompressedInstructionDataDecoder,wc as getNativeTransferIntentCompressedInstructionDataEncoder,vv as getNativeTransferIntentDiscriminatorBytes,Wc as getNativeTransferIntentInstruction,_v as getNativeTransferIntentInstructionAsync,bv as getNativeTransferIntentInstructionDataCodec,Uc as getNativeTransferIntentInstructionDataDecoder,xn as getNativeTransferIntentInstructionDataEncoder,cM as getNewAuthorityArgsCodec,Hr as getNewAuthorityArgsDecoder,Nr as getNewAuthorityArgsEncoder,sO 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,Lr as getRemoveMemberArgsDecoder,Wr as getRemoveMemberArgsEncoder,Fi as getRpId,hM as getSecp256r1PubkeyCodec,St as getSecp256r1PubkeyDecoder,Vr 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,GO as getSecp256r1VerifyInstructionDataCodec,Pd as getSecp256r1VerifyInstructionDataDecoder,Rd as getSecp256r1VerifyInstructionDataEncoder,Vi as getSendAndConfirmTransaction,Sh as getSettingsCodec,wM as getSettingsCreationArgsCodec,It as getSettingsCreationArgsDecoder,xt as getSettingsCreationArgsEncoder,Ls as getSettingsDecoder,fh as getSettingsDiscriminatorBytes,Wy as getSettingsEncoder,re as getSettingsFromIndex,HM as getSettingsIndexWithAddressCodec,Fr as getSettingsIndexWithAddressDecoder,Gr as getSettingsIndexWithAddressEncoder,zM as getSettingsMutArgsCodec,Se as getSettingsMutArgsDecoder,fe as getSettingsMutArgsEncoder,qM as getSettingsReadonlyArgsCodec,ee as getSettingsReadonlyArgsDecoder,Q as getSettingsReadonlyArgsEncoder,Ch as getSettingsSize,rO as getSignedSecp256r1Key,xO as getSignedTransactionManager,te as getSolanaRpc,ze as getSolanaRpcEndpoint,sb as getTokenTransferIntentCompressedDiscriminatorBytes,Yc as getTokenTransferIntentCompressedInstruction,cb as getTokenTransferIntentCompressedInstructionAsync,ob as getTokenTransferIntentCompressedInstructionDataCodec,qc as getTokenTransferIntentCompressedInstructionDataDecoder,Dn as getTokenTransferIntentCompressedInstructionDataEncoder,qv as getTokenTransferIntentDiscriminatorBytes,Fc as getTokenTransferIntentInstruction,Zv as getTokenTransferIntentInstructionAsync,Yv as getTokenTransferIntentInstructionDataCodec,Gc as getTokenTransferIntentInstructionDataDecoder,Cn as getTokenTransferIntentInstructionDataEncoder,sd as getTransactionBufferAddress,Db as getTransactionBufferCloseCompressedDiscriminatorBytes,aa as getTransactionBufferCloseCompressedInstruction,Mb as getTransactionBufferCloseCompressedInstructionDataCodec,ca as getTransactionBufferCloseCompressedInstructionDataDecoder,oa as getTransactionBufferCloseCompressedInstructionDataEncoder,pb as getTransactionBufferCloseDiscriminatorBytes,ta as getTransactionBufferCloseInstruction,mb as getTransactionBufferCloseInstructionDataCodec,ea as getTransactionBufferCloseInstructionDataDecoder,Qc as getTransactionBufferCloseInstructionDataEncoder,Ph as getTransactionBufferCodec,$M as getTransactionBufferCreateArgsCodec,Dt as getTransactionBufferCreateArgsDecoder,Ct as getTransactionBufferCreateArgsEncoder,Vb as getTransactionBufferCreateCompressedDiscriminatorBytes,Sa as getTransactionBufferCreateCompressedInstruction,Gb as getTransactionBufferCreateCompressedInstructionDataCodec,fa as getTransactionBufferCreateCompressedInstructionDataDecoder,la as getTransactionBufferCreateCompressedInstructionDataEncoder,Ub as getTransactionBufferCreateDiscriminatorBytes,ya as getTransactionBufferCreateInstruction,Wb as getTransactionBufferCreateInstructionDataCodec,ga as getTransactionBufferCreateInstructionDataDecoder,Aa as getTransactionBufferCreateInstructionDataEncoder,Vs as getTransactionBufferDecoder,hh as getTransactionBufferDiscriminatorBytes,ep as getTransactionBufferEncoder,o_ as getTransactionBufferExecuteCompressedDiscriminatorBytes,_a as getTransactionBufferExecuteCompressedInstruction,c_ as getTransactionBufferExecuteCompressedInstructionDataCodec,ba as getTransactionBufferExecuteCompressedInstructionDataDecoder,va as getTransactionBufferExecuteCompressedInstructionDataEncoder,Zb as getTransactionBufferExecuteDiscriminatorBytes,Ea as getTransactionBufferExecuteInstruction,Xb as getTransactionBufferExecuteInstructionDataCodec,Ma as getTransactionBufferExecuteInstructionDataDecoder,Da as getTransactionBufferExecuteInstructionDataEncoder,I_ as getTransactionBufferExtendCompressedDiscriminatorBytes,Fa as getTransactionBufferExtendCompressedInstruction,C_ as getTransactionBufferExtendCompressedInstructionDataCodec,Ga as getTransactionBufferExtendCompressedInstructionDataDecoder,Va as getTransactionBufferExtendCompressedInstructionDataEncoder,y_ as getTransactionBufferExtendDiscriminatorBytes,wa as getTransactionBufferExtendInstruction,p_ as getTransactionBufferExtendInstructionDataCodec,Ba as getTransactionBufferExtendInstructionDataDecoder,Oa as getTransactionBufferExtendInstructionDataEncoder,N_ as getTransactionBufferVoteCompressedDiscriminatorBytes,ti as getTransactionBufferVoteCompressedInstruction,H_ as getTransactionBufferVoteCompressedInstructionDataCodec,ei as getTransactionBufferVoteCompressedInstructionDataDecoder,Qa as getTransactionBufferVoteCompressedInstructionDataEncoder,b_ as getTransactionBufferVoteDiscriminatorBytes,Ya as getTransactionBufferVoteInstruction,__ as getTransactionBufferVoteInstructionDataCodec,qa as getTransactionBufferVoteInstructionDataDecoder,ja as getTransactionBufferVoteInstructionDataEncoder,tU as getTransactionExecuteCompressedDiscriminatorBytes,yi as getTransactionExecuteCompressedInstruction,rU as getTransactionExecuteCompressedInstructionDataCodec,gi as getTransactionExecuteCompressedInstructionDataDecoder,Ai as getTransactionExecuteCompressedInstructionDataEncoder,j_ as getTransactionExecuteDiscriminatorBytes,ai as getTransactionExecuteInstruction,q_ as getTransactionExecuteInstructionDataCodec,ci as getTransactionExecuteInstructionDataDecoder,oi as getTransactionExecuteInstructionDataEncoder,SU as getTransactionExecuteSyncCompressedDiscriminatorBytes,Ei as getTransactionExecuteSyncCompressedInstruction,xU as getTransactionExecuteSyncCompressedInstructionDataCodec,Mi as getTransactionExecuteSyncCompressedInstructionDataDecoder,Di as getTransactionExecuteSyncCompressedInstructionDataEncoder,uU as getTransactionExecuteSyncDiscriminatorBytes,Si as getTransactionExecuteSyncInstruction,AU as getTransactionExecuteSyncInstructionDataCodec,fi as getTransactionExecuteSyncInstructionDataDecoder,li as getTransactionExecuteSyncInstructionDataEncoder,oE as getTransactionMessageAddressTableLookupCodec,Kr as getTransactionMessageAddressTableLookupDecoder,zr 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,Yr as getUserReadOnlyArgsDecoder,qr 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,On as getWhitelistedAddressTreeFromIndex,ir as getWhitelistedAddressTreeIndexFromAddress,Zi as getWhitelistedAddressTreesAddress,oW as identifyMultiWalletAccount,cW as identifyMultiWalletInstruction,sL as initialize,bD as isConfigAction,yW as isMultiWalletError,PE as isUserReadOnlyOrMutateArgs,ew as migrateSettings,aw as migrateUsers,gk 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,FO 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,fO as pollJitoBundleConfirmation,H2 as prepareTransactionBundle,Q2 as prepareTransactionMessage,sN as prepareTransactionSync,SO as retrieveTransactionManager,AC as sendJitoBundle,TO as signAndSendBundledTransactions,lO as signAndSendTransaction,f2 as signMessageWithPasskey,D2 as signTransactionWithPasskey,Ck as tokenTransferIntent,nL as uninitialize,hE as userReadOnlyOrMutateArgs,bi as vaultTransactionMessageDeserialize,vi as vaultTransactionMessageSerialize,R2 as verifyMessage,nO as verifyTransactionAuthResponseWithMessageHash,Gd as voteTransactionBuffer};//# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map