@revibase/core 0.0.1 → 0.0.3

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,getU16Encoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getU16Decoder,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,getOptionEncoder,getBooleanEncoder,getOptionDecoder,getBooleanDecoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getArrayEncoder,getArrayDecoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getEnumEncoder,getEnumDecoder,getU64Encoder,getU64Decoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,getBase64Decoder,AccountRole,createNoopSigner,some,none,createDecoder,createEncoder,upgradeRoleToSigner,getTransactionEncoder,getBlockhashDecoder,compileTransaction,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import Vx from'bn.js';import {VERSION,featureFlags,deriveAddressSeedV2,batchAddressTree,createBN254,deriveAddressV2,createRpc,getLightSystemAccountMetasV2,TreeType,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 {verifyAuthenticationResponse}from'@simplewebauthn/server';var hn=new Uint8Array([201,232,212,229,59,241,106,197]);function mI(){return fixEncoderSize(getBytesEncoder(),8).encode(hn)}function Bu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["numOrigins",getU16Encoder()],["authority",getAddressEncoder()],["rpIdHash",fixEncoderSize(getBytesEncoder(),32)],["bump",getU8Encoder()],["isDisabled",getU8Encoder()],["rpIdLength",getU8Encoder()],["rpId",fixEncoderSize(getBytesEncoder(),255)],["origins",fixEncoderSize(getBytesEncoder(),413)],["metadataUrlLength",getU8Encoder()],["metadataUrl",fixEncoderSize(getBytesEncoder(),100)]]),e=>({...e,discriminator:hn}))}function vn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["numOrigins",getU16Decoder()],["authority",getAddressDecoder()],["rpIdHash",fixDecoderSize(getBytesDecoder(),32)],["bump",getU8Decoder()],["isDisabled",getU8Decoder()],["rpIdLength",getU8Decoder()],["rpId",fixDecoderSize(getBytesDecoder(),255)],["origins",fixDecoderSize(getBytesDecoder(),413)],["metadataUrlLength",getU8Decoder()],["metadataUrl",fixDecoderSize(getBytesDecoder(),100)]])}function pI(){return combineCodec(Bu(),vn())}function bn(e){return decodeAccount(e,vn())}async function _n(e,n,r){let s=await Lu(e,n,r);return assertAccountExists(s),s}async function Lu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return bn(s)}async function fI(e,n,r){let s=await ku(e,n,r);return assertAccountsExist(s),s}async function ku(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>bn(t))}function lI(){return 846}var On=new Uint8Array([42,206,176,58,175,129,130,233]);function xI(){return fixEncoderSize(getBytesEncoder(),8).encode(On)}function Xu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:On}))}function Bn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function II(){return combineCodec(Xu(),Bn())}function Ln(e){return decodeAccount(e,Bn())}async function CI(e,n,r){let s=await $u(e,n,r);return assertAccountExists(s),s}async function $u(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Ln(s)}async function DI(e,n,r){let s=await Qu(e,n,r);return assertAccountsExist(s),s}async function Qu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ln(t))}function MI(){return 24}function or(){return getStructEncoder([["member",Ce()],["verifyArgs",getOptionEncoder(B())],["userArgs",Je()],["setAsDelegate",getBooleanEncoder()]])}function cr(){return getStructDecoder([["member",De()],["verifyArgs",getOptionDecoder(L())],["userArgs",je()],["setAsDelegate",getBooleanDecoder()]])}function hI(){return combineCodec(or(),cr())}function ar(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function ir(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function _I(){return combineCodec(ar(),ir())}function Ye(){return getStructEncoder([["treeInfo",qe()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function Ze(){return getStructDecoder([["treeInfo",Xe()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function BI(){return combineCodec(Ye(),Ze())}function $e(){return getStructEncoder([["treeInfo",qe()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function Qe(){return getStructDecoder([["treeInfo",Xe()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function NI(){return combineCodec($e(),Qe())}function yr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function mr(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function GI(){return combineCodec(yr(),mr())}function et(){return getStructEncoder([["data",getOptionEncoder(tt())]])}function G(){return getStructDecoder([["data",getOptionDecoder(rt())]])}function JI(){return combineCodec(et(),G())}function tt(){return getStructEncoder([["threshold",getU8Encoder()],["bump",getU8Encoder()],["index",getU128Encoder()],["multiWalletBump",getU8Encoder()],["members",getArrayEncoder(Ce())]])}function rt(){return getStructDecoder([["threshold",getU8Decoder()],["bump",getU8Decoder()],["index",getU128Decoder()],["multiWalletBump",getU8Decoder()],["members",getArrayDecoder(De())]])}function qI(){return combineCodec(tt(),rt())}function nt(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Sr())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(or())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Ir())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function st(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(xr())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(cr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Cr())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function eC(){return combineCodec(nt(),st())}function tC(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function rC(e,n){return n.__kind===e}function Dr(){return getStructEncoder([["member",getAddressEncoder()],["isPermanentMember",getBooleanEncoder()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Me()]])}function Mr(){return getStructDecoder([["member",getAddressDecoder()],["isPermanentMember",getBooleanDecoder()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",Ee()]])}function cC(){return combineCodec(Dr(),Mr())}var bt=(s=>(s[s.Add=0]="Add",s[s.Remove=1]="Remove",s[s.Ignore=2]="Ignore",s))(bt||{});function Er(){return getEnumEncoder(bt)}function Pr(){return getEnumDecoder(bt)}function uC(){return combineCodec(Er(),Pr())}function Sr(){return getStructEncoder([["memberKey",ae()],["permissions",ot()],["userArgs",getOptionEncoder(re())],["delegateOperation",Er()]])}function xr(){return getStructDecoder([["memberKey",ie()],["permissions",ct()],["userArgs",getOptionDecoder(ne())],["delegateOperation",Pr()]])}function yC(){return combineCodec(Sr(),xr())}function Rr(){return getStructEncoder([["settingsMutArgs",ye()],["transactionManager",getOptionEncoder(re())]])}function hr(){return getStructDecoder([["settingsMutArgs",me()],["transactionManager",getOptionDecoder(ne())]])}function lC(){return combineCodec(Rr(),hr())}function Ce(){return getStructEncoder([["pubkey",ae()],["permissions",ot()]])}function De(){return getStructDecoder([["pubkey",ie()],["permissions",ct()]])}function IC(){return combineCodec(Ce(),De())}function ae(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function ie(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function MC(){return combineCodec(ae(),ie())}function at(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function it(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function RC(){return combineCodec(at(),it())}function qe(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function Xe(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function bC(){return combineCodec(qe(),Xe())}function ot(){return getStructEncoder([["mask",getU8Encoder()]])}function ct(){return getStructDecoder([["mask",getU8Decoder()]])}function WC(){return combineCodec(ot(),ct())}function P(){return getStructEncoder([["proof",getOptionEncoder(yr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function R(){return getStructDecoder([["proof",getOptionDecoder(mr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function kC(){return combineCodec(P(),R())}function Ir(){return getStructEncoder([["memberKey",ae()],["userArgs",Je()]])}function Cr(){return getStructDecoder([["memberKey",ie()],["userArgs",je()]])}function VC(){return combineCodec(Ir(),Cr())}function vr(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function ut(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function zC(){return combineCodec(vr(),ut())}function B(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function L(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function jC(){return combineCodec(B(),L())}function J(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",B()]])}function j(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",L()]])}function XC(){return combineCodec(J(),j())}function br(){return getDiscriminatedUnionEncoder([["Create",getStructEncoder([["fields",getTupleEncoder([Pe()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([ye()])]])]])}function _r(){return getDiscriminatedUnionDecoder([["Create",getStructDecoder([["fields",getTupleDecoder([Re()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([me()])]])]])}function tD(){return combineCodec(br(),_r())}function rD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function nD(e,n){return n.__kind===e}function Pe(){return getStructEncoder([["addressTreeInfo",at()],["outputStateTreeIndex",getU8Encoder()]])}function Re(){return getStructDecoder([["addressTreeInfo",it()],["outputStateTreeIndex",getU8Decoder()]])}function aD(){return combineCodec(Pe(),Re())}function ye(){return getStructEncoder([["accountMeta",Ye()],["data",et()]])}function me(){return getStructDecoder([["accountMeta",Ze()],["data",G()]])}function gD(){return combineCodec(ye(),me())}function X(){return getStructEncoder([["accountMeta",$e()],["data",et()]])}function $(){return getStructDecoder([["accountMeta",Qe()],["data",G()]])}function pD(){return combineCodec(X(),$())}function dt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()]])}function gt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()]])}function TD(){return combineCodec(dt(),gt())}function At(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(ar())],["addressTableLookups",getArrayEncoder(Ur())]])}function yt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(ir())],["addressTableLookups",getArrayDecoder(Wr())]])}function CD(){return combineCodec(At(),yt())}function Ur(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Wr(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function ED(){return combineCodec(Ur(),Wr())}function he(){return getStructEncoder([["member",ae()],["domainConfig",getOptionEncoder(getAddressEncoder())],["isPermanentMember",getBooleanEncoder()],["settingsIndex",getOptionEncoder(getU128Encoder())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]])}function Y(){return getStructDecoder([["member",ie()],["domainConfig",getOptionDecoder(getAddressDecoder())],["isPermanentMember",getBooleanDecoder()],["settingsIndex",getOptionDecoder(getU128Decoder())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function vD(){return combineCodec(he(),Y())}function Me(){return getStructEncoder([["addressTreeInfo",at()],["outputStateTreeIndex",getU8Encoder()]])}function Ee(){return getStructDecoder([["addressTreeInfo",it()],["outputStateTreeIndex",getU8Decoder()]])}function WD(){return combineCodec(Me(),Ee())}function re(){return getStructEncoder([["accountMeta",Ye()],["data",he()]])}function ne(){return getStructDecoder([["accountMeta",Ze()],["data",Y()]])}function kD(){return combineCodec(re(),ne())}function Lr(){return getStructEncoder([["accountMeta",$e()],["data",he()]])}function kr(){return getStructDecoder([["accountMeta",Qe()],["data",Y()]])}function VD(){return combineCodec(Lr(),kr())}function Je(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Lr()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([re()])]])]])}function je(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([kr()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([ne()])]])]])}function KD(){return combineCodec(Je(),je())}function JD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function jD(e,n){return n.__kind===e}var ls=new Uint8Array([223,179,163,190,177,224,67,173]);function UM(){return fixEncoderSize(getBytesEncoder(),8).encode(ls)}function ny(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(Ce(),{size:4})],["membersLen",getU8Encoder()],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()]]),e=>({...e,discriminator:ls}))}function Ts(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(De(),{size:4})],["membersLen",getU8Decoder()],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()]])}function WM(){return combineCodec(ny(),Ts())}function Ss(e){return decodeAccount(e,Ts())}async function OM(e,n,r){let s=await wr(e,n,r);return assertAccountExists(s),s}async function wr(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Ss(s)}async function BM(e,n,r){let s=await sy(e,n,r);return assertAccountsExist(s),s}async function sy(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Ss(t))}function LM(){return 168}var Ps=new Uint8Array([90,36,35,219,93,225,110,96]);function HM(){return fixEncoderSize(getBytesEncoder(),8).encode(Ps)}function Cy(){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",ae()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(ae())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Ps}))}function Rs(){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",ie()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(ie())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function VM(){return combineCodec(Cy(),Rs())}function hs(e){return decodeAccount(e,Rs())}async function vs(e,n,r){let s=await Dy(e,n,r);return assertAccountExists(s),s}async function Dy(e,n,r){let s=await fetchEncodedAccount(e,n,r);return hs(s)}async function GM(e,n,r){let s=await My(e,n,r);return assertAccountsExist(s),s}async function My(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>hs(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 kt(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function H(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:H(r.value),role:bs(r.value)?upgradeRoleToSigner(s):s,...bs(r.value)?{signer:r.value}:{}})}}function bs(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Os=new Uint8Array([8]);function oE(){return fixEncoderSize(getBytesEncoder(),1).encode(Os)}function Fr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(nt())],["compressedProofArgs",getOptionEncoder(P())]]),e=>({...e,discriminator:Os}))}function Bs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(st())],["compressedProofArgs",getOptionDecoder(R())]])}function cE(){return combineCodec(Fr(),Bs())}async function Ls(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.settings.value||(t.settings.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getU128Encoder().encode(kt(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(H(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Fr().encode(c),programAddress:r})}function aE(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Fr().encode(c),programAddress:r})}function iE(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Bs().decode(e.data)}}var Ns=new Uint8Array([19]);function pE(){return fixEncoderSize(getBytesEncoder(),1).encode(Ns)}function Hs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(nt())],["settingsMut",ye()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Ns}))}function Vs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(st())],["settingsMut",me()],["compressedProofArgs",R()]])}function fE(){return combineCodec(Hs(),Vs())}function Gs(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.authority),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Hs().encode(c),programAddress:r})}function lE(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),authority:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Vs().decode(e.data)}}var Ks=new Uint8Array([16]);function ME(){return fixEncoderSize(getBytesEncoder(),1).encode(Ks)}function Js(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["settingsArg",br()],["secp256r1VerifyArgs",getArrayEncoder(J())]]),e=>({...e,discriminator:Ks}))}function js(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",R()],["settingsArg",_r()],["secp256r1VerifyArgs",getArrayDecoder(j())]])}function EE(){return combineCodec(Js(),js())}function Ys(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Js().encode(c),programAddress:r})}function PE(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:js().decode(e.data)}}var Xs=new Uint8Array([0]);function UE(){return fixEncoderSize(getBytesEncoder(),1).encode(Xs)}function $s(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authority",getAddressEncoder()],["metadataUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),e=>({...e,discriminator:Xs}))}function Qs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authority",getAddressDecoder()],["metadataUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function WE(){return combineCodec($s(),Qs())}function eo(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},adminDomainConfig:{value:e.adminDomainConfig??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.systemProgram),o(t.adminDomainConfig),...i],data:$s().encode(c),programAddress:r})}function OE(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),systemProgram:r(),adminDomainConfig:s()},data:Qs().decode(e.data)}}var no=new Uint8Array([4]);function VE(){return fixEncoderSize(getBytesEncoder(),1).encode(no)}function so(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["member",vr()],["isPermanentMember",getBooleanEncoder()],["userAccountCreationArgs",Me()],["linkWalletArgs",getOptionEncoder(Rr())]]),e=>({...e,discriminator:no}))}function oo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",R()],["member",ut()],["isPermanentMember",getBooleanDecoder()],["userAccountCreationArgs",Ee()],["linkWalletArgs",getOptionDecoder(hr())]])}function GE(){return combineCodec(so(),oo())}function co(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),...i],data:so().encode(c),programAddress:r})}function FE(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(),domainConfig:r(),authority:r()},data:oo().decode(e.data)}}var io=new Uint8Array([3]);function ZE(){return fixEncoderSize(getBytesEncoder(),1).encode(io)}function Xr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:io}))}function uo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function qE(){return combineCodec(Xr(),uo())}async function go(e,n){let r=n?.programAddress??d,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=p(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Xr().encode({}),programAddress:r})}function XE(e,n){let r=n?.programAddress??d,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=p(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Xr().encode({}),programAddress:r})}function $E(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:uo().decode(e.data)}}var mo=new Uint8Array([7]);function oP(){return fixEncoderSize(getBytesEncoder(),1).encode(mo)}function Qr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["secp256r1VerifyArgs",getOptionEncoder(B())],["userMutArgs",re()],["compressedProofArgs",P()],["setAsDelegate",getBooleanEncoder()]]),e=>({...e,discriminator:mo}))}function po(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["secp256r1VerifyArgs",getOptionDecoder(L())],["userMutArgs",ne()],["compressedProofArgs",R()],["setAsDelegate",getBooleanDecoder()]])}function cP(){return combineCodec(Qr(),po())}async function aP(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},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}},c={...e},a={args:c};t.settings.value||(t.settings.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getU128Encoder().encode(kt(c.settingsIndex))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),...i],data:Qr().encode(c),programAddress:r})}function fo(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},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}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),...i],data:Qr().encode(c),programAddress:r})}function iP(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),initialMember:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s(),globalCounter:r()},data:po().decode(e.data)}}var So=new Uint8Array([18]);function pP(){return fixEncoderSize(getBytesEncoder(),1).encode(So)}function xo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["compressedProofArgs",P()],["settingsCreation",Pe()],["userMutArgs",re()],["settingsIndex",getU128Encoder()],["setAsDelegate",getBooleanEncoder()]]),e=>({...e,discriminator:So}))}function Io(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(L())],["compressedProofArgs",R()],["settingsCreation",Re()],["userMutArgs",ne()],["settingsIndex",getU128Decoder()],["setAsDelegate",getBooleanDecoder()]])}function fP(){return combineCodec(xo(),Io())}function Co(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},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}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),...i],data:xo().encode(c),programAddress:r})}function lP(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s(),globalCounter:r()},data:Io().decode(e.data)}}var Eo=new Uint8Array([5]);function MP(){return fixEncoderSize(getBytesEncoder(),1).encode(Eo)}function Po(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",P()],["createUserArgs",getArrayEncoder(Dr())]]),e=>({...e,discriminator:Eo}))}function Ro(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",R()],["createUserArgs",getArrayDecoder(Mr())]])}function EP(){return combineCodec(Po(),Ro())}function ho(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),...i],data:Po().encode(c),programAddress:r})}function PP(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(),systemProgram:r()},data:Ro().decode(e.data)}}var _o=new Uint8Array([17]);function WP(){return fixEncoderSize(getBytesEncoder(),1).encode(_o)}function Uo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMut",ye()],["compressedProofArgs",P()],["secp256r1VerifyArgs",getArrayEncoder(J())]]),e=>({...e,discriminator:_o}))}function Wo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMut",me()],["compressedProofArgs",R()],["secp256r1VerifyArgs",getArrayDecoder(j())]])}function OP(){return combineCodec(Uo(),Wo())}function Oo(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Uo().encode(c),programAddress:r})}function BP(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Wo().decode(e.data)}}var ko=new Uint8Array([2]);function VP(){return fixEncoderSize(getBytesEncoder(),1).encode(ko)}function wo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:ko}))}function No(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function GP(){return combineCodec(wo(),No())}function Ho(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false},adminDomainConfig:{value:e.adminDomainConfig??null,isWritable:false}},c={...e},a={args:c};t.adminDomainConfig.value||(t.adminDomainConfig.value="5tgzUZaVtfnnSEBgmBDtJj6PdgYCnA1uaEGEUi3y5Njg");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),o(t.adminDomainConfig),...i],data:wo().encode(c),programAddress:r})}function FP(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:{domainConfig:r(),admin:r(),adminDomainConfig:r()},data:No().decode(e.data)}}var Zo=new Uint8Array([1]);function ZP(){return fixEncoderSize(getBytesEncoder(),1).encode(Zo)}function qo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthority",getOptionEncoder(getAddressEncoder())],["newMetadataUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),e=>({...e,discriminator:Zo}))}function Xo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthority",getOptionDecoder(getAddressDecoder())],["newMetadataUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function qP(){return combineCodec(qo(),Xo())}function $o(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.systemProgram),...i],data:qo().encode(c),programAddress:r})}function XP(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),systemProgram:r()},data:Xo().decode(e.data)}}var tc=new Uint8Array([6]);function sR(){return fixEncoderSize(getBytesEncoder(),1).encode(tc)}function rc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",re()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",P()]]),e=>({...e,discriminator:tc}))}function nc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",ne()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",R()]])}function oR(){return combineCodec(rc(),nc())}function sc(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:false}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.authority),...i],data:rc().encode(c),programAddress:r})}function cR(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:nc().decode(e.data)}}var ac=new Uint8Array([32]);function yR(){return fixEncoderSize(getBytesEncoder(),1).encode(ac)}function ic(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",tt()],["compressedProofArgs",P()],["settingsCreationArgs",Pe()]]),e=>({...e,discriminator:ac}))}function uc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",rt()],["compressedProofArgs",R()],["settingsCreationArgs",Re()]])}function mR(){return combineCodec(ic(),uc())}function pR(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true},adminDomainConfig:{value:e.adminDomainConfig??null,isWritable:false}},c={...e},a={args:c};t.adminDomainConfig.value||(t.adminDomainConfig.value="5tgzUZaVtfnnSEBgmBDtJj6PdgYCnA1uaEGEUi3y5Njg");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.authority),o(t.adminDomainConfig),...i],data:ic().encode(c),programAddress:r})}function fR(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:{authority:r(),adminDomainConfig:r()},data:uc().decode(e.data)}}var Ac=new Uint8Array([31]);function DR(){return fixEncoderSize(getBytesEncoder(),1).encode(Ac)}function yc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",he()],["compressedProofArgs",P()],["userCreationArgs",Me()]]),e=>({...e,discriminator:Ac}))}function mc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Y()],["compressedProofArgs",R()],["userCreationArgs",Ee()]])}function MR(){return combineCodec(yc(),mc())}function ER(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true},adminDomainConfig:{value:e.adminDomainConfig??null,isWritable:false}},c={...e},a={args:c};t.adminDomainConfig.value||(t.adminDomainConfig.value="5tgzUZaVtfnnSEBgmBDtJj6PdgYCnA1uaEGEUi3y5Njg");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.authority),o(t.adminDomainConfig),...i],data:yc().encode(c),programAddress:r})}function PR(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:{authority:r(),adminDomainConfig:r()},data:mc().decode(e.data)}}var fc=new Uint8Array([29]);function WR(){return fixEncoderSize(getBytesEncoder(),1).encode(fc)}function rn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(J())]]),e=>({...e,discriminator:fc}))}function lc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(j())]])}function OR(){return combineCodec(rn(),lc())}async function BR(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(H(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:rn().encode(c),programAddress:r})}function Tc(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:rn().encode(c),programAddress:r})}function LR(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:lc().decode(e.data)}}var Ic=new Uint8Array([27]);function FR(){return fixEncoderSize(getBytesEncoder(),1).encode(Ic)}function Cc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(J())],["settingsReadonlyArgs",X()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Ic}))}function Dc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(j())],["settingsReadonlyArgs",$()],["compressedProofArgs",R()]])}function zR(){return combineCodec(Cc(),Dc())}function Mc(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Cc().encode(c),programAddress:r})}function KR(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Dc().decode(e.data)}}var Pc=new Uint8Array([30]);function $R(){return fixEncoderSize(getBytesEncoder(),1).encode(Pc)}function sn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(J())]]),e=>({...e,discriminator:Pc}))}function Rc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(j())]])}function QR(){return combineCodec(sn(),Rc())}async function eh(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(H(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(H(t.source.value)),getAddressEncoder().encode(H(t.tokenProgram.value)),getAddressEncoder().encode(H(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(H(t.destination.value)),getAddressEncoder().encode(H(t.tokenProgram.value)),getAddressEncoder().encode(H(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:sn().encode(c),programAddress:r})}function hc(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:sn().encode(c),programAddress:r})}function th(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:Rc().decode(e.data)}}var Uc=new Uint8Array([28]);function ih(){return fixEncoderSize(getBytesEncoder(),1).encode(Uc)}function on(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(J())],["settingsReadonlyArgs",X()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Uc}))}function Wc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(j())],["settingsReadonlyArgs",$()],["compressedProofArgs",R()]])}function uh(){return combineCodec(on(),Wc())}async function dh(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceTokenAccount.value||(t.sourceTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(H(t.source.value)),getAddressEncoder().encode(H(t.tokenProgram.value)),getAddressEncoder().encode(H(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(H(t.destination.value)),getAddressEncoder().encode(H(t.tokenProgram.value)),getAddressEncoder().encode(H(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:on().encode(c),programAddress:r})}function Oc(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:on().encode(c),programAddress:r})}function gh(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:Wc().decode(e.data)}}var kc=new Uint8Array([12]);function Th(){return fixEncoderSize(getBytesEncoder(),1).encode(kc)}function wc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:kc}))}function Nc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(L())]])}function Sh(){return combineCodec(wc(),Nc())}function Hc(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:wc().encode(c),programAddress:r})}function xh(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Nc().decode(e.data)}}var Fc=new Uint8Array([23]);function Rh(){return fixEncoderSize(getBytesEncoder(),1).encode(Fc)}function zc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",X()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Fc}))}function Kc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(L())],["settingsReadonlyArgs",$()],["compressedProofArgs",R()]])}function hh(){return combineCodec(zc(),Kc())}function Jc(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:zc().encode(c),programAddress:r})}function vh(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Kc().decode(e.data)}}var Zc=new Uint8Array([9]);function Lh(){return fixEncoderSize(getBytesEncoder(),1).encode(Zc)}function qc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",dt()],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:Zc}))}function Xc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",gt()],["secp256r1VerifyArgs",getOptionDecoder(L())]])}function kh(){return combineCodec(qc(),Xc())}function $c(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:qc().encode(c),programAddress:r})}function wh(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Xc().decode(e.data)}}var ta=new Uint8Array([20]);function Kh(){return fixEncoderSize(getBytesEncoder(),1).encode(ta)}function ra(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",dt()],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",X()],["compressedProofArgs",P()]]),e=>({...e,discriminator:ta}))}function na(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",gt()],["secp256r1VerifyArgs",getOptionDecoder(L())],["settingsReadonlyArgs",$()],["compressedProofArgs",R()]])}function Jh(){return combineCodec(ra(),na())}function sa(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:ra().encode(c),programAddress:r})}function jh(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:na().decode(e.data)}}var aa=new Uint8Array([13]);function ev(){return fixEncoderSize(getBytesEncoder(),1).encode(aa)}function ia(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:aa}))}function ua(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(L())]])}function tv(){return combineCodec(ia(),ua())}function da(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ia().encode(c),programAddress:r})}function rv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ua().decode(e.data)}}var ya=new Uint8Array([24]);function uv(){return fixEncoderSize(getBytesEncoder(),1).encode(ya)}function ma(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",X()],["compressedProofArgs",P()]]),e=>({...e,discriminator:ya}))}function pa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(L())],["settingsReadonlyArgs",$()],["compressedProofArgs",R()]])}function dv(){return combineCodec(ma(),pa())}function fa(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ma().encode(c),programAddress:r})}function gv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:pa().decode(e.data)}}var Sa=new Uint8Array([11]);function lv(){return fixEncoderSize(getBytesEncoder(),1).encode(Sa)}function xa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Sa}))}function Ia(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Tv(){return combineCodec(xa(),Ia())}function Ca(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:xa().encode(c),programAddress:r})}function Sv(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:Ia().decode(e.data)}}var Ea=new Uint8Array([22]);function Ev(){return fixEncoderSize(getBytesEncoder(),1).encode(Ea)}function Pa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Ea}))}function Ra(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function Pv(){return combineCodec(Pa(),Ra())}function ha(e,n){let r=n?.programAddress??d,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:Pa().encode(c),programAddress:r})}function Rv(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:Ra().decode(e.data)}}var _a=new Uint8Array([10]);function Ov(){return fixEncoderSize(getBytesEncoder(),1).encode(_a)}function Ua(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())]]),e=>({...e,discriminator:_a}))}function Wa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(L())]])}function Bv(){return combineCodec(Ua(),Wa())}function Oa(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ua().encode(c),programAddress:r})}function Lv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Wa().decode(e.data)}}var ka=new Uint8Array([21]);function Fv(){return fixEncoderSize(getBytesEncoder(),1).encode(ka)}function wa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(B())],["settingsReadonlyArgs",X()],["compressedProofArgs",P()]]),e=>({...e,discriminator:ka}))}function Na(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(L())],["settingsReadonlyArgs",$()],["compressedProofArgs",R()]])}function zv(){return combineCodec(wa(),Na())}function Ha(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:wa().encode(c),programAddress:r})}function Kv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Na().decode(e.data)}}var Fa=new Uint8Array([14]);function Xv(){return fixEncoderSize(getBytesEncoder(),1).encode(Fa)}function za(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Fa}))}function Ka(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function $v(){return combineCodec(za(),Ka())}function Ja(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=m({}),i=p(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:za().encode({}),programAddress:r})}function Qv(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:Ka().decode(e.data)}}var Za=new Uint8Array([25]);function ob(){return fixEncoderSize(getBytesEncoder(),1).encode(Za)}function qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Za}))}function Xa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function cb(){return combineCodec(qa(),Xa())}function $a(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:qa().encode(c),programAddress:r})}function ab(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:Xa().decode(e.data)}}var ti=new Uint8Array([15]);function mb(){return fixEncoderSize(getBytesEncoder(),1).encode(ti)}function ri(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",At()],["secp256r1VerifyArgs",getArrayEncoder(J())]]),e=>({...e,discriminator:ti}))}function ni(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",yt()],["secp256r1VerifyArgs",getArrayDecoder(j())]])}function pb(){return combineCodec(ri(),ni())}function si(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ri().encode(c),programAddress:r})}function fb(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:ni().decode(e.data)}}var ai=new Uint8Array([26]);function Db(){return fixEncoderSize(getBytesEncoder(),1).encode(ai)}function ii(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",At()],["secp256r1VerifyArgs",getArrayEncoder(J())],["settingsReadonlyArgs",X()],["compressedProofArgs",P()]]),e=>({...e,discriminator:ai}))}function ui(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",yt()],["secp256r1VerifyArgs",getArrayDecoder(j())],["settingsReadonlyArgs",$()],["compressedProofArgs",R()]])}function Mb(){return combineCodec(ii(),ui())}function di(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ii().encode(c),programAddress:r})}function Eb(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:ui().decode(e.data)}}var d="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",XT=(t=>(t[t.DomainConfig=0]="DomainConfig",t[t.GlobalCounter=1]="GlobalCounter",t[t.Settings=2]="Settings",t[t.TransactionBuffer=3]="TransactionBuffer",t))(XT||{});function u_(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;throw new Error("The provided account could not be identified as a multiWallet account.")}var $T=(A=>(A[A.ChangeConfig=0]="ChangeConfig",A[A.ChangeConfigCompressed=1]="ChangeConfigCompressed",A[A.CompressSettingsAccount=2]="CompressSettingsAccount",A[A.CreateDomainConfig=3]="CreateDomainConfig",A[A.CreateDomainUserAccount=4]="CreateDomainUserAccount",A[A.CreateGlobalCounter=5]="CreateGlobalCounter",A[A.CreateMultiWallet=6]="CreateMultiWallet",A[A.CreateMultiWalletCompressed=7]="CreateMultiWalletCompressed",A[A.CreateUserAccounts=8]="CreateUserAccounts",A[A.DecompressSettingsAccount=9]="DecompressSettingsAccount",A[A.DisableDomainConfig=10]="DisableDomainConfig",A[A.EditDomainConfig=11]="EditDomainConfig",A[A.EditTransactionManagerUrl=12]="EditTransactionManagerUrl",A[A.MigrateCompressedSettings=13]="MigrateCompressedSettings",A[A.MigrateCompressedUsers=14]="MigrateCompressedUsers",A[A.NativeTransferIntent=15]="NativeTransferIntent",A[A.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",A[A.TokenTransferIntent=17]="TokenTransferIntent",A[A.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",A[A.TransactionBufferClose=19]="TransactionBufferClose",A[A.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",A[A.TransactionBufferCreate=21]="TransactionBufferCreate",A[A.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",A[A.TransactionBufferExecute=23]="TransactionBufferExecute",A[A.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",A[A.TransactionBufferExtend=25]="TransactionBufferExtend",A[A.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",A[A.TransactionBufferVote=27]="TransactionBufferVote",A[A.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",A[A.TransactionExecute=29]="TransactionExecute",A[A.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",A[A.TransactionExecuteSync=31]="TransactionExecuteSync",A[A.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",A))($T||{});function d_(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 4;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 5;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),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 eS=6e3,tS=6001,rS=6002,nS=6003,sS=6004,oS=6005,cS=6006,aS=6007,iS=6008,uS=6009,dS=6010,gS=6011,AS=6012,yS=6013,mS=6014,pS=6015,fS=6016,lS=6017,TS=6018,SS=6019,xS=6020,IS=6021,CS=6022,DS=6023,MS=6024,ES=6025,PS=6026,RS=6027,hS=6028,vS=6029,bS=6030,_S=6031,US=6032,WS=6033,OS=6034,BS=6035,LS=6036,kS=6037,wS=6038,NS=6039,gi;process.env.NODE_ENV!=="production"&&(gi={[TS]:"This member is already delegated to another wallet.",[BS]:"The domain configuration account is disabled. Please contact support or try again later.",[LS]:"Missing domain configuration account. Include it as a required account in this instruction.",[nS]:"Duplicate public keys detected among members. Each member must have a unique key.",[rS]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[uS]:"No members provided. A multisig wallet must contain at least one member.",[ES]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[PS]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[RS]:"Declared buffer size does not match the actual serialized size.",[IS]:"Not enough members with vote permission to meet the approval threshold.",[SS]:"At least one signer with execute permission is required to proceed.",[xS]:"At least one signer with initiate permission is required to perform this action.",[mS]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[pS]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[MS]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[yS]:"Unexpected number of accounts provided for this instruction.",[tS]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[eS]:"Invalid signature: the provided signature does not match the expected message payload.",[WS]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[gS]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[AS]:"Malformed transaction message: structure or formatting does not match the expected layout.",[_S]:"An input string exceeds the maximum allowed character length.",[kS]:"This member is not registered under the provided domain configuration.",[fS]:"A required account is missing from the instruction context.",[US]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[lS]:"User mutation arguments are required when performing add or remove delegate operations.",[CS]:"No valid signer found in this transaction.",[cS]:"Only one permanent member is allowed per wallet.",[aS]:"Only one transaction manager is allowed per wallet.",[NS]:"The given origin index is not in the whitelisted origins.",[sS]:"Permanent members cannot be removed from a wallet.",[oS]:"This operation cannot assign a permanent member.",[bS]:"Writable CPI calls to protected accounts are not permitted.",[wS]:"The relying party ID hash does not match the one defined in the domain configuration.",[OS]:"The specified slot number was not found in the provided slot history.",[dS]:"Too many members: a maximum of 4 members are supported.",[hS]:"This transaction has expired. It must be executed within 3 minutes of approval.",[iS]:"This operation cannot assign a transaction manager.",[vS]:"This transaction has not yet reached the required approval threshold.",[DS]:"Only the transaction creator or rent payer may close this transaction buffer."});function f_(e){return process.env.NODE_ENV!=="production"?gi[e]:"Error message not available in production bundles."}function l_(e,n,r){return isProgramError(e,n,d,r)}var ft={Ed25519:1,Secp256r1:2};var pe={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},un=8,lt=16,de=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(pe).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var dn=33,ue=class{_bn;constructor(n){typeof n=="string"?this._bn=new Uint8Array(getBase58Encoder().encode(n)):this._bn=new Uint8Array(n),this.validateKeyLength(this._bn);}validateKeyLength(n){if(n.length!==dn)throw new Error(`Invalid public key length, expected ${dn} bytes but got ${n.length}`)}toBase58(){return getBase58Decoder().decode(this.toBytes())}toTruncatedBuffer(){let n=this.toBuffer();return n.subarray(1,n.length)}toBuffer(){if(!this._bn)throw new Error("Invalid public key input");let n=this._bn;if(n.byteLength===dn)return n;throw new Error("Invalid public key input")}toBytes(){let n=this.toBuffer();return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}toString(){return this.toBase58()}toJSON(){return this.toBase58()}},M=class extends ue{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;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;}};function GS(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function FS(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var yi=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(GS())],["addressTableLookups",getArrayCodec(FS())]]);function mi(e){return yi.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 pi(e){let n=yi.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:d,staticAccounts:n.accountKeys,version:0}}featureFlags.version=VERSION.V2;var An="v2",fi="revibase.com",li="https://auth.revibase.com",Ti="https://api.revibase.com";function Q(e){let n=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("multi_wallet")),new Uint8Array(getU128Encoder().encode(e)),new Uint8Array(getUtf8Encoder().encode(An))]),r=new PublicKey(batchAddressTree);return {address:createBN254(deriveAddressV2(n,r,new PublicKey(d)).toString(),"base58"),addressTree:r}}function F(e){let n=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),e instanceof ue?e.toTruncatedBuffer():new Uint8Array(getAddressEncoder().encode(e)),new Uint8Array(getUtf8Encoder().encode(An))]),r=new PublicKey(batchAddressTree);return {address:createBN254(deriveAddressV2(n,r,new PublicKey(d.toString())).toString(),"base58"),addressTree: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:d,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function Gt(){let[e]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function Mi(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof ue?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function fe(e){let[n]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function z(e){let[n]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function Ei(e){let n=await z(e);return await fe(n)}async function tU(){let[e]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function mn(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await oe().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(s.instructions,c),c=>setTransactionMessageFeePayerSigner(s.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let a=Math.ceil((s.unitsConsumed??0)*1.1)||8e5;return a>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:a})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function Ri(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===AccountRole.WRITABLE||c.role===AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,a)=>c-a);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function hi(e,n){if(e.length===0)throw new Error("Bundle is empty.");for(let c=0;c<e.length;c++){if(e[c].length>1644)throw new Error(`Transaction ${c} exceeds maximum length, ${e[c].length}. Retry again.`);console.log(`Transaction ${c} length: ${e[c].length}`);}let r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})});if(!r.ok)throw console.error(await r.json()),new Error("Failed to simulate bundle");let{result:s,error:t}=await r.json();if(!s||t)throw console.error(t??s),new Error(`Unable to simulate bundle: ${JSON.stringify(t??s)}`);if(typeof s.value.summary!="string"&&s.value.summary.failed){let{TransactionFailure:c}=s.value.summary.failed.error,[,a]=c;throw console.error(t??s),new Error(`Simulation failed: ${a}`)}return s.value.transactionResults.map(c=>c.unitsConsumed)}function w(e,n=0){let r=e instanceof M?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}):null,t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,a=r?.authData&&r.verifyArgs?.clientDataJson?new Uint8Array([...r.authData,...sha256(r.verifyArgs.clientDataJson)]):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function ge(e){function n(t){return t instanceof M?t.toString():t.address.toString()}let r=new Set,s=[];for(let t of e)r.has(n(t))||(s.push(t),r.add(n(t)));if(s.filter(t=>t instanceof M).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return s}function vi({payer:e,tipAmount:n}){let r=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],s=r[Math.floor(Math.random()*r.length)];return getTransferSolInstruction({source:e,destination:address(s),amount:n})}async function bi(e){let n=await fetch(`${e}/getRandomPayer`),{randomPayer:r}=await n.json();return {address:address(r),async signTransactions(s){let t={publicKey:r,transactions:s.map(i=>getBase64Decoder().decode(getTransactionEncoder().encode(i)))},a=await(await fetch(`${e}/sign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json();if("error"in a)throw new Error(a.error);return a.signatures.map(i=>({[address(r)]:getBase58Encoder().encode(i)}))}}}var we=null,zt=null,Kt=null,Jt=null,jt=null,Ft=null,pn=null,Yt=null,fn=null,ln=null,_i=null;function Ui(){if(!we)throw new Error("Rpc is not initialized yet.");return we}function Tt(){if(!zt)throw new Error("Rpc is not initialized yet");return zt}function oe(){if(!Kt)throw new Error("Rpc is not initialized yet");return Kt}function Wi(){if(!Jt)throw new Error("Rpc is not initialized yet.");return Jt}function Oi(){if(!jt)throw new Error("Rpc is not initialized yet");return jt}async function pU(){return Ft||(Ft=await bi(pn??Ti)),Ft}function Tn(){if(!Yt)throw new Error("Jito Bundle Config is not set.");return Yt}function Se(){return fn??li}function Bi(){return ln}function Zt(){return _i}function fU(){zt=null,Kt=null,we=null,Ft=null,pn=null,Yt=null,fn=null,Jt=null,jt=null,ln=null;}function lU({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,authorizedClient:a,additionalInfo:i}){we=e,zt=createRpc(we,r,n);let{rpc:o,sendAndConfirmTransaction:u}=createSolanaClient({urlOrMoniker:we});Kt=o,Jt=u,jt=estimateComputeUnitLimitFactory({rpc:o}),pn=t??null,Yt=s??null,fn=c??null,ln=a??null,_i=i??null;}var K=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:r?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(d.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await Tt().getStateTreeInfos();return this.packOutputTreeIndex(selectStateTreeInfo(n))}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:a,queuePubkeyIndex:i,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,u=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=u);}for(let c of r){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:a,addressQueuePubkeyIndex:i});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function Ne(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await Tt().getCompressedAccount(e);return s&&n?.set(e.toString(),s),s}}async function ce(e,n){let s=(await Promise.all(e.map(async t=>Ne(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 k(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 xe(e,n,r,s,t){if(t.length===0)return [];let c=t.map((u,g)=>({treeInfo:n[g],root:r[g],rootIndex:s[g],address:u.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((u,g)=>({addressTreeInfo:a[g],outputStateTreeIndex:i,address:u.address,type:u.type}))}function ee(e,n,r,s,t,c,a){let i=[];for(let g=0;g<n.length;g++)i.push({treeInfo:n[g],rootIndex:s[g],leafIndex:r[g],proveByIndex:t[g],hash:c[g].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((g,y)=>({data:a.decode(g.data.data),accountMeta:{treeInfo:o.packedTreeInfos[y],address:new Uint8Array(g.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Ae(e,n,r,s){let t=null,c=null,a=new K;if(e){await a.addSystemAccounts();let{address:i}=Q(n),o=(await ce([{address:i,type:"Settings"}],s))[0];r?c={rootIndices:[0],roots:[],leafIndices:[o.leafIndex],leaves:[],treeInfos:[o.treeInfo],proveByIndices:[o.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)))}}:c=await q([o],[]);let u=a.packTreeInfos([{treeInfo:c.treeInfos[0],rootIndex:c.rootIndices[0],leafIndex:c.leafIndices[0],proveByIndex:c.proveByIndices[0],hash:o.hash}],[]).stateTrees;if(!u)throw new Error("Unable to parsed data.");t={accountMeta:{address:new Uint8Array(o.address),treeInfo:u.packedTreeInfos[0]},data:G().decode(o.data?.data)};}return {settingsReadonlyArgs:t,proof:c,packedAccounts:a}}async function q(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await Tt().getValidityProofV0(e,n)}catch(c){if(console.error(`Attempt ${t}, Get Validity Proof failed. ${c}`),t++,t>=r)throw new Error(`Failed to get validity proof after ${r} attempts: ${c}`);await new Promise(a=>setTimeout(a,s));}throw new Error(`Failed to get validity proof after ${r} attempts`)}async function wi(e,n){let r=await Tx(e,n);if(!r)throw new Error("User cannot be found.");return r}async function Tx(e,n){let{address:r}=F(e),s=await Ne(r,n);return s?.data?.data?Y().decode(s.data.data):null}async function qt(e,n){let r=await Sx(e,n);if(!r)throw new Error("Settings cannot be found.");return r}async function Sx(e,n){try{let{address:r}=Q(e),s=await Ne(r,n);if(!s?.data?.data)return null;let t=G().decode(s.data.data);return t.data.__option==="None"?null:{...t.data.value,isCompressed:!0}}catch{let r=await wr(oe(),await z(e));return r.exists?{...r.data,members:r.data.members.slice(0,r.data.membersLen),isCompressed:false}:null}}var He=null,Hi=2e3,Vi=3e3,xx=300*1e3;async function Xt({authUrl:e,additionalInfo:n,signer:r,popUp:s=null,data:t}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");return new Promise((c,a)=>{let i=new URL(e).origin,o=null,u=setInterval(()=>{s&&s.closed&&(y(),a(new Error("User closed the authentication window")));},500),g=setTimeout(()=>{l("Authentication timeout."),y(),a(new Error("Authentication timed out"));},xx);function y(){clearInterval(u),clearTimeout(g),o&&clearTimeout(o),He&&window.removeEventListener("message",He),s&&s.close();}if(s?s.location.replace(e):s=Ki(e),!s){a(new Error("Disable your popup blocker to continue."));return}function l(...S){n?.debug&&console.debug("[Popup]",...S);}let T=S=>{let D=S.origin===i,_=S.source===s;if(!D||!_||!S.isTrusted||!s){l("Ignored message from unknown source",S);return}switch(S.data.type){case "popup-ready":l("Popup is ready, sending auth data"),s.postMessage({type:"popup-init",payload:{signer:r?.toString(),data:t,additionalInfo:n}},i),o=setTimeout(()=>{y(),a(new Error("User closed the authentication window"));},Hi+Vi);break;case "popup-complete":l("Received completion message");try{let I=JSON.parse(S.data.payload);y(),c(I);}catch{a(new Error("Failed to parse response payload"));}break;case "popup-heartbeat":l("Received heartbeat"),o&&(clearTimeout(o),o=setTimeout(()=>{y(),a(new Error("User closed the authentication window"));},Hi+Vi));break;case "popup-closed":l("Popup explicitly closed"),y(),a(new Error("User closed the authentication window"));break;default:l("Unknown message type",S.data.type);}};He&&window.removeEventListener("message",He),He=T,window.addEventListener("message",He);})}function $t(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function xt(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),a=new Uint8Array(c);for(let i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return c}function Qt(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function Ix(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 Gi(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 Fi(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let a=e[s]|e[s+1]<<8;if(s+=2,s+a>e.length)throw new Error("MaxLengthExceeded");let i=e.slice(s,s+a),o=t.decode(i);r.push(o),s+=a;}return r}function zi(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let I=n&127;r+=I;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let a=e[r+1],i=r+2,o=e.slice(i,i+a),u=c[0]===0&&c.length>32?c.slice(1):c,g=o[0]===0&&o.length>32?o.slice(1):o;if(u.length>32||g.length>32)throw new Error("r or s length > 32 bytes");let y=new Uint8Array(32);y.set(u,32-u.length);let l=p256.Point.CURVE().n>>1n,T=BigInt("0x"+Qt(g)),D=(T>l?p256.Point.CURVE().n-T:T).toString(16).padStart(64,"0"),_=Ix(D);return new Uint8Array([...y,..._])}function Ki(e=`${Se()}/loading`){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let n=window.innerWidth||screen.availWidth,r=window.innerHeight||screen.availHeight,s=n<=768,t,c,a,i;if(s)t=n,c=r,a=0,i=0;else {let g=window.screenLeft??window.screenX,y=window.screenTop??window.screenY,l=window.innerWidth??document.documentElement.clientWidth??screen.width,T=window.innerHeight??document.documentElement.clientHeight??screen.height;t=500,c=600,i=g+(l-t)/2,a=y+(T-c)/2;}let o=[`width=${t}`,`height=${c}`,`top=${a}`,`left=${i}`,"toolbar=no","location=no","status=no","menubar=no","scrollbars=yes","resizable=yes"].join(","),u=window.open(e,"_blank",o);return u&&u.focus(),u}function rW(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Qt(n.get(-2))),y:BigInt("0x"+Qt(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function Yi(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 nW(e,n=0,r=false){let{authenticatorData:s,clientDataJSON:t,signature:c}=e.authResponse.response,a=new Uint8Array(xt(s)),i=JSON.parse(new TextDecoder().decode(xt(t))),o=Gi(i),u=zi(new Uint8Array(xt(c))),g=await ke({rpIdHash:a.subarray(0,32)});return new M(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(xt(t)),truncatedClientDataJson:o,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},domainConfig:g,authData:a,signature:u,originIndex:n,crossOrigin:r})}async function sW(e,n){let{data:r}=await _n(oe(),e),t=Fi(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 pW(e){let n=await mn(e,true),r=await hi(n.map(getBase64EncodedWireTransaction),Ui()),s=await mn(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await Nx(s.map(getBase64EncodedWireTransaction))}async function fW({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await oe().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions([...e],c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([Oi()(c),Ri(oe(),c.instructions.flatMap(u=>u.accounts??[]))]),o=Math.ceil(a*1.1);return prependTransactionMessageInstructions([...o>2e5?[getSetComputeUnitLimitInstruction({units:o})]:[],...i>0?[getSetComputeUnitPriceInstruction({microLamports:i})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await Wi()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}async function Nx(e,n=10,r=1e3,s=Tn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/bundles`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})});if(a.status===429&&c<n){await new Promise(o=>setTimeout(o,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);return i.result}throw new Error("Failed to send bundle after retries.")}async function lW(e,n=30,r=3e3,s=Tn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/getBundleStatuses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});if(a.status===429&&c<n){await new Promise(u=>setTimeout(u,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);let o=i.result;if(o.value.length){let u=o.value[0];if(u.confirmation_status==="confirmed"||u.confirmation_status==="finalized")return u.transactions[u.transactions.length-1]}if(c<n){await new Promise(u=>setTimeout(u,r));continue}}throw new Error("Failed to get bundle status after retries.")}async function TW({signer:e,index:n,transactionMessageBytes:r,cachedAccounts:s}){let t=await qt(n,s);if(t.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:c}=t.members.find(l=>It(l.pubkey)===e.toString())??{};if(!c)throw new Error("No permissions found for the current member.");let a=de.has(c,pe.InitiateTransaction),i=de.has(c,pe.VoteTransaction),o=de.has(c,pe.ExecuteTransaction);if(a&&i&&o)return null;if(!i||!o)throw new Error("Signer lacks the required Vote/Execute permissions.");let u=t.members.find(l=>de.has(l.permissions,lt));if(!u)throw new Error("No transaction manager available in wallet.");let g=address(It(u.pubkey)),y=await wi(g,s);if(y.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return Hx(g,y.transactionManagerUrl.value,r)}function Hx(e,n,r){return {address:e,async signTransactions(s){let t={publicKey:e.toString(),transactions:s.map(getBase64EncodedWireTransaction)};r&&(t.transactionMessageBytes=getBase64Decoder().decode(r));let c=Bi();if(c){let{url:o,publicKey:u}=c,y=await(await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({transactions:t.transactions,publicKey:u})})).json();if("error"in y)throw new Error(y.error);t.authorizedClient={publicKey:u,signatures:y.signatures};}let i=await(await fetch(n,{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(o=>({[e]:getBase58Encoder().encode(o)}))}}}function It(e){return e.keyType===ft.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}async function LW({index:e,configActionsArgs:n,payer:r,compressed:s=false,cachedAccounts:t}){let c=await Ei(e),a=[],i=[];for(let x of n)if(x.type==="AddMembers")a.push(...x.members.map(f=>f.pubkey instanceof M?{address:F(f.pubkey).address,type:"User"}:f.setAsDelegate?{address:F(f.pubkey.address).address,type:"User"}:{address:F(f.pubkey).address,type:"User"}));else if(x.type==="RemoveMembers")i.push(...x.members.map(f=>({address:F(f.pubkey).address,type:"User"})));else if(x.type==="EditPermissions")for(let f of x.members)f.delegateOperation!==2&&(f.delegateOperation===0?a:i).push({address:F(f.pubkey).address,type:"User"});let o=new K,u=null,g=null,y=[];if(a.length||i.length||s){await o.addSystemAccounts();let x=[...s?[{address:Q(e).address,type:"Settings"}]:[],...i,...a],f=x.length?await ce(x,t):[];if(f.length){u=await q(f,[]);let C=f.filter(U=>U.type==="Settings"),E=f.filter(U=>U.type==="User");s&&u&&(g=ee(o,u.treeInfos.slice(0,1),u.leafIndices.slice(0,1),u.rootIndices.slice(0,1),u.proveByIndices.slice(0,1),C,G())[0]),E.length&&u&&(y=ee(o,u.treeInfos.slice(s?1:0),u.leafIndices.slice(s?1:0),u.rootIndices.slice(s?1:0),u.proveByIndices.slice(s?1:0),E,Y()));}}let l=[],T=[];for(let x of n)switch(x.type){case "AddMembers":{let f=[];for(let C of x.members)if(C.pubkey instanceof M){let E=l.length,{message:U,signature:W,publicKey:O,domainConfig:N}=w(C.pubkey,E);U&&W&&O&&l.push({message:U,signature:W,publicKey:O}),N&&o.addPreAccounts([{address:N,role:AccountRole.READONLY}]);let Z=await er(C.pubkey,y);Z&&f.push(Xi({...C,permissionArgs:C.permissions,index:E,userMutArgs:Z}));}else {C.setAsDelegate&&o.addPreAccounts([{address:C.pubkey.address,role:AccountRole.READONLY_SIGNER,signer:C.pubkey}]);let E=await er(C.setAsDelegate?C.pubkey.address:C.pubkey,y);E&&f.push(Xi({...C,permissionArgs:C.permissions,index:-1,userMutArgs:E}));}T.push({__kind:x.type,fields:[f]});break}case "RemoveMembers":{let f=await Promise.all(x.members.map(async C=>{let E=await er(C.pubkey,y);if(!E)throw new Error("User account not found");return Kx({...C,userMutArgs:E})}));T.push({__kind:x.type,fields:[f]});break}case "EditPermissions":{let f=await qt(e,t),C=f.members.find(W=>de.has(W.permissions,un)),E=f.members.find(W=>de.has(W.permissions,lt)),U=await Promise.all(x.members.map(async W=>{let O=!!C?.pubkey&&It(C.pubkey)===W.pubkey.toString();if(!!E?.pubkey&&It(E.pubkey)===W.pubkey.toString())throw new Error("Transaction Manager's permission cannot be changed.");let Z=W.delegateOperation!==2?await er(W.pubkey,y):void 0;return zx({...W,permissionArgs:W.permissions,isPermanentMember:O,userMutArgs:Z})}));T.push({__kind:x.type,fields:[U]});break}default:T.push({__kind:x.type,fields:[x.threshold]});}let{remainingAccounts:S,systemOffset:D}=o.toAccountMetas(),_=k(u,D);return {instructions:s?[Gs({configActions:T,payer:r,authority:createNoopSigner(c),compressedProofArgs:_,settingsMut:g,remainingAccounts:S})]:[await Ls({settingsIndex:e,configActions:T,payer:r,compressedProofArgs:_,remainingAccounts:S})],secp256r1VerifyInput:l}}async function er(e,n){let{address:r}=F(e);return n.find(t=>new Vx(new Uint8Array(t.accountMeta.address)).eq(r))}function zx({pubkey:e,permissionArgs:n,userMutArgs:r,delegateOperation:s,isPermanentMember:t}){if(t&&(r||s!==2))throw new Error("Delegation cannot be modified for a permanent member.");let c=eu(n,t);return {memberKey:xn(e),permissions:c,userArgs:r?some(r):none(),delegateOperation:s}}function Kx({pubkey:e,userMutArgs:n}){if(n.data.isPermanentMember)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:xn(e),userArgs:n.data.settingsIndex.__option==="Some"?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function Xi({pubkey:e,permissionArgs:n,index:r,userMutArgs:s,setAsDelegate:t,isTransactionManager:c}){return {member:{permissions:Jx(s,t,n,c),pubkey:xn(e instanceof M?e:t?e.address:e)},verifyArgs:e instanceof M&&e.verifyArgs&&r!==-1?some({truncatedClientDataJson:e.verifyArgs.truncatedClientDataJson,slotNumber:e.verifyArgs.slotNumber,signedMessageIndex:r,originIndex:e.originIndex,crossOrigin:e.crossOrigin}):none(),userArgs:t?{__kind:"Mutate",fields:[s]}:{__kind:"Read",fields:[s]},setAsDelegate:t}}function xn(e){return e instanceof ue?{keyType:ft.Secp256r1,key:e.toBytes()}:{keyType:ft.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(e)])}}function Jx(e,n,r,s){let t=e.data,c=t.isPermanentMember;if(c){if(!n)throw new Error("Permanent members must also be delegates. Please set `setAsDelegate = true`.");if(t.settingsIndex.__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.")}if(s){if(r.execute||r.vote)throw new Error("Transaction Manager can only have initiate permission");if(n)throw new Error("Transaction Manager cannot be a delegate. Please set `setAsDelegate = false`.")}return eu(r,c,s)}function eu(e,n=false,r=false){let s=[];return e.initiate&&s.push(pe.InitiateTransaction),e.vote&&s.push(pe.VoteTransaction),e.execute&&s.push(pe.ExecuteTransaction),n&&s.push(un),r&&s.push(lt),de.fromPermissions(s)}var Ve=33,Ge=64,Mn=14,Qx=2,eI=address("Secp256r1SigVerify1111111111111111111111111");function tI(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function rI(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function su(){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=rI();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=Mn;let a=[];for(let i=0;i<r;i++){let o=fixDecoderSize(getBytesDecoder(),Ve).decode(e,n);n+=Ve;let u=fixDecoderSize(getBytesDecoder(),Ge).decode(e,n);n+=Ge;let g=t[i].messageDataSize,y=fixDecoderSize(getBytesDecoder(),g).decode(e,n);n+=g,a.push({publicKey:o,signature:u,message:y});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function ou(){return createEncoder({getSizeFromValue:e=>{let n=Mn*e.offsets.length,r=e.payload.reduce((s,t)=>s+Ve+Ge+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=tI();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),Ve).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),Ge).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function NW(){return combineCodec(ou(),su())}function V(e,n){let r=e.length,s=Qx+r*Mn,t=[];for(let o=0;o<r;o++){let{message:u}=e[o],g=s,y=g+Ve,l=y+Ge;t.push({publicKeyOffset:g,publicKeyInstructionIndex:65535,signatureOffset:y,signatureInstructionIndex:65535,messageDataOffset:l,messageDataSize:u.length,messageInstructionIndex:65535}),s+=Ve+Ge+u.length;}let c=n?.programAddress??eI,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:ou().encode(a)}}function HW(e){return {programAddress:e.programAddress,accounts:{},data:su().decode(e.data)}}async function qW({index:e,payer:n,signers:r,cachedAccounts:s}){let t=new K;await t.addSystemAccounts();let c=await z(e),{address:a,addressTree:i}=Q(e),o=await Ne(a,s),u,g;if(o?.data?.data)if(G().decode(o.data.data).data.__option==="None"){let C=await ce([{address:a,type:"Settings"}],s);g=await q(C,[]),u={__kind:"Mutate",fields:[ee(t,g.treeInfos,g.leafIndices,g.rootIndices,g.proveByIndices,C.filter(U=>U.type==="Settings"),G())[0]]};}else throw new Error("Settings account is already compressed.");else {let f=[{address:a,tree:i,queue:i,type:"Settings"}];g=await q([],f),u={__kind:"Create",fields:[(await xe(t,g.treeInfos,g.roots,g.rootIndices,f))[0]]};}let y=ge(r),l=y.filter(f=>f instanceof M),T=[],S=[];for(let f of l){let C=T.length,{domainConfig:E,verifyArgs:U,signature:W,publicKey:O,message:N}=w(f,C);N&&W&&O&&T.push({message:N,signature:W,publicKey:O}),E&&(t.addPreAccounts([{address:E,role:AccountRole.READONLY}]),U?.__option==="Some"&&S.push({domainConfigKey:E,verifyArgs:U.value}));}t.addPreAccounts(y.filter(f=>"address"in f).map(f=>({address:f.address,role:AccountRole.READONLY_SIGNER,signer:f})));let{remainingAccounts:D,systemOffset:_}=t.toAccountMetas(),I=k(g,_),x=[];return T.length>0&&x.push(V(T)),x.push(Ys({settings:c,settingsArg:u,compressedProofArgs:I,payer:n,secp256r1VerifyArgs:S,remainingAccounts:D})),x}async function tO({payer:e,rpId:n,origins:r,authority:s,metadataUrl:t,adminDomainConfig:c}){let a=await ke({rpId:n});return eo({origins:r,authority:s,payer:e,domainConfig:a,rpId:n,metadataUrl:t,adminDomainConfig:c,remainingAccounts:[]})}async function dO({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new K;await c.addSystemAccounts();let a=[];r.settingsIndex&&(a.push({address:Q(r.settingsIndex).address,type:"Settings"}),r.transactionManager&&a.push({address:F(r.transactionManager).address,type:"User"}));let i=a.length?await ce(a,t):[],{address:o,addressTree:u}=F(r.member),g=[{address:o,type:"User",tree:u,queue:u}],y=await q(i,g),l=null,T=null,S=i.filter(C=>C.type==="Settings"),D=i.filter(C=>C.type==="User");S.length&&(l=ee(c,y.treeInfos.slice(0,1),y.leafIndices.slice(0,1),y.rootIndices.slice(0,1),y.proveByIndices.slice(0,1),S,G())[0]),D.length&&(T=ee(c,y.treeInfos.slice(1,2),y.leafIndices.slice(1,2),y.rootIndices.slice(1,2),y.proveByIndices.slice(1,2),D,Y())[0]);let _=await xe(c,y.treeInfos.slice(i.length),y.roots.slice(i.length),y.rootIndices.slice(i.length),g),{remainingAccounts:I,systemOffset:x}=c.toAccountMetas(),f=k(y,x);return co({payer:n,authority:e,compressedProofArgs:f,member:ut().decode(r.member.toBuffer()),isPermanentMember:r.isPermanentMember,linkWalletArgs:l?some({settingsMutArgs:l,transactionManager:T?some(T):none()}):none(),userAccountCreationArgs:_[0],domainConfig:s,remainingAccounts:I})}async function mO({payer:e}){let n=await Gt();return go({payer:e,globalCounter:n})}async function IO({createUserArgs:e,payer:n}){let r=new K;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:AccountRole.READONLY_SIGNER,signer:u.member})));let s=e.map(u=>{let{address:g,addressTree:y}=F(u.member.address);return {address:g,tree:y,queue:y,type:"User"}}),t=await q([],s),c=await xe(r,t.treeInfos,t.roots,t.rootIndices,s),{remainingAccounts:a,systemOffset:i}=r.toAccountMetas(),o=k(t,i);return ho({compressedProofArgs:o,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,isPermanentMember:u.isPermanentMember,userCreationArgs:c[g],transactionManagerUrl:u.transactionManagerUrl??null})),remainingAccounts:a})}async function EO({admin:e,rpId:n,disable:r}){let s=await ke({rpId:n});return Ho({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function vO({authority:e,domainConfig:n,newAuthority:r,newOrigins:s,newMetadataUrl:t}){return $o({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthority:r?some(r):none(),newMetadataUrl:t?some(t):none(),remainingAccounts:[]})}async function BO({authority:e,transactionManagerUrl:n}){let r=new K;await r.addSystemAccounts();let s=await ce([{address:F(e.address).address,type:"User"}]),t=await q(s,[]),c=ee(r,t.treeInfos,t.leafIndices,t.rootIndices,t.proveByIndices,s,Y())[0],{remainingAccounts:a,systemOffset:i}=r.toAccountMetas(),o=k(t,i);return sc({authority:e,transactionManagerUrl:n,compressedProofArgs:o,userMutArgs:c,remainingAccounts:a})}async function $O({index:e,payer:n,initialMember:r,setAsDelegate:s,compressed:t=false,cachedAccounts:c}){let a=await Gt(),{domainConfig:i,verifyArgs:o,message:u,signature:g,publicKey:y}=w(r),l=[];u&&g&&y&&l.push({message:u,signature:g,publicKey:y});let T=new K;await T.addSystemAccounts();let S=[],D=[];if(D.push(...await ce([{address:F("address"in r?r.address:r).address,type:"User"}],c)),t){let{address:N,addressTree:Z}=Q(e);S.push({address:N,queue:Z,tree:Z,type:"Settings"});}let _=D.length,I=await q(D,S),x=ee(T,I.treeInfos.slice(0,_),I.leafIndices.slice(0,_),I.rootIndices.slice(0,_),I.proveByIndices.slice(0,_),D.filter(N=>N.type==="User"),Y())[0],C=(await xe(T,I.treeInfos.slice(_),I.roots.slice(_),I.rootIndices.slice(_),S)).find(N=>N.type==="Settings")??null;i?T.addPreAccounts([{address:i,role:AccountRole.READONLY}]):"address"in r&&T.addPreAccounts([{address:r.address,role:AccountRole.READONLY_SIGNER,signer:r}]);let{remainingAccounts:E,systemOffset:U}=T.toAccountMetas(),W=k(I,U),O=[];if(t){if(!C)throw new Error("Settings creation args is missing.");O.push(Co({settingsIndex:e,payer:n,initialMember:r instanceof M?void 0:r,secp256r1VerifyArgs:o,domainConfig:i,userMutArgs:x,globalCounter:a,compressedProofArgs:W,settingsCreation:C,setAsDelegate:s,remainingAccounts:E}));}else {let N=await z(e);O.push(fo({settingsIndex:e,settings:N,payer:n,initialMember:r instanceof M?void 0:r,secp256r1VerifyArgs:o,domainConfig:i,userMutArgs:x,globalCounter:a,compressedProofArgs:W,setAsDelegate:s,remainingAccounts:E}));}return {instructions:O,secp256r1VerifyInput:l}}async function iB({index:e,payer:n,signers:r,cachedAccounts:s}){let t=new K;await t.addSystemAccounts();let c=await ce([{address:Q(e).address,type:"Settings"}],s),a=await q(c,[]),i=ee(t,a.treeInfos,a.leafIndices,a.rootIndices,a.proveByIndices,c.filter(I=>I.type==="Settings"),G())[0],o=ge(r),u=o.filter(I=>I instanceof M),g=[],y=[];for(let I of u){let x=g.length,{domainConfig:f,verifyArgs:C,signature:E,publicKey:U,message:W}=w(I,x);W&&E&&U&&g.push({message:W,signature:E,publicKey:U}),f&&(t.addPreAccounts([{address:f,role:AccountRole.READONLY}]),C?.__option==="Some"&&y.push({domainConfigKey:f,verifyArgs:C.value}));}t.addPreAccounts(o.filter(I=>"address"in I).map(I=>({address:I.address,role:AccountRole.READONLY_SIGNER,signer:I})));let{remainingAccounts:l,systemOffset:T}=t.toAccountMetas(),S=k(a,T),D=[];g.length>0&&D.push(V(g));let _=await z(e);return D.push(Oo({settings:_,payer:n,settingsMut:i,compressedProofArgs:S,secp256r1VerifyArgs:y,remainingAccounts:l})),D}function oI(e,n,r,s){let t=cI(e,n),c=aI(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function cI(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,a=s-t,i=r-s-c;return n>=r?false:n<a?true:n>=s?n-s<i:false}function aI(e,n){return n<e.header.numSignerAccounts}async function tr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=pi(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(i=>i.lookupTableAddress),oe()):{}),a=[];a.push(...t.addressTableLookups?.map(i=>({role:AccountRole.READONLY,address:i.lookupTableAddress}))??[]);for(let[i,o]of t.staticAccounts.entries())a.push({address:o,role:oI(t,i,o,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let o=c[i.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let u of i.writableIndexes){let g=o[u];if(!g)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:g,role:AccountRole.WRITABLE});}for(let u of i.readonlyIndexes){let g=o[u];if(!g)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:g,role:AccountRole.READONLY});}}for(let i of s?.filter(o=>o.address!==e)??[]){let o=a.findIndex(u=>u.address===i.address);o===-1?a.push({address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}):a[o].role===AccountRole.READONLY||a[o].role===AccountRole.READONLY_SIGNER?a[o]={address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}:(a[o].role===AccountRole.WRITABLE||a[o].role===AccountRole.WRITABLE_SIGNER)&&(a[o]={address:i.address,role:AccountRole.WRITABLE_SIGNER,signer:i});}return {accountMetas:a,addressLookupTableAccounts:c,transactionMessage:t}}async function gu({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let u=await fe(e),{accountMetas:g,addressLookupTableAccounts:y}=await tr({transactionMessageBytes:r,walletAddress:u,additionalSigners:a,addressesByLookupTableAddress:t}),l=[];return c.length>0&&l.push(V(c)),l.push(o?$a({transactionBuffer:n,payer:s.address,remainingAccounts:g,settingsKey:e}):Ja({transactionBuffer:n,payer:s.address,settings:e})),i&&l.push(vi({payer:s,tipAmount:i})),{instructions:l,addressLookupTableAccounts:y}}async function Au({index:e,transactionMessageBytes:n,signers:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],compressed:a=false,simulateProof:i=false,cachedAccounts:o}){let u=ge(r),g=await z(e),y=await fe(g),[{accountMetas:l,addressLookupTableAccounts:T,transactionMessage:S},{settingsReadonlyArgs:D,proof:_,packedAccounts:I}]=await Promise.all([tr({transactionMessageBytes:n,walletAddress:y,additionalSigners:u.filter(O=>!(O instanceof M)),addressesByLookupTableAddress:t}),Ae(a,e,i,o)]);I.addPreAccounts(l);let x=u.filter(O=>O instanceof M),f=[];for(let O of x){let N=c.length,{domainConfig:Z,verifyArgs:le,signature:Ie,publicKey:Ct,message:Dt}=w(O,N);Dt&&Ie&&Ct&&c.push({message:Dt,signature:Ie,publicKey:Ct}),Z&&(I.addPreAccounts([{address:Z,role:AccountRole.READONLY}]),le?.__option==="Some"&&f.push({domainConfigKey:Z,verifyArgs:le.value}));}let{remainingAccounts:C,systemOffset:E}=I.toAccountMetas(),U=[];c.length>0&&U.push(V(c));let W=uI(S,l);if(a){if(!s||!D)throw new Error("Payer not found or proof args is missing.");let O=k(_,E);U.push(di({secp256r1VerifyArgs:f,transactionMessage:W,settingsReadonlyArgs:D,compressedProofArgs:O,payer:s,remainingAccounts:C}));}else U.push(si({secp256r1VerifyArgs:f,settings:g,transactionMessage:W,remainingAccounts:C}));return {instructions:U,addressLookupTableAccounts:T}}function uI(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 LB({index:e,destination:n,signers:r,cachedAccounts:s,amount:t,payer:c,compressed:a=false}){let i=ge(r),o=await z(e),u=await fe(o),{settingsReadonlyArgs:g,proof:y,packedAccounts:l}=await Ae(a,e,false,s),T=[],S=[];for(let x of i)if(x instanceof M){let f=T.length,{domainConfig:C,verifyArgs:E,signature:U,publicKey:W,message:O}=w(x,f);O&&U&&W&&T.push({message:O,signature:U,publicKey:W}),C&&(l.addPreAccounts([{address:C,role:AccountRole.READONLY}]),E?.__option==="Some"&&S.push({domainConfigKey:C,verifyArgs:E.value}));}else l.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:D,systemOffset:_}=l.toAccountMetas(),I=[];if(T.length>0&&I.push(V(T)),a){if(!c||!g)throw new Error("Payer not found or proof args is missing.");let x=k(y,_);I.push(Mc({amount:t,settingsReadonlyArgs:g,compressedProofArgs:x,payer:c,secp256r1VerifyArgs:S,source:u,destination:n,remainingAccounts:D}));}else I.push(Tc({amount:t,secp256r1VerifyArgs:S,source:u,destination:n,settings:o,remainingAccounts:D}));return I}async function JB({index:e,destination:n,mint:r,signers:s,cachedAccounts:t,amount:c,payer:a,tokenProgram:i,compressed:o=false}){let u=ge(s),g=await z(e),y=await fe(g),[l,T]=await Promise.all([getAssociatedTokenAccountAddress(r,y,i),getAssociatedTokenAccountAddress(r,n,i)]),{settingsReadonlyArgs:S,proof:D,packedAccounts:_}=await Ae(o,e,false,t),I=[],x=[];for(let U of u)if(U instanceof M){let W=I.length,{domainConfig:O,verifyArgs:N,signature:Z,publicKey:le,message:Ie}=w(U,W);Ie&&Z&&le&&I.push({message:Ie,signature:Z,publicKey:le}),O&&(_.addPreAccounts([{address:O,role:AccountRole.READONLY}]),N?.__option==="Some"&&x.push({domainConfigKey:O,verifyArgs:N.value}));}else _.addPreAccounts([{address:U.address,role:AccountRole.READONLY_SIGNER,signer:U}]);let{remainingAccounts:f,systemOffset:C}=_.toAccountMetas(),E=[];if(I.length>0&&E.push(V(I)),o){if(!a||!S)throw new Error("Payer not found or proof args is missing.");let U=k(D,C);E.push(Oc({amount:c,settingsReadonlyArgs:S,compressedProofArgs:U,payer:a,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:l,destination:n,destinationTokenAccount:T,mint:r,tokenProgram:i,remainingAccounts:f}));}else E.push(hc({amount:c,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:l,destination:n,destinationTokenAccount:T,settings:g,mint:r,tokenProgram:i,remainingAccounts:f}));return E}async function nL({index:e,closer:n,transactionBufferAddress:r,payer:s,compressed:t=false,cachedAccounts:c}){let a=await vs(oe(),r),i=a.data.multiWalletSettings,{settingsReadonlyArgs:o,proof:u,packedAccounts:g}=await Ae(t,e,false,c),{remainingAccounts:y,systemOffset:l}=g.toAccountMetas(),{domainConfig:T,verifyArgs:S,message:D,signature:_,publicKey:I}=w(n),x=[];if(D&&_&&I&&x.push(V([{message:D,signature:_,publicKey:I}])),t){if(!s||!o)throw new Error("Payer not found or proof args is missing.");let f=k(u,l);x.push(Jc({transactionBuffer:r,domainConfig:T,closer:n instanceof M?void 0:n,rentCollector:a.data.payer,secp256r1VerifyArgs:S,settingsReadonlyArgs:o,payer:s,compressedProofArgs:f,remainingAccounts:y}));}else x.push(Hc({transactionBuffer:r,domainConfig:T,closer:n instanceof M?void 0:n,settings:i,payer:a.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return x}function fu({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:u}){let{domainConfig:g,verifyArgs:y,message:l,signature:T,publicKey:S}=w(n),D=[];if(l&&T&&S&&D.push(V([{message:l,signature:T,publicKey:S}])),u){let{settingsReadonlyArgs:_,compressedProofArgs:I,remainingAccounts:x}=u;D.push(sa({transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof M?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i},settingsReadonlyArgs:_,compressedProofArgs:I,remainingAccounts:x}));}else D.push($c({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof M?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i},remainingAccounts:[]}));return D}function lu({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=w(e),u=[];return i&&a&&o&&u.push(V([{message:i,signature:a,publicKey:o}])),s?u.push(fa({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(da({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,remainingAccounts:[]})),u}function Tu({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?ha({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Ca({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Su({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=w(n),u=[];return o&&a&&i&&u.push(V([{message:o,signature:a,publicKey:i}])),s?u.push(Ha({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(Oa({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,remainingAccounts:[]})),u}async function GL({message:e,signer:n,popUp:r}){let s=await Xt({authUrl:`${Se()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"message",payload:e},signer:n,popUp:r,additionalInfo:Zt()});return {...s,signer:new ue(s.signer)}}async function jL({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){let c=await Xt({authUrl:`${Se()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"transaction",payload:JSON.stringify({transactionActionType:e,transactionAddress:n,transactionMessageBytes:$t(r)})},additionalInfo:Zt(),signer:s,popUp:t});return {...c,signer:new ue(c.signer)}}async function QL({message:e,response:n,expectedOrigin:r=Se()}){let{verified:s}=await verifyAuthenticationResponse({response:n.authResponse,expectedChallenge:$t(new TextEncoder().encode(e)),expectedOrigin:r,expectedRPID:fi,requireUserVerification:false,credential:{id:n.authResponse.id,publicKey:Yi(n.signer.toString()),counter:0}});return s}async function dk({payer:e,index:n,transactionMessageBytes:r,creator:s,executor:t,secp256r1VerifyInput:c,jitoBundlesTipAmount:a,addressesByLookupTableAddress:i,bufferIndex:o=Math.floor(Math.random()*255),additionalVoters:u=[],additionalSigners:g=[],compressed:y=false,chunkSize:l=Math.ceil(r.length/2),cachedAccounts:T}){let[S,D]=await Promise.all([z(n),Mi(await z(n),s instanceof M?s:s.address,o)]),_=[],I=[];for(let A=0;A<r.length;A+=l){let Rn=r.subarray(A,A+l);_.push(Rn),I.push(sha256(Rn));}let x=sha256(new Uint8Array(r)),{settingsReadonlyArgs:f,proof:C,packedAccounts:E}=await Ae(y,n,false,T),{remainingAccounts:U,systemOffset:W}=E.toAccountMetas(),O=f?{settingsReadonlyArgs:f,compressedProofArgs:k(C,W),remainingAccounts:U,payer:e}:null,N=fu({finalBufferHash:x,finalBufferSize:r.length,bufferIndex:o,payer:e,transactionBufferAddress:D,settings:S,creator:s,preauthorizeExecution:!t,bufferExtendHashes:I,compressedArgs:O}),Z=_.map(A=>Tu({transactionMessageBytes:A,transactionBufferAddress:D,settings:S,compressed:y})),le=u.map(A=>Su({voter:A,transactionBufferAddress:D,settings:S,compressedArgs:O})),Ie=lu({compressedArgs:O,settings:S,executor:t,transactionBufferAddress:D}),{instructions:Ct,addressLookupTableAccounts:Dt}=await gu({compressed:y,settings:S,transactionMessageBytes:r,transactionBufferAddress:D,payer:e,additionalSigners:g,secp256r1VerifyInput:c,jitoBundlesTipAmount:a,addressesByLookupTableAddress:i}),Fe=A=>({payer:e,instructions:A,addressesByLookupTableAddress:Dt});return [Fe(N),...Z.map(A=>Fe([A])),...le.length?[Fe(le.flat())]:[],Fe(Ie),Fe(Ct)]}var nr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=a=>{let i=s.get(a);return i===void 0&&(i={isSigner:false,isWritable:false,isInvoked:false},s.set(a,i)),i},c=t(r);c.isSigner=true,c.isWritable=true;for(let a of n){t(a.programAddress).isInvoked=false;for(let i of a.accounts??[]){let o=t(i.address);o.isSigner||=i.role===AccountRole.READONLY_SIGNER||i.role===AccountRole.WRITABLE_SIGNER,o.isWritable||=i.role===AccountRole.WRITABLE||i.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),a={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let i=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [a,i]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&a.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&!a.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,a]of this.keyMetaMap.entries())if(r(a)){let i=c,o=n.findIndex(u=>u===i);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(i),this.keyMetaMap.delete(c);}}return [s,t]}};var sr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,a)=>{s.set(c,a);});let t=c=>{let a=s.get(c);if(a===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return a};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(a=>t(a.address))??[],data:c.data}))}};function Iu({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=nr.compile(r,e),c=new Array,a={writable:[],readonly:[]},i=Object.entries(s??{});for(let l of i){let T=t.extractTableLookup(l);if(T!==void 0){let{addressTableLookup:S,drainedKeys:D}=T;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),a.writable.push(...D.writable),a.readonly.push(...D.readonly);}}let[o,u]=t.getMessageComponents(),y=new sr(u,a).compileInstructions(r);return {version:0,header:o,instructions:y,lifetimeToken:n,staticAccounts:u,addressTableLookups:c}}function Dk({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Iu({instructions:e,payer:n,recentBlockhash:d,addressesByLookupTableAddress:r});return mi(s)}async function hk({payer:e,index:n,transactionMessageBytes:r,signers:s,secp256r1VerifyInput:t,addressesByLookupTableAddress:c,cachedAccounts:a,compressed:i=false,simulateProof:o=false}){let{instructions:u,addressLookupTableAccounts:g}=await Au({index:n,payer:e,signers:s,transactionMessageBytes:r,secp256r1VerifyInput:t,compressed:i,addressesByLookupTableAddress:c,simulateProof:o,cachedAccounts:a});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}
2
- export{Ns as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,Os as CHANGE_CONFIG_DISCRIMINATOR,Ks as COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Xs as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,no as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,io as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,So as CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR,mo as CREATE_MULTI_WALLET_DISCRIMINATOR,Eo as CREATE_USER_ACCOUNTS_DISCRIMINATOR,_o as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,ko as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,hn as DOMAIN_CONFIG_DISCRIMINATOR,bt as DelegateOp,Zo as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,tc as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,On as GLOBAL_COUNTER_DISCRIMINATOR,ft as KeyType,ac as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,Ac as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,TS as MULTI_WALLET_ERROR__ALREADY_DELEGATED,BS as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,LS as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,nS as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,rS as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,uS as MULTI_WALLET_ERROR__EMPTY_MEMBERS,ES as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,PS as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,RS as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,IS as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,SS as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,xS as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,mS as MULTI_WALLET_ERROR__INVALID_ACCOUNT,pS as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,MS as MULTI_WALLET_ERROR__INVALID_BUFFER,yS as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,tS as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,eS as MULTI_WALLET_ERROR__INVALID_SIGNED_MESSAGE,WS as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,gS as MULTI_WALLET_ERROR__INVALID_THRESHOLD,AS as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,_S as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,kS as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,fS as MULTI_WALLET_ERROR__MISSING_ACCOUNT,US as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,lS as MULTI_WALLET_ERROR__MISSING_USER_ARGS,CS as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,cS as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,aS as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,NS as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,sS as MULTI_WALLET_ERROR__PERMANENT_MEMBER,oS as MULTI_WALLET_ERROR__PERMANENT_MEMBER_NOT_ALLOWED,bS as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,wS as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,OS as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,dS as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,hS as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,iS as MULTI_WALLET_ERROR__TRANSACTION_MANAGER_NOT_ALLOWED,vS as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,DS as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,d as MULTI_WALLET_PROGRAM_ADDRESS,XT as MultiWalletAccount,$T as MultiWalletInstruction,Ic as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,fc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,un as PermanentMemberPermission,pe as Permission,de as Permissions,ls as SETTINGS_DISCRIMINATOR,ue as Secp256r1Key,M as SignedSecp256r1Key,Uc as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Pc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Fc as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,kc as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,ta as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,Zc as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Ps as TRANSACTION_BUFFER_DISCRIMINATOR,ya as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,aa as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Ea as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Sa as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,ka as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,_a as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,Za as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,Fa as TRANSACTION_EXECUTE_DISCRIMINATOR,ai as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,ti as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,lt as TransactionManagerPermission,LW as changeConfig,nL as closeTransactionBuffer,qW as compressSettingsAccount,tC as configAction,It as convertMemberKeyToString,Yi as convertPubkeyCompressedToCose,rW as convertPubkeyCoseToCompressed,tO as createDomainConfig,dO as createDomainUserAccounts,mO as createGlobalCounter,Ki as createPopUp,fu as createTransactionBuffer,Hx as createTransactionManagerSigner,IO as createUserAccounts,$O as createWallet,bn as decodeDomainConfig,Ln as decodeGlobalCounter,Ss as decodeSettings,hs as decodeTransactionBuffer,iB as decompressSettingsAccount,EO as disableDomainConfig,vO as editDomainConfig,BO as editTransactionManagerUrl,gu as executeTransaction,lu as executeTransactionBuffer,Au as executeTransactionSync,Tu as extendTransactionBuffer,fI as fetchAllDomainConfig,DI as fetchAllGlobalCounter,ku as fetchAllMaybeDomainConfig,Qu as fetchAllMaybeGlobalCounter,sy as fetchAllMaybeSettings,My as fetchAllMaybeTransactionBuffer,BM as fetchAllSettings,GM as fetchAllTransactionBuffer,_n as fetchDomainConfig,CI as fetchGlobalCounter,Lu as fetchMaybeDomainConfig,$u as fetchMaybeGlobalCounter,wr as fetchMaybeSettings,Sx as fetchMaybeSettingsAccountData,Dy as fetchMaybeTransactionBuffer,Tx as fetchMaybeUserAccountData,OM as fetchSettings,qt as fetchSettingsAccountData,vs as fetchTransactionBuffer,wi as fetchUserAccountData,hI as getAddMemberArgsCodec,cr as getAddMemberArgsDecoder,or as getAddMemberArgsEncoder,Se as getAuthEndpoint,pE as getChangeConfigCompressedDiscriminatorBytes,Gs as getChangeConfigCompressedInstruction,fE as getChangeConfigCompressedInstructionDataCodec,Vs as getChangeConfigCompressedInstructionDataDecoder,Hs as getChangeConfigCompressedInstructionDataEncoder,oE as getChangeConfigDiscriminatorBytes,aE as getChangeConfigInstruction,Ls as getChangeConfigInstructionAsync,cE as getChangeConfigInstructionDataCodec,Bs as getChangeConfigInstructionDataDecoder,Fr as getChangeConfigInstructionDataEncoder,_I as getCompiledInstructionCodec,ir as getCompiledInstructionDecoder,ar as getCompiledInstructionEncoder,ME as getCompressSettingsAccountDiscriminatorBytes,Ys as getCompressSettingsAccountInstruction,EE as getCompressSettingsAccountInstructionDataCodec,js as getCompressSettingsAccountInstructionDataDecoder,Js as getCompressSettingsAccountInstructionDataEncoder,BI as getCompressedAccountMetaCodec,Ze as getCompressedAccountMetaDecoder,Ye as getCompressedAccountMetaEncoder,NI as getCompressedAccountMetaReadOnlyCodec,Qe as getCompressedAccountMetaReadOnlyDecoder,$e as getCompressedAccountMetaReadOnlyEncoder,GI as getCompressedProofCodec,mr as getCompressedProofDecoder,yr as getCompressedProofEncoder,Q as getCompressedSettingsAddressFromIndex,JI as getCompressedSettingsCodec,qI as getCompressedSettingsDataCodec,rt as getCompressedSettingsDataDecoder,tt as getCompressedSettingsDataEncoder,G as getCompressedSettingsDecoder,et as getCompressedSettingsEncoder,Oi as getComputeBudgetEstimate,eC as getConfigActionCodec,st as getConfigActionDecoder,nt as getConfigActionEncoder,UE as getCreateDomainConfigDiscriminatorBytes,eo as getCreateDomainConfigInstruction,WE as getCreateDomainConfigInstructionDataCodec,Qs as getCreateDomainConfigInstructionDataDecoder,$s as getCreateDomainConfigInstructionDataEncoder,VE as getCreateDomainUserAccountDiscriminatorBytes,co as getCreateDomainUserAccountInstruction,GE as getCreateDomainUserAccountInstructionDataCodec,oo as getCreateDomainUserAccountInstructionDataDecoder,so as getCreateDomainUserAccountInstructionDataEncoder,ZE as getCreateGlobalCounterDiscriminatorBytes,XE as getCreateGlobalCounterInstruction,go as getCreateGlobalCounterInstructionAsync,qE as getCreateGlobalCounterInstructionDataCodec,uo as getCreateGlobalCounterInstructionDataDecoder,Xr as getCreateGlobalCounterInstructionDataEncoder,pP as getCreateMultiWalletCompressedDiscriminatorBytes,Co as getCreateMultiWalletCompressedInstruction,fP as getCreateMultiWalletCompressedInstructionDataCodec,Io as getCreateMultiWalletCompressedInstructionDataDecoder,xo as getCreateMultiWalletCompressedInstructionDataEncoder,oP as getCreateMultiWalletDiscriminatorBytes,fo as getCreateMultiWalletInstruction,aP as getCreateMultiWalletInstructionAsync,cP as getCreateMultiWalletInstructionDataCodec,po as getCreateMultiWalletInstructionDataDecoder,Qr as getCreateMultiWalletInstructionDataEncoder,cC as getCreateUserAccountArgsCodec,Mr as getCreateUserAccountArgsDecoder,Dr as getCreateUserAccountArgsEncoder,MP as getCreateUserAccountsDiscriminatorBytes,ho as getCreateUserAccountsInstruction,EP as getCreateUserAccountsInstructionDataCodec,Ro as getCreateUserAccountsInstructionDataDecoder,Po as getCreateUserAccountsInstructionDataEncoder,WP as getDecompressSettingsAccountDiscriminatorBytes,Oo as getDecompressSettingsAccountInstruction,OP as getDecompressSettingsAccountInstructionDataCodec,Wo as getDecompressSettingsAccountInstructionDataDecoder,Uo as getDecompressSettingsAccountInstructionDataEncoder,uC as getDelegateOpCodec,Pr as getDelegateOpDecoder,Er as getDelegateOpEncoder,VP as getDisableDomainConfigDiscriminatorBytes,Ho as getDisableDomainConfigInstruction,GP as getDisableDomainConfigInstructionDataCodec,No as getDisableDomainConfigInstructionDataDecoder,wo as getDisableDomainConfigInstructionDataEncoder,ke as getDomainConfigAddress,pI as getDomainConfigCodec,vn as getDomainConfigDecoder,mI as getDomainConfigDiscriminatorBytes,Bu as getDomainConfigEncoder,lI as getDomainConfigSize,ZP as getEditDomainConfigDiscriminatorBytes,$o as getEditDomainConfigInstruction,qP as getEditDomainConfigInstructionDataCodec,Xo as getEditDomainConfigInstructionDataDecoder,qo as getEditDomainConfigInstructionDataEncoder,yC as getEditMemberArgsCodec,xr as getEditMemberArgsDecoder,Sr as getEditMemberArgsEncoder,sR as getEditTransactionManagerUrlDiscriminatorBytes,sc as getEditTransactionManagerUrlInstruction,oR as getEditTransactionManagerUrlInstructionDataCodec,nc as getEditTransactionManagerUrlInstructionDataDecoder,rc as getEditTransactionManagerUrlInstructionDataEncoder,pU as getFeePayer,Zt as getGlobalAdditonalInfo,Bi as getGlobalAuthorizedClient,Gt as getGlobalCounterAddress,II as getGlobalCounterCodec,Bn as getGlobalCounterDecoder,xI as getGlobalCounterDiscriminatorBytes,Xu as getGlobalCounterEncoder,MI as getGlobalCounterSize,Tn as getJitoTipsConfig,tU as getLightCpiSigner,Tt as getLightProtocolRpc,lC as getLinkWalletArgsCodec,hr as getLinkWalletArgsDecoder,Rr as getLinkWalletArgsEncoder,IC as getMemberCodec,De as getMemberDecoder,Ce as getMemberEncoder,MC as getMemberKeyCodec,ie as getMemberKeyDecoder,ae as getMemberKeyEncoder,yR as getMigrateCompressedSettingsDiscriminatorBytes,pR as getMigrateCompressedSettingsInstruction,mR as getMigrateCompressedSettingsInstructionDataCodec,uc as getMigrateCompressedSettingsInstructionDataDecoder,ic as getMigrateCompressedSettingsInstructionDataEncoder,DR as getMigrateCompressedUsersDiscriminatorBytes,ER as getMigrateCompressedUsersInstruction,MR as getMigrateCompressedUsersInstructionDataCodec,mc as getMigrateCompressedUsersInstructionDataDecoder,yc as getMigrateCompressedUsersInstructionDataEncoder,f_ as getMultiWalletErrorMessage,FR as getNativeTransferIntentCompressedDiscriminatorBytes,Mc as getNativeTransferIntentCompressedInstruction,zR as getNativeTransferIntentCompressedInstructionDataCodec,Dc as getNativeTransferIntentCompressedInstructionDataDecoder,Cc as getNativeTransferIntentCompressedInstructionDataEncoder,WR as getNativeTransferIntentDiscriminatorBytes,Tc as getNativeTransferIntentInstruction,BR as getNativeTransferIntentInstructionAsync,OR as getNativeTransferIntentInstructionDataCodec,lc as getNativeTransferIntentInstructionDataDecoder,rn as getNativeTransferIntentInstructionDataEncoder,sW as getOriginIndex,RC as getPackedAddressTreeInfoCodec,it as getPackedAddressTreeInfoDecoder,at as getPackedAddressTreeInfoEncoder,bC as getPackedStateTreeInfoCodec,Xe as getPackedStateTreeInfoDecoder,qe as getPackedStateTreeInfoEncoder,WC as getPermissionsCodec,ct as getPermissionsDecoder,ot as getPermissionsEncoder,kC as getProofArgsCodec,R as getProofArgsDecoder,P as getProofArgsEncoder,VC as getRemoveMemberArgsCodec,Cr as getRemoveMemberArgsDecoder,Ir as getRemoveMemberArgsEncoder,zC as getSecp256r1PubkeyCodec,ut as getSecp256r1PubkeyDecoder,vr as getSecp256r1PubkeyEncoder,rI as getSecp256r1SignatureOffsetsDataDecoder,tI as getSecp256r1SignatureOffsetsDataEncoder,jC as getSecp256r1VerifyArgsCodec,L as getSecp256r1VerifyArgsDecoder,B as getSecp256r1VerifyArgsEncoder,XC as getSecp256r1VerifyArgsWithDomainAddressCodec,j as getSecp256r1VerifyArgsWithDomainAddressDecoder,J as getSecp256r1VerifyArgsWithDomainAddressEncoder,V as getSecp256r1VerifyInstruction,NW as getSecp256r1VerifyInstructionDataCodec,su as getSecp256r1VerifyInstructionDataDecoder,ou as getSecp256r1VerifyInstructionDataEncoder,Wi as getSendAndConfirmTransaction,WM as getSettingsCodec,tD as getSettingsCreateOrMutateArgsCodec,_r as getSettingsCreateOrMutateArgsDecoder,br as getSettingsCreateOrMutateArgsEncoder,aD as getSettingsCreationArgsCodec,Re as getSettingsCreationArgsDecoder,Pe as getSettingsCreationArgsEncoder,Ts as getSettingsDecoder,UM as getSettingsDiscriminatorBytes,ny as getSettingsEncoder,z as getSettingsFromIndex,gD as getSettingsMutArgsCodec,me as getSettingsMutArgsDecoder,ye as getSettingsMutArgsEncoder,pD as getSettingsReadonlyArgsCodec,$ as getSettingsReadonlyArgsDecoder,X as getSettingsReadonlyArgsEncoder,LM as getSettingsSize,nW as getSignedSecp256r1Key,oe as getSolanaRpc,Ui as getSolanaRpcEndpoint,ih as getTokenTransferIntentCompressedDiscriminatorBytes,Oc as getTokenTransferIntentCompressedInstruction,dh as getTokenTransferIntentCompressedInstructionAsync,uh as getTokenTransferIntentCompressedInstructionDataCodec,Wc as getTokenTransferIntentCompressedInstructionDataDecoder,on as getTokenTransferIntentCompressedInstructionDataEncoder,$R as getTokenTransferIntentDiscriminatorBytes,hc as getTokenTransferIntentInstruction,eh as getTokenTransferIntentInstructionAsync,QR as getTokenTransferIntentInstructionDataCodec,Rc as getTokenTransferIntentInstructionDataDecoder,sn as getTokenTransferIntentInstructionDataEncoder,Mi as getTransactionBufferAddress,Rh as getTransactionBufferCloseCompressedDiscriminatorBytes,Jc as getTransactionBufferCloseCompressedInstruction,hh as getTransactionBufferCloseCompressedInstructionDataCodec,Kc as getTransactionBufferCloseCompressedInstructionDataDecoder,zc as getTransactionBufferCloseCompressedInstructionDataEncoder,Th as getTransactionBufferCloseDiscriminatorBytes,Hc as getTransactionBufferCloseInstruction,Sh as getTransactionBufferCloseInstructionDataCodec,Nc as getTransactionBufferCloseInstructionDataDecoder,wc as getTransactionBufferCloseInstructionDataEncoder,VM as getTransactionBufferCodec,TD as getTransactionBufferCreateArgsCodec,gt as getTransactionBufferCreateArgsDecoder,dt as getTransactionBufferCreateArgsEncoder,Kh as getTransactionBufferCreateCompressedDiscriminatorBytes,sa as getTransactionBufferCreateCompressedInstruction,Jh as getTransactionBufferCreateCompressedInstructionDataCodec,na as getTransactionBufferCreateCompressedInstructionDataDecoder,ra as getTransactionBufferCreateCompressedInstructionDataEncoder,Lh as getTransactionBufferCreateDiscriminatorBytes,$c as getTransactionBufferCreateInstruction,kh as getTransactionBufferCreateInstructionDataCodec,Xc as getTransactionBufferCreateInstructionDataDecoder,qc as getTransactionBufferCreateInstructionDataEncoder,Rs as getTransactionBufferDecoder,HM as getTransactionBufferDiscriminatorBytes,Cy as getTransactionBufferEncoder,uv as getTransactionBufferExecuteCompressedDiscriminatorBytes,fa as getTransactionBufferExecuteCompressedInstruction,dv as getTransactionBufferExecuteCompressedInstructionDataCodec,pa as getTransactionBufferExecuteCompressedInstructionDataDecoder,ma as getTransactionBufferExecuteCompressedInstructionDataEncoder,ev as getTransactionBufferExecuteDiscriminatorBytes,da as getTransactionBufferExecuteInstruction,tv as getTransactionBufferExecuteInstructionDataCodec,ua as getTransactionBufferExecuteInstructionDataDecoder,ia as getTransactionBufferExecuteInstructionDataEncoder,Ev as getTransactionBufferExtendCompressedDiscriminatorBytes,ha as getTransactionBufferExtendCompressedInstruction,Pv as getTransactionBufferExtendCompressedInstructionDataCodec,Ra as getTransactionBufferExtendCompressedInstructionDataDecoder,Pa as getTransactionBufferExtendCompressedInstructionDataEncoder,lv as getTransactionBufferExtendDiscriminatorBytes,Ca as getTransactionBufferExtendInstruction,Tv as getTransactionBufferExtendInstructionDataCodec,Ia as getTransactionBufferExtendInstructionDataDecoder,xa as getTransactionBufferExtendInstructionDataEncoder,Fv as getTransactionBufferVoteCompressedDiscriminatorBytes,Ha as getTransactionBufferVoteCompressedInstruction,zv as getTransactionBufferVoteCompressedInstructionDataCodec,Na as getTransactionBufferVoteCompressedInstructionDataDecoder,wa as getTransactionBufferVoteCompressedInstructionDataEncoder,Ov as getTransactionBufferVoteDiscriminatorBytes,Oa as getTransactionBufferVoteInstruction,Bv as getTransactionBufferVoteInstructionDataCodec,Wa as getTransactionBufferVoteInstructionDataDecoder,Ua as getTransactionBufferVoteInstructionDataEncoder,ob as getTransactionExecuteCompressedDiscriminatorBytes,$a as getTransactionExecuteCompressedInstruction,cb as getTransactionExecuteCompressedInstructionDataCodec,Xa as getTransactionExecuteCompressedInstructionDataDecoder,qa as getTransactionExecuteCompressedInstructionDataEncoder,Xv as getTransactionExecuteDiscriminatorBytes,Ja as getTransactionExecuteInstruction,$v as getTransactionExecuteInstructionDataCodec,Ka as getTransactionExecuteInstructionDataDecoder,za as getTransactionExecuteInstructionDataEncoder,Db as getTransactionExecuteSyncCompressedDiscriminatorBytes,di as getTransactionExecuteSyncCompressedInstruction,Mb as getTransactionExecuteSyncCompressedInstructionDataCodec,ui as getTransactionExecuteSyncCompressedInstructionDataDecoder,ii as getTransactionExecuteSyncCompressedInstructionDataEncoder,mb as getTransactionExecuteSyncDiscriminatorBytes,si as getTransactionExecuteSyncInstruction,pb as getTransactionExecuteSyncInstructionDataCodec,ni as getTransactionExecuteSyncInstructionDataDecoder,ri as getTransactionExecuteSyncInstructionDataEncoder,ED as getTransactionMessageAddressTableLookupCodec,Wr as getTransactionMessageAddressTableLookupDecoder,Ur as getTransactionMessageAddressTableLookupEncoder,CD as getTransactionMessageCodec,yt as getTransactionMessageDecoder,At as getTransactionMessageEncoder,F as getUserAccountAddress,vD as getUserCodec,WD as getUserCreationArgsCodec,Ee as getUserCreationArgsDecoder,Me as getUserCreationArgsEncoder,Y as getUserDecoder,he as getUserEncoder,kD as getUserMutArgsCodec,ne as getUserMutArgsDecoder,re as getUserMutArgsEncoder,VD as getUserReadOnlyArgsCodec,kr as getUserReadOnlyArgsDecoder,Lr as getUserReadOnlyArgsEncoder,KD as getUserReadOnlyOrMutateArgsCodec,je as getUserReadOnlyOrMutateArgsDecoder,Je as getUserReadOnlyOrMutateArgsEncoder,Ei as getWalletAddressFromIndex,fe as getWalletAddressFromSettings,u_ as identifyMultiWalletAccount,d_ as identifyMultiWalletInstruction,lU as initialize,rC as isConfigAction,l_ as isMultiWalletError,nD as isSettingsCreateOrMutateArgs,jD as isUserReadOnlyOrMutateArgs,LB as nativeTransferIntent,lE as parseChangeConfigCompressedInstruction,iE as parseChangeConfigInstruction,PE as parseCompressSettingsAccountInstruction,OE as parseCreateDomainConfigInstruction,FE as parseCreateDomainUserAccountInstruction,$E as parseCreateGlobalCounterInstruction,lP as parseCreateMultiWalletCompressedInstruction,iP as parseCreateMultiWalletInstruction,PP as parseCreateUserAccountsInstruction,BP as parseDecompressSettingsAccountInstruction,FP as parseDisableDomainConfigInstruction,XP as parseEditDomainConfigInstruction,cR as parseEditTransactionManagerUrlInstruction,fR as parseMigrateCompressedSettingsInstruction,PR as parseMigrateCompressedUsersInstruction,KR as parseNativeTransferIntentCompressedInstruction,LR as parseNativeTransferIntentInstruction,HW as parseSecp256r1VerifyInstruction,gh as parseTokenTransferIntentCompressedInstruction,th as parseTokenTransferIntentInstruction,vh as parseTransactionBufferCloseCompressedInstruction,xh as parseTransactionBufferCloseInstruction,jh as parseTransactionBufferCreateCompressedInstruction,wh as parseTransactionBufferCreateInstruction,gv as parseTransactionBufferExecuteCompressedInstruction,rv as parseTransactionBufferExecuteInstruction,Rv as parseTransactionBufferExtendCompressedInstruction,Sv as parseTransactionBufferExtendInstruction,Kv as parseTransactionBufferVoteCompressedInstruction,Lv as parseTransactionBufferVoteInstruction,ab as parseTransactionExecuteCompressedInstruction,Qv as parseTransactionExecuteInstruction,Eb as parseTransactionExecuteSyncCompressedInstruction,fb as parseTransactionExecuteSyncInstruction,lW as pollJitoBundleConfirmation,dk as prepareTransactionBundle,Dk as prepareTransactionMessage,hk as prepareTransactionSync,TW as resolveTransactionManagerSigner,Nx as sendJitoBundle,rD as settingsCreateOrMutateArgs,pW as signAndSendBundledTransactions,fW as signAndSendTransaction,GL as signMessageWithPasskey,jL as signTransactionWithPasskey,JB as tokenTransferIntent,fU as uninitialize,JD as userReadOnlyOrMutateArgs,pi as vaultTransactionMessageDeserialize,mi as vaultTransactionMessageSerialize,QL as verifyMessage,Su as voteTransactionBuffer};//# sourceMappingURL=index.js.map
1
+ import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getU16Encoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getU16Decoder,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,getOptionEncoder,getBooleanEncoder,getOptionDecoder,getBooleanDecoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getArrayEncoder,getArrayDecoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getEnumEncoder,getEnumDecoder,getU64Encoder,getU64Decoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,getBase64Decoder,AccountRole,createNoopSigner,some,none,createDecoder,createEncoder,upgradeRoleToSigner,getTransactionEncoder,getBlockhashDecoder,compileTransaction,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import CI from'bn.js';import {VERSION,featureFlags,createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,getLightSystemAccountMetasV2,TreeType,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 {verifyAuthenticationResponse}from'@simplewebauthn/server';var Vn=new Uint8Array([201,232,212,229,59,241,106,197]);function YI(){return fixEncoderSize(getBytesEncoder(),8).encode(Vn)}function jd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["numOrigins",getU16Encoder()],["authority",getAddressEncoder()],["rpIdHash",fixEncoderSize(getBytesEncoder(),32)],["bump",getU8Encoder()],["isDisabled",getU8Encoder()],["rpIdLength",getU8Encoder()],["rpId",fixEncoderSize(getBytesEncoder(),255)],["origins",fixEncoderSize(getBytesEncoder(),413)],["metadataUrlLength",getU8Encoder()],["metadataUrl",fixEncoderSize(getBytesEncoder(),100)]]),e=>({...e,discriminator:Vn}))}function Gn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["numOrigins",getU16Decoder()],["authority",getAddressDecoder()],["rpIdHash",fixDecoderSize(getBytesDecoder(),32)],["bump",getU8Decoder()],["isDisabled",getU8Decoder()],["rpIdLength",getU8Decoder()],["rpId",fixDecoderSize(getBytesDecoder(),255)],["origins",fixDecoderSize(getBytesDecoder(),413)],["metadataUrlLength",getU8Decoder()],["metadataUrl",fixDecoderSize(getBytesDecoder(),100)]])}function ZI(){return combineCodec(jd(),Gn())}function Fn(e){return decodeAccount(e,Gn())}async function zn(e,n,r){let s=await Jd(e,n,r);return assertAccountExists(s),s}async function Jd(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Fn(s)}async function qI(e,n,r){let s=await Yd(e,n,r);return assertAccountsExist(s),s}async function Yd(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Fn(t))}function XI(){return 846}var Jn=new Uint8Array([42,206,176,58,175,129,130,233]);function eD(){return fixEncoderSize(getBytesEncoder(),8).encode(Jn)}function iu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Jn}))}function Yn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function tD(){return combineCodec(iu(),Yn())}function Zn(e){return decodeAccount(e,Yn())}async function rD(e,n,r){let s=await du(e,n,r);return assertAccountExists(s),s}async function du(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Zn(s)}async function nD(e,n,r){let s=await uu(e,n,r);return assertAccountsExist(s),s}async function uu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Zn(t))}function sD(){return 24}function ur(){return getStructEncoder([["member",Ce()],["verifyArgs",getOptionEncoder(O())],["userArgs",Ye()],["setAsDelegate",getBooleanEncoder()]])}function Ar(){return getStructDecoder([["member",Me()],["verifyArgs",getOptionDecoder(k())],["userArgs",Ze()],["setAsDelegate",getBooleanDecoder()]])}function iD(){return combineCodec(ur(),Ar())}function gr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function mr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function AD(){return combineCodec(gr(),mr())}function qe(){return getStructEncoder([["treeInfo",$e()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function Xe(){return getStructDecoder([["treeInfo",Qe()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function pD(){return combineCodec(qe(),Xe())}function et(){return getStructEncoder([["treeInfo",$e()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function tt(){return getStructDecoder([["treeInfo",Qe()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function SD(){return combineCodec(et(),tt())}function lr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function Sr(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function DD(){return combineCodec(lr(),Sr())}function rt(){return getStructEncoder([["data",getOptionEncoder(nt())]])}function z(){return getStructDecoder([["data",getOptionDecoder(st())]])}function PD(){return combineCodec(rt(),z())}function nt(){return getStructEncoder([["threshold",getU8Encoder()],["bump",getU8Encoder()],["index",getU128Encoder()],["multiWalletBump",getU8Encoder()],["members",getArrayEncoder(Ce())],["settingsAddressTreeIndex",getU8Encoder()]])}function st(){return getStructDecoder([["threshold",getU8Decoder()],["bump",getU8Decoder()],["index",getU128Decoder()],["multiWalletBump",getU8Decoder()],["members",getArrayDecoder(Me())],["settingsAddressTreeIndex",getU8Decoder()]])}function vD(){return combineCodec(nt(),st())}function ot(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Dr())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(ur())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Mr())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function ct(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Cr())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Ar())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Er())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function BD(){return combineCodec(ot(),ct())}function LD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function OD(e,n){return n.__kind===e}function Pr(){return getStructEncoder([["member",getAddressEncoder()],["isPermanentMember",getBooleanEncoder()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Ee()]])}function hr(){return getStructDecoder([["member",getAddressDecoder()],["isPermanentMember",getBooleanDecoder()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",Pe()]])}function HD(){return combineCodec(Pr(),hr())}var kt=(s=>(s[s.Add=0]="Add",s[s.Remove=1]="Remove",s[s.Ignore=2]="Ignore",s))(kt||{});function Rr(){return getEnumEncoder(kt)}function br(){return getEnumDecoder(kt)}function FD(){return combineCodec(Rr(),br())}function Dr(){return getStructEncoder([["memberKey",Z()],["permissions",at()],["userArgs",getOptionEncoder(ue())],["delegateOperation",Rr()]])}function Cr(){return getStructDecoder([["memberKey",q()],["permissions",it()],["userArgs",getOptionDecoder(Ae())],["delegateOperation",br()]])}function JD(){return combineCodec(Dr(),Cr())}function vr(){return getStructEncoder([["settingsMutArgs",pe()],["transactionManager",getOptionEncoder(ue())]])}function Ur(){return getStructDecoder([["settingsMutArgs",Te()],["transactionManager",getOptionDecoder(Ae())]])}function XD(){return combineCodec(vr(),Ur())}function Ce(){return getStructEncoder([["pubkey",Z()],["permissions",at()],["userAddressTreeIndex",getU8Encoder()]])}function Me(){return getStructDecoder([["pubkey",q()],["permissions",it()],["userAddressTreeIndex",getU8Decoder()]])}function tC(){return combineCodec(Ce(),Me())}function Z(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function q(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function sC(){return combineCodec(Z(),q())}function dt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function ut(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function aC(){return combineCodec(dt(),ut())}function $e(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function Qe(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function uC(){return combineCodec($e(),Qe())}function at(){return getStructEncoder([["mask",getU8Encoder()]])}function it(){return getStructDecoder([["mask",getU8Decoder()]])}function mC(){return combineCodec(at(),it())}function U(){return getStructEncoder([["proof",getOptionEncoder(lr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function _(){return getStructDecoder([["proof",getOptionDecoder(Sr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function fC(){return combineCodec(U(),_())}function Mr(){return getStructEncoder([["memberKey",Z()],["userArgs",Ye()]])}function Er(){return getStructDecoder([["memberKey",q()],["userArgs",Ze()]])}function IC(){return combineCodec(Mr(),Er())}function _r(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function At(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function MC(){return combineCodec(_r(),At())}function O(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function k(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function hC(){return combineCodec(O(),k())}function K(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",O()]])}function j(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",k()]])}function UC(){return combineCodec(K(),j())}function gt(){return getStructEncoder([["addressTreeInfo",dt()],["outputStateTreeIndex",getU8Encoder()]])}function mt(){return getStructDecoder([["addressTreeInfo",ut()],["outputStateTreeIndex",getU8Decoder()]])}function LC(){return combineCodec(gt(),mt())}function Wr(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function Br(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function wC(){return combineCodec(Wr(),Br())}function pe(){return getStructEncoder([["accountMeta",qe()],["data",rt()]])}function Te(){return getStructDecoder([["accountMeta",Xe()],["data",z()]])}function GC(){return combineCodec(pe(),Te())}function $(){return getStructEncoder([["accountMeta",et()],["data",rt()]])}function Q(){return getStructDecoder([["accountMeta",tt()],["data",z()]])}function jC(){return combineCodec($(),Q())}function yt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(Z())]])}function pt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(q())]])}function qC(){return combineCodec(yt(),pt())}function Tt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(gr())],["addressTableLookups",getArrayEncoder(Lr())]])}function ft(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(mr())],["addressTableLookups",getArrayDecoder(Or())]])}function eM(){return combineCodec(Tt(),ft())}function Lr(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Or(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function nM(){return combineCodec(Lr(),Or())}function he(){return getStructEncoder([["member",Z()],["domainConfig",getOptionEncoder(getAddressEncoder())],["isPermanentMember",getBooleanEncoder()],["delegatedTo",getOptionEncoder(Wr())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function J(){return getStructDecoder([["member",q()],["domainConfig",getOptionDecoder(getAddressDecoder())],["isPermanentMember",getBooleanDecoder()],["delegatedTo",getOptionDecoder(Br())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function aM(){return combineCodec(he(),J())}function Ee(){return getStructEncoder([["addressTreeInfo",dt()],["outputStateTreeIndex",getU8Encoder()]])}function Pe(){return getStructDecoder([["addressTreeInfo",ut()],["outputStateTreeIndex",getU8Decoder()]])}function AM(){return combineCodec(Ee(),Pe())}function ue(){return getStructEncoder([["accountMeta",qe()],["data",he()]])}function Ae(){return getStructDecoder([["accountMeta",Xe()],["data",J()]])}function pM(){return combineCodec(ue(),Ae())}function Nr(){return getStructEncoder([["accountMeta",et()],["data",he()]])}function Hr(){return getStructDecoder([["accountMeta",tt()],["data",J()]])}function SM(){return combineCodec(Nr(),Hr())}function Ye(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Nr()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([ue()])]])]])}function Ze(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Hr()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([Ae()])]])]])}function CM(){return combineCodec(Ye(),Ze())}function MM(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function EM(e,n){return n.__kind===e}var Rs=new Uint8Array([223,179,163,190,177,224,67,173]);function uE(){return fixEncoderSize(getBytesEncoder(),8).encode(Rs)}function Tm(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(Ce(),{size:4})],["membersLen",getU8Encoder()],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["padding",fixEncoderSize(getBytesEncoder(),11)]]),e=>({...e,discriminator:Rs}))}function bs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(Me(),{size:4})],["membersLen",getU8Decoder()],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["padding",fixDecoderSize(getBytesDecoder(),11)]])}function AE(){return combineCodec(Tm(),bs())}function vs(e){return decodeAccount(e,bs())}async function gE(e,n,r){let s=await Fr(e,n,r);return assertAccountExists(s),s}async function Fr(e,n,r){let s=await fetchEncodedAccount(e,n,r);return vs(s)}async function mE(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=>vs(t))}function yE(){return 184}var Ls=new Uint8Array([90,36,35,219,93,225,110,96]);function lE(){return fixEncoderSize(getBytesEncoder(),8).encode(Ls)}function Lm(){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",Z()],["executor",Z()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(Z())],["expectedSigners",getArrayEncoder(Z())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Ls}))}function Os(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multiWalletSettings",getAddressDecoder()],["multiWalletBump",getU8Decoder()],["canExecute",getBooleanDecoder()],["preauthorizeExecution",getBooleanDecoder()],["validTill",getU64Decoder()],["payer",getAddressDecoder()],["bump",getU8Decoder()],["bufferIndex",getU8Decoder()],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["creator",q()],["executor",q()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(q())],["expectedSigners",getArrayDecoder(q())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function SE(){return combineCodec(Lm(),Os())}function ks(e){return decodeAccount(e,Os())}async function ws(e,n,r){let s=await Om(e,n,r);return assertAccountExists(s),s}async function Om(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ks(s)}async function xE(e,n,r){let s=await km(e,n,r);return assertAccountsExist(s),s}async function km(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ks(t))}var Vs=new Uint8Array([105,23,173,2,197,255,80,87]);function CE(){return fixEncoderSize(getBytesEncoder(),8).encode(Vs)}function ty(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Vs}))}function Gs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function ME(){return combineCodec(ty(),Gs())}function Fs(e){return decodeAccount(e,Gs())}async function zs(e,n,r){let s=await ry(e,n,r);return assertAccountExists(s),s}async function ry(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Fs(s)}async function EE(e,n,r){let s=await ny(e,n,r);return assertAccountsExist(s),s}async function ny(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Fs(t))}function g({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function js(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function H(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:H(r.value),role:Ks(r.value)?upgradeRoleToSigner(s):s,...Ks(r.value)?{signer:r.value}:{}})}}function Ks(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var Ys=new Uint8Array([7]);function GE(){return fixEncoderSize(getBytesEncoder(),1).encode(Ys)}function Xr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Ys}))}function Zs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function FE(){return combineCodec(Xr(),Zs())}async function qs(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},adminDomainConfig:{value:e.adminDomainConfig??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.adminDomainConfig.value||(t.adminDomainConfig.value="5tgzUZaVtfnnSEBgmBDtJj6PdgYCnA1uaEGEUi3y5Njg");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),o(t.adminDomainConfig),...i],data:Xr().encode(c),programAddress:r})}function zE(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},adminDomainConfig:{value:e.adminDomainConfig??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.adminDomainConfig.value||(t.adminDomainConfig.value="5tgzUZaVtfnnSEBgmBDtJj6PdgYCnA1uaEGEUi3y5Njg");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),o(t.adminDomainConfig),...i],data:Xr().encode(c),programAddress:r})}function KE(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:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r(),adminDomainConfig:r()},data:Zs().decode(e.data)}}var eo=new Uint8Array([8]);function $E(){return fixEncoderSize(getBytesEncoder(),1).encode(eo)}function $r(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(ot())],["compressedProofArgs",getOptionEncoder(U())]]),e=>({...e,discriminator:eo}))}function to(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(ct())],["compressedProofArgs",getOptionDecoder(_())]])}function QE(){return combineCodec($r(),to())}async function ro(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.settings.value||(t.settings.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getU128Encoder().encode(js(c.settingsIndex))]})),t.authority.value||(t.authority.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(H(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:$r().encode(c),programAddress:r})}function eP(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:$r().encode(c),programAddress:r})}function tP(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:to().decode(e.data)}}var oo=new Uint8Array([19]);function iP(){return fixEncoderSize(getBytesEncoder(),1).encode(oo)}function co(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(ot())],["settingsMut",pe()],["compressedProofArgs",U()]]),e=>({...e,discriminator:oo}))}function ao(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(ct())],["settingsMut",Te()],["compressedProofArgs",_()]])}function dP(){return combineCodec(co(),ao())}function io(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.authority),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:co().encode(c),programAddress:r})}function uP(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),authority:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ao().decode(e.data)}}var go=new Uint8Array([16]);function fP(){return fixEncoderSize(getBytesEncoder(),1).encode(go)}function mo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",U()],["settingsMutArgs",pe()],["secp256r1VerifyArgs",getArrayEncoder(K())]]),e=>({...e,discriminator:go}))}function yo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",_()],["settingsMutArgs",Te()],["secp256r1VerifyArgs",getArrayDecoder(j())]])}function lP(){return combineCodec(mo(),yo())}function po(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:mo().encode(c),programAddress:r})}function SP(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:yo().decode(e.data)}}var lo=new Uint8Array([0]);function EP(){return fixEncoderSize(getBytesEncoder(),1).encode(lo)}function So(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authority",getAddressEncoder()],["metadataUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),e=>({...e,discriminator:lo}))}function xo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authority",getAddressDecoder()],["metadataUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function PP(){return combineCodec(So(),xo())}function Io(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},adminDomainConfig:{value:e.adminDomainConfig??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.systemProgram),o(t.adminDomainConfig),...i],data:So().encode(c),programAddress:r})}function hP(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),systemProgram:r(),adminDomainConfig:s()},data:xo().decode(e.data)}}var Co=new Uint8Array([4]);function BP(){return fixEncoderSize(getBytesEncoder(),1).encode(Co)}function cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",U()],["member",_r()],["isPermanentMember",getBooleanEncoder()],["userAccountCreationArgs",Ee()],["linkWalletArgs",getOptionEncoder(vr())]]),e=>({...e,discriminator:Co}))}function Mo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",_()],["member",At()],["isPermanentMember",getBooleanDecoder()],["userAccountCreationArgs",Pe()],["linkWalletArgs",getOptionDecoder(Ur())]])}function LP(){return combineCodec(cn(),Mo())}async function Eo(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:cn().encode(c),programAddress:r})}function OP(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i=g({args:c}),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:cn().encode(c),programAddress:r})}function kP(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:Mo().decode(e.data)}}var ho=new Uint8Array([3]);function FP(){return fixEncoderSize(getBytesEncoder(),1).encode(ho)}function dn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:ho}))}function Ro(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function zP(){return combineCodec(dn(),Ro())}async function bo(e,n){let r=n?.programAddress??u,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=g(c),i=m(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:dn().encode({}),programAddress:r})}function KP(e,n){let r=n?.programAddress??u,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=g(c),i=m(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:dn().encode({}),programAddress:r})}function jP(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:Ro().decode(e.data)}}var Uo=new Uint8Array([18]);function QP(){return fixEncoderSize(getBytesEncoder(),1).encode(Uo)}function An(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(O())],["compressedProofArgs",U()],["settingsCreation",gt()],["userMutArgs",ue()],["settingsIndex",getU128Encoder()],["setAsDelegate",getBooleanEncoder()]]),e=>({...e,discriminator:Uo}))}function _o(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(k())],["compressedProofArgs",_()],["settingsCreation",mt()],["userMutArgs",Ae()],["settingsIndex",getU128Decoder()],["setAsDelegate",getBooleanDecoder()]])}function eh(){return combineCodec(An(),_o())}async function Wo(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:An().encode(c),programAddress:r})}function th(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:An().encode(c),programAddress:r})}function rh(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s(),globalCounter:r(),whitelistedAddressTrees:r()},data:_o().decode(e.data)}}var Lo=new Uint8Array([5]);function dh(){return fixEncoderSize(getBytesEncoder(),1).encode(Lo)}function mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",U()],["createUserArgs",getArrayEncoder(Pr())]]),e=>({...e,discriminator:Lo}))}function Oo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",_()],["createUserArgs",getArrayDecoder(hr())]])}function uh(){return combineCodec(mn(),Oo())}async function ko(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:mn().encode(c),programAddress:r})}function Ah(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:mn().encode(c),programAddress:r})}function gh(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:Oo().decode(e.data)}}var Ho=new Uint8Array([17]);function Sh(){return fixEncoderSize(getBytesEncoder(),1).encode(Ho)}function Vo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMut",pe()],["compressedProofArgs",U()],["secp256r1VerifyArgs",getArrayEncoder(K())]]),e=>({...e,discriminator:Ho}))}function Go(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMut",Te()],["compressedProofArgs",_()],["secp256r1VerifyArgs",getArrayDecoder(j())]])}function xh(){return combineCodec(Vo(),Go())}function Fo(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Vo().encode(c),programAddress:r})}function Ih(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Go().decode(e.data)}}var jo=new Uint8Array([2]);function hh(){return fixEncoderSize(getBytesEncoder(),1).encode(jo)}function Jo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:jo}))}function Yo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function Rh(){return combineCodec(Jo(),Yo())}function Zo(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false},adminDomainConfig:{value:e.adminDomainConfig??null,isWritable:false}},c={...e},a={args:c};t.adminDomainConfig.value||(t.adminDomainConfig.value="5tgzUZaVtfnnSEBgmBDtJj6PdgYCnA1uaEGEUi3y5Njg");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),o(t.adminDomainConfig),...i],data:Jo().encode(c),programAddress:r})}function bh(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:{domainConfig:r(),admin:r(),adminDomainConfig:r()},data:Yo().decode(e.data)}}var sc=new Uint8Array([1]);function Lh(){return fixEncoderSize(getBytesEncoder(),1).encode(sc)}function oc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthority",getOptionEncoder(getAddressEncoder())],["newMetadataUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),e=>({...e,discriminator:sc}))}function cc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthority",getOptionDecoder(getAddressDecoder())],["newMetadataUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function Oh(){return combineCodec(oc(),cc())}function ac(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.systemProgram),...i],data:oc().encode(c),programAddress:r})}function kh(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:{domainConfig:r(),authority:r(),systemProgram:r()},data:cc().decode(e.data)}}var uc=new Uint8Array([6]);function zh(){return fixEncoderSize(getBytesEncoder(),1).encode(uc)}function Ac(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",ue()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",U()]]),e=>({...e,discriminator:uc}))}function gc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ae()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",_()]])}function Kh(){return combineCodec(Ac(),gc())}function mc(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:false}},c={...e},i=g({args:c}),o=m(r);return Object.freeze({accounts:[o(t.authority),...i],data:Ac().encode(c),programAddress:r})}function jh(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:gc().decode(e.data)}}var Tc=new Uint8Array([32]);function Qh(){return fixEncoderSize(getBytesEncoder(),1).encode(Tc)}function fc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",nt()],["compressedProofArgs",U()],["settingsCreationArgs",gt()]]),e=>({...e,discriminator:Tc}))}function lc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",st()],["compressedProofArgs",_()],["settingsCreationArgs",mt()]])}function eR(){return combineCodec(fc(),lc())}function tR(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true},adminDomainConfig:{value:e.adminDomainConfig??null,isWritable:false}},c={...e},a={args:c};t.adminDomainConfig.value||(t.adminDomainConfig.value="5tgzUZaVtfnnSEBgmBDtJj6PdgYCnA1uaEGEUi3y5Njg");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.authority),o(t.adminDomainConfig),...i],data:fc().encode(c),programAddress:r})}function rR(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:{authority:r(),adminDomainConfig:r()},data:lc().decode(e.data)}}var Ic=new Uint8Array([31]);function dR(){return fixEncoderSize(getBytesEncoder(),1).encode(Ic)}function Dc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",he()],["compressedProofArgs",U()],["userCreationArgs",Ee()]]),e=>({...e,discriminator:Ic}))}function Cc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",J()],["compressedProofArgs",_()],["userCreationArgs",Pe()]])}function uR(){return combineCodec(Dc(),Cc())}function AR(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true},adminDomainConfig:{value:e.adminDomainConfig??null,isWritable:false}},c={...e},a={args:c};t.adminDomainConfig.value||(t.adminDomainConfig.value="5tgzUZaVtfnnSEBgmBDtJj6PdgYCnA1uaEGEUi3y5Njg");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.authority),o(t.adminDomainConfig),...i],data:Dc().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:{authority:r(),adminDomainConfig:r()},data:Cc().decode(e.data)}}var Ec=new Uint8Array([29]);function SR(){return fixEncoderSize(getBytesEncoder(),1).encode(Ec)}function Tn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(K())]]),e=>({...e,discriminator:Ec}))}function Pc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(j())]])}function xR(){return combineCodec(Tn(),Pc())}async function IR(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(H(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Tn().encode(c),programAddress:r})}function hc(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Tn().encode(c),programAddress:r})}function DR(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Pc().decode(e.data)}}var vc=new Uint8Array([27]);function bR(){return fixEncoderSize(getBytesEncoder(),1).encode(vc)}function Uc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(K())],["settingsReadonlyArgs",$()],["compressedProofArgs",U()]]),e=>({...e,discriminator:vc}))}function _c(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(j())],["settingsReadonlyArgs",Q()],["compressedProofArgs",_()]])}function vR(){return combineCodec(Uc(),_c())}function Wc(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Uc().encode(c),programAddress:r})}function UR(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:_c().decode(e.data)}}var Lc=new Uint8Array([30]);function wR(){return fixEncoderSize(getBytesEncoder(),1).encode(Lc)}function ln(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(K())]]),e=>({...e,discriminator:Lc}))}function Oc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(j())]])}function NR(){return combineCodec(ln(),Oc())}async function HR(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(H(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(H(t.source.value)),getAddressEncoder().encode(H(t.tokenProgram.value)),getAddressEncoder().encode(H(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(H(t.destination.value)),getAddressEncoder().encode(H(t.tokenProgram.value)),getAddressEncoder().encode(H(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:ln().encode(c),programAddress:r})}function kc(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:ln().encode(c),programAddress:r})}function VR(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:Oc().decode(e.data)}}var Vc=new Uint8Array([28]);function YR(){return fixEncoderSize(getBytesEncoder(),1).encode(Vc)}function Sn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(K())],["settingsReadonlyArgs",$()],["compressedProofArgs",U()]]),e=>({...e,discriminator:Vc}))}function Gc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(j())],["settingsReadonlyArgs",Q()],["compressedProofArgs",_()]])}function ZR(){return combineCodec(Sn(),Gc())}async function qR(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceTokenAccount.value||(t.sourceTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(H(t.source.value)),getAddressEncoder().encode(H(t.tokenProgram.value)),getAddressEncoder().encode(H(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(H(t.destination.value)),getAddressEncoder().encode(H(t.tokenProgram.value)),getAddressEncoder().encode(H(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:Sn().encode(c),programAddress:r})}function Fc(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:Sn().encode(c),programAddress:r})}function XR(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:Gc().decode(e.data)}}var jc=new Uint8Array([12]);function sb(){return fixEncoderSize(getBytesEncoder(),1).encode(jc)}function Jc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(O())]]),e=>({...e,discriminator:jc}))}function Yc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(k())]])}function ob(){return combineCodec(Jc(),Yc())}function Zc(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Jc().encode(c),programAddress:r})}function cb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Yc().decode(e.data)}}var $c=new Uint8Array([23]);function mb(){return fixEncoderSize(getBytesEncoder(),1).encode($c)}function Qc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(O())],["settingsReadonlyArgs",$()],["compressedProofArgs",U()]]),e=>({...e,discriminator:$c}))}function ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(k())],["settingsReadonlyArgs",Q()],["compressedProofArgs",_()]])}function yb(){return combineCodec(Qc(),ea())}function ta(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Qc().encode(c),programAddress:r})}function pb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ea().decode(e.data)}}var sa=new Uint8Array([9]);function Db(){return fixEncoderSize(getBytesEncoder(),1).encode(sa)}function oa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",yt()],["secp256r1VerifyArgs",getOptionEncoder(O())]]),e=>({...e,discriminator:sa}))}function ca(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",pt()],["secp256r1VerifyArgs",getOptionDecoder(k())]])}function Cb(){return combineCodec(oa(),ca())}function aa(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:oa().encode(c),programAddress:r})}function Mb(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:ca().decode(e.data)}}var ua=new Uint8Array([20]);function Ub(){return fixEncoderSize(getBytesEncoder(),1).encode(ua)}function Aa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",yt()],["secp256r1VerifyArgs",getOptionEncoder(O())],["settingsReadonlyArgs",$()],["compressedProofArgs",U()]]),e=>({...e,discriminator:ua}))}function ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",pt()],["secp256r1VerifyArgs",getOptionDecoder(k())],["settingsReadonlyArgs",Q()],["compressedProofArgs",_()]])}function _b(){return combineCodec(Aa(),ga())}function ma(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:Aa().encode(c),programAddress:r})}function Wb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:ga().decode(e.data)}}var Ta=new Uint8Array([13]);function Hb(){return fixEncoderSize(getBytesEncoder(),1).encode(Ta)}function fa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(O())]]),e=>({...e,discriminator:Ta}))}function la(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(k())]])}function Vb(){return combineCodec(fa(),la())}function Sa(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:fa().encode(c),programAddress:r})}function Gb(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:la().decode(e.data)}}var Da=new Uint8Array([24]);function Zb(){return fixEncoderSize(getBytesEncoder(),1).encode(Da)}function Ca(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(O())],["settingsReadonlyArgs",$()],["compressedProofArgs",U()]]),e=>({...e,discriminator:Da}))}function Ma(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(k())],["settingsReadonlyArgs",Q()],["compressedProofArgs",_()]])}function qb(){return combineCodec(Ca(),Ma())}function Ea(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ca().encode(c),programAddress:r})}function Xb(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ma().decode(e.data)}}var Ra=new Uint8Array([11]);function nv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ra)}function ba(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Ra}))}function va(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function sv(){return combineCodec(ba(),va())}function Ua(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=g({args:c}),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:ba().encode(c),programAddress:r})}function ov(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:va().decode(e.data)}}var Ba=new Uint8Array([22]);function Av(){return fixEncoderSize(getBytesEncoder(),1).encode(Ba)}function La(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Ba}))}function Oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function gv(){return combineCodec(La(),Oa())}function ka(e,n){let r=n?.programAddress??u,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=g({args:c}),o=m(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:La().encode(c),programAddress:r})}function mv(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:Oa().decode(e.data)}}var Ha=new Uint8Array([10]);function xv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ha)}function Va(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(O())]]),e=>({...e,discriminator:Ha}))}function Ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(k())]])}function Iv(){return combineCodec(Va(),Ga())}function Fa(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Va().encode(c),programAddress:r})}function Dv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ga().decode(e.data)}}var ja=new Uint8Array([21]);function bv(){return fixEncoderSize(getBytesEncoder(),1).encode(ja)}function Ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(O())],["settingsReadonlyArgs",$()],["compressedProofArgs",U()]]),e=>({...e,discriminator:ja}))}function Ya(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(k())],["settingsReadonlyArgs",Q()],["compressedProofArgs",_()]])}function vv(){return combineCodec(Ja(),Ya())}function Za(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ja().encode(c),programAddress:r})}function Uv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ya().decode(e.data)}}var $a=new Uint8Array([14]);function kv(){return fixEncoderSize(getBytesEncoder(),1).encode($a)}function Qa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:$a}))}function ei(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function wv(){return combineCodec(Qa(),ei())}function ti(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=g({}),i=m(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:Qa().encode({}),programAddress:r})}function Nv(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:ei().decode(e.data)}}var si=new Uint8Array([25]);function Kv(){return fixEncoderSize(getBytesEncoder(),1).encode(si)}function oi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:si}))}function ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function jv(){return combineCodec(oi(),ci())}function ai(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=g({args:c}),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:oi().encode(c),programAddress:r})}function Jv(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:ci().decode(e.data)}}var ui=new Uint8Array([15]);function eU(){return fixEncoderSize(getBytesEncoder(),1).encode(ui)}function Ai(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Tt()],["secp256r1VerifyArgs",getArrayEncoder(K())]]),e=>({...e,discriminator:ui}))}function gi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",ft()],["secp256r1VerifyArgs",getArrayDecoder(j())]])}function tU(){return combineCodec(Ai(),gi())}function mi(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ai().encode(c),programAddress:r})}function rU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:gi().decode(e.data)}}var Ti=new Uint8Array([26]);function dU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ti)}function fi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Tt()],["secp256r1VerifyArgs",getArrayEncoder(K())],["settingsReadonlyArgs",$()],["compressedProofArgs",U()]]),e=>({...e,discriminator:Ti}))}function li(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",ft()],["secp256r1VerifyArgs",getArrayDecoder(j())],["settingsReadonlyArgs",Q()],["compressedProofArgs",_()]])}function uU(){return combineCodec(fi(),li())}function Si(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=g(a),o=m(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:fi().encode(c),programAddress:r})}function AU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:li().decode(e.data)}}var u="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",vS=(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))(vS||{});function ZU(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([201,232,212,229,59,241,106,197])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([42,206,176,58,175,129,130,233])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([223,179,163,190,177,224,67,173])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([90,36,35,219,93,225,110,96])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([105,23,173,2,197,255,80,87])),0))return 4;throw new Error("The provided account could not be identified as a multiWallet account.")}var US=(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))(US||{});function qU(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 WS=6e3,BS=6001,LS=6002,OS=6003,kS=6004,wS=6005,NS=6006,HS=6007,VS=6008,GS=6009,FS=6010,zS=6011,KS=6012,jS=6013,JS=6014,YS=6015,ZS=6016,qS=6017,XS=6018,$S=6019,QS=6020,ex=6021,tx=6022,rx=6023,nx=6024,sx=6025,ox=6026,cx=6027,ax=6028,ix=6029,dx=6030,ux=6031,Ax=6032,gx=6033,mx=6034,yx=6035,px=6036,Tx=6037,fx=6038,lx=6039,Sx=6040,xx=6041,xi;process.env.NODE_ENV!=="production"&&(xi={[XS]:"This member is already delegated to another wallet.",[px]:"The domain configuration account is disabled. Please contact support or try again later.",[Tx]:"Missing domain configuration account. Include it as a required account in this instruction.",[OS]:"Duplicate public keys detected among members. Each member must have a unique key.",[LS]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[GS]:"No members provided. A multisig wallet must contain at least one member.",[ox]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[cx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[ax]:"Declared buffer size does not match the actual serialized size.",[ex]:"Not enough members with vote permission to meet the approval threshold.",[$S]:"At least one signer with execute permission is required to proceed.",[QS]:"At least one signer with initiate permission is required to perform this action.",[JS]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[xx]:"Address Tree supplied is not part of the whitelisted address trees",[YS]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[sx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[jS]:"Unexpected number of accounts provided for this instruction.",[BS]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[WS]:"Invalid signature: the provided signature does not match the expected message payload.",[mx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[zS]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[KS]:"Malformed transaction message: structure or formatting does not match the expected layout.",[Ax]:"An input string exceeds the maximum allowed character length.",[fx]:"This member is not registered under the provided domain configuration.",[ZS]:"A required account is missing from the instruction context.",[gx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[qS]:"User mutation arguments are required when performing add or remove delegate operations.",[rx]:"No valid signer found in this transaction.",[NS]:"Only one permanent member is allowed per wallet.",[HS]:"Only one transaction manager is allowed per wallet.",[Sx]:"The given origin index is not in the whitelisted origins.",[kS]:"Permanent members cannot be removed from a wallet.",[wS]:"This operation cannot assign a permanent member.",[ux]:"Writable CPI calls to protected accounts are not permitted.",[lx]:"The relying party ID hash does not match the one defined in the domain configuration.",[yx]:"The specified slot number was not found in the provided slot history.",[FS]:"Too many members: a maximum of 4 members are supported.",[ix]:"This transaction has expired. It must be executed within 3 minutes of approval.",[VS]:"This operation cannot assign a transaction manager.",[dx]:"This transaction has not yet reached the required approval threshold.",[nx]:"Only the transaction creator or rent payer may close this transaction buffer.",[tx]:"Member is not part of the expected signers for this transaction."});function r_(e){return process.env.NODE_ENV!=="production"?xi[e]:"Error message not available in production bundles."}function n_(e,n,r){return isProgramError(e,n,u,r)}var Dt={Ed25519:1,Secp256r1:2};var fe={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Dn=8,Ct=16,ge=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(fe).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var Cn=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!==Cn)throw new Error(`Invalid public key length, expected ${Cn} 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===Cn)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()}},M=class extends ie{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;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;}};function Cx(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function Mx(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var Di=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(Cx())],["addressTableLookups",getArrayCodec(Mx())]]);function Ci(e){return Di.encode({numSigners:e.header.numSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,accountKeys:e.staticAccounts,instructions:e.instructions.map(r=>({programAddressIndex:r.programAddressIndex,accountIndices:r.accountIndices??[],data:Array.from(r.data??[])})),addressTableLookups:e.version!=="legacy"?e.addressTableLookups?.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes,writableIndexes:r.writableIndexes}))??[]:[]})}function Mi(e){let n=Di.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:u,staticAccounts:n.accountKeys,version:0}}featureFlags.version=VERSION.V2;var Ei="revibase.com",Pi="https://auth.revibase.com",hi="https://api.revibase.com";async function Pn(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await ee().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(s.instructions,c),c=>setTransactionMessageFeePayerSigner(s.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let a=Math.ceil((s.unitsConsumed??0)*1.1)||8e5;return a>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:a})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function vi(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===AccountRole.WRITABLE||c.role===AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,a)=>c-a);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function Ui(e,n){if(e.length===0)throw new Error("Bundle is empty.");for(let c=0;c<e.length;c++){if(e[c].length>1644)throw new Error(`Transaction ${c} exceeds maximum length, ${e[c].length}. Retry again.`);console.log(`Transaction ${c} length: ${e[c].length}`);}let r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})});if(!r.ok)throw console.error(await r.json()),new Error("Failed to simulate bundle");let{result:s,error:t}=await r.json();if(!s||t)throw console.error(t??s),new Error(`Unable to simulate bundle: ${JSON.stringify(t??s)}`);if(typeof s.value.summary!="string"&&s.value.summary.failed){let{TransactionFailure:c}=s.value.summary.failed.error,[,a]=c;throw console.error(t??s),new Error(`Simulation failed: ${a}`)}return s.value.transactionResults.map(c=>c.unitsConsumed)}function w(e,n=0){let r=e instanceof M?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}):null,t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,a=r?.authData&&r.verifyArgs?.clientDataJson?new Uint8Array([...r.authData,...sha256(r.verifyArgs.clientDataJson)]):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function Oe(e){if(e instanceof ie)return {keyType:Dt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Dt.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function bi(e){return e instanceof M?e.toString():e.address.toString()}function me(e){let n=new Set,r=[];for(let s of e)n.has(bi(s))||(r.push(s),n.add(bi(s)));if(r.filter(s=>s instanceof M).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function _i({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 Wi(e){let n=await fetch(`${e}/getRandomPayer`),{randomPayer:r}=await n.json();return {address:address(r),async signTransactions(s){let t={publicKey:r,transactions:s.map(i=>getBase64Decoder().decode(getTransactionEncoder().encode(i)))},a=await(await fetch(`${e}/sign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json();if("error"in a)throw new Error(a.error);return a.signatures.map(i=>({[address(r)]:getBase58Encoder().encode(i)}))}}}var ke=null,Kt=null,jt=null,Jt=null,Yt=null,zt=null,hn=null,Zt=null,Rn=null,bn=null,Bi=null;function Li(){if(!ke)throw new Error("Rpc is not initialized yet.");return ke}function Mt(){if(!Kt)throw new Error("Rpc is not initialized yet");return Kt}function ee(){if(!jt)throw new Error("Rpc is not initialized yet");return jt}function Oi(){if(!Jt)throw new Error("Rpc is not initialized yet.");return Jt}function ki(){if(!Yt)throw new Error("Rpc is not initialized yet");return Yt}async function j_(){return zt||(zt=await Wi(hn??hi)),zt}function vn(){if(!Zt)throw new Error("Jito Bundle Config is not set.");return Zt}function Ie(){return Rn??Pi}function wi(){return bn}function qt(){return Bi}function J_(){Kt=null,jt=null,ke=null,zt=null,hn=null,Zt=null,Rn=null,Jt=null,Yt=null,bn=null;}function Y_({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,authorizedClient:a,additionalInfo:i}){ke=e,Kt=createRpc(ke,r,n);let{rpc:o,sendAndConfirmTransaction:d}=createSolanaClient({urlOrMoniker:ke});jt=o,Jt=d,Yt=estimateComputeUnitLimitFactory({rpc:o}),hn=t??null,Zt=s??null,Rn=c??null,bn=a??null,Bi=i??null;}var G=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:r?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(u.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await Mt().getStateTreeInfos();return this.packOutputTreeIndex(selectStateTreeInfo(n))}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:a,queuePubkeyIndex:i,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:a,addressQueuePubkeyIndex:i});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function Xt(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await Mt().getCompressedAccount(e);return s&&n?.set(e.toString(),s),s}}async function ce(e,n){let s=(await Promise.all(e.map(async t=>Xt(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 L(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 we(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,A)=>({treeInfo:n[A],root:r[A],rootIndex:s[A],address:d.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((d,A)=>({addressTreeInfo:a[A],outputStateTreeIndex:i,address:d.address,type:d.type}))}function ne(e,n,r,s,t,c,a){let i=[];for(let A=0;A<n.length;A++)i.push({treeInfo:n[A],rootIndex:s[A],leafIndex:r[A],proveByIndex:t[A],hash:c[A].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((A,f)=>({data:a.decode(A.data.data),accountMeta:{treeInfo:o.packedTreeInfos[f],address:new Uint8Array(A.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function ye(e,n,r,s){let t=null,c=null,a=new G;if(e){await a.addSystemAccounts();let{address:i}=await se(n),o=(await ce([{address:i,type:"Settings"}],s))[0];r?c={rootIndices:[0],roots:[],leafIndices:[o.leafIndex],leaves:[],treeInfos:[o.treeInfo],proveByIndices:[o.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)))}}:c=await te([o],[]);let d=a.packTreeInfos([{treeInfo:c.treeInfos[0],rootIndex:c.rootIndices[0],leafIndex:c.leafIndices[0],proveByIndex:c.proveByIndices[0],hash:o.hash}],[]).stateTrees;if(!d)throw new Error("Unable to parsed data.");t={accountMeta:{address:new Uint8Array(o.address),treeInfo:d.packedTreeInfos[0]},data:z().decode(o.data?.data)};}return {settingsReadonlyArgs:t,proof:c,packedAccounts:a}}async function te(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await Mt().getValidityProofV0(e,n)}catch(c){if(console.error(`Attempt ${t}, Get Validity Proof failed. ${c}`),t++,t>=r)throw new Error(`Failed to get validity proof after ${r} attempts: ${c}`);await new Promise(a=>setTimeout(a,s));}throw new Error(`Failed to get validity proof after ${r} attempts`)}async function Ne(){let e=await $t();return Math.floor(Math.random()*e.length)}var Un;async function $t(){if(!Un){let{data:e}=await zs(ee(),await Vi());Un=e.whitelistedAddressTrees;}return Un}async function Gi(e,n){let r=await $x(e,n);if(!r)throw new Error("User cannot be found.");return r}async function $x(e,n){let{address:r}=await F(e),s=await Xt(r,n);return s?.data?.data?J().decode(s.data.data):null}async function Qt(e,n){let r=await Qx(e,n);if(!r)throw new Error("Settings cannot be found.");return r}async function Qx(e,n){try{let{address:r}=await se(e),s=await Xt(r,n);if(!s?.data?.data)return null;let t=z().decode(s.data.data);return t.data.__option==="None"?null:{...t.data.value,isCompressed:!0}}catch{let r=await Fr(ee(),await re(e.index));return r.exists?{...r.data,members:r.data.members.slice(0,r.data.membersLen),isCompressed:false}:null}}async function _n(e){let n=await $t();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function pW(e){let r=(await $t()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function se(e){let{index:n,settingsAddressTreeIndex:r}=e,s=await _n(r),t=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("multi_wallet")),new Uint8Array(getU128Encoder().encode(n))]);return {address:createBN254(deriveAddressV2(t,new PublicKey(s),new PublicKey(u)).toString(),"base58"),addressTree:new PublicKey(s)}}async function F(e){let{member:n,userAddressTreeIndex:r}=e,s=await _n(r),t=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),n instanceof ie?n.toTruncatedBuffer():new Uint8Array(getAddressEncoder().encode(n))]);return {address:createBN254(deriveAddressV2(t,new PublicKey(s),new PublicKey(u.toString())).toString(),"base58"),addressTree:new PublicKey(s)}}async function Ve({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(new Uint8Array(getUtf8Encoder().encode(n)));else throw new Error("RpId not found.");if(!e)throw new Error("RpIdHash not found.");let[r]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function tr(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function Vi(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Ji(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof ie?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function le(e){let[n]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function re(e){let[n]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function Yi(e){let n=await re(e);return await le(n)}async function MW(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}var Ge=null,qi=2e3,Xi=3e3,rI=300*1e3;async function rr({authUrl:e,additionalInfo:n,signer:r,popUp:s=null,data:t}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");return new Promise((c,a)=>{let i=new URL(e).origin,o=null,d=setInterval(()=>{s&&s.closed&&(f(),a(new Error("User closed the authentication window")));},500),A=setTimeout(()=>{y("Authentication timeout."),f(),a(new Error("Authentication timed out"));},rI);function f(){clearInterval(d),clearTimeout(A),o&&clearTimeout(o),Ge&&window.removeEventListener("message",Ge),s&&s.close();}if(s?s.location.replace(e):s=td(e),!s){a(new Error("Disable your popup blocker to continue."));return}function y(...l){n?.debug&&console.debug("[Popup]",...l);}let I=l=>{let D=l.origin===i,W=l.source===s;if(!D||!W||!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}},i),o=setTimeout(()=>{f(),a(new Error("User closed the authentication window"));},qi+Xi);break;case "popup-complete":y("Received completion message");try{let C=JSON.parse(l.data.payload);f(),c(C);}catch{a(new Error("Failed to parse response payload"));}break;case "popup-heartbeat":y("Received heartbeat"),o&&(clearTimeout(o),o=setTimeout(()=>{f(),a(new Error("User closed the authentication window"));},qi+Xi));break;case "popup-closed":y("Popup explicitly closed"),f(),a(new Error("User closed the authentication window"));break;default:y("Unknown message type",l.data.type);}};Ge&&window.removeEventListener("message",Ge),Ge=I,window.addEventListener("message",Ge);})}function nr(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Pt(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),a=new Uint8Array(c);for(let i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return c}function sr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function nI(e){let n=new Uint8Array(e.length/2);for(let r=0;r<n.length;r++)n[r]=parseInt(e.slice(r*2,r*2+2),16);return n}function $i(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let s=JSON.stringify(r);return new TextEncoder().encode(s.slice(1,-1))}function Qi(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let a=e[s]|e[s+1]<<8;if(s+=2,s+a>e.length)throw new Error("MaxLengthExceeded");let i=e.slice(s,s+a),o=t.decode(i);r.push(o),s+=a;}return r}function ed(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 C=n&127;r+=C;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let a=e[r+1],i=r+2,o=e.slice(i,i+a),d=c[0]===0&&c.length>32?c.slice(1):c,A=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||A.length>32)throw new Error("r or s length > 32 bytes");let f=new Uint8Array(32);f.set(d,32-d.length);let y=p256.Point.CURVE().n>>1n,I=BigInt("0x"+sr(A)),D=(I>y?p256.Point.CURVE().n-I:I).toString(16).padStart(64,"0"),W=nI(D);return new Uint8Array([...f,...W])}function td(e=`${Ie()}/loading`){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let n=window.innerWidth||screen.availWidth,r=window.innerHeight||screen.availHeight,s=n<=768,t,c,a,i;if(s)t=n,c=r,a=0,i=0;else {let A=window.screenLeft??window.screenX,f=window.screenTop??window.screenY,y=window.innerWidth??document.documentElement.clientWidth??screen.width,I=window.innerHeight??document.documentElement.clientHeight??screen.height;t=500,c=600,i=A+(y-t)/2,a=f+(I-c)/2;}let o=[`width=${t}`,`height=${c}`,`top=${a}`,`left=${i}`,"toolbar=no","location=no","status=no","menubar=no","scrollbars=yes","resizable=yes"].join(","),d=window.open(e,"_blank",o);return d&&d.focus(),d}function VW(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+sr(n.get(-2))),y:BigInt("0x"+sr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function sd(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 GW(e,n=0,r=false){let{authenticatorData:s,clientDataJSON:t,signature:c}=e.authResponse.response,a=new Uint8Array(Pt(s)),i=JSON.parse(new TextDecoder().decode(Pt(t))),o=$i(i),d=ed(new Uint8Array(Pt(c))),A=await Ve({rpIdHash:a.subarray(0,32)});return new M(e.signer.member.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Pt(t)),truncatedClientDataJson:o,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},domainConfig:A,authData:a,signature:d,originIndex:n,crossOrigin:r})}async function FW(e,n){let{data:r}=await zn(ee(),e),t=Qi(new Uint8Array(r.origins),r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Error("Origin not found in domain config");return t}async function eB(e){let n=await Pn(e,true),r=await Ui(n.map(getBase64EncodedWireTransaction),Li()),s=await Pn(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await II(s.map(getBase64EncodedWireTransaction))}async function tB({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await ee().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions([...e],c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([ki()(c),vi(ee(),c.instructions.flatMap(d=>d.accounts??[]))]),o=Math.ceil(a*1.1);return prependTransactionMessageInstructions([...o>2e5?[getSetComputeUnitLimitInstruction({units:o})]:[],...i>0?[getSetComputeUnitPriceInstruction({microLamports:i})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await Oi()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}async function II(e,n=10,r=1e3,s=vn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/bundles`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})});if(a.status===429&&c<n){await new Promise(o=>setTimeout(o,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);return i.result}throw new Error("Failed to send bundle after retries.")}async function rB(e,n=30,r=3e3,s=vn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/getBundleStatuses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});if(a.status===429&&c<n){await new Promise(d=>setTimeout(d,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);let o=i.result;if(o.value.length){let d=o.value[0];if(d.confirmation_status==="confirmed"||d.confirmation_status==="finalized")return d.transactions[d.transactions.length-1]}if(c<n){await new Promise(d=>setTimeout(d,r));continue}}throw new Error("Failed to get bundle status after retries.")}async function nB({signer:e,settingsIndexWithAddressArgs:n,transactionMessageBytes:r,cachedAccounts:s}){let t=await Qt(n,s);if(t.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:c}=t.members.find(y=>ht(y.pubkey)===e.toString())??{};if(!c)throw new Error("No permissions found for the current member.");let a=ge.has(c,fe.InitiateTransaction),i=ge.has(c,fe.VoteTransaction),o=ge.has(c,fe.ExecuteTransaction);if(a&&i&&o)return null;if(!i||!o)throw new Error("Signer lacks the required Vote/Execute permissions.");let d=t.members.find(y=>ge.has(y.permissions,Ct));if(!d)throw new Error("No transaction manager available in wallet.");let A=address(ht(d.pubkey)),f=await Gi({member:A,userAddressTreeIndex:d.userAddressTreeIndex},s);if(f.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return DI(A,f.transactionManagerUrl.value,r)}function DI(e,n,r){return {address:e,async signTransactions(s){let t={publicKey:e.toString(),transactions:s.map(getBase64EncodedWireTransaction)};r&&(t.transactionMessageBytes=getBase64Decoder().decode(r));let c=wi();if(c){let{url:o,publicKey:d}=c,f=await(await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({transactions:t.transactions,publicKey:d})})).json();if("error"in f)throw new Error(f.error);t.authorizedClient={publicKey:d,signatures:f.signatures};}let i=await(await fetch(n,{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(o=>({[e]:getBase58Encoder().encode(o)}))}}}function ht(e){return e.keyType===Dt.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}async function DB({settingsIndexWithAddressArgs:e,configActionsArgs:n,payer:r,compressed:s=false,cachedAccounts:t}){let{index:c}=e,a=await Yi(c),i=[],o=[];for(let p of n)if(p.type==="AddMembers")i.push(...await Promise.all(p.members.map(async x=>x.account.member instanceof M?{address:(await F({member:x.account.member,userAddressTreeIndex:x.account.userAddressTreeIndex})).address,type:"User"}:x.setAsDelegate?{address:(await F({member:x.account.member.address,userAddressTreeIndex:x.account.userAddressTreeIndex})).address,type:"User"}:{address:(await F({member:x.account.member,userAddressTreeIndex:x.account.userAddressTreeIndex})).address,type:"User"})));else if(p.type==="RemoveMembers")o.push(...await Promise.all(p.members.map(async x=>({address:(await F(x)).address,type:"User"}))));else if(p.type==="EditPermissions")for(let x of p.members)x.delegateOperation!==2&&(x.delegateOperation===0?i:o).push({address:(await F(x.account)).address,type:"User"});let d=new G,A=null,f=null,y=[];if(i.length||o.length||s){await d.addSystemAccounts();let p=[...s?[{address:(await se(e)).address,type:"Settings"}]:[],...o,...i],x=p.length?await ce(p,t):[];if(x.length){A=await te(x,[]);let S=x.filter(B=>B.type==="Settings"),E=x.filter(B=>B.type==="User");s&&A&&(f=ne(d,A.treeInfos.slice(0,1),A.leafIndices.slice(0,1),A.rootIndices.slice(0,1),A.proveByIndices.slice(0,1),S,z())[0]),E.length&&A&&(y=ne(d,A.treeInfos.slice(s?1:0),A.leafIndices.slice(s?1:0),A.rootIndices.slice(s?1:0),A.proveByIndices.slice(s?1:0),E,J()));}}let I=[],l=[];for(let p of n)switch(p.type){case "AddMembers":{let x=[];for(let S of p.members)if(S.account.member instanceof M){let E=I.length,{message:B,signature:v,publicKey:N,domainConfig:X}=w(S.account.member,E);B&&v&&N&&I.push({message:B,signature:v,publicKey:N}),X&&d.addPreAccounts([{address:X,role:AccountRole.READONLY}]);let Y=await or({member:S.account.member,userAddressTreeIndex:S.account.userAddressTreeIndex},y);Y&&x.push(ad({permissionArgs:S.permissions,index:E,userMutArgs:Y,isTransactionManager:S.isTransactionManager,pubkey:S.account.member,setAsDelegate:S.setAsDelegate}));}else {S.setAsDelegate&&d.addPreAccounts([{address:S.account.member.address,role:AccountRole.READONLY_SIGNER,signer:S.account.member}]);let E=await or({member:S.setAsDelegate?S.account.member.address:S.account.member,userAddressTreeIndex:S.account.userAddressTreeIndex},y);E&&x.push(ad({permissionArgs:S.permissions,index:-1,userMutArgs:E,isTransactionManager:S.isTransactionManager,pubkey:S.account.member,setAsDelegate:S.setAsDelegate}));}l.push({__kind:p.type,fields:[x]});break}case "RemoveMembers":{let x=await Promise.all(p.members.map(async S=>{let E=await or(S,y);if(!E)throw new Error("User account not found");return PI({pubkey:S.member,userMutArgs:E})}));l.push({__kind:p.type,fields:[x]});break}case "EditPermissions":{let x=await Qt(e,t),S=x.members.find(v=>ge.has(v.permissions,Dn)),E=x.members.find(v=>ge.has(v.permissions,Ct)),B=await Promise.all(p.members.map(async v=>{let N=!!S?.pubkey&&ht(S.pubkey)===v.account.member.toString();if(!!E?.pubkey&&ht(E.pubkey)===v.account.member.toString())throw new Error("Transaction Manager's permission cannot be changed.");let Y=v.delegateOperation!==2?await or(v.account,y):void 0;return EI({permissionArgs:v.permissions,isPermanentMember:N,userMutArgs:Y,pubkey:v.account.member,delegateOperation:v.delegateOperation})}));l.push({__kind:p.type,fields:[B]});break}default:l.push({__kind:p.type,fields:[p.threshold]});}let{remainingAccounts:D,systemOffset:W}=d.toAccountMetas(),C=L(A,W);return {instructions:s?[io({configActions:l,payer:r,authority:createNoopSigner(a),compressedProofArgs:C,settingsMut:f,remainingAccounts:D})]:[await ro({settingsIndex:c,configActions:l,payer:r,compressedProofArgs:C,remainingAccounts:D})],secp256r1VerifyInput:I}}async function or(e,n){let{address:r}=await F(e);return n.find(t=>new CI(new Uint8Array(t.accountMeta.address)).eq(r))}function EI({pubkey:e,permissionArgs:n,userMutArgs:r,delegateOperation:s,isPermanentMember:t}){if(t&&(r||s!==2))throw new Error("Delegation cannot be modified for a permanent member.");let c=ud(n,t);return {memberKey:Oe(e),permissions:c,userArgs:r?some(r):none(),delegateOperation:s}}function PI({pubkey:e,userMutArgs:n}){if(n.data.isPermanentMember)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:Oe(e),userArgs:n.data.delegatedTo.__option==="Some"?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function ad({pubkey:e,permissionArgs:n,index:r,userMutArgs:s,setAsDelegate:t,isTransactionManager:c}){return {member:{permissions:hI(s,t,n,c),pubkey:Oe(e),userAddressTreeIndex:s.data.userAddressTreeIndex},verifyArgs:e instanceof M&&e.verifyArgs&&r!==-1?some({truncatedClientDataJson:e.verifyArgs.truncatedClientDataJson,slotNumber:e.verifyArgs.slotNumber,signedMessageIndex:r,originIndex:e.originIndex,crossOrigin:e.crossOrigin}):none(),userArgs:t?{__kind:"Mutate",fields:[s]}:{__kind:"Read",fields:[s]},setAsDelegate:t}}function hI(e,n,r,s){let t=e.data,c=t.isPermanentMember;if(c){if(!n)throw new Error("Permanent members must also be delegates. Please set `setAsDelegate = true`.");if(t.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.")}if(s){if(r.execute||r.vote)throw new Error("Transaction Manager can only have initiate permission");if(n)throw new Error("Transaction Manager cannot be a delegate. Please set `setAsDelegate = false`.")}return ud(r,c,s)}function ud(e,n=false,r=false){let s=[];return e.initiate&&s.push(fe.InitiateTransaction),e.vote&&s.push(fe.VoteTransaction),e.execute&&s.push(fe.ExecuteTransaction),n&&s.push(Dn),r&&s.push(Ct),ge.fromPermissions(s)}var Fe=33,ze=64,kn=14,BI=2,LI=address("Secp256r1SigVerify1111111111111111111111111");function OI(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function kI(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function yd(){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=kI();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=kn;let a=[];for(let i=0;i<r;i++){let o=fixDecoderSize(getBytesDecoder(),Fe).decode(e,n);n+=Fe;let d=fixDecoderSize(getBytesDecoder(),ze).decode(e,n);n+=ze;let A=t[i].messageDataSize,f=fixDecoderSize(getBytesDecoder(),A).decode(e,n);n+=A,a.push({publicKey:o,signature:d,message:f});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function pd(){return createEncoder({getSizeFromValue:e=>{let n=kn*e.offsets.length,r=e.payload.reduce((s,t)=>s+Fe+ze+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=getU8Encoder().write(e.numSignatures,n,r),r=getU8Encoder().write(e.padding,n,r);let s=OI();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),Fe).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),ze).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function EB(){return combineCodec(pd(),yd())}function V(e,n){let r=e.length,s=BI+r*kn,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],A=s,f=A+Fe,y=f+ze;t.push({publicKeyOffset:A,publicKeyInstructionIndex:65535,signatureOffset:f,signatureInstructionIndex:65535,messageDataOffset:y,messageDataSize:d.length,messageInstructionIndex:65535}),s+=Fe+ze+d.length;}let c=n?.programAddress??LI,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:pd().encode(a)}}function PB(e){return {programAddress:e.programAddress,accounts:{},data:yd().decode(e.data)}}async function OB({settingsIndexWithAddressArgs:e,payer:n,signers:r,cachedAccounts:s}){let t=new G;await t.addSystemAccounts();let{index:c}=e,a=await re(c),{address:i}=await se(e),o=await ce([{address:i,type:"Settings"}],s),d=await te(o,[]),A=ne(t,d.treeInfos,d.leafIndices,d.rootIndices,d.proveByIndices,o.filter(p=>p.type==="Settings"),z())[0],f=me(r),y=f.filter(p=>p instanceof M),I=[],l=[];for(let p of y){let x=I.length,{domainConfig:S,verifyArgs:E,signature:B,publicKey:v,message:N}=w(p,x);N&&B&&v&&I.push({message:N,signature:B,publicKey:v}),S&&(t.addPreAccounts([{address:S,role:AccountRole.READONLY}]),E?.__option==="Some"&&l.push({domainConfigKey:S,verifyArgs:E.value}));}t.addPreAccounts(f.filter(p=>"address"in p).map(p=>({address:p.address,role:AccountRole.READONLY_SIGNER,signer:p})));let{remainingAccounts:D,systemOffset:W}=t.toAccountMetas(),C=L(d,W),b=[];return I.length>0&&b.push(V(I)),b.push(po({settings:a,settingsMutArgs:A,compressedProofArgs:C,payer:n,secp256r1VerifyArgs:l,remainingAccounts:D})),b}async function NB({admin:e,addressTree:n}){return qs({payer:e,addressTree:n,remainingAccounts:[]})}async function zB({payer:e,rpId:n,origins:r,authority:s,metadataUrl:t,adminDomainConfig:c}){let a=await Ve({rpId:n});return Io({origins:r,authority:s,payer:e,domainConfig:a,rpId:n,metadataUrl:t,adminDomainConfig:c,remainingAccounts:[]})}async function QB({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new G;await c.addSystemAccounts();let a=[];r.settingsIndexWithAddressArgs&&(a.push({address:(await se(r.settingsIndexWithAddressArgs)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await F(r.transactionManager)).address,type:"User"}));let i=a.length?await ce(a,t):[],o=await Ne(),{address:d,addressTree:A}=await F({member:r.member,userAddressTreeIndex:o}),f=[{address:d,type:"User",tree:A,queue:A}],y=await te(i,f),I=null,l=null,D=i.filter(S=>S.type==="Settings"),W=i.filter(S=>S.type==="User");D.length&&(I=ne(c,y.treeInfos.slice(0,1),y.leafIndices.slice(0,1),y.rootIndices.slice(0,1),y.proveByIndices.slice(0,1),D,z())[0]),W.length&&(l=ne(c,y.treeInfos.slice(1,2),y.leafIndices.slice(1,2),y.rootIndices.slice(1,2),y.proveByIndices.slice(1,2),W,J())[0]);let C=await we(c,y.treeInfos.slice(i.length),y.roots.slice(i.length),y.rootIndices.slice(i.length),f),{remainingAccounts:b,systemOffset:p}=c.toAccountMetas(),x=L(y,p);return {instruction:await Eo({payer:n,authority:e,compressedProofArgs:x,member:At().decode(r.member.toBuffer()),isPermanentMember:r.isPermanentMember,linkWalletArgs:I?some({settingsMutArgs:I,transactionManager:l?some(l):none()}):none(),userAccountCreationArgs:C[0],domainConfig:s,remainingAccounts:b}),userAddressTreeIndex:o}}async function nL({payer:e}){let n=await tr();return bo({payer:e,globalCounter:n})}async function uL({createUserArgs:e,payer:n}){let r=new G;await r.addSystemAccounts(),r.addPreAccounts(e.map(A=>({address:A.member.address,role:AccountRole.READONLY_SIGNER,signer:A.member})));let s=await Ne(),t=await Promise.all(e.map(async A=>{let{address:f,addressTree:y}=await F({member:A.member.address,userAddressTreeIndex:s});return {address:f,tree:y,queue:y,type:"User"}})),c=await te([],t),a=await we(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),d=L(c,o);return {instruction:await ko({compressedProofArgs:d,payer:n,createUserArgs:e.map((A,f)=>({member:A.member.address,isPermanentMember:A.isPermanentMember,userCreationArgs:a[f],transactionManagerUrl:A.transactionManagerUrl??null})),remainingAccounts:i}),userAddressTreeIndex:s}}async function yL({admin:e,rpId:n,disable:r}){let s=await Ve({rpId:n});return Zo({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function lL({authority:e,domainConfig:n,newAuthority:r,newOrigins:s,newMetadataUrl:t}){return ac({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthority:r?some(r):none(),newMetadataUrl:t?some(t):none(),remainingAccounts:[]})}async function ML({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new G;await s.addSystemAccounts();let t=await ce([{address:(await F({member:e.address,userAddressTreeIndex:n})).address,type:"User"}]),c=await te(t,[]),a=ne(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,J())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),d=L(c,o);return mc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:a,remainingAccounts:i})}async function GL({index:e,payer:n,initialMember:r,setAsDelegate:s,cachedAccounts:t}){let c=await tr(),{domainConfig:a,verifyArgs:i,message:o,signature:d,publicKey:A}=w(r.member),f=[];o&&d&&A&&f.push({message:o,signature:d,publicKey:A});let y=new G;await y.addSystemAccounts();let I=[],l=[];l.push(...await ce([{address:(await F({member:"address"in r.member?r.member.address:r.member,userAddressTreeIndex:r.userAddressTreeIndex})).address,type:"User"}],t));let D=await Ne(),{address:W,addressTree:C}=await se({index:e,settingsAddressTreeIndex:D});I.push({address:W,queue:C,tree:C,type:"Settings"});let b=l.length,p=await te(l,I),x=ne(y,p.treeInfos.slice(0,b),p.leafIndices.slice(0,b),p.rootIndices.slice(0,b),p.proveByIndices.slice(0,b),l.filter(Y=>Y.type==="User"),J())[0],E=(await we(y,p.treeInfos.slice(b),p.roots.slice(b),p.rootIndices.slice(b),I)).find(Y=>Y.type==="Settings")??null;a?y.addPreAccounts([{address:a,role:AccountRole.READONLY}]):"address"in r.member&&y.addPreAccounts([{address:r.member.address,role:AccountRole.READONLY_SIGNER,signer:r.member}]);let{remainingAccounts:B,systemOffset:v}=y.toAccountMetas(),N=L(p,v),X=[];if(!E)throw new Error("Settings creation args is missing.");return X.push(await Wo({settingsIndex:e,payer:n,initialMember:r.member instanceof M?void 0:r.member,secp256r1VerifyArgs:i,domainConfig:a,userMutArgs:x,globalCounter:c,compressedProofArgs:N,settingsCreation:E,setAsDelegate:s,remainingAccounts:B})),{instructions:X,secp256r1VerifyInput:f,settingsAddressTreeIndex:D}}async function $L({settingsIndexWithAddressArgs:e,payer:n,signers:r,cachedAccounts:s}){let t=new G;await t.addSystemAccounts();let c=await ce([{address:(await se(e)).address,type:"Settings"}],s),a=await te(c,[]),i=ne(t,a.treeInfos,a.leafIndices,a.rootIndices,a.proveByIndices,c.filter(C=>C.type==="Settings"),z())[0],o=me(r),d=o.filter(C=>C instanceof M),A=[],f=[];for(let C of d){let b=A.length,{domainConfig:p,verifyArgs:x,signature:S,publicKey:E,message:B}=w(C,b);B&&S&&E&&A.push({message:B,signature:S,publicKey:E}),p&&(t.addPreAccounts([{address:p,role:AccountRole.READONLY}]),x?.__option==="Some"&&f.push({domainConfigKey:p,verifyArgs:x.value}));}t.addPreAccounts(o.filter(C=>"address"in C).map(C=>({address:C.address,role:AccountRole.READONLY_SIGNER,signer:C})));let{remainingAccounts:y,systemOffset:I}=t.toAccountMetas(),l=L(a,I),D=[];A.length>0&&D.push(V(A));let W=await re(e.index);return D.push(Fo({settings:W,payer:n,settingsMut:i,compressedProofArgs:l,secp256r1VerifyArgs:f,remainingAccounts:y})),D}function HI(e,n,r,s){let t=VI(e,n),c=GI(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function VI(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,a=s-t,i=r-s-c;return n>=r?false:n<a?true:n>=s?n-s<i:false}function GI(e,n){return n<e.header.numSignerAccounts}async function cr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Mi(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(i=>i.lookupTableAddress),ee()):{}),a=[];a.push(...t.addressTableLookups?.map(i=>({role:AccountRole.READONLY,address:i.lookupTableAddress}))??[]);for(let[i,o]of t.staticAccounts.entries())a.push({address:o,role:HI(t,i,o,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let o=c[i.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let d of i.writableIndexes){let A=o[d];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:A,role:AccountRole.WRITABLE});}for(let d of i.readonlyIndexes){let A=o[d];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:A,role:AccountRole.READONLY});}}for(let i of s?.filter(o=>o.address!==e)??[]){let o=a.findIndex(d=>d.address===i.address);o===-1?a.push({address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}):a[o].role===AccountRole.READONLY||a[o].role===AccountRole.READONLY_SIGNER?a[o]={address:i.address,role:AccountRole.READONLY_SIGNER,signer:i}:(a[o].role===AccountRole.WRITABLE||a[o].role===AccountRole.WRITABLE_SIGNER)&&(a[o]={address:i.address,role:AccountRole.WRITABLE_SIGNER,signer:i});}return {accountMetas:a,addressLookupTableAccounts:c,transactionMessage:t}}async function Id({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let d=await le(e),{accountMetas:A,addressLookupTableAccounts:f}=await cr({transactionMessageBytes:r,walletAddress:d,additionalSigners:a,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(V(c)),y.push(o?ai({transactionBuffer:n,payer:s.address,remainingAccounts:A,settingsKey:e}):ti({transactionBuffer:n,payer:s.address,settings:e})),i&&y.push(_i({payer:s,tipAmount:i})),{instructions:y,addressLookupTableAccounts:f}}async function Dd({settingsIndexWithAddressArgs:e,transactionMessageBytes:n,signers:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],compressed:a=false,simulateProof:i=false,cachedAccounts:o}){let d=me(r),A=await re(e.index),f=await le(A),[{accountMetas:y,addressLookupTableAccounts:I,transactionMessage:l},{settingsReadonlyArgs:D,proof:W,packedAccounts:C}]=await Promise.all([cr({transactionMessageBytes:n,walletAddress:f,additionalSigners:d.filter(v=>!(v instanceof M)),addressesByLookupTableAddress:t}),ye(a,e,i,o)]);C.addPreAccounts(y);let b=d.filter(v=>v instanceof M),p=[];for(let v of b){let N=c.length,{domainConfig:X,verifyArgs:Y,signature:Se,publicKey:De,message:Rt}=w(v,N);Rt&&Se&&De&&c.push({message:Rt,signature:Se,publicKey:De}),X&&(C.addPreAccounts([{address:X,role:AccountRole.READONLY}]),Y?.__option==="Some"&&p.push({domainConfigKey:X,verifyArgs:Y.value}));}let{remainingAccounts:x,systemOffset:S}=C.toAccountMetas(),E=[];c.length>0&&E.push(V(c));let B=zI(l,y);if(a){if(!s||!D)throw new Error("Payer not found or proof args is missing.");let v=L(W,S);E.push(Si({secp256r1VerifyArgs:p,transactionMessage:B,settingsReadonlyArgs:D,compressedProofArgs:v,payer:s,remainingAccounts:x}));}else E.push(mi({secp256r1VerifyArgs:p,settings:A,transactionMessage:B,remainingAccounts:x}));return {instructions:E,addressLookupTableAccounts:I}}function zI(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 PO({settingsIndexWithAddressArgs:e,destination:n,signers:r,cachedAccounts:s,amount:t,payer:c,compressed:a=false}){let{index:i}=e,o=me(r),d=await re(i),A=await le(d),{settingsReadonlyArgs:f,proof:y,packedAccounts:I}=await ye(a,e,false,s),l=[],D=[];for(let p of o)if(p instanceof M){let x=l.length,{domainConfig:S,verifyArgs:E,signature:B,publicKey:v,message:N}=w(p,x);N&&B&&v&&l.push({message:N,signature:B,publicKey:v}),S&&(I.addPreAccounts([{address:S,role:AccountRole.READONLY}]),E?.__option==="Some"&&D.push({domainConfigKey:S,verifyArgs:E.value}));}else I.addPreAccounts([{address:p.address,role:AccountRole.READONLY_SIGNER,signer:p}]);let{remainingAccounts:W,systemOffset:C}=I.toAccountMetas(),b=[];if(l.length>0&&b.push(V(l)),a){if(!c||!f)throw new Error("Payer not found or proof args is missing.");let p=L(y,C);b.push(Wc({amount:t,settingsReadonlyArgs:f,compressedProofArgs:p,payer:c,secp256r1VerifyArgs:D,source:A,destination:n,remainingAccounts:W}));}else b.push(hc({amount:t,secp256r1VerifyArgs:D,source:A,destination:n,settings:d,remainingAccounts:W}));return b}async function OO({settingsIndexWithAddressArgs:e,destination:n,mint:r,signers:s,cachedAccounts:t,amount:c,payer:a,tokenProgram:i,compressed:o=false}){let{index:d}=e,A=me(s),f=await re(d),y=await le(f),[I,l]=await Promise.all([getAssociatedTokenAccountAddress(r,y,i),getAssociatedTokenAccountAddress(r,n,i)]),{settingsReadonlyArgs:D,proof:W,packedAccounts:C}=await ye(o,e,false,t),b=[],p=[];for(let B of A)if(B instanceof M){let v=b.length,{domainConfig:N,verifyArgs:X,signature:Y,publicKey:Se,message:De}=w(B,v);De&&Y&&Se&&b.push({message:De,signature:Y,publicKey:Se}),N&&(C.addPreAccounts([{address:N,role:AccountRole.READONLY}]),X?.__option==="Some"&&p.push({domainConfigKey:N,verifyArgs:X.value}));}else C.addPreAccounts([{address:B.address,role:AccountRole.READONLY_SIGNER,signer:B}]);let{remainingAccounts:x,systemOffset:S}=C.toAccountMetas(),E=[];if(b.length>0&&E.push(V(b)),o){if(!a||!D)throw new Error("Payer not found or proof args is missing.");let B=L(W,S);E.push(Fc({amount:c,settingsReadonlyArgs:D,compressedProofArgs:B,payer:a,secp256r1VerifyArgs:p,source:y,sourceTokenAccount:I,destination:n,destinationTokenAccount:l,mint:r,tokenProgram:i,remainingAccounts:x}));}else E.push(kc({amount:c,secp256r1VerifyArgs:p,source:y,sourceTokenAccount:I,destination:n,destinationTokenAccount:l,settings:f,mint:r,tokenProgram:i,remainingAccounts:x}));return E}async function JO({settingsIndexWithAddressArgs:e,closer:n,transactionBufferAddress:r,payer:s,compressed:t=false,cachedAccounts:c}){let a=await ws(ee(),r),i=a.data.multiWalletSettings,{settingsReadonlyArgs:o,proof:d,packedAccounts:A}=await ye(t,e,false,c),{remainingAccounts:f,systemOffset:y}=A.toAccountMetas(),{domainConfig:I,verifyArgs:l,message:D,signature:W,publicKey:C}=w(n),b=[];if(D&&W&&C&&b.push(V([{message:D,signature:W,publicKey:C}])),t){if(!s||!o)throw new Error("Payer not found or proof args is missing.");let p=L(d,y);b.push(ta({transactionBuffer:r,domainConfig:I,closer:n instanceof M?void 0:n,rentCollector:a.data.payer,secp256r1VerifyArgs:l,settingsReadonlyArgs:o,payer:s,compressedProofArgs:p,remainingAccounts:f}));}else b.push(Zc({transactionBuffer:r,domainConfig:I,closer:n instanceof M?void 0:n,settings:i,payer:a.data.payer,secp256r1VerifyArgs:l,remainingAccounts:[]}));return b}function Pd({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:d,expectedSigners:A}){let{domainConfig:f,verifyArgs:y,message:I,signature:l,publicKey:D}=w(n),W=[];if(I&&l&&D&&W.push(V([{message:I,signature:l,publicKey:D}])),d){let{settingsReadonlyArgs:C,compressedProofArgs:b,remainingAccounts:p}=d;W.push(ma({transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof M?void 0:n,domainConfig:f,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSigners:A},settingsReadonlyArgs:C,compressedProofArgs:b,remainingAccounts:p}));}else W.push(aa({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof M?void 0:n,domainConfig:f,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSigners:A},remainingAccounts:[]}));return W}function hd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=w(e),d=[];return i&&a&&o&&d.push(V([{message:i,signature:a,publicKey:o}])),s?d.push(Ea({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Sa({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,remainingAccounts:[]})),d}function Rd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?ka({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Ua({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function bd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=w(n),d=[];return o&&a&&i&&d.push(V([{message:o,signature:a,publicKey:i}])),s?d.push(Za({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Fa({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,remainingAccounts:[]})),d}async function _k({message:e,signer:n,popUp:r}){let s=await rr({authUrl:`${Ie()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"message",payload:e},signer:n,popUp:r,additionalInfo:qt()});return {...s,signer:{member:new ie(s.signer),userAddressTreeIndex:s.userAddressTreeIndex}}}async function kk({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){let c=await rr({authUrl:`${Ie()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"transaction",payload:JSON.stringify({transactionActionType:e,transactionAddress:n,transactionMessageBytes:nr(r)})},additionalInfo:qt(),signer:s,popUp:t});return {...c,signer:{member:new ie(c.signer),userAddressTreeIndex:c.userAddressTreeIndex}}}async function Fk({message:e,response:n,expectedOrigin:r=Ie()}){let{verified:s}=await verifyAuthenticationResponse({response:n.authResponse,expectedChallenge:nr(new TextEncoder().encode(e)),expectedOrigin:r,expectedRPID:Ei,requireUserVerification:false,credential:{id:n.authResponse.id,publicKey:sd(n.signer.member.toString()),counter:0}});return s}async function tw({payer:e,settingsIndexWithAddressArgs:n,transactionMessageBytes:r,creator:s,executor:t,secp256r1VerifyInput:c,jitoBundlesTipAmount:a,addressesByLookupTableAddress:i,compressed:o=false,bufferIndex:d=Math.floor(Math.random()*255),additionalVoters:A=[],additionalSigners:f=[],chunkSize:y=Math.ceil(r.length/2),cachedAccounts:I}){let l=await re(n.index),D=await Ji(l,s instanceof M?s:s.address,d),W=[],C=[];for(let ae=0;ae<r.length;ae+=y){let Hn=r.subarray(ae,ae+y);W.push(Hn),C.push(sha256(Hn));}let b=sha256(new Uint8Array(r)),{settingsReadonlyArgs:p,proof:x,packedAccounts:S}=await ye(o,n,false,I),{remainingAccounts:E,systemOffset:B}=S.toAccountMetas(),v=p?{settingsReadonlyArgs:p,compressedProofArgs:L(x,B),remainingAccounts:E,payer:e}:null,N=[s,...t?[t]:[],...A].map(Oe),X=Pd({finalBufferHash:b,finalBufferSize:r.length,bufferIndex:d,payer:e,transactionBufferAddress:D,settings:l,creator:s,preauthorizeExecution:!t,bufferExtendHashes:C,compressedArgs:v,expectedSigners:N}),Y=W.map(ae=>Rd({transactionMessageBytes:ae,transactionBufferAddress:D,settings:l,compressed:o})),Se=A.map(ae=>bd({voter:ae,transactionBufferAddress:D,settings:l,compressedArgs:v})),De=hd({compressedArgs:v,settings:l,executor:t,transactionBufferAddress:D}),{instructions:Rt,addressLookupTableAccounts:_d}=await Id({compressed:o,settings:l,transactionMessageBytes:r,transactionBufferAddress:D,payer:e,additionalSigners:f,secp256r1VerifyInput:c,jitoBundlesTipAmount:a,addressesByLookupTableAddress:i}),Ke=ae=>({payer:e,instructions:ae,addressesByLookupTableAddress:_d});return [Ke(X),...Y.map(ae=>Ke([ae])),...Se.length?[Ke(Se.flat())]:[],Ke(De),Ke(Rt)]}var ir=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=a=>{let i=s.get(a);return i===void 0&&(i={isSigner:false,isWritable:false,isInvoked:false},s.set(a,i)),i},c=t(r);c.isSigner=true,c.isWritable=true;for(let a of n){t(a.programAddress).isInvoked=false;for(let i of a.accounts??[]){let o=t(i.address);o.isSigner||=i.role===AccountRole.READONLY_SIGNER||i.role===AccountRole.WRITABLE_SIGNER,o.isWritable||=i.role===AccountRole.WRITABLE||i.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),a={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let i=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [a,i]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&a.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&!a.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,a]of this.keyMetaMap.entries())if(r(a)){let i=c,o=n.findIndex(d=>d===i);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(i),this.keyMetaMap.delete(c);}}return [s,t]}};var dr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,a)=>{s.set(c,a);});let t=c=>{let a=s.get(c);if(a===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return a};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(a=>t(a.address))??[],data:c.data}))}};function Ud({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=ir.compile(r,e),c=new Array,a={writable:[],readonly:[]},i=Object.entries(s??{});for(let y of i){let I=t.extractTableLookup(y);if(I!==void 0){let{addressTableLookup:l,drainedKeys:D}=I;c.push({readonlyIndexes:l.readonlyIndexes,readableIndices:l.readonlyIndexes,writableIndexes:l.writableIndexes,writableIndices:l.writableIndexes,lookupTableAddress:address(l.lookupTableAddress)}),a.writable.push(...D.writable),a.readonly.push(...D.readonly);}}let[o,d]=t.getMessageComponents(),f=new dr(d,a).compileInstructions(r);return {version:0,header:o,instructions:f,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function yw({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Ud({instructions:e,payer:n,recentBlockhash:u,addressesByLookupTableAddress:r});return Ci(s)}async function Sw({payer:e,settingsIndexWithAddressArgs:n,transactionMessageBytes:r,signers:s,secp256r1VerifyInput:t,addressesByLookupTableAddress:c,cachedAccounts:a,compressed:i=false,simulateProof:o=false}){let{instructions:d,addressLookupTableAccounts:A}=await Dd({settingsIndexWithAddressArgs:n,payer:e,signers:s,transactionMessageBytes:r,secp256r1VerifyInput:t,compressed:i,addressesByLookupTableAddress:c,simulateProof:o,cachedAccounts:a});return {payer:e,instructions:d,addressesByLookupTableAddress:A}}
2
+ export{Ys as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,oo as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,eo as CHANGE_CONFIG_DISCRIMINATOR,go as COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,lo as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Co as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,ho as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Uo as CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR,Lo as CREATE_USER_ACCOUNTS_DISCRIMINATOR,Ho as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,jo as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Vn as DOMAIN_CONFIG_DISCRIMINATOR,kt as DelegateOp,sc as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,uc as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,Jn as GLOBAL_COUNTER_DISCRIMINATOR,Dt as KeyType,Tc as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,Ic as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,XS as MULTI_WALLET_ERROR__ALREADY_DELEGATED,px as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,Tx as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,OS as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,LS as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,GS as MULTI_WALLET_ERROR__EMPTY_MEMBERS,ox as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,cx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,ax as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,ex as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,$S as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,QS as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,JS as MULTI_WALLET_ERROR__INVALID_ACCOUNT,xx as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,YS as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,sx as MULTI_WALLET_ERROR__INVALID_BUFFER,jS as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,BS as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,WS as MULTI_WALLET_ERROR__INVALID_SIGNED_MESSAGE,mx as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,zS as MULTI_WALLET_ERROR__INVALID_THRESHOLD,KS as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,Ax as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,fx as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,ZS as MULTI_WALLET_ERROR__MISSING_ACCOUNT,gx as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,qS as MULTI_WALLET_ERROR__MISSING_USER_ARGS,rx as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,NS as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,HS as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,Sx as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,kS as MULTI_WALLET_ERROR__PERMANENT_MEMBER,wS as MULTI_WALLET_ERROR__PERMANENT_MEMBER_NOT_ALLOWED,ux as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,lx as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,yx as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,FS as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,ix as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,VS as MULTI_WALLET_ERROR__TRANSACTION_MANAGER_NOT_ALLOWED,dx as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,nx as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,tx as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,u as MULTI_WALLET_PROGRAM_ADDRESS,vS as MultiWalletAccount,US as MultiWalletInstruction,vc as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Ec as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,Dn as PermanentMemberPermission,fe as Permission,ge as Permissions,Rs as SETTINGS_DISCRIMINATOR,ie as Secp256r1Key,M as SignedSecp256r1Key,Vc as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Lc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,$c as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,jc as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,ua as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,sa as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Ls as TRANSACTION_BUFFER_DISCRIMINATOR,Da as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Ta as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Ba as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Ra as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,ja as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,Ha as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,si as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,$a as TRANSACTION_EXECUTE_DISCRIMINATOR,Ti as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,ui as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Ct as TransactionManagerPermission,Vs as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,NB as addWhitelistedAddressTrees,DB as changeConfig,JO as closeTransactionBuffer,OB as compressSettingsAccount,LD as configAction,ht as convertMemberKeyToString,sd as convertPubkeyCompressedToCose,VW as convertPubkeyCoseToCompressed,zB as createDomainConfig,QB as createDomainUserAccounts,nL as createGlobalCounter,td as createPopUp,Pd as createTransactionBuffer,DI as createTransactionManagerSigner,uL as createUserAccounts,GL as createWallet,Fn as decodeDomainConfig,Zn as decodeGlobalCounter,vs as decodeSettings,ks as decodeTransactionBuffer,Fs as decodeWhitelistedAddressTree,$L as decompressSettingsAccount,yL as disableDomainConfig,lL as editDomainConfig,ML as editTransactionManagerUrl,Id as executeTransaction,hd as executeTransactionBuffer,Dd as executeTransactionSync,Rd as extendTransactionBuffer,qI as fetchAllDomainConfig,nD as fetchAllGlobalCounter,Yd as fetchAllMaybeDomainConfig,uu as fetchAllMaybeGlobalCounter,fm as fetchAllMaybeSettings,km as fetchAllMaybeTransactionBuffer,ny as fetchAllMaybeWhitelistedAddressTree,mE as fetchAllSettings,xE as fetchAllTransactionBuffer,EE as fetchAllWhitelistedAddressTree,zn as fetchDomainConfig,rD as fetchGlobalCounter,Jd as fetchMaybeDomainConfig,du as fetchMaybeGlobalCounter,Fr as fetchMaybeSettings,Qx as fetchMaybeSettingsAccountData,Om as fetchMaybeTransactionBuffer,$x as fetchMaybeUserAccountData,ry as fetchMaybeWhitelistedAddressTree,gE as fetchSettings,Qt as fetchSettingsAccountData,ws as fetchTransactionBuffer,Gi as fetchUserAccountData,zs as fetchWhitelistedAddressTree,iD as getAddMemberArgsCodec,Ar as getAddMemberArgsDecoder,ur as getAddMemberArgsEncoder,GE as getAddWhitelistedAddressTreesDiscriminatorBytes,zE as getAddWhitelistedAddressTreesInstruction,qs as getAddWhitelistedAddressTreesInstructionAsync,FE as getAddWhitelistedAddressTreesInstructionDataCodec,Zs as getAddWhitelistedAddressTreesInstructionDataDecoder,Xr as getAddWhitelistedAddressTreesInstructionDataEncoder,Ie as getAuthEndpoint,iP as getChangeConfigCompressedDiscriminatorBytes,io as getChangeConfigCompressedInstruction,dP as getChangeConfigCompressedInstructionDataCodec,ao as getChangeConfigCompressedInstructionDataDecoder,co as getChangeConfigCompressedInstructionDataEncoder,$E as getChangeConfigDiscriminatorBytes,eP as getChangeConfigInstruction,ro as getChangeConfigInstructionAsync,QE as getChangeConfigInstructionDataCodec,to as getChangeConfigInstructionDataDecoder,$r as getChangeConfigInstructionDataEncoder,AD as getCompiledInstructionCodec,mr as getCompiledInstructionDecoder,gr as getCompiledInstructionEncoder,fP as getCompressSettingsAccountDiscriminatorBytes,po as getCompressSettingsAccountInstruction,lP as getCompressSettingsAccountInstructionDataCodec,yo as getCompressSettingsAccountInstructionDataDecoder,mo as getCompressSettingsAccountInstructionDataEncoder,pD as getCompressedAccountMetaCodec,Xe as getCompressedAccountMetaDecoder,qe as getCompressedAccountMetaEncoder,SD as getCompressedAccountMetaReadOnlyCodec,tt as getCompressedAccountMetaReadOnlyDecoder,et as getCompressedAccountMetaReadOnlyEncoder,DD as getCompressedProofCodec,Sr as getCompressedProofDecoder,lr as getCompressedProofEncoder,se as getCompressedSettingsAddressFromIndex,PD as getCompressedSettingsCodec,vD as getCompressedSettingsDataCodec,st as getCompressedSettingsDataDecoder,nt as getCompressedSettingsDataEncoder,z as getCompressedSettingsDecoder,rt as getCompressedSettingsEncoder,ki as getComputeBudgetEstimate,BD as getConfigActionCodec,ct as getConfigActionDecoder,ot as getConfigActionEncoder,EP as getCreateDomainConfigDiscriminatorBytes,Io as getCreateDomainConfigInstruction,PP as getCreateDomainConfigInstructionDataCodec,xo as getCreateDomainConfigInstructionDataDecoder,So as getCreateDomainConfigInstructionDataEncoder,BP as getCreateDomainUserAccountDiscriminatorBytes,OP as getCreateDomainUserAccountInstruction,Eo as getCreateDomainUserAccountInstructionAsync,LP as getCreateDomainUserAccountInstructionDataCodec,Mo as getCreateDomainUserAccountInstructionDataDecoder,cn as getCreateDomainUserAccountInstructionDataEncoder,FP as getCreateGlobalCounterDiscriminatorBytes,KP as getCreateGlobalCounterInstruction,bo as getCreateGlobalCounterInstructionAsync,zP as getCreateGlobalCounterInstructionDataCodec,Ro as getCreateGlobalCounterInstructionDataDecoder,dn as getCreateGlobalCounterInstructionDataEncoder,QP as getCreateMultiWalletCompressedDiscriminatorBytes,th as getCreateMultiWalletCompressedInstruction,Wo as getCreateMultiWalletCompressedInstructionAsync,eh as getCreateMultiWalletCompressedInstructionDataCodec,_o as getCreateMultiWalletCompressedInstructionDataDecoder,An as getCreateMultiWalletCompressedInstructionDataEncoder,HD as getCreateUserAccountArgsCodec,hr as getCreateUserAccountArgsDecoder,Pr as getCreateUserAccountArgsEncoder,dh as getCreateUserAccountsDiscriminatorBytes,Ah as getCreateUserAccountsInstruction,ko as getCreateUserAccountsInstructionAsync,uh as getCreateUserAccountsInstructionDataCodec,Oo as getCreateUserAccountsInstructionDataDecoder,mn as getCreateUserAccountsInstructionDataEncoder,Sh as getDecompressSettingsAccountDiscriminatorBytes,Fo as getDecompressSettingsAccountInstruction,xh as getDecompressSettingsAccountInstructionDataCodec,Go as getDecompressSettingsAccountInstructionDataDecoder,Vo as getDecompressSettingsAccountInstructionDataEncoder,FD as getDelegateOpCodec,br as getDelegateOpDecoder,Rr as getDelegateOpEncoder,hh as getDisableDomainConfigDiscriminatorBytes,Zo as getDisableDomainConfigInstruction,Rh as getDisableDomainConfigInstructionDataCodec,Yo as getDisableDomainConfigInstructionDataDecoder,Jo as getDisableDomainConfigInstructionDataEncoder,Ve as getDomainConfigAddress,ZI as getDomainConfigCodec,Gn as getDomainConfigDecoder,YI as getDomainConfigDiscriminatorBytes,jd as getDomainConfigEncoder,XI as getDomainConfigSize,Lh as getEditDomainConfigDiscriminatorBytes,ac as getEditDomainConfigInstruction,Oh as getEditDomainConfigInstructionDataCodec,cc as getEditDomainConfigInstructionDataDecoder,oc as getEditDomainConfigInstructionDataEncoder,JD as getEditMemberArgsCodec,Cr as getEditMemberArgsDecoder,Dr as getEditMemberArgsEncoder,zh as getEditTransactionManagerUrlDiscriminatorBytes,mc as getEditTransactionManagerUrlInstruction,Kh as getEditTransactionManagerUrlInstructionDataCodec,gc as getEditTransactionManagerUrlInstructionDataDecoder,Ac as getEditTransactionManagerUrlInstructionDataEncoder,j_ as getFeePayer,qt as getGlobalAdditonalInfo,wi as getGlobalAuthorizedClient,tr as getGlobalCounterAddress,tD as getGlobalCounterCodec,Yn as getGlobalCounterDecoder,eD as getGlobalCounterDiscriminatorBytes,iu as getGlobalCounterEncoder,sD as getGlobalCounterSize,vn as getJitoTipsConfig,MW as getLightCpiSigner,Mt as getLightProtocolRpc,XD as getLinkWalletArgsCodec,Ur as getLinkWalletArgsDecoder,vr as getLinkWalletArgsEncoder,tC as getMemberCodec,Me as getMemberDecoder,Ce as getMemberEncoder,sC as getMemberKeyCodec,q as getMemberKeyDecoder,Z as getMemberKeyEncoder,Qh as getMigrateCompressedSettingsDiscriminatorBytes,tR as getMigrateCompressedSettingsInstruction,eR as getMigrateCompressedSettingsInstructionDataCodec,lc as getMigrateCompressedSettingsInstructionDataDecoder,fc as getMigrateCompressedSettingsInstructionDataEncoder,dR as getMigrateCompressedUsersDiscriminatorBytes,AR as getMigrateCompressedUsersInstruction,uR as getMigrateCompressedUsersInstructionDataCodec,Cc as getMigrateCompressedUsersInstructionDataDecoder,Dc as getMigrateCompressedUsersInstructionDataEncoder,r_ as getMultiWalletErrorMessage,bR as getNativeTransferIntentCompressedDiscriminatorBytes,Wc as getNativeTransferIntentCompressedInstruction,vR as getNativeTransferIntentCompressedInstructionDataCodec,_c as getNativeTransferIntentCompressedInstructionDataDecoder,Uc as getNativeTransferIntentCompressedInstructionDataEncoder,SR as getNativeTransferIntentDiscriminatorBytes,hc as getNativeTransferIntentInstruction,IR as getNativeTransferIntentInstructionAsync,xR as getNativeTransferIntentInstructionDataCodec,Pc as getNativeTransferIntentInstructionDataDecoder,Tn as getNativeTransferIntentInstructionDataEncoder,FW as getOriginIndex,aC as getPackedAddressTreeInfoCodec,ut as getPackedAddressTreeInfoDecoder,dt as getPackedAddressTreeInfoEncoder,uC as getPackedStateTreeInfoCodec,Qe as getPackedStateTreeInfoDecoder,$e as getPackedStateTreeInfoEncoder,mC as getPermissionsCodec,it as getPermissionsDecoder,at as getPermissionsEncoder,fC as getProofArgsCodec,_ as getProofArgsDecoder,U as getProofArgsEncoder,IC as getRemoveMemberArgsCodec,Er as getRemoveMemberArgsDecoder,Mr as getRemoveMemberArgsEncoder,MC as getSecp256r1PubkeyCodec,At as getSecp256r1PubkeyDecoder,_r as getSecp256r1PubkeyEncoder,kI as getSecp256r1SignatureOffsetsDataDecoder,OI as getSecp256r1SignatureOffsetsDataEncoder,hC as getSecp256r1VerifyArgsCodec,k as getSecp256r1VerifyArgsDecoder,O as getSecp256r1VerifyArgsEncoder,UC as getSecp256r1VerifyArgsWithDomainAddressCodec,j as getSecp256r1VerifyArgsWithDomainAddressDecoder,K as getSecp256r1VerifyArgsWithDomainAddressEncoder,V as getSecp256r1VerifyInstruction,EB as getSecp256r1VerifyInstructionDataCodec,yd as getSecp256r1VerifyInstructionDataDecoder,pd as getSecp256r1VerifyInstructionDataEncoder,Oi as getSendAndConfirmTransaction,AE as getSettingsCodec,LC as getSettingsCreationArgsCodec,mt as getSettingsCreationArgsDecoder,gt as getSettingsCreationArgsEncoder,bs as getSettingsDecoder,uE as getSettingsDiscriminatorBytes,Tm as getSettingsEncoder,re as getSettingsFromIndex,wC as getSettingsIndexWithAddressCodec,Br as getSettingsIndexWithAddressDecoder,Wr as getSettingsIndexWithAddressEncoder,GC as getSettingsMutArgsCodec,Te as getSettingsMutArgsDecoder,pe as getSettingsMutArgsEncoder,jC as getSettingsReadonlyArgsCodec,Q as getSettingsReadonlyArgsDecoder,$ as getSettingsReadonlyArgsEncoder,yE as getSettingsSize,GW as getSignedSecp256r1Key,ee as getSolanaRpc,Li as getSolanaRpcEndpoint,YR as getTokenTransferIntentCompressedDiscriminatorBytes,Fc as getTokenTransferIntentCompressedInstruction,qR as getTokenTransferIntentCompressedInstructionAsync,ZR as getTokenTransferIntentCompressedInstructionDataCodec,Gc as getTokenTransferIntentCompressedInstructionDataDecoder,Sn as getTokenTransferIntentCompressedInstructionDataEncoder,wR as getTokenTransferIntentDiscriminatorBytes,kc as getTokenTransferIntentInstruction,HR as getTokenTransferIntentInstructionAsync,NR as getTokenTransferIntentInstructionDataCodec,Oc as getTokenTransferIntentInstructionDataDecoder,ln as getTokenTransferIntentInstructionDataEncoder,Ji as getTransactionBufferAddress,mb as getTransactionBufferCloseCompressedDiscriminatorBytes,ta as getTransactionBufferCloseCompressedInstruction,yb as getTransactionBufferCloseCompressedInstructionDataCodec,ea as getTransactionBufferCloseCompressedInstructionDataDecoder,Qc as getTransactionBufferCloseCompressedInstructionDataEncoder,sb as getTransactionBufferCloseDiscriminatorBytes,Zc as getTransactionBufferCloseInstruction,ob as getTransactionBufferCloseInstructionDataCodec,Yc as getTransactionBufferCloseInstructionDataDecoder,Jc as getTransactionBufferCloseInstructionDataEncoder,SE as getTransactionBufferCodec,qC as getTransactionBufferCreateArgsCodec,pt as getTransactionBufferCreateArgsDecoder,yt as getTransactionBufferCreateArgsEncoder,Ub as getTransactionBufferCreateCompressedDiscriminatorBytes,ma as getTransactionBufferCreateCompressedInstruction,_b as getTransactionBufferCreateCompressedInstructionDataCodec,ga as getTransactionBufferCreateCompressedInstructionDataDecoder,Aa as getTransactionBufferCreateCompressedInstructionDataEncoder,Db as getTransactionBufferCreateDiscriminatorBytes,aa as getTransactionBufferCreateInstruction,Cb as getTransactionBufferCreateInstructionDataCodec,ca as getTransactionBufferCreateInstructionDataDecoder,oa as getTransactionBufferCreateInstructionDataEncoder,Os as getTransactionBufferDecoder,lE as getTransactionBufferDiscriminatorBytes,Lm as getTransactionBufferEncoder,Zb as getTransactionBufferExecuteCompressedDiscriminatorBytes,Ea as getTransactionBufferExecuteCompressedInstruction,qb as getTransactionBufferExecuteCompressedInstructionDataCodec,Ma as getTransactionBufferExecuteCompressedInstructionDataDecoder,Ca as getTransactionBufferExecuteCompressedInstructionDataEncoder,Hb as getTransactionBufferExecuteDiscriminatorBytes,Sa as getTransactionBufferExecuteInstruction,Vb as getTransactionBufferExecuteInstructionDataCodec,la as getTransactionBufferExecuteInstructionDataDecoder,fa as getTransactionBufferExecuteInstructionDataEncoder,Av as getTransactionBufferExtendCompressedDiscriminatorBytes,ka as getTransactionBufferExtendCompressedInstruction,gv as getTransactionBufferExtendCompressedInstructionDataCodec,Oa as getTransactionBufferExtendCompressedInstructionDataDecoder,La as getTransactionBufferExtendCompressedInstructionDataEncoder,nv as getTransactionBufferExtendDiscriminatorBytes,Ua as getTransactionBufferExtendInstruction,sv as getTransactionBufferExtendInstructionDataCodec,va as getTransactionBufferExtendInstructionDataDecoder,ba as getTransactionBufferExtendInstructionDataEncoder,bv as getTransactionBufferVoteCompressedDiscriminatorBytes,Za as getTransactionBufferVoteCompressedInstruction,vv as getTransactionBufferVoteCompressedInstructionDataCodec,Ya as getTransactionBufferVoteCompressedInstructionDataDecoder,Ja as getTransactionBufferVoteCompressedInstructionDataEncoder,xv as getTransactionBufferVoteDiscriminatorBytes,Fa as getTransactionBufferVoteInstruction,Iv as getTransactionBufferVoteInstructionDataCodec,Ga as getTransactionBufferVoteInstructionDataDecoder,Va as getTransactionBufferVoteInstructionDataEncoder,Kv as getTransactionExecuteCompressedDiscriminatorBytes,ai as getTransactionExecuteCompressedInstruction,jv as getTransactionExecuteCompressedInstructionDataCodec,ci as getTransactionExecuteCompressedInstructionDataDecoder,oi as getTransactionExecuteCompressedInstructionDataEncoder,kv as getTransactionExecuteDiscriminatorBytes,ti as getTransactionExecuteInstruction,wv as getTransactionExecuteInstructionDataCodec,ei as getTransactionExecuteInstructionDataDecoder,Qa as getTransactionExecuteInstructionDataEncoder,dU as getTransactionExecuteSyncCompressedDiscriminatorBytes,Si as getTransactionExecuteSyncCompressedInstruction,uU as getTransactionExecuteSyncCompressedInstructionDataCodec,li as getTransactionExecuteSyncCompressedInstructionDataDecoder,fi as getTransactionExecuteSyncCompressedInstructionDataEncoder,eU as getTransactionExecuteSyncDiscriminatorBytes,mi as getTransactionExecuteSyncInstruction,tU as getTransactionExecuteSyncInstructionDataCodec,gi as getTransactionExecuteSyncInstructionDataDecoder,Ai as getTransactionExecuteSyncInstructionDataEncoder,nM as getTransactionMessageAddressTableLookupCodec,Or as getTransactionMessageAddressTableLookupDecoder,Lr as getTransactionMessageAddressTableLookupEncoder,eM as getTransactionMessageCodec,ft as getTransactionMessageDecoder,Tt as getTransactionMessageEncoder,F as getUserAccountAddress,aM as getUserCodec,AM as getUserCreationArgsCodec,Pe as getUserCreationArgsDecoder,Ee as getUserCreationArgsEncoder,J as getUserDecoder,he as getUserEncoder,pM as getUserMutArgsCodec,Ae as getUserMutArgsDecoder,ue as getUserMutArgsEncoder,SM as getUserReadOnlyArgsCodec,Hr as getUserReadOnlyArgsDecoder,Nr as getUserReadOnlyArgsEncoder,CM as getUserReadOnlyOrMutateArgsCodec,Ze as getUserReadOnlyOrMutateArgsDecoder,Ye as getUserReadOnlyOrMutateArgsEncoder,Yi as getWalletAddressFromIndex,le as getWalletAddressFromSettings,ME as getWhitelistedAddressTreeCodec,Gs as getWhitelistedAddressTreeDecoder,CE as getWhitelistedAddressTreeDiscriminatorBytes,ty as getWhitelistedAddressTreeEncoder,_n as getWhitelistedAddressTreeFromIndex,pW as getWhitelistedAddressTreeIndexFromAddress,Vi as getWhitelistedAddressTreesAddress,ZU as identifyMultiWalletAccount,qU as identifyMultiWalletInstruction,Y_ as initialize,OD as isConfigAction,n_ as isMultiWalletError,EM as isUserReadOnlyOrMutateArgs,PO as nativeTransferIntent,KE as parseAddWhitelistedAddressTreesInstruction,uP as parseChangeConfigCompressedInstruction,tP as parseChangeConfigInstruction,SP as parseCompressSettingsAccountInstruction,hP as parseCreateDomainConfigInstruction,kP as parseCreateDomainUserAccountInstruction,jP as parseCreateGlobalCounterInstruction,rh as parseCreateMultiWalletCompressedInstruction,gh as parseCreateUserAccountsInstruction,Ih as parseDecompressSettingsAccountInstruction,bh as parseDisableDomainConfigInstruction,kh as parseEditDomainConfigInstruction,jh as parseEditTransactionManagerUrlInstruction,rR as parseMigrateCompressedSettingsInstruction,gR as parseMigrateCompressedUsersInstruction,UR as parseNativeTransferIntentCompressedInstruction,DR as parseNativeTransferIntentInstruction,PB as parseSecp256r1VerifyInstruction,XR as parseTokenTransferIntentCompressedInstruction,VR as parseTokenTransferIntentInstruction,pb as parseTransactionBufferCloseCompressedInstruction,cb as parseTransactionBufferCloseInstruction,Wb as parseTransactionBufferCreateCompressedInstruction,Mb as parseTransactionBufferCreateInstruction,Xb as parseTransactionBufferExecuteCompressedInstruction,Gb as parseTransactionBufferExecuteInstruction,mv as parseTransactionBufferExtendCompressedInstruction,ov as parseTransactionBufferExtendInstruction,Uv as parseTransactionBufferVoteCompressedInstruction,Dv as parseTransactionBufferVoteInstruction,Jv as parseTransactionExecuteCompressedInstruction,Nv as parseTransactionExecuteInstruction,AU as parseTransactionExecuteSyncCompressedInstruction,rU as parseTransactionExecuteSyncInstruction,rB as pollJitoBundleConfirmation,tw as prepareTransactionBundle,yw as prepareTransactionMessage,Sw as prepareTransactionSync,nB as resolveTransactionManagerSigner,II as sendJitoBundle,eB as signAndSendBundledTransactions,tB as signAndSendTransaction,_k as signMessageWithPasskey,kk as signTransactionWithPasskey,OO as tokenTransferIntent,J_ as uninitialize,MM as userReadOnlyOrMutateArgs,Mi as vaultTransactionMessageDeserialize,Ci as vaultTransactionMessageSerialize,Fk as verifyMessage,bd as voteTransactionBuffer};//# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map