@revibase/core 0.0.44 → 0.0.46
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 +151 -89
- package/dist/index.d.ts +151 -89
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getU64Encoder,getU64Decoder,getOptionEncoder,getOptionDecoder,getArrayEncoder,getArrayDecoder,getU16Encoder,getBooleanEncoder,getU16Decoder,getBooleanDecoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getUnitEncoder,getUnitDecoder,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,encodeBN254toBase58,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import f from'zod';import {estimateComputeUnitLimitFactory,getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTokenDecoder,AccountState,getTransferSolInstruction}from'gill/programs';import {p256}from'@noble/curves/nist.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {equalBytes}from'@noble/curves/utils.js';var $r=1644,Ar=2e5,fo=1.1,So=30,xo=3e3,ke=3,Le=500,gr=2,pr=3e4,en=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Io="https://mainnet.block-engine.jito.wtf/api/v1",Co="https://bundles.jito.wtf/api/v1/bundles/tip_floor",Eo="landed_tips_75th_percentile",Do=255,Po=400,Mo=429,tn=500;var Ee=class extends Error{constructor(r,s,t){super(r);this.code=s;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},Oe=class extends Ee{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},ne=class extends Ee{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},z=class extends Ee{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},De=class extends Ee{constructor(r,s,t){super(r,"NETWORK_ERROR",{statusCode:s,url:t});this.statusCode=s;this.url=t;}},ho=class extends Ee{constructor(r,s,t){super(r,"TRANSACTION_ERROR",{signature:s,logs:t});this.signature=s;this.logs=t;}},ye=class extends Ee{constructor(r,s,t){super(r,"BUNDLE_ERROR",{bundleId:s,attempt:t});this.bundleId=s;this.attempt=t;}},mr=class extends Ee{constructor(r,s,t){super(`Operation "${r}" failed after ${s} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=s;this.lastError=t;}},yr=class extends Ee{constructor(r,s,t){super(r,"PERMISSION_ERROR",{required:s,actual:t});this.required=s;this.actual=t;}};var Ro=new Uint8Array([201,232,212,229,59,241,106,197]);function VM(){return fixEncoderSize(getBytesEncoder(),8).encode(Ro)}function Tg(){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:Ro}))}function bo(){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 HM(){return combineCodec(Tg(),bo())}function _o(e){return decodeAccount(e,bo())}async function vo(e,n,r){let s=await lg(e,n,r);return assertAccountExists(s),s}async function lg(e,n,r){let s=await fetchEncodedAccount(e,n,r);return _o(s)}async function FM(e,n,r){let s=await fg(e,n,r);return assertAccountsExist(s),s}async function fg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>_o(t))}function GM(){return 846}var ko=new Uint8Array([42,206,176,58,175,129,130,233]);function jM(){return fixEncoderSize(getBytesEncoder(),8).encode(ko)}function Ug(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:ko}))}function Lo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function JM(){return combineCodec(Ug(),Lo())}function Oo(e){return decodeAccount(e,Lo())}async function qM(e,n,r){let s=await Wg(e,n,r);return assertAccountExists(s),s}async function Wg(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Oo(s)}async function YM(e,n,r){let s=await kg(e,n,r);return assertAccountsExist(s),s}async function kg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Oo(t))}function ZM(){return 24}function rn(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function nn(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function $M(){return combineCodec(rn(),nn())}function sn(){return getStructEncoder([["memberKey",se()],["permissions",He()],["userReadonlyArgs",Re()]])}function on(){return getStructDecoder([["memberKey",oe()],["permissions",Fe()],["userReadonlyArgs",be()]])}function nh(){return combineCodec(sn(),on())}function cn(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function an(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function ch(){return combineCodec(cn(),an())}function Ct(){return getStructEncoder([["treeInfo",Dt()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function Et(){return getStructDecoder([["treeInfo",Pt()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function uh(){return combineCodec(Ct(),Et())}function Mt(){return getStructEncoder([["treeInfo",Dt()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function ht(){return getStructDecoder([["treeInfo",Pt()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function mh(){return combineCodec(Mt(),ht())}function dn(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function un(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function lh(){return combineCodec(dn(),un())}function yn(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function Tn(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function xh(){return combineCodec(yn(),Tn())}function Rt(){return getStructEncoder([["data",getOptionEncoder(bt())]])}function Z(){return getStructDecoder([["data",getOptionDecoder(_t())]])}function Dh(){return combineCodec(Rt(),Z())}function bt(){return getStructEncoder([["threshold",getU8Encoder()],["bump",getU8Encoder()],["index",getU128Encoder()],["multiWalletBump",getU8Encoder()],["members",getArrayEncoder(vt())],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function _t(){return getStructDecoder([["threshold",getU8Decoder()],["bump",getU8Decoder()],["index",getU128Decoder()],["multiWalletBump",getU8Decoder()],["members",getArrayDecoder(Ut())],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function Rh(){return combineCodec(bt(),_t())}function Wt(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",fn()],["tlv",getOptionEncoder(getArrayEncoder(ln()))],["hasDelegate",getBooleanEncoder()],["isFrozen",getBooleanEncoder()]])}function kt(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",Sn()],["tlv",getOptionDecoder(getArrayDecoder(Lt()))],["hasDelegate",getBooleanDecoder()],["isFrozen",getBooleanDecoder()]])}function Uh(){return combineCodec(Wt(),kt())}function Cn(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",Dn()]])}function En(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",Pn()]])}function Oh(){return combineCodec(Cn(),En())}function Dn(){return getStructEncoder([["configAccountVersion",getU16Encoder()],["compressToPubkey",getU8Encoder()],["accountVersion",getU8Encoder()],["lamportsPerWrite",getU32Encoder()],["compressionAuthority",fixEncoderSize(getBytesEncoder(),32)],["rentSponsor",fixEncoderSize(getBytesEncoder(),32)],["lastClaimedSlot",getU64Encoder()],["rentExemptionPaid",getU32Encoder()],["reserved",getU32Encoder()],["rentConfig",Rn()]])}function Pn(){return getStructDecoder([["configAccountVersion",getU16Decoder()],["compressToPubkey",getU8Decoder()],["accountVersion",getU8Decoder()],["lamportsPerWrite",getU32Decoder()],["compressionAuthority",fixDecoderSize(getBytesDecoder(),32)],["rentSponsor",fixDecoderSize(getBytesDecoder(),32)],["lastClaimedSlot",getU64Decoder()],["rentExemptionPaid",getU32Decoder()],["reserved",getU32Decoder()],["rentConfig",bn()]])}function Vh(){return combineCodec(Dn(),Pn())}function Ge(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Un())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(sn())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(kn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function ze(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Wn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(on())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Ln())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function zh(){return combineCodec(Ge(),ze())}function Kh(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function jh(e,n){return n.__kind===e}function On(){return getStructEncoder([["member",getAddressEncoder()],["role",Ke()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",xe()]])}function Bn(){return getStructDecoder([["member",getAddressDecoder()],["role",je()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",Ie()]])}function Zh(){return combineCodec(On(),Bn())}function Un(){return getStructEncoder([["memberKey",se()],["permissions",He()]])}function Wn(){return getStructDecoder([["memberKey",oe()],["permissions",Fe()]])}function eR(){return combineCodec(Un(),Wn())}function Ot(){return getStructEncoder([["memberKey",se()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function Bt(){return getStructDecoder([["memberKey",oe()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function sR(){return combineCodec(Ot(),Bt())}function ln(){return getDiscriminatedUnionEncoder([["Placeholder0",getUnitEncoder()],["Placeholder1",getUnitEncoder()],["Placeholder2",getUnitEncoder()],["Placeholder3",getUnitEncoder()],["Placeholder4",getUnitEncoder()],["Placeholder5",getUnitEncoder()],["Placeholder6",getUnitEncoder()],["Placeholder7",getUnitEncoder()],["Placeholder8",getUnitEncoder()],["Placeholder9",getUnitEncoder()],["Placeholder10",getUnitEncoder()],["Placeholder11",getUnitEncoder()],["Placeholder12",getUnitEncoder()],["Placeholder13",getUnitEncoder()],["Placeholder14",getUnitEncoder()],["Placeholder15",getUnitEncoder()],["Placeholder16",getUnitEncoder()],["Placeholder17",getUnitEncoder()],["Placeholder18",getUnitEncoder()],["TokenMetadata",getStructEncoder([["fields",getTupleEncoder([Fn()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([Nn()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([Vn()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([zn()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([jn()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([dn()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([Cn()])]])]])}function Lt(){return getDiscriminatedUnionDecoder([["Placeholder0",getUnitDecoder()],["Placeholder1",getUnitDecoder()],["Placeholder2",getUnitDecoder()],["Placeholder3",getUnitDecoder()],["Placeholder4",getUnitDecoder()],["Placeholder5",getUnitDecoder()],["Placeholder6",getUnitDecoder()],["Placeholder7",getUnitDecoder()],["Placeholder8",getUnitDecoder()],["Placeholder9",getUnitDecoder()],["Placeholder10",getUnitDecoder()],["Placeholder11",getUnitDecoder()],["Placeholder12",getUnitDecoder()],["Placeholder13",getUnitDecoder()],["Placeholder14",getUnitDecoder()],["Placeholder15",getUnitDecoder()],["Placeholder16",getUnitDecoder()],["Placeholder17",getUnitDecoder()],["Placeholder18",getUnitDecoder()],["TokenMetadata",getStructDecoder([["fields",getTupleDecoder([Gn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([wn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([Hn()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([Kn()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([Jn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([un()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([En()])]])]])}function iR(){return combineCodec(ln(),Lt())}function dR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function uR(e,n){return n.__kind===e}function qn(){return getStructEncoder([["settingsMutArgs",K()],["transactionManager",getOptionEncoder(Re())]])}function Yn(){return getStructDecoder([["settingsMutArgs",j()],["transactionManager",getOptionDecoder(be())]])}function mR(){return combineCodec(qn(),Yn())}function vt(){return getStructEncoder([["pubkey",se()],["permissions",He()],["role",getU8Encoder()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function Ut(){return getStructDecoder([["pubkey",oe()],["permissions",Fe()],["role",getU8Decoder()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function fR(){return combineCodec(vt(),Ut())}function se(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function oe(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function IR(){return combineCodec(se(),oe())}function Qn(){return getStructEncoder([["authorityCreationArgs",xe()],["compressedProofArgs",E()]])}function $n(){return getStructDecoder([["authorityCreationArgs",Ie()],["compressedProofArgs",D()]])}function PR(){return combineCodec(Qn(),$n())}function Nt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function wt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function RR(){return combineCodec(Nt(),wt())}function fn(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function Sn(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function vR(){return combineCodec(fn(),Sn())}function Dt(){return getStructEncoder([["rootIndex",getU16Encoder()],["proveByIndex",getBooleanEncoder()],["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()]])}function Pt(){return getStructDecoder([["rootIndex",getU16Decoder()],["proveByIndex",getBooleanDecoder()],["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()]])}function kR(){return combineCodec(Dt(),Pt())}function Nn(){return getStructEncoder([])}function wn(){return getStructDecoder([])}function BR(){return combineCodec(Nn(),wn())}function Vn(){return getStructEncoder([])}function Hn(){return getStructDecoder([])}function VR(){return combineCodec(Vn(),Hn())}function He(){return getStructEncoder([["mask",getU8Encoder()]])}function Fe(){return getStructDecoder([["mask",getU8Decoder()]])}function GR(){return combineCodec(He(),Fe())}function E(){return getStructEncoder([["proof",getOptionEncoder(yn())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function D(){return getStructDecoder([["proof",getOptionDecoder(Tn())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function JR(){return combineCodec(E(),D())}function kn(){return getStructEncoder([["memberKey",se()],["userArgs",es()]])}function Ln(){return getStructDecoder([["memberKey",oe()],["userArgs",ts()]])}function XR(){return combineCodec(kn(),Ln())}function Rn(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function bn(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function eb(){return combineCodec(Rn(),bn())}function ss(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Vt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function nb(){return combineCodec(ss(),Vt())}function H(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function F(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function cb(){return combineCodec(H(),F())}function X(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",H()]])}function Q(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",F()]])}function ub(){return combineCodec(X(),Q())}function Ht(){return getStructEncoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",getU8Encoder()]])}function Ft(){return getStructDecoder([["addressTreeInfo",wt()],["outputStateTreeIndex",getU8Decoder()]])}function mb(){return combineCodec(Ht(),Ft())}function Gt(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function zt(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function lb(){return combineCodec(Gt(),zt())}function K(){return getStructEncoder([["accountMeta",Ct()],["data",Rt()]])}function j(){return getStructDecoder([["accountMeta",Et()],["data",Z()]])}function Ib(){return combineCodec(K(),j())}function Kt(){return getStructEncoder([["accountMeta",Mt()],["data",Rt()]])}function jt(){return getStructDecoder([["accountMeta",ht()],["data",Z()]])}function Pb(){return combineCodec(Kt(),jt())}function Jt(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function qt(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function Rb(){return combineCodec(Jt(),qt())}function Fn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(rn())]])}function Gn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(nn())]])}function Ub(){return combineCodec(Fn(),Gn())}function Yt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getArrayEncoder(Ot())]])}function Zt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getArrayDecoder(Bt())]])}function Ob(){return combineCodec(Yt(),Zt())}function Xt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(cn())],["addressTableLookups",getArrayEncoder(As())]])}function Qt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(an())],["addressTableLookups",getArrayDecoder(gs())]])}function Vb(){return combineCodec(Xt(),Qt())}function As(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function gs(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Gb(){return combineCodec(As(),gs())}function zn(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function Kn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function jb(){return combineCodec(zn(),Kn())}function jn(){return getStructEncoder([["transferring",getU8Encoder()]])}function Jn(){return getStructDecoder([["transferring",getU8Decoder()]])}function Yb(){return combineCodec(jn(),Jn())}function Xe(){return getStructEncoder([["member",se()],["domainConfig",getOptionEncoder(getAddressEncoder())],["role",Ke()],["delegatedTo",getOptionEncoder(Gt())],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function $(){return getStructDecoder([["member",oe()],["domainConfig",getOptionDecoder(getAddressDecoder())],["role",je()],["delegatedTo",getOptionDecoder(zt())],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function $b(){return combineCodec(Xe(),$())}function xe(){return getStructEncoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",getU8Encoder()]])}function Ie(){return getStructDecoder([["addressTreeInfo",wt()],["outputStateTreeIndex",getU8Decoder()]])}function n_(){return combineCodec(xe(),Ie())}function Qe(){return getStructEncoder([["accountMeta",Ct()],["data",Xe()]])}function $e(){return getStructDecoder([["accountMeta",Et()],["data",$()]])}function a_(){return combineCodec(Qe(),$e())}function Re(){return getStructEncoder([["accountMeta",Mt()],["data",Xe()]])}function be(){return getStructDecoder([["accountMeta",ht()],["data",$()]])}function A_(){return combineCodec(Re(),be())}function es(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Re()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([Qe()])]])]])}function ts(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([be()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([$e()])]])]])}function y_(){return combineCodec(es(),ts())}function T_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function l_(e,n){return n.__kind===e}var it=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(it||{});function Ke(){return getEnumEncoder(it)}function je(){return getEnumDecoder(it)}function x_(){return combineCodec(Ke(),je())}var wc=new Uint8Array([223,179,163,190,177,224,67,173]);function Iv(){return fixEncoderSize(getBytesEncoder(),8).encode(wc)}function ul(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(vt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:wc}))}function Vc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(Ut())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function Cv(){return combineCodec(ul(),Vc())}function Hc(e){return decodeAccount(e,Vc())}async function Ev(e,n,r){let s=await ys(e,n,r);return assertAccountExists(s),s}async function ys(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Hc(s)}async function Dv(e,n,r){let s=await Al(e,n,r);return assertAccountsExist(s),s}async function Al(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Hc(t))}var jc=new Uint8Array([90,36,35,219,93,225,110,96]);function Rv(){return fixEncoderSize(getBytesEncoder(),8).encode(jc)}function bl(){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",se()],["executor",se()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(se())],["expectedSecp256r1Signers",getArrayEncoder(Ot())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:jc}))}function Jc(){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",oe()],["executor",oe()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(oe())],["expectedSecp256r1Signers",getArrayDecoder(Bt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function bv(){return combineCodec(bl(),Jc())}function qc(e){return decodeAccount(e,Jc())}async function Yc(e,n,r){let s=await _l(e,n,r);return assertAccountExists(s),s}async function _l(e,n,r){let s=await fetchEncodedAccount(e,n,r);return qc(s)}async function _v(e,n,r){let s=await vl(e,n,r);return assertAccountsExist(s),s}async function vl(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>qc(t))}var Qc=new Uint8Array([105,23,173,2,197,255,80,87]);function Wv(){return fixEncoderSize(getBytesEncoder(),8).encode(Qc)}function Yl(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:Qc}))}function $c(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function kv(){return combineCodec(Yl(),$c())}function ea(e){return decodeAccount(e,$c())}async function ta(e,n,r){let s=await Zl(e,n,r);return assertAccountExists(s),s}async function Zl(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ea(s)}async function Lv(e,n,r){let s=await Xl(e,n,r);return assertAccountsExist(s),s}async function Xl(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ea(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 na(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function O(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 y(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:O(r.value),role:ra(r.value)?upgradeRoleToSigner(s):s,...ra(r.value)?{signer:r.value}:{}})}}function ra(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var oa=new Uint8Array([8]);function Qv(){return fixEncoderSize(getBytesEncoder(),1).encode(oa)}function Es(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:oa}))}function ca(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function $v(){return combineCodec(Es(),ca())}async function aa(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},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=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:Es().encode(c),programAddress:r})}function eU(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:Es().encode(c),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:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:ca().decode(e.data)}}var ga=new Uint8Array([9]);function iU(){return fixEncoderSize(getBytesEncoder(),1).encode(ga)}function Ps(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(Ge())],["secp256r1VerifyArgs",getArrayEncoder(X())],["compressedProofArgs",getOptionEncoder(E())]]),e=>({...e,discriminator:ga}))}function pa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(ze())],["secp256r1VerifyArgs",getArrayDecoder(Q())],["compressedProofArgs",getOptionDecoder(D())]])}function dU(){return combineCodec(Ps(),pa())}async function ma(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},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(na(c.settingsIndex))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ps().encode(c),programAddress:r})}function uU(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},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=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ps().encode(c),programAddress:r})}function AU(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:pa().decode(e.data)}}var Sa=new Uint8Array([19]);function fU(){return fixEncoderSize(getBytesEncoder(),1).encode(Sa)}function xa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(Ge())],["secp256r1VerifyArgs",getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Sa}))}function Ia(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(ze())],["secp256r1VerifyArgs",getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function SU(){return combineCodec(xa(),Ia())}function Ca(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:xa().encode(c),programAddress:r})}function xU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Ia().decode(e.data)}}var Pa=new Uint8Array([18]);function hU(){return fixEncoderSize(getBytesEncoder(),1).encode(Pa)}function Ms(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",E()],["settingsCreation",Ht()],["userReadonlyArgs",Re()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Pa}))}function Ma(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["settingsCreation",Ft()],["userReadonlyArgs",be()],["settingsIndex",getU128Decoder()]])}function RU(){return combineCodec(Ms(),Ma())}async function ha(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Ms().encode(c),programAddress:r})}function bU(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Ms().encode(c),programAddress:r})}function _U(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:Ma().decode(e.data)}}var La=new Uint8Array([0]);function BU(){return fixEncoderSize(getBytesEncoder(),1).encode(La)}function Rs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",xe()],["compressedProofArgs",E()]]),e=>({...e,discriminator:La}))}function Oa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",Ie()],["compressedProofArgs",D()]])}function NU(){return combineCodec(Rs(),Oa())}async function Ba(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},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=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Rs().encode(c),programAddress:r})}function wU(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Rs().encode(c),programAddress:r})}function VU(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:Oa().decode(e.data)}}var wa=new Uint8Array([4]);function JU(){return fixEncoderSize(getBytesEncoder(),1).encode(wa)}function _s(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",E()],["member",ss()],["role",Ke()],["userAccountCreationArgs",xe()],["linkWalletArgs",getOptionEncoder(qn())]]),e=>({...e,discriminator:wa}))}function Va(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["member",Vt()],["role",je()],["userAccountCreationArgs",Ie()],["linkWalletArgs",getOptionDecoder(Yn())]])}function qU(){return combineCodec(_s(),Va())}async function Ha(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:_s().encode(c),programAddress:r})}function YU(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:_s().encode(c),programAddress:r})}function ZU(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:Va().decode(e.data)}}var Ga=new Uint8Array([3]);function rW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ga)}function Us(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Ga}))}function za(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function nW(){return combineCodec(Us(),za())}async function Ka(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=y(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Us().encode({}),programAddress:r})}function sW(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=y(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Us().encode({}),programAddress:r})}function oW(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:za().decode(e.data)}}var Ja=new Uint8Array([5]);function gW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ja)}function ks(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",E()],["createUserArgs",getArrayEncoder(On())]]),e=>({...e,discriminator:Ja}))}function qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",D()],["createUserArgs",getArrayDecoder(Bn())]])}function pW(){return combineCodec(ks(),qa())}async function Ya(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:ks().encode(c),programAddress:r})}function mW(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:ks().encode(c),programAddress:r})}function yW(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:qa().decode(e.data)}}var Qa=new Uint8Array([17]);function CW(){return fixEncoderSize(getBytesEncoder(),1).encode(Qa)}function $a(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",K()],["compressedProofArgs",E()],["secp256r1VerifyArgs",getArrayEncoder(X())]]),e=>({...e,discriminator:Qa}))}function ei(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",j()],["compressedProofArgs",D()],["secp256r1VerifyArgs",getArrayDecoder(Q())]])}function EW(){return combineCodec($a(),ei())}function ti(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},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=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:$a().encode(c),programAddress:r})}function DW(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:ei().decode(e.data)}}var si=new Uint8Array([2]);function _W(){return fixEncoderSize(getBytesEncoder(),1).encode(si)}function oi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:si}))}function ci(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function vW(){return combineCodec(oi(),ci())}function ai(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:oi().encode(c),programAddress:r})}function UW(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:ci().decode(e.data)}}var Ai=new Uint8Array([1]);function wW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ai)}function Os(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(Qn())]]),e=>({...e,discriminator:Ai}))}function gi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder($n())]])}function VW(){return combineCodec(Os(),gi())}async function HW(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},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=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Os().encode(c),programAddress:r})}function pi(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Os().encode(c),programAddress:r})}function FW(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:gi().decode(e.data)}}var Ti=new Uint8Array([6]);function YW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ti)}function li(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Qe()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ti}))}function fi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",$e()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",D()]])}function ZW(){return combineCodec(li(),fi())}function Si(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:li().encode(c),programAddress:r})}function XW(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:fi().decode(e.data)}}var Ci=new Uint8Array([7]);function sk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ci)}function Ei(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",Qe()],["secp256r1VerifyArgs",getOptionEncoder(H())],["delegateTo",getOptionEncoder(Gt())],["oldSettingsMutArgs",getOptionEncoder(K())],["newSettingsMutArgs",getOptionEncoder(K())],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ci}))}function Di(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",$e()],["secp256r1VerifyArgs",getOptionDecoder(F())],["delegateTo",getOptionDecoder(zt())],["oldSettingsMutArgs",getOptionDecoder(j())],["newSettingsMutArgs",getOptionDecoder(j())],["compressedProofArgs",D()]])}function ok(){return combineCodec(Ei(),Di())}function Pi(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(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:Ei().encode(c),programAddress:r})}function ck(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:Di().decode(e.data)}}var Ri=new Uint8Array([32]);function pk(){return fixEncoderSize(getBytesEncoder(),1).encode(Ri)}function bi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",bt()],["compressedProofArgs",E()],["settingsCreationArgs",Ht()]]),e=>({...e,discriminator:Ri}))}function _i(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",_t()],["compressedProofArgs",D()],["settingsCreationArgs",Ft()]])}function mk(){return combineCodec(bi(),_i())}function vi(e,n){let r=n?.programAddress??A,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=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:bi().encode(c),programAddress:r})}function yk(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:_i().decode(e.data)}}var ki=new Uint8Array([31]);function Ck(){return fixEncoderSize(getBytesEncoder(),1).encode(ki)}function Li(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Xe()],["compressedProofArgs",E()],["userCreationArgs",xe()]]),e=>({...e,discriminator:ki}))}function Oi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",$()],["compressedProofArgs",D()],["userCreationArgs",Ie()]])}function Ek(){return combineCodec(Li(),Oi())}function Bi(e,n){let r=n?.programAddress??A,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=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:Li().encode(c),programAddress:r})}function Dk(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:Oi().decode(e.data)}}var wi=new Uint8Array([29]);function vk(){return fixEncoderSize(getBytesEncoder(),1).encode(wi)}function Bs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(X())]]),e=>({...e,discriminator:wi}))}function Vi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Q())]])}function Uk(){return combineCodec(Bs(),Vi())}async function Wk(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},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(O(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(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:Bs().encode(c),programAddress:r})}function Hi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},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=y(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:Bs().encode(c),programAddress:r})}function kk(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Vi().decode(e.data)}}var zi=new Uint8Array([27]);function Hk(){return fixEncoderSize(getBytesEncoder(),1).encode(zi)}function Ki(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:zi}))}function ji(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function Fk(){return combineCodec(Ki(),ji())}function Ji(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},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=y(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:Ki().encode(c),programAddress:r})}function Gk(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:ji().decode(e.data)}}var Xi=new Uint8Array([30]);function Zk(){return fixEncoderSize(getBytesEncoder(),1).encode(Xi)}function Vs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Jt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(Wt()))],["compressedProofArgs",getOptionEncoder(E())],["secp256r1VerifyArgs",getArrayEncoder(X())]]),e=>({...e,discriminator:Xi}))}function Qi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(qt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(kt()))],["compressedProofArgs",getOptionDecoder(D())],["secp256r1VerifyArgs",getArrayDecoder(Q())]])}function Xk(){return combineCodec(Vs(),Qi())}async function Qk(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},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(O(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(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=y(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:Vs().encode(c),programAddress:r})}function $i(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},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=m(a),o=y(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:Vs().encode(c),programAddress:r})}function $k(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===A?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:Qi().decode(e.data)}}var od=new Uint8Array([28]);function cL(){return fixEncoderSize(getBytesEncoder(),1).encode(od)}function Hs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Jt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(Wt()))],["secp256r1VerifyArgs",getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:od}))}function cd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(qt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(kt()))],["secp256r1VerifyArgs",getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function aL(){return combineCodec(Hs(),cd())}async function iL(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable: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(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=y(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:Hs().encode(c),programAddress:r})}function ad(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable: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=m(a),o=y(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:Hs().encode(c),programAddress:r})}function dL(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===A?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:cd().decode(e.data)}}var ud=new Uint8Array([13]);function TL(){return fixEncoderSize(getBytesEncoder(),1).encode(ud)}function Ad(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())]]),e=>({...e,discriminator:ud}))}function gd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function lL(){return combineCodec(Ad(),gd())}function pd(e,n){let r=n?.programAddress??A,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=y(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:Ad().encode(c),programAddress:r})}function fL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:gd().decode(e.data)}}var Td=new Uint8Array([23]);function PL(){return fixEncoderSize(getBytesEncoder(),1).encode(Td)}function ld(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Td}))}function fd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function ML(){return combineCodec(ld(),fd())}function Sd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(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:ld().encode(c),programAddress:r})}function hL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:fd().decode(e.data)}}var Cd=new Uint8Array([10]);function kL(){return fixEncoderSize(getBytesEncoder(),1).encode(Cd)}function Ed(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Yt()],["secp256r1VerifyArgs",getOptionEncoder(H())]]),e=>({...e,discriminator:Cd}))}function Dd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Zt()],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function LL(){return combineCodec(Ed(),Dd())}function Pd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},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=y(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:Ed().encode(c),programAddress:r})}function OL(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Dd().decode(e.data)}}var Rd=new Uint8Array([20]);function GL(){return fixEncoderSize(getBytesEncoder(),1).encode(Rd)}function bd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Yt()],["secp256r1VerifyArgs",getOptionEncoder(H())],["settingsReadonlyArgs",Kt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Rd}))}function _d(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Zt()],["secp256r1VerifyArgs",getOptionDecoder(F())],["settingsReadonlyArgs",jt()],["compressedProofArgs",D()]])}function zL(){return combineCodec(bd(),_d())}function vd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},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=y(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:bd().encode(c),programAddress:r})}function KL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:_d().decode(e.data)}}var kd=new Uint8Array([14]);function QL(){return fixEncoderSize(getBytesEncoder(),1).encode(kd)}function Ld(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())]]),e=>({...e,discriminator:kd}))}function Od(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function $L(){return combineCodec(Ld(),Od())}function Bd(e,n){let r=n?.programAddress??A,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=y(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:Ld().encode(c),programAddress:r})}function eO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Od().decode(e.data)}}var Vd=new Uint8Array([24]);function aO(){return fixEncoderSize(getBytesEncoder(),1).encode(Vd)}function Hd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Vd}))}function Fd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function iO(){return combineCodec(Hd(),Fd())}function Gd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(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:Hd().encode(c),programAddress:r})}function dO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Fd().decode(e.data)}}var jd=new Uint8Array([12]);function yO(){return fixEncoderSize(getBytesEncoder(),1).encode(jd)}function Jd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:jd}))}function qd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function TO(){return combineCodec(Jd(),qd())}function Yd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:Jd().encode(c),programAddress:r})}function lO(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:qd().decode(e.data)}}var Qd=new Uint8Array([22]);function EO(){return fixEncoderSize(getBytesEncoder(),1).encode(Qd)}function $d(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Qd}))}function eu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function DO(){return combineCodec($d(),eu())}function tu(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:$d().encode(c),programAddress:r})}function PO(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:eu().decode(e.data)}}var su=new Uint8Array([11]);function UO(){return fixEncoderSize(getBytesEncoder(),1).encode(su)}function ou(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())]]),e=>({...e,discriminator:su}))}function cu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function WO(){return combineCodec(ou(),cu())}function au(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},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=y(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:ou().encode(c),programAddress:r})}function kO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:cu().decode(e.data)}}var uu=new Uint8Array([21]);function HO(){return fixEncoderSize(getBytesEncoder(),1).encode(uu)}function Au(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(H())],["settingsReadonlyArgs",Kt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:uu}))}function gu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())],["settingsReadonlyArgs",jt()],["compressedProofArgs",D()]])}function FO(){return combineCodec(Au(),gu())}function pu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},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=y(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:Au().encode(c),programAddress:r})}function GO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:gu().decode(e.data)}}var Tu=new Uint8Array([15]);function YO(){return fixEncoderSize(getBytesEncoder(),1).encode(Tu)}function lu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Tu}))}function fu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function ZO(){return combineCodec(lu(),fu())}function Su(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=m({}),i=y(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:lu().encode({}),programAddress:r})}function XO(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:fu().decode(e.data)}}var Cu=new Uint8Array([25]);function nB(){return fixEncoderSize(getBytesEncoder(),1).encode(Cu)}function Eu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Cu}))}function Du(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function sB(){return combineCodec(Eu(),Du())}function Pu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:Eu().encode(c),programAddress:r})}function oB(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:Du().decode(e.data)}}var Ru=new Uint8Array([16]);function gB(){return fixEncoderSize(getBytesEncoder(),1).encode(Ru)}function bu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Xt()],["secp256r1VerifyArgs",getArrayEncoder(X())]]),e=>({...e,discriminator:Ru}))}function _u(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Qt()],["secp256r1VerifyArgs",getArrayDecoder(Q())]])}function pB(){return combineCodec(bu(),_u())}function vu(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:bu().encode(c),programAddress:r})}function mB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:_u().decode(e.data)}}var ku=new Uint8Array([26]);function IB(){return fixEncoderSize(getBytesEncoder(),1).encode(ku)}function Lu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Xt()],["secp256r1VerifyArgs",getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:ku}))}function Ou(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Qt()],["secp256r1VerifyArgs",getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function CB(){return combineCodec(Lu(),Ou())}function Bu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Lu().encode(c),programAddress:r})}function EB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Ou().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",AE=(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))(AE||{});function aN(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 gE=(T=>(T[T.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",T[T.ChangeConfig=1]="ChangeConfig",T[T.ChangeConfigCompressed=2]="ChangeConfigCompressed",T[T.CreateCompressedWallet=3]="CreateCompressedWallet",T[T.CreateDomainConfig=4]="CreateDomainConfig",T[T.CreateDomainUserAccount=5]="CreateDomainUserAccount",T[T.CreateGlobalCounter=6]="CreateGlobalCounter",T[T.CreateUserAccounts=7]="CreateUserAccounts",T[T.DecompressSettingsAccount=8]="DecompressSettingsAccount",T[T.DisableDomainConfig=9]="DisableDomainConfig",T[T.EditDomainConfig=10]="EditDomainConfig",T[T.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",T[T.EditUserDelegate=12]="EditUserDelegate",T[T.MigrateCompressedSettings=13]="MigrateCompressedSettings",T[T.MigrateCompressedUsers=14]="MigrateCompressedUsers",T[T.NativeTransferIntent=15]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=17]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=19]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=21]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=23]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=25]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=27]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",T[T.TransactionExecute=29]="TransactionExecute",T[T.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=31]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",T))(gE||{});function iN(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 mE=6e3,yE=6001,TE=6002,lE=6003,fE=6004,SE=6005,xE=6006,IE=6007,CE=6008,EE=6009,DE=6010,PE=6011,ME=6012,hE=6013,RE=6014,bE=6015,_E=6016,vE=6017,UE=6018,WE=6019,kE=6020,LE=6021,OE=6022,BE=6023,NE=6024,wE=6025,VE=6026,HE=6027,FE=6028,GE=6029,zE=6030,KE=6031,jE=6032,JE=6033,qE=6034,YE=6035,ZE=6036,XE=6037,QE=6038,$E=6039,eD=6040,tD=6041,rD=6042,nD=6043,sD=6044,oD=6045,cD=6046,aD=6047,iD=6048,dD=6049,uD=6050,AD=6051,gD=6052,pD=6053,mD=6054,yD=6055,TD=6056,lD=6057,fD=6058,SD=6059,xD=6060,ID=6061,CD=6062,ED=6063,DD=6064,PD=6065,MD=6066,hD=6067,RD=6068,bD=6069,_D=6070,vD=6071,UD=6072,WD=6073,kD=6074,LD=6075,OD=6076,BD=6077,ND=6078,wD=6079,VD=6080,HD=6081,FD=6082,Nu;process.env.NODE_ENV!=="production"&&(Nu={[zE]:"This member is already delegated to another wallet.",[IE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[kD]:"Clock sysvar access failed. This may indicate a system error.",[uD]:"The domain configuration account is disabled. Please contact support or try again later.",[AD]:"Missing domain configuration account.",[UD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[FD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[DE]:"Duplicate public keys detected among members. Each member must have a unique key.",[EE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[kE]:"No members provided. A multisig wallet must contain at least one member.",[lD]:"Slot numbers list is empty. At least one slot number is required for validation.",[UE]:"Expected a User with Administrator role for this instruction.",[CE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[_E]:"Expected a User with Transaction Manager role for this instruction.",[$E]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[eD]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[tD]:"Declared buffer size does not match the actual serialized size.",[TD]:"Failed to compute hash. This may indicate a system error.",[JE]:"Not enough members with vote permission to meet the approval threshold.",[KE]:"At least one signer with execute permission is required to proceed.",[jE]:"At least one signer with initiate permission is required to perform this action.",[wE]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[vD]:"Invalid account index in transaction message. The account index is out of bounds.",[mD]:"Address Tree supplied is not part of the whitelisted address trees.",[WE]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[HE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[QE]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[fD]:"Member key conversion failed. The provided key format is invalid.",[qE]:"Only delegated members are allowed for this transaction.",[NE]:"Unexpected number of accounts provided for this instruction.",[hE]:"User with Permanent Member role must have a delegated wallet.",[yE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[fE]:"The extracted public key has an invalid length or encoding.",[mE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[lE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[dD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[aD]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[OE]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[RD]:"Invalid source type for token transfer. The source account type is not supported.",[vE]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[bE]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[BE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[VE]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[OD]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[hD]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[SE]:"The extracted WebAuthn signed message payload is malformed.",[oD]:"An input string exceeds the maximum allowed character length.",[gD]:"This member is not registered under the provided domain configuration.",[ID]:"Member not found in settings. Cannot remove a member that does not exist.",[_D]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[FE]:"A required account is missing from the instruction context.",[SD]:"Compressed proof arguments are missing. Required for compressed account operations.",[DD]:"Missing compressed token account. Required for token transfer operations.",[BD]:"Missing destination token account. Required for token transfer operations.",[MD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[xD]:"Light CPI accounts are missing. Required for compressed account operations.",[GE]:"User mutation arguments are required when performing add or remove delegate operations.",[VD]:"Missing new authority account. Required for domain configuration updates.",[wD]:"Missing settings account. Required for delegate operations on compressed wallets.",[yD]:"Compressed settings data is missing. The settings account must be initialized with data.",[ND]:"Missing source token account. Required for token transfer operations.",[PD]:"Missing SPL interface PDA. Required for token transfer operations.",[cD]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[WD]:"User account address is missing. Required for secp256r1 signature verification.",[HD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[ZE]:"No valid signer found in this transaction.",[ME]:"Only one permanent member is allowed per wallet.",[RE]:"Only one transaction manager is allowed per wallet.",[pD]:"The given origin index is not in the whitelisted origins.",[ED]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[PE]:"Permanent members cannot be removed from a wallet.",[sD]:"Writable CPI calls to protected accounts are not permitted.",[xE]:"The rpIdHash extracted from the signed message does not match the expected value.",[CD]:"Settings key mismatch. The provided settings key does not match the expected value.",[TE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[iD]:"The specified slot number was not found in the provided slot history.",[bD]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[LE]:"Too many members: a maximum of 4 members are supported.",[rD]:"This transaction has expired. It must be executed within 3 minutes of approval.",[nD]:"This transaction has not yet reached the required approval threshold.",[XE]:"Only the transaction creator or rent payer may close this transaction buffer.",[LD]:"Unauthorized: Only the admin account is allowed to perform this action.",[YE]:"Member is not part of the expected signers for this transaction."});function mN(e){return process.env.NODE_ENV!=="production"?Nu[e]:"Error message not available in production bundles."}function yN(e,n,r){return isProgramError(e,n,A,r)}async function MN({admin:e,addressTree:n}){return aa({payer:e,addressTree:n,remainingAccounts:[]})}var tr={Ed25519:1,Secp256r1:2};var wu=f.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),UN=f.object({transactionActionType:wu,transactionAddress:f.string(),transactionMessageBytes:f.array(f.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),Vu=f.object({transactionActionType:wu,transactionAddress:f.string(),transactionMessageBytes:f.string()}).strict(),Hu=f.object({authResponse:f.custom(),nonce:f.string(),clientSignature:f.object({clientOrigin:f.string(),signature:f.string()}).strict(),deviceSignature:f.object({publicKey:f.string(),signature:f.string()}).strict(),authProviderSignature:f.object({publicKey:f.string(),signature:f.string()}).strict().optional()}).strict(),Fu=f.object({signer:f.string(),userAddressTreeIndex:f.number().optional(),additionalInfo:f.looseObject({}).optional()}).strict(),GD=f.object({transactionPayload:Vu,slotHash:f.string(),slotNumber:f.string(),originIndex:f.number(),crossOrigin:f.boolean()}).strict(),WN=f.object({phase:f.literal("start"),redirectOrigin:f.url(),signer:f.string().optional(),data:f.object({type:f.literal("message"),payload:f.string().optional()}).strict()}).strict(),kN=f.object({phase:f.literal("start"),redirectOrigin:f.url(),signer:f.string().optional(),data:f.object({type:f.literal("transaction"),payload:Vu}).strict()}).strict(),LN=f.object({phase:f.literal("complete"),data:f.object({type:f.literal("message"),payload:Fu.extend(Hu.shape).extend({id:f.string().optional(),message:f.string(),clientSignature:f.object({clientOrigin:f.string()}).strict()})}).strict()}).strict(),ON=f.object({phase:f.literal("complete"),data:f.object({type:f.literal("transaction"),payload:Fu.extend(Hu.shape).extend(GD.shape).extend({clientSignature:f.object({clientOrigin:f.string()}).strict()})}).strict()}).strict();var _e={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Be=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(_e).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var zs=33,Ne=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!==zs)throw new Error(`Invalid public key length, expected ${zs} 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===zs)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()}},P=class extends Ne{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 jD(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function JD(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var zu=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(jD())],["addressTableLookups",getArrayCodec(JD())]]);function Ku(e){return zu.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 ju(e){let n=zu.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}function Ju(e,n,r,s){if(e<n||e>r)throw new z(`${s} must be between ${n} and ${r} (inclusive), got ${e}`)}function qu(e,n){if(e<0)throw new z(`${n} must be non-negative, got ${e}`)}function rr(e,n){if(e.length===0)throw new z(`${n} cannot be empty`)}function Yu(e,n){if(e.trim().length===0)throw new z(`${n} cannot be empty`)}featureFlags.version=VERSION.V2;var te={};function Zu(){if(!te.solanaRpcEndpoint)throw new Oe("RPC endpoint");return te.solanaRpcEndpoint}function tt(){if(!te.lightProtocolRpc)throw new Oe("Light Protocol RPC");return te.lightProtocolRpc}function ce(){if(!te.solanaRpc)throw new Oe("Solana RPC");return te.solanaRpc}function Xu(){if(!te.sendAndConfirm)throw new Oe("Send and confirm transaction function");return te.sendAndConfirm}function Qu(){if(!te.computeEstimate)throw new Oe("Compute budget estimate function");return te.computeEstimate}function js(){return te.jitoTipsConfig?te.jitoTipsConfig:{blockEngineUrl:Io,getJitoTipsUrl:Co,priority:Eo}}function iw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){te.solanaRpcEndpoint=e,te.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});te.solanaRpc=t,te.sendAndConfirm=c,te.computeEstimate=estimateComputeUnitLimitFactory({rpc:t}),te.jitoTipsConfig=s??null;}function $u(e){return typeof e=="string"?e:e.toString()}function eA(e){return e.toString()}async function Js(e,n,r){let s=e?.get(n);if(s)return s;let t=await r();return t&&e&&e.set(n,t),t}var $D={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true};function eP(e,n,r=2,s=3e4){let t=n*Math.pow(r,e-1);return Math.min(t,s)}function tP(e){return new Promise(n=>setTimeout(n,e))}async function nr(e,n){let{maxRetries:r,initialDelayMs:s,backoffBase:t=2,maxDelayMs:c=3e4,shouldRetry:a}={...$D,...n},i;for(let o=1;o<=r;o++)try{return await e()}catch(u){if(i=u,a&&!a(u,o))throw u;if(o>=r)break;let d=eP(o,s,t,c);await tP(d);}throw new mr(e.name||"retryWithBackoff",r,i)}async function ut(e,n){let r=(s,t)=>s instanceof Response?s.status===429?n.retryOnRateLimit??true:s.status>=400&&s.status<500?false:s.status>=500:s instanceof TypeError||s instanceof Error;return nr(e,{...n,shouldRetry:n.shouldRetry??r})}var B=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:r?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(A.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await tt().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 Nr(e,n){let r=$u(e);return Js(n,r,()=>tt().getCompressedAccount(e))}async function rt(e,n){let r=eA(e);return Js(n,r,()=>ce().getAccountInfo(e,{encoding:"base64"}).send())}async function Te(e,n){let s=(await Promise.all(e.map(async t=>Nr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new ne("Compressed account",`Expected ${e.length} accounts but found ${s.length}`);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 ge(e,n,r,s,t){if(t.length===0)return [];let c=t.map((u,d)=>({treeInfo:n[d],root:r[d],rootIndex:s[d],address:u.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((u,d)=>({addressTreeInfo:a[d],outputStateTreeIndex:i,address:u.address,type:u.type}))}function de(e,n,r,s,t,c,a){let i=[];for(let d=0;d<n.length;d++)i.push({treeInfo:n[d],rootIndex:s[d],leafIndex:r[d],proveByIndex:t[d],hash:c[d].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new z("Unable to parse state tree data");return c.map((d,g)=>({data:a.decode(d.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(d.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Me(e,n,r,s,t){let c=null,a=null,i=null,o=new B;if(e){await o.addSystemAccounts();let{address:u}=await ae(n,r),d=(await Te([{address:u,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[d.leafIndex],leaves:[],treeInfos:[d.treeInfo],proveByIndices:[d.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:i=await w([d],[]);let g=o.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!g)throw new z("Unable to parse state tree data");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:g.packedTreeInfos[0]},data:Z().decode(d.data?.data)},a={accountMeta:{address:new Uint8Array(d.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:Z().decode(d.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:o,settingsMutArgs:a}}async function w(e,n,r=3,s=500){return nr(()=>tt().getValidityProofV0(e,n),{maxRetries:r,initialDelayMs:s})}async function he(){return (await wr()).length-1}var qs;async function wr(){if(!qs){let{data:e}=await ta(ce(),await sA());qs=e.whitelistedAddressTrees;}return qs}function nA(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let n=e[7];return n===3?2:3}async function Vr(e,n,r){let s=await cP(e,n,r);if(!s)throw new ne("User account");return s}async function cP(e,n,r){let{address:s}=await N(e,n),t=await Nr(s,r);return t?.data?.data?$().decode(t.data.data):null}async function Ys(e,n,r){let s=await aP(e,n,r);if(!s)throw new ne("Settings account");return s}async function aP(e,n,r){try{let{address:s}=await ae(e,n),t=await Nr(s,r);if(!t?.data?.data)throw new ne("Compressed settings account");let c=Z().decode(t.data.data);if(c.data.__option==="None")throw new ne("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let s=await ys(ce(),await ue(e));return s.exists?{...s.data,isCompressed:false}:null}}async function Zs(e){qu(e,"index");let n=await wr();if(e>=n.length)throw new z(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function ww(e){let r=(await wr()).findIndex(s=>s.toString()===e);if(r===-1)throw new ne("Address tree",`Address ${e} not found in whitelist`);return r}async function ae(e,n=0){let r=await Zs(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("multi_wallet")),new Uint8Array(getU128Encoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(A)).toString(),"base58"),addressTree:new PublicKey(r)}}async function N(e,n=0){let r=await Zs(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),e instanceof Ne?e.toTruncatedBuffer():new Uint8Array(getAddressEncoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(A.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function gt({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(new Uint8Array(getUtf8Encoder().encode(n)));else throw new z("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function dA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function sA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function uA(e,n,r){Ju(r,0,255,"buffer_index");let[s]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof Ne?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function ve(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function ue(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function Xw(e){let n=await ue(e);return await ve(n)}async function Qw(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function or(e,n){if(!e.ok){await e.text().catch(()=>e.statusText);throw new De(`Request failed: ${e.statusText} (${e.status})`,e.status,n)}return e}async function cr(e){try{return await e.json()}catch(n){throw new De(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function u2(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Fr(n.get(-2))),y:BigInt("0x"+Fr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function A2(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 g2(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Ve(n)),c=JSON.parse(new TextDecoder().decode(Ve(r))),a=pA(c),i=yA(new Uint8Array(Ve(s))),o=await gt({rpIdHash:t.subarray(0,32)});return new P(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Ve(r)),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:Xs(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function Xs(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function y2(e){return sha256(new Uint8Array(getUtf8Encoder().encode(JSON.stringify(e))))}function T2(e){return Qs(e.data.payload.authResponse)}function l2(e,n,r,s){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...Xs(n,r,s)]))}async function f2(e,n,r,s,t,c){let a;if(!t||!c){let o=(await ce().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!o)throw new ne("Slot sysvar","Unable to fetch slot sysvar data");let u=getBase64Encoder().encode(o[0]);c=getU64Decoder().decode(u.subarray(0,8)).toString(),a=u.subarray(8,40),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(Ve(e.transactionMessageBytes)):e.transactionMessageBytes),...a,...Xs(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:i}}function Qs(e){return sha256(zr(e))}function S2(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ve(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 x2(e,n){let{data:r}=await vo(ce(),e),t=mA(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 Fr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function TP(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 pA(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 mA(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 yA(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let C=n&127;r+=C;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let a=e[r+1],i=r+2,o=e.slice(i,i+a),u=c[0]===0&&c.length>32?c.slice(1):c,d=o[0]===0&&o.length>32?o.slice(1):o;if(u.length>32||d.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(u,32-u.length);let p=p256.Point.CURVE().n>>1n,l=BigInt("0x"+Fr(d)),b=(l>p?p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),x=TP(b);return new Uint8Array([...g,...x])}function zr(e){return new Uint8Array([...new Uint8Array(Ve(e.response.authenticatorData)),...sha256(new Uint8Array(Ve(e.response.clientDataJSON)))])}async function $s(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await ce().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);return a>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:a})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function SA(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 xA(e,n){rr(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new z(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await ut(()=>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:[]}))}]})}),{maxRetries:3,initialDelayMs:500});await or(r,n);let s=await cr(r);if(!s.result||s.error)throw new ye(`Unable to simulate bundle: ${JSON.stringify(s.error??s.result)}`);if(typeof s.result.value.summary!="string"&&s.result.value.summary.failed){let{TransactionFailure:t}=s.result.value.summary.failed.error,[,c]=t;throw new ye(`Simulation failed: ${c}`)}return s.result.value.transactionResults.map(t=>t.unitsConsumed)}function J(e,n=0){let r=e instanceof P?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}):none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,a=r?.authData&&r.verifyArgs.clientDataJson?zr(r.authResponse):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function mt(e){if(e instanceof Ne)return {keyType:tr.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:tr.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function fA(e){return e instanceof P?e.toString():e.address.toString()}function Se(e){let n=new Set,r=[];for(let t of e)n.has(fA(t))||(r.push(t),n.add(fA(t)));let s=r.filter(t=>t instanceof P);if(s.length>1)throw new z(`More than 1 Secp256r1 signers in an instruction is not supported (found ${s.length})`);return r}function IA({payer:e,tipAmount:n}){let r=en[Math.floor(Math.random()*en.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}async function j2(e){rr(e,"bundle");let n=await $s(e,true),r=await xA(n.map(getBase64EncodedWireTransaction),Zu()),s=await $s(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await WP(s.map(getBase64EncodedWireTransaction))}async function WP(e,n=3,r=500,s=js()){rr(e,"serializedTransactions");let{blockEngineUrl:t}=s,c=`${t}/bundles`,a=await ut(()=>fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})}),{maxRetries:n,initialDelayMs:r});await or(a,c);let i=await cr(a);if(i.error)throw new ye(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new ye("No bundle ID returned from Jito");return i.result}async function J2(e,n=30,r=3e3,s=js()){Yu(e,"bundleId");let{blockEngineUrl:t}=s,c=`${t}/getBundleStatuses`;return nr(async()=>{let a=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await or(a,c);let i=await cr(a);if(i.error)throw new ye(`Error getting bundle status: ${JSON.stringify(i.error,null,2)}`,e);if(!i.result?.value?.length)throw new ye("Bundle not yet confirmed",e);let o=i.result.value[0];if(o.confirmation_status==="confirmed"||o.confirmation_status==="finalized"){let u=o.transactions[o.transactions.length-1];if(!u)throw new ye("No transactions in confirmed bundle",e);return u}throw new ye(`Bundle status: ${o.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:a=>a instanceof ye||a instanceof De})}async function e5({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await ce().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([Qu()(c),SA(ce(),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 Xu()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function T5(e,n){if(n.threshold>1)throw new z("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(o=>DA(o.pubkey)===e);if(!r)throw new ne("Member",`Signer ${e} not found in settings`);let{permissions:s}=r;if(!s)throw new ne("Permissions","No permissions found for the current member");let t=Be.has(s,_e.InitiateTransaction),c=Be.has(s,_e.VoteTransaction),a=Be.has(s,_e.ExecuteTransaction);if(t&&c&&a)return {};if(!c||!a)throw new yr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,a?"ExecuteTransaction":void 0].filter(Boolean));let i=n.members.find(o=>o.role===2);if(!i)throw new ne("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(DA(i.pubkey)),userAddressTreeIndex:i.userAddressTreeIndex}}async function l5({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await Vr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new ne("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return XP(n,c.transactionManagerUrl.value,e,s)}function XP(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=getBase64Decoder().decode(s)),r&&(c.authResponses=r);let a=await ut(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)}),{maxRetries:3,initialDelayMs:500});if(!a.ok)throw new De(`Transaction manager request failed: ${a.statusText}`,a.status,n);let i=await a.json();if("error"in i)throw new De(`Transaction manager error: ${i.error}`,a.status,n);return i.signatures.map(o=>({[e]:getBase58Encoder().encode(o)}))}}}function DA(e){return e.keyType===tr.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function f5(e){let n=e.map(c=>Ge().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 S5(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=ze().read(e,n);t[c]=a[0],n=a[1];}if(n!==e.length)throw new z(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function L5({payer:e,rpId:n,origins:r,authority:s}){let t=await gt({rpId:n}),c=new B;await c.addSystemAccounts();let a=await he(),{address:i,addressTree:o}=await N(s.address,a),u=[{address:i,tree:o,queue:o,type:"User"}],d=await w([],u),g=(await ge(c,d.treeInfos,d.roots,d.rootIndices,u))[0],{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),S=v(d,l);return await Ba({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function K5({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await ae(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await N(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await Te(a,t):[],o=await he(),{address:u,addressTree:d}=await N(r.member,o),g=[{address:u,type:"User",tree:d,queue:d}],p=await w(i,g),l=null,S=null,b=i.filter(G=>G.type==="Settings"),x=i.filter(G=>G.type==="User");b.length&&(l=de(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),b,Z())[0]),x.length&&(S=de(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,$())[0]);let C=await ge(c,p.treeInfos.slice(i.length),p.roots.slice(i.length),p.rootIndices.slice(i.length),g),{remainingAccounts:_,systemOffset:I}=c.toAccountMetas(),W=v(p,I);return await Ha({payer:n,authority:e,compressedProofArgs:W,member:Vt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:l?some({settingsMutArgs:l,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:C[0],domainConfig:s,remainingAccounts:_})}async function Y5({payer:e}){let n=await dA();return Ka({payer:e,globalCounter:n})}async function $5({admin:e,rpId:n,disable:r}){let s=await gt({rpId:n});return ai({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function c6({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:a}=await ae(r,s),i=[{address:c,tree:a,queue:a,type:"Settings"}],o=await w([],i),u=(await ge(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:d,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return vi({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:u,remainingAccounts:d})}async function p6({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:a}=await N(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await w([],i),u=(await ge(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:d,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Bi({compressedProofArgs:p,args:e,authority:n,userCreationArgs:u,remainingAccounts:d})}function $P(e,n,r,s){let t=eM(e,n),c=tM(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function eM(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 tM(e,n){return n<e.header.numSignerAccounts}async function Kr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=ju(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),ce()):{}),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:$P(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 d=o[u];if(!d)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:d,role:AccountRole.WRITABLE});}for(let u of i.readonlyIndexes){let d=o[u];if(!d)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:d,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}}var yt=33,Tt=64,no=14,iM=2,dM=address("Secp256r1SigVerify1111111111111111111111111");function uM(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function AM(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function _A(){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=AM();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=no;let a=[];for(let i=0;i<r;i++){let o=fixDecoderSize(getBytesDecoder(),yt).decode(e,n);n+=yt;let u=fixDecoderSize(getBytesDecoder(),Tt).decode(e,n);n+=Tt;let d=t[i].messageDataSize,g=fixDecoderSize(getBytesDecoder(),d).decode(e,n);n+=d,a.push({publicKey:o,signature:u,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function vA(){return createEncoder({getSizeFromValue:e=>{let n=no*e.offsets.length,r=e.payload.reduce((s,t)=>s+yt+Tt+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=uM();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),yt).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),Tt).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function R6(){return combineCodec(vA(),_A())}function V(e,n){let r=e.length,s=iM+r*no,t=[];for(let o=0;o<r;o++){let{message:u}=e[o],d=s,g=d+yt,p=g+Tt;t.push({publicKeyOffset:d,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:u.length,messageInstructionIndex:65535}),s+=yt+Tt+u.length;}let c=n?.programAddress??dM,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:vA().encode(a)}}function b6(e){return {programAddress:e.programAddress,accounts:{},data:_A().decode(e.data)}}async function UA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let u=await ve(e),{accountMetas:d,addressLookupTableAccounts:g}=await Kr({transactionMessageBytes:r,walletAddress:u,additionalSigners:a,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(V(c)),p.push(o?Pu({transactionBuffer:n,payer:s.address,remainingAccounts:d,settingsKey:e}):Su({transactionBuffer:n,payer:s.address,settings:e})),i&&p.push(IA({payer:s,tipAmount:i})),{instructions:p,addressLookupTableAccounts:g}}async function WA({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:u}){let d=Se(s),g=await ue(e),p=await ve(g),[{accountMetas:l,addressLookupTableAccounts:S,transactionMessage:b},{settingsMutArgs:x,proof:C,packedAccounts:_}]=await Promise.all([Kr({transactionMessageBytes:r,walletAddress:p,additionalSigners:d.filter(ee=>!(ee instanceof P)),addressesByLookupTableAddress:c}),Me(i,e,n,o,u)]);_.addPreAccounts(l);let I=d.filter(ee=>ee instanceof P),{secp256r1VerifyArgs:W}=pM(I,a,_),{remainingAccounts:G,systemOffset:q}=_.toAccountMetas();return {instructions:mM({secp256r1VerifyInput:a,transactionMessage:b,accountMetas:l,compressed:i,payer:t,settingsMutArgs:x,proof:C,systemOffset:q,secp256r1VerifyArgs:W,settings:g,remainingAccounts:G}),addressLookupTableAccounts:S}}function pM(e,n,r){let s=[];for(let t of e){let c=n.length,{domainConfig:a,verifyArgs:i,signature:o,publicKey:u,message:d}=J(t,c);d&&o&&u&&n.push({message:d,signature:o,publicKey:u}),a&&(r.addPreAccounts([{address:a,role:AccountRole.READONLY}]),i.__option==="Some"&&s.push({domainConfigKey:a,verifyArgs:i.value}));}return {secp256r1VerifyArgs:s}}function mM({secp256r1VerifyInput:e,transactionMessage:n,accountMetas:r,compressed:s,payer:t,settingsMutArgs:c,proof:a,systemOffset:i,secp256r1VerifyArgs:o,settings:u,remainingAccounts:d}){let g=[];e.length>0&&g.push(V(e));let p=yM(n,r);if(s){if(!t||!c)throw new Error("Payer not found or proof args is missing.");let l=v(a,i);g.push(Bu({secp256r1VerifyArgs:o,transactionMessage:p,settingsMutArgs:c,compressedProofArgs:l,payer:t,remainingAccounts:d}));}else g.push(vu({secp256r1VerifyArgs:o,settings:u,transactionMessage:p,remainingAccounts:d}));return g}function yM(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 $6({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=Se(s),u=await ue(e),d=await ve(u),[{packedAccounts:g,proof:p,settingsMutArgs:l},{value:S}]=await Promise.all([Me(i,e,n,false,t),rt(d,t)]);if((S?.lamports??0)<BigInt(c))throw new Error("Insufficient balance");let b=[],x=[];for(let W of o)if(W instanceof P){let G=b.length,{domainConfig:q,verifyArgs:ie,signature:ee,publicKey:le,message:Ae}=J(W,G);Ae&&ee&&le&&b.push({message:Ae,signature:ee,publicKey:le}),q&&(g.addPreAccounts([{address:q,role:AccountRole.READONLY}]),ie.__option==="Some"&&x.push({domainConfigKey:q,verifyArgs:ie.value}));}else g.addPreAccounts([{address:W.address,role:AccountRole.READONLY_SIGNER,signer:W}]);let{remainingAccounts:C,systemOffset:_}=g.toAccountMetas(),I=[];if(b.length>0&&I.push(V(b)),i){if(!a||!l)throw new Error("Payer not found or proof args is missing.");let W=v(p,_);I.push(Ji({amount:c,settingsMutArgs:l,compressedProofArgs:W,payer:a,secp256r1VerifyArgs:x,source:d,destination:r,remainingAccounts:C}));}else I.push(Hi({amount:c,secp256r1VerifyArgs:x,source:d,destination:r,settings:u,remainingAccounts:C}));return I}var IM=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),CM=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Jr=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function gV({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,splInterfacePdaArgs:u={index:0,restricted:false},compressed:d=false}){let g=Se(t),p=await ue(e),l=await ve(p),S=U=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(U),getAddressEncoder().encode(Jr),getAddressEncoder().encode(s)],programAddress:Jr}),b=()=>{let U=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(s)];return u.restricted&&U.push(getUtf8Encoder().encode("restricted")),u.index>0&&U.push(getU8Encoder().encode(u.index)),U},[x,[C],_,[I],[W]]=await Promise.all([getAssociatedTokenAccountAddress(s,l,o),S(l),getAssociatedTokenAccountAddress(s,r,o),S(r),getProgramDerivedAddress({seeds:b(),programAddress:Jr})]),[G,q,ie,ee]=await Promise.all([rt(_,c),rt(x,c),rt(C,c),PM(d,e,n,c)]),le=!!G.value,Ae=!!q.value,lt=!!ie.value,ft=Ae?getTokenDecoder().decode(getBase64Encoder().encode(q.value.data[0])).amount:BigInt(0),ct=BigInt(lt?MM(new Uint8Array(getBase64Encoder().encode(ie.value.data[0])))?.amount??0:0),ir=le?_:void 0,Xr=le?void 0:I,St=Ae&&(ft+ct<BigInt(a)||ct>BigInt(0)||!le)||!Ae&&le,T=!le,[me,Ao]=await Promise.all([DM(l,s,ft,ct,BigInt(a),d?3:4),EM(St,W,c)]),Y=me.reduce((U,re)=>U+re.parsed.amount.toNumber(),0);if(ft+ct+BigInt(Y)<BigInt(a))throw new Error("Insufficient balance");let at=null,Ue=null,We=new B;if(Ao&&We.addPreAccounts([{address:s,role:AccountRole.WRITABLE}]),ee||me.length){await We.addSystemAccounts();let U=[];if(me.length&&U.push(...me.map(re=>({hash:re.compressedAccount.hash,tree:re.compressedAccount.treeInfo.tree,queue:re.compressedAccount.treeInfo.queue,data:re.compressedAccount.data,address:re.compressedAccount.address}))),ee&&U.push(ee),Ue=await w(U,[]),ee){let re=me.length;at=de(We,Ue.treeInfos.slice(re),Ue.leafIndices.slice(re),Ue.rootIndices.slice(re),Ue.proveByIndices.slice(re),U.slice(re),Z())[0];}}let QA=me.length&&Ue?some(me.map((U,re)=>({isFrozen:U.parsed.state===AccountState.Frozen,hasDelegate:U.parsed.delegate!=null,amount:U.parsed.amount.toNumber(),merkleContext:{leafIndex:U.compressedAccount.leafIndex,merkleTreePubkeyIndex:We.insertOrGet(U.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:We.insertOrGet(U.compressedAccount.treeInfo.queue.toString()),proveByIndex:U.compressedAccount.proveByIndex},rootIndex:Ue.rootIndices[re],version:nA(U.compressedAccount.data?.discriminator),tlv:U.parsed.tlv?some(getArrayDecoder(Lt()).decode(U.parsed.tlv)):none()}))):none(),dr=[],go=[];for(let U of g)if(U instanceof P){let re=dr.length,{domainConfig:Qr,verifyArgs:mo,signature:yo,publicKey:To,message:lo}=J(U,re);lo&&yo&&To&&dr.push({message:lo,signature:yo,publicKey:To}),Qr&&(We.addPreAccounts([{address:Qr,role:AccountRole.READONLY}]),mo.__option==="Some"&&go.push({domainConfigKey:Qr,verifyArgs:mo.value}));}else We.addPreAccounts([{address:U.address,role:AccountRole.READONLY_SIGNER,signer:U}]);let{remainingAccounts:$A,systemOffset:eg}=We.toAccountMetas(),ur=[];dr.length>0&&ur.push(V(dr));let tg=v(Ue,eg),rg=St?W:void 0,ng=T?CM:void 0,sg=St?some(u):none(),po={amount:a,secp256r1VerifyArgs:go,source:l,destination:r,sourceCtokenTokenAccount:C,sourceSplTokenAccount:x,destinationCtokenTokenAccount:Xr,destinationSplTokenAccount:ir,mint:s,tokenProgram:o,remainingAccounts:$A,payer:i,sourceCompressedTokenAccounts:QA,compressedProofArgs:tg,compressibleConfig:IM,splInterfacePda:rg,rentSponsor:ng,splInterfacePdaArgs:sg};if(d){if(!at)throw new Error("Payer not found or proof args is missing.");ur.push(ad({...po,settingsMutArgs:at}));}else ur.push($i({...po,settings:p}));return ur}async function EM(e,n,r){if(!e)return false;let{value:s}=await rt(n,r);return !s}async function DM(e,n,r,s,t,c){let a=t-r-s;if(a<=0)return [];let o=(await tt().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(n)})).items.filter(g=>!!g.compressedAccount.data?.data.length&&g.compressedAccount.owner.toString()===Jr.toString()&&!g.parsed.amount.isZero()).sort((g,p)=>p.parsed.amount.cmp(g.parsed.amount));if(o.length===0)return [];let u=BigInt(0),d=[];for(let g of o){if(d.length>=c||u>=a)break;u+=BigInt(g.parsed.amount.toNumber()),d.push(g);}if(u<a)throw d.length>=c?new Error("Transaction size limit exceeded. Consider multiple transfers to transfer full balance."):new Error("Insufficient balance.");return d}async function PM(e,n,r,s){if(!e)return null;let{address:t}=await ae(n,r);return (await Te([{address:t,type:"Settings"}],s))[0]}function MM(e){if(!e||e.length===0)return null;try{return {amount:getU64Decoder().decode(e.slice(64,72))}}catch(n){return console.error("Token data parsing error:",n),null}}async function EV({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:a,proof:i,settingsMutArgs:o}=r,u=Se(e),d=u.filter(_=>!(_ instanceof P));a.addPreAccounts(d.map(_=>({address:_.address,role:AccountRole.READONLY_SIGNER,signer:_})));let g=u.filter(_=>_ instanceof P),p=[],l=[];for(let _ of g){let I=l.length,{domainConfig:W,verifyArgs:G,signature:q,publicKey:ie,message:ee}=J(_,I);ee&&q&&ie&&l.push({message:ee,signature:q,publicKey:ie}),W&&(a.addPreAccounts([{address:W,role:AccountRole.READONLY}]),G.__option==="Some"&&p.push({domainConfigKey:W,verifyArgs:G.value}));}let{remainingAccounts:S,systemOffset:b}=a.toAccountMetas(),x=v(i,b),C=[];if(l.length>0&&C.push(V(l)),c){if(!o)throw new Error("Payer not found or proof args is missing.");C.push(Ca({configActions:t,payer:n,compressedProofArgs:x,settingsMutArgs:o,remainingAccounts:S,secp256r1VerifyArgs:p}));}else C.push(await ma({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:S,secp256r1VerifyArgs:p}));return C}async function _V({createUserArgs:e,payer:n}){let r=new B;await r.addSystemAccounts(),r.addPreAccounts(e.map(d=>({address:d.member.address,role:AccountRole.READONLY_SIGNER,signer:d.member})));let s=await he(),t=await Promise.all(e.map(async d=>{let{address:g,addressTree:p}=await N(d.member.address,s);return {address:g,tree:p,queue:p,type:"User"}})),c=await w([],t),a=await ge(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),u=v(c,o);return await Ya({compressedProofArgs:u,payer:n,createUserArgs:e.map((d,g)=>({member:d.member.address,role:d.role,userCreationArgs:a[g],transactionManagerUrl:d.role===2?d.transactionManagerUrl:null})),remainingAccounts:i})}async function BV({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let a=[],i=[];i.push(...await Te([{address:(await N(r.address,s)).address,type:"User"}],t));let o=await he(),{address:u,addressTree:d}=await ae(e,o);a.push({address:u,queue:d,tree:d,type:"Settings"});let g=i.length,p=await w(i,a),l=de(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),i.filter(I=>I.type==="User"),$())[0],b=(await ge(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),a)).find(I=>I.type==="Settings")??null,{remainingAccounts:x,systemOffset:C}=c.toAccountMetas(),_=v(p,C);if(!b)throw new Error("Settings creation args is missing.");return await ha({settingsIndex:e,payer:n,initialMember:r,userReadonlyArgs:l,compressedProofArgs:_,settingsCreation:b,remainingAccounts:x})}async function jV({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:a,settingsMutArgs:i}=await Me(true,e,n,false,t);if(!i)throw new Error("Proof args is missing");let o=Se(s),u=o.filter(C=>C instanceof P),d=[],g=[];for(let C of u){let _=d.length,{domainConfig:I,verifyArgs:W,signature:G,publicKey:q,message:ie}=J(C,_);ie&&G&&q&&d.push({message:ie,signature:G,publicKey:q}),I&&(c.addPreAccounts([{address:I,role:AccountRole.READONLY}]),W.__option==="Some"&&g.push({domainConfigKey:I,verifyArgs:W.value}));}c.addPreAccounts(o.filter(C=>"address"in C).map(C=>({address:C.address,role:AccountRole.READONLY_SIGNER,signer:C})));let{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),S=v(a,l),b=[];d.length>0&&b.push(V(d));let x=await ue(e);return b.push(ti({settings:x,payer:r,settingsMutArgs:i,compressedProofArgs:S,secp256r1VerifyArgs:g,remainingAccounts:p})),b}async function $V({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new B;await a.addSystemAccounts();let i=await he(),{address:o,addressTree:u}=await N(r.address,i),d=[{address:o,tree:u,queue:u,type:"User"}],g=await w([],d),p=(await ge(a,g.treeInfos,g.roots,g.rootIndices,d))[0],l=a.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:v(g,l.systemOffset),authorityCreationArgs:p};}return pi({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function o8({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new B;await s.addSystemAccounts();let t=await Te([{address:(await N(e.address,n)).address,type:"User"}]),c=await w(t,[]),a=de(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,$())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),u=v(c,o);return Si({authority:e,transactionManagerUrl:r,compressedProofArgs:u,userMutArgs:a,remainingAccounts:i})}async function y8({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:a,message:i,signature:o,publicKey:u}=J(n),d=[];i&&o&&u&&d.push({message:i,signature:o,publicKey:u});let g=await Vr(n instanceof P?n:n.address,r,t),p=[];p.push({address:(await N(n instanceof P?n:n.address,r)).address,type:"User"});let l,S=null,b,x=null;g.delegatedTo.__option==="Some"&&((await Ys(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):l=await ue(g.delegatedTo.value.index)),s&&((await Ys(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):b=await ue(s.index));let C=new B;await C.addSystemAccounts();let _=await Te(p,t),I=await w(_,[]),W=de(C,I.treeInfos.slice(0,1),I.leafIndices.slice(0,1),I.rootIndices.slice(0,1),I.proveByIndices.slice(0,1),_.slice(0,1),$())[0],G=S?some(de(C,I.treeInfos.slice(S.start,S.end),I.leafIndices.slice(S.start,S.end),I.rootIndices.slice(S.start,S.end),I.proveByIndices.slice(S.start,S.end),_.slice(S.start,S.end),Z())[0]):none(),q=x?some(de(C,I.treeInfos.slice(x.start,x.end),I.leafIndices.slice(x.start,x.end),I.rootIndices.slice(x.start,x.end),I.proveByIndices.slice(x.start,x.end),_.slice(x.start,x.end),Z())[0]):none(),{remainingAccounts:ie,systemOffset:ee}=C.toAccountMetas(),le=v(I,ee),Ae=[];return d.length>0&&Ae.push(V(d)),Ae.push(Pi({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof P?void 0:n,oldSettings:l,oldSettingsMutArgs:G,newSettings:b,newSettingsMutArgs:q,compressedProofArgs:le,userMutArgs:W,remainingAccounts:ie})),Ae}async function v8({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await Yc(ce(),s),o=i.data.multiWalletSettings,{packedAccounts:u,proof:d,settingsMutArgs:g}=await Me(c,e,n,false,a),{remainingAccounts:p,systemOffset:l}=u.toAccountMetas(),{domainConfig:S,verifyArgs:b,message:x,signature:C,publicKey:_}=J(r),I=[];if(x&&C&&_&&I.push(V([{message:x,signature:C,publicKey:_}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let W=v(d,l);I.push(Sd({transactionBuffer:s,domainConfig:S,closer:r instanceof P?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:b,settingsMutArgs:g,payer:t,compressedProofArgs:W,remainingAccounts:p}));}else I.push(pd({transactionBuffer:s,domainConfig:S,closer:r instanceof P?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:b,remainingAccounts:[]}));return I}function FA({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:u,expectedSecp256r1Signers:d}){let{domainConfig:g,verifyArgs:p,message:l,signature:S,publicKey:b}=J(n),x=[];if(l&&S&&b&&x.push(V([{message:l,signature:S,publicKey:b}])),u){let{settingsReadonlyArgs:C,compressedProofArgs:_,remainingAccounts:I}=u;x.push(vd({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:d},settingsReadonlyArgs:C,compressedProofArgs:_,remainingAccounts:I}));}else x.push(Pd({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:d},remainingAccounts:[]}));return x}function GA({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=J(e),u=[];return i&&a&&o&&u.push(V([{message:i,signature:a,publicKey:o}])),s?u.push(Gd({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof P?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(Bd({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof P?void 0:e,remainingAccounts:[]})),u}function zA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?tu({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Yd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function KA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=J(n),u=[];return o&&a&&i&&u.push(V([{message:o,signature:a,publicKey:i}])),s?u.push(pu({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof P?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(au({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof P?void 0:n,remainingAccounts:[]})),u}async function xH({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await _M(r),a=new B,i=null,o=null,u=[];if(c.length||t){let g=await vM({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 UM({configActionsArgs:r,userMutArgs:u,index:e}),index:e,proof:i,settingsMutArgs:o,packedAccounts:a,compressed:t}}async function _M(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>N(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let s=await Promise.all(r.members.map(t=>N(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function vM({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let a=[];if(r){let l=(await ae(s,t)).address;a.push({address:l,type:"Settings"});}n.length&&a.push(...n);let i=a.length?await Te(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await w(i,[]),u=[],d=[];for(let l of i)l.type==="Settings"?u.push(l):l.type==="User"&&d.push(l);let g,p=[];if(r&&o&&(g=de(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),u,Z())[0]),d.length&&o){let l=r?1:0;p=de(e,o.treeInfos.slice(l),o.leafIndices.slice(l),o.rootIndices.slice(l),o.proveByIndices.slice(l),d,$());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function UM({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 N(a.member,a.userAddressTreeIndex).then(o=>r.find(u=>equalBytes(new Uint8Array(u.accountMeta.address),new Uint8Array(getBase58Encoder().encode(encodeBN254toBase58(o.address))))));if(!i)throw new Error("Unable to find user account");c.push(LM({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=>N(a.member,a.userAddressTreeIndex).then(i=>{let o=r.find(u=>equalBytes(new Uint8Array(u.accountMeta.address),new Uint8Array(getBase58Encoder().encode(encodeBN254toBase58(i.address)))));if(!o)throw new Error("Unable to find user account");return kM({pubkey:a.member,userMutArgs:o,index:e})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(a=>WM({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 WM({pubkey:e,permissionArgs:n}){return {memberKey:mt(e),permissions:YA(n)}}function kM({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:mt(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function LM({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:mt(e),permissions:YA(n),userReadonlyArgs:r}}function YA(e){let n=[];return e.initiate&&n.push(_e.InitiateTransaction),e.vote&&n.push(_e.VoteTransaction),e.execute&&n.push(_e.ExecuteTransaction),Be.fromPermissions(n)}async function RH({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:u=false,additionalVoters:d=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:l}){let S=await ue(n),b=Math.floor(Math.random()*255),x=await uA(S,t instanceof P?t:t.address,b),C=[],_=[];for(let Y=0;Y<s.length;Y+=p){let at=s.subarray(Y,Y+p);C.push(at),_.push(sha256(at));}let I=sha256(new Uint8Array(s)),{settingsReadonlyArgs:W,settingsMutArgs:G,proof:q,packedAccounts:ie}=await Me(u,n,r,false,l),{remainingAccounts:ee,systemOffset:le}=ie.toAccountMetas(),Ae=q&&W&&G?{settingsReadonlyArgs:W,settingsMutArgs:G,compressedProofArgs:v(q,le),remainingAccounts:ee,payer:e}:null,lt=Se([t,...c?[c]:[],...d]).filter(Y=>Y instanceof P).map(Y=>({memberKey:mt(Y),messageHash:Qs(Y.authResponse)})),ft=FA({finalBufferHash:I,finalBufferSize:s.length,bufferIndex:b,payer:e,transactionBufferAddress:x,settings:S,creator:t,preauthorizeExecution:!c,bufferExtendHashes:_,compressedArgs:Ae,expectedSecp256r1Signers:lt}),ct=C.map(Y=>zA({transactionMessageBytes:Y,transactionBufferAddress:x,settings:S,compressed:u})),ir=d.map(Y=>KA({voter:Y,transactionBufferAddress:x,settings:S,compressedArgs:Ae})),Xr=GA({compressedArgs:Ae,settings:S,executor:c,transactionBufferAddress:x}),{instructions:St,addressLookupTableAccounts:T}=await UA({compressed:u,settings:S,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),me=Y=>({payer:e,instructions:Y,addressesByLookupTableAddress:T});return [me(ft),...ct.map(Y=>me([Y])),...ir.length?[me(ir.flat())]:[],me(Xr),me(St)]}var Yr=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 Zr=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 XA({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Yr.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:S,drainedKeys:b}=l;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),a.writable.push(...b.writable),a.readonly.push(...b.readonly);}}let[o,u]=t.getMessageComponents(),g=new Zr(u,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:u,addressTableLookups:c}}function HH({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=XA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return Ku(s)}async function jH({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:u=false}){let{instructions:d,addressLookupTableAccounts:g}=await WA({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:i});return {payer:e,instructions:d,addressesByLookupTableAddress:g}}
|
|
2
|
-
export{oa as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,Hu as AuthenticationContextSchema,pr as BACKOFF_MAX_DELAY_MS,xo as BUNDLE_POLL_DELAY_MS,So as BUNDLE_POLL_MAX_RETRIES,Fu as BaseResponseSchema,ye as BundleError,Sa as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,ga as CHANGE_CONFIG_DISCRIMINATOR,fo as COMPUTE_UNIT_MULTIPLIER,Pa as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,La as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,wa as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Ga as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,Ja as CREATE_USER_ACCOUNTS_DISCRIMINATOR,LN as CompleteMessageRequestSchema,ON as CompleteTransactionRequestSchema,Qa as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Io as DEFAULT_JITO_BLOCK_ENGINE_URL,Co as DEFAULT_JITO_TIPS_URL,Eo as DEFAULT_JITO_TIP_PRIORITY,Le as DEFAULT_NETWORK_RETRY_DELAY_MS,ke as DEFAULT_NETWORK_RETRY_MAX_RETRIES,si as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Ro as DOMAIN_CONFIG_DISCRIMINATOR,Ai as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,Ti as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,Ci as EDIT_USER_DELEGATE_DISCRIMINATOR,gr as EXPONENTIAL_BACKOFF_BASE,ko as GLOBAL_COUNTER_DISCRIMINATOR,Po as HTTP_STATUS_BAD_REQUEST,tn as HTTP_STATUS_INTERNAL_SERVER_ERROR,Mo as HTTP_STATUS_TOO_MANY_REQUESTS,en as JITO_TIP_ACCOUNTS,tr as KeyType,Do as MAX_TRANSACTION_BUFFER_INDEX,Ri as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,ki as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,Ar as MIN_COMPUTE_UNITS,zE as MULTI_WALLET_ERROR__ALREADY_DELEGATED,IE as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,kD as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,uD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,AD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,UD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,FD as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,DE as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,EE as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,kE as MULTI_WALLET_ERROR__EMPTY_MEMBERS,lD as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,UE as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,CE as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,_E as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,$E as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,eD as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,tD as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,TD as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,JE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,KE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,jE as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,wE as MULTI_WALLET_ERROR__INVALID_ACCOUNT,vD as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,mD as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,WE as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,HE as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,QE as MULTI_WALLET_ERROR__INVALID_BUFFER,fD as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,qE as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,NE as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,hE as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,yE as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,fE as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,mE as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,lE as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,dD as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,aD as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,OE as MULTI_WALLET_ERROR__INVALID_THRESHOLD,RD as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,vE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,bE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,BE as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,VE as MULTI_WALLET_ERROR__INVALID_USER_ROLE,OD as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,hD as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,SE as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,oD as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,gD as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,ID as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,_D as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,FE as MULTI_WALLET_ERROR__MISSING_ACCOUNT,SD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,DD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,BD as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,MD as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,xD as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,GE as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,VD as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,wD as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,yD as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,ND as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,PD as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,cD as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,WD as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,HD as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,ZE as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,ME as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,RE as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,pD as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,ED as MULTI_WALLET_ERROR__PAYER_MISMATCH,PE as MULTI_WALLET_ERROR__PERMANENT_MEMBER,sD as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,xE as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,CD as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,TE as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,iD as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,bD as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,LE as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,rD as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,nD as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,XE as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,LD as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,YE as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,AE as MultiWalletAccount,gE as MultiWalletInstruction,zi as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,wi as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,De as NetworkError,ne as NotFoundError,Oe as NotInitializedError,_e as Permission,yr as PermissionError,Be as Permissions,mr as RetryExhaustedError,Ee as RevibaseError,wc as SETTINGS_DISCRIMINATOR,Ne as Secp256r1Key,P as SignedSecp256r1Key,WN as StartMessageRequestSchema,kN as StartTransactionRequestSchema,od as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Xi as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Td as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,ud as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,Rd as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,Cd as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,jc as TRANSACTION_BUFFER_DISCRIMINATOR,Vd as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,kd as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Qd as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,jd as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,uu as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,su as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,Cu as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,Tu as TRANSACTION_EXECUTE_DISCRIMINATOR,ku as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,Ru as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,$r as TRANSACTION_SIZE_LIMIT,wu as TransactionActionTypeSchema,GD as TransactionDetailsSchema,ho as TransactionError,UN as TransactionPayloadSchema,Vu as TransactionPayloadWithBase64MessageBytesSchema,it as UserRole,z as ValidationError,Qc as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,MN as addWhitelistedAddressTrees,Ve as base64URLStringToBuffer,S2 as bufferToBase64URLString,EV as changeConfig,v8 as closeTransactionBuffer,Kh as configAction,DA as convertMemberKeyToString,A2 as convertPubkeyCompressedToCose,u2 as convertPubkeyCoseToCompressed,T2 as createClientAuthorizationCompleteRequestChallenge,y2 as createClientAuthorizationStartRequestChallenge,L5 as createDomainConfig,K5 as createDomainUserAccounts,Y5 as createGlobalCounter,l2 as createMessageChallenge,FA as createTransactionBuffer,f2 as createTransactionChallenge,XP as createTransactionManagerSigner,_V as createUserAccounts,BV as createWallet,_o as decodeDomainConfig,Oo as decodeGlobalCounter,Hc as decodeSettings,qc as decodeTransactionBuffer,ea as decodeWhitelistedAddressTree,jV as decompressSettingsAccount,S5 as deserializeConfigActions,$5 as disableDomainConfig,$V as editDomainConfig,o8 as editTransactionManagerUrl,y8 as editUserDelegate,UA as executeTransaction,GA as executeTransactionBuffer,WA as executeTransactionSync,zA as extendTransactionBuffer,dR as extensionStruct,FM as fetchAllDomainConfig,YM as fetchAllGlobalCounter,fg as fetchAllMaybeDomainConfig,kg as fetchAllMaybeGlobalCounter,Al as fetchAllMaybeSettings,vl as fetchAllMaybeTransactionBuffer,Xl as fetchAllMaybeWhitelistedAddressTree,Dv as fetchAllSettings,_v as fetchAllTransactionBuffer,Lv as fetchAllWhitelistedAddressTree,vo as fetchDomainConfig,qM as fetchGlobalCounter,lg as fetchMaybeDomainConfig,Wg as fetchMaybeGlobalCounter,ys as fetchMaybeSettings,aP as fetchMaybeSettingsAccountData,_l as fetchMaybeTransactionBuffer,cP as fetchMaybeUserAccountData,Zl as fetchMaybeWhitelistedAddressTree,Ev as fetchSettings,Ys as fetchSettingsAccountData,Yc as fetchTransactionBuffer,Vr as fetchUserAccountData,ta as fetchWhitelistedAddressTree,nh as getAddMemberArgsCodec,on as getAddMemberArgsDecoder,sn as getAddMemberArgsEncoder,Qv as getAddWhitelistedAddressTreesDiscriminatorBytes,eU as getAddWhitelistedAddressTreesInstruction,aa as getAddWhitelistedAddressTreesInstructionAsync,$v as getAddWhitelistedAddressTreesInstructionDataCodec,ca as getAddWhitelistedAddressTreesInstructionDataDecoder,Es as getAddWhitelistedAddressTreesInstructionDataEncoder,$M as getAdditionalMetadataCodec,nn as getAdditionalMetadataDecoder,rn as getAdditionalMetadataEncoder,fU as getChangeConfigCompressedDiscriminatorBytes,Ca as getChangeConfigCompressedInstruction,SU as getChangeConfigCompressedInstructionDataCodec,Ia as getChangeConfigCompressedInstructionDataDecoder,xa as getChangeConfigCompressedInstructionDataEncoder,iU as getChangeConfigDiscriminatorBytes,uU as getChangeConfigInstruction,ma as getChangeConfigInstructionAsync,dU as getChangeConfigInstructionDataCodec,pa as getChangeConfigInstructionDataDecoder,Ps as getChangeConfigInstructionDataEncoder,Xs as getClientAndDeviceHash,ch as getCompiledInstructionCodec,an as getCompiledInstructionDecoder,cn as getCompiledInstructionEncoder,uh as getCompressedAccountMetaCodec,Et as getCompressedAccountMetaDecoder,Ct as getCompressedAccountMetaEncoder,mh as getCompressedAccountMetaReadOnlyCodec,ht as getCompressedAccountMetaReadOnlyDecoder,Mt as getCompressedAccountMetaReadOnlyEncoder,lh as getCompressedOnlyExtensionCodec,un as getCompressedOnlyExtensionDecoder,dn as getCompressedOnlyExtensionEncoder,xh as getCompressedProofCodec,Tn as getCompressedProofDecoder,yn as getCompressedProofEncoder,ae as getCompressedSettingsAddressFromIndex,Dh as getCompressedSettingsCodec,Rh as getCompressedSettingsDataCodec,_t as getCompressedSettingsDataDecoder,bt as getCompressedSettingsDataEncoder,Z as getCompressedSettingsDecoder,Rt as getCompressedSettingsEncoder,Uh as getCompressedTokenArgsCodec,kt as getCompressedTokenArgsDecoder,Wt as getCompressedTokenArgsEncoder,Oh as getCompressibleExtensionCodec,En as getCompressibleExtensionDecoder,Cn as getCompressibleExtensionEncoder,Vh as getCompressionInfoCodec,Pn as getCompressionInfoDecoder,Dn as getCompressionInfoEncoder,Qu as getComputeBudgetEstimate,zh as getConfigActionCodec,ze as getConfigActionDecoder,Ge as getConfigActionEncoder,hU as getCreateCompressedWalletDiscriminatorBytes,bU as getCreateCompressedWalletInstruction,ha as getCreateCompressedWalletInstructionAsync,RU as getCreateCompressedWalletInstructionDataCodec,Ma as getCreateCompressedWalletInstructionDataDecoder,Ms as getCreateCompressedWalletInstructionDataEncoder,BU as getCreateDomainConfigDiscriminatorBytes,wU as getCreateDomainConfigInstruction,Ba as getCreateDomainConfigInstructionAsync,NU as getCreateDomainConfigInstructionDataCodec,Oa as getCreateDomainConfigInstructionDataDecoder,Rs as getCreateDomainConfigInstructionDataEncoder,JU as getCreateDomainUserAccountDiscriminatorBytes,YU as getCreateDomainUserAccountInstruction,Ha as getCreateDomainUserAccountInstructionAsync,qU as getCreateDomainUserAccountInstructionDataCodec,Va as getCreateDomainUserAccountInstructionDataDecoder,_s as getCreateDomainUserAccountInstructionDataEncoder,rW as getCreateGlobalCounterDiscriminatorBytes,sW as getCreateGlobalCounterInstruction,Ka as getCreateGlobalCounterInstructionAsync,nW as getCreateGlobalCounterInstructionDataCodec,za as getCreateGlobalCounterInstructionDataDecoder,Us as getCreateGlobalCounterInstructionDataEncoder,Zh as getCreateUserAccountArgsCodec,Bn as getCreateUserAccountArgsDecoder,On as getCreateUserAccountArgsEncoder,gW as getCreateUserAccountsDiscriminatorBytes,mW as getCreateUserAccountsInstruction,Ya as getCreateUserAccountsInstructionAsync,pW as getCreateUserAccountsInstructionDataCodec,qa as getCreateUserAccountsInstructionDataDecoder,ks as getCreateUserAccountsInstructionDataEncoder,CW as getDecompressSettingsAccountDiscriminatorBytes,ti as getDecompressSettingsAccountInstruction,EW as getDecompressSettingsAccountInstructionDataCodec,ei as getDecompressSettingsAccountInstructionDataDecoder,$a as getDecompressSettingsAccountInstructionDataEncoder,_W as getDisableDomainConfigDiscriminatorBytes,ai as getDisableDomainConfigInstruction,vW as getDisableDomainConfigInstructionDataCodec,ci as getDisableDomainConfigInstructionDataDecoder,oi as getDisableDomainConfigInstructionDataEncoder,gt as getDomainConfigAddress,HM as getDomainConfigCodec,bo as getDomainConfigDecoder,VM as getDomainConfigDiscriminatorBytes,Tg as getDomainConfigEncoder,GM as getDomainConfigSize,wW as getEditDomainConfigDiscriminatorBytes,pi as getEditDomainConfigInstruction,HW as getEditDomainConfigInstructionAsync,VW as getEditDomainConfigInstructionDataCodec,gi as getEditDomainConfigInstructionDataDecoder,Os as getEditDomainConfigInstructionDataEncoder,eR as getEditMemberArgsCodec,Wn as getEditMemberArgsDecoder,Un as getEditMemberArgsEncoder,YW as getEditTransactionManagerUrlDiscriminatorBytes,Si as getEditTransactionManagerUrlInstruction,ZW as getEditTransactionManagerUrlInstructionDataCodec,fi as getEditTransactionManagerUrlInstructionDataDecoder,li as getEditTransactionManagerUrlInstructionDataEncoder,sk as getEditUserDelegateDiscriminatorBytes,Pi as getEditUserDelegateInstruction,ok as getEditUserDelegateInstructionDataCodec,Di as getEditUserDelegateInstructionDataDecoder,Ei as getEditUserDelegateInstructionDataEncoder,sR as getExpectedSecp256r1SignersCodec,Bt as getExpectedSecp256r1SignersDecoder,Ot as getExpectedSecp256r1SignersEncoder,iR as getExtensionStructCodec,Lt as getExtensionStructDecoder,ln as getExtensionStructEncoder,dA as getGlobalCounterAddress,JM as getGlobalCounterCodec,Lo as getGlobalCounterDecoder,jM as getGlobalCounterDiscriminatorBytes,Ug as getGlobalCounterEncoder,ZM as getGlobalCounterSize,js as getJitoTipsConfig,Qw as getLightCpiSigner,tt as getLightProtocolRpc,mR as getLinkWalletArgsCodec,Yn as getLinkWalletArgsDecoder,qn as getLinkWalletArgsEncoder,fR as getMemberCodec,Ut as getMemberDecoder,vt as getMemberEncoder,IR as getMemberKeyCodec,oe as getMemberKeyDecoder,se as getMemberKeyEncoder,pk as getMigrateCompressedSettingsDiscriminatorBytes,vi as getMigrateCompressedSettingsInstruction,mk as getMigrateCompressedSettingsInstructionDataCodec,_i as getMigrateCompressedSettingsInstructionDataDecoder,bi as getMigrateCompressedSettingsInstructionDataEncoder,Ck as getMigrateCompressedUsersDiscriminatorBytes,Bi as getMigrateCompressedUsersInstruction,Ek as getMigrateCompressedUsersInstructionDataCodec,Oi as getMigrateCompressedUsersInstructionDataDecoder,Li as getMigrateCompressedUsersInstructionDataEncoder,mN as getMultiWalletErrorMessage,Hk as getNativeTransferIntentCompressedDiscriminatorBytes,Ji as getNativeTransferIntentCompressedInstruction,Fk as getNativeTransferIntentCompressedInstructionDataCodec,ji as getNativeTransferIntentCompressedInstructionDataDecoder,Ki as getNativeTransferIntentCompressedInstructionDataEncoder,vk as getNativeTransferIntentDiscriminatorBytes,Hi as getNativeTransferIntentInstruction,Wk as getNativeTransferIntentInstructionAsync,Uk as getNativeTransferIntentInstructionDataCodec,Vi as getNativeTransferIntentInstructionDataDecoder,Bs as getNativeTransferIntentInstructionDataEncoder,PR as getNewAuthorityArgsCodec,$n as getNewAuthorityArgsDecoder,Qn as getNewAuthorityArgsEncoder,x2 as getOriginIndex,RR as getPackedAddressTreeInfoCodec,wt as getPackedAddressTreeInfoDecoder,Nt as getPackedAddressTreeInfoEncoder,vR as getPackedMerkleContextCodec,Sn as getPackedMerkleContextDecoder,fn as getPackedMerkleContextEncoder,kR as getPackedStateTreeInfoCodec,Pt as getPackedStateTreeInfoDecoder,Dt as getPackedStateTreeInfoEncoder,BR as getPausableAccountExtensionCodec,wn as getPausableAccountExtensionDecoder,Nn as getPausableAccountExtensionEncoder,VR as getPermanentDelegateAccountExtensionCodec,Hn as getPermanentDelegateAccountExtensionDecoder,Vn as getPermanentDelegateAccountExtensionEncoder,GR as getPermissionsCodec,Fe as getPermissionsDecoder,He as getPermissionsEncoder,JR as getProofArgsCodec,D as getProofArgsDecoder,E as getProofArgsEncoder,XR as getRemoveMemberArgsCodec,Ln as getRemoveMemberArgsDecoder,kn as getRemoveMemberArgsEncoder,eb as getRentConfigCodec,bn as getRentConfigDecoder,Rn as getRentConfigEncoder,Qs as getSecp256r1MessageHash,nb as getSecp256r1PubkeyCodec,Vt as getSecp256r1PubkeyDecoder,ss as getSecp256r1PubkeyEncoder,AM as getSecp256r1SignatureOffsetsDataDecoder,uM as getSecp256r1SignatureOffsetsDataEncoder,cb as getSecp256r1VerifyArgsCodec,F as getSecp256r1VerifyArgsDecoder,H as getSecp256r1VerifyArgsEncoder,ub as getSecp256r1VerifyArgsWithDomainAddressCodec,Q as getSecp256r1VerifyArgsWithDomainAddressDecoder,X as getSecp256r1VerifyArgsWithDomainAddressEncoder,V as getSecp256r1VerifyInstruction,R6 as getSecp256r1VerifyInstructionDataCodec,_A as getSecp256r1VerifyInstructionDataDecoder,vA as getSecp256r1VerifyInstructionDataEncoder,Xu as getSendAndConfirmTransaction,Cv as getSettingsCodec,mb as getSettingsCreationArgsCodec,Ft as getSettingsCreationArgsDecoder,Ht as getSettingsCreationArgsEncoder,Vc as getSettingsDecoder,Iv as getSettingsDiscriminatorBytes,ul as getSettingsEncoder,ue as getSettingsFromIndex,lb as getSettingsIndexWithAddressCodec,zt as getSettingsIndexWithAddressDecoder,Gt as getSettingsIndexWithAddressEncoder,Ib as getSettingsMutArgsCodec,j as getSettingsMutArgsDecoder,K as getSettingsMutArgsEncoder,Pb as getSettingsReadonlyArgsCodec,jt as getSettingsReadonlyArgsDecoder,Kt as getSettingsReadonlyArgsEncoder,g2 as getSignedSecp256r1Key,l5 as getSignedTransactionManager,ce as getSolanaRpc,Zu as getSolanaRpcEndpoint,Rb as getSplInterfacePdaArgsCodec,qt as getSplInterfacePdaArgsDecoder,Jt as getSplInterfacePdaArgsEncoder,Ub as getTokenMetadataCodec,Gn as getTokenMetadataDecoder,Fn as getTokenMetadataEncoder,cL as getTokenTransferIntentCompressedDiscriminatorBytes,ad as getTokenTransferIntentCompressedInstruction,iL as getTokenTransferIntentCompressedInstructionAsync,aL as getTokenTransferIntentCompressedInstructionDataCodec,cd as getTokenTransferIntentCompressedInstructionDataDecoder,Hs as getTokenTransferIntentCompressedInstructionDataEncoder,Zk as getTokenTransferIntentDiscriminatorBytes,$i as getTokenTransferIntentInstruction,Qk as getTokenTransferIntentInstructionAsync,Xk as getTokenTransferIntentInstructionDataCodec,Qi as getTokenTransferIntentInstructionDataDecoder,Vs as getTokenTransferIntentInstructionDataEncoder,uA as getTransactionBufferAddress,PL as getTransactionBufferCloseCompressedDiscriminatorBytes,Sd as getTransactionBufferCloseCompressedInstruction,ML as getTransactionBufferCloseCompressedInstructionDataCodec,fd as getTransactionBufferCloseCompressedInstructionDataDecoder,ld as getTransactionBufferCloseCompressedInstructionDataEncoder,TL as getTransactionBufferCloseDiscriminatorBytes,pd as getTransactionBufferCloseInstruction,lL as getTransactionBufferCloseInstructionDataCodec,gd as getTransactionBufferCloseInstructionDataDecoder,Ad as getTransactionBufferCloseInstructionDataEncoder,bv as getTransactionBufferCodec,Ob as getTransactionBufferCreateArgsCodec,Zt as getTransactionBufferCreateArgsDecoder,Yt as getTransactionBufferCreateArgsEncoder,GL as getTransactionBufferCreateCompressedDiscriminatorBytes,vd as getTransactionBufferCreateCompressedInstruction,zL as getTransactionBufferCreateCompressedInstructionDataCodec,_d as getTransactionBufferCreateCompressedInstructionDataDecoder,bd as getTransactionBufferCreateCompressedInstructionDataEncoder,kL as getTransactionBufferCreateDiscriminatorBytes,Pd as getTransactionBufferCreateInstruction,LL as getTransactionBufferCreateInstructionDataCodec,Dd as getTransactionBufferCreateInstructionDataDecoder,Ed as getTransactionBufferCreateInstructionDataEncoder,Jc as getTransactionBufferDecoder,Rv as getTransactionBufferDiscriminatorBytes,bl as getTransactionBufferEncoder,aO as getTransactionBufferExecuteCompressedDiscriminatorBytes,Gd as getTransactionBufferExecuteCompressedInstruction,iO as getTransactionBufferExecuteCompressedInstructionDataCodec,Fd as getTransactionBufferExecuteCompressedInstructionDataDecoder,Hd as getTransactionBufferExecuteCompressedInstructionDataEncoder,QL as getTransactionBufferExecuteDiscriminatorBytes,Bd as getTransactionBufferExecuteInstruction,$L as getTransactionBufferExecuteInstructionDataCodec,Od as getTransactionBufferExecuteInstructionDataDecoder,Ld as getTransactionBufferExecuteInstructionDataEncoder,EO as getTransactionBufferExtendCompressedDiscriminatorBytes,tu as getTransactionBufferExtendCompressedInstruction,DO as getTransactionBufferExtendCompressedInstructionDataCodec,eu as getTransactionBufferExtendCompressedInstructionDataDecoder,$d as getTransactionBufferExtendCompressedInstructionDataEncoder,yO as getTransactionBufferExtendDiscriminatorBytes,Yd as getTransactionBufferExtendInstruction,TO as getTransactionBufferExtendInstructionDataCodec,qd as getTransactionBufferExtendInstructionDataDecoder,Jd as getTransactionBufferExtendInstructionDataEncoder,HO as getTransactionBufferVoteCompressedDiscriminatorBytes,pu as getTransactionBufferVoteCompressedInstruction,FO as getTransactionBufferVoteCompressedInstructionDataCodec,gu as getTransactionBufferVoteCompressedInstructionDataDecoder,Au as getTransactionBufferVoteCompressedInstructionDataEncoder,UO as getTransactionBufferVoteDiscriminatorBytes,au as getTransactionBufferVoteInstruction,WO as getTransactionBufferVoteInstructionDataCodec,cu as getTransactionBufferVoteInstructionDataDecoder,ou as getTransactionBufferVoteInstructionDataEncoder,nB as getTransactionExecuteCompressedDiscriminatorBytes,Pu as getTransactionExecuteCompressedInstruction,sB as getTransactionExecuteCompressedInstructionDataCodec,Du as getTransactionExecuteCompressedInstructionDataDecoder,Eu as getTransactionExecuteCompressedInstructionDataEncoder,YO as getTransactionExecuteDiscriminatorBytes,Su as getTransactionExecuteInstruction,ZO as getTransactionExecuteInstructionDataCodec,fu as getTransactionExecuteInstructionDataDecoder,lu as getTransactionExecuteInstructionDataEncoder,IB as getTransactionExecuteSyncCompressedDiscriminatorBytes,Bu as getTransactionExecuteSyncCompressedInstruction,CB as getTransactionExecuteSyncCompressedInstructionDataCodec,Ou as getTransactionExecuteSyncCompressedInstructionDataDecoder,Lu as getTransactionExecuteSyncCompressedInstructionDataEncoder,gB as getTransactionExecuteSyncDiscriminatorBytes,vu as getTransactionExecuteSyncInstruction,pB as getTransactionExecuteSyncInstructionDataCodec,_u as getTransactionExecuteSyncInstructionDataDecoder,bu as getTransactionExecuteSyncInstructionDataEncoder,Gb as getTransactionMessageAddressTableLookupCodec,gs as getTransactionMessageAddressTableLookupDecoder,As as getTransactionMessageAddressTableLookupEncoder,Vb as getTransactionMessageCodec,Qt as getTransactionMessageDecoder,Xt as getTransactionMessageEncoder,jb as getTransferFeeAccountExtensionCodec,Kn as getTransferFeeAccountExtensionDecoder,zn as getTransferFeeAccountExtensionEncoder,Yb as getTransferHookAccountExtensionCodec,Jn as getTransferHookAccountExtensionDecoder,jn as getTransferHookAccountExtensionEncoder,N as getUserAccountAddress,$b as getUserCodec,n_ as getUserCreationArgsCodec,Ie as getUserCreationArgsDecoder,xe as getUserCreationArgsEncoder,$ as getUserDecoder,Xe as getUserEncoder,a_ as getUserMutArgsCodec,$e as getUserMutArgsDecoder,Qe as getUserMutArgsEncoder,A_ as getUserReadOnlyArgsCodec,be as getUserReadOnlyArgsDecoder,Re as getUserReadOnlyArgsEncoder,y_ as getUserReadOnlyOrMutateArgsCodec,ts as getUserReadOnlyOrMutateArgsDecoder,es as getUserReadOnlyOrMutateArgsEncoder,x_ as getUserRoleCodec,je as getUserRoleDecoder,Ke as getUserRoleEncoder,Xw as getWalletAddressFromIndex,ve as getWalletAddressFromSettings,kv as getWhitelistedAddressTreeCodec,$c as getWhitelistedAddressTreeDecoder,Wv as getWhitelistedAddressTreeDiscriminatorBytes,Yl as getWhitelistedAddressTreeEncoder,Zs as getWhitelistedAddressTreeFromIndex,ww as getWhitelistedAddressTreeIndexFromAddress,sA as getWhitelistedAddressTreesAddress,aN as identifyMultiWalletAccount,iN as identifyMultiWalletInstruction,iw as initialize,jh as isConfigAction,uR as isExtensionStruct,yN as isMultiWalletError,l_ as isUserReadOnlyOrMutateArgs,c6 as migrateSettings,p6 as migrateUsers,$6 as nativeTransferIntent,tU as parseAddWhitelistedAddressTreesInstruction,xU as parseChangeConfigCompressedInstruction,AU as parseChangeConfigInstruction,_U as parseCreateCompressedWalletInstruction,VU as parseCreateDomainConfigInstruction,ZU as parseCreateDomainUserAccountInstruction,oW as parseCreateGlobalCounterInstruction,yW as parseCreateUserAccountsInstruction,DW as parseDecompressSettingsAccountInstruction,UW as parseDisableDomainConfigInstruction,FW as parseEditDomainConfigInstruction,XW as parseEditTransactionManagerUrlInstruction,ck as parseEditUserDelegateInstruction,yk as parseMigrateCompressedSettingsInstruction,Dk as parseMigrateCompressedUsersInstruction,Gk as parseNativeTransferIntentCompressedInstruction,kk as parseNativeTransferIntentInstruction,b6 as parseSecp256r1VerifyInstruction,dL as parseTokenTransferIntentCompressedInstruction,$k as parseTokenTransferIntentInstruction,hL as parseTransactionBufferCloseCompressedInstruction,fL as parseTransactionBufferCloseInstruction,KL as parseTransactionBufferCreateCompressedInstruction,OL as parseTransactionBufferCreateInstruction,dO as parseTransactionBufferExecuteCompressedInstruction,eO as parseTransactionBufferExecuteInstruction,PO as parseTransactionBufferExtendCompressedInstruction,lO as parseTransactionBufferExtendInstruction,GO as parseTransactionBufferVoteCompressedInstruction,kO as parseTransactionBufferVoteInstruction,oB as parseTransactionExecuteCompressedInstruction,XO as parseTransactionExecuteInstruction,EB as parseTransactionExecuteSyncCompressedInstruction,mB as parseTransactionExecuteSyncInstruction,J2 as pollJitoBundleConfirmation,xH as prepareChangeConfigArgs,RH as prepareTransactionBundle,HH as prepareTransactionMessage,jH as prepareTransactionSync,T5 as retrieveTransactionManager,WP as sendJitoBundle,f5 as serializeConfigActions,j2 as signAndSendBundledTransactions,e5 as signAndSendTransaction,gV as tokenTransferIntent,T_ as userReadOnlyOrMutateArgs,ju as vaultTransactionMessageDeserialize,Ku as vaultTransactionMessageSerialize,KA 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,getU64Encoder,getU64Decoder,getOptionEncoder,getOptionDecoder,getArrayEncoder,getArrayDecoder,getU16Encoder,getBooleanEncoder,getU16Decoder,getBooleanDecoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUtf8Encoder,getUtf8Decoder,getUnitEncoder,getUnitDecoder,getEnumEncoder,getEnumDecoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,createSolanaClient,getBase64Encoder,getBase64Decoder,getBase64EncodedWireTransaction,pipe,createTransactionMessage,appendTransactionMessageInstructions,setTransactionMessageFeePayerSigner,setTransactionMessageLifetimeUsingBlockhash,compressTransactionMessageUsingAddressLookupTables,prependTransactionMessageInstructions,signTransactionMessageWithSigners,getSignatureFromTransaction,some,none,createDecoder,createEncoder,AccountRole,upgradeRoleToSigner,getBlockhashDecoder,compileTransaction,getTransactionEncoder,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {createRpc,deriveAddressSeedV2,createBN254,deriveAddressV2,encodeBN254toBase58,getLightSystemAccountMetasV2,TreeType,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {sha256}from'@noble/hashes/sha2.js';import {PublicKey}from'@solana/web3.js';import f from'zod';import {base64URLStringToBuffer}from'@simplewebauthn/browser';import {estimateComputeUnitLimitFactory,getSetComputeUnitLimitInstruction,getSetComputeUnitPriceInstruction,getAssociatedTokenAccountAddress,getTokenDecoder,AccountState,getTransferSolInstruction}from'gill/programs';import {p256}from'@noble/curves/nist.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {equalBytes}from'@noble/curves/utils.js';var rn=1644,gr=2e5,Co=1.1,Eo=30,Do=3e3,nn=3,Po=500,Mo=2,ho=3e4,sn=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Ro="https://mainnet.block-engine.jito.wtf/api/v1",bo="https://bundles.jito.wtf/api/v1/bundles/tip_floor",_o="landed_tips_75th_percentile",vo=255,Uo=400,Wo=429,on=500;var Ee=class extends Error{constructor(r,s,t){super(r);this.code=s;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},Le=class extends Ee{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},oe=class extends Ee{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},K=class extends Ee{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},De=class extends Ee{constructor(r,s,t){super(r,"NETWORK_ERROR",{statusCode:s,url:t});this.statusCode=s;this.url=t;}},ko=class extends Ee{constructor(r,s,t){super(r,"TRANSACTION_ERROR",{signature:s,logs:t});this.signature=s;this.logs=t;}},me=class extends Ee{constructor(r,s,t){super(r,"BUNDLE_ERROR",{bundleId:s,attempt:t});this.bundleId=s;this.attempt=t;}},pr=class extends Ee{constructor(r,s,t){super(`Operation "${r}" failed after ${s} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=s;this.lastError=t;}},mr=class extends Ee{constructor(r,s,t){super(r,"PERMISSION_ERROR",{required:s,actual:t});this.required=s;this.actual=t;}};var Lo=new Uint8Array([201,232,212,229,59,241,106,197]);function Ih(){return fixEncoderSize(getBytesEncoder(),8).encode(Lo)}function vg(){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:Lo}))}function Oo(){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 Ch(){return combineCodec(vg(),Oo())}function Bo(e){return decodeAccount(e,Oo())}async function No(e,n,r){let s=await Ug(e,n,r);return assertAccountExists(s),s}async function Ug(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Bo(s)}async function Eh(e,n,r){let s=await Wg(e,n,r);return assertAccountsExist(s),s}async function Wg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Bo(t))}function Dh(){return 846}var Ho=new Uint8Array([42,206,176,58,175,129,130,233]);function hh(){return fixEncoderSize(getBytesEncoder(),8).encode(Ho)}function Jg(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Ho}))}function Fo(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function Rh(){return combineCodec(Jg(),Fo())}function Go(e){return decodeAccount(e,Fo())}async function bh(e,n,r){let s=await qg(e,n,r);return assertAccountExists(s),s}async function qg(e,n,r){let s=await fetchEncodedAccount(e,n,r);return Go(s)}async function _h(e,n,r){let s=await Yg(e,n,r);return assertAccountsExist(s),s}async function Yg(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>Go(t))}function vh(){return 24}function cn(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function an(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function kh(){return combineCodec(cn(),an())}function dn(){return getStructEncoder([["memberKey",H()],["permissions",Fe()],["userArgs",ze()]])}function un(){return getStructDecoder([["memberKey",ce()],["permissions",Ge()],["userArgs",Ke()]])}function Nh(){return combineCodec(dn(),un())}function An(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function gn(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Hh(){return combineCodec(An(),gn())}function xt(){return getStructEncoder([["treeInfo",Ct()],["address",fixEncoderSize(getBytesEncoder(),32)],["outputStateTreeIndex",getU8Encoder()]])}function It(){return getStructDecoder([["treeInfo",Et()],["address",fixDecoderSize(getBytesDecoder(),32)],["outputStateTreeIndex",getU8Decoder()]])}function Kh(){return combineCodec(xt(),It())}function Dt(){return getStructEncoder([["treeInfo",Ct()],["address",fixEncoderSize(getBytesEncoder(),32)]])}function Pt(){return getStructDecoder([["treeInfo",Et()],["address",fixDecoderSize(getBytesDecoder(),32)]])}function Yh(){return combineCodec(Dt(),Pt())}function pn(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function mn(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function Qh(){return combineCodec(pn(),mn())}function Sn(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function xn(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function tR(){return combineCodec(Sn(),xn())}function Mt(){return getStructEncoder([["data",getOptionEncoder(ht())]])}function j(){return getStructDecoder([["data",getOptionDecoder(Rt())]])}function oR(){return combineCodec(Mt(),j())}function ht(){return getStructEncoder([["index",getU128Encoder()],["members",getArrayEncoder(bt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]])}function Rt(){return getStructDecoder([["index",getU128Decoder()],["members",getArrayDecoder(_t())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function dR(){return combineCodec(ht(),Rt())}function vt(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",Cn()],["tlv",getOptionEncoder(getArrayEncoder(In()))],["hasDelegate",getBooleanEncoder()],["isFrozen",getBooleanEncoder()]])}function Ut(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",En()],["tlv",getOptionDecoder(getArrayDecoder(Wt()))],["hasDelegate",getBooleanDecoder()],["isFrozen",getBooleanDecoder()]])}function pR(){return combineCodec(vt(),Ut())}function Mn(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",Rn()]])}function hn(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",bn()]])}function lR(){return combineCodec(Mn(),hn())}function Rn(){return getStructEncoder([["configAccountVersion",getU16Encoder()],["compressToPubkey",getU8Encoder()],["accountVersion",getU8Encoder()],["lamportsPerWrite",getU32Encoder()],["compressionAuthority",fixEncoderSize(getBytesEncoder(),32)],["rentSponsor",fixEncoderSize(getBytesEncoder(),32)],["lastClaimedSlot",getU64Encoder()],["rentExemptionPaid",getU32Encoder()],["reserved",getU32Encoder()],["rentConfig",Un()]])}function bn(){return getStructDecoder([["configAccountVersion",getU16Decoder()],["compressToPubkey",getU8Decoder()],["accountVersion",getU8Decoder()],["lamportsPerWrite",getU32Decoder()],["compressionAuthority",fixDecoderSize(getBytesDecoder(),32)],["rentSponsor",fixDecoderSize(getBytesDecoder(),32)],["lastClaimedSlot",getU64Decoder()],["rentExemptionPaid",getU32Decoder()],["reserved",getU32Decoder()],["rentConfig",Wn()]])}function IR(){return combineCodec(Rn(),bn())}function je(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(On())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(dn())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Nn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Je(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Bn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(un())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(wn())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function PR(){return combineCodec(je(),Je())}function MR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function hR(e,n){return n.__kind===e}function Vn(){return getStructEncoder([["member",getAddressEncoder()],["role",qe()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userCreationArgs",xe()]])}function Hn(){return getStructDecoder([["member",getAddressDecoder()],["role",Ye()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userCreationArgs",Ie()]])}function vR(){return combineCodec(Vn(),Hn())}function On(){return getStructEncoder([["memberKey",H()],["permissions",Fe()]])}function Bn(){return getStructDecoder([["memberKey",ce()],["permissions",Ge()]])}function LR(){return combineCodec(On(),Bn())}function kt(){return getStructEncoder([["memberKey",H()],["messageHash",fixEncoderSize(getBytesEncoder(),32)]])}function Lt(){return getStructDecoder([["memberKey",ce()],["messageHash",fixDecoderSize(getBytesDecoder(),32)]])}function wR(){return combineCodec(kt(),Lt())}function In(){return getDiscriminatedUnionEncoder([["Placeholder0",getUnitEncoder()],["Placeholder1",getUnitEncoder()],["Placeholder2",getUnitEncoder()],["Placeholder3",getUnitEncoder()],["Placeholder4",getUnitEncoder()],["Placeholder5",getUnitEncoder()],["Placeholder6",getUnitEncoder()],["Placeholder7",getUnitEncoder()],["Placeholder8",getUnitEncoder()],["Placeholder9",getUnitEncoder()],["Placeholder10",getUnitEncoder()],["Placeholder11",getUnitEncoder()],["Placeholder12",getUnitEncoder()],["Placeholder13",getUnitEncoder()],["Placeholder14",getUnitEncoder()],["Placeholder15",getUnitEncoder()],["Placeholder16",getUnitEncoder()],["Placeholder17",getUnitEncoder()],["Placeholder18",getUnitEncoder()],["TokenMetadata",getStructEncoder([["fields",getTupleEncoder([jn()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([Fn()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([zn()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([qn()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([Zn()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([pn()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([Mn()])]])]])}function Wt(){return getDiscriminatedUnionDecoder([["Placeholder0",getUnitDecoder()],["Placeholder1",getUnitDecoder()],["Placeholder2",getUnitDecoder()],["Placeholder3",getUnitDecoder()],["Placeholder4",getUnitDecoder()],["Placeholder5",getUnitDecoder()],["Placeholder6",getUnitDecoder()],["Placeholder7",getUnitDecoder()],["Placeholder8",getUnitDecoder()],["Placeholder9",getUnitDecoder()],["Placeholder10",getUnitDecoder()],["Placeholder11",getUnitDecoder()],["Placeholder12",getUnitDecoder()],["Placeholder13",getUnitDecoder()],["Placeholder14",getUnitDecoder()],["Placeholder15",getUnitDecoder()],["Placeholder16",getUnitDecoder()],["Placeholder17",getUnitDecoder()],["Placeholder18",getUnitDecoder()],["TokenMetadata",getStructDecoder([["fields",getTupleDecoder([Jn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([Gn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([Kn()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([Yn()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([Xn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([mn()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([hn()])]])]])}function GR(){return combineCodec(In(),Wt())}function zR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function KR(e,n){return n.__kind===e}function Qn(){return getStructEncoder([["settingsMutArgs",J()],["transactionManager",getOptionEncoder(Ot())]])}function $n(){return getStructDecoder([["settingsMutArgs",q()],["transactionManager",getOptionDecoder(Bt())]])}function YR(){return combineCodec(Qn(),$n())}function bt(){return getStructEncoder([["pubkey",H()],["role",getU8Encoder()],["permissions",Fe()],["userAddressTreeIndex",getU8Encoder()],["isDelegate",getU8Encoder()]])}function _t(){return getStructDecoder([["pubkey",ce()],["role",getU8Decoder()],["permissions",Ge()],["userAddressTreeIndex",getU8Decoder()],["isDelegate",getU8Decoder()]])}function $R(){return combineCodec(bt(),_t())}function H(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function ce(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function rb(){return combineCodec(H(),ce())}function rs(){return getStructEncoder([["authorityCreationArgs",xe()],["compressedProofArgs",C()]])}function ns(){return getStructDecoder([["authorityCreationArgs",Ie()],["compressedProofArgs",E()]])}function cb(){return combineCodec(rs(),ns())}function Nt(){return getStructEncoder([["addressMerkleTreePubkeyIndex",getU8Encoder()],["addressQueuePubkeyIndex",getU8Encoder()],["rootIndex",getU16Encoder()]])}function wt(){return getStructDecoder([["addressMerkleTreePubkeyIndex",getU8Decoder()],["addressQueuePubkeyIndex",getU8Decoder()],["rootIndex",getU16Decoder()]])}function db(){return combineCodec(Nt(),wt())}function Cn(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function En(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function gb(){return combineCodec(Cn(),En())}function Ct(){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 yb(){return combineCodec(Ct(),Et())}function Fn(){return getStructEncoder([])}function Gn(){return getStructDecoder([])}function fb(){return combineCodec(Fn(),Gn())}function zn(){return getStructEncoder([])}function Kn(){return getStructDecoder([])}function Ib(){return combineCodec(zn(),Kn())}function Fe(){return getStructEncoder([["mask",getU8Encoder()]])}function Ge(){return getStructDecoder([["mask",getU8Decoder()]])}function Db(){return combineCodec(Fe(),Ge())}function C(){return getStructEncoder([["proof",getOptionEncoder(Sn())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function E(){return getStructDecoder([["proof",getOptionDecoder(xn())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function Rb(){return combineCodec(C(),E())}function Nn(){return getStructEncoder([["memberKey",H()],["userArgs",ze()]])}function wn(){return getStructDecoder([["memberKey",ce()],["userArgs",Ke()]])}function Ub(){return combineCodec(Nn(),wn())}function Un(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function Wn(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function Lb(){return combineCodec(Un(),Wn())}function cs(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Vt(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function Nb(){return combineCodec(cs(),Vt())}function F(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function G(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function Hb(){return combineCodec(F(),G())}function $(){return getStructEncoder([["domainConfigKey",getAddressEncoder()],["verifyArgs",F()]])}function ee(){return getStructDecoder([["domainConfigKey",getAddressDecoder()],["verifyArgs",G()]])}function Kb(){return combineCodec($(),ee())}function Ht(){return getStructEncoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",getU8Encoder()]])}function Ft(){return getStructDecoder([["addressTreeInfo",wt()],["outputStateTreeIndex",getU8Decoder()]])}function Yb(){return combineCodec(Ht(),Ft())}function as(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()]])}function is(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()]])}function Qb(){return combineCodec(as(),is())}function ds(){return getStructEncoder([["index",getU128Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["isDelegate",getBooleanEncoder()]])}function us(){return getStructDecoder([["index",getU128Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["isDelegate",getBooleanDecoder()]])}function t_(){return combineCodec(ds(),us())}function J(){return getStructEncoder([["accountMeta",xt()],["data",Mt()]])}function q(){return getStructDecoder([["accountMeta",It()],["data",j()]])}function o_(){return combineCodec(J(),q())}function Gt(){return getStructEncoder([["accountMeta",Dt()],["data",Mt()]])}function zt(){return getStructDecoder([["accountMeta",Pt()],["data",j()]])}function d_(){return combineCodec(Gt(),zt())}function Kt(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function jt(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function g_(){return combineCodec(Kt(),jt())}function jn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(cn())]])}function Jn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(an())]])}function T_(){return combineCodec(jn(),Jn())}function Jt(){return getStructEncoder([["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSecp256r1Signers",getArrayEncoder(kt())]])}function qt(){return getStructDecoder([["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSecp256r1Signers",getArrayDecoder(Lt())]])}function x_(){return combineCodec(Jt(),qt())}function Yt(){return getStructEncoder([["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(An())],["addressTableLookups",getArrayEncoder(ls())]])}function Zt(){return getStructDecoder([["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(gn())],["addressTableLookups",getArrayDecoder(fs())]])}function D_(){return combineCodec(Yt(),Zt())}function ls(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function fs(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function h_(){return combineCodec(ls(),fs())}function qn(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function Yn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function __(){return combineCodec(qn(),Yn())}function Zn(){return getStructEncoder([["transferring",getU8Encoder()]])}function Xn(){return getStructDecoder([["transferring",getU8Decoder()]])}function W_(){return combineCodec(Zn(),Xn())}var Ss=(a=>(a[a.Ble=0]="Ble",a[a.Cable=1]="Cable",a[a.Hybrid=2]="Hybrid",a[a.Internal=3]="Internal",a[a.Nfc=4]="Nfc",a[a.SmartCard=5]="SmartCard",a[a.Usb=6]="Usb",a))(Ss||{});function Xt(){return getEnumEncoder(Ss)}function Qt(){return getEnumDecoder(Ss)}function O_(){return combineCodec(Xt(),Qt())}function et(){return getStructEncoder([["domainConfig",getOptionEncoder(getAddressEncoder())],["member",H()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(Xt()))],["wallets",getArrayEncoder(ds())],["role",qe()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["userAddressTreeIndex",getU8Encoder()]])}function Y(){return getStructDecoder([["domainConfig",getOptionDecoder(getAddressDecoder())],["member",ce()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(Qt()))],["wallets",getArrayDecoder(us())],["role",Ye()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["userAddressTreeIndex",getU8Decoder()]])}function V_(){return combineCodec(et(),Y())}function xe(){return getStructEncoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",getU8Encoder()]])}function Ie(){return getStructDecoder([["addressTreeInfo",wt()],["outputStateTreeIndex",getU8Decoder()]])}function z_(){return combineCodec(xe(),Ie())}function tt(){return getStructEncoder([["accountMeta",xt()],["data",et()]])}function rt(){return getStructDecoder([["accountMeta",It()],["data",Y()]])}function q_(){return combineCodec(tt(),rt())}function Ot(){return getStructEncoder([["accountMeta",Dt()],["data",et()]])}function Bt(){return getStructDecoder([["accountMeta",Pt()],["data",Y()]])}function Q_(){return combineCodec(Ot(),Bt())}function ze(){return getDiscriminatedUnionEncoder([["Read",getStructEncoder([["fields",getTupleEncoder([Ot()])]])],["Mutate",getStructEncoder([["fields",getTupleEncoder([tt()])]])]])}function Ke(){return getDiscriminatedUnionDecoder([["Read",getStructDecoder([["fields",getTupleDecoder([Bt()])]])],["Mutate",getStructDecoder([["fields",getTupleDecoder([rt()])]])]])}function rv(){return combineCodec(ze(),Ke())}function nv(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function sv(e,n){return n.__kind===e}var Oe=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(Oe||{});function qe(){return getEnumEncoder(Oe)}function Ye(){return getEnumDecoder(Oe)}function av(){return combineCodec(qe(),Ye())}var Qc=new Uint8Array([223,179,163,190,177,224,67,173]);function uU(){return fixEncoderSize(getBytesEncoder(),8).encode(Qc)}function Ll(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(bt())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["settingsAddressTreeIndex",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:Qc}))}function vr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(_t())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["settingsAddressTreeIndex",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function AU(){return combineCodec(Ll(),vr())}function $c(e){return decodeAccount(e,vr())}async function gU(e,n,r){let s=await xs(e,n,r);return assertAccountExists(s),s}async function xs(e,n,r){let s=await fetchEncodedAccount(e,n,r);return $c(s)}async function pU(e,n,r){let s=await Ol(e,n,r);return assertAccountsExist(s),s}async function Ol(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>$c(t))}var sa=new Uint8Array([90,36,35,219,93,225,110,96]);function lU(){return fixEncoderSize(getBytesEncoder(),8).encode(sa)}function ef(){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",H()],["executor",H()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(H())],["expectedSecp256r1Signers",getArrayEncoder(kt())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:sa}))}function oa(){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",ce()],["executor",ce()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(ce())],["expectedSecp256r1Signers",getArrayDecoder(Lt())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function fU(){return combineCodec(ef(),oa())}function ca(e){return decodeAccount(e,oa())}async function aa(e,n,r){let s=await tf(e,n,r);return assertAccountExists(s),s}async function tf(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ca(s)}async function SU(e,n,r){let s=await rf(e,n,r);return assertAccountsExist(s),s}async function rf(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ca(t))}var ua=new Uint8Array([105,23,173,2,197,255,80,87]);function CU(){return fixEncoderSize(getBytesEncoder(),8).encode(ua)}function If(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["whitelistedAddressTrees",getArrayEncoder(getAddressEncoder())],["bump",getU8Encoder()]]),e=>({...e,discriminator:ua}))}function Aa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["whitelistedAddressTrees",getArrayDecoder(getAddressDecoder())],["bump",getU8Decoder()]])}function EU(){return combineCodec(If(),Aa())}function ga(e){return decodeAccount(e,Aa())}async function pa(e,n,r){let s=await Cf(e,n,r);return assertAccountExists(s),s}async function Cf(e,n,r){let s=await fetchEncodedAccount(e,n,r);return ga(s)}async function DU(e,n,r){let s=await Ef(e,n,r);return assertAccountsExist(s),s}async function Ef(e,n,r){return (await fetchEncodedAccounts(e,n,r)).map(t=>ga(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 ya(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function O(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 y(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:O(r.value),role:ma(r.value)?upgradeRoleToSigner(s):s,...ma(r.value)?{signer:r.value}:{}})}}function ma(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var la=new Uint8Array([8]);function HU(){return fixEncoderSize(getBytesEncoder(),1).encode(la)}function Rs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["addressTree",getAddressEncoder()]]),e=>({...e,discriminator:la}))}function fa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["addressTree",getAddressDecoder()]])}function FU(){return combineCodec(Rs(),fa())}async function Sa(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:Rs().encode(c),programAddress:r})}function GU(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:Rs().encode(c),programAddress:r})}function zU(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:fa().decode(e.data)}}var Da=new Uint8Array([9]);function XU(){return fixEncoderSize(getBytesEncoder(),1).encode(Da)}function _s(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()],["configActions",getArrayEncoder(je())],["secp256r1VerifyArgs",getArrayEncoder($())],["compressedProofArgs",getOptionEncoder(C())]]),e=>({...e,discriminator:Da}))}function Pa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()],["configActions",getArrayDecoder(Je())],["secp256r1VerifyArgs",getArrayDecoder(ee())],["compressedProofArgs",getOptionDecoder(E())]])}function QU(){return combineCodec(_s(),Pa())}async function Ma(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.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(ya(c.settingsIndex))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:_s().encode(c),programAddress:r})}function $U(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:_s().encode(c),programAddress:r})}function eW(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Pa().decode(e.data)}}var va=new Uint8Array([19]);function aW(){return fixEncoderSize(getBytesEncoder(),1).encode(va)}function Ua(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(je())],["secp256r1VerifyArgs",getArrayEncoder($())],["settingsMutArgs",J()],["compressedProofArgs",C()]]),e=>({...e,discriminator:va}))}function Wa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Je())],["secp256r1VerifyArgs",getArrayDecoder(ee())],["settingsMutArgs",q()],["compressedProofArgs",E()]])}function iW(){return combineCodec(Ua(),Wa())}function ka(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ua().encode(c),programAddress:r})}function dW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Wa().decode(e.data)}}var Ba=new Uint8Array([18]);function TW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ba)}function vs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["settingsCreation",Ht()],["userArgs",ze()],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Ba}))}function Na(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["settingsCreation",Ft()],["userArgs",Ke()],["settingsIndex",getU128Decoder()]])}function lW(){return combineCodec(vs(),Na())}async function wa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:vs().encode(c),programAddress:r})}function fW(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:vs().encode(c),programAddress:r})}function SW(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:Na().decode(e.data)}}var Ja=new Uint8Array([0]);function MW(){return fixEncoderSize(getBytesEncoder(),1).encode(Ja)}function Ws(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["authorityCreationArgs",xe()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ja}))}function qa(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["authorityCreationArgs",Ie()],["compressedProofArgs",E()]])}function hW(){return combineCodec(Ws(),qa())}async function Ya(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:Ws().encode(c),programAddress:r})}function RW(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:Ws().encode(c),programAddress:r})}function bW(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:qa().decode(e.data)}}var Qa=new Uint8Array([4]);function OW(){return fixEncoderSize(getBytesEncoder(),1).encode(Qa)}function ks(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["member",cs()],["role",qe()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(Xt())],["userAccountCreationArgs",xe()],["linkWalletArgs",getOptionEncoder(Qn())]]),e=>({...e,discriminator:Qa}))}function $a(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["member",Vt()],["role",Ye()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Qt())],["userAccountCreationArgs",Ie()],["linkWalletArgs",getOptionDecoder($n())]])}function BW(){return combineCodec(ks(),$a())}async function ei(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:ks().encode(c),programAddress:r})}function NW(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:ks().encode(c),programAddress:r})}function wW(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:$a().decode(e.data)}}var ri=new Uint8Array([3]);function KW(){return fixEncoderSize(getBytesEncoder(),1).encode(ri)}function Os(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:ri}))}function ni(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function jW(){return combineCodec(Os(),ni())}async function si(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=y(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:Os().encode({}),programAddress:r})}function JW(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=y(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:Os().encode({}),programAddress:r})}function qW(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:ni().decode(e.data)}}var ci=new Uint8Array([5]);function tk(){return fixEncoderSize(getBytesEncoder(),1).encode(ci)}function Ns(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["compressedProofArgs",C()],["createUserArgs",getArrayEncoder(Vn())]]),e=>({...e,discriminator:ci}))}function ai(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["compressedProofArgs",E()],["createUserArgs",getArrayDecoder(Hn())]])}function rk(){return combineCodec(Ns(),ai())}async function ii(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:Ns().encode(c),programAddress:r})}function nk(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:Ns().encode(c),programAddress:r})}function sk(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:ai().decode(e.data)}}var Ai=new Uint8Array([17]);function Ak(){return fixEncoderSize(getBytesEncoder(),1).encode(Ai)}function gi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsMutArgs",J()],["compressedProofArgs",C()],["secp256r1VerifyArgs",getArrayEncoder($())]]),e=>({...e,discriminator:Ai}))}function pi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsMutArgs",q()],["compressedProofArgs",E()],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function gk(){return combineCodec(gi(),pi())}function mi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:gi().encode(c),programAddress:r})}function pk(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:pi().decode(e.data)}}var li=new Uint8Array([2]);function Sk(){return fixEncoderSize(getBytesEncoder(),1).encode(li)}function fi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:li}))}function Si(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function xk(){return combineCodec(fi(),Si())}function xi(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...a],data:fi().encode(c),programAddress:r})}function Ik(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:Si().decode(e.data)}}var Di=new Uint8Array([1]);function Rk(){return fixEncoderSize(getBytesEncoder(),1).encode(Di)}function Vs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))],["newAuthorityArgs",getOptionEncoder(rs())]]),e=>({...e,discriminator:Di}))}function Pi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))],["newAuthorityArgs",getOptionDecoder(ns())]])}function bk(){return combineCodec(Vs(),Pi())}async function _k(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:Vs().encode(c),programAddress:r})}function Mi(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:Vs().encode(c),programAddress:r})}function vk(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:Pi().decode(e.data)}}var bi=new Uint8Array([6]);function Nk(){return fixEncoderSize(getBytesEncoder(),1).encode(bi)}function _i(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",tt()],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["compressedProofArgs",C()]]),e=>({...e,discriminator:bi}))}function vi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",rt()],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["compressedProofArgs",E()]])}function wk(){return combineCodec(_i(),vi())}function Ui(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.authority),...a],data:_i().encode(c),programAddress:r})}function Vk(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:vi().decode(e.data)}}var Li=new Uint8Array([7]);function Jk(){return fixEncoderSize(getBytesEncoder(),1).encode(Li)}function Oi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["userMutArgs",tt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["delegateTo",getOptionEncoder(as())],["oldSettingsMutArgs",getOptionEncoder(J())],["newSettingsMutArgs",getOptionEncoder(J())],["compressedProofArgs",C()]]),e=>({...e,discriminator:Li}))}function Bi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["userMutArgs",rt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["delegateTo",getOptionDecoder(is())],["oldSettingsMutArgs",getOptionDecoder(q())],["newSettingsMutArgs",getOptionDecoder(q())],["compressedProofArgs",E()]])}function qk(){return combineCodec(Oi(),Bi())}function Ni(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...a],data:Oi().encode(c),programAddress:r})}function Yk(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:Bi().decode(e.data)}}var Hi=new Uint8Array([32]);function rL(){return fixEncoderSize(getBytesEncoder(),1).encode(Hi)}function Fi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",ht()],["compressedProofArgs",C()],["settingsCreationArgs",Ht()]]),e=>({...e,discriminator:Hi}))}function Gi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Rt()],["compressedProofArgs",E()],["settingsCreationArgs",Ft()]])}function nL(){return combineCodec(Fi(),Gi())}function zi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.authority),...a],data:Fi().encode(c),programAddress:r})}function sL(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:Gi().decode(e.data)}}var Ji=new Uint8Array([31]);function AL(){return fixEncoderSize(getBytesEncoder(),1).encode(Ji)}function qi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",et()],["compressedProofArgs",C()],["userCreationArgs",xe()]]),e=>({...e,discriminator:Ji}))}function Yi(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",Y()],["compressedProofArgs",E()],["userCreationArgs",Ie()]])}function gL(){return combineCodec(qi(),Yi())}function Zi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.authority),...a],data:qi().encode(c),programAddress:r})}function pL(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:Yi().decode(e.data)}}var Qi=new Uint8Array([29]);function xL(){return fixEncoderSize(getBytesEncoder(),1).encode(Qi)}function Hs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder($())]]),e=>({...e,discriminator:Qi}))}function $i(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function IL(){return combineCodec(Hs(),$i())}async function CL(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(O(t.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:Hs().encode(c),programAddress:r})}function ed(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:Hs().encode(c),programAddress:r})}function EL(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:$i().decode(e.data)}}var nd=new Uint8Array([27]);function _L(){return fixEncoderSize(getBytesEncoder(),1).encode(nd)}function sd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["secp256r1VerifyArgs",getArrayEncoder($())],["settingsMutArgs",J()],["compressedProofArgs",C()]]),e=>({...e,discriminator:nd}))}function od(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["secp256r1VerifyArgs",getArrayDecoder(ee())],["settingsMutArgs",q()],["compressedProofArgs",E()]])}function vL(){return combineCodec(sd(),od())}function cd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:sd().encode(c),programAddress:r})}function UL(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:od().decode(e.data)}}var ud=new Uint8Array([30]);function wL(){return fixEncoderSize(getBytesEncoder(),1).encode(ud)}function zs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Kt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(vt()))],["compressedProofArgs",getOptionEncoder(C())],["secp256r1VerifyArgs",getArrayEncoder($())]]),e=>({...e,discriminator:ud}))}function Ad(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(jt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(Ut()))],["compressedProofArgs",getOptionDecoder(E())],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function VL(){return combineCodec(zs(),Ad())}async function HL(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await getProgramDerivedAddress({programAddress:r,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(O(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(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),o=y(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),...a],data:zs().encode(c),programAddress:r})}function gd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),o=y(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),...a],data:zs().encode(c),programAddress:r})}function FL(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===A?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:Ad().decode(e.data)}}var fd=new Uint8Array([28]);function YL(){return fixEncoderSize(getBytesEncoder(),1).encode(fd)}function Ks(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Kt())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getOptionEncoder(getArrayEncoder(vt()))],["secp256r1VerifyArgs",getArrayEncoder($())],["settingsMutArgs",J()],["compressedProofArgs",C()]]),e=>({...e,discriminator:fd}))}function Sd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(jt())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getOptionDecoder(getArrayDecoder(Ut()))],["secp256r1VerifyArgs",getArrayDecoder(ee())],["settingsMutArgs",q()],["compressedProofArgs",E()]])}function ZL(){return combineCodec(Ks(),Sd())}async function XL(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable: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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.source.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(O(t.destination.value)),getAddressEncoder().encode(O(t.tokenProgram.value)),getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),o=y(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),...a],data:Ks().encode(c),programAddress:r})}function xd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable: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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),o=y(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),...a],data:Ks().encode(c),programAddress:r})}function QL(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===A?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:Sd().decode(e.data)}}var Ed=new Uint8Array([13]);function oO(){return fixEncoderSize(getBytesEncoder(),1).encode(Ed)}function Dd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Ed}))}function Pd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function cO(){return combineCodec(Dd(),Pd())}function Md(e,n){let r=n?.programAddress??A,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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Dd().encode(c),programAddress:r})}function aO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Pd().decode(e.data)}}var bd=new Uint8Array([23]);function mO(){return fixEncoderSize(getBytesEncoder(),1).encode(bd)}function _d(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",J()],["compressedProofArgs",C()]]),e=>({...e,discriminator:bd}))}function vd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",q()],["compressedProofArgs",E()]])}function yO(){return combineCodec(_d(),vd())}function Ud(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:_d().encode(c),programAddress:r})}function TO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:vd().decode(e.data)}}var Ld=new Uint8Array([10]);function EO(){return fixEncoderSize(getBytesEncoder(),1).encode(Ld)}function Od(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Jt()],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Ld}))}function Bd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",qt()],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function DO(){return combineCodec(Od(),Bd())}function Nd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...a],data:Od().encode(c),programAddress:r})}function PO(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Bd().decode(e.data)}}var Hd=new Uint8Array([20]);function UO(){return fixEncoderSize(getBytesEncoder(),1).encode(Hd)}function Fd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["args",Jt()],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",Gt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Hd}))}function Gd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["args",qt()],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",zt()],["compressedProofArgs",E()]])}function WO(){return combineCodec(Fd(),Gd())}function zd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...a],data:Fd().encode(c),programAddress:r})}function kO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Gd().decode(e.data)}}var Jd=new Uint8Array([14]);function HO(){return fixEncoderSize(getBytesEncoder(),1).encode(Jd)}function qd(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:Jd}))}function Yd(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function FO(){return combineCodec(qd(),Yd())}function Zd(e,n){let r=n?.programAddress??A,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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:qd().encode(c),programAddress:r})}function GO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Yd().decode(e.data)}}var $d=new Uint8Array([24]);function ZO(){return fixEncoderSize(getBytesEncoder(),1).encode($d)}function eu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsMutArgs",J()],["compressedProofArgs",C()]]),e=>({...e,discriminator:$d}))}function tu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsMutArgs",q()],["compressedProofArgs",E()]])}function XO(){return combineCodec(eu(),tu())}function ru(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:eu().encode(c),programAddress:r})}function QO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:tu().decode(e.data)}}var ou=new Uint8Array([12]);function sB(){return fixEncoderSize(getBytesEncoder(),1).encode(ou)}function cu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:ou}))}function au(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function oB(){return combineCodec(cu(),au())}function iu(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...a],data:cu().encode(c),programAddress:r})}function cB(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:au().decode(e.data)}}var Au=new Uint8Array([22]);function gB(){return fixEncoderSize(getBytesEncoder(),1).encode(Au)}function gu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Au}))}function pu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["settingsKey",getAddressDecoder()]])}function pB(){return combineCodec(gu(),pu())}function mu(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.transactionBuffer),...a],data:gu().encode(c),programAddress:r})}function mB(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:pu().decode(e.data)}}var lu=new Uint8Array([11]);function IB(){return fixEncoderSize(getBytesEncoder(),1).encode(lu)}function fu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())]]),e=>({...e,discriminator:lu}))}function Su(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())]])}function CB(){return combineCodec(fu(),Su())}function xu(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:fu().encode(c),programAddress:r})}function EB(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Su().decode(e.data)}}var Eu=new Uint8Array([21]);function _B(){return fixEncoderSize(getBytesEncoder(),1).encode(Eu)}function Du(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(F())],["settingsReadonlyArgs",Gt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Eu}))}function Pu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(G())],["settingsReadonlyArgs",zt()],["compressedProofArgs",E()]])}function vB(){return combineCodec(Du(),Pu())}function Mu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Du().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===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Pu().decode(e.data)}}var bu=new Uint8Array([15]);function NB(){return fixEncoderSize(getBytesEncoder(),1).encode(bu)}function _u(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:bu}))}function vu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function wB(){return combineCodec(_u(),vu())}function Uu(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=m({}),a=y(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:_u().encode({}),programAddress:r})}function VB(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:vu().decode(e.data)}}var Lu=new Uint8Array([25]);function jB(){return fixEncoderSize(getBytesEncoder(),1).encode(Lu)}function Ou(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsKey",getAddressEncoder()]]),e=>({...e,discriminator:Lu}))}function Bu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsKey",getAddressDecoder()]])}function JB(){return combineCodec(Ou(),Bu())}function Nu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...a],data:Ou().encode(c),programAddress:r})}function qB(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:Bu().decode(e.data)}}var Hu=new Uint8Array([16]);function tN(){return fixEncoderSize(getBytesEncoder(),1).encode(Hu)}function Fu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Yt()],["secp256r1VerifyArgs",getArrayEncoder($())]]),e=>({...e,discriminator:Hu}))}function Gu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Zt()],["secp256r1VerifyArgs",getArrayDecoder(ee())]])}function rN(){return combineCodec(Fu(),Gu())}function zu(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Fu().encode(c),programAddress:r})}function nN(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Gu().decode(e.data)}}var Ju=new Uint8Array([26]);function uN(){return fixEncoderSize(getBytesEncoder(),1).encode(Ju)}function qu(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionMessage",Yt()],["secp256r1VerifyArgs",getArrayEncoder($())],["settingsMutArgs",J()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ju}))}function Yu(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionMessage",Zt()],["secp256r1VerifyArgs",getArrayDecoder(ee())],["settingsMutArgs",q()],["compressedProofArgs",E()]])}function AN(){return combineCodec(qu(),Yu())}function Zu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:qu().encode(c),programAddress:r})}function gN(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Yu().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",HE=(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))(HE||{});function ZN(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 FE=(T=>(T[T.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",T[T.ChangeConfig=1]="ChangeConfig",T[T.ChangeConfigCompressed=2]="ChangeConfigCompressed",T[T.CreateCompressedWallet=3]="CreateCompressedWallet",T[T.CreateDomainConfig=4]="CreateDomainConfig",T[T.CreateDomainUserAccount=5]="CreateDomainUserAccount",T[T.CreateGlobalCounter=6]="CreateGlobalCounter",T[T.CreateUserAccounts=7]="CreateUserAccounts",T[T.DecompressSettingsAccount=8]="DecompressSettingsAccount",T[T.DisableDomainConfig=9]="DisableDomainConfig",T[T.EditDomainConfig=10]="EditDomainConfig",T[T.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",T[T.EditUserDelegate=12]="EditUserDelegate",T[T.MigrateCompressedSettings=13]="MigrateCompressedSettings",T[T.MigrateCompressedUsers=14]="MigrateCompressedUsers",T[T.NativeTransferIntent=15]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=17]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=19]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=21]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=23]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=25]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=27]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",T[T.TransactionExecute=29]="TransactionExecute",T[T.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=31]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",T))(FE||{});function XN(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 zE=6e3,KE=6001,jE=6002,JE=6003,qE=6004,YE=6005,ZE=6006,XE=6007,QE=6008,$E=6009,eD=6010,tD=6011,rD=6012,nD=6013,sD=6014,oD=6015,cD=6016,aD=6017,iD=6018,dD=6019,uD=6020,AD=6021,gD=6022,pD=6023,mD=6024,yD=6025,TD=6026,lD=6027,fD=6028,SD=6029,xD=6030,ID=6031,CD=6032,ED=6033,DD=6034,PD=6035,MD=6036,hD=6037,RD=6038,bD=6039,_D=6040,vD=6041,UD=6042,WD=6043,kD=6044,LD=6045,OD=6046,BD=6047,ND=6048,wD=6049,VD=6050,HD=6051,FD=6052,GD=6053,zD=6054,KD=6055,jD=6056,JD=6057,qD=6058,YD=6059,ZD=6060,XD=6061,QD=6062,$D=6063,eP=6064,tP=6065,rP=6066,nP=6067,sP=6068,oP=6069,cP=6070,aP=6071,iP=6072,dP=6073,uP=6074,AP=6075,gP=6076,pP=6077,mP=6078,yP=6079,TP=6080,lP=6081,fP=6082,SP=6083,xP=6084,IP=6085,CP=6086,Xu;process.env.NODE_ENV!=="production"&&(Xu={[ID]:"This member is already delegated to another wallet.",[XE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[pP]:"Clock sysvar access failed. This may indicate a system error.",[HD]:"Missing credential id.",[GD]:"The domain configuration account is disabled. Please contact support or try again later.",[zD]:"Missing domain configuration account.",[AP]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[CP]:"Duplicate address tree detected. This address tree is already in the whitelist.",[eD]:"Duplicate public keys detected among members. Each member must have a unique key.",[$E]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[AD]:"No members provided. A multisig wallet must contain at least one member.",[ZD]:"Slot numbers list is empty. At least one slot number is required for validation.",[iD]:"Expected a User with Administrator role for this instruction.",[QE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[cD]:"Expected a User with Transaction Manager role for this instruction.",[_D]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[vD]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[UD]:"Declared buffer size does not match the actual serialized size.",[YD]:"Failed to compute hash. This may indicate a system error.",[DD]:"Not enough members with vote permission to meet the approval threshold.",[CD]:"At least one signer with execute permission is required to proceed.",[ED]:"At least one signer with initiate permission is required to perform this action.",[TD]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[uP]:"Invalid account index in transaction message. The account index is out of bounds.",[JD]:"Address Tree supplied is not part of the whitelisted address trees.",[dD]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[fD]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[bD]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[XD]:"Member key conversion failed. The provided key format is invalid.",[PD]:"Only delegated members are allowed for this transaction.",[yD]:"Unexpected number of accounts provided for this instruction.",[nD]:"User with Permanent Member role must have a delegated wallet.",[KE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[qE]:"The extracted public key has an invalid length or encoding.",[zE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[JE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[VD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[ND]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[pD]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[aP]:"Invalid source type for token transfer. The source account type is not supported.",[aD]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[oD]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[mD]:"Malformed transaction message: structure or formatting does not match the expected layout.",[TP]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[lD]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[yP]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[cP]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[YE]:"The extracted WebAuthn signed message payload is malformed.",[OD]:"An input string exceeds the maximum allowed character length.",[KD]:"This member is not registered under the provided domain configuration.",[eP]:"Member not found in settings. Cannot remove a member that does not exist.",[dP]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[SD]:"A required account is missing from the instruction context.",[QD]:"Compressed proof arguments are missing. Required for compressed account operations.",[nP]:"Missing compressed token account. Required for token transfer operations.",[lP]:"Missing destination token account. Required for token transfer operations.",[oP]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[$D]:"Light CPI accounts are missing. Required for compressed account operations.",[xD]:"User mutation arguments are required when performing add or remove delegate operations.",[xP]:"Missing new authority account. Required for domain configuration updates.",[SP]:"Missing settings account. Required for delegate operations on compressed wallets.",[qD]:"Compressed settings data is missing. The settings account must be initialized with data.",[fP]:"Missing source token account. Required for token transfer operations.",[sP]:"Missing SPL interface PDA. Required for token transfer operations.",[BD]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[gP]:"User account address is missing. Required for secp256r1 signature verification.",[IP]:"Missing whitelisted address trees account. Required for domain configuration updates.",[hD]:"No valid signer found in this transaction.",[uD]:"Only one administrator is allowed per wallet.",[rD]:"Only one permanent member is allowed per wallet.",[sD]:"Only one transaction manager is allowed per wallet.",[jD]:"The given origin index is not in the whitelisted origins.",[rP]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[tD]:"Permanent members cannot be removed from a wallet.",[LD]:"Writable CPI calls to protected accounts are not permitted.",[ZE]:"The rpIdHash extracted from the signed message does not match the expected value.",[tP]:"Settings key mismatch. The provided settings key does not match the expected value.",[jE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[wD]:"The specified slot number was not found in the provided slot history.",[iP]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[gD]:"Too many members: a maximum of 4 members are supported.",[WD]:"This transaction has expired. It must be executed within 3 minutes of approval.",[kD]:"This transaction has not yet reached the required approval threshold.",[FD]:"Missing transports.",[RD]:"Only the transaction creator or rent payer may close this transaction buffer.",[mP]:"Unauthorized: Only the admin account is allowed to perform this action.",[MD]:"Member is not part of the expected signers for this transaction."});function nw(e){return process.env.NODE_ENV!=="production"?Xu[e]:"Error message not available in production bundles."}function sw(e,n,r){return isProgramError(e,n,A,r)}async function yw({admin:e,addressTree:n}){return Sa({payer:e,addressTree:n,remainingAccounts:[]})}var tr={Ed25519:1,Secp256r1:2};var Qu=f.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),Iw=f.object({transactionActionType:Qu,transactionAddress:f.string(),transactionMessageBytes:f.array(f.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),$u=f.object({transactionActionType:Qu,transactionAddress:f.string(),transactionMessageBytes:f.string()}).strict(),eA=f.object({authResponse:f.custom(),nonce:f.string(),clientSignature:f.object({clientOrigin:f.string(),signature:f.string()}).strict(),deviceSignature:f.object({publicKey:f.string(),signature:f.string()}).strict(),authProviderSignature:f.object({publicKey:f.string(),signature:f.string()}).strict().optional()}).strict(),tA=f.object({signer:f.string(),userAddressTreeIndex:f.number().optional(),additionalInfo:f.looseObject({}).optional()}).strict(),EP=f.object({transactionPayload:$u,slotHash:f.string(),slotNumber:f.string(),originIndex:f.number(),crossOrigin:f.boolean()}).strict(),Cw=f.object({phase:f.literal("start"),redirectOrigin:f.url(),signer:f.string().optional(),data:f.object({type:f.literal("message"),payload:f.string().optional()}).strict()}).strict(),Ew=f.object({phase:f.literal("start"),redirectOrigin:f.url(),signer:f.string().optional(),data:f.object({type:f.literal("transaction"),payload:$u}).strict()}).strict(),Dw=f.object({phase:f.literal("complete"),data:f.object({type:f.literal("message"),payload:tA.extend(eA.shape).extend({id:f.string().optional(),message:f.string(),clientSignature:f.object({clientOrigin:f.string()}).strict()})}).strict()}).strict(),Pw=f.object({phase:f.literal("complete"),data:f.object({type:f.literal("transaction"),payload:tA.extend(eA.shape).extend(EP.shape).extend({clientSignature:f.object({clientOrigin:f.string()}).strict()})}).strict()}).strict();var ve={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Be=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(ve).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var qs=33,Ne=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!==qs)throw new Error(`Invalid public key length, expected ${qs} 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===qs)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()}},P=class extends Ne{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 MP(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function hP(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var nA=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(MP())],["addressTableLookups",getArrayCodec(hP())]]);function sA(e){return nA.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 oA(e){let n=nA.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}var re={};function cA(){if(!re.solanaRpcEndpoint)throw new Le("RPC endpoint");return re.solanaRpcEndpoint}function Me(){if(!re.lightProtocolRpc)throw new Le("Light Protocol RPC");return re.lightProtocolRpc}function ne(){if(!re.solanaRpc)throw new Le("Solana RPC");return re.solanaRpc}function aA(){if(!re.sendAndConfirm)throw new Le("Send and confirm transaction function");return re.sendAndConfirm}function iA(){if(!re.computeEstimate)throw new Le("Compute budget estimate function");return re.computeEstimate}function Zs(){return re.jitoTipsConfig?re.jitoTipsConfig:{blockEngineUrl:Ro,getJitoTipsUrl:bo,priority:_o}}function Yw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){re.solanaRpcEndpoint=e,re.lightProtocolRpc=createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=createSolanaClient({urlOrMoniker:e});re.solanaRpc=t,re.sendAndConfirm=c,re.computeEstimate=estimateComputeUnitLimitFactory({rpc:t}),re.jitoTipsConfig=s??null;}async function rr(e,n){if(!e.ok){await e.text().catch(()=>e.statusText);throw new De(`Request failed: ${e.statusText} (${e.status})`,e.status,n)}return e}async function nr(e){try{return await e.json()}catch(n){throw new De(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function a2(e){let n=decodeCBOR(e),r=p256.Point.fromAffine({x:BigInt("0x"+Hr(n.get(-2))),y:BigInt("0x"+Hr(n.get(-3)))});return getBase58Decoder().decode(r.toBytes(true))}function i2(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 d2(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Ve(n)),c=JSON.parse(new TextDecoder().decode(Ve(r))),i=AA(c),a=pA(new Uint8Array(Ve(s))),o=await gt({rpIdHash:t.subarray(0,32)});return new P(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Ve(r)),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:Xs(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function Xs(e,n,r){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function g2(e){return sha256(new Uint8Array(getUtf8Encoder().encode(JSON.stringify(e))))}function p2(e){return Qs(e.data.payload.authResponse)}function m2(e,n,r,s){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...Xs(n,r,s)]))}async function y2(e,n,r,s,t,c){let i;if(!t||!c){let o=(await ne().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!o)throw new oe("Slot sysvar","Unable to fetch slot sysvar data");let u=getBase64Encoder().encode(o[0]);c=getU64Decoder().decode(u.subarray(0,8)).toString(),i=u.subarray(8,40),t=getBase58Decoder().decode(i);}else i=new Uint8Array(getBase58Encoder().encode(t));let a=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...sha256(typeof e.transactionMessageBytes=="string"?new Uint8Array(Ve(e.transactionMessageBytes)):e.transactionMessageBytes),...i,...Xs(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:a}}function Qs(e){return sha256(Gr(e))}function T2(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ve(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return c}async function l2(e,n){let{data:r}=await No(ne(),e),t=gA(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 Hr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function BP(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 AA(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 gA(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let i=e[s]|e[s+1]<<8;if(s+=2,s+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(s,s+i),o=t.decode(a);r.push(o),s+=i;}return r}function pA(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 i=e[r+1],a=r+2,o=e.slice(a,a+i),u=c[0]===0&&c.length>32?c.slice(1):c,d=o[0]===0&&o.length>32?o.slice(1):o;if(u.length>32||d.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(u,32-u.length);let p=p256.Point.CURVE().n>>1n,l=BigInt("0x"+Hr(d)),b=(l>p?p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),x=BP(b);return new Uint8Array([...g,...x])}function Gr(e){return new Uint8Array([...new Uint8Array(Ve(e.response.authenticatorData)),...sha256(new Uint8Array(Ve(e.response.clientDataJSON)))])}var NP={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true,initialDelayMs:500,maxRetries:3};function wP(e,n,r,s){let t=n*Math.pow(r,e-1);return Math.min(t,s)}function VP(e){return new Promise(n=>setTimeout(n,e))}async function or(e,n){let{maxRetries:r,initialDelayMs:s,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...NP,...n},a;for(let o=1;o<=r;o++)try{return await e()}catch(u){if(a=u,i&&!i(u,o))throw u;if(o>=r)break;let d=wP(o,s,t,c);await VP(d);}throw new pr(e.name||"retryWithBackoff",r,a)}async function pt(e,n){let r=(s,t)=>t>(n?.maxRetries??3)?false:s instanceof Response?s.status===429?n?.retryOnRateLimit??true:s.status>=400&&s.status<500?false:s.status>=500:s instanceof TypeError||s instanceof Error;return or(e,{...n,shouldRetry:n?.shouldRetry??r})}function yA(e,n,r,s){if(e<n||e>r)throw new K(`${s} must be between ${n} and ${r} (inclusive), got ${e}`)}function TA(e,n){if(e<0)throw new K(`${n} must be non-negative, got ${e}`)}function cr(e,n){if(e.length===0)throw new K(`${n} cannot be empty`)}function lA(e,n){if(e.trim().length===0)throw new K(`${n} cannot be empty`)}async function $s(e,n=false){let r=n?{blockhash:getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await ne().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(s.instructions,c),c=>setTransactionMessageFeePayerSigner(s.payer,c),c=>setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let i=Math.ceil((s.unitsConsumed??0)*1.1);return i>2e5?prependTransactionMessageInstructions([getSetComputeUnitLimitInstruction({units:i})],c):c},async c=>n?compileTransaction(await c):await signTransactionMessageWithSigners(await c))))}async function xA(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===AccountRole.WRITABLE||c.role===AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,i)=>c-i);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function IA(e,n){cr(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new K(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await pt(()=>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:[]}))}]})}));await rr(r,n);let s=await nr(r);if(!s.result||s.error)throw new me(`Unable to simulate bundle: ${JSON.stringify(s.error??s.result)}`);if(typeof s.result.value.summary!="string"&&s.result.value.summary.failed){let{TransactionFailure:t}=s.result.value.summary.failed.error,[,c]=t;throw new me(`Simulation failed: ${c}`)}return s.result.value.transactionResults.map(t=>t.unitsConsumed)}function Z(e,n=0){let r=e instanceof P?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}):none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs.clientDataJson?Gr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:i,publicKey:a}}function he(e){if(e instanceof Ne)return {keyType:tr.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:tr.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(n)])}}}function SA(e){return e instanceof P?e.toString():e.address.toString()}function fe(e){let n=new Set,r=[];for(let t of e)n.has(SA(t))||(r.push(t),n.add(SA(t)));let s=r.filter(t=>t instanceof P);if(s.length>1)throw new K(`More than 1 Secp256r1 signers in an instruction is not supported (found ${s.length})`);return r}function CA({payer:e,tipAmount:n}){let r=sn[Math.floor(Math.random()*sn.length)];return getTransferSolInstruction({source:e,destination:address(r),amount:n})}function EA(e){return typeof e=="string"?e:e.toString()}function DA(e){return e.toString()}async function eo(e,n,r){let s=e?.get(n);if(s)return s;let t=await r();return t&&e&&e.set(n,t),t}var B=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:r?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(A.toString())}).map(n=>({address:address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await Me().getStateTreeInfos(),r=selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,u=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=u);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function zr(e,n){let r=EA(e);return eo(n,r,()=>Me().getCompressedAccount(e))}async function st(e,n){let r=DA(e);return eo(n,r,()=>ne().getAccountInfo(e,{encoding:"base64"}).send())}async function ye(e,n){let s=(await Promise.all(e.map(async t=>zr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new oe("Compressed account",`Expected ${e.length} accounts but found ${s.length}`);return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function U(e,n){return {proof:e?.compressedProof?some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function Ae(e,n,r,s,t){if(t.length===0)return [];let c=t.map((u,d)=>({treeInfo:n[d],root:r[d],rootIndex:s[d],address:u.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((u,d)=>({addressTreeInfo:i[d],outputStateTreeIndex:a,address:u.address,type:u.type}))}function de(e,n,r,s,t,c,i){let a=[];for(let d=0;d<n.length;d++)a.push({treeInfo:n[d],rootIndex:s[d],leafIndex:r[d],proveByIndex:t[d],hash:c[d].hash});let o=e.packTreeInfos(a,[]).stateTrees;if(!o)throw new K("Unable to parse state tree data");return c.map((d,g)=>({data:i.decode(d.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(d.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Re(e,n,r,s,t){let c=null,i=null,a=null,o=new B;if(e){await o.addSystemAccounts();let{address:u}=await ae(n,r),d=(await ye([{address:u,type:"Settings"}],t))[0];s?a={rootIndices:[0],roots:[],leafIndices:[d.leafIndex],leaves:[],treeInfos:[d.treeInfo],proveByIndices:[d.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:a=await w([d],[]);let g=o.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!g)throw new K("Unable to parse state tree data");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:g.packedTreeInfos[0]},data:j().decode(d.data?.data)},i={accountMeta:{address:new Uint8Array(d.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:j().decode(d.data?.data)};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:o,settingsMutArgs:i}}async function w(e,n){return or(()=>Me().getValidityProofV0(e,n))}async function be(){return (await Kr()).length-1}var to;async function Kr(){if(!to){let{data:e}=await pa(ne(),await RA());to=e.whitelistedAddressTrees;}return to}function hA(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let n=e[7];return n===3?2:3}async function ir(e,n,r){let s=await uM(e,n,r);if(!s)throw new oe("User account");return s}async function uM(e,n,r){let{address:s}=await N(e,n),t=await zr(s,r);return t?.data?.data?Y().decode(t.data.data):null}async function m5(e,{member:n,credentialId:r}){let s=[{memcmp:{offset:1,encoding:"base58",bytes:e}}];if(n)s.push({memcmp:{offset:33,encoding:"base58",bytes:getBase58Decoder().decode(H().encode(he(n)))}});else if(r)s.push({memcmp:{offset:72,encoding:"base58",bytes:getBase58Decoder().decode(new Uint8Array(base64URLStringToBuffer(r)))}});else return null;let t=await Me().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:s});return t.items.filter(c=>!!c.data).length?t.items.map(c=>Y().decode(c.data?.data))[0]:null}async function jr(e,n,r){let s=await AM(e,n,r);if(!s)throw new oe("Settings account");return s}async function AM(e,n,r){try{let{address:s}=await ae(e,n),t=await zr(s,r);if(!t?.data?.data)throw new oe("Compressed settings account");let c=j().decode(t.data.data);if(c.data.__option==="None")throw new oe("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let s=await xs(ne(),await ue(e));return s.exists?{...s.data,isCompressed:false}:null}}async function y5(e,n,r){let s=await ir(e,n,r);if(s.role===1||s.role===0){let t=[],[c,i]=await Promise.all([Me().getCompressedAccountsByOwner(new PublicKey(A.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:getBase58Decoder().decode(H().encode(he(e)))}}]}),ne().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:getBase64Decoder().decode(H().encode(he(e)))}}]}).send()]);return c.items.forEach(a=>{if(a.data?.data){let o=j().decode(a.data.data);o.data.__option==="Some"&&t.push({...o.data.value,isCompressed:true});}}),i.forEach(a=>{let o=vr().decode(getBase64Encoder().encode(a.account.data[0]));t.push({...o,isCompressed:false});}),t}else return await Promise.all(s.wallets.map(t=>jr(t.index,t.settingsAddressTreeIndex,r)))}async function no(e){TA(e,"index");let n=await Kr();if(e>=n.length)throw new K(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function T5(e){let r=(await Kr()).findIndex(s=>s.toString()===e);if(r===-1)throw new oe("Address tree",`Address ${e} not found in whitelist`);return r}async function ae(e,n=0){let r=await no(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("multi_wallet")),new Uint8Array(getU128Encoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(A)).toString(),"base58"),addressTree:new PublicKey(r)}}async function N(e,n=0){let r=await no(n),s=deriveAddressSeedV2([new Uint8Array(getUtf8Encoder().encode("user")),e instanceof Ne?e.toTruncatedBuffer():new Uint8Array(getAddressEncoder().encode(e))]);return {address:createBN254(deriveAddressV2(s,new PublicKey(r),new PublicKey(A.toString())).toString(),"base58"),addressTree:new PublicKey(r)}}async function gt({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256(new Uint8Array(getUtf8Encoder().encode(n)));else throw new K("Either rpId or rpIdHash must be provided");let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return r}async function kA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function RA(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function LA(e,n,r){yA(r,0,255,"buffer_index");let[s]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),n instanceof Ne?n.toTruncatedBuffer():getAddressEncoder().encode(n),getU8Encoder().encode(r)]});return s}async function Ue(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return n}async function ue(e){let[n]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return n}async function R5(e){let n=await ue(e);return await Ue(n)}async function b5(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}async function w5(e){cr(e,"bundle");let n=await $s(e,true),r=await IA(n.map(getBase64EncodedWireTransaction),cA()),s=await $s(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await mM(s.map(getBase64EncodedWireTransaction))}async function mM(e,n=Zs(),r){cr(e,"serializedTransactions");let{blockEngineUrl:s}=n,t=`${s}/bundles`,c=await pt(()=>fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})}),r);await rr(c,t);let i=await nr(c);if(i.error)throw new me(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new me("No bundle ID returned from Jito");return i.result}async function V5(e,n=30,r=3e3,s=Zs()){lA(e,"bundleId");let{blockEngineUrl:t}=s,c=`${t}/getBundleStatuses`;return or(async()=>{let i=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await rr(i,c);let a=await nr(i);if(a.error)throw new me(`Error getting bundle status: ${JSON.stringify(a.error,null,2)}`,e);if(!a.result?.value?.length)throw new me("Bundle not yet confirmed",e);let o=a.result.value[0];if(o.confirmation_status==="confirmed"||o.confirmation_status==="finalized"){let u=o.transactions[o.transactions.length-1];if(!u)throw new me("No transactions in confirmed bundle",e);return u}throw new me(`Bundle status: ${o.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:i=>i instanceof me||i instanceof De})}async function J5({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await ne().getLatestBlockhash().send(),t=await pipe(createTransactionMessage({version:0}),c=>appendTransactionMessageInstructions(e,c),c=>setTransactionMessageFeePayerSigner(n,c),c=>setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([iA()(c),xA(ne(),c.instructions.flatMap(u=>u.accounts??[]))]),o=Math.ceil(i*1.1);return prependTransactionMessageInstructions([...o>2e5?[getSetComputeUnitLimitInstruction({units:o})]:[],...a>0?[getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await signTransactionMessageWithSigners(await c));return await aA()(t,{commitment:"confirmed",skipPreflight:true}),getSignatureFromTransaction(t)}function i6(e,n){if(n.threshold>1)throw new K("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(o=>wA(o.pubkey)===e);if(!r)throw new oe("Member",`Signer ${e} not found in settings`);let{permissions:s}=r;if(!s)throw new oe("Permissions","No permissions found for the current member");let t=Be.has(s,ve.InitiateTransaction),c=Be.has(s,ve.VoteTransaction),i=Be.has(s,ve.ExecuteTransaction);if(t&&c&&i)return {};if(!c||!i)throw new mr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(o=>o.role===0);if(!a)throw new oe("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(wA(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function d6({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await ir(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new oe("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return vM(n,c.transactionManagerUrl.value,e,s)}function vM(e,n,r,s){return {address:e,async signTransactions(t){let c=await pt(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:e.toString(),payload:t.map(a=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(a)),transactionMessageBytes:s?getBase64Decoder().decode(s):void 0,authResponses:r}))})}));if(!c.ok)throw new De(`Transaction manager request failed: ${c.statusText}`,c.status,n);let i=await c.json();if("error"in i)throw new De(`Transaction manager error: ${i.error}`,c.status,n);return i.signatures.map(a=>({[e]:getBase58Encoder().encode(a)}))}}}function wA(e){return e.keyType===tr.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function u6(e){let n=e.map(c=>je().encode(c)),r=4+n.reduce((c,i)=>c+i.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 A6(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 i=Je().read(e,n);t[c]=i[0],n=i[1];}if(n!==e.length)throw new K(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function h6({payer:e,rpId:n,origins:r,authority:s}){let t=await gt({rpId:n}),c=new B;await c.addSystemAccounts();let i=await be(),{address:a,addressTree:o}=await N(s.address,i),u=[{address:a,tree:o,queue:o,type:"User"}],d=await w([],u),g=(await Ae(c,d.treeInfos,d.roots,d.rootIndices,u))[0],{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),S=U(d,l);return await Ya({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function w6({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let i=[];r.index&&(i.push({address:(await ae(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&i.push({address:(await N(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let a=i.length?await ye(i,t):[],o=await be(),{address:u,addressTree:d}=await N(r.member,o),g=[{address:u,type:"User",tree:d,queue:d}],p=await w(a,g),l=null,S=null,b=a.filter(z=>z.type==="Settings"),x=a.filter(z=>z.type==="User");b.length&&(l=de(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),b,j())[0]),x.length&&(S=de(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,Y())[0]);let I=await Ae(c,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),g),{remainingAccounts:_,systemOffset:v}=c.toAccountMetas(),D=U(p,v);return await ei({payer:n,authority:e,compressedProofArgs:D,member:Vt().decode(r.member.toBuffer()),credentialId:new Uint8Array(base64URLStringToBuffer(r.credentialId)),transports:r.transports,role:r.role,linkWalletArgs:l?some({settingsMutArgs:l,transactionManager:S?some(S):none()}):none(),userAccountCreationArgs:I[0],domainConfig:s,remainingAccounts:_})}async function G6({payer:e}){let n=await kA();return si({payer:e,globalCounter:n})}async function J6({admin:e,rpId:n,disable:r}){let s=await gt({rpId:n});return xi({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function eV({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:i}=await ae(r,s),a=[{address:c,tree:i,queue:i,type:"Settings"}],o=await w([],a),u=(await Ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:d,systemOffset:g}=t.toAccountMetas(),p=U(o,g);return zi({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:u,remainingAccounts:d})}async function aV({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:i}=await N(r,s),a=[{address:c,tree:i,queue:i,type:"User"}],o=await w([],a),u=(await Ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:d,systemOffset:g}=t.toAccountMetas(),p=U(o,g);return Zi({compressedProofArgs:p,args:e,authority:n,userCreationArgs:u,remainingAccounts:d})}function kM(e,n,r,s){let t=LM(e,n),c=OM(e,n)&&r!==s;return t&&c?AccountRole.WRITABLE_SIGNER:t&&!c?AccountRole.WRITABLE:!t&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function LM(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=s-t,a=r-s-c;return n>=r?false:n<i?true:n>=s?n-s<a:false}function OM(e,n){return n<e.header.numSignerAccounts}async function qr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=oA(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),ne()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,o]of t.staticAccounts.entries())i.push({address:o,role:kM(t,a,o,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let o=c[a.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let u of a.writableIndexes){let d=o[u];if(!d)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${u}`);i.push({address:d,role:AccountRole.WRITABLE});}for(let u of a.readonlyIndexes){let d=o[u];if(!d)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${u}`);i.push({address:d,role:AccountRole.READONLY});}}for(let a of s?.filter(o=>o.address!==e)??[]){let o=i.findIndex(u=>u.address===a.address);o===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[o].role===AccountRole.READONLY||i[o].role===AccountRole.READONLY_SIGNER?i[o]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[o].role===AccountRole.WRITABLE||i[o].role===AccountRole.WRITABLE_SIGNER)&&(i[o]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}var yt=33,Tt=64,ao=14,GM=2,zM=address("Secp256r1SigVerify1111111111111111111111111");function KM(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function jM(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function KA(){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=jM();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=ao;let i=[];for(let a=0;a<r;a++){let o=fixDecoderSize(getBytesDecoder(),yt).decode(e,n);n+=yt;let u=fixDecoderSize(getBytesDecoder(),Tt).decode(e,n);n+=Tt;let d=t[a].messageDataSize,g=fixDecoderSize(getBytesDecoder(),d).decode(e,n);n+=d,i.push({publicKey:o,signature:u,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:i},n]}})}function jA(){return createEncoder({getSizeFromValue:e=>{let n=ao*e.offsets.length,r=e.payload.reduce((s,t)=>s+yt+Tt+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=KM();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=fixEncoderSize(getBytesEncoder(),yt).write(t.publicKey,n,r),r=fixEncoderSize(getBytesEncoder(),Tt).write(t.signature,n,r),r=getBytesEncoder().write(t.message,n,r);return r}})}function CV(){return combineCodec(jA(),KA())}function V(e,n){let r=e.length,s=GM+r*ao,t=[];for(let o=0;o<r;o++){let{message:u}=e[o],d=s,g=d+yt,p=g+Tt;t.push({publicKeyOffset:d,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:u.length,messageInstructionIndex:65535}),s+=yt+Tt+u.length;}let c=n?.programAddress??zM,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:jA().encode(i)}}function EV(e){return {programAddress:e.programAddress,accounts:{},data:KA().decode(e.data)}}async function JA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:o=false}){let u=await Ue(e),{accountMetas:d,addressLookupTableAccounts:g}=await qr({transactionMessageBytes:r,walletAddress:u,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(V(c)),p.push(o?Nu({transactionBuffer:n,payer:s.address,remainingAccounts:d,settingsKey:e}):Uu({transactionBuffer:n,payer:s.address,settings:e})),a&&p.push(CA({payer:s,tipAmount:a})),{instructions:p,addressLookupTableAccounts:g}}async function qA({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:i=[],compressed:a=false,simulateProof:o=false,cachedAccounts:u}){let d=fe(s),g=await ue(e),p=await Ue(g),[{accountMetas:l,addressLookupTableAccounts:S,transactionMessage:b},{settingsMutArgs:x,proof:I,packedAccounts:_}]=await Promise.all([qr({transactionMessageBytes:r,walletAddress:p,additionalSigners:d.filter(te=>!(te instanceof P)),addressesByLookupTableAddress:c}),Re(a,e,n,o,u)]);_.addPreAccounts(l);let v=d.filter(te=>te instanceof P),{secp256r1VerifyArgs:D}=qM(v,i,_),{remainingAccounts:z,systemOffset:X}=_.toAccountMetas();return {instructions:YM({secp256r1VerifyInput:i,transactionMessage:b,accountMetas:l,compressed:a,payer:t,settingsMutArgs:x,proof:I,systemOffset:X,secp256r1VerifyArgs:D,settings:g,remainingAccounts:z}),addressLookupTableAccounts:S}}function qM(e,n,r){let s=[];for(let t of e){let c=n.length,{domainConfig:i,verifyArgs:a,signature:o,publicKey:u,message:d}=Z(t,c);d&&o&&u&&n.push({message:d,signature:o,publicKey:u}),i&&(r.addPreAccounts([{address:i,role:AccountRole.READONLY}]),a.__option==="Some"&&s.push({domainConfigKey:i,verifyArgs:a.value}));}return {secp256r1VerifyArgs:s}}function YM({secp256r1VerifyInput:e,transactionMessage:n,accountMetas:r,compressed:s,payer:t,settingsMutArgs:c,proof:i,systemOffset:a,secp256r1VerifyArgs:o,settings:u,remainingAccounts:d}){let g=[];e.length>0&&g.push(V(e));let p=ZM(n,r);if(s){if(!t||!c)throw new Error("Payer not found or proof args is missing.");let l=U(i,a);g.push(Zu({secp256r1VerifyArgs:o,transactionMessage:p,settingsMutArgs:c,compressedProofArgs:l,payer:t,remainingAccounts:d}));}else g.push(zu({secp256r1VerifyArgs:o,settings:u,transactionMessage:p,remainingAccounts:d}));return g}function ZM(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 JV({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let o=fe(s),u=await ue(e),d=await Ue(u),[{packedAccounts:g,proof:p,settingsMutArgs:l},{value:S}]=await Promise.all([Re(a,e,n,false,t),st(d,t)]);if((S?.lamports??0)<BigInt(c))throw new Error("Insufficient balance");let b=[],x=[];for(let D of o)if(D instanceof P){let z=b.length,{domainConfig:X,verifyArgs:ie,signature:te,publicKey:Te,message:le}=Z(D,z);le&&te&&Te&&b.push({message:le,signature:te,publicKey:Te}),X&&(g.addPreAccounts([{address:X,role:AccountRole.READONLY}]),ie.__option==="Some"&&x.push({domainConfigKey:X,verifyArgs:ie.value}));}else g.addPreAccounts([{address:D.address,role:AccountRole.READONLY_SIGNER,signer:D}]);let{remainingAccounts:I,systemOffset:_}=g.toAccountMetas(),v=[];if(b.length>0&&v.push(V(b)),a){if(!i||!l)throw new Error("Payer not found or proof args is missing.");let D=U(p,_);v.push(cd({amount:c,settingsMutArgs:l,compressedProofArgs:D,payer:i,secp256r1VerifyArgs:x,source:d,destination:r,remainingAccounts:I}));}else v.push(ed({amount:c,secp256r1VerifyArgs:x,source:d,destination:r,settings:u,remainingAccounts:I}));return v}var rh=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),nh=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Zr=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function c8({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:o,splInterfacePdaArgs:u={index:0,restricted:false},compressed:d=false}){let g=fe(t),p=await ue(e),l=await Ue(p),S=W=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(W),getAddressEncoder().encode(Zr),getAddressEncoder().encode(s)],programAddress:Zr}),b=()=>{let W=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(s)];return u.restricted&&W.push(getUtf8Encoder().encode("restricted")),u.index>0&&W.push(getU8Encoder().encode(u.index)),W},[x,[I],_,[v],[D]]=await Promise.all([getAssociatedTokenAccountAddress(s,l,o),S(l),getAssociatedTokenAccountAddress(s,r,o),S(r),getProgramDerivedAddress({seeds:b(),programAddress:Zr})]),[z,X,ie,te]=await Promise.all([st(_,c),st(x,c),st(I,c),ch(d,e,n,c)]),Te=!!z.value,le=!!X.value,He=!!ie.value,_e=le?getTokenDecoder().decode(getBase64Encoder().encode(X.value.data[0])).amount:BigInt(0),it=BigInt(He?ah(new Uint8Array(getBase64Encoder().encode(ie.value.data[0])))?.amount??0:0),dr=Te?_:void 0,en=Te?void 0:v,lt=le&&(_e+it<BigInt(i)||it>BigInt(0)||!Te)||!le&&Te,T=!Te,[pe,yo]=await Promise.all([oh(l,s,_e,it,BigInt(i),d?3:4),sh(lt,D,c)]),Q=pe.reduce((W,se)=>W+se.parsed.amount.toNumber(),0);if(_e+it+BigInt(Q)<BigInt(i))throw new Error("Insufficient balance");let dt=null,We=null,ke=new B;if(yo&&ke.addPreAccounts([{address:s,role:AccountRole.WRITABLE}]),te||pe.length){await ke.addSystemAccounts();let W=[];if(pe.length&&W.push(...pe.map(se=>({hash:se.compressedAccount.hash,tree:se.compressedAccount.treeInfo.tree,queue:se.compressedAccount.treeInfo.queue,data:se.compressedAccount.data,address:se.compressedAccount.address}))),te&&W.push(te),We=await w(W,[]),te){let se=pe.length;dt=de(ke,We.treeInfos.slice(se),We.leafIndices.slice(se),We.rootIndices.slice(se),We.proveByIndices.slice(se),W.slice(se),j())[0];}}let pg=pe.length&&We?some(pe.map((W,se)=>({isFrozen:W.parsed.state===AccountState.Frozen,hasDelegate:W.parsed.delegate!=null,amount:W.parsed.amount.toNumber(),merkleContext:{leafIndex:W.compressedAccount.leafIndex,merkleTreePubkeyIndex:ke.insertOrGet(W.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:ke.insertOrGet(W.compressedAccount.treeInfo.queue.toString()),proveByIndex:W.compressedAccount.proveByIndex},rootIndex:We.rootIndices[se],version:hA(W.compressedAccount.data?.discriminator),tlv:W.parsed.tlv?some(getArrayDecoder(Wt()).decode(W.parsed.tlv)):none()}))):none(),ur=[],To=[];for(let W of g)if(W instanceof P){let se=ur.length,{domainConfig:tn,verifyArgs:fo,signature:So,publicKey:xo,message:Io}=Z(W,se);Io&&So&&xo&&ur.push({message:Io,signature:So,publicKey:xo}),tn&&(ke.addPreAccounts([{address:tn,role:AccountRole.READONLY}]),fo.__option==="Some"&&To.push({domainConfigKey:tn,verifyArgs:fo.value}));}else ke.addPreAccounts([{address:W.address,role:AccountRole.READONLY_SIGNER,signer:W}]);let{remainingAccounts:mg,systemOffset:yg}=ke.toAccountMetas(),Ar=[];ur.length>0&&Ar.push(V(ur));let Tg=U(We,yg),lg=lt?D:void 0,fg=T?nh:void 0,Sg=lt?some(u):none(),lo={amount:i,secp256r1VerifyArgs:To,source:l,destination:r,sourceCtokenTokenAccount:I,sourceSplTokenAccount:x,destinationCtokenTokenAccount:en,destinationSplTokenAccount:dr,mint:s,tokenProgram:o,remainingAccounts:mg,payer:a,sourceCompressedTokenAccounts:pg,compressedProofArgs:Tg,compressibleConfig:rh,splInterfacePda:lg,rentSponsor:fg,splInterfacePdaArgs:Sg};if(d){if(!dt)throw new Error("Payer not found or proof args is missing.");Ar.push(xd({...lo,settingsMutArgs:dt}));}else Ar.push(gd({...lo,settings:p}));return Ar}async function sh(e,n,r){if(!e)return false;let{value:s}=await st(n,r);return !s}async function oh(e,n,r,s,t,c){let i=t-r-s;if(i<=0)return [];let o=(await Me().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(n)})).items.filter(g=>!!g.compressedAccount.data?.data.length&&g.compressedAccount.owner.toString()===Zr.toString()&&!g.parsed.amount.isZero()).sort((g,p)=>p.parsed.amount.cmp(g.parsed.amount));if(o.length===0)return [];let u=BigInt(0),d=[];for(let g of o){if(d.length>=c||u>=i)break;u+=BigInt(g.parsed.amount.toNumber()),d.push(g);}if(u<i)throw d.length>=c?new Error("Transaction size limit exceeded. Consider multiple transfers to transfer full balance."):new Error("Insufficient balance.");return d}async function ch(e,n,r,s){if(!e)return null;let{address:t}=await ae(n,r);return (await ye([{address:t,type:"Settings"}],s))[0]}function ah(e){if(!e||e.length===0)return null;try{return {amount:getU64Decoder().decode(e.slice(64,72))}}catch(n){return console.error("Token data parsing error:",n),null}}async function l8({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:o}=r,u=fe(e),d=u.filter(_=>!(_ instanceof P));i.addPreAccounts(d.map(_=>({address:_.address,role:AccountRole.READONLY_SIGNER,signer:_})));let g=u.filter(_=>_ instanceof P),p=[],l=[];for(let _ of g){let v=l.length,{domainConfig:D,verifyArgs:z,signature:X,publicKey:ie,message:te}=Z(_,v);te&&X&&ie&&l.push({message:te,signature:X,publicKey:ie}),D&&(i.addPreAccounts([{address:D,role:AccountRole.READONLY}]),z.__option==="Some"&&p.push({domainConfigKey:D,verifyArgs:z.value}));}let{remainingAccounts:S,systemOffset:b}=i.toAccountMetas(),x=U(a,b),I=[];if(l.length>0&&I.push(V(l)),c){if(!o)throw new Error("Payer not found or proof args is missing.");I.push(ka({configActions:t,payer:n,compressedProofArgs:x,settingsMutArgs:o,remainingAccounts:S,secp256r1VerifyArgs:p}));}else I.push(await Ma({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:S,secp256r1VerifyArgs:p}));return I}async function D8({createUserArgs:e,payer:n}){let r=new B;await r.addSystemAccounts(),r.addPreAccounts(e.map(d=>({address:d.member.address,role:AccountRole.READONLY_SIGNER,signer:d.member})));let s=await be(),t=await Promise.all(e.map(async d=>{let{address:g,addressTree:p}=await N(d.member.address,s);return {address:g,tree:p,queue:p,type:"User"}})),c=await w([],t),i=await Ae(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:o}=r.toAccountMetas(),u=U(c,o);return await ii({compressedProofArgs:u,payer:n,createUserArgs:e.map((d,g)=>({member:d.member.address,role:d.role,userCreationArgs:i[g],transactionManagerUrl:d.role===0?d.transactionManagerUrl:null})),remainingAccounts:a})}async function v8({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let i=[],a=[];a.push(...await ye([{address:(await N(r.address,s)).address,type:"User"}],t));let o=await be(),{address:u,addressTree:d}=await ae(e,o);i.push({address:u,queue:d,tree:d,type:"Settings"});let g=a.length,p=await w(a,i),l=de(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),a.filter(v=>v.type==="User"),Y())[0],b=(await Ae(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),i)).find(v=>v.type==="Settings")??null,{remainingAccounts:x,systemOffset:I}=c.toAccountMetas(),_=U(p,I);if(!b)throw new Error("Settings creation args is missing.");return await wa({settingsIndex:e,payer:n,initialMember:r,userArgs:l.data.role===3?{__kind:"Mutate",fields:[l]}:{__kind:"Read",fields:[l]},compressedProofArgs:_,settingsCreation:b,remainingAccounts:x})}async function V8({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await Re(true,e,n,false,t);if(!a)throw new Error("Proof args is missing");let o=fe(s),u=o.filter(I=>I instanceof P),d=[],g=[];for(let I of u){let _=d.length,{domainConfig:v,verifyArgs:D,signature:z,publicKey:X,message:ie}=Z(I,_);ie&&z&&X&&d.push({message:ie,signature:z,publicKey:X}),v&&(c.addPreAccounts([{address:v,role:AccountRole.READONLY}]),D.__option==="Some"&&g.push({domainConfigKey:v,verifyArgs:D.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(),S=U(i,l),b=[];d.length>0&&b.push(V(d));let x=await ue(e);return b.push(mi({settings:x,payer:r,settingsMutArgs:a,compressedProofArgs:S,secp256r1VerifyArgs:g,remainingAccounts:p})),b}async function J8({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let i=new B;await i.addSystemAccounts();let a=await be(),{address:o,addressTree:u}=await N(r.address,a),d=[{address:o,tree:u,queue:u,type:"User"}],g=await w([],d),p=(await Ae(i,g.treeInfos,g.roots,g.rootIndices,d))[0],l=i.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:U(g,l.systemOffset),authorityCreationArgs:p};}return Mi({domainConfig:n,authority:e,newOrigins:s?some(s):none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function $8({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new B;await s.addSystemAccounts();let t=await ye([{address:(await N(e.address,n)).address,type:"User"}]),c=await w(t,[]),i=de(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,Y())[0],{remainingAccounts:a,systemOffset:o}=s.toAccountMetas(),u=U(c,o);return Ui({authority:e,transactionManagerUrl:r,compressedProofArgs:u,userMutArgs:i,remainingAccounts:a})}async function dH({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:o,publicKey:u}=Z(n),d=[];a&&o&&u&&d.push({message:a,signature:o,publicKey:u});let g=await ir(n instanceof P?n:n.address,r,t),p=[];p.push({address:(await N(n instanceof P?n:n.address,r)).address,type:"User"});let l,S=null,b,x=null,I=g.wallets.find(_e=>_e.isDelegate);I&&((await jr(I.index,I.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(I.index,I.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):l=await ue(I.index)),s&&((await jr(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):b=await ue(s.index));let _=new B;await _.addSystemAccounts();let v=await ye(p,t),D=await w(v,[]),z=de(_,D.treeInfos.slice(0,1),D.leafIndices.slice(0,1),D.rootIndices.slice(0,1),D.proveByIndices.slice(0,1),v.slice(0,1),Y())[0],X=S?some(de(_,D.treeInfos.slice(S.start,S.end),D.leafIndices.slice(S.start,S.end),D.rootIndices.slice(S.start,S.end),D.proveByIndices.slice(S.start,S.end),v.slice(S.start,S.end),j())[0]):none(),ie=x?some(de(_,D.treeInfos.slice(x.start,x.end),D.leafIndices.slice(x.start,x.end),D.rootIndices.slice(x.start,x.end),D.proveByIndices.slice(x.start,x.end),v.slice(x.start,x.end),j())[0]):none(),{remainingAccounts:te,systemOffset:Te}=_.toAccountMetas(),le=U(D,Te),He=[];return d.length>0&&He.push(V(d)),He.push(Ni({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:s?some(s):none(),feePayer:e,signer:n instanceof P?void 0:n,oldSettings:l,oldSettingsMutArgs:X,newSettings:b,newSettingsMutArgs:ie,compressedProofArgs:le,userMutArgs:z,remainingAccounts:te})),He}async function PH({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:i}){let a=await aa(ne(),s),o=a.data.multiWalletSettings,{packedAccounts:u,proof:d,settingsMutArgs:g}=await Re(c,e,n,false,i),{remainingAccounts:p,systemOffset:l}=u.toAccountMetas(),{domainConfig:S,verifyArgs:b,message:x,signature:I,publicKey:_}=Z(r),v=[];if(x&&I&&_&&v.push(V([{message:x,signature:I,publicKey:_}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let D=U(d,l);v.push(Ud({transactionBuffer:s,domainConfig:S,closer:r instanceof P?void 0:r,rentCollector:a.data.payer,secp256r1VerifyArgs:b,settingsMutArgs:g,payer:t,compressedProofArgs:D,remainingAccounts:p}));}else v.push(Md({transactionBuffer:s,domainConfig:S,closer:r instanceof P?void 0:r,settings:o,payer:a.data.payer,secp256r1VerifyArgs:b,remainingAccounts:[]}));return v}function ng({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:o,compressedArgs:u,expectedSecp256r1Signers:d}){let{domainConfig:g,verifyArgs:p,message:l,signature:S,publicKey:b}=Z(n),x=[];if(l&&S&&b&&x.push(V([{message:l,signature:S,publicKey:b}])),u){let{settingsReadonlyArgs:I,compressedProofArgs:_,remainingAccounts:v}=u;x.push(zd({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:d},settingsReadonlyArgs:I,compressedProofArgs:_,remainingAccounts:v}));}else x.push(Nd({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:d},remainingAccounts:[]}));return x}function sg({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:o}=Z(e),u=[];return a&&i&&o&&u.push(V([{message:a,signature:i,publicKey:o}])),s?u.push(ru({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof P?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(Zd({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof P?void 0:e,remainingAccounts:[]})),u}function og({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?mu({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):iu({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function cg({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:o}=Z(n),u=[];return o&&i&&a&&u.push(V([{message:o,signature:i,publicKey:a}])),s?u.push(Mu({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof P?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):u.push(xu({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof P?void 0:n,remainingAccounts:[]})),u}async function mF({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await Ah(r),i=new B,a=null,o=null,u=[];if(c.length||t){let g=await gh({packedAccounts:i,userAccounts:c,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:s});a=g.proof,o=g.settingsMutArgs??null,u=g.userMutArgs??[];}return {configActions:await ph({configActionsArgs:r,userMutArgs:u,index:e}),index:e,proof:a,settingsMutArgs:o,packedAccounts:i,compressed:t}}async function Ah(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>N(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let s=await Promise.all(r.members.map(t=>N(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function gh({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let l=(await ae(s,t)).address;i.push({address:l,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await ye(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await w(a,[]),u=[],d=[];for(let l of a)l.type==="Settings"?u.push(l):l.type==="User"&&d.push(l);let g,p=[];if(r&&o&&(g=de(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),u,j())[0]),d.length&&o){let l=r?1:0;p=de(e,o.treeInfos.slice(l),o.leafIndices.slice(l),o.rootIndices.slice(l),o.proveByIndices.slice(l),d,Y());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function ph({index:e,configActionsArgs:n,userMutArgs:r}){let s=[];for(let t of n)switch(t.type){case "AddMembers":{let c=[];for(let i of t.members){let a=await N(i.member,i.userAddressTreeIndex).then(o=>r.find(u=>equalBytes(new Uint8Array(u.accountMeta.address),new Uint8Array(getBase58Encoder().encode(encodeBN254toBase58(o.address))))));if(!a)throw new Error("Unable to find user account");c.push(Th({permissionArgs:i.permissions,userMutArgs:a,pubkey:i.member}));}s.push({__kind:t.type,fields:[c]});break}case "RemoveMembers":{let c=await Promise.all(t.members.map(i=>N(i.member,i.userAddressTreeIndex).then(a=>{let o=r.find(u=>equalBytes(new Uint8Array(u.accountMeta.address),new Uint8Array(getBase58Encoder().encode(encodeBN254toBase58(a.address)))));if(!o)throw new Error("Unable to find user account");return yh({pubkey:i.member,userMutArgs:o})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(i=>mh({permissionArgs:i.permissions,pubkey:i.member}));s.push({__kind:t.type,fields:[c]});break}default:s.push({__kind:t.type,fields:[t.threshold]});}return s}function mh({pubkey:e,permissionArgs:n}){return {memberKey:he(e),permissions:ug(n)}}function yh({pubkey:e,userMutArgs:n}){let r=n.data.role;if(r===2)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:he(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function Th({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===2)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===0&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:he(e),permissions:ug(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function ug(e){let n=[];return e.initiate&&n.push(ve.InitiateTransaction),e.vote&&n.push(ve.VoteTransaction),e.execute&&n.push(ve.ExecuteTransaction),Be.fromPermissions(n)}async function CF({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o,compressed:u=false,additionalVoters:d=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:l}){let S=await ue(n),b=Math.floor(Math.random()*255),x=await LA(S,t instanceof P?t:t.address,b),I=[],_=[];for(let Q=0;Q<s.length;Q+=p){let dt=s.subarray(Q,Q+p);I.push(dt),_.push(sha256(dt));}let v=sha256(new Uint8Array(s)),{settingsReadonlyArgs:D,settingsMutArgs:z,proof:X,packedAccounts:ie}=await Re(u,n,r,false,l),{remainingAccounts:te,systemOffset:Te}=ie.toAccountMetas(),le=X&&D&&z?{settingsReadonlyArgs:D,settingsMutArgs:z,compressedProofArgs:U(X,Te),remainingAccounts:te,payer:e}:null,He=fe([t,...c?[c]:[],...d]).filter(Q=>Q instanceof P).map(Q=>({memberKey:he(Q),messageHash:Qs(Q.authResponse)})),_e=ng({finalBufferHash:v,finalBufferSize:s.length,bufferIndex:b,payer:e,transactionBufferAddress:x,settings:S,creator:t,preauthorizeExecution:!c,bufferExtendHashes:_,compressedArgs:le,expectedSecp256r1Signers:He}),it=I.map(Q=>og({transactionMessageBytes:Q,transactionBufferAddress:x,settings:S,compressed:u})),dr=d.map(Q=>cg({voter:Q,transactionBufferAddress:x,settings:S,compressedArgs:le})),en=sg({compressedArgs:le,settings:S,executor:c,transactionBufferAddress:x}),{instructions:lt,addressLookupTableAccounts:T}=await JA({compressed:u,settings:S,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o}),pe=Q=>({payer:e,instructions:Q,addressesByLookupTableAddress:T});return [pe(_e),...it.map(Q=>pe([Q])),...dr.length?[pe(dr.flat())]:[],pe(en),pe(lt)]}var Qr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=i=>{let a=s.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},s.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let o=t(a.address);o.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,o.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),i={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let a=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [i,a]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,o=n.findIndex(u=>u===a);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(a),this.keyMetaMap.delete(c);}}return [s,t]}};var $r=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,i)=>{s.set(c,i);});let t=c=>{let i=s.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function gg({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Qr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(s??{});for(let p of a){let l=t.extractTableLookup(p);if(l!==void 0){let{addressTableLookup:S,drainedKeys:b}=l;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:address(S.lookupTableAddress)}),i.writable.push(...b.writable),i.readonly.push(...b.readonly);}}let[o,u]=t.getMessageComponents(),g=new $r(u,i).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:u,addressTableLookups:c}}function LF({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=gg({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return sA(s)}async function VF({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i,cachedAccounts:a,compressed:o=false,simulateProof:u=false}){let{instructions:d,addressLookupTableAccounts:g}=await qA({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:i,simulateProof:u,cachedAccounts:a});return {payer:e,instructions:d,addressesByLookupTableAddress:g}}
|
|
2
|
+
export{la as ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR,eA as AuthenticationContextSchema,ho as BACKOFF_MAX_DELAY_MS,Do as BUNDLE_POLL_DELAY_MS,Eo as BUNDLE_POLL_MAX_RETRIES,tA as BaseResponseSchema,me as BundleError,va as CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR,Da as CHANGE_CONFIG_DISCRIMINATOR,Co as COMPUTE_UNIT_MULTIPLIER,Ba as CREATE_COMPRESSED_WALLET_DISCRIMINATOR,Ja as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Qa as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,ri as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,ci as CREATE_USER_ACCOUNTS_DISCRIMINATOR,Dw as CompleteMessageRequestSchema,Pw as CompleteTransactionRequestSchema,Ai as DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR,Ro as DEFAULT_JITO_BLOCK_ENGINE_URL,bo as DEFAULT_JITO_TIPS_URL,_o as DEFAULT_JITO_TIP_PRIORITY,Po as DEFAULT_NETWORK_RETRY_DELAY_MS,nn as DEFAULT_NETWORK_RETRY_MAX_RETRIES,li as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Lo as DOMAIN_CONFIG_DISCRIMINATOR,Di as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,bi as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,Li as EDIT_USER_DELEGATE_DISCRIMINATOR,Mo as EXPONENTIAL_BACKOFF_BASE,Ho as GLOBAL_COUNTER_DISCRIMINATOR,Uo as HTTP_STATUS_BAD_REQUEST,on as HTTP_STATUS_INTERNAL_SERVER_ERROR,Wo as HTTP_STATUS_TOO_MANY_REQUESTS,sn as JITO_TIP_ACCOUNTS,tr as KeyType,vo as MAX_TRANSACTION_BUFFER_INDEX,Hi as MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR,Ji as MIGRATE_COMPRESSED_USERS_DISCRIMINATOR,gr as MIN_COMPUTE_UNITS,ID as MULTI_WALLET_ERROR__ALREADY_DELEGATED,XE as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,pP as MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED,HD as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,GD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,zD as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,AP as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,CP as MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE,eD as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,$E as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,AD as MULTI_WALLET_ERROR__EMPTY_MEMBERS,ZD as MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS,iD as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,QE as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,cD as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,_D as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,vD as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,UD as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,YD as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,DD as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,CD as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,ED as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,TD as MULTI_WALLET_ERROR__INVALID_ACCOUNT,uP as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,JD as MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE,dD as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,fD as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,bD as MULTI_WALLET_ERROR__INVALID_BUFFER,XD as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,PD as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,yD as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,nD as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,KE as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,qE as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,zE as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,JE as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,VD as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,ND as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,pD as MULTI_WALLET_ERROR__INVALID_THRESHOLD,aP as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,aD as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,oD as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,mD as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,TP as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,lD as MULTI_WALLET_ERROR__INVALID_USER_ROLE,yP as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,cP as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,YE as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,OD as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,KD as MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG,eP as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,dP as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS,SD as MULTI_WALLET_ERROR__MISSING_ACCOUNT,QD as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,nP as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,lP as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,oP as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,$D as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,xD as MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS,xP as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,SP as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,qD as MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA,fP as MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT,sP as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,BD as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,gP as MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS,IP as MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES,hD as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,uD as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,rD as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,sD as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,jD as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,rP as MULTI_WALLET_ERROR__PAYER_MISMATCH,tD as MULTI_WALLET_ERROR__PERMANENT_MEMBER,LD as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,ZE as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,tP as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,jE as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,wD as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,iP as MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH,gD as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,WD as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,kD as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,FD as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,RD as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,mP as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,MD as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,HE as MultiWalletAccount,FE as MultiWalletInstruction,nd as NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,Qi as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,De as NetworkError,oe as NotFoundError,Le as NotInitializedError,ve as Permission,mr as PermissionError,Be as Permissions,pr as RetryExhaustedError,Ee as RevibaseError,Qc as SETTINGS_DISCRIMINATOR,Ne as Secp256r1Key,P as SignedSecp256r1Key,Cw as StartMessageRequestSchema,Ew as StartTransactionRequestSchema,fd as TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR,ud as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,bd as TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR,Ed as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,Hd as TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR,Ld as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,sa as TRANSACTION_BUFFER_DISCRIMINATOR,$d as TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR,Jd as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Au as TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR,ou as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Eu as TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR,lu as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,Lu as TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR,bu as TRANSACTION_EXECUTE_DISCRIMINATOR,Ju as TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR,Hu as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,rn as TRANSACTION_SIZE_LIMIT,Qu as TransactionActionTypeSchema,EP as TransactionDetailsSchema,ko as TransactionError,Iw as TransactionPayloadSchema,$u as TransactionPayloadWithBase64MessageBytesSchema,Ss as Transports,Oe as UserRole,K as ValidationError,ua as WHITELISTED_ADDRESS_TREE_DISCRIMINATOR,yw as addWhitelistedAddressTrees,Ve as base64URLStringToBuffer,T2 as bufferToBase64URLString,l8 as changeConfig,PH as closeTransactionBuffer,MR as configAction,wA as convertMemberKeyToString,i2 as convertPubkeyCompressedToCose,a2 as convertPubkeyCoseToCompressed,p2 as createClientAuthorizationCompleteRequestChallenge,g2 as createClientAuthorizationStartRequestChallenge,h6 as createDomainConfig,w6 as createDomainUserAccounts,G6 as createGlobalCounter,m2 as createMessageChallenge,ng as createTransactionBuffer,y2 as createTransactionChallenge,vM as createTransactionManagerSigner,D8 as createUserAccounts,v8 as createWallet,Bo as decodeDomainConfig,Go as decodeGlobalCounter,$c as decodeSettings,ca as decodeTransactionBuffer,ga as decodeWhitelistedAddressTree,V8 as decompressSettingsAccount,A6 as deserializeConfigActions,J6 as disableDomainConfig,J8 as editDomainConfig,$8 as editTransactionManagerUrl,dH as editUserDelegate,JA as executeTransaction,sg as executeTransactionBuffer,qA as executeTransactionSync,og as extendTransactionBuffer,zR as extensionStruct,Eh as fetchAllDomainConfig,_h as fetchAllGlobalCounter,Wg as fetchAllMaybeDomainConfig,Yg as fetchAllMaybeGlobalCounter,Ol as fetchAllMaybeSettings,rf as fetchAllMaybeTransactionBuffer,Ef as fetchAllMaybeWhitelistedAddressTree,pU as fetchAllSettings,y5 as fetchAllSettingsAccountByMember,SU as fetchAllTransactionBuffer,DU as fetchAllWhitelistedAddressTree,No as fetchDomainConfig,bh as fetchGlobalCounter,Ug as fetchMaybeDomainConfig,qg as fetchMaybeGlobalCounter,xs as fetchMaybeSettings,AM as fetchMaybeSettingsAccountData,tf as fetchMaybeTransactionBuffer,uM as fetchMaybeUserAccountData,Cf as fetchMaybeWhitelistedAddressTree,gU as fetchSettings,jr as fetchSettingsAccountData,aa as fetchTransactionBuffer,m5 as fetchUserAccountByFilters,ir as fetchUserAccountData,pa as fetchWhitelistedAddressTree,Nh as getAddMemberArgsCodec,un as getAddMemberArgsDecoder,dn as getAddMemberArgsEncoder,HU as getAddWhitelistedAddressTreesDiscriminatorBytes,GU as getAddWhitelistedAddressTreesInstruction,Sa as getAddWhitelistedAddressTreesInstructionAsync,FU as getAddWhitelistedAddressTreesInstructionDataCodec,fa as getAddWhitelistedAddressTreesInstructionDataDecoder,Rs as getAddWhitelistedAddressTreesInstructionDataEncoder,kh as getAdditionalMetadataCodec,an as getAdditionalMetadataDecoder,cn as getAdditionalMetadataEncoder,aW as getChangeConfigCompressedDiscriminatorBytes,ka as getChangeConfigCompressedInstruction,iW as getChangeConfigCompressedInstructionDataCodec,Wa as getChangeConfigCompressedInstructionDataDecoder,Ua as getChangeConfigCompressedInstructionDataEncoder,XU as getChangeConfigDiscriminatorBytes,$U as getChangeConfigInstruction,Ma as getChangeConfigInstructionAsync,QU as getChangeConfigInstructionDataCodec,Pa as getChangeConfigInstructionDataDecoder,_s as getChangeConfigInstructionDataEncoder,Xs as getClientAndDeviceHash,Hh as getCompiledInstructionCodec,gn as getCompiledInstructionDecoder,An as getCompiledInstructionEncoder,Kh as getCompressedAccountMetaCodec,It as getCompressedAccountMetaDecoder,xt as getCompressedAccountMetaEncoder,Yh as getCompressedAccountMetaReadOnlyCodec,Pt as getCompressedAccountMetaReadOnlyDecoder,Dt as getCompressedAccountMetaReadOnlyEncoder,Qh as getCompressedOnlyExtensionCodec,mn as getCompressedOnlyExtensionDecoder,pn as getCompressedOnlyExtensionEncoder,tR as getCompressedProofCodec,xn as getCompressedProofDecoder,Sn as getCompressedProofEncoder,ae as getCompressedSettingsAddressFromIndex,oR as getCompressedSettingsCodec,dR as getCompressedSettingsDataCodec,Rt as getCompressedSettingsDataDecoder,ht as getCompressedSettingsDataEncoder,j as getCompressedSettingsDecoder,Mt as getCompressedSettingsEncoder,pR as getCompressedTokenArgsCodec,Ut as getCompressedTokenArgsDecoder,vt as getCompressedTokenArgsEncoder,lR as getCompressibleExtensionCodec,hn as getCompressibleExtensionDecoder,Mn as getCompressibleExtensionEncoder,IR as getCompressionInfoCodec,bn as getCompressionInfoDecoder,Rn as getCompressionInfoEncoder,iA as getComputeBudgetEstimate,PR as getConfigActionCodec,Je as getConfigActionDecoder,je as getConfigActionEncoder,TW as getCreateCompressedWalletDiscriminatorBytes,fW as getCreateCompressedWalletInstruction,wa as getCreateCompressedWalletInstructionAsync,lW as getCreateCompressedWalletInstructionDataCodec,Na as getCreateCompressedWalletInstructionDataDecoder,vs as getCreateCompressedWalletInstructionDataEncoder,MW as getCreateDomainConfigDiscriminatorBytes,RW as getCreateDomainConfigInstruction,Ya as getCreateDomainConfigInstructionAsync,hW as getCreateDomainConfigInstructionDataCodec,qa as getCreateDomainConfigInstructionDataDecoder,Ws as getCreateDomainConfigInstructionDataEncoder,OW as getCreateDomainUserAccountDiscriminatorBytes,NW as getCreateDomainUserAccountInstruction,ei as getCreateDomainUserAccountInstructionAsync,BW as getCreateDomainUserAccountInstructionDataCodec,$a as getCreateDomainUserAccountInstructionDataDecoder,ks as getCreateDomainUserAccountInstructionDataEncoder,KW as getCreateGlobalCounterDiscriminatorBytes,JW as getCreateGlobalCounterInstruction,si as getCreateGlobalCounterInstructionAsync,jW as getCreateGlobalCounterInstructionDataCodec,ni as getCreateGlobalCounterInstructionDataDecoder,Os as getCreateGlobalCounterInstructionDataEncoder,vR as getCreateUserAccountArgsCodec,Hn as getCreateUserAccountArgsDecoder,Vn as getCreateUserAccountArgsEncoder,tk as getCreateUserAccountsDiscriminatorBytes,nk as getCreateUserAccountsInstruction,ii as getCreateUserAccountsInstructionAsync,rk as getCreateUserAccountsInstructionDataCodec,ai as getCreateUserAccountsInstructionDataDecoder,Ns as getCreateUserAccountsInstructionDataEncoder,Ak as getDecompressSettingsAccountDiscriminatorBytes,mi as getDecompressSettingsAccountInstruction,gk as getDecompressSettingsAccountInstructionDataCodec,pi as getDecompressSettingsAccountInstructionDataDecoder,gi as getDecompressSettingsAccountInstructionDataEncoder,Sk as getDisableDomainConfigDiscriminatorBytes,xi as getDisableDomainConfigInstruction,xk as getDisableDomainConfigInstructionDataCodec,Si as getDisableDomainConfigInstructionDataDecoder,fi as getDisableDomainConfigInstructionDataEncoder,gt as getDomainConfigAddress,Ch as getDomainConfigCodec,Oo as getDomainConfigDecoder,Ih as getDomainConfigDiscriminatorBytes,vg as getDomainConfigEncoder,Dh as getDomainConfigSize,Rk as getEditDomainConfigDiscriminatorBytes,Mi as getEditDomainConfigInstruction,_k as getEditDomainConfigInstructionAsync,bk as getEditDomainConfigInstructionDataCodec,Pi as getEditDomainConfigInstructionDataDecoder,Vs as getEditDomainConfigInstructionDataEncoder,LR as getEditMemberArgsCodec,Bn as getEditMemberArgsDecoder,On as getEditMemberArgsEncoder,Nk as getEditTransactionManagerUrlDiscriminatorBytes,Ui as getEditTransactionManagerUrlInstruction,wk as getEditTransactionManagerUrlInstructionDataCodec,vi as getEditTransactionManagerUrlInstructionDataDecoder,_i as getEditTransactionManagerUrlInstructionDataEncoder,Jk as getEditUserDelegateDiscriminatorBytes,Ni as getEditUserDelegateInstruction,qk as getEditUserDelegateInstructionDataCodec,Bi as getEditUserDelegateInstructionDataDecoder,Oi as getEditUserDelegateInstructionDataEncoder,wR as getExpectedSecp256r1SignersCodec,Lt as getExpectedSecp256r1SignersDecoder,kt as getExpectedSecp256r1SignersEncoder,GR as getExtensionStructCodec,Wt as getExtensionStructDecoder,In as getExtensionStructEncoder,kA as getGlobalCounterAddress,Rh as getGlobalCounterCodec,Fo as getGlobalCounterDecoder,hh as getGlobalCounterDiscriminatorBytes,Jg as getGlobalCounterEncoder,vh as getGlobalCounterSize,Zs as getJitoTipsConfig,b5 as getLightCpiSigner,Me as getLightProtocolRpc,YR as getLinkWalletArgsCodec,$n as getLinkWalletArgsDecoder,Qn as getLinkWalletArgsEncoder,$R as getMemberCodec,_t as getMemberDecoder,bt as getMemberEncoder,rb as getMemberKeyCodec,ce as getMemberKeyDecoder,H as getMemberKeyEncoder,rL as getMigrateCompressedSettingsDiscriminatorBytes,zi as getMigrateCompressedSettingsInstruction,nL as getMigrateCompressedSettingsInstructionDataCodec,Gi as getMigrateCompressedSettingsInstructionDataDecoder,Fi as getMigrateCompressedSettingsInstructionDataEncoder,AL as getMigrateCompressedUsersDiscriminatorBytes,Zi as getMigrateCompressedUsersInstruction,gL as getMigrateCompressedUsersInstructionDataCodec,Yi as getMigrateCompressedUsersInstructionDataDecoder,qi as getMigrateCompressedUsersInstructionDataEncoder,nw as getMultiWalletErrorMessage,_L as getNativeTransferIntentCompressedDiscriminatorBytes,cd as getNativeTransferIntentCompressedInstruction,vL as getNativeTransferIntentCompressedInstructionDataCodec,od as getNativeTransferIntentCompressedInstructionDataDecoder,sd as getNativeTransferIntentCompressedInstructionDataEncoder,xL as getNativeTransferIntentDiscriminatorBytes,ed as getNativeTransferIntentInstruction,CL as getNativeTransferIntentInstructionAsync,IL as getNativeTransferIntentInstructionDataCodec,$i as getNativeTransferIntentInstructionDataDecoder,Hs as getNativeTransferIntentInstructionDataEncoder,cb as getNewAuthorityArgsCodec,ns as getNewAuthorityArgsDecoder,rs as getNewAuthorityArgsEncoder,l2 as getOriginIndex,db as getPackedAddressTreeInfoCodec,wt as getPackedAddressTreeInfoDecoder,Nt as getPackedAddressTreeInfoEncoder,gb as getPackedMerkleContextCodec,En as getPackedMerkleContextDecoder,Cn as getPackedMerkleContextEncoder,yb as getPackedStateTreeInfoCodec,Et as getPackedStateTreeInfoDecoder,Ct as getPackedStateTreeInfoEncoder,fb as getPausableAccountExtensionCodec,Gn as getPausableAccountExtensionDecoder,Fn as getPausableAccountExtensionEncoder,Ib as getPermanentDelegateAccountExtensionCodec,Kn as getPermanentDelegateAccountExtensionDecoder,zn as getPermanentDelegateAccountExtensionEncoder,Db as getPermissionsCodec,Ge as getPermissionsDecoder,Fe as getPermissionsEncoder,Rb as getProofArgsCodec,E as getProofArgsDecoder,C as getProofArgsEncoder,Ub as getRemoveMemberArgsCodec,wn as getRemoveMemberArgsDecoder,Nn as getRemoveMemberArgsEncoder,Lb as getRentConfigCodec,Wn as getRentConfigDecoder,Un as getRentConfigEncoder,Qs as getSecp256r1MessageHash,Nb as getSecp256r1PubkeyCodec,Vt as getSecp256r1PubkeyDecoder,cs as getSecp256r1PubkeyEncoder,jM as getSecp256r1SignatureOffsetsDataDecoder,KM as getSecp256r1SignatureOffsetsDataEncoder,Hb as getSecp256r1VerifyArgsCodec,G as getSecp256r1VerifyArgsDecoder,F as getSecp256r1VerifyArgsEncoder,Kb as getSecp256r1VerifyArgsWithDomainAddressCodec,ee as getSecp256r1VerifyArgsWithDomainAddressDecoder,$ as getSecp256r1VerifyArgsWithDomainAddressEncoder,V as getSecp256r1VerifyInstruction,CV as getSecp256r1VerifyInstructionDataCodec,KA as getSecp256r1VerifyInstructionDataDecoder,jA as getSecp256r1VerifyInstructionDataEncoder,aA as getSendAndConfirmTransaction,AU as getSettingsCodec,Yb as getSettingsCreationArgsCodec,Ft as getSettingsCreationArgsDecoder,Ht as getSettingsCreationArgsEncoder,vr as getSettingsDecoder,uU as getSettingsDiscriminatorBytes,Ll as getSettingsEncoder,ue as getSettingsFromIndex,t_ as getSettingsIndexWithAddressAndDelegateInfoCodec,us as getSettingsIndexWithAddressAndDelegateInfoDecoder,ds as getSettingsIndexWithAddressAndDelegateInfoEncoder,Qb as getSettingsIndexWithAddressCodec,is as getSettingsIndexWithAddressDecoder,as as getSettingsIndexWithAddressEncoder,o_ as getSettingsMutArgsCodec,q as getSettingsMutArgsDecoder,J as getSettingsMutArgsEncoder,d_ as getSettingsReadonlyArgsCodec,zt as getSettingsReadonlyArgsDecoder,Gt as getSettingsReadonlyArgsEncoder,d2 as getSignedSecp256r1Key,d6 as getSignedTransactionManager,ne as getSolanaRpc,cA as getSolanaRpcEndpoint,g_ as getSplInterfacePdaArgsCodec,jt as getSplInterfacePdaArgsDecoder,Kt as getSplInterfacePdaArgsEncoder,T_ as getTokenMetadataCodec,Jn as getTokenMetadataDecoder,jn as getTokenMetadataEncoder,YL as getTokenTransferIntentCompressedDiscriminatorBytes,xd as getTokenTransferIntentCompressedInstruction,XL as getTokenTransferIntentCompressedInstructionAsync,ZL as getTokenTransferIntentCompressedInstructionDataCodec,Sd as getTokenTransferIntentCompressedInstructionDataDecoder,Ks as getTokenTransferIntentCompressedInstructionDataEncoder,wL as getTokenTransferIntentDiscriminatorBytes,gd as getTokenTransferIntentInstruction,HL as getTokenTransferIntentInstructionAsync,VL as getTokenTransferIntentInstructionDataCodec,Ad as getTokenTransferIntentInstructionDataDecoder,zs as getTokenTransferIntentInstructionDataEncoder,LA as getTransactionBufferAddress,mO as getTransactionBufferCloseCompressedDiscriminatorBytes,Ud as getTransactionBufferCloseCompressedInstruction,yO as getTransactionBufferCloseCompressedInstructionDataCodec,vd as getTransactionBufferCloseCompressedInstructionDataDecoder,_d as getTransactionBufferCloseCompressedInstructionDataEncoder,oO as getTransactionBufferCloseDiscriminatorBytes,Md as getTransactionBufferCloseInstruction,cO as getTransactionBufferCloseInstructionDataCodec,Pd as getTransactionBufferCloseInstructionDataDecoder,Dd as getTransactionBufferCloseInstructionDataEncoder,fU as getTransactionBufferCodec,x_ as getTransactionBufferCreateArgsCodec,qt as getTransactionBufferCreateArgsDecoder,Jt as getTransactionBufferCreateArgsEncoder,UO as getTransactionBufferCreateCompressedDiscriminatorBytes,zd as getTransactionBufferCreateCompressedInstruction,WO as getTransactionBufferCreateCompressedInstructionDataCodec,Gd as getTransactionBufferCreateCompressedInstructionDataDecoder,Fd as getTransactionBufferCreateCompressedInstructionDataEncoder,EO as getTransactionBufferCreateDiscriminatorBytes,Nd as getTransactionBufferCreateInstruction,DO as getTransactionBufferCreateInstructionDataCodec,Bd as getTransactionBufferCreateInstructionDataDecoder,Od as getTransactionBufferCreateInstructionDataEncoder,oa as getTransactionBufferDecoder,lU as getTransactionBufferDiscriminatorBytes,ef as getTransactionBufferEncoder,ZO as getTransactionBufferExecuteCompressedDiscriminatorBytes,ru as getTransactionBufferExecuteCompressedInstruction,XO as getTransactionBufferExecuteCompressedInstructionDataCodec,tu as getTransactionBufferExecuteCompressedInstructionDataDecoder,eu as getTransactionBufferExecuteCompressedInstructionDataEncoder,HO as getTransactionBufferExecuteDiscriminatorBytes,Zd as getTransactionBufferExecuteInstruction,FO as getTransactionBufferExecuteInstructionDataCodec,Yd as getTransactionBufferExecuteInstructionDataDecoder,qd as getTransactionBufferExecuteInstructionDataEncoder,gB as getTransactionBufferExtendCompressedDiscriminatorBytes,mu as getTransactionBufferExtendCompressedInstruction,pB as getTransactionBufferExtendCompressedInstructionDataCodec,pu as getTransactionBufferExtendCompressedInstructionDataDecoder,gu as getTransactionBufferExtendCompressedInstructionDataEncoder,sB as getTransactionBufferExtendDiscriminatorBytes,iu as getTransactionBufferExtendInstruction,oB as getTransactionBufferExtendInstructionDataCodec,au as getTransactionBufferExtendInstructionDataDecoder,cu as getTransactionBufferExtendInstructionDataEncoder,_B as getTransactionBufferVoteCompressedDiscriminatorBytes,Mu as getTransactionBufferVoteCompressedInstruction,vB as getTransactionBufferVoteCompressedInstructionDataCodec,Pu as getTransactionBufferVoteCompressedInstructionDataDecoder,Du as getTransactionBufferVoteCompressedInstructionDataEncoder,IB as getTransactionBufferVoteDiscriminatorBytes,xu as getTransactionBufferVoteInstruction,CB as getTransactionBufferVoteInstructionDataCodec,Su as getTransactionBufferVoteInstructionDataDecoder,fu as getTransactionBufferVoteInstructionDataEncoder,jB as getTransactionExecuteCompressedDiscriminatorBytes,Nu as getTransactionExecuteCompressedInstruction,JB as getTransactionExecuteCompressedInstructionDataCodec,Bu as getTransactionExecuteCompressedInstructionDataDecoder,Ou as getTransactionExecuteCompressedInstructionDataEncoder,NB as getTransactionExecuteDiscriminatorBytes,Uu as getTransactionExecuteInstruction,wB as getTransactionExecuteInstructionDataCodec,vu as getTransactionExecuteInstructionDataDecoder,_u as getTransactionExecuteInstructionDataEncoder,uN as getTransactionExecuteSyncCompressedDiscriminatorBytes,Zu as getTransactionExecuteSyncCompressedInstruction,AN as getTransactionExecuteSyncCompressedInstructionDataCodec,Yu as getTransactionExecuteSyncCompressedInstructionDataDecoder,qu as getTransactionExecuteSyncCompressedInstructionDataEncoder,tN as getTransactionExecuteSyncDiscriminatorBytes,zu as getTransactionExecuteSyncInstruction,rN as getTransactionExecuteSyncInstructionDataCodec,Gu as getTransactionExecuteSyncInstructionDataDecoder,Fu as getTransactionExecuteSyncInstructionDataEncoder,h_ as getTransactionMessageAddressTableLookupCodec,fs as getTransactionMessageAddressTableLookupDecoder,ls as getTransactionMessageAddressTableLookupEncoder,D_ as getTransactionMessageCodec,Zt as getTransactionMessageDecoder,Yt as getTransactionMessageEncoder,__ as getTransferFeeAccountExtensionCodec,Yn as getTransferFeeAccountExtensionDecoder,qn as getTransferFeeAccountExtensionEncoder,W_ as getTransferHookAccountExtensionCodec,Xn as getTransferHookAccountExtensionDecoder,Zn as getTransferHookAccountExtensionEncoder,O_ as getTransportsCodec,Qt as getTransportsDecoder,Xt as getTransportsEncoder,N as getUserAccountAddress,V_ as getUserCodec,z_ as getUserCreationArgsCodec,Ie as getUserCreationArgsDecoder,xe as getUserCreationArgsEncoder,Y as getUserDecoder,et as getUserEncoder,q_ as getUserMutArgsCodec,rt as getUserMutArgsDecoder,tt as getUserMutArgsEncoder,Q_ as getUserReadOnlyArgsCodec,Bt as getUserReadOnlyArgsDecoder,Ot as getUserReadOnlyArgsEncoder,rv as getUserReadOnlyOrMutateArgsCodec,Ke as getUserReadOnlyOrMutateArgsDecoder,ze as getUserReadOnlyOrMutateArgsEncoder,av as getUserRoleCodec,Ye as getUserRoleDecoder,qe as getUserRoleEncoder,R5 as getWalletAddressFromIndex,Ue as getWalletAddressFromSettings,EU as getWhitelistedAddressTreeCodec,Aa as getWhitelistedAddressTreeDecoder,CU as getWhitelistedAddressTreeDiscriminatorBytes,If as getWhitelistedAddressTreeEncoder,no as getWhitelistedAddressTreeFromIndex,T5 as getWhitelistedAddressTreeIndexFromAddress,RA as getWhitelistedAddressTreesAddress,ZN as identifyMultiWalletAccount,XN as identifyMultiWalletInstruction,Yw as initialize,hR as isConfigAction,KR as isExtensionStruct,sw as isMultiWalletError,sv as isUserReadOnlyOrMutateArgs,eV as migrateSettings,aV as migrateUsers,JV as nativeTransferIntent,zU as parseAddWhitelistedAddressTreesInstruction,dW as parseChangeConfigCompressedInstruction,eW as parseChangeConfigInstruction,SW as parseCreateCompressedWalletInstruction,bW as parseCreateDomainConfigInstruction,wW as parseCreateDomainUserAccountInstruction,qW as parseCreateGlobalCounterInstruction,sk as parseCreateUserAccountsInstruction,pk as parseDecompressSettingsAccountInstruction,Ik as parseDisableDomainConfigInstruction,vk as parseEditDomainConfigInstruction,Vk as parseEditTransactionManagerUrlInstruction,Yk as parseEditUserDelegateInstruction,sL as parseMigrateCompressedSettingsInstruction,pL as parseMigrateCompressedUsersInstruction,UL as parseNativeTransferIntentCompressedInstruction,EL as parseNativeTransferIntentInstruction,EV as parseSecp256r1VerifyInstruction,QL as parseTokenTransferIntentCompressedInstruction,FL as parseTokenTransferIntentInstruction,TO as parseTransactionBufferCloseCompressedInstruction,aO as parseTransactionBufferCloseInstruction,kO as parseTransactionBufferCreateCompressedInstruction,PO as parseTransactionBufferCreateInstruction,QO as parseTransactionBufferExecuteCompressedInstruction,GO as parseTransactionBufferExecuteInstruction,mB as parseTransactionBufferExtendCompressedInstruction,cB as parseTransactionBufferExtendInstruction,UB as parseTransactionBufferVoteCompressedInstruction,EB as parseTransactionBufferVoteInstruction,qB as parseTransactionExecuteCompressedInstruction,VB as parseTransactionExecuteInstruction,gN as parseTransactionExecuteSyncCompressedInstruction,nN as parseTransactionExecuteSyncInstruction,V5 as pollJitoBundleConfirmation,mF as prepareChangeConfigArgs,CF as prepareTransactionBundle,LF as prepareTransactionMessage,VF as prepareTransactionSync,i6 as retrieveTransactionManager,mM as sendJitoBundle,u6 as serializeConfigActions,w5 as signAndSendBundledTransactions,J5 as signAndSendTransaction,c8 as tokenTransferIntent,nv as userReadOnlyOrMutateArgs,oA as vaultTransactionMessageDeserialize,sA as vaultTransactionMessageSerialize,cg as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|