@revibase/core 0.0.35-alpha.0 → 0.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +501 -489
- package/dist/index.d.ts +501 -489
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getOptionEncoder,getOptionDecoder,getArrayEncoder,getU64Encoder,getArrayDecoder,getU64Decoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getU16Encoder,getU16Decoder,getBooleanEncoder,getBooleanDecoder,getEnumEncoder,getEnumDecoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64Encoder,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,getBase64Decoder,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,getBlockhashDecoder,compileTransaction,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {VERSION,featureFlags,createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import {estimateComputeUnitLimitFactory,getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTransferSolInstruction}from'gill/programs';import Sd from'bn.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {p256}from'@noble/curves/nist.js';var Ln=new Uint8Array([201,232,212,229,59,241,106,197]);function dD(){return fixEncoderSize(getBytesEncoder(),8).encode(Ln)}function Bd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["rpIdHash",fixEncoderSize(getBytesEncoder(),32)],["bump",getU8Encoder()],["isDisabled",getU8Encoder()],["rpIdLength",getU8Encoder()],["numOrigins",getU8Encoder()],["rpId",fixEncoderSize(getBytesEncoder(),255)],["origins",fixEncoderSize(getBytesEncoder(),515)]]),e=>({...e,discriminator:Ln}))}function On(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["rpIdHash",fixDecoderSize(getBytesDecoder(),32)],["bump",getU8Decoder()],["isDisabled",getU8Decoder()],["rpIdLength",getU8Decoder()],["numOrigins",getU8Decoder()],["rpId",fixDecoderSize(getBytesDecoder(),255)],["origins",fixDecoderSize(getBytesDecoder(),515)]])}function uD(){return combineCodec(Bd(),On())}function Bn(e){return decodeAccount(e,On())}async function wn(e,n,r){let s=await wd(e,n,r);return assertAccountExists(s),s}async function wd(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Bn(s)}async function AD(e,n,r){let s=await kd(e,n,r);return assertAccountsExist(s),s}async function kd(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Bn(t))}function gD(){return 846}var Vn=new Uint8Array([42,206,176,58,175,129,130,233]);function pD(){return fixEncoderSize(getBytesEncoder(),8).encode(Vn)}function Qd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Vn}))}function Hn(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function TD(){return combineCodec(Qd(),Hn())}function Gn(e){return decodeAccount(e,Hn())}async function fD(e,n,r){let s=await $d(e,n,r);return assertAccountExists(s),s}async function $d(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Gn(s)}async function lD(e,n,r){let s=await eu(e,n,r);return assertAccountsExist(s),s}async function eu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Gn(t))}function SD(){return 24}function ur(){return getStructEncoder([["memberKey",Q()],["permissions",he()],["userReadonlyArgs",be()]])}function Ar(){return getStructDecoder([["memberKey",$()],["permissions",Re()],["userReadonlyArgs",ve()]])}function CD(){return combineCodec(ur(),Ar())}function gr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function yr(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function PD(){return combineCodec(gr(),yr())}function Xe(){return getStructEncoder([["treeInfo",$e()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function Qe(){return getStructDecoder([["treeInfo",et()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function vD(){return combineCodec(Xe(),Qe())}function tt(){return getStructEncoder([["treeInfo",$e()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function rt(){return getStructDecoder([["treeInfo",et()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function LD(){return combineCodec(tt(),rt())}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 wD(){return combineCodec(lr(),Sr())}function nt(){return getStructEncoder([["data",getOptionEncoder(st())]])}function ee(){return getStructDecoder([["data",getOptionDecoder(ot())]])}function HD(){return combineCodec(nt(),ee())}function st(){return getStructEncoder([["threshold",getU8Encoder()],["bump",getU8Encoder()],["index",getU128Encoder()],["multiWalletBump",getU8Encoder()],["members",getArrayEncoder(ct())],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function ot(){return getStructDecoder([["threshold",getU8Decoder()],["bump",getU8Decoder()],["index",getU128Decoder()],["multiWalletBump",getU8Decoder()],["members",getArrayDecoder(at())],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function KD(){return combineCodec(st(),ot())}function _e(){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 Ue(){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 ZD(){return combineCodec(_e(),Ue())}function YD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function XD(e,n){return n.__kind===e}function Pr(){return getStructEncoder([["member",getAddressEncoder()],["role",We()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Ae()]])}function hr(){return getStructDecoder([["member",getAddressDecoder()],["role",Le()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",ge()]])}function tC(){return combineCodec(Pr(),hr())}function Dr(){return getStructEncoder([["memberKey",Q()],["permissions",he()]])}function Cr(){return getStructDecoder([["memberKey",$()],["permissions",Re()]])}function oC(){return combineCodec(Dr(),Cr())}function it(){return getStructEncoder([["memberKey",Q()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function dt(){return getStructDecoder([["memberKey",$()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function dC(){return combineCodec(it(),dt())}function Rr(){return getStructEncoder([["settingsMutArgs",w()],["transactionManager",getOptionEncoder(Te())]])}function br(){return getStructDecoder([["settingsMutArgs",k()],["transactionManager",getOptionDecoder(fe())]])}function yC(){return combineCodec(Rr(),br())}function ct(){return getStructEncoder([["pubkey",Q()],["permissions",he()],["role",getU8Encoder()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function at(){return getStructDecoder([["pubkey",$()],["permissions",Re()],["role",getU8Decoder()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function fC(){return combineCodec(ct(),at())}function Q(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function $(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function xC(){return combineCodec(Q(),$())}function Ur(){return getStructEncoder([["authorityCreationArgs",Ae()],["compressedProofArgs",C()]])}function Wr(){return getStructDecoder([["authorityCreationArgs",ge()],["compressedProofArgs",M()]])}function MC(){return combineCodec(Ur(),Wr())}function ut(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function At(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function hC(){return combineCodec(ut(),At())}function $e(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function et(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function vC(){return combineCodec($e(),et())}function he(){return getStructEncoder([["mask",getU8Encoder()]])}function Re(){return getStructDecoder([["mask",getU8Decoder()]])}function WC(){return combineCodec(he(),Re())}function C(){return getStructEncoder([["proof",getOptionEncoder(lr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function M(){return getStructDecoder([["proof",getOptionDecoder(Sr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function wC(){return combineCodec(C(),M())}function Mr(){return getStructEncoder([["memberKey",Q()],["userArgs",Lr()]])}function Er(){return getStructDecoder([["memberKey",$()],["userArgs",Or()]])}function HC(){return combineCodec(Mr(),Er())}function Br(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function gt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function zC(){return combineCodec(Br(),gt())}function V(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function H(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function jC(){return combineCodec(V(),H())}function G(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",V()]])}function F(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",H()]])}function XC(){return combineCodec(G(),F())}function yt(){return getStructEncoder([["addressTreeInfo",ut()],["outputStateTreeIndex",getU8Encoder()]])}function mt(){return getStructDecoder([["addressTreeInfo",At()],["outputStateTreeIndex",getU8Decoder()]])}function tM(){return combineCodec(yt(),mt())}function pt(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function Tt(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function sM(){return combineCodec(pt(),Tt())}function w(){return getStructEncoder([["accountMeta",Xe()],["data",nt()]])}function k(){return getStructDecoder([["accountMeta",Qe()],["data",ee()]])}function iM(){return combineCodec(w(),k())}function ft(){return getStructEncoder([["accountMeta",tt()],["data",nt()]])}function lt(){return getStructDecoder([["accountMeta",rt()],["data",ee()]])}function gM(){return combineCodec(ft(),lt())}function St(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getOptionEncoder(getArrayEncoder(it()))]])}function xt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(dt()))]])}function TM(){return combineCodec(St(),xt())}function It(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(gr())],["addressTableLookups",getArrayEncoder(wr())]])}function Dt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(yr())],["addressTableLookups",getArrayDecoder(kr())]])}function xM(){return combineCodec(It(),Dt())}function wr(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function kr(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function CM(){return combineCodec(wr(),kr())}function Oe(){return getStructEncoder([["member",Q()],["domainConfig",getOptionEncoder(getAddressEncoder())],["role",We()],["delegatedTo",getOptionEncoder(pt())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function Z(){return getStructDecoder([["member",$()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",Le()],["delegatedTo",getOptionDecoder(Tt())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function hM(){return combineCodec(Oe(),Z())}function Ae(){return getStructEncoder([["addressTreeInfo",ut()],["outputStateTreeIndex",getU8Encoder()]])}function ge(){return getStructDecoder([["addressTreeInfo",At()],["outputStateTreeIndex",getU8Decoder()]])}function _M(){return combineCodec(Ae(),ge())}function Te(){return getStructEncoder([["accountMeta",Xe()],["data",Oe()]])}function fe(){return getStructDecoder([["accountMeta",Qe()],["data",Z()]])}function OM(){return combineCodec(Te(),fe())}function be(){return getStructEncoder([["accountMeta",tt()],["data",Oe()]])}function ve(){return getStructDecoder([["accountMeta",rt()],["data",Z()]])}function NM(){return combineCodec(be(),ve())}function Lr(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([be()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([Te()])]])]])}function Or(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([ve()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([fe()])]])]])}function FM(){return combineCodec(Lr(),Or())}function zM(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function KM(e,n){return n.__kind===e}var He=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(He||{});function We(){return getEnumEncoder(He)}function Le(){return getEnumDecoder(He)}function qM(){return combineCodec(We(),Le())}var Is=new Uint8Array([223,179,163,190,177,224,67,173]);function OE(){return fixEncoderSize(getBytesEncoder(),8).encode(Is)}function iy(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",fixEncoderSize(getBytesEncoder(),16)],["members",getArrayEncoder(ct(),{size:4})],["membersLen",getU8Encoder()],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["padding",fixEncoderSize(getBytesEncoder(),3)],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:Is}))}function Ds(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",fixDecoderSize(getBytesDecoder(),16)],["members",getArrayDecoder(at(),{size:4})],["membersLen",getU8Decoder()],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["padding",fixDecoderSize(getBytesDecoder(),3)],["latestSlotNumber",getU64Decoder()]])}function BE(){return combineCodec(iy(),Ds())}function Cs(e){return decodeAccount(e,Ds())}async function wE(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 Cs(s)}async function kE(e,n,r){let s=await dy(e,n,r);return assertAccountsExist(s),s}async function dy(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Cs(t))}function NE(){return 192}var Rs=new Uint8Array([90,36,35,219,93,225,110,96]);function FE(){return fixEncoderSize(getBytesEncoder(),8).encode(Rs)}function by(){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",Q()],["executor",Q()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(Q())],["expectedSecp256r1Signers",getOptionEncoder(getArrayEncoder(it()))],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Rs}))}function bs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["multiWalletSettings",getAddressDecoder()],["multiWalletBump",getU8Decoder()],["canExecute",getBooleanDecoder()],["preauthorizeExecution",getBooleanDecoder()],["validTill",getU64Decoder()],["payer",getAddressDecoder()],["bump",getU8Decoder()],["bufferIndex",getU8Decoder()],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["creator",$()],["executor",$()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder($())],["expectedSecp256r1Signers",getOptionDecoder(getArrayDecoder(dt()))],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function zE(){return combineCodec(by(),bs())}function vs(e){return decodeAccount(e,bs())}async function _s(e,n,r){let s=await vy(e,n,r);return assertAccountExists(s),s}async function vy(e,n,r){let s=await fetchEncodedAccount(e,n,r);return vs(s)}async function KE(e,n,r){let s=await _y(e,n,r);return assertAccountsExist(s),s}async function _y(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>vs(t))}var Ls=new Uint8Array([105,23,173,2,197,255,80,87]);function qE(){return fixEncoderSize(getBytesEncoder(),8).encode(Ls)}function Zy(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Ls}))}function Os(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function ZE(){return combineCodec(Zy(),Os())}function Bs(e){return decodeAccount(e,Os())}async function ws(e,n,r){let s=await Yy(e,n,r);return assertAccountExists(s),s}async function Yy(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Bs(s)}async function YE(e,n,r){let s=await Xy(e,n,r);return assertAccountsExist(s),s}async function Xy(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Bs(t))}function m({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function Ns(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function J(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:J(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 Hs=new Uint8Array([8]);function yP(){return fixEncoderSize(getBytesEncoder(),1).encode(Hs)}function Xr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:Hs}))}function Gs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function mP(){return combineCodec(Xr(),Gs())}async function Fs(e,n){let r=n?.programAddress??d,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:Xr().encode(c),programAddress:r})}function pP(e,n){let r=n?.programAddress??d,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:Xr().encode(c),programAddress:r})}function TP(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:Gs().decode(e.data)}}var Zs=new Uint8Array([9]);function CP(){return fixEncoderSize(getBytesEncoder(),1).encode(Zs)}function Qr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(_e())],["secp256r1VerifyArgs",getArrayEncoder(G())],["compressedProofArgs",getOptionEncoder(C())]]),e=>({...e,discriminator:Zs}))}function Ys(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(Ue())],["secp256r1VerifyArgs",getArrayDecoder(F())],["compressedProofArgs",getOptionDecoder(M())]])}function MP(){return combineCodec(Qr(),Ys())}async function Xs(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(Ns(c.settingsIndex))]})),t.authority.value||(t.authority.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(J(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:Qr().encode(c),programAddress:r})}function EP(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:Qr().encode(c),programAddress:r})}function PP(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:r()},data:Ys().decode(e.data)}}var ro=new Uint8Array([20]);function WP(){return fixEncoderSize(getBytesEncoder(),1).encode(ro)}function no(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(_e())],["secp256r1VerifyArgs",getArrayEncoder(G())],["settingsMutArgs",w()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ro}))}function so(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Ue())],["secp256r1VerifyArgs",getArrayDecoder(F())],["settingsMutArgs",k()],["compressedProofArgs",M()]])}function LP(){return combineCodec(no(),so())}function oo(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:no().encode(c),programAddress:r})}function OP(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:so().decode(e.data)}}var io=new Uint8Array([17]);function GP(){return fixEncoderSize(getBytesEncoder(),1).encode(io)}function uo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["settingsMutArgs",w()],["secp256r1VerifyArgs",getArrayEncoder(G())]]),e=>({...e,discriminator:io}))}function Ao(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",k()],["secp256r1VerifyArgs",getArrayDecoder(F())]])}function FP(){return combineCodec(uo(),Ao())}function go(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:uo().encode(c),programAddress:r})}function zP(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:Ao().decode(e.data)}}var xo=new Uint8Array([0]);function XP(){return fixEncoderSize(getBytesEncoder(),1).encode(xo)}function en(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",Ae()],["compressedProofArgs",C()]]),e=>({...e,discriminator:xo}))}function Io(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",ge()],["compressedProofArgs",M()]])}function QP(){return combineCodec(en(),Io())}async function Do(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:en().encode(c),programAddress:r})}function $P(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:en().encode(c),programAddress:r})}function eh(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Io().decode(e.data)}}var Mo=new Uint8Array([4]);function ah(){return fixEncoderSize(getBytesEncoder(),1).encode(Mo)}function rn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["member",Br()],["role",We()],["userAccountCreationArgs",Ae()],["linkWalletArgs",getOptionEncoder(Rr())]]),e=>({...e,discriminator:Mo}))}function Eo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["member",gt()],["role",Le()],["userAccountCreationArgs",ge()],["linkWalletArgs",getOptionDecoder(br())]])}function ih(){return combineCodec(rn(),Eo())}async function Po(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},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=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:rn().encode(c),programAddress:r})}function dh(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},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??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),o(t.whitelistedAddressTrees),...i],data:rn().encode(c),programAddress:r})}function uh(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:Eo().decode(e.data)}}var Ro=new Uint8Array([3]);function Th(){return fixEncoderSize(getBytesEncoder(),1).encode(Ro)}function sn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Ro}))}function bo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function fh(){return combineCodec(sn(),bo())}async function vo(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:sn().encode({}),programAddress:r})}function lh(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:sn().encode({}),programAddress:r})}function Sh(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:bo().decode(e.data)}}var Wo=new Uint8Array([19]);function Ph(){return fixEncoderSize(getBytesEncoder(),1).encode(Wo)}function on(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["settingsCreation",yt()],["userReadonlyArgs",be()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Wo}))}function Lo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["settingsCreation",mt()],["userReadonlyArgs",ve()],["settingsIndex",getU128Decoder()]])}function hh(){return combineCodec(on(),Lo())}async function Oo(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},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.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:on().encode(c),programAddress:r})}function Rh(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},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");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:on().encode(c),programAddress:r})}function bh(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:Lo().decode(e.data)}}var wo=new Uint8Array([5]);function Bh(){return fixEncoderSize(getBytesEncoder(),1).encode(wo)}function an(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["createUserArgs",getArrayEncoder(Pr())]]),e=>({...e,discriminator:wo}))}function ko(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",M()],["createUserArgs",getArrayDecoder(hr())]])}function wh(){return combineCodec(an(),ko())}async function No(e,n){let r=n?.programAddress??d,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=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:an().encode(c),programAddress:r})}function kh(e,n){let r=n?.programAddress??d,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=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:an().encode(c),programAddress:r})}function Nh(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:ko().decode(e.data)}}var Go=new Uint8Array([18]);function Jh(){return fixEncoderSize(getBytesEncoder(),1).encode(Go)}function Fo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",w()],["compressedProofArgs",C()],["secp256r1VerifyArgs",getArrayEncoder(G())]]),e=>({...e,discriminator:Go}))}function zo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",k()],["compressedProofArgs",M()],["secp256r1VerifyArgs",getArrayDecoder(F())]])}function jh(){return combineCodec(Fo(),zo())}function Ko(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:Fo().encode(c),programAddress:r})}function qh(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:zo().decode(e.data)}}var qo=new Uint8Array([2]);function eR(){return fixEncoderSize(getBytesEncoder(),1).encode(qo)}function Zo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:qo}))}function Yo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function tR(){return combineCodec(Zo(),Yo())}function Xo(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:Zo().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:{domainConfig:r(),admin:r()},data:Yo().decode(e.data)}}var tc=new Uint8Array([1]);function dR(){return fixEncoderSize(getBytesEncoder(),1).encode(tc)}function un(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Ur())]]),e=>({...e,discriminator:tc}))}function rc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Wr())]])}function uR(){return combineCodec(un(),rc())}async function AR(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:un().encode(c),programAddress:r})}function nc(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:un().encode(c),programAddress:r})}function gR(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:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:rc().decode(e.data)}}var cc=new Uint8Array([6]);function SR(){return fixEncoderSize(getBytesEncoder(),1).encode(cc)}function ac(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Te()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",C()]]),e=>({...e,discriminator:cc}))}function ic(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",fe()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",M()]])}function xR(){return combineCodec(ac(),ic())}function dc(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.authority),...i],data:ac().encode(c),programAddress:r})}function IR(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:ic().decode(e.data)}}var gc=new Uint8Array([7]);function RR(){return fixEncoderSize(getBytesEncoder(),1).encode(gc)}function yc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Te()],["secp256r1VerifyArgs",getOptionEncoder(V())],["delegateTo",getOptionEncoder(pt())],["oldSettingsMutArgs",getOptionEncoder(w())],["newSettingsMutArgs",getOptionEncoder(w())],["compressedProofArgs",C()]]),e=>({...e,discriminator:gc}))}function mc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",fe()],["secp256r1VerifyArgs",getOptionDecoder(H())],["delegateTo",getOptionDecoder(Tt())],["oldSettingsMutArgs",getOptionDecoder(k())],["newSettingsMutArgs",getOptionDecoder(k())],["compressedProofArgs",M()]])}function bR(){return combineCodec(yc(),mc())}function pc(e,n){let r=n?.programAddress??d,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},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.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...i],data:yc().encode(c),programAddress:r})}function vR(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:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:mc().decode(e.data)}}var lc=new Uint8Array([33]);function wR(){return fixEncoderSize(getBytesEncoder(),1).encode(lc)}function Sc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",st()],["compressedProofArgs",C()],["settingsCreationArgs",yt()]]),e=>({...e,discriminator:lc}))}function xc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",ot()],["compressedProofArgs",M()],["settingsCreationArgs",mt()]])}function kR(){return combineCodec(Sc(),xc())}function Ic(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.authority),...i],data:Sc().encode(c),programAddress:r})}function NR(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:xc().decode(e.data)}}var Mc=new Uint8Array([32]);function JR(){return fixEncoderSize(getBytesEncoder(),1).encode(Mc)}function Ec(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Oe()],["compressedProofArgs",C()],["userCreationArgs",Ae()]]),e=>({...e,discriminator:Mc}))}function Pc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Z()],["compressedProofArgs",M()],["userCreationArgs",ge()]])}function jR(){return combineCodec(Ec(),Pc())}function hc(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.authority),...i],data:Ec().encode(c),programAddress:r})}function qR(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Pc().decode(e.data)}}var bc=new Uint8Array([30]);function tb(){return fixEncoderSize(getBytesEncoder(),1).encode(bc)}function An(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(G())]]),e=>({...e,discriminator:bc}))}function vc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(F())]])}function rb(){return combineCodec(An(),vc())}async function nb(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},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(J(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:An().encode(c),programAddress:r})}function _c(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},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:An().encode(c),programAddress:r})}function sb(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:vc().decode(e.data)}}var Lc=new Uint8Array([28]);function Ab(){return fixEncoderSize(getBytesEncoder(),1).encode(Lc)}function Oc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(G())],["settingsMutArgs",w()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Lc}))}function Bc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(F())],["settingsMutArgs",k()],["compressedProofArgs",M()]])}function gb(){return combineCodec(Oc(),Bc())}function wc(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:Oc().encode(c),programAddress:r})}function yb(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:Bc().decode(e.data)}}var Nc=new Uint8Array([31]);function xb(){return fixEncoderSize(getBytesEncoder(),1).encode(Nc)}function yn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(G())]]),e=>({...e,discriminator:Nc}))}function Vc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(F())]])}function Ib(){return combineCodec(yn(),Vc())}async function Db(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},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(J(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(J(t.source.value)),getAddressEncoder().encode(J(t.tokenProgram.value)),getAddressEncoder().encode(J(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(J(t.destination.value)),getAddressEncoder().encode(J(t.tokenProgram.value)),getAddressEncoder().encode(J(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:yn().encode(c),programAddress:r})}function Hc(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},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:yn().encode(c),programAddress:r})}function Cb(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:Vc().decode(e.data)}}var Kc=new Uint8Array([29]);function vb(){return fixEncoderSize(getBytesEncoder(),1).encode(Kc)}function mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["createAtaIfNeeded",getBooleanEncoder()],["secp256r1VerifyArgs",getArrayEncoder(G())],["settingsMutArgs",w()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Kc}))}function Jc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["createAtaIfNeeded",getBooleanDecoder()],["secp256r1VerifyArgs",getArrayDecoder(F())],["settingsMutArgs",k()],["compressedProofArgs",M()]])}function _b(){return combineCodec(mn(),Jc())}async function Ub(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(J(t.source.value)),getAddressEncoder().encode(J(t.tokenProgram.value)),getAddressEncoder().encode(J(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(J(t.destination.value)),getAddressEncoder().encode(J(t.tokenProgram.value)),getAddressEncoder().encode(J(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:mn().encode(c),programAddress:r})}function jc(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:mn().encode(c),programAddress:r})}function Wb(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:Jc().decode(e.data)}}var Yc=new Uint8Array([13]);function Vb(){return fixEncoderSize(getBytesEncoder(),1).encode(Yc)}function Xc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:Yc}))}function Qc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())]])}function Hb(){return combineCodec(Xc(),Qc())}function $c(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},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:Xc().encode(c),programAddress:r})}function Gb(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:Qc().decode(e.data)}}var ra=new Uint8Array([24]);function Zb(){return fixEncoderSize(getBytesEncoder(),1).encode(ra)}function na(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsMutArgs",w()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ra}))}function sa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())],["settingsMutArgs",k()],["compressedProofArgs",M()]])}function Yb(){return combineCodec(na(),sa())}function oa(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:na().encode(c),programAddress:r})}function Xb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:sa().decode(e.data)}}var ia=new Uint8Array([10]);function sv(){return fixEncoderSize(getBytesEncoder(),1).encode(ia)}function da(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",St()],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:ia}))}function ua(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",xt()],["secp256r1VerifyArgs",getOptionDecoder(H())]])}function ov(){return combineCodec(da(),ua())}function Aa(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:da().encode(c),programAddress:r})}function cv(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:ua().decode(e.data)}}var ma=new Uint8Array([21]);function yv(){return fixEncoderSize(getBytesEncoder(),1).encode(ma)}function pa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",St()],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsReadonlyArgs",ft()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ma}))}function Ta(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",xt()],["secp256r1VerifyArgs",getOptionDecoder(H())],["settingsReadonlyArgs",lt()],["compressedProofArgs",M()]])}function mv(){return combineCodec(pa(),Ta())}function fa(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:pa().encode(c),programAddress:r})}function pv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Ta().decode(e.data)}}var xa=new Uint8Array([14]);function Dv(){return fixEncoderSize(getBytesEncoder(),1).encode(xa)}function Ia(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:xa}))}function Da(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())]])}function Cv(){return combineCodec(Ia(),Da())}function Ca(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??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.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ia().encode(c),programAddress:r})}function Mv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Da().decode(e.data)}}var Pa=new Uint8Array([25]);function _v(){return fixEncoderSize(getBytesEncoder(),1).encode(Pa)}function ha(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsMutArgs",w()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Pa}))}function Ra(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())],["settingsMutArgs",k()],["compressedProofArgs",M()]])}function Uv(){return combineCodec(ha(),Ra())}function ba(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:ha().encode(c),programAddress:r})}function Wv(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:Ra().decode(e.data)}}var Ua=new Uint8Array([12]);function Nv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ua)}function Wa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Ua}))}function La(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Vv(){return combineCodec(Wa(),La())}function Oa(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:Wa().encode(c),programAddress:r})}function Hv(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:La().decode(e.data)}}var ka=new Uint8Array([23]);function jv(){return fixEncoderSize(getBytesEncoder(),1).encode(ka)}function Na(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:ka}))}function Va(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function qv(){return combineCodec(Na(),Va())}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:Na().encode(c),programAddress:r})}function Zv(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:Va().decode(e.data)}}var za=new Uint8Array([11]);function r_(){return fixEncoderSize(getBytesEncoder(),1).encode(za)}function Ka(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:za}))}function Ja(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())]])}function n_(){return combineCodec(Ka(),Ja())}function ja(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:Ka().encode(c),programAddress:r})}function s_(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:Ja().decode(e.data)}}var Ya=new Uint8Array([22]);function A_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ya)}function Xa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsReadonlyArgs",ft()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ya}))}function Qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())],["settingsReadonlyArgs",lt()],["compressedProofArgs",M()]])}function g_(){return combineCodec(Xa(),Qa())}function $a(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:Xa().encode(c),programAddress:r})}function y_(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:Qa().decode(e.data)}}var ri=new Uint8Array([15]);function S_(){return fixEncoderSize(getBytesEncoder(),1).encode(ri)}function ni(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:ri}))}function si(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function x_(){return combineCodec(ni(),si())}function oi(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:ni().encode({}),programAddress:r})}function I_(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:si().decode(e.data)}}var ii=new Uint8Array([26]);function h_(){return fixEncoderSize(getBytesEncoder(),1).encode(ii)}function di(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:ii}))}function ui(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function R_(){return combineCodec(di(),ui())}function Ai(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:di().encode(c),programAddress:r})}function b_(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:ui().decode(e.data)}}var mi=new Uint8Array([16]);function B_(){return fixEncoderSize(getBytesEncoder(),1).encode(mi)}function pi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",It()],["secp256r1VerifyArgs",getArrayEncoder(G())]]),e=>({...e,discriminator:mi}))}function Ti(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Dt()],["secp256r1VerifyArgs",getArrayDecoder(F())]])}function w_(){return combineCodec(pi(),Ti())}function fi(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:pi().encode(c),programAddress:r})}function k_(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:Ti().decode(e.data)}}var xi=new Uint8Array([27]);function K_(){return fixEncoderSize(getBytesEncoder(),1).encode(xi)}function Ii(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",It()],["secp256r1VerifyArgs",getArrayEncoder(G())],["settingsMutArgs",w()],["compressedProofArgs",C()]]),e=>({...e,discriminator:xi}))}function Di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Dt()],["secp256r1VerifyArgs",getArrayDecoder(F())],["settingsMutArgs",k()],["compressedProofArgs",M()]])}function J_(){return combineCodec(Ii(),Di())}function Ci(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 j_(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:Di().decode(e.data)}}var d="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",hS=(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))(hS||{});function UU(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 RS=(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.EditUserDelegate=13]="EditUserDelegate",T[T.MigrateCompressedSettings=14]="MigrateCompressedSettings",T[T.MigrateCompressedUsers=15]="MigrateCompressedUsers",T[T.NativeTransferIntent=16]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=17]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=18]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=19]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=20]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=21]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=22]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=23]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=24]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=25]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=26]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=27]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=28]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=29]="TransactionBufferVoteCompressed",T[T.TransactionExecute=30]="TransactionExecute",T[T.TransactionExecuteCompressed=31]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=32]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=33]="TransactionExecuteSyncCompressed",T))(RS||{});function WU(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 3;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 4;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 5;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 6;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 7;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 8;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 9;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 10;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 11;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 12;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 13;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([33])),0))return 14;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([32])),0))return 15;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 16;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 17;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([31])),0))return 18;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 19;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 20;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 21;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 22;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 23;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 24;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 25;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 26;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 27;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 28;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 29;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 30;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 31;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 32;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 33;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var vS=6e3,_S=6001,US=6002,WS=6003,LS=6004,OS=6005,BS=6006,wS=6007,kS=6008,NS=6009,VS=6010,HS=6011,GS=6012,FS=6013,zS=6014,KS=6015,JS=6016,jS=6017,qS=6018,ZS=6019,YS=6020,XS=6021,QS=6022,$S=6023,ex=6024,tx=6025,rx=6026,nx=6027,sx=6028,ox=6029,cx=6030,ax=6031,ix=6032,dx=6033,ux=6034,Ax=6035,gx=6036,yx=6037,mx=6038,px=6039,Tx=6040,fx=6041,lx=6042,Sx=6043,xx=6044,Ix=6045,Dx=6046,Cx=6047,Mx=6048,Ex=6049,Px=6050,hx=6051,Rx=6052,bx=6053,vx=6054,Mi;process.env.NODE_ENV!=="production"&&(Mi={[cx]:"This member is already delegated to another wallet.",[wS]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[Px]:"The domain configuration account is disabled. Please contact support or try again later.",[hx]:"Missing domain configuration account.",[VS]:"Duplicate public keys detected among members. Each member must have a unique key.",[NS]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[YS]:"No members provided. A multisig wallet must contain at least one member.",[qS]:"Expected a User with Administrator role for this instruction.",[kS]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[JS]:"Expected a User with Transaction Manager role for this instruction.",[px]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[Tx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[fx]:"Declared buffer size does not match the actual serialized size.",[dx]:"Not enough members with vote permission to meet the approval threshold.",[ax]:"At least one signer with execute permission is required to proceed.",[ix]:"At least one signer with initiate permission is required to perform this action.",[tx]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[vx]:"Address Tree supplied is not part of the whitelisted address trees",[ZS]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[nx]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[mx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[ux]:"Only delegated members are allowed for this transaction.",[ex]:"Unexpected number of accounts provided for this instruction.",[FS]:"User with Permanent Member role requires a must have a delegated wallet.",[_S]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[LS]:"The extracted public key has an invalid length or encoding.",[vS]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[WS]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[Ex]:"The specified slot number is not recent.",[Cx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[QS]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[jS]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[KS]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[$S]:"Malformed transaction message: structure or formatting does not match the expected layout.",[rx]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[OS]:"The extracted WebAuthn signed message payload is malformed.",[Ix]:"An input string exceeds the maximum allowed character length.",[Rx]:"This member is not registered under the provided domain configuration.",[sx]:"A required account is missing from the instruction context.",[ox]:"User mutation arguments are required when performing add or remove delegate operations.",[Dx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[gx]:"No valid signer found in this transaction.",[GS]:"Only one permanent member is allowed per wallet.",[zS]:"Only one transaction manager is allowed per wallet.",[bx]:"The given origin index is not in the whitelisted origins.",[HS]:"Permanent members cannot be removed from a wallet.",[xx]:"Writable CPI calls to protected accounts are not permitted.",[BS]:"The rpIdHash extracted from the signed message does not match the expected value.",[US]:"The signature index provided is out of bounds for the secp256r1 instruction.",[Mx]:"The specified slot number was not found in the provided slot history.",[XS]:"Too many members: a maximum of 4 members are supported.",[lx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[Sx]:"This transaction has not yet reached the required approval threshold.",[yx]:"Only the transaction creator or rent payer may close this transaction buffer.",[Ax]:"Member is not part of the expected signers for this transaction."});function NU(e){return process.env.NODE_ENV!=="production"?Mi[e]:"Error message not available in production bundles."}function VU(e,n,r){return isProgramError(e,n,d,r)}async function XU({admin:e,addressTree:n}){return Fs({payer:e,addressTree:n,remainingAccounts:[]})}var ht={Ed25519:1,Secp256r1:2};var le={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Ie=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(le).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var fn=33,De=class{_bn;constructor(n){typeof n=="string"?this._bn=new Uint8Array(getBase58Encoder().encode(n)):this._bn=new Uint8Array(n),this.validateKeyLength(this._bn);}validateKeyLength(n){if(n.length!==fn)throw new Error(`Invalid public key length, expected ${fn} bytes but got ${n.length}`)}toBase58(){return getBase58Decoder().decode(this.toBytes())}toTruncatedBuffer(){let n=this.toBuffer();return n.subarray(1,n.length)}toBuffer(){if(!this._bn)throw new Error("Invalid public key input");let n=this._bn;if(n.byteLength===fn)return n;throw new Error("Invalid public key input")}toBytes(){let n=this.toBuffer();return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}toString(){return this.toBase58()}toJSON(){return this.toBase58()}},E=class extends De{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(n,r){super(n),this.verifyArgs=r.verifyArgs,this.domainConfig=r.domainConfig,this.authData=r.authData,this.signature=r.signature,this.originIndex=r.originIndex,this.crossOrigin=r.crossOrigin,this.clientAndDeviceHash=r.clientAndDeviceHash,this.authResponse=r.authResponse;}};function Wx(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function Lx(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var Pi=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(Wx())],["addressTableLookups",getArrayCodec(Lx())]]);function hi(e){return Pi.encode({numSigners:e.header.numSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,accountKeys:e.staticAccounts,instructions:e.instructions.map(r=>({programAddressIndex:r.programAddressIndex,accountIndices:r.accountIndices??[],data:Array.from(r.data??[])})),addressTableLookups:e.version!=="legacy"?e.addressTableLookups?.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes,writableIndexes:r.writableIndexes}))??[]:[]})}function Ri(e){let n=Pi.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:d,staticAccounts:n.accountKeys,version:0}}featureFlags.version=VERSION.V2;var j={};function bi(){if(!j.solanaRpcEndpoint)throw new Error("Rpc is not initialized yet.");return j.solanaRpcEndpoint}function Rt(){if(!j.lightProtocolRpc)throw new Error("Rpc is not initialized yet");return j.lightProtocolRpc}function re(){if(!j.solanaRpc)throw new Error("Rpc is not initialized yet");return j.solanaRpc}function vi(){if(!j.sendAndConfirm)throw new Error("Rpc is not initialized yet.");return j.sendAndConfirm}function _i(){if(!j.computeEstimate)throw new Error("Rpc is not initialized yet");return j.computeEstimate}function Sn(){return j.jitoTipsConfig?j.jitoTipsConfig:{blockEngineUrl:"https://mainnet.block-engine.jito.wtf/api/v1",getJitoTipsUrl:"https://bundles.jito.wtf/api/v1/bundles/tip_floor",priority:"landed_tips_75th_percentile"}}function IW(){Object.keys(j).forEach(e=>{j[e]=void 0;});}function DW({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){j.solanaRpcEndpoint=e,j.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});j.solanaRpc=t,j.sendAndConfirm=c,j.computeEstimate=estimateComputeUnitLimitFactory({rpc:t}),j.jitoTipsConfig=s??null;}var L=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 Rt().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:a,queuePubkeyIndex:i,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,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 $t(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await Rt().getCompressedAccount(e);return s&&n?.set(e.toString(),s),s}}async function ye(e,n){let s=(await Promise.all(e.map(async t=>$t(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new Error("Unable to find compressed account.");return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function v(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function se(e,n,r,s,t){if(t.length===0)return [];let c=t.map((u,A)=>({treeInfo:n[A],root:r[A],rootIndex:s[A],address:u.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((u,A)=>({addressTreeInfo:a[A],outputStateTreeIndex:i,address:u.address,type:u.type}))}function oe(e,n,r,s,t,c,a){let i=[];for(let A=0;A<n.length;A++)i.push({treeInfo:n[A],rootIndex:s[A],leafIndex:r[A],proveByIndex:t[A],hash:c[A].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((A,g)=>({data:a.decode(A.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(A.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function ce(e,n,r,s,t){let c=null,a=null,i=null,o=new L;if(e){await o.addSystemAccounts();let{address:u}=await ne(n,r),A=(await ye([{address:u,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[A.leafIndex],leaves:[],treeInfos:[A.treeInfo],proveByIndices:[A.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:i=await z([A],[]);let g=o.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:A.hash}],[]).stateTrees;if(!g)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(A.address),treeInfo:g.packedTreeInfos[0]},data:ee().decode(A.data?.data)},a={accountMeta:{address:new Uint8Array(A.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:ee().decode(A.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:o,settingsMutArgs:a}}async function z(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await Rt().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 pe(){return (await er()).length-1}var xn;async function er(){if(!xn){let{data:e}=await ws(re(),await Li());xn=e.whitelistedAddressTrees;}return xn}async function tr(e,n,r){let s=await Kx(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function Kx(e,n,r){let{address:s}=await O(e,n),t=await $t(s,r);return t?.data?.data?Z().decode(t.data.data):null}async function In(e,n,r){let s=await Jx(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function Jx(e,n,r){try{let{address:s}=await ne(e,n),t=await $t(s,r);if(!t?.data?.data)throw new Error("No compressed settings account found.");let c=ee().decode(t.data.data);if(c.data.__option==="None")throw new Error("No compressed settings account found.");return {...c.data.value,isCompressed:!0}}catch{let s=await Fr(re(),await Y(e));return s.exists?{...s.data,index:getU128Decoder().decode(s.data.index),members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function Dn(e){let n=await er();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function KW(e){let r=(await er()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function ne(e,n=0){let r=await Dn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("multi_wallet")),new Uint8Array(getU128Encoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(d)).toString(),"base58"),addressTree:new PublicKey(r)}}async function O(e,n=0){let r=await Dn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),e instanceof De?e.toTruncatedBuffer():new Uint8Array(getAddressEncoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(d.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function ze({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(new Uint8Array(getUtf8Encoder().encode(n)));else throw new Error("RpId not found.");if(!e)throw new Error("RpIdHash not found.");let[r]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function Ni(){let[e]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function Li(){let[e]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Vi(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 De?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function Se(e){let[n]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function Y(e){let[n]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function eL(e){let n=await Y(e);return await Se(n)}async function tL(){let[e]=await getProgramDerivedAddress({programAddress:d,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}function nr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function Yx(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,A=o[0]===0&&o.length>32?o.slice(1):o;if(u.length>32||A.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(u,32-u.length);let y=p256.Point.CURVE().n>>1n,f=BigInt("0x"+nr(A)),P=(f>y?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),S=Yx(P);return new Uint8Array([...g,...S])}function sr(e){return new Uint8Array([...new Uint8Array(Me(e.response.authenticatorData)),...sha256(new Uint8Array(Me(e.response.clientDataJSON)))])}function lL(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+nr(n.get(-2))),y:BigInt("0x"+nr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function SL(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 xL(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Me(n)),c=JSON.parse(new TextDecoder().decode(Me(r))),a=Gi(c),i=zi(new Uint8Array(Me(s))),o=await ze({rpIdHash:t.subarray(0,32)});return new E(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Me(r)),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:Cn(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}async function IL(e,n){let{data:r}=await wn(re(),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}function Cn(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function DL(e){return sha256(new Uint8Array(getUtf8Encoder().encode(JSON.stringify(e))))}function CL(e){return Mn(e.data.payload.authResponse)}function ML(e,n,r,s){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...Cn(n,r,s)]))}async function EL(e,n,r,s,t,c){let a;if(!t||!c){let o=(await re().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed"}).send()).value?.data;if(!o)throw new Error("Unable to fetch slot sysvar");let u=getBase64Encoder().encode(o[0]);c=getU64Decoder().decode(u.subarray(8,16)).toString(),a=u.subarray(16,48),t=getBase58Decoder().decode(a);}else a=new Uint8Array(getBase58Encoder().encode(t));let i=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...sha256(typeof e.transactionMessageBytes=="string"?new Uint8Array(Me(e.transactionMessageBytes)):e.transactionMessageBytes),...a,...Cn(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:i}}function Mn(e){return sha256(sr(e))}function PL(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Me(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}async function En(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await re().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(s.instructions,c),c=>setTransactionMessageFeePayerSigner(s.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let 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 Zi(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 Yi(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 N(e,n=0){let r=e instanceof E?e:void 0,s=r?.verifyArgs&&n!==-1?some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):null,t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,a=r?.authData&&r.verifyArgs?.clientDataJson?sr(r.authResponse):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function Je(e){if(e instanceof De)return {keyType:ht.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:ht.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function qi(e){return e instanceof E?e.toString():e.address.toString()}function ae(e){let n=new Set,r=[];for(let s of e)n.has(qi(s))||(r.push(s),n.add(qi(s)));if(r.filter(s=>s instanceof E).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function Xi({payer:e,tipAmount:n}){let r=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],s=r[Math.floor(Math.random()*r.length)];return getTransferSolInstruction({source:e,destination:address(s),amount:n})}async function FL(e){let n=await En(e,true),r=await Yi(n.map(getBase64EncodedWireTransaction),bi()),s=await En(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await WI(s.map(getBase64EncodedWireTransaction))}async function zL({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await re().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(e,c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([_i()(c),Zi(re(),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 vi()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}async function WI(e,n=10,r=1e3,s=Sn()){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 KL(e,n=30,r=3e3,s=Sn()){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.")}function JL(e,n){if(n.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:r}=n.members.find(i=>$i(i.pubkey)===e)??{};if(!r)throw new Error("No permissions found for the current member.");let s=Ie.has(r,le.InitiateTransaction),t=Ie.has(r,le.VoteTransaction),c=Ie.has(r,le.ExecuteTransaction);if(s&&t&&c)return {};if(!t||!c)throw new Error("Signer lacks the required Vote/Execute permissions.");let a=n.members.find(i=>i.role===2);if(!a)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:address($i(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function jL({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await tr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return LI(n,c.transactionManagerUrl.value,e,s)}function LI(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=getBase64Decoder().decode(s)),r&&(c.authResponses=r);let i=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json();if("error"in i)throw new Error(i.error);return i.signatures.map(o=>({[e]:getBase58Encoder().encode(o)}))}}}function $i(e){return e.keyType===ht.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function qL(e){let n=e.map(c=>_e().encode(c)),r=4+n.reduce((c,a)=>c+a.length,0),s=new Uint8Array(r),t=0;s.set(getU32Encoder().encode(e.length),t),t+=4;for(let c of n)s.set(c,t),t+=c.length;return s}function ZL(e){let n=0,[r,s]=getU32Decoder().read(e,n);n=s;let t=new Array(r);for(let c=0;c<r;c++){let a=Ue().read(e,n);t[c]=a[0],n=a[1];}if(n!==e.length)throw new Error(`Trailing bytes: ${e.length-n}`);return t}async function uO({payer:e,rpId:n,origins:r,authority:s}){let t=await ze({rpId:n}),c=new L;await c.addSystemAccounts();let a=await pe(),{address:i,addressTree:o}=await O(s.address,a),u=[{address:i,tree:o,queue:o,type:"User"}],A=await z([],u),g=(await se(c,A.treeInfos,A.roots,A.rootIndices,u))[0],{remainingAccounts:y,systemOffset:f}=c.toAccountMetas(),l=v(A,f);return await Do({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:l,payer:e,domainConfig:t,rpId:n,remainingAccounts:y})}async function xO({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new L;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await ne(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await O(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await ye(a,t):[],o=await pe(),{address:u,addressTree:A}=await O(r.member,o),g=[{address:u,type:"User",tree:A,queue:A}],y=await z(i,g),f=null,l=null,P=i.filter(U=>U.type==="Settings"),S=i.filter(U=>U.type==="User");P.length&&(f=oe(c,y.treeInfos.slice(0,1),y.leafIndices.slice(0,1),y.rootIndices.slice(0,1),y.proveByIndices.slice(0,1),P,ee())[0]),S.length&&(l=oe(c,y.treeInfos.slice(1,2),y.leafIndices.slice(1,2),y.rootIndices.slice(1,2),y.proveByIndices.slice(1,2),S,Z())[0]);let I=await se(c,y.treeInfos.slice(i.length),y.roots.slice(i.length),y.rootIndices.slice(i.length),g),{remainingAccounts:D,systemOffset:x}=c.toAccountMetas(),_=v(y,x);return await Po({payer:n,authority:e,compressedProofArgs:_,member:gt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:f?some({settingsMutArgs:f,transactionManager:l?some(l):none()}):none(),userAccountCreationArgs:I[0],domainConfig:s,remainingAccounts:D})}async function MO({payer:e}){let n=await Ni();return vo({payer:e,globalCounter:n})}async function RO({admin:e,rpId:n,disable:r}){let s=await ze({rpId:n});return Xo({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function OO({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new L;await t.addSystemAccounts();let{address:c,addressTree:a}=await ne(r,s),i=[{address:c,tree:a,queue:a,type:"Settings"}],o=await z([],i),u=(await se(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:A,systemOffset:g}=t.toAccountMetas(),y=v(o,g);return Ic({compressedProofArgs:y,args:e,authority:n,settingsCreationArgs:u,remainingAccounts:A})}async function GO({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new L;await t.addSystemAccounts();let{address:c,addressTree:a}=await O(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await z([],i),u=(await se(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:A,systemOffset:g}=t.toAccountMetas(),y=v(o,g);return hc({compressedProofArgs:y,args:e,authority:n,userCreationArgs:u,remainingAccounts:A})}var je=33,qe=64,vn=14,HI=2,GI=address("Secp256r1SigVerify1111111111111111111111111");function FI(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function zI(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function od(){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=zI();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=vn;let a=[];for(let i=0;i<r;i++){let o=fixDecoderSize(getBytesDecoder(),je).decode(e,n);n+=je;let u=fixDecoderSize(getBytesDecoder(),qe).decode(e,n);n+=qe;let A=t[i].messageDataSize,g=fixDecoderSize(getBytesDecoder(),A).decode(e,n);n+=A,a.push({publicKey:o,signature:u,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function cd(){return createEncoder({getSizeFromValue:e=>{let n=vn*e.offsets.length,r=e.payload.reduce((s,t)=>s+je+qe+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=getU8Encoder().write(e.numSignatures,n,r),r=getU8Encoder().write(e.padding,n,r);let s=FI();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),je).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),qe).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function $O(){return combineCodec(cd(),od())}function B(e,n){let r=e.length,s=HI+r*vn,t=[];for(let o=0;o<r;o++){let{message:u}=e[o],A=s,g=A+je,y=g+qe;t.push({publicKeyOffset:A,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:y,messageDataSize:u.length,messageInstructionIndex:65535}),s+=je+qe+u.length;}let c=n?.programAddress??GI,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:cd().encode(a)}}function eB(e){return {programAddress:e.programAddress,accounts:{},data:od().decode(e.data)}}async function dB({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=await Y(e),{packedAccounts:a,proof:i,settingsMutArgs:o}=await ce(true,e,n,false,t);if(!o)throw new Error("Proof args is missing");let u=ae(s),A=u.filter(I=>I instanceof E),g=[],y=[];for(let I of A){let D=g.length,{domainConfig:x,verifyArgs:_,signature:U,publicKey:K,message:W}=N(I,D);W&&U&&K&&g.push({message:W,signature:U,publicKey:K}),x&&(a.addPreAccounts([{address:x,role:AccountRole.READONLY}]),_?.__option==="Some"&&y.push({domainConfigKey:x,verifyArgs:_.value}));}a.addPreAccounts(u.filter(I=>"address"in I).map(I=>({address:I.address,role:AccountRole.READONLY_SIGNER,signer:I})));let{remainingAccounts:f,systemOffset:l}=a.toAccountMetas(),P=v(i,l),S=[];return g.length>0&&S.push(B(g)),S.push(go({settings:c,settingsMutArgs:o,compressedProofArgs:P,payer:r,secp256r1VerifyArgs:y,remainingAccounts:f})),S}async function fB({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:a,proof:i,settingsMutArgs:o}=r,u=ae(e),A=u.filter(D=>!(D instanceof E));a.addPreAccounts(A.map(D=>({address:D.address,role:AccountRole.READONLY_SIGNER,signer:D})));let g=u.filter(D=>D instanceof E),y=[],f=[];for(let D of g){let x=f.length,{domainConfig:_,verifyArgs:U,signature:K,publicKey:W,message:q}=N(D,x);q&&K&&W&&f.push({message:q,signature:K,publicKey:W}),_&&(a.addPreAccounts([{address:_,role:AccountRole.READONLY}]),U?.__option==="Some"&&y.push({domainConfigKey:_,verifyArgs:U.value}));}let{remainingAccounts:l,systemOffset:P}=a.toAccountMetas(),S=v(i,P),I=[];if(f.length>0&&I.push(B(f)),c){if(!o)throw new Error("Payer not found or proof args is missing.");I.push(oo({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:o,remainingAccounts:l,secp256r1VerifyArgs:y}));}else I.push(await Xs({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:l,secp256r1VerifyArgs:y}));return I}async function MB({createUserArgs:e,payer:n}){let r=new L;await r.addSystemAccounts(),r.addPreAccounts(e.map(A=>({address:A.member.address,role:AccountRole.READONLY_SIGNER,signer:A.member})));let s=await pe(),t=await Promise.all(e.map(async A=>{let{address:g,addressTree:y}=await O(A.member.address,s);return {address:g,tree:y,queue:y,type:"User"}})),c=await z([],t),a=await se(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),u=v(c,o);return await No({compressedProofArgs:u,payer:n,createUserArgs:e.map((A,g)=>({member:A.member.address,role:A.role,userCreationArgs:a[g],transactionManagerUrl:A.role===2?A.transactionManagerUrl:null})),remainingAccounts:i})}async function _B({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new L;await a.addSystemAccounts();let i=await pe(),{address:o,addressTree:u}=await O(r.address,i),A=[{address:o,tree:u,queue:u,type:"User"}],g=await z([],A),y=(await se(a,g.treeInfos,g.roots,g.rootIndices,A))[0],f=a.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:v(g,f.systemOffset),authorityCreationArgs:y};}return nc({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function wB({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new L;await s.addSystemAccounts();let t=await ye([{address:(await O(e.address,n)).address,type:"User"}]),c=await z(t,[]),a=oe(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,Z())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),u=v(c,o);return dc({authority:e,transactionManagerUrl:r,compressedProofArgs:u,userMutArgs:a,remainingAccounts:i})}async function jB({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:a,message:i,signature:o,publicKey:u}=N(n),A=[];i&&o&&u&&A.push({message:i,signature:o,publicKey:u});let g=await tr(n instanceof E?n:n.address,r,t),y=[];y.push({address:(await O(n instanceof E?n:n.address,r)).address,type:"User"});let f,l=null,P,S=null;g.delegatedTo.__option==="Some"&&((await In(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(y.push({address:(await ne(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),l={start:y.length-1,end:y.length}):f=await Y(g.delegatedTo.value.index)),s&&((await In(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(y.push({address:(await ne(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:y.length-1,end:y.length}):P=await Y(s.index));let I=new L;await I.addSystemAccounts();let D=await ye(y,t),x=await z(D,[]),_=oe(I,x.treeInfos.slice(0,1),x.leafIndices.slice(0,1),x.rootIndices.slice(0,1),x.proveByIndices.slice(0,1),D.slice(0,1),Z())[0],U=l?some(oe(I,x.treeInfos.slice(l.start,l.end),x.leafIndices.slice(l.start,l.end),x.rootIndices.slice(l.start,l.end),x.proveByIndices.slice(l.start,l.end),D.slice(l.start,l.end),ee())[0]):none(),K=S?some(oe(I,x.treeInfos.slice(S.start,S.end),x.leafIndices.slice(S.start,S.end),x.rootIndices.slice(S.start,S.end),x.proveByIndices.slice(S.start,S.end),D.slice(S.start,S.end),ee())[0]):none(),{remainingAccounts:W,systemOffset:q}=I.toAccountMetas(),te=v(x,q),de=[];return A.length>0&&de.push(B(A)),de.push(pc({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof E?void 0:n,oldSettings:f,oldSettingsMutArgs:U,newSettings:P,newSettingsMutArgs:K,compressedProofArgs:te,userMutArgs:_,remainingAccounts:W})),de}async function cw({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new L;await c.addSystemAccounts();let a=[],i=[];i.push(...await ye([{address:(await O(r.address,s)).address,type:"User"}],t));let o=await pe(),{address:u,addressTree:A}=await ne(e,o);a.push({address:u,queue:A,tree:A,type:"Settings"});let g=i.length,y=await z(i,a),f=oe(c,y.treeInfos.slice(0,g),y.leafIndices.slice(0,g),y.rootIndices.slice(0,g),y.proveByIndices.slice(0,g),i.filter(_=>_.type==="User"),Z())[0],P=(await se(c,y.treeInfos.slice(g),y.roots.slice(g),y.rootIndices.slice(g),a)).find(_=>_.type==="Settings")??null,{remainingAccounts:S,systemOffset:I}=c.toAccountMetas(),D=v(y,I),x=[];if(!P)throw new Error("Settings creation args is missing.");return x.push(await Oo({settingsIndex:e,payer:n,initialMember:r,userReadonlyArgs:f,compressedProofArgs:D,settingsCreation:P,remainingAccounts:S})),x}async function pw({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:a,settingsMutArgs:i}=await ce(true,e,n,false,t);if(!i)throw new Error("Proof args is missing");let o=ae(s),u=o.filter(I=>I instanceof E),A=[],g=[];for(let I of u){let D=A.length,{domainConfig:x,verifyArgs:_,signature:U,publicKey:K,message:W}=N(I,D);W&&U&&K&&A.push({message:W,signature:U,publicKey:K}),x&&(c.addPreAccounts([{address:x,role:AccountRole.READONLY}]),_?.__option==="Some"&&g.push({domainConfigKey:x,verifyArgs:_.value}));}c.addPreAccounts(o.filter(I=>"address"in I).map(I=>({address:I.address,role:AccountRole.READONLY_SIGNER,signer:I})));let{remainingAccounts:y,systemOffset:f}=c.toAccountMetas(),l=v(a,f),P=[];A.length>0&&P.push(B(A));let S=await Y(e);return P.push(Ko({settings:S,payer:r,settingsMutArgs:i,compressedProofArgs:l,secp256r1VerifyArgs:g,remainingAccounts:y})),P}function ZI(e,n,r,s){let t=YI(e,n),c=XI(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function YI(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 XI(e,n){return n<e.header.numSignerAccounts}async function cr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Ri(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),re()):{}),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:ZI(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 A=o[u];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:A,role:AccountRole.WRITABLE});}for(let u of i.readonlyIndexes){let A=o[u];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:A,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 ud({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let u=await Se(e),{accountMetas:A,addressLookupTableAccounts:g}=await cr({transactionMessageBytes:r,walletAddress:u,additionalSigners:a,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(B(c)),y.push(o?Ai({transactionBuffer:n,payer:s.address,remainingAccounts:A,settingsKey:e}):oi({transactionBuffer:n,payer:s.address,settings:e})),i&&y.push(Xi({payer:s,tipAmount:i})),{instructions:y,addressLookupTableAccounts:g}}async function Ad({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:u}){let A=ae(s),g=await Y(e),y=await Se(g),[{accountMetas:f,addressLookupTableAccounts:l,transactionMessage:P},{settingsMutArgs:S,proof:I,packedAccounts:D}]=await Promise.all([cr({transactionMessageBytes:r,walletAddress:y,additionalSigners:A.filter(te=>!(te instanceof E)),addressesByLookupTableAddress:c}),ce(i,e,n,o,u)]);D.addPreAccounts(f);let x=A.filter(te=>te instanceof E),_=[];for(let te of x){let de=a.length,{domainConfig:me,verifyArgs:Ee,signature:Pe,publicKey:xe,message:_t}=N(te,de);_t&&Pe&&xe&&a.push({message:_t,signature:Pe,publicKey:xe}),me&&(D.addPreAccounts([{address:me,role:AccountRole.READONLY}]),Ee?.__option==="Some"&&_.push({domainConfigKey:me,verifyArgs:Ee.value}));}let{remainingAccounts:U,systemOffset:K}=D.toAccountMetas(),W=[];a.length>0&&W.push(B(a));let q=$I(P,f);if(i){if(!t||!S)throw new Error("Payer not found or proof args is missing.");let te=v(I,K);W.push(Ci({secp256r1VerifyArgs:_,transactionMessage:q,settingsMutArgs:S,compressedProofArgs:te,payer:t,remainingAccounts:U}));}else W.push(fi({secp256r1VerifyArgs:_,settings:g,transactionMessage:q,remainingAccounts:U}));return {instructions:W,addressLookupTableAccounts:l}}function $I(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 Fw({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=ae(s),u=await Y(e),A=await Se(u),{packedAccounts:g,proof:y,settingsMutArgs:f}=await ce(i,e,n,false,t),l=[],P=[];for(let x of o)if(x instanceof E){let _=l.length,{domainConfig:U,verifyArgs:K,signature:W,publicKey:q,message:te}=N(x,_);te&&W&&q&&l.push({message:te,signature:W,publicKey:q}),U&&(g.addPreAccounts([{address:U,role:AccountRole.READONLY}]),K?.__option==="Some"&&P.push({domainConfigKey:U,verifyArgs:K.value}));}else g.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:S,systemOffset:I}=g.toAccountMetas(),D=[];if(l.length>0&&D.push(B(l)),i){if(!a||!f)throw new Error("Payer not found or proof args is missing.");let x=v(y,I);D.push(wc({amount:c,settingsMutArgs:f,compressedProofArgs:x,payer:a,secp256r1VerifyArgs:P,source:A,destination:r,remainingAccounts:S}));}else D.push(_c({amount:c,secp256r1VerifyArgs:P,source:A,destination:r,settings:u,remainingAccounts:S}));return D}async function $w({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,createAtaIfNeeded:u=true,compressed:A=false}){let g=ae(t),y=await Y(e),f=await Se(y),[l,P]=await Promise.all([getAssociatedTokenAccountAddress(s,f,o),getAssociatedTokenAccountAddress(s,r,o)]),{packedAccounts:S,proof:I,settingsMutArgs:D}=await ce(A,e,n,false,c),x=[],_=[];for(let q of g)if(q instanceof E){let te=x.length,{domainConfig:de,verifyArgs:me,signature:Ee,publicKey:Pe,message:xe}=N(q,te);xe&&Ee&&Pe&&x.push({message:xe,signature:Ee,publicKey:Pe}),de&&(S.addPreAccounts([{address:de,role:AccountRole.READONLY}]),me?.__option==="Some"&&_.push({domainConfigKey:de,verifyArgs:me.value}));}else S.addPreAccounts([{address:q.address,role:AccountRole.READONLY_SIGNER,signer:q}]);let{remainingAccounts:U,systemOffset:K}=S.toAccountMetas(),W=[];if(x.length>0&&W.push(B(x)),A){if(!i||!D)throw new Error("Payer not found or proof args is missing.");let q=v(I,K);W.push(jc({amount:a,createAtaIfNeeded:u,settingsMutArgs:D,compressedProofArgs:q,payer:i,secp256r1VerifyArgs:_,source:f,sourceTokenAccount:l,destination:r,destinationTokenAccount:P,mint:s,tokenProgram:o,remainingAccounts:U}));}else W.push(Hc({amount:a,createAtaIfNeeded:u,secp256r1VerifyArgs:_,source:f,sourceTokenAccount:l,destination:r,destinationTokenAccount:P,settings:y,mint:s,tokenProgram:o,remainingAccounts:U}));return W}async function uk({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await _s(re(),s),o=i.data.multiWalletSettings,{packedAccounts:u,proof:A,settingsMutArgs:g}=await ce(c,e,n,false,a),{remainingAccounts:y,systemOffset:f}=u.toAccountMetas(),{domainConfig:l,verifyArgs:P,message:S,signature:I,publicKey:D}=N(r),x=[];if(S&&I&&D&&x.push(B([{message:S,signature:I,publicKey:D}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let _=v(A,f);x.push(oa({transactionBuffer:s,domainConfig:l,closer:r instanceof E?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:P,settingsMutArgs:g,payer:t,compressedProofArgs:_,remainingAccounts:y}));}else x.push($c({transactionBuffer:s,domainConfig:l,closer:r instanceof E?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:P,remainingAccounts:[]}));return x}function pd({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:u,expectedSecp256r1Signers:A}){let{domainConfig:g,verifyArgs:y,message:f,signature:l,publicKey:P}=N(n),S=[];if(f&&l&&P&&S.push(B([{message:f,signature:l,publicKey:P}])),u){let{settingsReadonlyArgs:I,compressedProofArgs:D,remainingAccounts:x}=u;S.push(fa({transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof E?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:A},settingsReadonlyArgs:I,compressedProofArgs:D,remainingAccounts:x}));}else S.push(Aa({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof E?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:A},remainingAccounts:[]}));return S}function Td({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=N(e),u=[];return i&&a&&o&&u.push(B([{message:i,signature:a,publicKey:o}])),s?u.push(ba({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof E?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(Ca({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof E?void 0:e,remainingAccounts:[]})),u}function fd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Ha({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Oa({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function ld({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=N(n),u=[];return o&&a&&i&&u.push(B([{message:o,signature:a,publicKey:i}])),s?u.push($a({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof E?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(ja({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof E?void 0:n,remainingAccounts:[]})),u}async function tN({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await eD(r),a=new L,i=null,o=null,u=[];if(c.length||t){let g=await tD({packedAccounts:a,userAccounts:c,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:s});i=g.proof,o=g.settingsMutArgs??null,u=g.userMutArgs??[];}return {configActions:await rD({configActionsArgs:r,userMutArgs:u,index:e}),index:e,proof:i,settingsMutArgs:o,packedAccounts:a,compressed:t}}async function eD(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>O(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let s=await Promise.all(r.members.map(t=>O(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function tD({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let a=[];if(r){let f=(await ne(s,t)).address;a.push({address:f,type:"Settings"});}n.length&&a.push(...n);let i=a.length?await ye(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await z(i,[]),u=[],A=[];for(let f of i)f.type==="Settings"?u.push(f):f.type==="User"&&A.push(f);let g,y=[];if(r&&o&&(g=oe(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),u,ee())[0]),A.length&&o){let f=r?1:0;y=oe(e,o.treeInfos.slice(f),o.leafIndices.slice(f),o.rootIndices.slice(f),o.proveByIndices.slice(f),A,Z());}return {proof:o,settingsMutArgs:g,userMutArgs:y}}async function rD({index:e,configActionsArgs:n,userMutArgs:r}){let s=[];for(let t of n)switch(t.type){case "AddMembers":{let c=[];for(let a of t.members){let i=await O(a.member,a.userAddressTreeIndex).then(o=>r.find(u=>new Sd(new Uint8Array(u.accountMeta.address)).eq(o.address)));if(!i)throw new Error("Unable to find user account");c.push(oD({permissionArgs:a.permissions,userMutArgs:i,pubkey:a.member}));}s.push({__kind:t.type,fields:[c]});break}case "RemoveMembers":{let c=await Promise.all(t.members.map(a=>O(a.member,a.userAddressTreeIndex).then(i=>{let o=r.find(u=>new Sd(new Uint8Array(u.accountMeta.address)).eq(i.address));if(!o)throw new Error("Unable to find user account");return sD({pubkey:a.member,userMutArgs:o,index:e})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(a=>nD({permissionArgs:a.permissions,pubkey:a.member}));s.push({__kind:t.type,fields:[c]});break}default:s.push({__kind:t.type,fields:[t.threshold]});}return s}function nD({pubkey:e,permissionArgs:n}){return {memberKey:Je(e),permissions:xd(n)}}function sD({pubkey:e,userMutArgs:n,index:r}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");let s=n.data.delegatedTo.__option==="Some"?Number(n.data.delegatedTo.value.index.toString())===r:false;return {memberKey:Je(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function oD({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===1)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===2&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:Je(e),permissions:xd(n),userReadonlyArgs:r}}function xd(e){let n=[];return e.initiate&&n.push(le.InitiateTransaction),e.vote&&n.push(le.VoteTransaction),e.execute&&n.push(le.ExecuteTransaction),Ie.fromPermissions(n)}async function dN({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:u=false,additionalVoters:A=[],additionalSigners:g=[],chunkSize:y=Math.ceil(s.length/2),cachedAccounts:f}){let l=await Y(n),P=Math.floor(Math.random()*255),S=await Vi(l,t instanceof E?t:t.address,P),I=[],D=[];for(let X=0;X<s.length;X+=y){let Wn=s.subarray(X,X+y);I.push(Wn),D.push(sha256(Wn));}let x=sha256(new Uint8Array(s)),{settingsReadonlyArgs:_,settingsMutArgs:U,proof:K,packedAccounts:W}=await ce(u,n,r,false,f),{remainingAccounts:q,systemOffset:te}=W.toAccountMetas(),de=K&&_&&U?{settingsReadonlyArgs:_,settingsMutArgs:U,compressedProofArgs:v(K,te),remainingAccounts:q,payer:e}:null,me=ae([t,...c?[c]:[],...A]).filter(X=>X instanceof E).map(X=>({memberKey:Je(X),messageHash:Mn(X.authResponse)})),Ee=pd({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:P,payer:e,transactionBufferAddress:S,settings:l,creator:t,preauthorizeExecution:!c,bufferExtendHashes:D,compressedArgs:de,expectedSecp256r1Signers:me}),Pe=I.map(X=>fd({transactionMessageBytes:X,transactionBufferAddress:S,settings:l,compressed:u})),xe=A.map(X=>ld({voter:X,transactionBufferAddress:S,settings:l,compressedArgs:de})),_t=Td({compressedArgs:de,settings:l,executor:c,transactionBufferAddress:S}),{instructions:Cd,addressLookupTableAccounts:Md}=await ud({compressed:u,settings:l,transactionMessageBytes:s,transactionBufferAddress:S,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),T=X=>({payer:e,instructions:X,addressesByLookupTableAddress:Md});return [T(Ee),...Pe.map(X=>T([X])),...xe.length?[T(xe.flat())]:[],T(_t),T(Cd)]}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(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 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 Dd({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 f=t.extractTableLookup(y);if(f!==void 0){let{addressTableLookup:l,drainedKeys:P}=f;c.push({readonlyIndexes:l.readonlyIndexes,readableIndices:l.readonlyIndexes,writableIndexes:l.writableIndexes,writableIndices:l.writableIndexes,lookupTableAddress:address(l.lookupTableAddress)}),a.writable.push(...P.writable),a.readonly.push(...P.readonly);}}let[o,u]=t.getMessageComponents(),g=new dr(u,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:u,addressTableLookups:c}}function DN({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Dd({instructions:e,payer:n,recentBlockhash:d,addressesByLookupTableAddress:r});return hi(s)}async function hN({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:u=false}){let{instructions:A,addressLookupTableAccounts:g}=await Ad({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:i});return {payer:e,instructions:A,addressesByLookupTableAddress:g}}
|
|
2
|
-
export{Hs as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,ro as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,Zs as CHANGE_CONFIG_DISCRIMINATOR,io as COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,xo as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Mo as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Ro as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Wo as CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR,wo as CREATE_USER_ACCOUNTS_DISCRIMINATOR,Go as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,qo as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Ln as DOMAIN_CONFIG_DISCRIMINATOR,tc as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,cc as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,gc as EDIT_USER_DELEGATE_DISCRIMINATOR,Vn as GLOBAL_COUNTER_DISCRIMINATOR,ht as KeyType,lc as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,Mc as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,cx as MULTI_WALLET_ERROR__ALREADY_DELEGATED,wS as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,Px as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,hx as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,VS as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,NS as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,YS as MULTI_WALLET_ERROR__EMPTY_MEMBERS,qS as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,kS as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,JS as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,px as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,Tx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,fx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,dx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,ax as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,ix as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,tx as MULTI_WALLET_ERROR__INVALID_ACCOUNT,vx as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,ZS as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,nx as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,mx as MULTI_WALLET_ERROR__INVALID_BUFFER,ux as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,ex as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,FS as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,_S as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,LS as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,vS as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,WS as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,Ex as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,Cx as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,QS as MULTI_WALLET_ERROR__INVALID_THRESHOLD,jS as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,KS as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,$S as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,rx as MULTI_WALLET_ERROR__INVALID_USER_ROLE,OS as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,Ix as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,Rx as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,sx as MULTI_WALLET_ERROR__MISSING_ACCOUNT,ox as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,Dx as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,gx as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,GS as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,zS as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,bx as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,HS as MULTI_WALLET_ERROR__PERMANENT_MEMBER,xx as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,BS as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,US as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,Mx as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,XS as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,lx as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,Sx as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,yx as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,Ax as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,d as MULTI_WALLET_PROGRAM_ADDRESS,hS as MultiWalletAccount,RS as MultiWalletInstruction,Lc as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,bc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,le as Permission,Ie as Permissions,Is as SETTINGS_DISCRIMINATOR,De as Secp256r1Key,E as SignedSecp256r1Key,Kc as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Nc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,ra as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,Yc as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,ma as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,ia as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Rs as TRANSACTION_BUFFER_DISCRIMINATOR,Pa as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,xa as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,ka as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Ua as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Ya as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,za as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,ii as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,ri as TRANSACTION_EXECUTE_DISCRIMINATOR,xi as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,mi as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,He as UserRole,Ls as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,XU as addWhitelistedAddressTrees,Me as base64URLStringToBuffer,PL as bufferToBase64URLString,fB as changeConfig,uk as closeTransactionBuffer,dB as compressSettingsAccount,YD as configAction,$i as convertMemberKeyToString,SL as convertPubkeyCompressedToCose,lL as convertPubkeyCoseToCompressed,CL as createClientAuthorizationCompleteRequestChallenge,DL as createClientAuthorizationStartRequestChallenge,uO as createDomainConfig,xO as createDomainUserAccounts,MO as createGlobalCounter,ML as createMessageChallenge,pd as createTransactionBuffer,EL as createTransactionChallenge,LI as createTransactionManagerSigner,MB as createUserAccounts,cw as createWallet,Bn as decodeDomainConfig,Gn as decodeGlobalCounter,Cs as decodeSettings,vs as decodeTransactionBuffer,Bs as decodeWhitelistedAddressTree,pw as decompressSettingsAccount,ZL as deserializeConfigActions,RO as disableDomainConfig,_B as editDomainConfig,wB as editTransactionManagerUrl,jB as editUserDelegate,ud as executeTransaction,Td as executeTransactionBuffer,Ad as executeTransactionSync,fd as extendTransactionBuffer,AD as fetchAllDomainConfig,lD as fetchAllGlobalCounter,kd as fetchAllMaybeDomainConfig,eu as fetchAllMaybeGlobalCounter,dy as fetchAllMaybeSettings,_y as fetchAllMaybeTransactionBuffer,Xy as fetchAllMaybeWhitelistedAddressTree,kE as fetchAllSettings,KE as fetchAllTransactionBuffer,YE as fetchAllWhitelistedAddressTree,wn as fetchDomainConfig,fD as fetchGlobalCounter,wd as fetchMaybeDomainConfig,$d as fetchMaybeGlobalCounter,Fr as fetchMaybeSettings,Jx as fetchMaybeSettingsAccountData,vy as fetchMaybeTransactionBuffer,Kx as fetchMaybeUserAccountData,Yy as fetchMaybeWhitelistedAddressTree,wE as fetchSettings,In as fetchSettingsAccountData,_s as fetchTransactionBuffer,tr as fetchUserAccountData,ws as fetchWhitelistedAddressTree,CD as getAddMemberArgsCodec,Ar as getAddMemberArgsDecoder,ur as getAddMemberArgsEncoder,yP as getAddWhitelistedAddressTreesDiscriminatorBytes,pP as getAddWhitelistedAddressTreesInstruction,Fs as getAddWhitelistedAddressTreesInstructionAsync,mP as getAddWhitelistedAddressTreesInstructionDataCodec,Gs as getAddWhitelistedAddressTreesInstructionDataDecoder,Xr as getAddWhitelistedAddressTreesInstructionDataEncoder,WP as getChangeConfigCompressedDiscriminatorBytes,oo as getChangeConfigCompressedInstruction,LP as getChangeConfigCompressedInstructionDataCodec,so as getChangeConfigCompressedInstructionDataDecoder,no as getChangeConfigCompressedInstructionDataEncoder,CP as getChangeConfigDiscriminatorBytes,EP as getChangeConfigInstruction,Xs as getChangeConfigInstructionAsync,MP as getChangeConfigInstructionDataCodec,Ys as getChangeConfigInstructionDataDecoder,Qr as getChangeConfigInstructionDataEncoder,Cn as getClientAndDeviceHash,PD as getCompiledInstructionCodec,yr as getCompiledInstructionDecoder,gr as getCompiledInstructionEncoder,GP as getCompressSettingsAccountDiscriminatorBytes,go as getCompressSettingsAccountInstruction,FP as getCompressSettingsAccountInstructionDataCodec,Ao as getCompressSettingsAccountInstructionDataDecoder,uo as getCompressSettingsAccountInstructionDataEncoder,vD as getCompressedAccountMetaCodec,Qe as getCompressedAccountMetaDecoder,Xe as getCompressedAccountMetaEncoder,LD as getCompressedAccountMetaReadOnlyCodec,rt as getCompressedAccountMetaReadOnlyDecoder,tt as getCompressedAccountMetaReadOnlyEncoder,wD as getCompressedProofCodec,Sr as getCompressedProofDecoder,lr as getCompressedProofEncoder,ne as getCompressedSettingsAddressFromIndex,HD as getCompressedSettingsCodec,KD as getCompressedSettingsDataCodec,ot as getCompressedSettingsDataDecoder,st as getCompressedSettingsDataEncoder,ee as getCompressedSettingsDecoder,nt as getCompressedSettingsEncoder,_i as getComputeBudgetEstimate,ZD as getConfigActionCodec,Ue as getConfigActionDecoder,_e as getConfigActionEncoder,XP as getCreateDomainConfigDiscriminatorBytes,$P as getCreateDomainConfigInstruction,Do as getCreateDomainConfigInstructionAsync,QP as getCreateDomainConfigInstructionDataCodec,Io as getCreateDomainConfigInstructionDataDecoder,en as getCreateDomainConfigInstructionDataEncoder,ah as getCreateDomainUserAccountDiscriminatorBytes,dh as getCreateDomainUserAccountInstruction,Po as getCreateDomainUserAccountInstructionAsync,ih as getCreateDomainUserAccountInstructionDataCodec,Eo as getCreateDomainUserAccountInstructionDataDecoder,rn as getCreateDomainUserAccountInstructionDataEncoder,Th as getCreateGlobalCounterDiscriminatorBytes,lh as getCreateGlobalCounterInstruction,vo as getCreateGlobalCounterInstructionAsync,fh as getCreateGlobalCounterInstructionDataCodec,bo as getCreateGlobalCounterInstructionDataDecoder,sn as getCreateGlobalCounterInstructionDataEncoder,Ph as getCreateMultiWalletCompressedDiscriminatorBytes,Rh as getCreateMultiWalletCompressedInstruction,Oo as getCreateMultiWalletCompressedInstructionAsync,hh as getCreateMultiWalletCompressedInstructionDataCodec,Lo as getCreateMultiWalletCompressedInstructionDataDecoder,on as getCreateMultiWalletCompressedInstructionDataEncoder,tC as getCreateUserAccountArgsCodec,hr as getCreateUserAccountArgsDecoder,Pr as getCreateUserAccountArgsEncoder,Bh as getCreateUserAccountsDiscriminatorBytes,kh as getCreateUserAccountsInstruction,No as getCreateUserAccountsInstructionAsync,wh as getCreateUserAccountsInstructionDataCodec,ko as getCreateUserAccountsInstructionDataDecoder,an as getCreateUserAccountsInstructionDataEncoder,Jh as getDecompressSettingsAccountDiscriminatorBytes,Ko as getDecompressSettingsAccountInstruction,jh as getDecompressSettingsAccountInstructionDataCodec,zo as getDecompressSettingsAccountInstructionDataDecoder,Fo as getDecompressSettingsAccountInstructionDataEncoder,eR as getDisableDomainConfigDiscriminatorBytes,Xo as getDisableDomainConfigInstruction,tR as getDisableDomainConfigInstructionDataCodec,Yo as getDisableDomainConfigInstructionDataDecoder,Zo as getDisableDomainConfigInstructionDataEncoder,ze as getDomainConfigAddress,uD as getDomainConfigCodec,On as getDomainConfigDecoder,dD as getDomainConfigDiscriminatorBytes,Bd as getDomainConfigEncoder,gD as getDomainConfigSize,dR as getEditDomainConfigDiscriminatorBytes,nc as getEditDomainConfigInstruction,AR as getEditDomainConfigInstructionAsync,uR as getEditDomainConfigInstructionDataCodec,rc as getEditDomainConfigInstructionDataDecoder,un as getEditDomainConfigInstructionDataEncoder,oC as getEditMemberArgsCodec,Cr as getEditMemberArgsDecoder,Dr as getEditMemberArgsEncoder,SR as getEditTransactionManagerUrlDiscriminatorBytes,dc as getEditTransactionManagerUrlInstruction,xR as getEditTransactionManagerUrlInstructionDataCodec,ic as getEditTransactionManagerUrlInstructionDataDecoder,ac as getEditTransactionManagerUrlInstructionDataEncoder,RR as getEditUserDelegateDiscriminatorBytes,pc as getEditUserDelegateInstruction,bR as getEditUserDelegateInstructionDataCodec,mc as getEditUserDelegateInstructionDataDecoder,yc as getEditUserDelegateInstructionDataEncoder,dC as getExpectedSecp256r1SignersCodec,dt as getExpectedSecp256r1SignersDecoder,it as getExpectedSecp256r1SignersEncoder,Ni as getGlobalCounterAddress,TD as getGlobalCounterCodec,Hn as getGlobalCounterDecoder,pD as getGlobalCounterDiscriminatorBytes,Qd as getGlobalCounterEncoder,SD as getGlobalCounterSize,Sn as getJitoTipsConfig,tL as getLightCpiSigner,Rt as getLightProtocolRpc,yC as getLinkWalletArgsCodec,br as getLinkWalletArgsDecoder,Rr as getLinkWalletArgsEncoder,fC as getMemberCodec,at as getMemberDecoder,ct as getMemberEncoder,xC as getMemberKeyCodec,$ as getMemberKeyDecoder,Q as getMemberKeyEncoder,wR as getMigrateCompressedSettingsDiscriminatorBytes,Ic as getMigrateCompressedSettingsInstruction,kR as getMigrateCompressedSettingsInstructionDataCodec,xc as getMigrateCompressedSettingsInstructionDataDecoder,Sc as getMigrateCompressedSettingsInstructionDataEncoder,JR as getMigrateCompressedUsersDiscriminatorBytes,hc as getMigrateCompressedUsersInstruction,jR as getMigrateCompressedUsersInstructionDataCodec,Pc as getMigrateCompressedUsersInstructionDataDecoder,Ec as getMigrateCompressedUsersInstructionDataEncoder,NU as getMultiWalletErrorMessage,Ab as getNativeTransferIntentCompressedDiscriminatorBytes,wc as getNativeTransferIntentCompressedInstruction,gb as getNativeTransferIntentCompressedInstructionDataCodec,Bc as getNativeTransferIntentCompressedInstructionDataDecoder,Oc as getNativeTransferIntentCompressedInstructionDataEncoder,tb as getNativeTransferIntentDiscriminatorBytes,_c as getNativeTransferIntentInstruction,nb as getNativeTransferIntentInstructionAsync,rb as getNativeTransferIntentInstructionDataCodec,vc as getNativeTransferIntentInstructionDataDecoder,An as getNativeTransferIntentInstructionDataEncoder,MC as getNewAuthorityArgsCodec,Wr as getNewAuthorityArgsDecoder,Ur as getNewAuthorityArgsEncoder,IL as getOriginIndex,hC as getPackedAddressTreeInfoCodec,At as getPackedAddressTreeInfoDecoder,ut as getPackedAddressTreeInfoEncoder,vC as getPackedStateTreeInfoCodec,et as getPackedStateTreeInfoDecoder,$e as getPackedStateTreeInfoEncoder,WC as getPermissionsCodec,Re as getPermissionsDecoder,he as getPermissionsEncoder,wC as getProofArgsCodec,M as getProofArgsDecoder,C as getProofArgsEncoder,HC as getRemoveMemberArgsCodec,Er as getRemoveMemberArgsDecoder,Mr as getRemoveMemberArgsEncoder,Mn as getSecp256r1MessageHash,zC as getSecp256r1PubkeyCodec,gt as getSecp256r1PubkeyDecoder,Br as getSecp256r1PubkeyEncoder,zI as getSecp256r1SignatureOffsetsDataDecoder,FI as getSecp256r1SignatureOffsetsDataEncoder,jC as getSecp256r1VerifyArgsCodec,H as getSecp256r1VerifyArgsDecoder,V as getSecp256r1VerifyArgsEncoder,XC as getSecp256r1VerifyArgsWithDomainAddressCodec,F as getSecp256r1VerifyArgsWithDomainAddressDecoder,G as getSecp256r1VerifyArgsWithDomainAddressEncoder,B as getSecp256r1VerifyInstruction,$O as getSecp256r1VerifyInstructionDataCodec,od as getSecp256r1VerifyInstructionDataDecoder,cd as getSecp256r1VerifyInstructionDataEncoder,vi as getSendAndConfirmTransaction,BE as getSettingsCodec,tM as getSettingsCreationArgsCodec,mt as getSettingsCreationArgsDecoder,yt as getSettingsCreationArgsEncoder,Ds as getSettingsDecoder,OE as getSettingsDiscriminatorBytes,iy as getSettingsEncoder,Y as getSettingsFromIndex,sM as getSettingsIndexWithAddressCodec,Tt as getSettingsIndexWithAddressDecoder,pt as getSettingsIndexWithAddressEncoder,iM as getSettingsMutArgsCodec,k as getSettingsMutArgsDecoder,w as getSettingsMutArgsEncoder,gM as getSettingsReadonlyArgsCodec,lt as getSettingsReadonlyArgsDecoder,ft as getSettingsReadonlyArgsEncoder,NE as getSettingsSize,xL as getSignedSecp256r1Key,jL as getSignedTransactionManager,re as getSolanaRpc,bi as getSolanaRpcEndpoint,vb as getTokenTransferIntentCompressedDiscriminatorBytes,jc as getTokenTransferIntentCompressedInstruction,Ub as getTokenTransferIntentCompressedInstructionAsync,_b as getTokenTransferIntentCompressedInstructionDataCodec,Jc as getTokenTransferIntentCompressedInstructionDataDecoder,mn as getTokenTransferIntentCompressedInstructionDataEncoder,xb as getTokenTransferIntentDiscriminatorBytes,Hc as getTokenTransferIntentInstruction,Db as getTokenTransferIntentInstructionAsync,Ib as getTokenTransferIntentInstructionDataCodec,Vc as getTokenTransferIntentInstructionDataDecoder,yn as getTokenTransferIntentInstructionDataEncoder,Vi as getTransactionBufferAddress,Zb as getTransactionBufferCloseCompressedDiscriminatorBytes,oa as getTransactionBufferCloseCompressedInstruction,Yb as getTransactionBufferCloseCompressedInstructionDataCodec,sa as getTransactionBufferCloseCompressedInstructionDataDecoder,na as getTransactionBufferCloseCompressedInstructionDataEncoder,Vb as getTransactionBufferCloseDiscriminatorBytes,$c as getTransactionBufferCloseInstruction,Hb as getTransactionBufferCloseInstructionDataCodec,Qc as getTransactionBufferCloseInstructionDataDecoder,Xc as getTransactionBufferCloseInstructionDataEncoder,zE as getTransactionBufferCodec,TM as getTransactionBufferCreateArgsCodec,xt as getTransactionBufferCreateArgsDecoder,St as getTransactionBufferCreateArgsEncoder,yv as getTransactionBufferCreateCompressedDiscriminatorBytes,fa as getTransactionBufferCreateCompressedInstruction,mv as getTransactionBufferCreateCompressedInstructionDataCodec,Ta as getTransactionBufferCreateCompressedInstructionDataDecoder,pa as getTransactionBufferCreateCompressedInstructionDataEncoder,sv as getTransactionBufferCreateDiscriminatorBytes,Aa as getTransactionBufferCreateInstruction,ov as getTransactionBufferCreateInstructionDataCodec,ua as getTransactionBufferCreateInstructionDataDecoder,da as getTransactionBufferCreateInstructionDataEncoder,bs as getTransactionBufferDecoder,FE as getTransactionBufferDiscriminatorBytes,by as getTransactionBufferEncoder,_v as getTransactionBufferExecuteCompressedDiscriminatorBytes,ba as getTransactionBufferExecuteCompressedInstruction,Uv as getTransactionBufferExecuteCompressedInstructionDataCodec,Ra as getTransactionBufferExecuteCompressedInstructionDataDecoder,ha as getTransactionBufferExecuteCompressedInstructionDataEncoder,Dv as getTransactionBufferExecuteDiscriminatorBytes,Ca as getTransactionBufferExecuteInstruction,Cv as getTransactionBufferExecuteInstructionDataCodec,Da as getTransactionBufferExecuteInstructionDataDecoder,Ia as getTransactionBufferExecuteInstructionDataEncoder,jv as getTransactionBufferExtendCompressedDiscriminatorBytes,Ha as getTransactionBufferExtendCompressedInstruction,qv as getTransactionBufferExtendCompressedInstructionDataCodec,Va as getTransactionBufferExtendCompressedInstructionDataDecoder,Na as getTransactionBufferExtendCompressedInstructionDataEncoder,Nv as getTransactionBufferExtendDiscriminatorBytes,Oa as getTransactionBufferExtendInstruction,Vv as getTransactionBufferExtendInstructionDataCodec,La as getTransactionBufferExtendInstructionDataDecoder,Wa as getTransactionBufferExtendInstructionDataEncoder,A_ as getTransactionBufferVoteCompressedDiscriminatorBytes,$a as getTransactionBufferVoteCompressedInstruction,g_ as getTransactionBufferVoteCompressedInstructionDataCodec,Qa as getTransactionBufferVoteCompressedInstructionDataDecoder,Xa as getTransactionBufferVoteCompressedInstructionDataEncoder,r_ as getTransactionBufferVoteDiscriminatorBytes,ja as getTransactionBufferVoteInstruction,n_ as getTransactionBufferVoteInstructionDataCodec,Ja as getTransactionBufferVoteInstructionDataDecoder,Ka as getTransactionBufferVoteInstructionDataEncoder,h_ as getTransactionExecuteCompressedDiscriminatorBytes,Ai as getTransactionExecuteCompressedInstruction,R_ as getTransactionExecuteCompressedInstructionDataCodec,ui as getTransactionExecuteCompressedInstructionDataDecoder,di as getTransactionExecuteCompressedInstructionDataEncoder,S_ as getTransactionExecuteDiscriminatorBytes,oi as getTransactionExecuteInstruction,x_ as getTransactionExecuteInstructionDataCodec,si as getTransactionExecuteInstructionDataDecoder,ni as getTransactionExecuteInstructionDataEncoder,K_ as getTransactionExecuteSyncCompressedDiscriminatorBytes,Ci as getTransactionExecuteSyncCompressedInstruction,J_ as getTransactionExecuteSyncCompressedInstructionDataCodec,Di as getTransactionExecuteSyncCompressedInstructionDataDecoder,Ii as getTransactionExecuteSyncCompressedInstructionDataEncoder,B_ as getTransactionExecuteSyncDiscriminatorBytes,fi as getTransactionExecuteSyncInstruction,w_ as getTransactionExecuteSyncInstructionDataCodec,Ti as getTransactionExecuteSyncInstructionDataDecoder,pi as getTransactionExecuteSyncInstructionDataEncoder,CM as getTransactionMessageAddressTableLookupCodec,kr as getTransactionMessageAddressTableLookupDecoder,wr as getTransactionMessageAddressTableLookupEncoder,xM as getTransactionMessageCodec,Dt as getTransactionMessageDecoder,It as getTransactionMessageEncoder,O as getUserAccountAddress,hM as getUserCodec,_M as getUserCreationArgsCodec,ge as getUserCreationArgsDecoder,Ae as getUserCreationArgsEncoder,Z as getUserDecoder,Oe as getUserEncoder,OM as getUserMutArgsCodec,fe as getUserMutArgsDecoder,Te as getUserMutArgsEncoder,NM as getUserReadOnlyArgsCodec,ve as getUserReadOnlyArgsDecoder,be as getUserReadOnlyArgsEncoder,FM as getUserReadOnlyOrMutateArgsCodec,Or as getUserReadOnlyOrMutateArgsDecoder,Lr as getUserReadOnlyOrMutateArgsEncoder,qM as getUserRoleCodec,Le as getUserRoleDecoder,We as getUserRoleEncoder,eL as getWalletAddressFromIndex,Se as getWalletAddressFromSettings,ZE as getWhitelistedAddressTreeCodec,Os as getWhitelistedAddressTreeDecoder,qE as getWhitelistedAddressTreeDiscriminatorBytes,Zy as getWhitelistedAddressTreeEncoder,Dn as getWhitelistedAddressTreeFromIndex,KW as getWhitelistedAddressTreeIndexFromAddress,Li as getWhitelistedAddressTreesAddress,UU as identifyMultiWalletAccount,WU as identifyMultiWalletInstruction,DW as initialize,XD as isConfigAction,VU as isMultiWalletError,KM as isUserReadOnlyOrMutateArgs,OO as migrateSettings,GO as migrateUsers,Fw as nativeTransferIntent,TP as parseAddWhitelistedAddressTreesInstruction,OP as parseChangeConfigCompressedInstruction,PP as parseChangeConfigInstruction,zP as parseCompressSettingsAccountInstruction,eh as parseCreateDomainConfigInstruction,uh as parseCreateDomainUserAccountInstruction,Sh as parseCreateGlobalCounterInstruction,bh as parseCreateMultiWalletCompressedInstruction,Nh as parseCreateUserAccountsInstruction,qh as parseDecompressSettingsAccountInstruction,rR as parseDisableDomainConfigInstruction,gR as parseEditDomainConfigInstruction,IR as parseEditTransactionManagerUrlInstruction,vR as parseEditUserDelegateInstruction,NR as parseMigrateCompressedSettingsInstruction,qR as parseMigrateCompressedUsersInstruction,yb as parseNativeTransferIntentCompressedInstruction,sb as parseNativeTransferIntentInstruction,eB as parseSecp256r1VerifyInstruction,Wb as parseTokenTransferIntentCompressedInstruction,Cb as parseTokenTransferIntentInstruction,Xb as parseTransactionBufferCloseCompressedInstruction,Gb as parseTransactionBufferCloseInstruction,pv as parseTransactionBufferCreateCompressedInstruction,cv as parseTransactionBufferCreateInstruction,Wv as parseTransactionBufferExecuteCompressedInstruction,Mv as parseTransactionBufferExecuteInstruction,Zv as parseTransactionBufferExtendCompressedInstruction,Hv as parseTransactionBufferExtendInstruction,y_ as parseTransactionBufferVoteCompressedInstruction,s_ as parseTransactionBufferVoteInstruction,b_ as parseTransactionExecuteCompressedInstruction,I_ as parseTransactionExecuteInstruction,j_ as parseTransactionExecuteSyncCompressedInstruction,k_ as parseTransactionExecuteSyncInstruction,KL as pollJitoBundleConfirmation,tN as prepareChangeConfigArgs,dN as prepareTransactionBundle,DN as prepareTransactionMessage,hN as prepareTransactionSync,JL as retrieveTransactionManager,WI as sendJitoBundle,qL as serializeConfigActions,FL as signAndSendBundledTransactions,zL as signAndSendTransaction,$w as tokenTransferIntent,IW as uninitialize,zM as userReadOnlyOrMutateArgs,Ri as vaultTransactionMessageDeserialize,hi as vaultTransactionMessageSerialize,ld as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
1
|
+
import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getOptionEncoder,getOptionDecoder,getArrayEncoder,getU64Encoder,getArrayDecoder,getU64Decoder,getU16Encoder,getU16Decoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getBooleanEncoder,getBooleanDecoder,getEnumEncoder,getEnumDecoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64Encoder,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,getBase64Decoder,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,getBlockhashDecoder,compileTransaction,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {VERSION,featureFlags,createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,CTOKEN_PROGRAM_ID,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import {estimateComputeUnitLimitFactory,getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTokenDecoder,getTransferSolInstruction}from'gill/programs';import Hd from'bn.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {p256}from'@noble/curves/nist.js';var rs=new Uint8Array([201,232,212,229,59,241,106,197]);function zC(){return fixEncoderSize(getBytesEncoder(),8).encode(rs)}function nu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["authority",getAddressEncoder()],["rpIdHash",fixEncoderSize(getBytesEncoder(),32)],["bump",getU8Encoder()],["isDisabled",getU8Encoder()],["rpIdLength",getU8Encoder()],["numOrigins",getU8Encoder()],["rpId",fixEncoderSize(getBytesEncoder(),255)],["origins",fixEncoderSize(getBytesEncoder(),515)]]),e=>({...e,discriminator:rs}))}function ns(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["authority",getAddressDecoder()],["rpIdHash",fixDecoderSize(getBytesDecoder(),32)],["bump",getU8Decoder()],["isDisabled",getU8Decoder()],["rpIdLength",getU8Decoder()],["numOrigins",getU8Decoder()],["rpId",fixDecoderSize(getBytesDecoder(),255)],["origins",fixDecoderSize(getBytesDecoder(),515)]])}function KC(){return combineCodec(nu(),ns())}function ss(e){return decodeAccount(e,ns())}async function os(e,n,r){let s=await su(e,n,r);return assertAccountExists(s),s}async function su(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ss(s)}async function jC(e,n,r){let s=await ou(e,n,r);return assertAccountsExist(s),s}async function ou(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ss(t))}function JC(){return 846}var is=new Uint8Array([42,206,176,58,175,129,130,233]);function YC(){return fixEncoderSize(getBytesEncoder(),8).encode(is)}function Su(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:is}))}function ds(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function XC(){return combineCodec(Su(),ds())}function us(e){return decodeAccount(e,ds())}async function QC(e,n,r){let s=await xu(e,n,r);return assertAccountExists(s),s}async function xu(e,n,r){let s=await fetchEncodedAccount(e,n,r);return us(s)}async function $C(e,n,r){let s=await Iu(e,n,r);return assertAccountsExist(s),s}async function Iu(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>us(t))}function eD(){return 24}function Er(){return getStructEncoder([["memberKey",ee()],["permissions",Ue()],["userReadonlyArgs",Ie()]])}function hr(){return getStructDecoder([["memberKey",te()],["permissions",We()],["userReadonlyArgs",Ce()]])}function sD(){return combineCodec(Er(),hr())}function Rr(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function br(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function aD(){return combineCodec(Rr(),br())}function dt(){return getStructEncoder([["treeInfo",At()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function ut(){return getStructDecoder([["treeInfo",gt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function AD(){return combineCodec(dt(),ut())}function pt(){return getStructEncoder([["treeInfo",At()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function mt(){return getStructDecoder([["treeInfo",gt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function yD(){return combineCodec(pt(),mt())}function kr(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function Lr(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function fD(){return combineCodec(kr(),Lr())}function yt(){return getStructEncoder([["data",getOptionEncoder(Tt())]])}function q(){return getStructDecoder([["data",getOptionDecoder(lt())]])}function CD(){return combineCodec(yt(),q())}function Tt(){return getStructEncoder([["threshold",getU8Encoder()],["bump",getU8Encoder()],["index",getU128Encoder()],["multiWalletBump",getU8Encoder()],["members",getArrayEncoder(ft())],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function lt(){return getStructDecoder([["threshold",getU8Decoder()],["bump",getU8Decoder()],["index",getU128Decoder()],["multiWalletBump",getU8Decoder()],["members",getArrayDecoder(St())],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function ED(){return combineCodec(Tt(),lt())}function xt(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",Or()]])}function It(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",Br()]])}function vD(){return combineCodec(xt(),It())}function ke(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Vr())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Er())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Fr())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Le(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Hr())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(hr())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Gr())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function kD(){return combineCodec(ke(),Le())}function LD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function OD(e,n){return n.__kind===e}function zr(){return getStructEncoder([["member",getAddressEncoder()],["role",Oe()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",Te()]])}function Kr(){return getStructDecoder([["member",getAddressDecoder()],["role",Be()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",le()]])}function VD(){return combineCodec(zr(),Kr())}function Vr(){return getStructEncoder([["memberKey",ee()],["permissions",Ue()]])}function Hr(){return getStructDecoder([["memberKey",te()],["permissions",We()]])}function zD(){return combineCodec(Vr(),Hr())}function Ct(){return getStructEncoder([["memberKey",ee()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function Dt(){return getStructDecoder([["memberKey",te()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function qD(){return combineCodec(Ct(),Dt())}function jr(){return getStructEncoder([["settingsMutArgs",G()],["transactionManager",getOptionEncoder(Ie())]])}function Jr(){return getStructDecoder([["settingsMutArgs",z()],["transactionManager",getOptionDecoder(Ce())]])}function QD(){return combineCodec(jr(),Jr())}function ft(){return getStructEncoder([["pubkey",ee()],["permissions",Ue()],["role",getU8Encoder()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function St(){return getStructDecoder([["pubkey",te()],["permissions",We()],["role",getU8Decoder()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function rM(){return combineCodec(ft(),St())}function ee(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function te(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function oM(){return combineCodec(ee(),te())}function Yr(){return getStructEncoder([["authorityCreationArgs",Te()],["compressedProofArgs",C()]])}function Xr(){return getStructDecoder([["authorityCreationArgs",le()],["compressedProofArgs",D()]])}function dM(){return combineCodec(Yr(),Xr())}function Mt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function Pt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function gM(){return combineCodec(Mt(),Pt())}function Or(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function Br(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function yM(){return combineCodec(Or(),Br())}function At(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function gt(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function fM(){return combineCodec(At(),gt())}function Ue(){return getStructEncoder([["mask",getU8Encoder()]])}function We(){return getStructDecoder([["mask",getU8Decoder()]])}function IM(){return combineCodec(Ue(),We())}function C(){return getStructEncoder([["proof",getOptionEncoder(kr())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function D(){return getStructDecoder([["proof",getOptionDecoder(Lr())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function PM(){return combineCodec(C(),D())}function Fr(){return getStructEncoder([["memberKey",ee()],["userArgs",Qr()]])}function Gr(){return getStructDecoder([["memberKey",te()],["userArgs",$r()]])}function bM(){return combineCodec(Fr(),Gr())}function en(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Et(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function UM(){return combineCodec(en(),Et())}function V(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function H(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function LM(){return combineCodec(V(),H())}function Z(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",V()]])}function Y(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",H()]])}function NM(){return combineCodec(Z(),Y())}function ht(){return getStructEncoder([["addressTreeInfo",Mt()],["outputStateTreeIndex",getU8Encoder()]])}function Rt(){return getStructDecoder([["addressTreeInfo",Pt()],["outputStateTreeIndex",getU8Decoder()]])}function GM(){return combineCodec(ht(),Rt())}function bt(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function vt(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function jM(){return combineCodec(bt(),vt())}function G(){return getStructEncoder([["accountMeta",dt()],["data",yt()]])}function z(){return getStructDecoder([["accountMeta",ut()],["data",q()]])}function YM(){return combineCodec(G(),z())}function _t(){return getStructEncoder([["accountMeta",pt()],["data",yt()]])}function Ut(){return getStructDecoder([["accountMeta",mt()],["data",q()]])}function eP(){return combineCodec(_t(),Ut())}function Wt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getArrayEncoder(Ct())]])}function kt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getArrayDecoder(Dt())]])}function sP(){return combineCodec(Wt(),kt())}function Lt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(Rr())],["addressTableLookups",getArrayEncoder(tn())]])}function Ot(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(br())],["addressTableLookups",getArrayDecoder(rn())]])}function iP(){return combineCodec(Lt(),Ot())}function tn(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function rn(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function AP(){return combineCodec(tn(),rn())}function we(){return getStructEncoder([["member",ee()],["domainConfig",getOptionEncoder(getAddressEncoder())],["role",Oe()],["delegatedTo",getOptionEncoder(bt())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function X(){return getStructDecoder([["member",te()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",Be()],["delegatedTo",getOptionDecoder(vt())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function yP(){return combineCodec(we(),X())}function Te(){return getStructEncoder([["addressTreeInfo",Mt()],["outputStateTreeIndex",getU8Encoder()]])}function le(){return getStructDecoder([["addressTreeInfo",Pt()],["outputStateTreeIndex",getU8Decoder()]])}function SP(){return combineCodec(Te(),le())}function Ne(){return getStructEncoder([["accountMeta",dt()],["data",we()]])}function Ve(){return getStructDecoder([["accountMeta",ut()],["data",X()]])}function DP(){return combineCodec(Ne(),Ve())}function Ie(){return getStructEncoder([["accountMeta",pt()],["data",we()]])}function Ce(){return getStructDecoder([["accountMeta",mt()],["data",X()]])}function hP(){return combineCodec(Ie(),Ce())}function Qr(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Ie()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([Ne()])]])]])}function $r(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Ce()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([Ve()])]])]])}function _P(){return combineCodec(Qr(),$r())}function UP(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function WP(e,n){return n.__kind===e}var Ye=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(Ye||{});function Oe(){return getEnumEncoder(Ye)}function Be(){return getEnumDecoder(Ye)}function OP(){return combineCodec(Oe(),Be())}var Js=new Uint8Array([223,179,163,190,177,224,67,173]);function PE(){return fixEncoderSize(getBytesEncoder(),8).encode(Js)}function Jp(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(ft())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:Js}))}function qs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(St())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function EE(){return combineCodec(Jp(),qs())}function Zs(e){return decodeAccount(e,qs())}async function hE(e,n,r){let s=await on(e,n,r);return assertAccountExists(s),s}async function on(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Zs(s)}async function RE(e,n,r){let s=await qp(e,n,r);return assertAccountsExist(s),s}async function qp(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Zs(t))}var eo=new Uint8Array([90,36,35,219,93,225,110,96]);function UE(){return fixEncoderSize(getBytesEncoder(),8).encode(eo)}function gm(){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",ee()],["executor",ee()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(ee())],["expectedSecp256r1Signers",getArrayEncoder(Ct())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:eo}))}function to(){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",te()],["executor",te()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(te())],["expectedSecp256r1Signers",getArrayDecoder(Dt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function WE(){return combineCodec(gm(),to())}function ro(e){return decodeAccount(e,to())}async function no(e,n,r){let s=await pm(e,n,r);return assertAccountExists(s),s}async function pm(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ro(s)}async function kE(e,n,r){let s=await mm(e,n,r);return assertAccountsExist(s),s}async function mm(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ro(t))}var co=new Uint8Array([105,23,173,2,197,255,80,87]);function BE(){return fixEncoderSize(getBytesEncoder(),8).encode(co)}function Um(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:co}))}function ao(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function wE(){return combineCodec(Um(),ao())}function io(e){return decodeAccount(e,ao())}async function uo(e,n,r){let s=await Wm(e,n,r);return assertAccountExists(s),s}async function Wm(e,n,r){let s=await fetchEncodedAccount(e,n,r);return io(s)}async function NE(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=>io(t))}function y({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 go(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function _(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 T(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:_(r.value),role:Ao(r.value)?upgradeRoleToSigner(s):s,...Ao(r.value)?{signer:r.value}:{}})}}function Ao(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var mo=new Uint8Array([8]);function rh(){return fixEncoderSize(getBytesEncoder(),1).encode(mo)}function mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:mo}))}function yo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function nh(){return combineCodec(mn(),yo())}async function To(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:mn().encode(c),programAddress:r})}function sh(e,n){let r=n?.programAddress??u,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:mn().encode(c),programAddress:r})}function oh(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:yo().decode(e.data)}}var Co=new Uint8Array([9]);function gh(){return fixEncoderSize(getBytesEncoder(),1).encode(Co)}function yn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(ke())],["secp256r1VerifyArgs",getArrayEncoder(Z())],["compressedProofArgs",getOptionEncoder(C())]]),e=>({...e,discriminator:Co}))}function Do(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(Le())],["secp256r1VerifyArgs",getArrayDecoder(Y())],["compressedProofArgs",getOptionDecoder(D())]])}function ph(){return combineCodec(yn(),Do())}async function Mo(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(go(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(_(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=y(a),o=T(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:yn().encode(c),programAddress:r})}function mh(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=y(a),o=T(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:yn().encode(c),programAddress:r})}function yh(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:r()},data:Do().decode(e.data)}}var bo=new Uint8Array([19]);function Ch(){return fixEncoderSize(getBytesEncoder(),1).encode(bo)}function vo(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(ke())],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",G()],["compressedProofArgs",C()]]),e=>({...e,discriminator:bo}))}function _o(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Le())],["secp256r1VerifyArgs",getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function Dh(){return combineCodec(vo(),_o())}function Uo(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=y(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:vo().encode(c),programAddress:r})}function Mh(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:_o().decode(e.data)}}var Lo=new Uint8Array([18]);function _h(){return fixEncoderSize(getBytesEncoder(),1).encode(Lo)}function Tn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["settingsCreation",ht()],["userReadonlyArgs",Ie()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Lo}))}function Oo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["settingsCreation",Rt()],["userReadonlyArgs",Ce()],["settingsIndex",getU128Decoder()]])}function Uh(){return combineCodec(Tn(),Oo())}async function Bo(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},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.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Tn().encode(c),programAddress:r})}function Wh(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},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");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Tn().encode(c),programAddress:r})}function kh(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:Oo().decode(e.data)}}var Ko=new Uint8Array([0]);function Hh(){return fixEncoderSize(getBytesEncoder(),1).encode(Ko)}function fn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",Te()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ko}))}function jo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",le()],["compressedProofArgs",D()]])}function Fh(){return combineCodec(fn(),jo())}async function Jo(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:fn().encode(c),programAddress:r})}function Gh(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:fn().encode(c),programAddress:r})}function zh(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:jo().decode(e.data)}}var Zo=new Uint8Array([4]);function Xh(){return fixEncoderSize(getBytesEncoder(),1).encode(Zo)}function xn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["member",en()],["role",Oe()],["userAccountCreationArgs",Te()],["linkWalletArgs",getOptionEncoder(jr())]]),e=>({...e,discriminator:Zo}))}function Yo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["member",Et()],["role",Be()],["userAccountCreationArgs",le()],["linkWalletArgs",getOptionDecoder(Jr())]])}function Qh(){return combineCodec(xn(),Yo())}async function Xo(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=y(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:xn().encode(c),programAddress:r})}function $h(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=y({args:c}),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:xn().encode(c),programAddress:r})}function eR(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:Yo().decode(e.data)}}var $o=new Uint8Array([3]);function cR(){return fixEncoderSize(getBytesEncoder(),1).encode($o)}function Cn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:$o}))}function ec(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function aR(){return combineCodec(Cn(),ec())}async function tc(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=y(c),i=T(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Cn().encode({}),programAddress:r})}function iR(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=y(c),i=T(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Cn().encode({}),programAddress:r})}function dR(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:ec().decode(e.data)}}var nc=new Uint8Array([5]);function TR(){return fixEncoderSize(getBytesEncoder(),1).encode(nc)}function Mn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["createUserArgs",getArrayEncoder(zr())]]),e=>({...e,discriminator:nc}))}function sc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["createUserArgs",getArrayDecoder(Kr())]])}function lR(){return combineCodec(Mn(),sc())}async function oc(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=y(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Mn().encode(c),programAddress:r})}function fR(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=y(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Mn().encode(c),programAddress:r})}function SR(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:sc().decode(e.data)}}var ic=new Uint8Array([17]);function ER(){return fixEncoderSize(getBytesEncoder(),1).encode(ic)}function dc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",G()],["compressedProofArgs",C()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:ic}))}function uc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",z()],["compressedProofArgs",D()],["secp256r1VerifyArgs",getArrayDecoder(Y())]])}function hR(){return combineCodec(dc(),uc())}function Ac(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=y(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:dc().encode(c),programAddress:r})}function RR(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:uc().decode(e.data)}}var mc=new Uint8Array([2]);function kR(){return fixEncoderSize(getBytesEncoder(),1).encode(mc)}function yc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:mc}))}function Tc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function LR(){return combineCodec(yc(),Tc())}function lc(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=y({args:c}),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:yc().encode(c),programAddress:r})}function OR(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:Tc().decode(e.data)}}var Ic=new Uint8Array([1]);function GR(){return fixEncoderSize(getBytesEncoder(),1).encode(Ic)}function En(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Yr())]]),e=>({...e,discriminator:Ic}))}function Cc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(Xr())]])}function zR(){return combineCodec(En(),Cc())}async function KR(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:En().encode(c),programAddress:r})}function Dc(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:En().encode(c),programAddress:r})}function jR(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:Cc().decode(e.data)}}var Ec=new Uint8Array([6]);function $R(){return fixEncoderSize(getBytesEncoder(),1).encode(Ec)}function hc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Ne()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ec}))}function Rc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ve()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",D()]])}function eb(){return combineCodec(hc(),Rc())}function bc(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i=y({args:c}),o=T(r);return Object.freeze({accounts:[o(t.authority),...i],data:hc().encode(c),programAddress:r})}function tb(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Rc().decode(e.data)}}var Uc=new Uint8Array([7]);function ib(){return fixEncoderSize(getBytesEncoder(),1).encode(Uc)}function Wc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Ne()],["secp256r1VerifyArgs",getOptionEncoder(V())],["delegateTo",getOptionEncoder(bt())],["oldSettingsMutArgs",getOptionEncoder(G())],["newSettingsMutArgs",getOptionEncoder(G())],["compressedProofArgs",C()]]),e=>({...e,discriminator:Uc}))}function kc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",Ve()],["secp256r1VerifyArgs",getOptionDecoder(H())],["delegateTo",getOptionDecoder(vt())],["oldSettingsMutArgs",getOptionDecoder(z())],["newSettingsMutArgs",getOptionDecoder(z())],["compressedProofArgs",D()]])}function db(){return combineCodec(Wc(),kc())}function Lc(e,n){let r=n?.programAddress??u,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...i],data:Wc().encode(c),programAddress:r})}function ub(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:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:kc().decode(e.data)}}var wc=new Uint8Array([32]);function lb(){return fixEncoderSize(getBytesEncoder(),1).encode(wc)}function Nc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Tt()],["compressedProofArgs",C()],["settingsCreationArgs",ht()]]),e=>({...e,discriminator:wc}))}function Vc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",lt()],["compressedProofArgs",D()],["settingsCreationArgs",Rt()]])}function fb(){return combineCodec(Nc(),Vc())}function Hc(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.authority),...i],data:Nc().encode(c),programAddress:r})}function Sb(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:Vc().decode(e.data)}}var zc=new Uint8Array([31]);function Eb(){return fixEncoderSize(getBytesEncoder(),1).encode(zc)}function Kc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",we()],["compressedProofArgs",C()],["userCreationArgs",Te()]]),e=>({...e,discriminator:zc}))}function jc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",X()],["compressedProofArgs",D()],["userCreationArgs",le()]])}function hb(){return combineCodec(Kc(),jc())}function Jc(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.authority),...i],data:Kc().encode(c),programAddress:r})}function Rb(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:jc().decode(e.data)}}var Zc=new Uint8Array([29]);function Lb(){return fixEncoderSize(getBytesEncoder(),1).encode(Zc)}function hn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:Zc}))}function Yc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Y())]])}function Ob(){return combineCodec(hn(),Yc())}async function Bb(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},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(_(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(a),o=T(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:hn().encode(c),programAddress:r})}function Xc(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},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=y(a),o=T(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:hn().encode(c),programAddress:r})}function wb(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:Yc().decode(e.data)}}var ea=new Uint8Array([27]);function Kb(){return fixEncoderSize(getBytesEncoder(),1).encode(ea)}function ta(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",G()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ea}))}function ra(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function jb(){return combineCodec(ta(),ra())}function na(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=y(a),o=T(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:ta().encode(c),programAddress:r})}function Jb(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:ra().decode(e.data)}}var aa=new Uint8Array([30]);function ev(){return fixEncoderSize(getBytesEncoder(),1).encode(aa)}function Rn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["compressedTokenAccount",getOptionEncoder(xt())],["compressedProofArgs",getOptionEncoder(C())],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:aa}))}function ia(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["compressedTokenAccount",getOptionDecoder(It())],["compressedProofArgs",getOptionDecoder(D())],["secp256r1VerifyArgs",getArrayDecoder(Y())]])}function tv(){return combineCodec(Rn(),ia())}async function rv(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},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??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(_(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(_(t.source.value)),getAddressEncoder().encode(_(t.tokenProgram.value)),getAddressEncoder().encode(_(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(_(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(_(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(_(t.destination.value)),getAddressEncoder().encode(_(t.tokenProgram.value)),getAddressEncoder().encode(_(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(_(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(_(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.splInterfacePda.value||(t.splInterfacePda.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getBytesEncoder().encode(new Uint8Array([112,111,111,108])),getAddressEncoder().encode(_(t.mint.value))]})),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Rn().encode(c),programAddress:r})}function da(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},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??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.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Rn().encode(c),programAddress:r})}function nv(e){if(e.accounts.length<18)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(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:ia().decode(e.data)}}var Aa=new Uint8Array([28]);function uv(){return fixEncoderSize(getBytesEncoder(),1).encode(Aa)}function bn(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["compressedTokenAccount",getOptionEncoder(xt())],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",G()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Aa}))}function ga(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["compressedTokenAccount",getOptionDecoder(It())],["secp256r1VerifyArgs",getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function Av(){return combineCodec(bn(),ga())}async function gv(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:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??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.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(_(t.source.value)),getAddressEncoder().encode(_(t.tokenProgram.value)),getAddressEncoder().encode(_(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(_(t.source.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(_(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(_(t.destination.value)),getAddressEncoder().encode(_(t.tokenProgram.value)),getAddressEncoder().encode(_(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(_(t.destination.value)),getBytesEncoder().encode(new Uint8Array([9,21,163,87,35,121,78,143,182,93,7,91,107,114,105,156,56,221,2,229,148,139,117,176,229,160,65,142,128,151,91,68])),getAddressEncoder().encode(_(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.splInterfacePda.value||(t.splInterfacePda.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getBytesEncoder().encode(new Uint8Array([112,111,111,108])),getAddressEncoder().encode(_(t.mint.value))]})),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:bn().encode(c),programAddress:r})}function pa(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:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??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.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:bn().encode(c),programAddress:r})}function pv(e){if(e.accounts.length<17)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(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:ga().decode(e.data)}}var Ta=new Uint8Array([13]);function xv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ta)}function la(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:Ta}))}function fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())]])}function Iv(){return combineCodec(la(),fa())}function Sa(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},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=y(a),o=T(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:la().encode(c),programAddress:r})}function Cv(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:fa().decode(e.data)}}var Ca=new Uint8Array([23]);function bv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ca)}function Da(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsMutArgs",G()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ca}))}function Ma(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function vv(){return combineCodec(Da(),Ma())}function Pa(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=y(a),o=T(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:Da().encode(c),programAddress:r})}function _v(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ma().decode(e.data)}}var Ra=new Uint8Array([10]);function wv(){return fixEncoderSize(getBytesEncoder(),1).encode(Ra)}function ba(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Wt()],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:Ra}))}function va(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",kt()],["secp256r1VerifyArgs",getOptionDecoder(H())]])}function Nv(){return combineCodec(ba(),va())}function _a(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=y(a),o=T(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:ba().encode(c),programAddress:r})}function Vv(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:va().decode(e.data)}}var ka=new Uint8Array([20]);function Jv(){return fixEncoderSize(getBytesEncoder(),1).encode(ka)}function La(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Wt()],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsReadonlyArgs",_t()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ka}))}function Oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",kt()],["secp256r1VerifyArgs",getOptionDecoder(H())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",D()]])}function qv(){return combineCodec(La(),Oa())}function Ba(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=y(a),o=T(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:La().encode(c),programAddress:r})}function Zv(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:Oa().decode(e.data)}}var Va=new Uint8Array([14]);function r_(){return fixEncoderSize(getBytesEncoder(),1).encode(Va)}function Ha(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:Va}))}function Fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())]])}function n_(){return combineCodec(Ha(),Fa())}function Ga(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??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=y(a),o=T(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:Ha().encode(c),programAddress:r})}function s_(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:Fa().decode(e.data)}}var ja=new Uint8Array([24]);function A_(){return fixEncoderSize(getBytesEncoder(),1).encode(ja)}function Ja(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsMutArgs",G()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ja}))}function qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function g_(){return combineCodec(Ja(),qa())}function Za(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=y(a),o=T(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:Ja().encode(c),programAddress:r})}function p_(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:qa().decode(e.data)}}var Qa=new Uint8Array([12]);function S_(){return fixEncoderSize(getBytesEncoder(),1).encode(Qa)}function $a(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Qa}))}function ei(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function x_(){return combineCodec($a(),ei())}function ti(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=y({args:c}),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:$a().encode(c),programAddress:r})}function I_(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:ei().decode(e.data)}}var si=new Uint8Array([22]);function h_(){return fixEncoderSize(getBytesEncoder(),1).encode(si)}function oi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:si}))}function ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function R_(){return combineCodec(oi(),ci())}function ai(e,n){let r=n?.programAddress??u,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=y({args:c}),o=T(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:oi().encode(c),programAddress:r})}function b_(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:ci().decode(e.data)}}var ui=new Uint8Array([11]);function O_(){return fixEncoderSize(getBytesEncoder(),1).encode(ui)}function Ai(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())]]),e=>({...e,discriminator:ui}))}function gi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())]])}function B_(){return combineCodec(Ai(),gi())}function pi(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=y(a),o=T(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:Ai().encode(c),programAddress:r})}function w_(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:gi().decode(e.data)}}var Ti=new Uint8Array([21]);function K_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ti)}function li(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(V())],["settingsReadonlyArgs",_t()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ti}))}function fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(H())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",D()]])}function j_(){return combineCodec(li(),fi())}function Si(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=y(a),o=T(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:li().encode(c),programAddress:r})}function J_(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:fi().decode(e.data)}}var Ci=new Uint8Array([15]);function $_(){return fixEncoderSize(getBytesEncoder(),1).encode(Ci)}function Di(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Ci}))}function Mi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function eU(){return combineCodec(Di(),Mi())}function Pi(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=y({}),i=T(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:Di().encode({}),programAddress:r})}function tU(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:Mi().decode(e.data)}}var Ri=new Uint8Array([25]);function aU(){return fixEncoderSize(getBytesEncoder(),1).encode(Ri)}function bi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Ri}))}function vi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function iU(){return combineCodec(bi(),vi())}function _i(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=y({args:c}),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:bi().encode(c),programAddress:r})}function dU(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:vi().decode(e.data)}}var ki=new Uint8Array([16]);function TU(){return fixEncoderSize(getBytesEncoder(),1).encode(ki)}function Li(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Lt()],["secp256r1VerifyArgs",getArrayEncoder(Z())]]),e=>({...e,discriminator:ki}))}function Oi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Ot()],["secp256r1VerifyArgs",getArrayDecoder(Y())]])}function lU(){return combineCodec(Li(),Oi())}function Bi(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=y(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Li().encode(c),programAddress:r})}function fU(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:Oi().decode(e.data)}}var Vi=new Uint8Array([26]);function PU(){return fixEncoderSize(getBytesEncoder(),1).encode(Vi)}function Hi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Lt()],["secp256r1VerifyArgs",getArrayEncoder(Z())],["settingsMutArgs",G()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Vi}))}function Fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Ot()],["secp256r1VerifyArgs",getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function EU(){return combineCodec(Hi(),Fi())}function Gi(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=y(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Hi().encode(c),programAddress:r})}function hU(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:Fi().decode(e.data)}}var u="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",ex=(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))(ex||{});function AW(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 tx=(m=>(m[m.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",m[m.ChangeConfig=1]="ChangeConfig",m[m.ChangeConfigCompressed=2]="ChangeConfigCompressed",m[m.CreateCompressedWallet=3]="CreateCompressedWallet",m[m.CreateDomainConfig=4]="CreateDomainConfig",m[m.CreateDomainUserAccount=5]="CreateDomainUserAccount",m[m.CreateGlobalCounter=6]="CreateGlobalCounter",m[m.CreateUserAccounts=7]="CreateUserAccounts",m[m.DecompressSettingsAccount=8]="DecompressSettingsAccount",m[m.DisableDomainConfig=9]="DisableDomainConfig",m[m.EditDomainConfig=10]="EditDomainConfig",m[m.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",m[m.EditUserDelegate=12]="EditUserDelegate",m[m.MigrateCompressedSettings=13]="MigrateCompressedSettings",m[m.MigrateCompressedUsers=14]="MigrateCompressedUsers",m[m.NativeTransferIntent=15]="NativeTransferIntent",m[m.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",m[m.TokenTransferIntent=17]="TokenTransferIntent",m[m.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",m[m.TransactionBufferClose=19]="TransactionBufferClose",m[m.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",m[m.TransactionBufferCreate=21]="TransactionBufferCreate",m[m.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",m[m.TransactionBufferExecute=23]="TransactionBufferExecute",m[m.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",m[m.TransactionBufferExtend=25]="TransactionBufferExtend",m[m.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",m[m.TransactionBufferVote=27]="TransactionBufferVote",m[m.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",m[m.TransactionExecute=29]="TransactionExecute",m[m.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",m[m.TransactionExecuteSync=31]="TransactionExecuteSync",m[m.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",m))(tx||{});function gW(e){let n="data"in e?e.data:e;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 1;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 2;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([18])),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([5])),0))return 7;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 8;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 9;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 10;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 11;if(containsBytes(n,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),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([13])),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([10])),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([14])),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([12])),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([11])),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([15])),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([16])),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 nx=6e3,sx=6001,ox=6002,cx=6003,ax=6004,ix=6005,dx=6006,ux=6007,Ax=6008,gx=6009,px=6010,mx=6011,yx=6012,Tx=6013,lx=6014,fx=6015,Sx=6016,xx=6017,Ix=6018,Cx=6019,Dx=6020,Mx=6021,Px=6022,Ex=6023,hx=6024,Rx=6025,bx=6026,vx=6027,_x=6028,Ux=6029,Wx=6030,kx=6031,Lx=6032,Ox=6033,Bx=6034,wx=6035,Nx=6036,Vx=6037,Hx=6038,Fx=6039,Gx=6040,zx=6041,Kx=6042,jx=6043,Jx=6044,qx=6045,Zx=6046,Yx=6047,Xx=6048,Qx=6049,$x=6050,eI=6051,tI=6052,rI=6053,nI=6054,zi;process.env.NODE_ENV!=="production"&&(zi={[Wx]:"This member is already delegated to another wallet.",[ux]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[$x]:"The domain configuration account is disabled. Please contact support or try again later.",[eI]:"Missing domain configuration account.",[px]:"Duplicate public keys detected among members. Each member must have a unique key.",[gx]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[Dx]:"No members provided. A multisig wallet must contain at least one member.",[Ix]:"Expected a User with Administrator role for this instruction.",[Ax]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[Sx]:"Expected a User with Transaction Manager role for this instruction.",[Fx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[Gx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[zx]:"Declared buffer size does not match the actual serialized size.",[Ox]:"Not enough members with vote permission to meet the approval threshold.",[kx]:"At least one signer with execute permission is required to proceed.",[Lx]:"At least one signer with initiate permission is required to perform this action.",[Rx]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[nI]:"Address Tree supplied is not part of the whitelisted address trees",[Cx]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[vx]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Hx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[Bx]:"Only delegated members are allowed for this transaction.",[hx]:"Unexpected number of accounts provided for this instruction.",[Tx]:"User with Permanent Member role requires a must have a delegated wallet.",[sx]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[ax]:"The extracted public key has an invalid length or encoding.",[nx]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[cx]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[Qx]:"The specified slot number is not recent.",[Yx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[Px]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[xx]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[fx]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[Ex]:"Malformed transaction message: structure or formatting does not match the expected layout.",[bx]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[ix]:"The extracted WebAuthn signed message payload is malformed.",[qx]:"An input string exceeds the maximum allowed character length.",[tI]:"This member is not registered under the provided domain configuration.",[_x]:"A required account is missing from the instruction context.",[Ux]:"User mutation arguments are required when performing add or remove delegate operations.",[Zx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[Nx]:"No valid signer found in this transaction.",[yx]:"Only one permanent member is allowed per wallet.",[lx]:"Only one transaction manager is allowed per wallet.",[rI]:"The given origin index is not in the whitelisted origins.",[mx]:"Permanent members cannot be removed from a wallet.",[Jx]:"Writable CPI calls to protected accounts are not permitted.",[dx]:"The rpIdHash extracted from the signed message does not match the expected value.",[ox]:"The signature index provided is out of bounds for the secp256r1 instruction.",[Xx]:"The specified slot number was not found in the provided slot history.",[Mx]:"Too many members: a maximum of 4 members are supported.",[Kx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[jx]:"This transaction has not yet reached the required approval threshold.",[Vx]:"Only the transaction creator or rent payer may close this transaction buffer.",[wx]:"Member is not part of the expected signers for this transaction."});function fW(e){return process.env.NODE_ENV!=="production"?zi[e]:"Error message not available in production bundles."}function SW(e,n,r){return isProgramError(e,n,u,r)}async function vW({admin:e,addressTree:n}){return To({payer:e,addressTree:n,remainingAccounts:[]})}var Ht={Ed25519:1,Secp256r1:2};var De={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Pe=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(De).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var Un=33,Ee=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!==Un)throw new Error(`Invalid public key length, expected ${Un} 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===Un)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 Ee{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(n,r){super(n),this.verifyArgs=r.verifyArgs,this.domainConfig=r.domainConfig,this.authData=r.authData,this.signature=r.signature,this.originIndex=r.originIndex,this.crossOrigin=r.crossOrigin,this.clientAndDeviceHash=r.clientAndDeviceHash,this.authResponse=r.authResponse;}};function cI(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function aI(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var ji=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(cI())],["addressTableLookups",getArrayCodec(aI())]]);function Ji(e){return ji.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 qi(e){let n=ji.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 K={};function Zi(){if(!K.solanaRpcEndpoint)throw new Error("Rpc is not initialized yet.");return K.solanaRpcEndpoint}function Qe(){if(!K.lightProtocolRpc)throw new Error("Rpc is not initialized yet");return K.lightProtocolRpc}function re(){if(!K.solanaRpc)throw new Error("Rpc is not initialized yet");return K.solanaRpc}function Yi(){if(!K.sendAndConfirm)throw new Error("Rpc is not initialized yet.");return K.sendAndConfirm}function Xi(){if(!K.computeEstimate)throw new Error("Rpc is not initialized yet");return K.computeEstimate}function kn(){return K.jitoTipsConfig?K.jitoTipsConfig:{blockEngineUrl:"https://mainnet.block-engine.jito.wtf/api/v1",getJitoTipsUrl:"https://bundles.jito.wtf/api/v1/bundles/tip_floor",priority:"landed_tips_75th_percentile"}}function ek(){Object.keys(K).forEach(e=>{K[e]=void 0;});}function tk({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){K.solanaRpcEndpoint=e,K.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});K.solanaRpc=t,K.sendAndConfirm=c,K.computeEstimate=estimateComputeUnitLimitFactory({rpc:t}),K.jitoTipsConfig=s??null;}var W=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 Qe().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:a,queuePubkeyIndex:i,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:a,addressQueuePubkeyIndex:i});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function pr(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await Qe().getCompressedAccount(e);return s&&n?.set(e.toString(),s),s}}async function ed(e,n,r){let s=e.toString()+(n?.mint?n?.mint.toString():""),t=r?.get(s);if(t)return t;{let c=await Qe().getCompressedTokenAccountsByOwner(e,n);return c&&r?.set(s,c),c}}async function Gt(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await re().getAccountInfo(e,{encoding:"base64"}).send();return s&&n?.set(e.toString(),s),s}}async function ue(e,n){let s=(await Promise.all(e.map(async t=>pr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new Error("Unable to find compressed account.");return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function v(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function ie(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,A)=>({treeInfo:n[A],root:r[A],rootIndex:s[A],address:d.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((d,A)=>({addressTreeInfo:a[A],outputStateTreeIndex:i,address:d.address,type:d.type}))}function se(e,n,r,s,t,c,a){let i=[];for(let A=0;A<n.length;A++)i.push({treeInfo:n[A],rootIndex:s[A],leafIndex:r[A],proveByIndex:t[A],hash:c[A].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((A,g)=>({data:a.decode(A.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(A.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Se(e,n,r,s,t){let c=null,a=null,i=null,o=new W;if(e){await o.addSystemAccounts();let{address:d}=await ne(n,r),A=(await ue([{address:d,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[A.leafIndex],leaves:[],treeInfos:[A.treeInfo],proveByIndices:[A.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:i=await O([A],[]);let g=o.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:A.hash}],[]).stateTrees;if(!g)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(A.address),treeInfo:g.packedTreeInfos[0]},data:q().decode(A.data?.data)},a={accountMeta:{address:new Uint8Array(A.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:q().decode(A.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:o,settingsMutArgs:a}}async function O(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await Qe().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 xe(){return (await mr()).length-1}var Ln;async function mr(){if(!Ln){let{data:e}=await uo(re(),await td());Ln=e.whitelistedAddressTrees;}return Ln}async function yr(e,n,r){let s=await lI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function lI(e,n,r){let{address:s}=await L(e,n),t=await pr(s,r);return t?.data?.data?X().decode(t.data.data):null}async function On(e,n,r){let s=await fI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function fI(e,n,r){try{let{address:s}=await ne(e,n),t=await pr(s,r);if(!t?.data?.data)throw new Error("No compressed settings account found.");let c=q().decode(t.data.data);if(c.data.__option==="None")throw new Error("No compressed settings account found.");return {...c.data.value,isCompressed:!0}}catch{let s=await on(re(),await oe(e));return s.exists?{...s.data,isCompressed:false}:null}}async function Bn(e){let n=await mr();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function Mk(e){let r=(await mr()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function ne(e,n=0){let r=await Bn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("multi_wallet")),new Uint8Array(getU128Encoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(u)).toString(),"base58"),addressTree:new PublicKey(r)}}async function L(e,n=0){let r=await Bn(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),e instanceof Ee?e.toTruncatedBuffer():new Uint8Array(getAddressEncoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(u.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function et({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 cd(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function td(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function ad(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 Ee?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function Me(e){let[n]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function oe(e){let[n]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function Wk(e){let n=await oe(e);return await Me(n)}async function kk(){let[e]=await getProgramDerivedAddress({programAddress:u,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}function lr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function CI(e){let n=new Uint8Array(e.length/2);for(let r=0;r<n.length;r++)n[r]=parseInt(e.slice(r*2,r*2+2),16);return n}function dd(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let s=JSON.stringify(r);return new TextEncoder().encode(s.slice(1,-1))}function ud(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let a=e[s]|e[s+1]<<8;if(s+=2,s+a>e.length)throw new Error("MaxLengthExceeded");let i=e.slice(s,s+a),o=t.decode(i);r.push(o),s+=a;}return r}function Ad(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let 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),d=c[0]===0&&c.length>32?c.slice(1):c,A=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||A.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let p=p256.Point.CURVE().n>>1n,l=BigInt("0x"+lr(A)),b=(l>p?p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),S=CI(b);return new Uint8Array([...g,...S])}function fr(e){return new Uint8Array([...new Uint8Array(Re(e.response.authenticatorData)),...sha256(new Uint8Array(Re(e.response.clientDataJSON)))])}function Xk(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+lr(n.get(-2))),y:BigInt("0x"+lr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function Qk(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 $k(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Re(n)),c=JSON.parse(new TextDecoder().decode(Re(r))),a=dd(c),i=Ad(new Uint8Array(Re(s))),o=await et({rpIdHash:t.subarray(0,32)});return new M(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Re(r)),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:wn(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}async function eL(e,n){let{data:r}=await os(re(),e),t=ud(new Uint8Array(r.origins),r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Error("Origin not found in domain config");return t}function wn(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function tL(e){return sha256(new Uint8Array(getUtf8Encoder().encode(JSON.stringify(e))))}function rL(e){return Nn(e.data.payload.authResponse)}function nL(e,n,r,s){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...wn(n,r,s)]))}async function sL(e,n,r,s,t,c){let a;if(!t||!c){let o=(await re().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed"}).send()).value?.data;if(!o)throw new Error("Unable to fetch slot sysvar");let d=getBase64Encoder().encode(o[0]);c=getU64Decoder().decode(d.subarray(8,16)).toString(),a=d.subarray(16,48),t=getBase58Decoder().decode(a);}else a=new Uint8Array(getBase58Encoder().encode(t));let i=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...sha256(typeof e.transactionMessageBytes=="string"?new Uint8Array(Re(e.transactionMessageBytes)):e.transactionMessageBytes),...a,...wn(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:i}}function Nn(e){return sha256(fr(e))}function oL(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Re(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}async function Vn(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await re().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(s.instructions,c),c=>setTransactionMessageFeePayerSigner(s.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let 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 Td(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 ld(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 j(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,clientAndDeviceHash:r.clientAndDeviceHash}):null,t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,a=r?.authData&&r.verifyArgs?.clientDataJson?fr(r.authResponse):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function rt(e){if(e instanceof Ee)return {keyType:Ht.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Ht.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function yd(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(yd(s))||(r.push(s),n.add(yd(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 fd({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 CL(e){let n=await Vn(e,true),r=await ld(n.map(getBase64EncodedWireTransaction),Zi()),s=await Vn(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await oC(s.map(getBase64EncodedWireTransaction))}async function DL({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await re().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(e,c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([Xi()(c),Td(re(),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 Yi()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}async function oC(e,n=10,r=1e3,s=kn()){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 ML(e,n=30,r=3e3,s=kn()){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.")}function PL(e,n){if(n.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:r}=n.members.find(i=>xd(i.pubkey)===e)??{};if(!r)throw new Error("No permissions found for the current member.");let s=Pe.has(r,De.InitiateTransaction),t=Pe.has(r,De.VoteTransaction),c=Pe.has(r,De.ExecuteTransaction);if(s&&t&&c)return {};if(!t||!c)throw new Error("Signer lacks the required Vote/Execute permissions.");let a=n.members.find(i=>i.role===2);if(!a)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:address(xd(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function EL({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await yr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return cC(n,c.transactionManagerUrl.value,e,s)}function cC(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=getBase64Decoder().decode(s)),r&&(c.authResponses=r);let i=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json();if("error"in i)throw new Error(i.error);return i.signatures.map(o=>({[e]:getBase58Encoder().encode(o)}))}}}function xd(e){return e.keyType===Ht.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function hL(e){let n=e.map(c=>ke().encode(c)),r=4+n.reduce((c,a)=>c+a.length,0),s=new Uint8Array(r),t=0;s.set(getU32Encoder().encode(e.length),t),t+=4;for(let c of n)s.set(c,t),t+=c.length;return s}function RL(e){let n=0,[r,s]=getU32Decoder().read(e,n);n=s;let t=new Array(r);for(let c=0;c<r;c++){let a=Le().read(e,n);t[c]=a[0],n=a[1];}if(n!==e.length)throw new Error(`Trailing bytes: ${e.length-n}`);return t}async function GL({payer:e,rpId:n,origins:r,authority:s}){let t=await et({rpId:n}),c=new W;await c.addSystemAccounts();let a=await xe(),{address:i,addressTree:o}=await L(s.address,a),d=[{address:i,tree:o,queue:o,type:"User"}],A=await O([],d),g=(await ie(c,A.treeInfos,A.roots,A.rootIndices,d))[0],{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),f=v(A,l);return await Jo({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:f,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function $L({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new W;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await ne(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await L(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await ue(a,t):[],o=await xe(),{address:d,addressTree:A}=await L(r.member,o),g=[{address:d,type:"User",tree:A,queue:A}],p=await O(i,g),l=null,f=null,b=i.filter(k=>k.type==="Settings"),S=i.filter(k=>k.type==="User");b.length&&(l=se(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),b,q())[0]),S.length&&(f=se(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),S,X())[0]);let I=await ie(c,p.treeInfos.slice(i.length),p.roots.slice(i.length),p.rootIndices.slice(i.length),g),{remainingAccounts:P,systemOffset:x}=c.toAccountMetas(),U=v(p,x);return await Xo({payer:n,authority:e,compressedProofArgs:U,member:Et().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:l?some({settingsMutArgs:l,transactionManager:f?some(f):none()}):none(),userAccountCreationArgs:I[0],domainConfig:s,remainingAccounts:P})}async function nO({payer:e}){let n=await cd();return tc({payer:e,globalCounter:n})}async function aO({admin:e,rpId:n,disable:r}){let s=await et({rpId:n});return lc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function mO({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new W;await t.addSystemAccounts();let{address:c,addressTree:a}=await ne(r,s),i=[{address:c,tree:a,queue:a,type:"Settings"}],o=await O([],i),d=(await ie(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:A,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Hc({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:A})}async function IO({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new W;await t.addSystemAccounts();let{address:c,addressTree:a}=await L(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await O([],i),d=(await ie(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:A,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Jc({compressedProofArgs:p,args:e,authority:n,userCreationArgs:d,remainingAccounts:A})}function iC(e,n,r,s){let t=dC(e,n),c=uC(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function dC(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 uC(e,n){return n<e.header.numSignerAccounts}async function xr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=qi(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),re()):{}),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:iC(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}}var nt=33,st=64,Kn=14,lC=2,fC=address("Secp256r1SigVerify1111111111111111111111111");function SC(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function xC(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function Ed(){return createDecoder({read:(e,n=0)=>{let r=getU8Decoder().decode(e,n);n+=1;let s=getU8Decoder().decode(e,n);n+=1;let t=[],c=xC();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(),nt).decode(e,n);n+=nt;let d=fixDecoderSize(getBytesDecoder(),st).decode(e,n);n+=st;let A=t[i].messageDataSize,g=fixDecoderSize(getBytesDecoder(),A).decode(e,n);n+=A,a.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function hd(){return createEncoder({getSizeFromValue:e=>{let n=Kn*e.offsets.length,r=e.payload.reduce((s,t)=>s+nt+st+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=SC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),nt).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),st).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function OO(){return combineCodec(hd(),Ed())}function w(e,n){let r=e.length,s=lC+r*Kn,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],A=s,g=A+nt,p=g+st;t.push({publicKeyOffset:A,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),s+=nt+st+d.length;}let c=n?.programAddress??fC,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:hd().encode(a)}}function BO(e){return {programAddress:e.programAddress,accounts:{},data:Ed().decode(e.data)}}async function Rd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let d=await Me(e),{accountMetas:A,addressLookupTableAccounts:g}=await xr({transactionMessageBytes:r,walletAddress:d,additionalSigners:a,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(w(c)),p.push(o?_i({transactionBuffer:n,payer:s.address,remainingAccounts:A,settingsKey:e}):Pi({transactionBuffer:n,payer:s.address,settings:e})),i&&p.push(fd({payer:s,tipAmount:i})),{instructions:p,addressLookupTableAccounts:g}}async function bd({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:d}){let A=me(s),g=await oe(e),p=await Me(g),[{accountMetas:l,addressLookupTableAccounts:f,transactionMessage:b},{settingsMutArgs:S,proof:I,packedAccounts:P}]=await Promise.all([xr({transactionMessageBytes:r,walletAddress:p,additionalSigners:A.filter(Q=>!(Q instanceof M)),addressesByLookupTableAddress:c}),Se(i,e,n,o,d)]);P.addPreAccounts(l);let x=A.filter(Q=>Q instanceof M),U=[];for(let Q of x){let ce=a.length,{domainConfig:ye,verifyArgs:be,signature:ve,publicKey:F,message:qe}=j(Q,ce);qe&&ve&&F&&a.push({message:qe,signature:ve,publicKey:F}),ye&&(P.addPreAccounts([{address:ye,role:AccountRole.READONLY}]),be?.__option==="Some"&&U.push({domainConfigKey:ye,verifyArgs:be.value}));}let{remainingAccounts:k,systemOffset:J}=P.toAccountMetas(),N=[];a.length>0&&N.push(w(a));let $=CC(b,l);if(i){if(!t||!S)throw new Error("Payer not found or proof args is missing.");let Q=v(I,J);N.push(Gi({secp256r1VerifyArgs:U,transactionMessage:$,settingsMutArgs:S,compressedProofArgs:Q,payer:t,remainingAccounts:k}));}else N.push(Bi({secp256r1VerifyArgs:U,settings:g,transactionMessage:$,remainingAccounts:k}));return {instructions:N,addressLookupTableAccounts:f}}function CC(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 aB({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=me(s),d=await oe(e),A=await Me(d),{packedAccounts:g,proof:p,settingsMutArgs:l}=await Se(i,e,n,false,t),f=[],b=[];for(let x of o)if(x instanceof M){let U=f.length,{domainConfig:k,verifyArgs:J,signature:N,publicKey:$,message:Q}=j(x,U);Q&&N&&$&&f.push({message:Q,signature:N,publicKey:$}),k&&(g.addPreAccounts([{address:k,role:AccountRole.READONLY}]),J?.__option==="Some"&&b.push({domainConfigKey:k,verifyArgs:J.value}));}else g.addPreAccounts([{address:x.address,role:AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:S,systemOffset:I}=g.toAccountMetas(),P=[];if(f.length>0&&P.push(w(f)),i){if(!a||!l)throw new Error("Payer not found or proof args is missing.");let x=v(p,I);P.push(na({amount:c,settingsMutArgs:l,compressedProofArgs:x,payer:a,secp256r1VerifyArgs:b,source:A,destination:r,remainingAccounts:S}));}else P.push(Xc({amount:c,secp256r1VerifyArgs:b,source:A,destination:r,settings:d,remainingAccounts:S}));return P}var Wd=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),kd=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti");async function IB({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,compressed:d=false}){let A=me(t),g=await oe(e),p=await Me(g),[l,[f],b,[S],[I]]=await Promise.all([getAssociatedTokenAccountAddress(s,p,o),getProgramDerivedAddress({seeds:[getAddressEncoder().encode(p),getAddressEncoder().encode(address(CTOKEN_PROGRAM_ID.toString())),getAddressEncoder().encode(s)],programAddress:address(CTOKEN_PROGRAM_ID.toString())}),getAssociatedTokenAccountAddress(s,r,o),getProgramDerivedAddress({seeds:[getAddressEncoder().encode(r),getAddressEncoder().encode(address(CTOKEN_PROGRAM_ID.toString())),getAddressEncoder().encode(s)],programAddress:address(CTOKEN_PROGRAM_ID.toString())}),getProgramDerivedAddress({seeds:[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(s)],programAddress:address(CTOKEN_PROGRAM_ID.toString())})]),[P,x,U]=await Promise.all([Gt(b,c),Gt(l,c),vC(d,e,n,c)]),k=!!P.value,J=!!x.value,N=J?getTokenDecoder().decode(getBase64Encoder().encode(x.value.data[0])).amount:BigInt(0),$=BigInt(0);if(N<BigInt(a)){let Ae=await Gt(f,c);$=Ae.value?BigInt(UC(new Uint8Array(getBase64Encoder().encode(Ae.value.data[0])))?.amount.toNumber()??0):BigInt(0);}let Q=k?b:void 0,ce=k?void 0:S,ye=J&&($>BigInt(0)||N+$<BigInt(a)||!!ce)||!J&&!!Q,be=!!ce,[{parsed:ve,compressedAccount:F},qe]=await Promise.all([bC(p,s,N,$,BigInt(a),c),RC(ye,I,c)]),ct=null,m=null,ae=new W;if(qe&&ae.addPreAccounts([{address:s,role:AccountRole.WRITABLE}]),U||F){await ae.addSystemAccounts();let Ae=[];if(F&&Ae.push({hash:F.hash,tree:F.treeInfo.tree,queue:F.treeInfo.queue,data:F.data,address:F.address}),U&&Ae.push(U),m=await O(Ae,[]),U){let _e=F?1:0;ct=se(ae,m.treeInfos.slice(_e),m.leafIndices.slice(_e),m.rootIndices.slice(_e),m.proveByIndices.slice(_e),Ae.slice(_e),q())[0];}}let Mr=F&&ve&&m?some({amount:ve.amount.toNumber(),merkleContext:{leafIndex:F.leafIndex,merkleTreePubkeyIndex:ae.insertOrGet(F.treeInfo.tree.toString()),queuePubkeyIndex:ae.insertOrGet(F.treeInfo.queue.toString()),proveByIndex:F.proveByIndex},rootIndex:m.rootIndices[0],version:_C(F.data?.discriminator)}):none(),B=[],Ze=[];for(let Ae of A)if(Ae instanceof M){let _e=B.length,{domainConfig:Pr,verifyArgs:Qn,signature:$n,publicKey:es,message:ts}=j(Ae,_e);ts&&$n&&es&&B.push({message:ts,signature:$n,publicKey:es}),Pr&&(ae.addPreAccounts([{address:Pr,role:AccountRole.READONLY}]),Qn?.__option==="Some"&&Ze.push({domainConfigKey:Pr,verifyArgs:Qn.value}));}else ae.addPreAccounts([{address:Ae.address,role:AccountRole.READONLY_SIGNER,signer:Ae}]);let{remainingAccounts:Yn,systemOffset:Kd}=ae.toAccountMetas(),jt=[];B.length>0&&jt.push(w(B));let Xn=v(m,Kd);if(d){if(!ct)throw new Error("Payer not found or proof args is missing.");jt.push(pa({amount:a,settingsMutArgs:ct,compressedProofArgs:Xn,payer:i,secp256r1VerifyArgs:Ze,source:p,destination:r,sourceCtokenTokenAccount:f,sourceSplTokenAccount:l,destinationCtokenTokenAccount:ce,destinationSplTokenAccount:Q,mint:s,tokenProgram:o,remainingAccounts:Yn,compressedTokenAccount:Mr,compressibleConfig:Wd,splInterfacePda:ye?I:void 0,rentSponsor:be?kd:void 0}));}else jt.push(da({amount:a,secp256r1VerifyArgs:Ze,source:p,destination:r,destinationCtokenTokenAccount:ce,destinationSplTokenAccount:Q,settings:g,mint:s,tokenProgram:o,remainingAccounts:Yn,payer:i,compressedTokenAccount:Mr,compressedProofArgs:Xn,sourceSplTokenAccount:l,sourceCtokenTokenAccount:f,compressibleConfig:Wd,splInterfacePda:ye?I:void 0,rentSponsor:be?kd:void 0}));return jt}async function RC(e,n,r){let s=false;if(e){let{value:t}=await Gt(n,r);s=!t;}return s}async function bC(e,n,r,s,t,c){if(r+s>=t)return {};let a=await ed(new PublicKey(e),{mint:new PublicKey(n)},c),i=a.items.length>0?a.items[0]:null;return i?i.compressedAccount.data?.data.length?i.compressedAccount.owner.equals(CTOKEN_PROGRAM_ID)?{compressedAccount:i.compressedAccount,parsed:i.parsed}:{}:{}:{}}async function vC(e,n,r,s){if(!e)return null;let{address:t}=await ne(n,r);return (await ue([{address:t,type:"Settings"}],s))[0]}function _C(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let n=e[7];return n===3?2:3}function UC(e){if(!e||e.length===0)return null;try{let n=0,r=new PublicKey(e.slice(n,n+32));n+=32;let s=new PublicKey(e.slice(n,n+32));n+=32;let t=new Hd(e.slice(n,n+8),"le");n+=8;let c=e[n];n+=1;let a=c?new PublicKey(e.slice(n,n+32)):null;n+=32;let i=e[n];n+=1;let o=e[n];n+=1;let d=o?e.slice(n):null;return {mint:r,owner:s,amount:t,delegate:a,state:i,tlv:d}}catch(n){return console.error("Token data parsing error:",n),null}}async function UB({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:a,proof:i,settingsMutArgs:o}=r,d=me(e),A=d.filter(P=>!(P instanceof M));a.addPreAccounts(A.map(P=>({address:P.address,role:AccountRole.READONLY_SIGNER,signer:P})));let g=d.filter(P=>P instanceof M),p=[],l=[];for(let P of g){let x=l.length,{domainConfig:U,verifyArgs:k,signature:J,publicKey:N,message:$}=j(P,x);$&&J&&N&&l.push({message:$,signature:J,publicKey:N}),U&&(a.addPreAccounts([{address:U,role:AccountRole.READONLY}]),k?.__option==="Some"&&p.push({domainConfigKey:U,verifyArgs:k.value}));}let{remainingAccounts:f,systemOffset:b}=a.toAccountMetas(),S=v(i,b),I=[];if(l.length>0&&I.push(w(l)),c){if(!o)throw new Error("Payer not found or proof args is missing.");I.push(Uo({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:o,remainingAccounts:f,secp256r1VerifyArgs:p}));}else I.push(await Mo({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:f,secp256r1VerifyArgs:p}));return I}async function NB({createUserArgs:e,payer:n}){let r=new W;await r.addSystemAccounts(),r.addPreAccounts(e.map(A=>({address:A.member.address,role:AccountRole.READONLY_SIGNER,signer:A.member})));let s=await xe(),t=await Promise.all(e.map(async A=>{let{address:g,addressTree:p}=await L(A.member.address,s);return {address:g,tree:p,queue:p,type:"User"}})),c=await O([],t),a=await ie(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),d=v(c,o);return await oc({compressedProofArgs:d,payer:n,createUserArgs:e.map((A,g)=>({member:A.member.address,role:A.role,userCreationArgs:a[g],transactionManagerUrl:A.role===2?A.transactionManagerUrl:null})),remainingAccounts:i})}async function jB({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new W;await c.addSystemAccounts();let a=[],i=[];i.push(...await ue([{address:(await L(r.address,s)).address,type:"User"}],t));let o=await xe(),{address:d,addressTree:A}=await ne(e,o);a.push({address:d,queue:A,tree:A,type:"Settings"});let g=i.length,p=await O(i,a),l=se(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),i.filter(x=>x.type==="User"),X())[0],b=(await ie(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),a)).find(x=>x.type==="Settings")??null,{remainingAccounts:S,systemOffset:I}=c.toAccountMetas(),P=v(p,I);if(!b)throw new Error("Settings creation args is missing.");return await Bo({settingsIndex:e,payer:n,initialMember:r,userReadonlyArgs:l,compressedProofArgs:P,settingsCreation:b,remainingAccounts:S})}async function tw({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:a,settingsMutArgs:i}=await Se(true,e,n,false,t);if(!i)throw new Error("Proof args is missing");let o=me(s),d=o.filter(I=>I instanceof M),A=[],g=[];for(let I of d){let P=A.length,{domainConfig:x,verifyArgs:U,signature:k,publicKey:J,message:N}=j(I,P);N&&k&&J&&A.push({message:N,signature:k,publicKey:J}),x&&(c.addPreAccounts([{address:x,role:AccountRole.READONLY}]),U?.__option==="Some"&&g.push({domainConfigKey:x,verifyArgs:U.value}));}c.addPreAccounts(o.filter(I=>"address"in I).map(I=>({address:I.address,role:AccountRole.READONLY_SIGNER,signer:I})));let{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),f=v(a,l),b=[];A.length>0&&b.push(w(A));let S=await oe(e);return b.push(Ac({settings:S,payer:r,settingsMutArgs:i,compressedProofArgs:f,secp256r1VerifyArgs:g,remainingAccounts:p})),b}async function iw({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new W;await a.addSystemAccounts();let i=await xe(),{address:o,addressTree:d}=await L(r.address,i),A=[{address:o,tree:d,queue:d,type:"User"}],g=await O([],A),p=(await ie(a,g.treeInfos,g.roots,g.rootIndices,A))[0],l=a.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:v(g,l.systemOffset),authorityCreationArgs:p};}return Dc({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function mw({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new W;await s.addSystemAccounts();let t=await ue([{address:(await L(e.address,n)).address,type:"User"}]),c=await O(t,[]),a=se(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),d=v(c,o);return bc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:a,remainingAccounts:i})}async function Mw({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:a,message:i,signature:o,publicKey:d}=j(n),A=[];i&&o&&d&&A.push({message:i,signature:o,publicKey:d});let g=await yr(n instanceof M?n:n.address,r,t),p=[];p.push({address:(await L(n instanceof M?n:n.address,r)).address,type:"User"});let l,f=null,b,S=null;g.delegatedTo.__option==="Some"&&((await On(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ne(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),f={start:p.length-1,end:p.length}):l=await oe(g.delegatedTo.value.index)),s&&((await On(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ne(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):b=await oe(s.index));let I=new W;await I.addSystemAccounts();let P=await ue(p,t),x=await O(P,[]),U=se(I,x.treeInfos.slice(0,1),x.leafIndices.slice(0,1),x.rootIndices.slice(0,1),x.proveByIndices.slice(0,1),P.slice(0,1),X())[0],k=f?some(se(I,x.treeInfos.slice(f.start,f.end),x.leafIndices.slice(f.start,f.end),x.rootIndices.slice(f.start,f.end),x.proveByIndices.slice(f.start,f.end),P.slice(f.start,f.end),q())[0]):none(),J=S?some(se(I,x.treeInfos.slice(S.start,S.end),x.leafIndices.slice(S.start,S.end),x.rootIndices.slice(S.start,S.end),x.proveByIndices.slice(S.start,S.end),P.slice(S.start,S.end),q())[0]):none(),{remainingAccounts:N,systemOffset:$}=I.toAccountMetas(),Q=v(x,$),ce=[];return A.length>0&&ce.push(w(A)),ce.push(Lc({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof M?void 0:n,oldSettings:l,oldSettingsMutArgs:k,newSettings:b,newSettingsMutArgs:J,compressedProofArgs:Q,userMutArgs:U,remainingAccounts:N})),ce}async function Vw({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await no(re(),s),o=i.data.multiWalletSettings,{packedAccounts:d,proof:A,settingsMutArgs:g}=await Se(c,e,n,false,a),{remainingAccounts:p,systemOffset:l}=d.toAccountMetas(),{domainConfig:f,verifyArgs:b,message:S,signature:I,publicKey:P}=j(r),x=[];if(S&&I&&P&&x.push(w([{message:S,signature:I,publicKey:P}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let U=v(A,l);x.push(Pa({transactionBuffer:s,domainConfig:f,closer:r instanceof M?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:b,settingsMutArgs:g,payer:t,compressedProofArgs:U,remainingAccounts:p}));}else x.push(Sa({transactionBuffer:s,domainConfig:f,closer:r instanceof M?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:b,remainingAccounts:[]}));return x}function Bd({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:A}){let{domainConfig:g,verifyArgs:p,message:l,signature:f,publicKey:b}=j(n),S=[];if(l&&f&&b&&S.push(w([{message:l,signature:f,publicKey:b}])),d){let{settingsReadonlyArgs:I,compressedProofArgs:P,remainingAccounts:x}=d;S.push(Ba({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof M?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:A},settingsReadonlyArgs:I,compressedProofArgs:P,remainingAccounts:x}));}else S.push(_a({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof M?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:A},remainingAccounts:[]}));return S}function wd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=j(e),d=[];return i&&a&&o&&d.push(w([{message:i,signature:a,publicKey:o}])),s?d.push(Za({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Ga({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,remainingAccounts:[]})),d}function Nd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?ai({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):ti({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Vd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=j(n),d=[];return o&&a&&i&&d.push(w([{message:o,signature:a,publicKey:i}])),s?d.push(Si({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(pi({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,remainingAccounts:[]})),d}async function R2({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await OC(r),a=new W,i=null,o=null,d=[];if(c.length||t){let g=await BC({packedAccounts:a,userAccounts:c,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:s});i=g.proof,o=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await wC({configActionsArgs:r,userMutArgs:d,index:e}),index:e,proof:i,settingsMutArgs:o,packedAccounts:a,compressed:t}}async function OC(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>L(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let s=await Promise.all(r.members.map(t=>L(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function BC({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let a=[];if(r){let l=(await ne(s,t)).address;a.push({address:l,type:"Settings"});}n.length&&a.push(...n);let i=a.length?await ue(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await O(i,[]),d=[],A=[];for(let l of i)l.type==="Settings"?d.push(l):l.type==="User"&&A.push(l);let g,p=[];if(r&&o&&(g=se(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),d,q())[0]),A.length&&o){let l=r?1:0;p=se(e,o.treeInfos.slice(l),o.leafIndices.slice(l),o.rootIndices.slice(l),o.proveByIndices.slice(l),A,X());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function wC({index:e,configActionsArgs:n,userMutArgs:r}){let s=[];for(let t of n)switch(t.type){case "AddMembers":{let c=[];for(let a of t.members){let i=await L(a.member,a.userAddressTreeIndex).then(o=>r.find(d=>new Hd(new Uint8Array(d.accountMeta.address)).eq(o.address)));if(!i)throw new Error("Unable to find user account");c.push(HC({permissionArgs:a.permissions,userMutArgs:i,pubkey:a.member}));}s.push({__kind:t.type,fields:[c]});break}case "RemoveMembers":{let c=await Promise.all(t.members.map(a=>L(a.member,a.userAddressTreeIndex).then(i=>{let o=r.find(d=>new Hd(new Uint8Array(d.accountMeta.address)).eq(i.address));if(!o)throw new Error("Unable to find user account");return VC({pubkey:a.member,userMutArgs:o,index:e})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(a=>NC({permissionArgs:a.permissions,pubkey:a.member}));s.push({__kind:t.type,fields:[c]});break}default:s.push({__kind:t.type,fields:[t.threshold]});}return s}function NC({pubkey:e,permissionArgs:n}){return {memberKey:rt(e),permissions:Fd(n)}}function VC({pubkey:e,userMutArgs:n,index:r}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");let s=n.data.delegatedTo.__option==="Some"?Number(n.data.delegatedTo.value.index.toString())===r:false;return {memberKey:rt(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function HC({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===1)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===2&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:rt(e),permissions:Fd(n),userReadonlyArgs:r}}function Fd(e){let n=[];return e.initiate&&n.push(De.InitiateTransaction),e.vote&&n.push(De.VoteTransaction),e.execute&&n.push(De.ExecuteTransaction),Pe.fromPermissions(n)}async function O2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:d=false,additionalVoters:A=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:l}){let f=await oe(n),b=Math.floor(Math.random()*255),S=await ad(f,t instanceof M?t:t.address,b),I=[],P=[];for(let B=0;B<s.length;B+=p){let Ze=s.subarray(B,B+p);I.push(Ze),P.push(sha256(Ze));}let x=sha256(new Uint8Array(s)),{settingsReadonlyArgs:U,settingsMutArgs:k,proof:J,packedAccounts:N}=await Se(d,n,r,false,l),{remainingAccounts:$,systemOffset:Q}=N.toAccountMetas(),ce=J&&U&&k?{settingsReadonlyArgs:U,settingsMutArgs:k,compressedProofArgs:v(J,Q),remainingAccounts:$,payer:e}:null,ye=me([t,...c?[c]:[],...A]).filter(B=>B instanceof M).map(B=>({memberKey:rt(B),messageHash:Nn(B.authResponse)})),be=Bd({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:b,payer:e,transactionBufferAddress:S,settings:f,creator:t,preauthorizeExecution:!c,bufferExtendHashes:P,compressedArgs:ce,expectedSecp256r1Signers:ye}),ve=I.map(B=>Nd({transactionMessageBytes:B,transactionBufferAddress:S,settings:f,compressed:d})),F=A.map(B=>Vd({voter:B,transactionBufferAddress:S,settings:f,compressedArgs:ce})),qe=wd({compressedArgs:ce,settings:f,executor:c,transactionBufferAddress:S}),{instructions:ct,addressLookupTableAccounts:m}=await Rd({compressed:d,settings:f,transactionMessageBytes:s,transactionBufferAddress:S,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),ae=B=>({payer:e,instructions:B,addressesByLookupTableAddress:m});return [ae(be),...ve.map(B=>ae([B])),...F.length?[ae(F.flat())]:[],ae(qe),ae(ct)]}var Cr=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 zd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Cr.compile(r,e),c=new Array,a={writable:[],readonly:[]},i=Object.entries(s??{});for(let p of i){let l=t.extractTableLookup(p);if(l!==void 0){let{addressTableLookup:f,drainedKeys:b}=l;c.push({readonlyIndexes:f.readonlyIndexes,readableIndices:f.readonlyIndexes,writableIndexes:f.writableIndexes,writableIndices:f.writableIndexes,lookupTableAddress:address(f.lookupTableAddress)}),a.writable.push(...b.writable),a.readonly.push(...b.readonly);}}let[o,d]=t.getMessageComponents(),g=new Dr(d,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function Z2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=zd({instructions:e,payer:n,recentBlockhash:u,addressesByLookupTableAddress:r});return Ji(s)}async function eN({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:d=false}){let{instructions:A,addressLookupTableAccounts:g}=await bd({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:d,cachedAccounts:i});return {payer:e,instructions:A,addressesByLookupTableAddress:g}}
|
|
2
|
+
export{mo as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,bo as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,Co as CHANGE_CONFIG_DISCRIMINATOR,Lo as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,Ko as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Zo as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,$o as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,nc as CREATE_USER_ACCOUNTS_DISCRIMINATOR,ic as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,mc as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,rs as DOMAIN_CONFIG_DISCRIMINATOR,Ic as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,Ec as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,Uc as EDIT_USER_DELEGATE_DISCRIMINATOR,is as GLOBAL_COUNTER_DISCRIMINATOR,Ht as KeyType,wc as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,zc as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,Wx as MULTI_WALLET_ERROR__ALREADY_DELEGATED,ux as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,$x as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,eI as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,px as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,gx as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,Dx as MULTI_WALLET_ERROR__EMPTY_MEMBERS,Ix as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,Ax as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,Sx as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,Fx as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,Gx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,zx as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,Ox as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,kx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,Lx as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,Rx as MULTI_WALLET_ERROR__INVALID_ACCOUNT,nI as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,Cx as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,vx as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,Hx as MULTI_WALLET_ERROR__INVALID_BUFFER,Bx as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,hx as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,Tx as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,sx as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,ax as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,nx as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,cx as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,Qx as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,Yx as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,Px as MULTI_WALLET_ERROR__INVALID_THRESHOLD,xx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,fx as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,Ex as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,bx as MULTI_WALLET_ERROR__INVALID_USER_ROLE,ix as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,qx as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,tI as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,_x as MULTI_WALLET_ERROR__MISSING_ACCOUNT,Ux as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,Zx as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,Nx as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,yx as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,lx as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,rI as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,mx as MULTI_WALLET_ERROR__PERMANENT_MEMBER,Jx as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,dx as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,ox as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,Xx as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,Mx as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,Kx as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,jx as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,Vx as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,wx as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,u as MULTI_WALLET_PROGRAM_ADDRESS,ex as MultiWalletAccount,tx as MultiWalletInstruction,ea as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Zc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,De as Permission,Pe as Permissions,Js as SETTINGS_DISCRIMINATOR,Ee as Secp256r1Key,M as SignedSecp256r1Key,Aa as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,aa as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Ca as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,Ta as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,ka as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,Ra as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,eo as TRANSACTION_BUFFER_DISCRIMINATOR,ja as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Va as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,si as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,Qa as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Ti as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,ui as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,Ri as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,Ci as TRANSACTION_EXECUTE_DISCRIMINATOR,Vi as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,ki as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,Ye as UserRole,co as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,vW as addWhitelistedAddressTrees,Re as base64URLStringToBuffer,oL as bufferToBase64URLString,UB as changeConfig,Vw as closeTransactionBuffer,LD as configAction,xd as convertMemberKeyToString,Qk as convertPubkeyCompressedToCose,Xk as convertPubkeyCoseToCompressed,rL as createClientAuthorizationCompleteRequestChallenge,tL as createClientAuthorizationStartRequestChallenge,GL as createDomainConfig,$L as createDomainUserAccounts,nO as createGlobalCounter,nL as createMessageChallenge,Bd as createTransactionBuffer,sL as createTransactionChallenge,cC as createTransactionManagerSigner,NB as createUserAccounts,jB as createWallet,ss as decodeDomainConfig,us as decodeGlobalCounter,Zs as decodeSettings,ro as decodeTransactionBuffer,io as decodeWhitelistedAddressTree,tw as decompressSettingsAccount,RL as deserializeConfigActions,aO as disableDomainConfig,iw as editDomainConfig,mw as editTransactionManagerUrl,Mw as editUserDelegate,Rd as executeTransaction,wd as executeTransactionBuffer,bd as executeTransactionSync,Nd as extendTransactionBuffer,jC as fetchAllDomainConfig,$C as fetchAllGlobalCounter,ou as fetchAllMaybeDomainConfig,Iu as fetchAllMaybeGlobalCounter,qp as fetchAllMaybeSettings,mm as fetchAllMaybeTransactionBuffer,km as fetchAllMaybeWhitelistedAddressTree,RE as fetchAllSettings,kE as fetchAllTransactionBuffer,NE as fetchAllWhitelistedAddressTree,os as fetchDomainConfig,QC as fetchGlobalCounter,su as fetchMaybeDomainConfig,xu as fetchMaybeGlobalCounter,on as fetchMaybeSettings,fI as fetchMaybeSettingsAccountData,pm as fetchMaybeTransactionBuffer,lI as fetchMaybeUserAccountData,Wm as fetchMaybeWhitelistedAddressTree,hE as fetchSettings,On as fetchSettingsAccountData,no as fetchTransactionBuffer,yr as fetchUserAccountData,uo as fetchWhitelistedAddressTree,sD as getAddMemberArgsCodec,hr as getAddMemberArgsDecoder,Er as getAddMemberArgsEncoder,rh as getAddWhitelistedAddressTreesDiscriminatorBytes,sh as getAddWhitelistedAddressTreesInstruction,To as getAddWhitelistedAddressTreesInstructionAsync,nh as getAddWhitelistedAddressTreesInstructionDataCodec,yo as getAddWhitelistedAddressTreesInstructionDataDecoder,mn as getAddWhitelistedAddressTreesInstructionDataEncoder,Ch as getChangeConfigCompressedDiscriminatorBytes,Uo as getChangeConfigCompressedInstruction,Dh as getChangeConfigCompressedInstructionDataCodec,_o as getChangeConfigCompressedInstructionDataDecoder,vo as getChangeConfigCompressedInstructionDataEncoder,gh as getChangeConfigDiscriminatorBytes,mh as getChangeConfigInstruction,Mo as getChangeConfigInstructionAsync,ph as getChangeConfigInstructionDataCodec,Do as getChangeConfigInstructionDataDecoder,yn as getChangeConfigInstructionDataEncoder,wn as getClientAndDeviceHash,aD as getCompiledInstructionCodec,br as getCompiledInstructionDecoder,Rr as getCompiledInstructionEncoder,AD as getCompressedAccountMetaCodec,ut as getCompressedAccountMetaDecoder,dt as getCompressedAccountMetaEncoder,yD as getCompressedAccountMetaReadOnlyCodec,mt as getCompressedAccountMetaReadOnlyDecoder,pt as getCompressedAccountMetaReadOnlyEncoder,fD as getCompressedProofCodec,Lr as getCompressedProofDecoder,kr as getCompressedProofEncoder,ne as getCompressedSettingsAddressFromIndex,CD as getCompressedSettingsCodec,ED as getCompressedSettingsDataCodec,lt as getCompressedSettingsDataDecoder,Tt as getCompressedSettingsDataEncoder,q as getCompressedSettingsDecoder,yt as getCompressedSettingsEncoder,vD as getCompressedTokenArgsCodec,It as getCompressedTokenArgsDecoder,xt as getCompressedTokenArgsEncoder,Xi as getComputeBudgetEstimate,kD as getConfigActionCodec,Le as getConfigActionDecoder,ke as getConfigActionEncoder,_h as getCreateCompressedWalletDiscriminatorBytes,Wh as getCreateCompressedWalletInstruction,Bo as getCreateCompressedWalletInstructionAsync,Uh as getCreateCompressedWalletInstructionDataCodec,Oo as getCreateCompressedWalletInstructionDataDecoder,Tn as getCreateCompressedWalletInstructionDataEncoder,Hh as getCreateDomainConfigDiscriminatorBytes,Gh as getCreateDomainConfigInstruction,Jo as getCreateDomainConfigInstructionAsync,Fh as getCreateDomainConfigInstructionDataCodec,jo as getCreateDomainConfigInstructionDataDecoder,fn as getCreateDomainConfigInstructionDataEncoder,Xh as getCreateDomainUserAccountDiscriminatorBytes,$h as getCreateDomainUserAccountInstruction,Xo as getCreateDomainUserAccountInstructionAsync,Qh as getCreateDomainUserAccountInstructionDataCodec,Yo as getCreateDomainUserAccountInstructionDataDecoder,xn as getCreateDomainUserAccountInstructionDataEncoder,cR as getCreateGlobalCounterDiscriminatorBytes,iR as getCreateGlobalCounterInstruction,tc as getCreateGlobalCounterInstructionAsync,aR as getCreateGlobalCounterInstructionDataCodec,ec as getCreateGlobalCounterInstructionDataDecoder,Cn as getCreateGlobalCounterInstructionDataEncoder,VD as getCreateUserAccountArgsCodec,Kr as getCreateUserAccountArgsDecoder,zr as getCreateUserAccountArgsEncoder,TR as getCreateUserAccountsDiscriminatorBytes,fR as getCreateUserAccountsInstruction,oc as getCreateUserAccountsInstructionAsync,lR as getCreateUserAccountsInstructionDataCodec,sc as getCreateUserAccountsInstructionDataDecoder,Mn as getCreateUserAccountsInstructionDataEncoder,ER as getDecompressSettingsAccountDiscriminatorBytes,Ac as getDecompressSettingsAccountInstruction,hR as getDecompressSettingsAccountInstructionDataCodec,uc as getDecompressSettingsAccountInstructionDataDecoder,dc as getDecompressSettingsAccountInstructionDataEncoder,kR as getDisableDomainConfigDiscriminatorBytes,lc as getDisableDomainConfigInstruction,LR as getDisableDomainConfigInstructionDataCodec,Tc as getDisableDomainConfigInstructionDataDecoder,yc as getDisableDomainConfigInstructionDataEncoder,et as getDomainConfigAddress,KC as getDomainConfigCodec,ns as getDomainConfigDecoder,zC as getDomainConfigDiscriminatorBytes,nu as getDomainConfigEncoder,JC as getDomainConfigSize,GR as getEditDomainConfigDiscriminatorBytes,Dc as getEditDomainConfigInstruction,KR as getEditDomainConfigInstructionAsync,zR as getEditDomainConfigInstructionDataCodec,Cc as getEditDomainConfigInstructionDataDecoder,En as getEditDomainConfigInstructionDataEncoder,zD as getEditMemberArgsCodec,Hr as getEditMemberArgsDecoder,Vr as getEditMemberArgsEncoder,$R as getEditTransactionManagerUrlDiscriminatorBytes,bc as getEditTransactionManagerUrlInstruction,eb as getEditTransactionManagerUrlInstructionDataCodec,Rc as getEditTransactionManagerUrlInstructionDataDecoder,hc as getEditTransactionManagerUrlInstructionDataEncoder,ib as getEditUserDelegateDiscriminatorBytes,Lc as getEditUserDelegateInstruction,db as getEditUserDelegateInstructionDataCodec,kc as getEditUserDelegateInstructionDataDecoder,Wc as getEditUserDelegateInstructionDataEncoder,qD as getExpectedSecp256r1SignersCodec,Dt as getExpectedSecp256r1SignersDecoder,Ct as getExpectedSecp256r1SignersEncoder,cd as getGlobalCounterAddress,XC as getGlobalCounterCodec,ds as getGlobalCounterDecoder,YC as getGlobalCounterDiscriminatorBytes,Su as getGlobalCounterEncoder,eD as getGlobalCounterSize,kn as getJitoTipsConfig,kk as getLightCpiSigner,Qe as getLightProtocolRpc,QD as getLinkWalletArgsCodec,Jr as getLinkWalletArgsDecoder,jr as getLinkWalletArgsEncoder,rM as getMemberCodec,St as getMemberDecoder,ft as getMemberEncoder,oM as getMemberKeyCodec,te as getMemberKeyDecoder,ee as getMemberKeyEncoder,lb as getMigrateCompressedSettingsDiscriminatorBytes,Hc as getMigrateCompressedSettingsInstruction,fb as getMigrateCompressedSettingsInstructionDataCodec,Vc as getMigrateCompressedSettingsInstructionDataDecoder,Nc as getMigrateCompressedSettingsInstructionDataEncoder,Eb as getMigrateCompressedUsersDiscriminatorBytes,Jc as getMigrateCompressedUsersInstruction,hb as getMigrateCompressedUsersInstructionDataCodec,jc as getMigrateCompressedUsersInstructionDataDecoder,Kc as getMigrateCompressedUsersInstructionDataEncoder,fW as getMultiWalletErrorMessage,Kb as getNativeTransferIntentCompressedDiscriminatorBytes,na as getNativeTransferIntentCompressedInstruction,jb as getNativeTransferIntentCompressedInstructionDataCodec,ra as getNativeTransferIntentCompressedInstructionDataDecoder,ta as getNativeTransferIntentCompressedInstructionDataEncoder,Lb as getNativeTransferIntentDiscriminatorBytes,Xc as getNativeTransferIntentInstruction,Bb as getNativeTransferIntentInstructionAsync,Ob as getNativeTransferIntentInstructionDataCodec,Yc as getNativeTransferIntentInstructionDataDecoder,hn as getNativeTransferIntentInstructionDataEncoder,dM as getNewAuthorityArgsCodec,Xr as getNewAuthorityArgsDecoder,Yr as getNewAuthorityArgsEncoder,eL as getOriginIndex,gM as getPackedAddressTreeInfoCodec,Pt as getPackedAddressTreeInfoDecoder,Mt as getPackedAddressTreeInfoEncoder,yM as getPackedMerkleContextCodec,Br as getPackedMerkleContextDecoder,Or as getPackedMerkleContextEncoder,fM as getPackedStateTreeInfoCodec,gt as getPackedStateTreeInfoDecoder,At as getPackedStateTreeInfoEncoder,IM as getPermissionsCodec,We as getPermissionsDecoder,Ue as getPermissionsEncoder,PM as getProofArgsCodec,D as getProofArgsDecoder,C as getProofArgsEncoder,bM as getRemoveMemberArgsCodec,Gr as getRemoveMemberArgsDecoder,Fr as getRemoveMemberArgsEncoder,Nn as getSecp256r1MessageHash,UM as getSecp256r1PubkeyCodec,Et as getSecp256r1PubkeyDecoder,en as getSecp256r1PubkeyEncoder,xC as getSecp256r1SignatureOffsetsDataDecoder,SC as getSecp256r1SignatureOffsetsDataEncoder,LM as getSecp256r1VerifyArgsCodec,H as getSecp256r1VerifyArgsDecoder,V as getSecp256r1VerifyArgsEncoder,NM as getSecp256r1VerifyArgsWithDomainAddressCodec,Y as getSecp256r1VerifyArgsWithDomainAddressDecoder,Z as getSecp256r1VerifyArgsWithDomainAddressEncoder,w as getSecp256r1VerifyInstruction,OO as getSecp256r1VerifyInstructionDataCodec,Ed as getSecp256r1VerifyInstructionDataDecoder,hd as getSecp256r1VerifyInstructionDataEncoder,Yi as getSendAndConfirmTransaction,EE as getSettingsCodec,GM as getSettingsCreationArgsCodec,Rt as getSettingsCreationArgsDecoder,ht as getSettingsCreationArgsEncoder,qs as getSettingsDecoder,PE as getSettingsDiscriminatorBytes,Jp as getSettingsEncoder,oe as getSettingsFromIndex,jM as getSettingsIndexWithAddressCodec,vt as getSettingsIndexWithAddressDecoder,bt as getSettingsIndexWithAddressEncoder,YM as getSettingsMutArgsCodec,z as getSettingsMutArgsDecoder,G as getSettingsMutArgsEncoder,eP as getSettingsReadonlyArgsCodec,Ut as getSettingsReadonlyArgsDecoder,_t as getSettingsReadonlyArgsEncoder,$k as getSignedSecp256r1Key,EL as getSignedTransactionManager,re as getSolanaRpc,Zi as getSolanaRpcEndpoint,uv as getTokenTransferIntentCompressedDiscriminatorBytes,pa as getTokenTransferIntentCompressedInstruction,gv as getTokenTransferIntentCompressedInstructionAsync,Av as getTokenTransferIntentCompressedInstructionDataCodec,ga as getTokenTransferIntentCompressedInstructionDataDecoder,bn as getTokenTransferIntentCompressedInstructionDataEncoder,ev as getTokenTransferIntentDiscriminatorBytes,da as getTokenTransferIntentInstruction,rv as getTokenTransferIntentInstructionAsync,tv as getTokenTransferIntentInstructionDataCodec,ia as getTokenTransferIntentInstructionDataDecoder,Rn as getTokenTransferIntentInstructionDataEncoder,ad as getTransactionBufferAddress,bv as getTransactionBufferCloseCompressedDiscriminatorBytes,Pa as getTransactionBufferCloseCompressedInstruction,vv as getTransactionBufferCloseCompressedInstructionDataCodec,Ma as getTransactionBufferCloseCompressedInstructionDataDecoder,Da as getTransactionBufferCloseCompressedInstructionDataEncoder,xv as getTransactionBufferCloseDiscriminatorBytes,Sa as getTransactionBufferCloseInstruction,Iv as getTransactionBufferCloseInstructionDataCodec,fa as getTransactionBufferCloseInstructionDataDecoder,la as getTransactionBufferCloseInstructionDataEncoder,WE as getTransactionBufferCodec,sP as getTransactionBufferCreateArgsCodec,kt as getTransactionBufferCreateArgsDecoder,Wt as getTransactionBufferCreateArgsEncoder,Jv as getTransactionBufferCreateCompressedDiscriminatorBytes,Ba as getTransactionBufferCreateCompressedInstruction,qv as getTransactionBufferCreateCompressedInstructionDataCodec,Oa as getTransactionBufferCreateCompressedInstructionDataDecoder,La as getTransactionBufferCreateCompressedInstructionDataEncoder,wv as getTransactionBufferCreateDiscriminatorBytes,_a as getTransactionBufferCreateInstruction,Nv as getTransactionBufferCreateInstructionDataCodec,va as getTransactionBufferCreateInstructionDataDecoder,ba as getTransactionBufferCreateInstructionDataEncoder,to as getTransactionBufferDecoder,UE as getTransactionBufferDiscriminatorBytes,gm as getTransactionBufferEncoder,A_ as getTransactionBufferExecuteCompressedDiscriminatorBytes,Za as getTransactionBufferExecuteCompressedInstruction,g_ as getTransactionBufferExecuteCompressedInstructionDataCodec,qa as getTransactionBufferExecuteCompressedInstructionDataDecoder,Ja as getTransactionBufferExecuteCompressedInstructionDataEncoder,r_ as getTransactionBufferExecuteDiscriminatorBytes,Ga as getTransactionBufferExecuteInstruction,n_ as getTransactionBufferExecuteInstructionDataCodec,Fa as getTransactionBufferExecuteInstructionDataDecoder,Ha as getTransactionBufferExecuteInstructionDataEncoder,h_ as getTransactionBufferExtendCompressedDiscriminatorBytes,ai as getTransactionBufferExtendCompressedInstruction,R_ as getTransactionBufferExtendCompressedInstructionDataCodec,ci as getTransactionBufferExtendCompressedInstructionDataDecoder,oi as getTransactionBufferExtendCompressedInstructionDataEncoder,S_ as getTransactionBufferExtendDiscriminatorBytes,ti as getTransactionBufferExtendInstruction,x_ as getTransactionBufferExtendInstructionDataCodec,ei as getTransactionBufferExtendInstructionDataDecoder,$a as getTransactionBufferExtendInstructionDataEncoder,K_ as getTransactionBufferVoteCompressedDiscriminatorBytes,Si as getTransactionBufferVoteCompressedInstruction,j_ as getTransactionBufferVoteCompressedInstructionDataCodec,fi as getTransactionBufferVoteCompressedInstructionDataDecoder,li as getTransactionBufferVoteCompressedInstructionDataEncoder,O_ as getTransactionBufferVoteDiscriminatorBytes,pi as getTransactionBufferVoteInstruction,B_ as getTransactionBufferVoteInstructionDataCodec,gi as getTransactionBufferVoteInstructionDataDecoder,Ai as getTransactionBufferVoteInstructionDataEncoder,aU as getTransactionExecuteCompressedDiscriminatorBytes,_i as getTransactionExecuteCompressedInstruction,iU as getTransactionExecuteCompressedInstructionDataCodec,vi as getTransactionExecuteCompressedInstructionDataDecoder,bi as getTransactionExecuteCompressedInstructionDataEncoder,$_ as getTransactionExecuteDiscriminatorBytes,Pi as getTransactionExecuteInstruction,eU as getTransactionExecuteInstructionDataCodec,Mi as getTransactionExecuteInstructionDataDecoder,Di as getTransactionExecuteInstructionDataEncoder,PU as getTransactionExecuteSyncCompressedDiscriminatorBytes,Gi as getTransactionExecuteSyncCompressedInstruction,EU as getTransactionExecuteSyncCompressedInstructionDataCodec,Fi as getTransactionExecuteSyncCompressedInstructionDataDecoder,Hi as getTransactionExecuteSyncCompressedInstructionDataEncoder,TU as getTransactionExecuteSyncDiscriminatorBytes,Bi as getTransactionExecuteSyncInstruction,lU as getTransactionExecuteSyncInstructionDataCodec,Oi as getTransactionExecuteSyncInstructionDataDecoder,Li as getTransactionExecuteSyncInstructionDataEncoder,AP as getTransactionMessageAddressTableLookupCodec,rn as getTransactionMessageAddressTableLookupDecoder,tn as getTransactionMessageAddressTableLookupEncoder,iP as getTransactionMessageCodec,Ot as getTransactionMessageDecoder,Lt as getTransactionMessageEncoder,L as getUserAccountAddress,yP as getUserCodec,SP as getUserCreationArgsCodec,le as getUserCreationArgsDecoder,Te as getUserCreationArgsEncoder,X as getUserDecoder,we as getUserEncoder,DP as getUserMutArgsCodec,Ve as getUserMutArgsDecoder,Ne as getUserMutArgsEncoder,hP as getUserReadOnlyArgsCodec,Ce as getUserReadOnlyArgsDecoder,Ie as getUserReadOnlyArgsEncoder,_P as getUserReadOnlyOrMutateArgsCodec,$r as getUserReadOnlyOrMutateArgsDecoder,Qr as getUserReadOnlyOrMutateArgsEncoder,OP as getUserRoleCodec,Be as getUserRoleDecoder,Oe as getUserRoleEncoder,Wk as getWalletAddressFromIndex,Me as getWalletAddressFromSettings,wE as getWhitelistedAddressTreeCodec,ao as getWhitelistedAddressTreeDecoder,BE as getWhitelistedAddressTreeDiscriminatorBytes,Um as getWhitelistedAddressTreeEncoder,Bn as getWhitelistedAddressTreeFromIndex,Mk as getWhitelistedAddressTreeIndexFromAddress,td as getWhitelistedAddressTreesAddress,AW as identifyMultiWalletAccount,gW as identifyMultiWalletInstruction,tk as initialize,OD as isConfigAction,SW as isMultiWalletError,WP as isUserReadOnlyOrMutateArgs,mO as migrateSettings,IO as migrateUsers,aB as nativeTransferIntent,oh as parseAddWhitelistedAddressTreesInstruction,Mh as parseChangeConfigCompressedInstruction,yh as parseChangeConfigInstruction,kh as parseCreateCompressedWalletInstruction,zh as parseCreateDomainConfigInstruction,eR as parseCreateDomainUserAccountInstruction,dR as parseCreateGlobalCounterInstruction,SR as parseCreateUserAccountsInstruction,RR as parseDecompressSettingsAccountInstruction,OR as parseDisableDomainConfigInstruction,jR as parseEditDomainConfigInstruction,tb as parseEditTransactionManagerUrlInstruction,ub as parseEditUserDelegateInstruction,Sb as parseMigrateCompressedSettingsInstruction,Rb as parseMigrateCompressedUsersInstruction,Jb as parseNativeTransferIntentCompressedInstruction,wb as parseNativeTransferIntentInstruction,BO as parseSecp256r1VerifyInstruction,pv as parseTokenTransferIntentCompressedInstruction,nv as parseTokenTransferIntentInstruction,_v as parseTransactionBufferCloseCompressedInstruction,Cv as parseTransactionBufferCloseInstruction,Zv as parseTransactionBufferCreateCompressedInstruction,Vv as parseTransactionBufferCreateInstruction,p_ as parseTransactionBufferExecuteCompressedInstruction,s_ as parseTransactionBufferExecuteInstruction,b_ as parseTransactionBufferExtendCompressedInstruction,I_ as parseTransactionBufferExtendInstruction,J_ as parseTransactionBufferVoteCompressedInstruction,w_ as parseTransactionBufferVoteInstruction,dU as parseTransactionExecuteCompressedInstruction,tU as parseTransactionExecuteInstruction,hU as parseTransactionExecuteSyncCompressedInstruction,fU as parseTransactionExecuteSyncInstruction,ML as pollJitoBundleConfirmation,R2 as prepareChangeConfigArgs,O2 as prepareTransactionBundle,Z2 as prepareTransactionMessage,eN as prepareTransactionSync,PL as retrieveTransactionManager,oC as sendJitoBundle,hL as serializeConfigActions,CL as signAndSendBundledTransactions,DL as signAndSendTransaction,IB as tokenTransferIntent,ek as uninitialize,UP as userReadOnlyOrMutateArgs,qi as vaultTransactionMessageDeserialize,Ji as vaultTransactionMessageSerialize,Vd as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|