@revibase/core 0.7.4 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,getEnumEncoder,getEnumDecoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getU64Encoder,getU64Decoder,getU16Encoder,getOptionEncoder,getArrayEncoder,getU16Decoder,getOptionDecoder,getArrayDecoder,getBooleanEncoder,getBooleanDecoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUnitEncoder,getUnitDecoder,getUtf8Encoder,getUtf8Decoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,getBase64Encoder,getBase64Decoder,getTransactionEncoder,createDecoder,createEncoder,AccountRole,some,none,upgradeRoleToSigner,fetchAddressesForLookupTables,isTransactionSigner}from'@solana/kit';import {sha256}from'@noble/hashes/sha2.js';import u from'zod';import {createRpc,TreeType,getLightSystemAccountMetasV2,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {createSolanaRpc}from'@solana/rpc';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {p256}from'@noble/curves/nist.js';import {canonicalize}from'json-canonicalize';import {getTransferSolInstruction}from'@solana-program/system';import {PublicKey}from'@solana/web3.js';import {findAssociatedTokenPda,getTokenDecoder}from'@solana-program/token';var kr=new Uint8Array([201,232,212,229,59,241,106,197]);function V1(){return fixEncoderSize(getBytesEncoder(),8).encode(kr)}function xi(){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:kr}))}function Or(){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 H1(){return combineCodec(xi(),Or())}function Wr(e){return decodeAccount(e,Or())}async function Br(e,r,t){let o=await Ii(e,r,t);return assertAccountExists(o),o}async function Ii(e,r,t){let o=await fetchEncodedAccount(e,r,t);return Wr(o)}async function z1(e,r,t){let o=await Ei(e,r,t);return assertAccountsExist(o),o}async function Ei(e,r,t){return (await fetchEncodedAccounts(e,r,t)).map(n=>Wr(n))}function K1(){return 846}var Fr=new Uint8Array([42,206,176,58,175,129,130,233]);function Y1(){return fixEncoderSize(getBytesEncoder(),8).encode(Fr)}function Wi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Fr}))}function Gr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function J1(){return combineCodec(Wi(),Gr())}function Vr(e){return decodeAccount(e,Gr())}async function Z1(e,r,t){let o=await Bi(e,r,t);return assertAccountExists(o),o}async function Bi(e,r,t){let o=await fetchEncodedAccount(e,r,t);return Vr(o)}async function X1(e,r,t){let o=await Ni(e,r,t);return assertAccountsExist(o),o}async function Ni(e,r,t){return (await fetchEncodedAccounts(e,r,t)).map(n=>Vr(n))}function $1(){return 24}var Ut=(t=>(t[t.Initialized=0]="Initialized",t[t.Frozen=1]="Frozen",t))(Ut||{});function vt(){return getEnumEncoder(Ut)}function Lt(){return getEnumDecoder(Ut)}function tS(){return combineCodec(vt(),Lt())}function kt(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Ot(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function oS(){return combineCodec(kt(),Ot())}function Wt(){return getStructEncoder([["memberKey",h()],["permissions",ae()]])}function Bt(){return getStructDecoder([["memberKey",L()],["permissions",ie()]])}function iS(){return combineCodec(Wt(),Bt())}function Nt(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function wt(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function AS(){return combineCodec(Nt(),wt())}function Ft(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function Gt(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function pS(){return combineCodec(Ft(),Gt())}function qt(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function jt(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function TS(){return combineCodec(qt(),jt())}function Yt(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",Xt()],["tlv",getOptionEncoder(getArrayEncoder(Zt()))],["state",vt()]])}function Jt(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",$t()],["tlv",getOptionDecoder(getArrayDecoder(Le()))],["state",Lt()]])}function IS(){return combineCodec(Yt(),Jt())}function tn(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",rn()]])}function nn(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",on()]])}function CS(){return combineCodec(tn(),nn())}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",an()]])}function on(){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",un()]])}function _S(){return combineCodec(rn(),on())}function ke(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(gn())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Wt())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(pn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Oe(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(ln())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Bt())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(mn())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function LS(){return combineCodec(ke(),Oe())}function kS(e,r){return Array.isArray(r)?{__kind:e,fields:r}:{__kind:e,...r??{}}}function OS(e,r){return r.__kind===e}function gn(){return getStructEncoder([["memberKey",h()],["permissions",ae()]])}function ln(){return getStructDecoder([["memberKey",L()],["permissions",ie()]])}function wS(){return combineCodec(gn(),ln())}function We(){return getStructEncoder([["memberKey",h()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function Be(){return getStructDecoder([["memberKey",L()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function HS(){return combineCodec(We(),Be())}function Zt(){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([xn()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([yn()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([fn()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([En()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([bn()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([Ft()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([tn()])]])]])}function Le(){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([In()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([Tn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([Sn()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([Dn()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([Cn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([Gt()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([nn()])]])]])}function jS(){return combineCodec(Zt(),Le())}function YS(e,r){return Array.isArray(r)?{__kind:e,fields:r}:{__kind:e,...r??{}}}function JS(e,r){return r.__kind===e}function Pn(){return getStructEncoder([["pubkey",h()],["role",getU8Encoder()],["permissions",ae()],["padding",getU8Encoder()],["isDelegate",getU8Encoder()]])}function _n(){return getStructDecoder([["pubkey",L()],["role",getU8Decoder()],["permissions",ie()],["padding",getU8Decoder()],["isDelegate",getU8Decoder()]])}function QS(){return combineCodec(Pn(),_n())}function h(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function L(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function nx(){return combineCodec(h(),L())}function Xt(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function $t(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function sx(){return combineCodec(Xt(),$t())}function yn(){return getStructEncoder([])}function Tn(){return getStructDecoder([])}function ix(){return combineCodec(yn(),Tn())}function fn(){return getStructEncoder([])}function Sn(){return getStructDecoder([])}function Ax(){return combineCodec(fn(),Sn())}function ae(){return getStructEncoder([["mask",getU8Encoder()]])}function ie(){return getStructDecoder([["mask",getU8Decoder()]])}function px(){return combineCodec(ae(),ie())}function hn(){return getStructEncoder([["proof",getOptionEncoder(qt())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function Un(){return getStructDecoder([["proof",getOptionDecoder(jt())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function fx(){return combineCodec(hn(),Un())}function pn(){return getStructEncoder([["memberKey",h()]])}function mn(){return getStructDecoder([["memberKey",L()]])}function Ex(){return combineCodec(pn(),mn())}function an(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function un(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function Cx(){return combineCodec(an(),un())}function kn(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Ne(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function Px(){return combineCodec(kn(),Ne())}function N(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function w(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function Ux(){return combineCodec(N(),w())}function On(){return getStructEncoder([["verifyArgs",N()],["domainConfigIndex",getU8Encoder()]])}function Wn(){return getStructDecoder([["verifyArgs",w()],["domainConfigIndex",getU8Decoder()]])}function Ox(){return combineCodec(On(),Wn())}function Bn(){return getStructEncoder([["index",getU128Encoder()],["isDelegate",getBooleanEncoder()]])}function Nn(){return getStructDecoder([["index",getU128Decoder()],["isDelegate",getBooleanDecoder()]])}function Nx(){return combineCodec(Bn(),Nn())}function wn(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function Fn(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function Gx(){return combineCodec(wn(),Fn())}function xn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(kt())]])}function In(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(Ot())]])}function Kx(){return combineCodec(xn(),In())}function jn(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Yn(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Yx(){return combineCodec(jn(),Yn())}function Y(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([On()])]])]])}function J(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([Wn()])]])]])}function $x(){return combineCodec(Y(),J())}function Qx(e,r){return Array.isArray(r)?{__kind:e,fields:r}:{__kind:e,...r??{}}}function eI(e,r){return r.__kind===e}function En(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function Dn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function rI(){return combineCodec(En(),Dn())}function bn(){return getStructEncoder([["transferring",getU8Encoder()]])}function Cn(){return getStructDecoder([["transferring",getU8Decoder()]])}function cI(){return combineCodec(bn(),Cn())}var Jn=(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))(Jn||{});function we(){return getEnumEncoder(Jn)}function Fe(){return getEnumDecoder(Jn)}function uI(){return combineCodec(we(),Fe())}var xe=(n=>(n[n.TransactionManager=0]="TransactionManager",n[n.Administrator=1]="Administrator",n[n.PermanentMember=2]="PermanentMember",n[n.Member=3]="Member",n))(xe||{});function le(){return getEnumEncoder(xe)}function pe(){return getEnumDecoder(xe)}function gI(){return combineCodec(le(),pe())}var vo=new Uint8Array([223,179,163,190,177,224,67,173]);function XI(){return fixEncoderSize(getBytesEncoder(),8).encode(vo)}function xg(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(Pn())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["padding",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:vo}))}function ct(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(_n())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["padding",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function $I(){return combineCodec(xg(),ct())}function Lo(e){return decodeAccount(e,ct())}async function ko(e,r,t){let o=await Ig(e,r,t);return assertAccountExists(o),o}async function Ig(e,r,t){let o=await fetchEncodedAccount(e,r,t);return Lo(o)}async function QI(e,r,t){let o=await Eg(e,r,t);return assertAccountsExist(o),o}async function Eg(e,r,t){return (await fetchEncodedAccounts(e,r,t)).map(n=>Lo(n))}var wo=new Uint8Array([90,36,35,219,93,225,110,96]);function rE(){return fixEncoderSize(getBytesEncoder(),8).encode(wo)}function Fg(){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())],["expectedSigners",getArrayEncoder(We())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:wo}))}function Fo(){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",L()],["executor",L()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(L())],["expectedSigners",getArrayDecoder(Be())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function oE(){return combineCodec(Fg(),Fo())}function Go(e){return decodeAccount(e,Fo())}async function sE(e,r,t){let o=await Gg(e,r,t);return assertAccountExists(o),o}async function Gg(e,r,t){let o=await fetchEncodedAccount(e,r,t);return Go(o)}async function cE(e,r,t){let o=await Vg(e,r,t);return assertAccountsExist(o),o}async function Vg(e,r,t){return (await fetchEncodedAccounts(e,r,t)).map(n=>Go(n))}var Zo=new Uint8Array([159,117,95,227,239,151,58,236]);function dE(){return fixEncoderSize(getBytesEncoder(),8).encode(Zo)}function sl(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["domainConfig",getOptionEncoder(getAddressEncoder())],["member",h()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(we()))],["wallets",getArrayEncoder(Bn())],["role",le()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["bump",getU8Encoder()]]),e=>({...e,discriminator:Zo}))}function At(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["domainConfig",getOptionDecoder(getAddressDecoder())],["member",L()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(Fe()))],["wallets",getArrayDecoder(Nn())],["role",pe()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["bump",getU8Decoder()]])}function AE(){return combineCodec(sl(),At())}function Xo(e){return decodeAccount(e,At())}async function $o(e,r,t){let o=await cl(e,r,t);return assertAccountExists(o),o}async function cl(e,r,t){let o=await fetchEncodedAccount(e,r,t);return Xo(o)}async function gE(e,r,t){let o=await al(e,r,t);return assertAccountsExist(o),o}async function al(e,r,t){return (await fetchEncodedAccounts(e,r,t)).map(n=>Xo(n))}function y({args:e}){if(!e)return [];let{remainingAccounts:r}=e;return r.map(t=>t.signer?{address:t.address,role:t.role,signer:t.signer}:{address:t.address,role:t.role})}function es(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function P(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function T(e,r){return t=>{if(!t.value)return Object.freeze({address:e,role:AccountRole.READONLY});let o=t.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:P(t.value),role:Qo(t.value)?upgradeRoleToSigner(o):o,...Qo(t.value)?{signer:t.value}:{}})}}function Qo(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var ss=new Uint8Array([8]);function hE(){return fixEncoderSize(getBytesEncoder(),1).encode(ss)}function cs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(ke())],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:ss}))}function as(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Oe())],["signers",getArrayDecoder(J())]])}function UE(){return combineCodec(cs(),as())}function is(e,r){let t=r?.programAddress??A,n={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};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.systemProgram),s(n.slotHashSysvar),s(n.instructionsSysvar),...a],data:cs().encode(c),programAddress:t})}function vE(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),payer:t(),systemProgram:t(),slotHashSysvar:o(),instructionsSysvar:t()},data:as().decode(e.data)}}var ys=new Uint8Array([0]);function NE(){return fixEncoderSize(getBytesEncoder(),1).encode(ys)}function or(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),e=>({...e,discriminator:ys}))}function Ts(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function wE(){return combineCodec(or(),Ts())}async function FE(e,r){let t=r?.programAddress??A,n={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},userAccount:{value:e.userAccount??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.userAccount.value||(n.userAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114])),getAddressEncoder().encode(P(n.authority.value))]}));let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.domainConfig),s(n.payer),s(n.authority),s(n.systemProgram),s(n.userAccount),...a],data:or().encode(c),programAddress:t})}function fs(e,r){let t=r?.programAddress??A,n={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},userAccount:{value:e.userAccount??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.domainConfig),s(n.payer),s(n.authority),s(n.systemProgram),s(n.userAccount),...a],data:or().encode(c),programAddress:t})}function GE(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:t(),payer:t(),authority:t(),systemProgram:t(),userAccount:t()},data:Ts().decode(e.data)}}var Is=new Uint8Array([4]);function YE(){return fixEncoderSize(getBytesEncoder(),1).encode(Is)}function Es(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["member",kn()],["role",le()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(we())]]),e=>({...e,discriminator:Is}))}function Ds(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["member",Ne()],["role",pe()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(Fe())]])}function JE(){return combineCodec(Es(),Ds())}function bs(e,r){let t=r?.programAddress??A,n={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},userAccount:{value:e.userAccount??null,isWritable:true},transactionManagerAccount:{value:e.transactionManagerAccount??null,isWritable:false},settings:{value:e.settings??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.payer),s(n.domainConfig),s(n.authority),s(n.userAccount),s(n.transactionManagerAccount),s(n.settings),s(n.systemProgram),...a],data:Es().encode(c),programAddress:t})}function ZE(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{payer:t(),domainConfig:t(),authority:t(),userAccount:t(),transactionManagerAccount:o(),settings:o(),systemProgram:t()},data:Ds().decode(e.data)}}var Ms=new Uint8Array([3]);function nD(){return fixEncoderSize(getBytesEncoder(),1).encode(Ms)}function ar(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Ms}))}function Rs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function rD(){return combineCodec(ar(),Rs())}async function Ps(e,r){let t=r?.programAddress??A,n={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};n.globalCounter.value||(n.globalCounter.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let i=y(c),a=T(t);return Object.freeze({accounts:[a(n.globalCounter),a(n.payer),a(n.systemProgram),...i],data:ar().encode({}),programAddress:t})}function oD(e,r){let t=r?.programAddress??A,n={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let i=y(c),a=T(t);return Object.freeze({accounts:[a(n.globalCounter),a(n.payer),a(n.systemProgram),...i],data:ar().encode({}),programAddress:t})}function sD(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{globalCounter:t(),payer:t(),systemProgram:t()},data:Rs().decode(e.data)}}var hs=new Uint8Array([5]);function gD(){return fixEncoderSize(getBytesEncoder(),1).encode(hs)}function ur(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["role",le()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),e=>({...e,discriminator:hs}))}function Us(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["role",pe()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function lD(){return combineCodec(ur(),Us())}async function pD(e,r){let t=r?.programAddress??A,n={payer:{value:e.payer??null,isWritable:true},member:{value:e.member??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},userAccount:{value:e.userAccount??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.userAccount.value||(n.userAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114])),getAddressEncoder().encode(P(n.member.value))]}));let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.payer),s(n.member),s(n.systemProgram),s(n.userAccount),...a],data:ur().encode(c),programAddress:t})}function vs(e,r){let t=r?.programAddress??A,n={payer:{value:e.payer??null,isWritable:true},member:{value:e.member??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},userAccount:{value:e.userAccount??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.payer),s(n.member),s(n.systemProgram),s(n.userAccount),...a],data:ur().encode(c),programAddress:t})}function mD(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{payer:t(),member:t(),systemProgram:t(),userAccount:t()},data:Us().decode(e.data)}}var Os=new Uint8Array([16]);function ID(){return fixEncoderSize(getBytesEncoder(),1).encode(Os)}function Ar(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Os}))}function Ws(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()]])}function ED(){return combineCodec(Ar(),Ws())}async function DD(e,r){let t=r?.programAddress??A,n={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},userAccount:{value:e.userAccount??null,isWritable:true},settings:{value:e.settings??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.globalCounter.value||(n.globalCounter.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),n.userAccount.value||(n.userAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114])),getAddressEncoder().encode(P(n.initialMember.value))]})),n.settings.value||(n.settings.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getU128Encoder().encode(es(c.settingsIndex))]}));let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.payer),s(n.initialMember),s(n.systemProgram),s(n.globalCounter),s(n.userAccount),s(n.settings),...a],data:Ar().encode(c),programAddress:t})}function Bs(e,r){let t=r?.programAddress??A,n={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},userAccount:{value:e.userAccount??null,isWritable:true},settings:{value:e.settings??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.payer),s(n.initialMember),s(n.systemProgram),s(n.globalCounter),s(n.userAccount),s(n.settings),...a],data:Ar().encode(c),programAddress:t})}function bD(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{payer:t(),initialMember:t(),systemProgram:t(),globalCounter:t(),userAccount:t(),settings:t()},data:Ws().decode(e.data)}}var Fs=new Uint8Array([2]);function hD(){return fixEncoderSize(getBytesEncoder(),1).encode(Fs)}function Gs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:Fs}))}function Vs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function UD(){return combineCodec(Gs(),Vs())}function Hs(e,r){let t=r?.programAddress??A,n={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=y({args:c}),s=T(t);return Object.freeze({accounts:[s(n.domainConfig),s(n.admin),...a],data:Gs().encode(c),programAddress:t})}function vD(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:t(),admin:t()},data:Vs().decode(e.data)}}var qs=new Uint8Array([1]);function ND(){return fixEncoderSize(getBytesEncoder(),1).encode(qs)}function js(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))]]),e=>({...e,discriminator:qs}))}function Ys(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))]])}function wD(){return combineCodec(js(),Ys())}function Js(e,r){let t=r?.programAddress??A,n={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},userAccount:{value:e.userAccount??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.domainConfig),s(n.authority),s(n.newAuthority),s(n.userAccount),s(n.systemProgram),...a],data:js().encode(c),programAddress:t})}function FD(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{domainConfig:t(),authority:t(),newAuthority:o(),userAccount:o(),systemProgram:t()},data:Ys().decode(e.data)}}var Xs=new Uint8Array([6]);function qD(){return fixEncoderSize(getBytesEncoder(),1).encode(Xs)}function lr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),e=>({...e,discriminator:Xs}))}function $s(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function jD(){return combineCodec(lr(),$s())}async function YD(e,r){let t=r?.programAddress??A,n={signer:{value:e.signer??null,isWritable:false},transactionManagerAccount:{value:e.transactionManagerAccount??null,isWritable:true}},c={...e},i={args:c};n.transactionManagerAccount.value||(n.transactionManagerAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114])),getAddressEncoder().encode(P(n.signer.value))]}));let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.signer),s(n.transactionManagerAccount),...a],data:lr().encode(c),programAddress:t})}function Qs(e,r){let t=r?.programAddress??A,n={signer:{value:e.signer??null,isWritable:false},transactionManagerAccount:{value:e.transactionManagerAccount??null,isWritable:true}},c={...e},a=y({args:c}),s=T(t);return Object.freeze({accounts:[s(n.signer),s(n.transactionManagerAccount),...a],data:lr().encode(c),programAddress:t})}function JD(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{signer:t(),transactionManagerAccount:t()},data:$s().decode(e.data)}}var oc=new Uint8Array([7]);function nb(){return fixEncoderSize(getBytesEncoder(),1).encode(oc)}function sc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())],["delegateTo",getOptionEncoder(getU128Encoder())]]),e=>({...e,discriminator:oc}))}function cc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())],["delegateTo",getOptionDecoder(getU128Decoder())]])}function rb(){return combineCodec(sc(),cc())}function ac(e,r){let t=r?.programAddress??A,n={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},userAccount:{value:e.userAccount??null,isWritable:true},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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.feePayer),s(n.signer),s(n.userAccount),s(n.oldSettings),s(n.newSettings),s(n.slotHashSysvar),s(n.instructionsSysvar),s(n.domainConfig),...a],data:sc().encode(c),programAddress:t})}function ob(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{feePayer:t(),signer:o(),userAccount:t(),oldSettings:o(),newSettings:o(),slotHashSysvar:o(),instructionsSysvar:o(),domainConfig:o()},data:cc().decode(e.data)}}var uc=new Uint8Array([17]);function Ab(){return fixEncoderSize(getBytesEncoder(),1).encode(uc)}function pr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:uc}))}function dc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(J())]])}function gb(){return combineCodec(pr(),dc())}async function lb(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),n.source.value||(n.source.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(P(n.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.slotHashSysvar),s(n.instructionsSysvar),s(n.source),s(n.destination),s(n.systemProgram),...a],data:pr().encode(c),programAddress:t})}function Ac(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.slotHashSysvar),s(n.instructionsSysvar),s(n.source),s(n.destination),s(n.systemProgram),...a],data:pr().encode(c),programAddress:t})}function pb(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),slotHashSysvar:o(),instructionsSysvar:t(),source:t(),destination:t(),systemProgram:t()},data:dc().decode(e.data)}}var Tc=new Uint8Array([18]);function Ib(){return fixEncoderSize(getBytesEncoder(),1).encode(Tc)}function mr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(wn())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(Yt())],["compressedProofArgs",getOptionEncoder(hn())],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:Tc}))}function fc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Fn())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Jt())],["compressedProofArgs",getOptionDecoder(Un())],["signers",getArrayDecoder(J())]])}function Eb(){return combineCodec(mr(),fc())}async function Db(e,r){let t=r?.programAddress??A,n={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:true},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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),n.source.value||(n.source.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(P(n.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),n.tokenProgram.value||(n.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),n.sourceSplTokenAccount.value||(n.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(P(n.source.value)),getAddressEncoder().encode(P(n.tokenProgram.value)),getAddressEncoder().encode(P(n.mint.value))]})),n.sourceCtokenTokenAccount.value||(n.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(P(n.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(P(n.mint.value))]})),n.destinationSplTokenAccount.value||(n.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(P(n.destination.value)),getAddressEncoder().encode(P(n.tokenProgram.value)),getAddressEncoder().encode(P(n.mint.value))]})),n.destinationCtokenTokenAccount.value||(n.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(P(n.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(P(n.mint.value))]})),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.compressedTokenProgramAuthority.value||(n.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),n.compressedTokenProgram.value||(n.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.slotHashSysvar),s(n.instructionsSysvar),s(n.source),s(n.sourceSplTokenAccount),s(n.sourceCtokenTokenAccount),s(n.destination),s(n.destinationSplTokenAccount),s(n.destinationCtokenTokenAccount),s(n.tokenProgram),s(n.mint),s(n.systemProgram),s(n.compressedTokenProgramAuthority),s(n.splInterfacePda),s(n.compressibleConfig),s(n.rentSponsor),s(n.compressedTokenProgram),...a],data:mr().encode(c),programAddress:t})}function Sc(e,r){let t=r?.programAddress??A,n={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:true},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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),n.tokenProgram.value||(n.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.compressedTokenProgramAuthority.value||(n.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),n.compressedTokenProgram.value||(n.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.slotHashSysvar),s(n.instructionsSysvar),s(n.source),s(n.sourceSplTokenAccount),s(n.sourceCtokenTokenAccount),s(n.destination),s(n.destinationSplTokenAccount),s(n.destinationCtokenTokenAccount),s(n.tokenProgram),s(n.mint),s(n.systemProgram),s(n.compressedTokenProgramAuthority),s(n.splInterfacePda),s(n.compressibleConfig),s(n.rentSponsor),s(n.compressedTokenProgram),...a],data:mr().encode(c),programAddress:t})}function bb(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),payer:t(),slotHashSysvar:o(),instructionsSysvar:t(),source:t(),sourceSplTokenAccount:t(),sourceCtokenTokenAccount:t(),destination:t(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:t(),mint:t(),systemProgram:t(),compressedTokenProgramAuthority:t(),splInterfacePda:o(),compressibleConfig:t(),rentSponsor:o(),compressedTokenProgram:t()},data:fc().decode(e.data)}}var Ec=new Uint8Array([12]);function Ub(){return fixEncoderSize(getBytesEncoder(),1).encode(Ec)}function Dc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:Ec}))}function bc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function vb(){return combineCodec(Dc(),bc())}function Cc(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.domainConfig),s(n.transactionBuffer),s(n.closer),s(n.slotHashSysvar),s(n.instructionsSysvar),...a],data:Dc().encode(c),programAddress:t})}function Lb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),payer:t(),domainConfig:o(),transactionBuffer:t(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:bc().decode(e.data)}}var Pc=new Uint8Array([9]);function Fb(){return fixEncoderSize(getBytesEncoder(),1).encode(Pc)}function _c(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(We())],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:Pc}))}function hc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(Be())],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Gb(){return combineCodec(_c(),hc())}function Uc(e,r){let t=r?.programAddress??A,n={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};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.domainConfig),s(n.transactionBuffer),s(n.creator),s(n.systemProgram),s(n.instructionsSysvar),s(n.slotHashSysvar),...a],data:_c().encode(c),programAddress:t})}function Vb(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),payer:t(),domainConfig:o(),transactionBuffer:t(),creator:o(),systemProgram:t(),instructionsSysvar:t(),slotHashSysvar:o()},data:hc().decode(e.data)}}var kc=new Uint8Array([13]);function Jb(){return fixEncoderSize(getBytesEncoder(),1).encode(kc)}function Oc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:kc}))}function Wc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function Zb(){return combineCodec(Oc(),Wc())}function Bc(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.domainConfig),s(n.executor),s(n.transactionBuffer),s(n.slotHashSysvar),s(n.instructionsSysvar),...a],data:Oc().encode(c),programAddress:t})}function Xb(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),domainConfig:o(),executor:o(),transactionBuffer:t(),slotHashSysvar:o(),instructionsSysvar:o()},data:Wc().decode(e.data)}}var Fc=new Uint8Array([11]);function rC(){return fixEncoderSize(getBytesEncoder(),1).encode(Fc)}function Gc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Fc}))}function Vc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function oC(){return combineCodec(Gc(),Vc())}function Hc(e,r){let t=r?.programAddress??A,n={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=y({args:c}),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.transactionBuffer),...a],data:Gc().encode(c),programAddress:t})}function sC(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{settings:t(),transactionBuffer:t()},data:Vc().decode(e.data)}}var qc=new Uint8Array([10]);function gC(){return fixEncoderSize(getBytesEncoder(),1).encode(qc)}function jc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(N())]]),e=>({...e,discriminator:qc}))}function Yc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(w())]])}function lC(){return combineCodec(jc(),Yc())}function Jc(e,r){let t=r?.programAddress??A,n={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};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.domainConfig),s(n.transactionBuffer),s(n.voter),s(n.systemProgram),s(n.slotHashSysvar),s(n.instructionsSysvar),...a],data:jc().encode(c),programAddress:t})}function pC(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),domainConfig:o(),transactionBuffer:t(),voter:o(),systemProgram:t(),slotHashSysvar:o(),instructionsSysvar:o()},data:Yc().decode(e.data)}}var $c=new Uint8Array([14]);function xC(){return fixEncoderSize(getBytesEncoder(),1).encode($c)}function Qc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:$c}))}function ea(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function IC(){return combineCodec(Qc(),ea())}function ta(e,r){let t=r?.programAddress??A,n={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=y({args:c}),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.transactionBuffer),...a],data:Qc().encode({}),programAddress:t})}function EC(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{settings:t(),payer:t(),transactionBuffer:t()},data:ea().decode(e.data)}}var oa=new Uint8Array([15]);function _C(){return fixEncoderSize(getBytesEncoder(),1).encode(oa)}function sa(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(Nt())],["addressTableLookups",getArrayEncoder(jn())],["signers",getArrayEncoder(Y())]]),e=>({...e,discriminator:oa}))}function ca(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(wt())],["addressTableLookups",getArrayDecoder(Yn())],["signers",getArrayDecoder(J())]])}function hC(){return combineCodec(sa(),ca())}function aa(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.slotHashSysvar),s(n.instructionsSysvar),...a],data:sa().encode(c),programAddress:t})}function UC(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),slotHashSysvar:o(),instructionsSysvar:t()},data:ca().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",_y=(c=>(c[c.DomainConfig=0]="DomainConfig",c[c.GlobalCounter=1]="GlobalCounter",c[c.Settings=2]="Settings",c[c.TransactionBuffer=3]="TransactionBuffer",c[c.User=4]="User",c))(_y||{});function tM(e){let r="data"in e?e.data:e;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([201,232,212,229,59,241,106,197])),0))return 0;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([42,206,176,58,175,129,130,233])),0))return 1;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([223,179,163,190,177,224,67,173])),0))return 2;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([90,36,35,219,93,225,110,96])),0))return 3;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([159,117,95,227,239,151,58,236])),0))return 4;throw new Error("The provided account could not be identified as a multiWallet account.")}var hy=(p=>(p[p.ChangeConfig=0]="ChangeConfig",p[p.CreateDomainConfig=1]="CreateDomainConfig",p[p.CreateDomainUserAccount=2]="CreateDomainUserAccount",p[p.CreateGlobalCounter=3]="CreateGlobalCounter",p[p.CreateUserAccount=4]="CreateUserAccount",p[p.CreateWallet=5]="CreateWallet",p[p.DisableDomainConfig=6]="DisableDomainConfig",p[p.EditDomainConfig=7]="EditDomainConfig",p[p.EditTransactionManagerUrl=8]="EditTransactionManagerUrl",p[p.EditUserDelegate=9]="EditUserDelegate",p[p.NativeTransferIntent=10]="NativeTransferIntent",p[p.TokenTransferIntent=11]="TokenTransferIntent",p[p.TransactionBufferClose=12]="TransactionBufferClose",p[p.TransactionBufferCreate=13]="TransactionBufferCreate",p[p.TransactionBufferExecute=14]="TransactionBufferExecute",p[p.TransactionBufferExtend=15]="TransactionBufferExtend",p[p.TransactionBufferVote=16]="TransactionBufferVote",p[p.TransactionExecute=17]="TransactionExecute",p[p.TransactionExecuteSync=18]="TransactionExecuteSync",p))(hy||{});function nM(e){let r="data"in e?e.data:e;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 1;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 2;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 3;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 4;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 5;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 6;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 7;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 8;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 9;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 10;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 11;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 12;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 13;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 14;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 15;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 16;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 17;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 18;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var vy=6e3,Ly=6001,ky=6002,Oy=6003,Wy=6004,By=6005,Ny=6006,wy=6007,Fy=6008,Gy=6009,Vy=6010,Hy=6011,zy=6012,Ky=6013,qy=6014,jy=6015,Yy=6016,Jy=6017,Zy=6018,Xy=6019,$y=6020,Qy=6021,eT=6022,tT=6023,nT=6024,rT=6025,oT=6026,sT=6027,cT=6028,aT=6029,iT=6030,uT=6031,dT=6032,AT=6033,gT=6034,lT=6035,pT=6036,mT=6037,yT=6038,TT=6039,fT=6040,ST=6041,xT=6042,IT=6043,ET=6044,DT=6045,bT=6046,CT=6047,MT=6048,RT=6049,PT=6050,_T=6051,hT=6052,UT=6053,vT=6054,LT=6055,kT=6056,OT=6057,WT=6058,BT=6059,NT=6060,wT=6061,FT=6062,GT=6063,VT=6064,HT=6065,zT=6066,KT=6067,qT=6068,jT=6069,YT=6070,JT=6071,ZT=6072,XT=6073,$T=6074,ia;process.env.NODE_ENV!=="production"&&(ia={[iT]:"This member is already delegated to another wallet.",[wy]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[PT]:"Missing credential id.",[hT]:"The domain configuration account is disabled. Please contact support or try again later.",[UT]:"Missing domain configuration account.",[qT]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[Vy]:"Duplicate public keys detected among members. Each member must have a unique key.",[Gy]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[Qy]:"No members provided. A multisig wallet must contain at least one member.",[Zy]:"Expected a User with Administrator role for this instruction.",[Fy]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[Yy]:"Expected a User with Transaction Manager role for this instruction.",[TT]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[fT]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[ST]:"Declared buffer size does not match the actual serialized size.",[LT]:"Failed to compute hash. This may indicate a system error.",[AT]:"Not enough members with vote permission to meet the approval threshold.",[uT]:"At least one signer with execute permission is required to proceed.",[dT]:"At least one signer with initiate permission is required to perform this action.",[oT]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[KT]:"Invalid account index in transaction message. The account index is out of bounds.",[Xy]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[cT]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[yT]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[kT]:"Member key conversion failed. The provided key format is invalid.",[gT]:"Only delegated members are allowed for this transaction.",[rT]:"Unexpected number of accounts provided for this instruction.",[Ky]:"User with Permanent Member role must have a delegated wallet.",[Ly]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[Wy]:"The extracted public key has an invalid length or encoding.",[vy]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[Oy]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[RT]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[CT]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[tT]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[zT]:"Invalid source type for token transfer. The source account type is not supported.",[Jy]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[jy]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[nT]:"Malformed transaction message: structure or formatting does not match the expected layout.",[JT]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[sT]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[YT]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[HT]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[By]:"The extracted WebAuthn signed message payload is malformed.",[DT]:"An input string exceeds the maximum allowed character length.",[BT]:"Member not found in settings. Cannot remove a member that does not exist.",[aT]:"A required account is missing from the instruction context.",[OT]:"Compressed proof arguments are missing. Required for compressed account operations.",[FT]:"Missing compressed token account. Required for token transfer operations.",[ZT]:"Missing destination token account. Required for token transfer operations.",[VT]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[WT]:"Light CPI accounts are missing. Required for compressed account operations.",[$T]:"Missing new authority account. Required for domain configuration updates.",[XT]:"Missing settings account. Required for delegate operations.",[GT]:"Missing SPL interface PDA. Required for token transfer operations.",[bT]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[pT]:"No valid signer found in this transaction.",[$y]:"Only one administrator is allowed per wallet.",[zy]:"Only one permanent member is allowed per wallet.",[qy]:"Only one transaction manager is allowed per wallet.",[vT]:"The given origin index is not in the whitelisted origins.",[wT]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[Hy]:"Permanent members cannot be removed from a wallet.",[ET]:"Writable CPI calls to protected accounts are not permitted.",[Ny]:"The rpIdHash extracted from the signed message does not match the expected value.",[NT]:"Settings key mismatch. The provided settings key does not match the expected value.",[ky]:"The signature index provided is out of bounds for the secp256r1 instruction.",[MT]:"The specified slot number was not found in the provided slot history.",[eT]:"Too many members: a maximum of 4 members are supported.",[xT]:"This transaction has expired. It must be executed within 3 minutes of approval.",[IT]:"This transaction has not yet reached the required approval threshold.",[_T]:"Missing transports.",[mT]:"Only the transaction creator or rent payer may close this transaction buffer.",[jT]:"Unauthorized: Only the admin account is allowed to perform this action.",[lT]:"Member is not part of the expected signers for this transaction."});function iM(e){return process.env.NODE_ENV!=="production"?ia[e]:"Error message not available in production bundles."}function uM(e,r,t){return isProgramError(e,r,A,t)}var te=class extends Error{constructor(t,o,n){super(t);this.code=o;this.cause=n;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},Ee=class extends te{constructor(r){super(`${r} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},Z=class extends te{constructor(r,t){super(`${r} not found.${t?` ${t}`:""}`,"NOT_FOUND");}},O=class extends te{constructor(r,t){super(r,"VALIDATION_ERROR",{field:t});}},De=class extends te{constructor(t,o,n){super(t,"NETWORK_ERROR",{statusCode:o,url:n});this.statusCode=o;this.url=n;}},Tt=class extends te{constructor(t,o,n){super(`Operation "${t}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:n});this.attempts=o;this.lastError=n;}},ft=class extends te{constructor(t,o,n){super(t,"PERMISSION_ERROR",{required:o,actual:n});this.required=o;this.actual=n;}};var ze={Ed25519:1,Secp256r1:2};var QT=u.looseObject({publicKey:u.string(),walletAddress:u.string(),settingsIndexWithAddress:u.object({index:u.union([u.number(),u.bigint()])})}),ef=u.object({devicePublicKey:u.string(),platform:u.enum(["web","ios","android"]),userAgent:u.string().optional(),browser:u.object({name:u.string().optional(),version:u.string().optional(),major:u.string().optional(),type:u.string().optional()}).optional(),engine:u.object({name:u.string().optional(),version:u.string().optional()}).optional(),cpu:u.object({architecture:u.string().optional()}).optional(),device:u.object({type:u.string().optional(),vendor:u.string().optional(),model:u.string().optional()}).optional(),os:u.object({name:u.string().optional(),version:u.string().optional()}).optional(),app:u.object({name:u.string().optional(),version:u.string().optional(),build:u.string().optional()}).optional(),display:u.object({screenWidth:u.number().optional(),screenHeight:u.number().optional(),viewportWidth:u.number().optional(),viewportHeight:u.number().optional(),devicePixelRatio:u.number().optional()}).optional(),locale:u.string().optional(),timezone:u.string().optional(),push:u.object({provider:u.enum(["expo","fcm","apns"]),token:u.string()}).optional(),website:u.string().optional(),nativeApp:u.string().optional(),createdAt:u.iso.datetime().optional()}).strict(),ua=u.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","transfer_intent","change_delegate","change_config"]),bM=u.object({transactionActionType:ua,transactionAddress:u.string(),transactionMessageBytes:u.array(u.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),tf=u.object({transactionActionType:ua,transactionAddress:u.string(),transactionMessageBytes:u.base64()}).strict(),da=u.object({phase:u.literal("start"),clientOrigin:u.url(),signer:u.string().optional(),rid:u.string(),validTill:u.number(),providerOrigin:u.string(),rpId:u.string(),data:u.object({type:u.literal("message"),payload:u.string(),requireTwoFactorAuthentication:u.boolean().default(false)}).strict()}).strict(),Aa=u.object({phase:u.literal("start"),clientOrigin:u.url(),signer:u.string().optional(),rid:u.string(),validTill:u.number(),providerOrigin:u.string(),rpId:u.string(),data:u.object({type:u.literal("transaction"),payload:tf}).strict()}).strict(),ga=u.object({startRequest:u.union([da,Aa]),authResponse:u.custom(),client:u.object({clientOrigin:u.url(),jws:u.string()}).strict(),device:u.object({jwk:u.base64(),jws:u.string(),deviceProfile:ef}).strict(),user:QT}).strict(),la=u.object({signer:u.string(),additionalInfo:u.looseObject({}).optional()}).strict(),nf=u.object({slotHash:u.string(),slotNumber:u.string(),estimatedSlotHashExpiry:u.number(),originIndex:u.number(),crossOrigin:u.boolean(),transactionManagerAddress:u.string().optional(),unitsConsumed:u.array(u.union([u.number(),u.bigint()])).optional()}).strict(),CM=u.object({phase:u.literal("complete"),data:u.object({type:u.literal("message"),payload:la.extend(ga.shape).extend({startRequest:da,transactionManager:u.object({publicKey:u.string(),signature:u.string()}).optional()})}).strict()}).strict(),MM=u.object({phase:u.literal("complete"),data:u.object({type:u.literal("transaction"),payload:la.extend(ga.shape).extend(nf.shape).extend({startRequest:Aa})}).strict()}).strict();var X={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},ne=class e{constructor(r){this.mask=r;}static fromPermissions(r){return new e(r.reduce((t,o)=>t|o,0))}static all(){return new e(Object.values(X).reduce((r,t)=>r|t,0))}static has(r,t){return (r.mask&t)===t}};var Ir=33,re=class{_bn;constructor(r){typeof r=="string"?this._bn=new Uint8Array(getBase58Encoder().encode(r)):this._bn=new Uint8Array(r),this.validateKeyLength(this._bn);}validateKeyLength(r){if(r.length!==Ir)throw new Error(`Invalid public key length, expected ${Ir} bytes but got ${r.length}`)}toBase58(){return getBase58Decoder().decode(this.toBytes())}toTruncatedBuffer(){let r=this.toBuffer();return r.subarray(1,r.length)}toBuffer(){if(!this._bn)throw new Error("Invalid public key input");let r=this._bn;if(r.byteLength===Ir)return r;throw new Error("Invalid public key input")}toBytes(){let r=this.toBuffer();return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}toString(){return this.toBase58()}toJSON(){return this.toBase58()}},I=class extends re{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(r,t){super(r),this.verifyArgs=t.verifyArgs,this.domainConfig=t.domainConfig,this.authData=t.authData,this.signature=t.signature,this.originIndex=t.originIndex,this.crossOrigin=t.crossOrigin,this.clientAndDeviceHash=t.clientAndDeviceHash,this.authResponse=t.authResponse;}};function sf(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function cf(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var ma=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(sf())],["addressTableLookups",getArrayCodec(cf())]]);function ya(e){return ma.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(t=>({programAddressIndex:t.programAddressIndex,accountIndices:t.accountIndices??[],data:Array.from(t.data??[])})),addressTableLookups:e.version===0?e.addressTableLookups?.map(t=>({lookupTableAddress:t.lookupTableAddress,readonlyIndexes:t.readonlyIndexes,writableIndexes:t.writableIndexes}))??[]:[]})}function Ta(e){let r=ma.decode(e);return {header:{numSignerAccounts:r.numSigners,numReadonlySignerAccounts:r.numSigners-r.numWritableSigners,numReadonlyNonSignerAccounts:r.accountKeys.length-r.numSigners-r.numWritableNonSigners},addressTableLookups:r.addressTableLookups.map(t=>({lookupTableAddress:t.lookupTableAddress,readonlyIndexes:t.readonlyIndexes.map(Number),writableIndexes:t.writableIndexes.map(Number),readableIndices:t.readonlyIndexes.map(Number),writableIndices:t.writableIndexes.map(Number)})),instructions:r.instructions.map(t=>({accountIndices:t.accountIndices.map(Number),data:new Uint8Array(t.data),programAddressIndex:t.programAddressIndex})),lifetimeToken:A,staticAccounts:r.accountKeys,version:0}}function fa(e,r,t,o){if(e<r||e>t)throw new O(`${o} must be between ${r} and ${t} (inclusive), got ${e}`)}async function v(e){let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("user"),e instanceof re?e.toTruncatedBuffer():getAddressEncoder().encode(e)]});return r}async function be({rpIdHash:e,rpId:r}){if(!e)if(r)e=sha256(getUtf8Encoder().encode(r));else throw new O("Either rpId or rpIdHash must be provided");let[t]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return t}async function xt(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function Sa(e,r,t){fa(t,0,255,"buffer_index");let[o]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),r instanceof re?r.toTruncatedBuffer():getAddressEncoder().encode(r),getU8Encoder().encode(t)]});return o}async function $(e){let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return r}async function se(e){let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return r}async function ZM(e){let r=await se(e);return await $(r)}async function XM(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}var Q={};function oR(){if(!Q.solanaRpcEndpoint)throw new Ee("RPC endpoint");return Q.solanaRpcEndpoint}function Ke(){if(!Q.lightProtocolRpc)throw new Ee("Light Protocol RPC");return Q.lightProtocolRpc}function k(){if(!Q.solanaRpc)throw new Ee("Solana RPC");return Q.solanaRpc}function sR({rpcEndpoint:e,proverEndpoint:r,compressionApiEndpoint:t}){Q.solanaRpcEndpoint=e,Q.lightProtocolRpc=createRpc(e,t,r);let o=createSolanaRpc(e);Q.solanaRpc=o;}function It(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}function pf(e){let r=new Uint8Array(e.length/2);for(let t=0;t<r.length;t++)r[t]=parseInt(e.slice(t*2,t*2+2),16);return r}function Ia(e){let r=new Set(["type","challenge","origin","crossOrigin"]),t={};for(let n in e)r.has(n)||(t[n]=e[n]);if(Object.keys(t).length===0)return new Uint8Array([]);let o=JSON.stringify(t);return new Uint8Array(new TextEncoder().encode(o.slice(1,-1)))}function Ea(e,r){let t=[],o=0,n=new TextDecoder;for(let c=0;c<r;c++){if(o+2>e.length)throw new Error("MaxLengthExceeded");let i=e[o]|e[o+1]<<8;if(o+=2,o+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(o,o+i),s=n.decode(a);t.push(s),o+=i;}return t}function Da(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let r=e[1],t=2;if(r>128){let B=r&127;t+=B;}if(e[t]!==2)throw new Error("Expected INTEGER for r");let o=e[t+1],n=t+2,c=e.slice(n,n+o);if(t=n+o,e[t]!==2)throw new Error("Expected INTEGER for s");let i=e[t+1],a=t+2,s=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,g=s[0]===0&&s.length>32?s.slice(1):s;if(d.length>32||g.length>32)throw new Error("r or s length > 32 bytes");let l=new Uint8Array(32);l.set(d,32-d.length);let m=p256.Point.CURVE().n>>1n,f=BigInt("0x"+It(g)),M=(f>m?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),R=pf(M);return new Uint8Array([...l,...R])}function qe(e){let r=z(e.response.clientDataJSON),t=z(e.response.authenticatorData),o=sha256(r);return new Uint8Array([...t,...o])}function ER(e){let r=decodeCBOR(e),t=p256.Point.fromAffine({x:BigInt("0x"+It(r.get(-2))),y:BigInt("0x"+It(r.get(-3)))});return getBase58Decoder().decode(t.toBytes(true))}function DR(e){let t=p256.Point.fromBytes(getBase58Encoder().encode(e)).toBytes(false),o=new Map;return o.set(1,2),o.set(3,-7),o.set(-1,1),o.set(-2,t.slice(1,33)),o.set(-3,t.slice(33,65)),new Uint8Array(encodeCBOR(o))}async function bR(e){let{authenticatorData:r,clientDataJSON:t,signature:o}=e.authResponse.response,n=z(r),c=JSON.parse(getUtf8Decoder().decode(z(t))),i=Ia(c),a=Da(z(o)),s=await be({rpIdHash:n.subarray(0,32)});return new I(e.signer,{verifyArgs:{clientDataJson:z(t),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:br(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:s,authData:n,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function br(e,r,t){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(r),...getBase64Encoder().encode(t)]))}function CR(e){return sha256(getUtf8Encoder().encode(canonicalize(e)))}function MR(e){return Cr(e.data.payload.authResponse)}function RR(e,r,t,o){let n=br(r,t,o);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...n]))}async function PR(e,r,t,o,n,c,i){let a;if(!n||!c||!i){let l=(await k().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!l)throw new Z("Slot sysvar","Unable to fetch slot sysvar data");let m=getBase64Encoder().encode(l[0]);c=getU64Decoder().decode(m.subarray(0,8)).toString(),a=m.subarray(8,40),n=getBase58Decoder().decode(a),i=Date.now()+512*400;}else a=getBase58Encoder().encode(n);let s=sha256(typeof e.transactionMessageBytes=="string"?getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),d=br(r,t,o),g=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...s,...a,...d]));return {slotNumber:c,slotHash:n,challenge:g,estimatedSlotHashExpiry:i}}function _R(e,r){return new Uint8Array([...qe(e),...getUtf8Encoder().encode(canonicalize(r))])}function Cr(e){let r=qe(e);return sha256(r)}function hR(e){let r="";for(let o of e)r+=String.fromCharCode(o);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function z(e){let r=e.replace(/-/g,"+").replace(/_/g,"/"),t=(4-r.length%4)%4,o=r.padEnd(r.length+t,"="),n=atob(o),c=new ArrayBuffer(n.length),i=new Uint8Array(c);for(let a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return i}async function UR(e,r){let{data:t}=await Br(k(),e),n=Ea(t.origins,t.numOrigins).findIndex(c=>c===r);if(n===-1)throw new Z("Origin","Origin not found in domain config");return n}function vR(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function LR(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}function GR(e,r){if(r.threshold>1)throw new O("Multi-signature transactions with threshold > 1 are not supported yet.");let t=r.members.find(s=>_a(s.pubkey)===e);if(!t)throw new Z("Member",`Signer ${e} not found in settings`);let{permissions:o}=t;if(!o)throw new Z("Permissions","No permissions found for the current member");let n=ne.has(o,X.InitiateTransaction),c=ne.has(o,X.VoteTransaction),i=ne.has(o,X.ExecuteTransaction);if(n&&c&&i)return null;if(!c||!i)throw new ft("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=r.members.find(s=>s.role===0);if(!a)throw new Z("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(_a(a.pubkey))}}function Cf(e){let r=new URL(e);return r.protocol=r.protocol==="https:"?"wss:":"ws:",r.toString()}function Mf(e,r){return new Promise((t,o)=>{let n=new WebSocket(e),c=()=>{try{n.close();}catch{}};r.addEventListener("abort",c,{once:true}),n.onopen=()=>{r.removeEventListener("abort",c),t(n);},n.onerror=()=>{r.removeEventListener("abort",c),o(new Error("WebSocket connection failed"));};})}async function Rf(e,r,t){return new Promise((o,n)=>{let c=false,i=()=>{e.removeEventListener("message",d),e.removeEventListener("error",g),e.removeEventListener("close",l),r.removeEventListener("abort",s);},a=m=>{c||(c=true,i(),m());},s=()=>{try{e.close();}catch{}},d=m=>{if(typeof m.data!="string")return;let f;try{f=JSON.parse(m.data);}catch{return}let E=f.event??"message";try{t(E,f.data)&&a(o);}catch(M){a(()=>n(M));}},g=()=>a(()=>n(new De("Transaction manager request failed",0,e.url))),l=()=>a(o);r.addEventListener("abort",s,{once:true}),e.addEventListener("message",d),e.addEventListener("error",g),e.addEventListener("close",l);})}var Dt=()=>{let e=new Error("Aborted");return e.name="AbortError",e},Pf=(e,r)=>new Promise((t,o)=>{if(r.aborted)return o(Dt());let n=setTimeout(t,e);r.addEventListener("abort",()=>{clearTimeout(n),o(Dt());},{once:true});});function VR(e){let{address:r,url:t,authResponses:o,transactionMessageBytes:n,onPendingApprovalsCallback:c,onPendingApprovalsSuccess:i,abortController:a,opts:s}=e,d=a?.signal??new AbortController().signal,g=Cf(t),l=s?.maxAttempts??10,m=s?.retryDelayMs??400;return {address:r,async signTransactions(f){if(d.aborted)throw Dt();let E=new Array(f.length);for(let R=0;R<f.length;R++)E[R]={transaction:getBase64Decoder().decode(getTransactionEncoder().encode(f[R])),transactionMessageBytes:n?getBase64Decoder().decode(n):void 0,authResponses:o};let M=JSON.stringify({type:"transaction",data:{publicKey:r.toString(),payload:E}});for(let R=0;R<l;R++){if(d.aborted)throw Dt();let B,G;try{B=await Mf(g,d),B.send(M),await Rf(B,d,(p,V)=>{if(p==="error"){let he=typeof V=="object"&&V&&typeof V.error=="string"?V.error:"Unknown error",Se=new Error(he);throw Se.noRetry=!0,Se}return p==="signatures"?(G=V.signatures,!0):(p==="pending_transaction_approval"&&c?.(V.validTill),p==="transaction_approved"&&i?.(),!1)});}catch(p){if(p?.noRetry)throw new De(p.message);if(p?.name==="AbortError")throw p}finally{try{B?.close();}catch{}}if(G?.length)return G.map(p=>({[r]:getBase58Encoder().encode(p)}));R<l-1&&await Pf(m,d);}throw new De("Transaction manager: missing signatures")}}}function _a(e){return e.keyType===ze.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function HR(e){let r=e.map(c=>ke().encode(c)),t=4+r.reduce((c,i)=>c+i.length,0),o=new Uint8Array(t),n=0;o.set(getU32Encoder().encode(e.length),n),n+=4;for(let c of r)o.set(c,n),n+=c.length;return o}function zR(e){let r=0,[t,o]=getU32Decoder().read(e,r);r=o;let n=new Array(t);for(let c=0;c<t;c++){let i=Oe().read(e,r);n[c]=i[0],r=i[1];}if(r!==e.length)throw new O(`Trailing bytes detected: expected ${e.length} bytes but consumed ${r}`);return n}var Mr=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"];function F(e,r=0){let t=e instanceof I?e:void 0,o=t?.verifyArgs&&r!==-1?some({signedMessageIndex:r,truncatedClientDataJson:t.verifyArgs.truncatedClientDataJson,slotNumber:t.verifyArgs.slotNumber,originIndex:t.originIndex,crossOrigin:t.crossOrigin,clientAndDeviceHash:t.clientAndDeviceHash}):none(),n=t?.domainConfig?t.domainConfig:void 0,c=t?.verifyArgs?t.signature:void 0,i=t?.authData&&t.verifyArgs.clientDataJson?qe(t.authResponse):void 0,a=t?.toBuffer();return {domainConfig:n,verifyArgs:o,signature:c,message:i,publicKey:a}}function Re(e,r,t=[]){let o=[];for(let n of e)if(n instanceof I){let c=t.length,{domainConfig:i,verifyArgs:a,signature:s,publicKey:d,message:g}=F(n,c);if(g&&s&&d&&t.push({message:g,signature:s,publicKey:d}),i){let l=r.addPreAccounts([{address:i,role:AccountRole.READONLY}]).get(i)?.index;a.__option==="Some"&&l!==void 0&&o.push({__kind:"Secp256r1",fields:[{domainConfigIndex:l,verifyArgs:a.value}]});}}else {let c=r.addPreAccounts([{address:n.address,role:AccountRole.READONLY_SIGNER,signer:n}]).get(n.address)?.index;c!==void 0&&o.push({__kind:"Ed25519",fields:[c]});}return {secp256r1VerifyInput:t,transactionSyncSigners:o}}function ee(e){if(e instanceof re)return {keyType:ze.Secp256r1,key:e.toBytes()};{let r;try{r="address"in e?e.address:e;}catch{r=e;}return {keyType:ze.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(r)])}}}function Ua(e){return e instanceof I?e.toString():e.address.toString()}function q(e){let r=new Set,t=[];for(let n of e)r.has(Ua(n))||(t.push(n),r.add(Ua(n)));let o=t.filter(n=>n instanceof I);if(o.length>1)throw new O(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return t}function va({payer:e,tipAmount:r}){let t=Mr[Math.floor(Math.random()*Mr.length)];return getTransferSolInstruction({source:e,destination:address(t),amount:r})}var ka=8,Oa=1,Of=34,Wf=5,Bf=ka+Oa,Wa=ka+Oa+32,Nf=Wa+Of+Wf,wf=20;async function iP(e,{member:r,credentialId:t}){let o=[{memcmp:{offset:BigInt(Bf),encoding:"base64",bytes:getBase64Decoder().decode(getAddressEncoder().encode(e))}}];if(r)o.push({memcmp:{offset:BigInt(Wa),encoding:"base64",bytes:getBase64Decoder().decode(h().encode(ee(r)))}});else if(t)o.push({memcmp:{offset:BigInt(Nf),encoding:"base64",bytes:getBase64Decoder().decode(z(t))}});else return null;let n=await k().getProgramAccounts(A,{filters:o,encoding:"base64"}).send();return n.length?n.map(c=>At().decode(getBase64Encoder().encode(c.account.data[0])))[0]:null}async function uP(e){let r=(await $o(k(),await v(e))).data;if(r.role===1||r.role===0){let t=[];return (await k().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(wf),encoding:"base64",bytes:getBase64Decoder().decode(h().encode(ee(e)))}}]}).send()).forEach(n=>{let c=ct().decode(getBase64Encoder().encode(n.account.data[0]));t.push({...c});}),t}else return await Promise.all(r.wallets.map(async t=>(await ko(k(),await se(t.index))).data))}async function EP({payer:e,rpId:r,origins:t,authority:o}){let n=await be({rpId:r});return fs({origins:t,authority:o,payer:e,domainConfig:n,rpId:r,userAccount:await v(o.address),remainingAccounts:[]})}async function MP({payer:e}){let r=await xt();return Ps({payer:e,globalCounter:r})}async function hP({admin:e,rpId:r,disable:t}){let o=await be({rpId:r});return Hs({domainConfig:o,admin:e,disable:t,remainingAccounts:[]})}function Gf(e,r,t,o){let n=Vf(e,r),c=Hf(e,r)&&t!==o;return n&&c?AccountRole.WRITABLE_SIGNER:n&&!c?AccountRole.WRITABLE:!n&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function Vf(e,r){let t=e.staticAccounts.length,{numSignerAccounts:o,numReadonlySignerAccounts:n,numReadonlyNonSignerAccounts:c}=e.header,i=o-n,a=t-o-c;return r>=t?false:r<i?true:r>=o?r-o<a:false}function Hf(e,r){return r<e.header.numSignerAccounts}async function Ct({walletAddress:e,transactionMessageBytes:r,addressesByLookupTableAddress:t,additionalSigners:o}){let n=Ta(r),c=t??(n.addressTableLookups?await fetchAddressesForLookupTables(n.addressTableLookups.map(a=>a.lookupTableAddress),k()):{}),i=[];i.push(...n.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,s]of n.staticAccounts.entries())i.push({address:s,role:Gf(n,a,s,e)});if(n.addressTableLookups)for(let a of n.addressTableLookups){let s=c[a.lookupTableAddress];if(!s)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let g=s[d];if(!g)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:g,role:AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let g=s[d];if(!g)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:g,role:AccountRole.READONLY});}}for(let a of o?.filter(s=>s.address!==e)??[]){let s=i.findIndex(d=>d.address===a.address);s===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[s].role===AccountRole.READONLY||i[s].role===AccountRole.READONLY_SIGNER?i[s]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[s].role===AccountRole.WRITABLE||i[s].role===AccountRole.WRITABLE_SIGNER)&&(i[s]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:n}}var Pe=33,_e=64,hr=14,Zf=2,Xf=address("Secp256r1SigVerify1111111111111111111111111");function $f(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function Qf(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function Fa(){return createDecoder({read:(e,r=0)=>{let t=getU8Decoder().decode(e,r);r+=1;let o=getU8Decoder().decode(e,r);r+=1;let n=[],c=Qf();for(let a=0;a<t;a++)n.push(c.decode(e,r)),r+=hr;let i=[];for(let a=0;a<t;a++){let s=fixDecoderSize(getBytesDecoder(),Pe).decode(e,r);r+=Pe;let d=fixDecoderSize(getBytesDecoder(),_e).decode(e,r);r+=_e;let g=n[a].messageDataSize,l=fixDecoderSize(getBytesDecoder(),g).decode(e,r);r+=g,i.push({publicKey:s,signature:d,message:l});}return [{numSignatures:t,padding:o,offsets:n,payload:i},r]}})}function Ga(){return createEncoder({getSizeFromValue:e=>{let r=hr*e.offsets.length,t=e.payload.reduce((o,n)=>o+Pe+_e+n.message.length,0);return 2+r+t},write:(e,r,t=0)=>{t=getU8Encoder().write(e.numSignatures,r,t),t=getU8Encoder().write(e.padding,r,t);let o=$f();for(let n of e.offsets)t=o.write(n,r,t);for(let n of e.payload)t=fixEncoderSize(getBytesEncoder(),Pe).write(n.publicKey,r,t),t=fixEncoderSize(getBytesEncoder(),_e).write(n.signature,r,t),t=getBytesEncoder().write(n.message,r,t);return t}})}function GP(){return combineCodec(Ga(),Fa())}function U(e,r){let t=e.length,o=Zf+t*hr,n=[];for(let s=0;s<t;s++){let{message:d}=e[s],g=o,l=g+Pe,m=l+_e;n.push({publicKeyOffset:g,publicKeyInstructionIndex:65535,signatureOffset:l,signatureInstructionIndex:65535,messageDataOffset:m,messageDataSize:d.length,messageInstructionIndex:65535}),o+=Pe+_e+d.length;}let c=r?.programAddress??Xf,i={numSignatures:t,padding:0,offsets:n,payload:e};return {accounts:[],programAddress:c,data:Ga().encode(i)}}function VP(e){return {programAddress:e.programAddress,accounts:{},data:Fa().decode(e.data)}}async function Va({settings:e,transactionBufferAddress:r,transactionMessageBytes:t,payer:o,addressesByLookupTableAddress:n,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a}){let s=await $(e),{accountMetas:d,addressLookupTableAccounts:g}=await Ct({transactionMessageBytes:t,walletAddress:s,additionalSigners:i,addressesByLookupTableAddress:n}),l=[];return c.length>0&&l.push(U(c)),l.push(ta({transactionBuffer:r,payer:o.address,remainingAccounts:d,settings:e})),a&&l.push(va({payer:o,tipAmount:a})),{instructions:l,addressLookupTableAccounts:g}}var j=class{systemAccounts;nextPreIndex;preMap;nextPackedIndex;packedMap;outputTreeIndex;constructor(){this.systemAccounts=[],this.nextPreIndex=0,this.preMap=new Map,this.nextPackedIndex=0,this.packedMap=new Map,this.outputTreeIndex=-1;}addPreAccounts(r){for(let t of r)this.insertOrGet(t.address.toString(),t,false);return this.preMap}getAccountRole(r,t){return r?t?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:t?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(A.toString())}).map(r=>({address:address(r.pubkey.toString()),role:this.getAccountRole(r.isSigner,r.isWritable)})));}insertOrGet(r,t={address:address(r),role:AccountRole.WRITABLE},o=true){let n=o?this.packedMap:this.preMap;if(!n.has(r)){let c=o?this.nextPackedIndex++:this.nextPreIndex++;n.set(r,{index:c,accountMeta:t});}return n.get(r).index}packOutputTreeIndex(r){if(r.treeType===TreeType.StateV1)return this.insertOrGet(r.tree.toString());if(r.treeType===TreeType.StateV2)return this.insertOrGet(r.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let r=await Ke().getStateTreeInfos(),t=selectStateTreeInfo(r);return this.packOutputTreeIndex(t)}packTreeInfos(r,t){let o=[],n=[];for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());o.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let s=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(s);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of t){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());n.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:o.length>0?{packedTreeInfos:o,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:n}}hashSetAccountsToMetas(r){return Array.from(r.entries()).sort((o,n)=>o[1].index-n[1].index).map(([,{accountMeta:o}])=>({...o}))}getOffsets(r){let t=r,o=t+this.systemAccounts.length;return [t,o]}toAccountMetas(){let r=this.hashSetAccountsToMetas(this.preMap),t=this.hashSetAccountsToMetas(this.packedMap),[o,n]=this.getOffsets(r.length);return {remainingAccounts:[...r,...this.systemAccounts,...t],systemOffset:o,packedOffset:n}}};async function Ka({settings:e,transactionMessageBytes:r,additionalSigners:t,signers:o,addressesByLookupTableAddress:n,secp256r1VerifyInput:c=[]}){let i=q(o),a=await $(e),[{accountMetas:s,addressLookupTableAccounts:d,transactionMessage:g}]=await Promise.all([Ct({transactionMessageBytes:r,walletAddress:a,additionalSigners:t,addressesByLookupTableAddress:n})]),l=new j;l.addPreAccounts(s);let{secp256r1VerifyInput:m,transactionSyncSigners:f}=Re(i,l,c),{remainingAccounts:E}=l.toAccountMetas(),M=[];m.length>0&&M.push(U(m));let R=r1(g,s);return M.push(aa({signers:f,settings:e,...R,remainingAccounts:E})),{instructions:M,addressLookupTableAccounts:d}}function r1(e,r){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(t=>({...t,accountIndices:new Uint8Array(t.accountIndices??[]),data:t.data??[]})),addressTableLookups:e.addressTableLookups?.map(t=>({lookupTableAddressIndex:r.findIndex(o=>o.address===t.lookupTableAddress),writableIndexes:new Uint8Array(t.writableIndexes),readonlyIndexes:new Uint8Array(t.readonlyIndexes)}))??[]}}async function I_({settings:e,destination:r,signers:t,amount:o}){let n=q(t),c=await $(e),{value:i}=await k().getAccountInfo(c,{encoding:"base64"}).send();if((i?.lamports??0)<BigInt(o))throw new O("Insufficient balance for native transfer.");let a=new j,{secp256r1VerifyInput:s,transactionSyncSigners:d}=Re(n,a),{remainingAccounts:g}=a.toAccountMetas(),l=[];return s.length>0&&l.push(U(s)),l.push(Ac({amount:o,signers:d,source:c,destination:r,settings:e,remainingAccounts:g})),l}var o1=3,s1=500,c1=2,a1=3e4,i1={backoffBase:c1,maxDelayMs:a1,retryOnRateLimit:true,initialDelayMs:s1,maxRetries:o1};function u1(e,r,t,o){let n=r*Math.pow(t,e-1);return Math.min(n,o)}function d1(e){return new Promise(r=>setTimeout(r,e))}async function qa(e,r){let{maxRetries:t,initialDelayMs:o,backoffBase:n,maxDelayMs:c,shouldRetry:i}={...i1,...r},a;for(let s=1;s<=t;s++)try{return await e()}catch(d){if(a=d,i&&!i(d,s))throw d;if(s>=t)break;let g=u1(s,o,n,c);await d1(g);}throw new Tt(e.name||"retryWithBackoff",t,a)}var T1=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),f1=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Rt=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function N_({settings:e,destination:r,mint:t,signers:o,amount:n,payer:c,tokenProgram:i,splInterfacePdaArgs:a={index:0,restricted:false}}){let s=q(o),d=await $(e),g=await S1(t,r,d,i,a),l=await x1(g),m=I1(l,g,n),[f,E]=await Promise.all([M1(d,t,m.splBalance,m.cTokenBalance,BigInt(n)),C1(m.requireSplInterface,g.splInterfacePda)]),M=BigInt(f.reduce((Je,ii)=>Je+(ii.parsed.amount.toNumber()??0),0));if(m.splBalance+m.cTokenBalance+M<BigInt(n))throw new O("Insufficient balance for token transfer.");let R=new j;E&&R.addPreAccounts([{address:t,role:AccountRole.WRITABLE}]);let B=E1(f),{proof:G}=await D1(R,B),p=b1(f,G,R),{secp256r1VerifyInput:V,transactionSyncSigners:he}=Re(s,R),{remainingAccounts:Se,systemOffset:ce}=R.toAccountMetas(),Lr=h1(G,ce),_=[];return V.length>0&&_.push(U(V)),_.push(Sc({settings:e,payer:c,source:d,sourceSplTokenAccount:g.sourceSplAta,sourceCtokenTokenAccount:g.sourceCtokenAta,destination:r,destinationSplTokenAccount:m.destinationSplTokenAccount,destinationCtokenTokenAccount:m.destinationCtokenTokenAccount,tokenProgram:i,mint:t,splInterfacePda:m.requireSplInterface?g.splInterfacePda:void 0,compressibleConfig:T1,rentSponsor:m.requireRentSponsor?f1:void 0,amount:n,signers:he,sourceCompressedTokenAccounts:p,compressedProofArgs:Lr,splInterfacePdaArgs:m.requireSplInterface?some(a):none(),remainingAccounts:Se})),_}async function S1(e,r,t,o,n){let c=m=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(m),getAddressEncoder().encode(Rt),getAddressEncoder().encode(e)],programAddress:Rt}),i=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(e)];n.restricted&&i.push(getUtf8Encoder().encode("restricted")),n.index>0&&i.push(getU8Encoder().encode(n.index));let[a,[s],d,[g],[l]]=await Promise.all([findAssociatedTokenPda({mint:e,owner:t,tokenProgram:o}).then(([m])=>m),c(t),findAssociatedTokenPda({mint:e,owner:r,tokenProgram:o}).then(([m])=>m),c(r),getProgramDerivedAddress({seeds:i,programAddress:Rt})]);return {sourceSplAta:a,sourceCtokenAta:s,destinationSplAta:d,destinationCTokenAta:g,splInterfacePda:l}}async function x1(e){let[r,t,o]=await Promise.all([k().getAccountInfo(e.destinationSplAta,{encoding:"base64"}).send(),k().getAccountInfo(e.sourceSplAta,{encoding:"base64"}).send(),k().getAccountInfo(e.sourceCtokenAta,{encoding:"base64"}).send()]);return {destinationSplAtaInfo:r,sourceSplAtaInfo:t,sourceCTokenAtaInfo:o}}function I1(e,r,t){let o=!!e.destinationSplAtaInfo.value,n=!!e.sourceSplAtaInfo.value,c=!!e.sourceCTokenAtaInfo.value,i=n?getTokenDecoder().decode(getBase64Encoder().encode(e.sourceSplAtaInfo.value.data[0])).amount:BigInt(0),a=BigInt(c?P1(getBase64Encoder().encode(e.sourceCTokenAtaInfo.value.data[0]))?.amount??0:0),s=o?r.destinationSplAta:void 0,d=o?void 0:r.destinationCTokenAta,g=n&&(i+a<BigInt(t)||a>BigInt(0)||!o)||!n&&o;return {splBalance:i,cTokenBalance:a,destinationSplTokenAccount:s,destinationCtokenTokenAccount:d,requireSplInterface:g,requireRentSponsor:i+a<BigInt(t)||!o}}function E1(e){let r=[];return e.forEach(t=>r.push({hash:t.compressedAccount.hash,tree:t.compressedAccount.treeInfo.tree,queue:t.compressedAccount.treeInfo.queue,data:t.compressedAccount.data,address:t.compressedAccount.address})),r}async function D1(e,r){let t=null;return r.length===0?{proof:t}:(await e.addSystemAccounts(),t=await U1(r,[]),{proof:t})}function b1(e,r,t){return !r||!e.length?[]:e.map(o=>({amount:o.parsed.amount.toNumber(),merkleContext:{leafIndex:o.compressedAccount.leafIndex,merkleTreePubkeyIndex:t.insertOrGet(o.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:t.insertOrGet(o.compressedAccount.treeInfo.queue.toString()),proveByIndex:o.compressedAccount.proveByIndex},rootIndex:r.rootIndices[0],version:_1(o.compressedAccount.data?.discriminator),tlv:o.parsed.tlv?some(getArrayDecoder(Le()).decode(o.parsed.tlv)):none(),state:o.parsed.state}))}async function C1(e,r){if(!e)return false;let{value:t}=await k().getAccountInfo(r,{encoding:"base64"}).send();return !t}async function M1(e,r,t,o,n){let c=n-t-o;if(c<=0)return [];let a=(await Ke().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(r)})).items.filter(d=>!!d.compressedAccount.data?.data.length&&d.compressedAccount.owner.toString()===Rt.toString()&&!d.parsed.amount.isZero());return a.length===0?[]:R1(a,Number(c),4,{treeType:TreeType.StateV2})}function R1(e,r,t=4,o){let n=e.filter(d=>d.compressedAccount.treeInfo.treeType===o?.treeType);if(n.length===0)throw new Error("No accounts found");let c=0,i=0,a=0,s=[];n.sort((d,g)=>g.parsed.amount.cmp(d.parsed.amount));for(let d of n){if(s.length>=t||c>=r)break;(!d.parsed.amount.isZero()||!d.compressedAccount.lamports.isZero())&&(c=c+d.parsed.amount.toNumber(),i=i+d.compressedAccount.lamports.toNumber(),s.push(d));}if(a=n.slice(0,t).reduce((d,g)=>d+g.parsed.amount.toNumber(),0),s.length===0)throw new Error("No accounts found.");if(c<r){let d=n.reduce((g,l)=>g+l.parsed.amount.toNumber(),0);throw s.length>=t?new Error(`Account limit exceeded: max ${a.toString()} (${t} accounts) per transaction. Total balance: ${d.toString()} (${n.length} accounts). Consider multiple transfers to spend full balance.`):new Error(`Insufficient balance for transfer. Required: ${r.toString()}, available: ${d.toString()}.`)}if(s.length===0)throw new Error("No accounts found.");return s}function P1(e){if(!e||e.length===0)return null;try{return {amount:getU64Decoder().decode(e.slice(64,72))}}catch(r){return console.error("Token data parsing error:",r),null}}function _1(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let r=e[7];return r===3?2:3}function h1(e,r){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:r}}async function U1(e,r){return qa(()=>Ke().getValidityProofV0(e,r))}function Y_({signers:e,payer:r,changeConfigArgs:t}){let{settings:o,configActions:n,packedAccounts:c}=t,i=q(e),a=[],s=[];for(let l of i)if(l instanceof I){let m=s.length,{domainConfig:f,verifyArgs:E,signature:M,publicKey:R,message:B}=F(l,m);if(B&&M&&R&&s.push({message:B,signature:M,publicKey:R}),f){let G=c.addPreAccounts([{address:f,role:AccountRole.READONLY}]).get(f)?.index;E.__option==="Some"&&G!==void 0&&a.push({__kind:"Secp256r1",fields:[{domainConfigIndex:G,verifyArgs:E.value}]});}}else {let m=c.addPreAccounts([{address:l.address,role:AccountRole.READONLY_SIGNER,signer:l}]).get(l.address)?.index;m!==void 0&&a.push({__kind:"Ed25519",fields:[m]});}let{remainingAccounts:d}=c.toAccountMetas(),g=[];return s.length>0&&g.push(U(s)),g.push(is({settings:o,configActions:n,payer:r,remainingAccounts:d,signers:a})),g}async function rh({authority:e,payer:r,createUserArgs:t,domainConfig:o}){return bs({payer:r,authority:e,member:Ne().decode(t.member.toBuffer()),credentialId:z(t.credentialId),transports:t.transports,role:t.role,domainConfig:o,settings:t.settings,transactionManagerAccount:t.transactionManagerAccount,userAccount:await v(t.member),remainingAccounts:[]})}async function ih({createUserArgs:e,payer:r}){return vs({payer:r,member:e.member,role:e.role,transactionManagerUrl:e.role===0?e.transactionManagerUrl:null,userAccount:await v(e.member.address),remainingAccounts:[]})}async function lh({index:e,payer:r,initialMember:t}){return Bs({globalCounter:await xt(),userAccount:await v(t.address),settingsIndex:e,settings:await se(e),payer:r,initialMember:t,remainingAccounts:[]})}async function fh({authority:e,domainConfig:r,newAuthority:t,newOrigins:o}){return Js({domainConfig:r,authority:e,newOrigins:o?some(o):none(),newAuthority:t,userAccount:t?await v(t.address):void 0,remainingAccounts:[]})}async function Eh({signer:e,transactionManagerUrl:r}){return Qs({signer:e,transactionManagerAccount:await v(e.address),transactionManagerUrl:r,remainingAccounts:[]})}async function hh({payer:e,user:r,oldDelegate:t,newDelegate:o}){let n,c;t!==void 0&&(n=await se(t)),o!==void 0&&(c=await se(o));let{domainConfig:i,verifyArgs:a,message:s,signature:d,publicKey:g}=F(r),l=[];s&&d&&g&&l.push({message:s,signature:d,publicKey:g});let m=[];return l.length>0&&m.push(U(l)),m.push(ac({secp256r1VerifyArgs:a,domainConfig:i,delegateTo:o!==void 0?some(o):none(),feePayer:e,signer:r instanceof I?void 0:r,oldSettings:n,newSettings:c,userAccount:await v(r instanceof I?r:r.address),remainingAccounts:[]})),m}function zh({closer:e,payer:r,settings:t,transactionBufferAddress:o}){let{domainConfig:n,verifyArgs:c,message:i,signature:a,publicKey:s}=F(e),d=[];return i&&a&&s&&d.push(U([{message:i,signature:a,publicKey:s}])),d.push(Cc({transactionBuffer:o,domainConfig:n,closer:e instanceof I?void 0:e,settings:t,payer:r,secp256r1VerifyArgs:c,remainingAccounts:[]})),d}function ei({payer:e,creator:r,bufferIndex:t,settings:o,transactionBufferAddress:n,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,expectedSigners:d}){let{domainConfig:g,verifyArgs:l,message:m,signature:f,publicKey:E}=F(r),M=[];return m&&f&&E&&M.push(U([{message:m,signature:f,publicKey:E}])),M.push(Uc({settings:o,transactionBuffer:n,payer:e,secp256r1VerifyArgs:l,creator:r instanceof I?void 0:r,domainConfig:g,bufferIndex:t,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:d,remainingAccounts:[]})),M}function ti({executor:e,transactionBufferAddress:r,settings:t}){let{domainConfig:o,verifyArgs:n,signature:c,message:i,publicKey:a}=F(e),s=[];return i&&c&&a&&s.push(U([{message:i,signature:c,publicKey:a}])),s.push(Bc({settings:t,transactionBuffer:r,secp256r1VerifyArgs:n,domainConfig:o,executor:e instanceof I?void 0:e,remainingAccounts:[]})),s}function ni({transactionMessageBytes:e,transactionBufferAddress:r,settings:t}){return Hc({transactionBuffer:r,buffer:e,settings:t,remainingAccounts:[]})}function ri({settings:e,voter:r,transactionBufferAddress:t}){let{domainConfig:o,verifyArgs:n,signature:c,publicKey:i,message:a}=F(r),s=[];return a&&c&&i&&s.push(U([{message:a,signature:c,publicKey:i}])),s.push(Jc({settings:e,transactionBuffer:t,secp256r1VerifyArgs:n,domainConfig:o,voter:r instanceof I?void 0:r,remainingAccounts:[]})),s}async function hU({settings:e,configActionsArgs:r}){let t=new j;return {configActions:await W1({configActionsArgs:r,packedAccounts:t}),settings:e,packedAccounts:t}}async function W1({configActionsArgs:e,packedAccounts:r}){let t=[];for(let o of e)switch(o.type){case "AddMembers":{let n=[];for(let c of o.members)r.addPreAccounts([{address:await v(c.member),role:AccountRole.WRITABLE}]),n.push(w1({permissionArgs:c.permissions,pubkey:c.member}));t.push({__kind:o.type,fields:[n]});break}case "RemoveMembers":{let n=await Promise.all(o.members.map(async c=>(r.addPreAccounts([{address:await v(c.member),role:AccountRole.WRITABLE}]),N1({pubkey:c.member}))));t.push({__kind:o.type,fields:[n]});break}case "EditPermissions":{let n=o.members.map(c=>B1({permissionArgs:c.permissions,pubkey:c.member}));t.push({__kind:o.type,fields:[n]});break}default:t.push({__kind:o.type,fields:[o.threshold]});}return t}function B1({pubkey:e,permissionArgs:r}){return {memberKey:ee(e),permissions:si(r)}}function N1({pubkey:e}){return {memberKey:ee(e)}}function w1({pubkey:e,permissionArgs:r}){return {memberKey:ee(e),permissions:si(r)}}function si(e){let r=[];return e.initiate&&r.push(X.InitiateTransaction),e.vote&&r.push(X.VoteTransaction),e.execute&&r.push(X.ExecuteTransaction),ne.fromPermissions(r)}async function BU({payer:e,settings:r,transactionMessageBytes:t,creator:o,executor:n,secp256r1VerifyInput:c,jitoBundlesTipAmount:i,addressesByLookupTableAddress:a,additionalVoters:s=[],additionalSigners:d=[],chunkSize:g=Math.ceil(t.length/2)}){let l=Math.floor(Math.random()*255),m=await Sa(r,o instanceof I?o:o.address,l),f=[],E=[];for(let _=0;_<t.length;_+=g){let Je=t.subarray(_,_+g);f.push(Je),E.push(sha256(Je));}let M=sha256(t),R=q([o,...n?[n]:[],...s]).map(_=>({memberKey:ee(_),messageHash:_ instanceof I?Cr(_.authResponse):null})),B=ei({finalBufferHash:M,finalBufferSize:t.length,bufferIndex:l,payer:e,transactionBufferAddress:m,settings:r,creator:o,preauthorizeExecution:!n,bufferExtendHashes:E,expectedSigners:R}),G=f.map(_=>ni({transactionMessageBytes:_,transactionBufferAddress:m,settings:r})),p=s.map(_=>ri({voter:_,transactionBufferAddress:m,settings:r})),V=ti({settings:r,executor:n,transactionBufferAddress:m}),{instructions:he,addressLookupTableAccounts:Se}=await Va({settings:r,transactionMessageBytes:t,transactionBufferAddress:m,payer:e,additionalSigners:d,secp256r1VerifyInput:c,jitoBundlesTipAmount:i,addressesByLookupTableAddress:a}),ce=_=>({payer:e,instructions:_,addressesByLookupTableAddress:Se});return [ce(B),...G.map(_=>ce([_])),...p.length?[ce(p.flat())]:[],ce(V),ce(he)]}var _t=class e{payer;keyMetaMap;constructor(r,t){this.payer=r,this.keyMetaMap=t;}static compile(r,t){let o=new Map,n=i=>{let a=o.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},o.set(i,a)),a},c=n(t);c.isSigner=true,c.isWritable=true;for(let i of r){n(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let s=n(a.address);s.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(t,o)}getMessageComponents(){let r=[...this.keyMetaMap.entries()];if(r.length>256)throw new Error("Max static account keys length exceeded");let t=r.filter(([,d])=>d.isSigner&&d.isWritable),o=r.filter(([,d])=>d.isSigner&&!d.isWritable),n=r.filter(([,d])=>!d.isSigner&&d.isWritable),c=r.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:t.length+o.length,numReadonlySignerAccounts:o.length,numReadonlyNonSignerAccounts:c.length};if(t.length===0)throw new Error("Expected at least one writable signer key");let[a]=t[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let s=[...t.map(([d])=>d),...o.map(([d])=>d),...n.map(([d])=>d),...c.map(([d])=>d)];return [i,s]}extractTableLookup(r){let[t,o]=this.drainKeysFoundInLookupTable(r[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[n,c]=this.drainKeysFoundInLookupTable(r[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(t.length===0&&n.length===0))return {addressTableLookup:{lookupTableAddress:r[0],writableIndexes:t,readonlyIndexes:n},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(r,t){let o=new Array,n=new Array;for(let[c,i]of this.keyMetaMap.entries())if(t(i)){let a=c,s=r.findIndex(d=>d===a);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),n.push(a),this.keyMetaMap.delete(c);}}return [o,n]}};var ht=class{staticAccountKeys;accountKeysFromLookups;constructor(r,t){this.staticAccountKeys=r,this.accountKeysFromLookups=t;}keySegments(){let r=[this.staticAccountKeys];return this.accountKeysFromLookups&&(r.push(this.accountKeysFromLookups.writable),r.push(this.accountKeysFromLookups.readonly)),r}get(r){for(let t of this.keySegments()){if(r<t.length)return t[r];r-=t.length;}}get length(){return this.keySegments().flat().length}compileInstructions(r){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let o=new Map;this.keySegments().flat().forEach((c,i)=>{o.set(c,i);});let n=c=>{let i=o.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return r.map(c=>({programAddressIndex:n(c.programAddress),accountIndices:c.accounts?.map(i=>n(i.address))??[],data:c.data}))}};function ai({payer:e,recentBlockhash:r,instructions:t,addressesByLookupTableAddress:o}){let n=_t.compile(t,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(o??{});for(let m of a){let f=n.extractTableLookup(m);if(f!==void 0){let{addressTableLookup:E,drainedKeys:M}=f;c.push({readonlyIndexes:E.readonlyIndexes,readableIndices:E.readonlyIndexes,writableIndexes:E.writableIndexes,writableIndices:E.writableIndexes,lookupTableAddress:address(E.lookupTableAddress)}),i.writable.push(...M.writable),i.readonly.push(...M.readonly);}}let[s,d]=n.getMessageComponents(),l=new ht(d,i).compileInstructions(t);return {version:0,header:s,instructions:l,lifetimeToken:r,staticAccounts:d,addressTableLookups:c}}function ZU({instructions:e,payer:r,addressesByLookupTableAddress:t}){let o=ai({instructions:e,payer:r,recentBlockhash:A,addressesByLookupTableAddress:t});return new Uint8Array(ya(o))}async function tv({payer:e,settings:r,transactionMessageBytes:t,signers:o,additionalSigners:n,secp256r1VerifyInput:c,addressesByLookupTableAddress:i}){let{instructions:a,addressLookupTableAccounts:s}=await Ka({settings:r,signers:o,additionalSigners:n,transactionMessageBytes:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i});return {payer:e,instructions:a,addressesByLookupTableAddress:s}}
2
- export{Ut as AccountState,ga as AuthenticationContextSchema,la as BaseResponseSchema,ss as CHANGE_CONFIG_DISCRIMINATOR,ys as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,Is as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,Ms as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,hs as CREATE_USER_ACCOUNT_DISCRIMINATOR,Os as CREATE_WALLET_DISCRIMINATOR,CM as CompleteMessageRequestSchema,MM as CompleteTransactionRequestSchema,Fs as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,kr as DOMAIN_CONFIG_DISCRIMINATOR,ef as DeviceProfileSchema,qs as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,Xs as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,oc as EDIT_USER_DELEGATE_DISCRIMINATOR,Fr as GLOBAL_COUNTER_DISCRIMINATOR,ze as KeyType,iT as MULTI_WALLET_ERROR__ALREADY_DELEGATED,wy as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,PT as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,hT as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,UT as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,qT as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,Vy as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,Gy as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,Qy as MULTI_WALLET_ERROR__EMPTY_MEMBERS,Zy as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,Fy as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,Yy as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,TT as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,fT as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,ST as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,LT as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,AT as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,uT as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,dT as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,oT as MULTI_WALLET_ERROR__INVALID_ACCOUNT,KT as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,Xy as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,cT as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,yT as MULTI_WALLET_ERROR__INVALID_BUFFER,kT as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,gT as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,rT as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,Ky as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,Ly as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,Wy as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,vy as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,Oy as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,RT as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,CT as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,tT as MULTI_WALLET_ERROR__INVALID_THRESHOLD,zT as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,Jy as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,jy as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,nT as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,JT as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,sT as MULTI_WALLET_ERROR__INVALID_USER_ROLE,YT as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,HT as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,By as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,DT as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,BT as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,aT as MULTI_WALLET_ERROR__MISSING_ACCOUNT,OT as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,FT as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,ZT as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,VT as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,WT as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,$T as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,XT as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,GT as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,bT as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,pT as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,$y as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,zy as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,qy as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,vT as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,wT as MULTI_WALLET_ERROR__PAYER_MISMATCH,Hy as MULTI_WALLET_ERROR__PERMANENT_MEMBER,ET as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,Ny as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,NT as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,ky as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,MT as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,eT as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,xT as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,IT as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,_T as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,mT as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,jT as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,lT as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,_y as MultiWalletAccount,hy as MultiWalletInstruction,uc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,X as Permission,ne as Permissions,vo as SETTINGS_DISCRIMINATOR,re as Secp256r1Key,I as SignedSecp256r1Key,da as StartMessageRequestSchema,Aa as StartTransactionRequestSchema,Tc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Ec as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,Pc as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,wo as TRANSACTION_BUFFER_DISCRIMINATOR,kc as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Fc as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,qc as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,$c as TRANSACTION_EXECUTE_DISCRIMINATOR,oa as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,ua as TransactionActionTypeSchema,nf as TransactionDetailsSchema,bM as TransactionPayloadSchema,tf as TransactionPayloadWithBase64MessageBytesSchema,Jn as Transports,Zo as USER_DISCRIMINATOR,QT as UserInfoSchema,xe as UserRole,z as base64URLStringToBuffer,hR as bufferToBase64URLString,Y_ as changeConfig,zh as closeTransactionBuffer,kS as configAction,LR as convertBase64StringToJWK,vR as convertJWKToBase64String,_a as convertMemberKeyToString,DR as convertPubkeyCompressedToCose,ER as convertPubkeyCoseToCompressed,MR as createClientAuthorizationCompleteRequestChallenge,CR as createClientAuthorizationStartRequestChallenge,EP as createDomainConfig,rh as createDomainUserAccounts,MP as createGlobalCounter,RR as createMessageChallenge,ei as createTransactionBuffer,PR as createTransactionChallenge,VR as createTransactionManagerSigner,ih as createUserAccounts,lh as createWallet,Wr as decodeDomainConfig,Vr as decodeGlobalCounter,Lo as decodeSettings,Go as decodeTransactionBuffer,Xo as decodeUser,zR as deserializeConfigActions,hP as disableDomainConfig,fh as editDomainConfig,Eh as editTransactionManagerUrl,hh as editUserDelegate,Va as executeTransaction,ti as executeTransactionBuffer,Ka as executeTransactionSync,ni as extendTransactionBuffer,YS as extensionStruct,z1 as fetchAllDomainConfig,X1 as fetchAllGlobalCounter,Ei as fetchAllMaybeDomainConfig,Ni as fetchAllMaybeGlobalCounter,Eg as fetchAllMaybeSettings,Vg as fetchAllMaybeTransactionBuffer,al as fetchAllMaybeUser,QI as fetchAllSettings,uP as fetchAllSettingsAccountByMember,cE as fetchAllTransactionBuffer,gE as fetchAllUser,Br as fetchDomainConfig,Z1 as fetchGlobalCounter,Ii as fetchMaybeDomainConfig,Bi as fetchMaybeGlobalCounter,Ig as fetchMaybeSettings,Gg as fetchMaybeTransactionBuffer,cl as fetchMaybeUser,ko as fetchSettings,sE as fetchTransactionBuffer,$o as fetchUser,iP as fetchUserAccountByFilters,tS as getAccountStateCodec,Lt as getAccountStateDecoder,vt as getAccountStateEncoder,iS as getAddMemberArgsCodec,Bt as getAddMemberArgsDecoder,Wt as getAddMemberArgsEncoder,oS as getAdditionalMetadataCodec,Ot as getAdditionalMetadataDecoder,kt as getAdditionalMetadataEncoder,hE as getChangeConfigDiscriminatorBytes,is as getChangeConfigInstruction,UE as getChangeConfigInstructionDataCodec,as as getChangeConfigInstructionDataDecoder,cs as getChangeConfigInstructionDataEncoder,br as getClientAndDeviceHash,AS as getCompiledInstructionCodec,wt as getCompiledInstructionDecoder,Nt as getCompiledInstructionEncoder,pS as getCompressedOnlyExtensionCodec,Gt as getCompressedOnlyExtensionDecoder,Ft as getCompressedOnlyExtensionEncoder,TS as getCompressedProofCodec,jt as getCompressedProofDecoder,qt as getCompressedProofEncoder,IS as getCompressedTokenArgsCodec,Jt as getCompressedTokenArgsDecoder,Yt as getCompressedTokenArgsEncoder,CS as getCompressibleExtensionCodec,nn as getCompressibleExtensionDecoder,tn as getCompressibleExtensionEncoder,_S as getCompressionInfoCodec,on as getCompressionInfoDecoder,rn as getCompressionInfoEncoder,LS as getConfigActionCodec,Oe as getConfigActionDecoder,ke as getConfigActionEncoder,NE as getCreateDomainConfigDiscriminatorBytes,fs as getCreateDomainConfigInstruction,FE as getCreateDomainConfigInstructionAsync,wE as getCreateDomainConfigInstructionDataCodec,Ts as getCreateDomainConfigInstructionDataDecoder,or as getCreateDomainConfigInstructionDataEncoder,YE as getCreateDomainUserAccountDiscriminatorBytes,bs as getCreateDomainUserAccountInstruction,JE as getCreateDomainUserAccountInstructionDataCodec,Ds as getCreateDomainUserAccountInstructionDataDecoder,Es as getCreateDomainUserAccountInstructionDataEncoder,nD as getCreateGlobalCounterDiscriminatorBytes,oD as getCreateGlobalCounterInstruction,Ps as getCreateGlobalCounterInstructionAsync,rD as getCreateGlobalCounterInstructionDataCodec,Rs as getCreateGlobalCounterInstructionDataDecoder,ar as getCreateGlobalCounterInstructionDataEncoder,gD as getCreateUserAccountDiscriminatorBytes,vs as getCreateUserAccountInstruction,pD as getCreateUserAccountInstructionAsync,lD as getCreateUserAccountInstructionDataCodec,Us as getCreateUserAccountInstructionDataDecoder,ur as getCreateUserAccountInstructionDataEncoder,ID as getCreateWalletDiscriminatorBytes,Bs as getCreateWalletInstruction,DD as getCreateWalletInstructionAsync,ED as getCreateWalletInstructionDataCodec,Ws as getCreateWalletInstructionDataDecoder,Ar as getCreateWalletInstructionDataEncoder,_R as getDeviceMessageHash,hD as getDisableDomainConfigDiscriminatorBytes,Hs as getDisableDomainConfigInstruction,UD as getDisableDomainConfigInstructionDataCodec,Vs as getDisableDomainConfigInstructionDataDecoder,Gs as getDisableDomainConfigInstructionDataEncoder,be as getDomainConfigAddress,H1 as getDomainConfigCodec,Or as getDomainConfigDecoder,V1 as getDomainConfigDiscriminatorBytes,xi as getDomainConfigEncoder,K1 as getDomainConfigSize,ND as getEditDomainConfigDiscriminatorBytes,Js as getEditDomainConfigInstruction,wD as getEditDomainConfigInstructionDataCodec,Ys as getEditDomainConfigInstructionDataDecoder,js as getEditDomainConfigInstructionDataEncoder,wS as getEditMemberArgsCodec,ln as getEditMemberArgsDecoder,gn as getEditMemberArgsEncoder,qD as getEditTransactionManagerUrlDiscriminatorBytes,Qs as getEditTransactionManagerUrlInstruction,YD as getEditTransactionManagerUrlInstructionAsync,jD as getEditTransactionManagerUrlInstructionDataCodec,$s as getEditTransactionManagerUrlInstructionDataDecoder,lr as getEditTransactionManagerUrlInstructionDataEncoder,nb as getEditUserDelegateDiscriminatorBytes,ac as getEditUserDelegateInstruction,rb as getEditUserDelegateInstructionDataCodec,cc as getEditUserDelegateInstructionDataDecoder,sc as getEditUserDelegateInstructionDataEncoder,HS as getExpectedSignerCodec,Be as getExpectedSignerDecoder,We as getExpectedSignerEncoder,jS as getExtensionStructCodec,Le as getExtensionStructDecoder,Zt as getExtensionStructEncoder,xt as getGlobalCounterAddress,J1 as getGlobalCounterCodec,Gr as getGlobalCounterDecoder,Y1 as getGlobalCounterDiscriminatorBytes,Wi as getGlobalCounterEncoder,$1 as getGlobalCounterSize,XM as getLightCpiSigner,Ke as getLightProtocolRpc,QS as getMemberCodec,_n as getMemberDecoder,Pn as getMemberEncoder,nx as getMemberKeyCodec,L as getMemberKeyDecoder,h as getMemberKeyEncoder,iM as getMultiWalletErrorMessage,Ab as getNativeTransferIntentDiscriminatorBytes,Ac as getNativeTransferIntentInstruction,lb as getNativeTransferIntentInstructionAsync,gb as getNativeTransferIntentInstructionDataCodec,dc as getNativeTransferIntentInstructionDataDecoder,pr as getNativeTransferIntentInstructionDataEncoder,UR as getOriginIndex,sx as getPackedMerkleContextCodec,$t as getPackedMerkleContextDecoder,Xt as getPackedMerkleContextEncoder,ix as getPausableAccountExtensionCodec,Tn as getPausableAccountExtensionDecoder,yn as getPausableAccountExtensionEncoder,Ax as getPermanentDelegateAccountExtensionCodec,Sn as getPermanentDelegateAccountExtensionDecoder,fn as getPermanentDelegateAccountExtensionEncoder,px as getPermissionsCodec,ie as getPermissionsDecoder,ae as getPermissionsEncoder,fx as getProofArgsCodec,Un as getProofArgsDecoder,hn as getProofArgsEncoder,Ex as getRemoveMemberArgsCodec,mn as getRemoveMemberArgsDecoder,pn as getRemoveMemberArgsEncoder,Cx as getRentConfigCodec,un as getRentConfigDecoder,an as getRentConfigEncoder,Cr as getSecp256r1MessageHash,Px as getSecp256r1PubkeyCodec,Ne as getSecp256r1PubkeyDecoder,kn as getSecp256r1PubkeyEncoder,Qf as getSecp256r1SignatureOffsetsDataDecoder,$f as getSecp256r1SignatureOffsetsDataEncoder,Ux as getSecp256r1VerifyArgsCodec,w as getSecp256r1VerifyArgsDecoder,N as getSecp256r1VerifyArgsEncoder,Ox as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,Wn as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,On as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,U as getSecp256r1VerifyInstruction,GP as getSecp256r1VerifyInstructionDataCodec,Fa as getSecp256r1VerifyInstructionDataDecoder,Ga as getSecp256r1VerifyInstructionDataEncoder,$I as getSettingsCodec,ct as getSettingsDecoder,XI as getSettingsDiscriminatorBytes,xg as getSettingsEncoder,se as getSettingsFromIndex,Nx as getSettingsIndexWithDelegateInfoCodec,Nn as getSettingsIndexWithDelegateInfoDecoder,Bn as getSettingsIndexWithDelegateInfoEncoder,bR as getSignedSecp256r1Key,k as getSolanaRpc,oR as getSolanaRpcEndpoint,Gx as getSplInterfacePdaArgsCodec,Fn as getSplInterfacePdaArgsDecoder,wn as getSplInterfacePdaArgsEncoder,Kx as getTokenMetadataCodec,In as getTokenMetadataDecoder,xn as getTokenMetadataEncoder,Ib as getTokenTransferIntentDiscriminatorBytes,Sc as getTokenTransferIntentInstruction,Db as getTokenTransferIntentInstructionAsync,Eb as getTokenTransferIntentInstructionDataCodec,fc as getTokenTransferIntentInstructionDataDecoder,mr as getTokenTransferIntentInstructionDataEncoder,Sa as getTransactionBufferAddress,Ub as getTransactionBufferCloseDiscriminatorBytes,Cc as getTransactionBufferCloseInstruction,vb as getTransactionBufferCloseInstructionDataCodec,bc as getTransactionBufferCloseInstructionDataDecoder,Dc as getTransactionBufferCloseInstructionDataEncoder,oE as getTransactionBufferCodec,Fb as getTransactionBufferCreateDiscriminatorBytes,Uc as getTransactionBufferCreateInstruction,Gb as getTransactionBufferCreateInstructionDataCodec,hc as getTransactionBufferCreateInstructionDataDecoder,_c as getTransactionBufferCreateInstructionDataEncoder,Fo as getTransactionBufferDecoder,rE as getTransactionBufferDiscriminatorBytes,Fg as getTransactionBufferEncoder,Jb as getTransactionBufferExecuteDiscriminatorBytes,Bc as getTransactionBufferExecuteInstruction,Zb as getTransactionBufferExecuteInstructionDataCodec,Wc as getTransactionBufferExecuteInstructionDataDecoder,Oc as getTransactionBufferExecuteInstructionDataEncoder,rC as getTransactionBufferExtendDiscriminatorBytes,Hc as getTransactionBufferExtendInstruction,oC as getTransactionBufferExtendInstructionDataCodec,Vc as getTransactionBufferExtendInstructionDataDecoder,Gc as getTransactionBufferExtendInstructionDataEncoder,gC as getTransactionBufferVoteDiscriminatorBytes,Jc as getTransactionBufferVoteInstruction,lC as getTransactionBufferVoteInstructionDataCodec,Yc as getTransactionBufferVoteInstructionDataDecoder,jc as getTransactionBufferVoteInstructionDataEncoder,xC as getTransactionExecuteDiscriminatorBytes,ta as getTransactionExecuteInstruction,IC as getTransactionExecuteInstructionDataCodec,ea as getTransactionExecuteInstructionDataDecoder,Qc as getTransactionExecuteInstructionDataEncoder,_C as getTransactionExecuteSyncDiscriminatorBytes,aa as getTransactionExecuteSyncInstruction,hC as getTransactionExecuteSyncInstructionDataCodec,ca as getTransactionExecuteSyncInstructionDataDecoder,sa as getTransactionExecuteSyncInstructionDataEncoder,Yx as getTransactionMessageAddressTableLookupCodec,Yn as getTransactionMessageAddressTableLookupDecoder,jn as getTransactionMessageAddressTableLookupEncoder,$x as getTransactionSyncSignersCodec,J as getTransactionSyncSignersDecoder,Y as getTransactionSyncSignersEncoder,rI as getTransferFeeAccountExtensionCodec,Dn as getTransferFeeAccountExtensionDecoder,En as getTransferFeeAccountExtensionEncoder,cI as getTransferHookAccountExtensionCodec,Cn as getTransferHookAccountExtensionDecoder,bn as getTransferHookAccountExtensionEncoder,uI as getTransportsCodec,Fe as getTransportsDecoder,we as getTransportsEncoder,v as getUserAddress,AE as getUserCodec,At as getUserDecoder,dE as getUserDiscriminatorBytes,sl as getUserEncoder,gI as getUserRoleCodec,pe as getUserRoleDecoder,le as getUserRoleEncoder,_1 as getVersionFromDiscriminator,ZM as getWalletAddressFromIndex,$ as getWalletAddressFromSettings,tM as identifyMultiWalletAccount,nM as identifyMultiWalletInstruction,sR as initialize,OS as isConfigAction,JS as isExtensionStruct,uM as isMultiWalletError,eI as isTransactionSyncSigners,I_ as nativeTransferIntent,vE as parseChangeConfigInstruction,GE as parseCreateDomainConfigInstruction,ZE as parseCreateDomainUserAccountInstruction,sD as parseCreateGlobalCounterInstruction,mD as parseCreateUserAccountInstruction,bD as parseCreateWalletInstruction,vD as parseDisableDomainConfigInstruction,FD as parseEditDomainConfigInstruction,JD as parseEditTransactionManagerUrlInstruction,ob as parseEditUserDelegateInstruction,pb as parseNativeTransferIntentInstruction,VP as parseSecp256r1VerifyInstruction,bb as parseTokenTransferIntentInstruction,Lb as parseTransactionBufferCloseInstruction,Vb as parseTransactionBufferCreateInstruction,Xb as parseTransactionBufferExecuteInstruction,sC as parseTransactionBufferExtendInstruction,pC as parseTransactionBufferVoteInstruction,EC as parseTransactionExecuteInstruction,UC as parseTransactionExecuteSyncInstruction,hU as prepareChangeConfigArgs,BU as prepareTransactionBundle,ZU as prepareTransactionMessage,tv as prepareTransactionSync,GR as retrieveTransactionManager,HR as serializeConfigActions,N_ as tokenTransferIntent,Qx as transactionSyncSigners,Ta as vaultTransactionMessageDeserialize,ya as vaultTransactionMessageSerialize,ri 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,getEnumEncoder,getEnumDecoder,addEncoderSizePrefix,getU32Encoder,addDecoderSizePrefix,getU32Decoder,getU64Encoder,getU64Decoder,getU16Encoder,getOptionEncoder,getArrayEncoder,getU16Decoder,getOptionDecoder,getArrayDecoder,getBooleanEncoder,getBooleanDecoder,getDiscriminatedUnionEncoder,getTupleEncoder,getDiscriminatedUnionDecoder,getTupleDecoder,getUnitEncoder,getUnitDecoder,getUtf8Encoder,getUtf8Decoder,getProgramDerivedAddress,containsBytes,isProgramError,getBase58Encoder,getBase58Decoder,getBase64Encoder,getBase64Decoder,getTransactionEncoder,createDecoder,createEncoder,AccountRole,some,none,upgradeRoleToSigner,fetchAddressesForLookupTables,isTransactionSigner}from'@solana/kit';import {sha256}from'@noble/hashes/sha2.js';import d from'zod';import {createRpc,TreeType,getLightSystemAccountMetasV2,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {createSolanaRpc}from'@solana/rpc';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {p256}from'@noble/curves/nist.js';import {canonicalize}from'json-canonicalize';import {getTransferSolInstruction}from'@solana-program/system';import {PublicKey}from'@solana/web3.js';import {findAssociatedTokenPda,getTokenDecoder}from'@solana-program/token';var Br=new Uint8Array([201,232,212,229,59,241,106,197]);function X1(){return fixEncoderSize(getBytesEncoder(),8).encode(Br)}function Ri(){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:Br}))}function Nr(){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 $1(){return combineCodec(Ri(),Nr())}function wr(e){return decodeAccount(e,Nr())}async function Fr(e,r,t){let o=await Pi(e,r,t);return assertAccountExists(o),o}async function Pi(e,r,t){let o=await fetchEncodedAccount(e,r,t);return wr(o)}async function Q1(e,r,t){let o=await _i(e,r,t);return assertAccountsExist(o),o}async function _i(e,r,t){return (await fetchEncodedAccounts(e,r,t)).map(n=>wr(n))}function eS(){return 846}var Hr=new Uint8Array([42,206,176,58,175,129,130,233]);function rS(){return fixEncoderSize(getBytesEncoder(),8).encode(Hr)}function Hi(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()]]),e=>({...e,discriminator:Hr}))}function zr(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()]])}function oS(){return combineCodec(Hi(),zr())}function Kr(e){return decodeAccount(e,zr())}async function sS(e,r,t){let o=await zi(e,r,t);return assertAccountExists(o),o}async function zi(e,r,t){let o=await fetchEncodedAccount(e,r,t);return Kr(o)}async function cS(e,r,t){let o=await Ki(e,r,t);return assertAccountsExist(o),o}async function Ki(e,r,t){return (await fetchEncodedAccounts(e,r,t)).map(n=>Kr(n))}function aS(){return 24}var kt=(t=>(t[t.Initialized=0]="Initialized",t[t.Frozen=1]="Frozen",t))(kt||{});function Lt(){return getEnumEncoder(kt)}function Ot(){return getEnumDecoder(kt)}function dS(){return combineCodec(Lt(),Ot())}function Wt(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Bt(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function lS(){return combineCodec(Wt(),Bt())}function Nt(){return getStructEncoder([["memberKey",h()],["permissions",Ae()]])}function wt(){return getStructDecoder([["memberKey",k()],["permissions",ge()]])}function TS(){return combineCodec(Nt(),wt())}function Ft(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Gt(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function xS(){return combineCodec(Ft(),Gt())}function Vt(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function Ht(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function DS(){return combineCodec(Vt(),Ht())}function Yt(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function Jt(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function MS(){return combineCodec(Yt(),Jt())}function Zt(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",Qt()],["tlv",getOptionEncoder(getArrayEncoder($t()))],["state",Lt()]])}function Xt(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",en()],["tlv",getOptionDecoder(getArrayDecoder(We()))],["state",Ot()]])}function hS(){return combineCodec(Zt(),Xt())}function rn(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",sn()]])}function on(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",cn()]])}function LS(){return combineCodec(rn(),on())}function sn(){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",dn()]])}function cn(){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",An()]])}function NS(){return combineCodec(sn(),cn())}function Be(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(pn())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Nt())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(yn())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Ne(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(mn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(wt())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Tn())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function VS(){return combineCodec(Be(),Ne())}function HS(e,r){return Array.isArray(r)?{__kind:e,fields:r}:{__kind:e,...r??{}}}function zS(e,r){return r.__kind===e}function pn(){return getStructEncoder([["memberKey",h()],["permissions",Ae()]])}function mn(){return getStructDecoder([["memberKey",k()],["permissions",ge()]])}function YS(){return combineCodec(pn(),mn())}function we(){return getStructEncoder([["memberKey",h()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function Fe(){return getStructDecoder([["memberKey",k()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function $S(){return combineCodec(we(),Fe())}function $t(){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([En()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([fn()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([xn()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([bn()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([Mn()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([Vt()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([rn()])]])]])}function We(){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([Dn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([Sn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([In()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([Cn()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([Rn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([Ht()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([on()])]])]])}function nx(){return combineCodec($t(),We())}function rx(e,r){return Array.isArray(r)?{__kind:e,fields:r}:{__kind:e,...r??{}}}function ox(e,r){return r.__kind===e}function hn(){return getStructEncoder([["pubkey",h()],["role",getU8Encoder()],["permissions",Ae()],["padding",getU8Encoder()],["isDelegate",getU8Encoder()]])}function Un(){return getStructDecoder([["pubkey",k()],["role",getU8Decoder()],["permissions",ge()],["padding",getU8Decoder()],["isDelegate",getU8Decoder()]])}function ix(){return combineCodec(hn(),Un())}function h(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function k(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function Ax(){return combineCodec(h(),k())}function Qt(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function en(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function px(){return combineCodec(Qt(),en())}function fn(){return getStructEncoder([])}function Sn(){return getStructDecoder([])}function Tx(){return combineCodec(fn(),Sn())}function xn(){return getStructEncoder([])}function In(){return getStructDecoder([])}function xx(){return combineCodec(xn(),In())}function Ae(){return getStructEncoder([["mask",getU8Encoder()]])}function ge(){return getStructDecoder([["mask",getU8Decoder()]])}function Dx(){return combineCodec(Ae(),ge())}function vn(){return getStructEncoder([["proof",getOptionEncoder(Yt())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function kn(){return getStructDecoder([["proof",getOptionDecoder(Jt())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function Rx(){return combineCodec(vn(),kn())}function yn(){return getStructEncoder([["memberKey",h()]])}function Tn(){return getStructDecoder([["memberKey",k()]])}function Ux(){return combineCodec(yn(),Tn())}function dn(){return getStructEncoder([["baseRent",getU16Encoder()],["compressionCost",getU16Encoder()],["lamportsPerBytePerEpoch",getU8Encoder()],["maxFundedEpochs",getU8Encoder()],["maxTopUp",getU16Encoder()]])}function An(){return getStructDecoder([["baseRent",getU16Decoder()],["compressionCost",getU16Decoder()],["lamportsPerBytePerEpoch",getU8Decoder()],["maxFundedEpochs",getU8Decoder()],["maxTopUp",getU16Decoder()]])}function Lx(){return combineCodec(dn(),An())}function Wn(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Ge(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function Bx(){return combineCodec(Wn(),Ge())}function w(){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 Fx(){return combineCodec(w(),F())}function Bn(){return getStructEncoder([["verifyArgs",w()],["domainConfigIndex",getU8Encoder()]])}function Nn(){return getStructDecoder([["verifyArgs",F()],["domainConfigIndex",getU8Decoder()]])}function zx(){return combineCodec(Bn(),Nn())}function wn(){return getStructEncoder([["index",getU128Encoder()],["isDelegate",getBooleanEncoder()]])}function Fn(){return getStructDecoder([["index",getU128Decoder()],["isDelegate",getBooleanDecoder()]])}function jx(){return combineCodec(wn(),Fn())}function Gn(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function Vn(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function Zx(){return combineCodec(Gn(),Vn())}function En(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(Wt())]])}function Dn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(Bt())]])}function eI(){return combineCodec(En(),Dn())}function Jn(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Zn(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function rI(){return combineCodec(Jn(),Zn())}function $(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([Bn()])]])]])}function Q(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([Nn()])]])]])}function aI(){return combineCodec($(),Q())}function iI(e,r){return Array.isArray(r)?{__kind:e,fields:r}:{__kind:e,...r??{}}}function uI(e,r){return r.__kind===e}function bn(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function Cn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function gI(){return combineCodec(bn(),Cn())}function Mn(){return getStructEncoder([["transferring",getU8Encoder()]])}function Rn(){return getStructDecoder([["transferring",getU8Decoder()]])}function mI(){return combineCodec(Mn(),Rn())}var Xn=(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))(Xn||{});function Ve(){return getEnumEncoder(Xn)}function He(){return getEnumDecoder(Xn)}function fI(){return combineCodec(Ve(),He())}var be=(n=>(n[n.TransactionManager=0]="TransactionManager",n[n.Administrator=1]="Administrator",n[n.PermanentMember=2]="PermanentMember",n[n.Member=3]="Member",n))(be||{});function Te(){return getEnumEncoder(be)}function fe(){return getEnumDecoder(be)}function II(){return combineCodec(Te(),fe())}var Oo=new Uint8Array([223,179,163,190,177,224,67,173]);function cE(){return fixEncoderSize(getBytesEncoder(),8).encode(Oo)}function Rg(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(hn())],["threshold",getU8Encoder()],["multiWalletBump",getU8Encoder()],["bump",getU8Encoder()],["padding",getU8Encoder()],["latestSlotNumber",getU64Encoder()]]),e=>({...e,discriminator:Oo}))}function ut(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["index",getU128Decoder()],["members",getArrayDecoder(Un())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["padding",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function aE(){return combineCodec(Rg(),ut())}function Wo(e){return decodeAccount(e,ut())}async function Bo(e,r,t){let o=await Pg(e,r,t);return assertAccountExists(o),o}async function Pg(e,r,t){let o=await fetchEncodedAccount(e,r,t);return Wo(o)}async function iE(e,r,t){let o=await _g(e,r,t);return assertAccountsExist(o),o}async function _g(e,r,t){return (await fetchEncodedAccounts(e,r,t)).map(n=>Wo(n))}var Vo=new Uint8Array([90,36,35,219,93,225,110,96]);function gE(){return fixEncoderSize(getBytesEncoder(),8).encode(Vo)}function jg(){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())],["expectedSigners",getArrayEncoder(we())],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Vo}))}function Ho(){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",k()],["executor",k()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(k())],["expectedSigners",getArrayDecoder(Fe())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function lE(){return combineCodec(jg(),Ho())}function zo(e){return decodeAccount(e,Ho())}async function pE(e,r,t){let o=await Yg(e,r,t);return assertAccountExists(o),o}async function Yg(e,r,t){let o=await fetchEncodedAccount(e,r,t);return zo(o)}async function mE(e,r,t){let o=await Jg(e,r,t);return assertAccountsExist(o),o}async function Jg(e,r,t){return (await fetchEncodedAccounts(e,r,t)).map(n=>zo(n))}var Qo=new Uint8Array([159,117,95,227,239,151,58,236]);function SE(){return fixEncoderSize(getBytesEncoder(),8).encode(Qo)}function gl(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["domainConfig",getOptionEncoder(getAddressEncoder())],["member",h()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(Ve()))],["wallets",getArrayEncoder(wn())],["role",Te()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["bump",getU8Encoder()]]),e=>({...e,discriminator:Qo}))}function pt(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["domainConfig",getOptionDecoder(getAddressDecoder())],["member",k()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(He()))],["wallets",getArrayDecoder(Fn())],["role",fe()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["bump",getU8Decoder()]])}function xE(){return combineCodec(gl(),pt())}function es(e){return decodeAccount(e,pt())}async function ts(e,r,t){let o=await ll(e,r,t);return assertAccountExists(o),o}async function ll(e,r,t){let o=await fetchEncodedAccount(e,r,t);return es(o)}async function IE(e,r,t){let o=await pl(e,r,t);return assertAccountsExist(o),o}async function pl(e,r,t){return (await fetchEncodedAccounts(e,r,t)).map(n=>es(n))}function y({args:e}){if(!e)return [];let{remainingAccounts:r}=e;return r.map(t=>t.signer?{address:t.address,role:t.role,signer:t.signer}:{address:t.address,role:t.role})}function rs(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function P(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function T(e,r){return t=>{if(!t.value)return Object.freeze({address:e,role:AccountRole.READONLY});let o=t.isWritable?AccountRole.WRITABLE:AccountRole.READONLY;return Object.freeze({address:P(t.value),role:ns(t.value)?upgradeRoleToSigner(o):o,...ns(t.value)?{signer:t.value}:{}})}}function ns(e){return !!e&&typeof e=="object"&&"address"in e&&isTransactionSigner(e)}var is=new Uint8Array([8]);function wE(){return fixEncoderSize(getBytesEncoder(),1).encode(is)}function us(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(Be())],["signers",getArrayEncoder($())]]),e=>({...e,discriminator:is}))}function ds(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Ne())],["signers",getArrayDecoder(Q())]])}function FE(){return combineCodec(us(),ds())}function As(e,r){let t=r?.programAddress??A,n={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};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.systemProgram),s(n.slotHashSysvar),s(n.instructionsSysvar),...a],data:us().encode(c),programAddress:t})}function GE(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),payer:t(),systemProgram:t(),slotHashSysvar:o(),instructionsSysvar:t()},data:ds().decode(e.data)}}var Ss=new Uint8Array([0]);function jE(){return fixEncoderSize(getBytesEncoder(),1).encode(Ss)}function cr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["rpId",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())],["origins",getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),e=>({...e,discriminator:Ss}))}function xs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["rpId",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())],["origins",getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function YE(){return combineCodec(cr(),xs())}async function JE(e,r){let t=r?.programAddress??A,n={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},userAccount:{value:e.userAccount??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.userAccount.value||(n.userAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114])),getAddressEncoder().encode(P(n.authority.value))]}));let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.domainConfig),s(n.payer),s(n.authority),s(n.systemProgram),s(n.userAccount),...a],data:cr().encode(c),programAddress:t})}function Is(e,r){let t=r?.programAddress??A,n={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},userAccount:{value:e.userAccount??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.domainConfig),s(n.payer),s(n.authority),s(n.systemProgram),s(n.userAccount),...a],data:cr().encode(c),programAddress:t})}function ZE(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:t(),payer:t(),authority:t(),systemProgram:t(),userAccount:t()},data:xs().decode(e.data)}}var bs=new Uint8Array([4]);function rD(){return fixEncoderSize(getBytesEncoder(),1).encode(bs)}function Cs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["member",Wn()],["role",Te()],["credentialId",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["transports",getArrayEncoder(Ve())]]),e=>({...e,discriminator:bs}))}function Ms(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["member",Ge()],["role",fe()],["credentialId",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["transports",getArrayDecoder(He())]])}function oD(){return combineCodec(Cs(),Ms())}function Rs(e,r){let t=r?.programAddress??A,n={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},userAccount:{value:e.userAccount??null,isWritable:true},transactionManagerAccount:{value:e.transactionManagerAccount??null,isWritable:false},settings:{value:e.settings??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.payer),s(n.domainConfig),s(n.authority),s(n.userAccount),s(n.transactionManagerAccount),s(n.settings),s(n.systemProgram),...a],data:Cs().encode(c),programAddress:t})}function sD(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{payer:t(),domainConfig:t(),authority:t(),userAccount:t(),transactionManagerAccount:o(),settings:o(),systemProgram:t()},data:Ms().decode(e.data)}}var _s=new Uint8Array([3]);function AD(){return fixEncoderSize(getBytesEncoder(),1).encode(_s)}function ur(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:_s}))}function hs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function gD(){return combineCodec(ur(),hs())}async function Us(e,r){let t=r?.programAddress??A,n={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};n.globalCounter.value||(n.globalCounter.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let i=y(c),a=T(t);return Object.freeze({accounts:[a(n.globalCounter),a(n.payer),a(n.systemProgram),...i],data:ur().encode({}),programAddress:t})}function lD(e,r){let t=r?.programAddress??A,n={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let i=y(c),a=T(t);return Object.freeze({accounts:[a(n.globalCounter),a(n.payer),a(n.systemProgram),...i],data:ur().encode({}),programAddress:t})}function pD(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{globalCounter:t(),payer:t(),systemProgram:t()},data:hs().decode(e.data)}}var ks=new Uint8Array([5]);function ID(){return fixEncoderSize(getBytesEncoder(),1).encode(ks)}function Ar(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["role",Te()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))]]),e=>({...e,discriminator:ks}))}function Ls(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["role",fe()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))]])}function ED(){return combineCodec(Ar(),Ls())}async function DD(e,r){let t=r?.programAddress??A,n={payer:{value:e.payer??null,isWritable:true},member:{value:e.member??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},userAccount:{value:e.userAccount??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.userAccount.value||(n.userAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114])),getAddressEncoder().encode(P(n.member.value))]}));let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.payer),s(n.member),s(n.systemProgram),s(n.userAccount),...a],data:Ar().encode(c),programAddress:t})}function Os(e,r){let t=r?.programAddress??A,n={payer:{value:e.payer??null,isWritable:true},member:{value:e.member??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},userAccount:{value:e.userAccount??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.payer),s(n.member),s(n.systemProgram),s(n.userAccount),...a],data:Ar().encode(c),programAddress:t})}function bD(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{payer:t(),member:t(),systemProgram:t(),userAccount:t()},data:Ls().decode(e.data)}}var Ns=new Uint8Array([16]);function hD(){return fixEncoderSize(getBytesEncoder(),1).encode(Ns)}function lr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["settingsIndex",getU128Encoder()]]),e=>({...e,discriminator:Ns}))}function ws(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["settingsIndex",getU128Decoder()]])}function UD(){return combineCodec(lr(),ws())}async function vD(e,r){let t=r?.programAddress??A,n={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},userAccount:{value:e.userAccount??null,isWritable:true},settings:{value:e.settings??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.globalCounter.value||(n.globalCounter.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),n.userAccount.value||(n.userAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114])),getAddressEncoder().encode(P(n.initialMember.value))]})),n.settings.value||(n.settings.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getU128Encoder().encode(rs(c.settingsIndex))]}));let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.payer),s(n.initialMember),s(n.systemProgram),s(n.globalCounter),s(n.userAccount),s(n.settings),...a],data:lr().encode(c),programAddress:t})}function Fs(e,r){let t=r?.programAddress??A,n={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},userAccount:{value:e.userAccount??null,isWritable:true},settings:{value:e.settings??null,isWritable:true}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.payer),s(n.initialMember),s(n.systemProgram),s(n.globalCounter),s(n.userAccount),s(n.settings),...a],data:lr().encode(c),programAddress:t})}function kD(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{payer:t(),initialMember:t(),systemProgram:t(),globalCounter:t(),userAccount:t(),settings:t()},data:ws().decode(e.data)}}var Hs=new Uint8Array([2]);function wD(){return fixEncoderSize(getBytesEncoder(),1).encode(Hs)}function zs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["disable",getBooleanEncoder()]]),e=>({...e,discriminator:Hs}))}function Ks(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["disable",getBooleanDecoder()]])}function FD(){return combineCodec(zs(),Ks())}function qs(e,r){let t=r?.programAddress??A,n={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=y({args:c}),s=T(t);return Object.freeze({accounts:[s(n.domainConfig),s(n.admin),...a],data:zs().encode(c),programAddress:t})}function GD(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:t(),admin:t()},data:Ks().decode(e.data)}}var Js=new Uint8Array([1]);function jD(){return fixEncoderSize(getBytesEncoder(),1).encode(Js)}function Zs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["newOrigins",getOptionEncoder(getArrayEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())))]]),e=>({...e,discriminator:Js}))}function Xs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["newOrigins",getOptionDecoder(getArrayDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())))]])}function YD(){return combineCodec(Zs(),Xs())}function $s(e,r){let t=r?.programAddress??A,n={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},userAccount:{value:e.userAccount??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.domainConfig),s(n.authority),s(n.newAuthority),s(n.userAccount),s(n.systemProgram),...a],data:Zs().encode(c),programAddress:t})}function JD(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{domainConfig:t(),authority:t(),newAuthority:o(),userAccount:o(),systemProgram:t()},data:Xs().decode(e.data)}}var ec=new Uint8Array([6]);function tb(){return fixEncoderSize(getBytesEncoder(),1).encode(ec)}function mr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["transactionManagerUrl",addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder())]]),e=>({...e,discriminator:ec}))}function tc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["transactionManagerUrl",addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder())]])}function nb(){return combineCodec(mr(),tc())}async function rb(e,r){let t=r?.programAddress??A,n={signer:{value:e.signer??null,isWritable:false},transactionManagerAccount:{value:e.transactionManagerAccount??null,isWritable:true}},c={...e},i={args:c};n.transactionManagerAccount.value||(n.transactionManagerAccount.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([117,115,101,114])),getAddressEncoder().encode(P(n.signer.value))]}));let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.signer),s(n.transactionManagerAccount),...a],data:mr().encode(c),programAddress:t})}function nc(e,r){let t=r?.programAddress??A,n={signer:{value:e.signer??null,isWritable:false},transactionManagerAccount:{value:e.transactionManagerAccount??null,isWritable:true}},c={...e},a=y({args:c}),s=T(t);return Object.freeze({accounts:[s(n.signer),s(n.transactionManagerAccount),...a],data:mr().encode(c),programAddress:t})}function ob(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{signer:t(),transactionManagerAccount:t()},data:tc().decode(e.data)}}var ac=new Uint8Array([7]);function Ab(){return fixEncoderSize(getBytesEncoder(),1).encode(ac)}function ic(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(w())],["delegateTo",getOptionEncoder(getU128Encoder())]]),e=>({...e,discriminator:ac}))}function uc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())],["delegateTo",getOptionDecoder(getU128Decoder())]])}function gb(){return combineCodec(ic(),uc())}function dc(e,r){let t=r?.programAddress??A,n={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},userAccount:{value:e.userAccount??null,isWritable:true},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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.feePayer),s(n.signer),s(n.userAccount),s(n.oldSettings),s(n.newSettings),s(n.slotHashSysvar),s(n.instructionsSysvar),s(n.domainConfig),...a],data:ic().encode(c),programAddress:t})}function lb(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{feePayer:t(),signer:o(),userAccount:t(),oldSettings:o(),newSettings:o(),slotHashSysvar:o(),instructionsSysvar:o(),domainConfig:o()},data:uc().decode(e.data)}}var gc=new Uint8Array([17]);function xb(){return fixEncoderSize(getBytesEncoder(),1).encode(gc)}function yr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder($())]]),e=>({...e,discriminator:gc}))}function lc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(Q())]])}function Ib(){return combineCodec(yr(),lc())}async function Eb(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),n.source.value||(n.source.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(P(n.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.slotHashSysvar),s(n.instructionsSysvar),s(n.source),s(n.destination),s(n.systemProgram),...a],data:yr().encode(c),programAddress:t})}function pc(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.slotHashSysvar),s(n.instructionsSysvar),s(n.source),s(n.destination),s(n.systemProgram),...a],data:yr().encode(c),programAddress:t})}function Db(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),slotHashSysvar:o(),instructionsSysvar:t(),source:t(),destination:t(),systemProgram:t()},data:lc().decode(e.data)}}var xc=new Uint8Array([18]);function hb(){return fixEncoderSize(getBytesEncoder(),1).encode(xc)}function Tr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Gn())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(Zt())],["compressedProofArgs",getOptionEncoder(vn())],["signers",getArrayEncoder($())]]),e=>({...e,discriminator:xc}))}function Ic(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(Vn())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Xt())],["compressedProofArgs",getOptionDecoder(kn())],["signers",getArrayDecoder(Q())]])}function Ub(){return combineCodec(Tr(),Ic())}async function vb(e,r){let t=r?.programAddress??A,n={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:true},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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),n.source.value||(n.source.value=await getProgramDerivedAddress({programAddress:t,seeds:[getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),getAddressEncoder().encode(P(n.settings.value)),getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),n.tokenProgram.value||(n.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),n.sourceSplTokenAccount.value||(n.sourceSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(P(n.source.value)),getAddressEncoder().encode(P(n.tokenProgram.value)),getAddressEncoder().encode(P(n.mint.value))]})),n.sourceCtokenTokenAccount.value||(n.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(P(n.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(P(n.mint.value))]})),n.destinationSplTokenAccount.value||(n.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(P(n.destination.value)),getAddressEncoder().encode(P(n.tokenProgram.value)),getAddressEncoder().encode(P(n.mint.value))]})),n.destinationCtokenTokenAccount.value||(n.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(P(n.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(P(n.mint.value))]})),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.compressedTokenProgramAuthority.value||(n.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),n.compressedTokenProgram.value||(n.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.slotHashSysvar),s(n.instructionsSysvar),s(n.source),s(n.sourceSplTokenAccount),s(n.sourceCtokenTokenAccount),s(n.destination),s(n.destinationSplTokenAccount),s(n.destinationCtokenTokenAccount),s(n.tokenProgram),s(n.mint),s(n.systemProgram),s(n.compressedTokenProgramAuthority),s(n.splInterfacePda),s(n.compressibleConfig),s(n.rentSponsor),s(n.compressedTokenProgram),...a],data:Tr().encode(c),programAddress:t})}function Ec(e,r){let t=r?.programAddress??A,n={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:true},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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),n.tokenProgram.value||(n.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.compressedTokenProgramAuthority.value||(n.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),n.compressedTokenProgram.value||(n.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.slotHashSysvar),s(n.instructionsSysvar),s(n.source),s(n.sourceSplTokenAccount),s(n.sourceCtokenTokenAccount),s(n.destination),s(n.destinationSplTokenAccount),s(n.destinationCtokenTokenAccount),s(n.tokenProgram),s(n.mint),s(n.systemProgram),s(n.compressedTokenProgramAuthority),s(n.splInterfacePda),s(n.compressibleConfig),s(n.rentSponsor),s(n.compressedTokenProgram),...a],data:Tr().encode(c),programAddress:t})}function kb(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),payer:t(),slotHashSysvar:o(),instructionsSysvar:t(),source:t(),sourceSplTokenAccount:t(),sourceCtokenTokenAccount:t(),destination:t(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:t(),mint:t(),systemProgram:t(),compressedTokenProgramAuthority:t(),splInterfacePda:o(),compressibleConfig:t(),rentSponsor:o(),compressedTokenProgram:t()},data:Ic().decode(e.data)}}var Cc=new Uint8Array([12]);function Fb(){return fixEncoderSize(getBytesEncoder(),1).encode(Cc)}function Mc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(w())]]),e=>({...e,discriminator:Cc}))}function Rc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function Gb(){return combineCodec(Mc(),Rc())}function Pc(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.domainConfig),s(n.transactionBuffer),s(n.closer),s(n.slotHashSysvar),s(n.instructionsSysvar),...a],data:Mc().encode(c),programAddress:t})}function Vb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),payer:t(),domainConfig:o(),transactionBuffer:t(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:Rc().decode(e.data)}}var Uc=new Uint8Array([9]);function Jb(){return fixEncoderSize(getBytesEncoder(),1).encode(Uc)}function vc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["bufferIndex",getU8Encoder()],["preauthorizeExecution",getBooleanEncoder()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["finalBufferHash",fixEncoderSize(getBytesEncoder(),32)],["finalBufferSize",getU16Encoder()],["expectedSigners",getArrayEncoder(we())],["secp256r1VerifyArgs",getOptionEncoder(w())]]),e=>({...e,discriminator:Uc}))}function kc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["bufferIndex",getU8Decoder()],["preauthorizeExecution",getBooleanDecoder()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["finalBufferHash",fixDecoderSize(getBytesDecoder(),32)],["finalBufferSize",getU16Decoder()],["expectedSigners",getArrayDecoder(Fe())],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function Zb(){return combineCodec(vc(),kc())}function Lc(e,r){let t=r?.programAddress??A,n={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};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.domainConfig),s(n.transactionBuffer),s(n.creator),s(n.systemProgram),s(n.instructionsSysvar),s(n.slotHashSysvar),...a],data:vc().encode(c),programAddress:t})}function Xb(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),payer:t(),domainConfig:o(),transactionBuffer:t(),creator:o(),systemProgram:t(),instructionsSysvar:t(),slotHashSysvar:o()},data:kc().decode(e.data)}}var Bc=new Uint8Array([13]);function oC(){return fixEncoderSize(getBytesEncoder(),1).encode(Bc)}function Nc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(w())]]),e=>({...e,discriminator:Bc}))}function wc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function sC(){return combineCodec(Nc(),wc())}function Fc(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.domainConfig),s(n.executor),s(n.transactionBuffer),s(n.slotHashSysvar),s(n.instructionsSysvar),...a],data:Nc().encode(c),programAddress:t})}function cC(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),domainConfig:o(),executor:o(),transactionBuffer:t(),slotHashSysvar:o(),instructionsSysvar:o()},data:wc().decode(e.data)}}var Hc=new Uint8Array([11]);function gC(){return fixEncoderSize(getBytesEncoder(),1).encode(Hc)}function zc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["buffer",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]]),e=>({...e,discriminator:Hc}))}function Kc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function lC(){return combineCodec(zc(),Kc())}function qc(e,r){let t=r?.programAddress??A,n={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=y({args:c}),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.transactionBuffer),...a],data:zc().encode(c),programAddress:t})}function pC(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{settings:t(),transactionBuffer:t()},data:Kc().decode(e.data)}}var Jc=new Uint8Array([10]);function IC(){return fixEncoderSize(getBytesEncoder(),1).encode(Jc)}function Zc(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["secp256r1VerifyArgs",getOptionEncoder(w())]]),e=>({...e,discriminator:Jc}))}function Xc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(F())]])}function EC(){return combineCodec(Zc(),Xc())}function $c(e,r){let t=r?.programAddress??A,n={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};n.systemProgram.value||(n.systemProgram.value="11111111111111111111111111111111"),n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.domainConfig),s(n.transactionBuffer),s(n.voter),s(n.systemProgram),s(n.slotHashSysvar),s(n.instructionsSysvar),...a],data:Zc().encode(c),programAddress:t})}function DC(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),domainConfig:o(),transactionBuffer:t(),voter:o(),systemProgram:t(),slotHashSysvar:o(),instructionsSysvar:o()},data:Xc().decode(e.data)}}var ta=new Uint8Array([14]);function _C(){return fixEncoderSize(getBytesEncoder(),1).encode(ta)}function na(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:ta}))}function ra(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function hC(){return combineCodec(na(),ra())}function oa(e,r){let t=r?.programAddress??A,n={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=y({args:c}),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.payer),s(n.transactionBuffer),...a],data:na().encode({}),programAddress:t})}function UC(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let r=0,t=()=>{let o=e.accounts[r];return r+=1,o};return {programAddress:e.programAddress,accounts:{settings:t(),payer:t(),transactionBuffer:t()},data:ra().decode(e.data)}}var aa=new Uint8Array([15]);function NC(){return fixEncoderSize(getBytesEncoder(),1).encode(aa)}function ia(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["numSigners",getU8Encoder()],["numWritableSigners",getU8Encoder()],["numWritableNonSigners",getU8Encoder()],["numAccountKeys",getU8Encoder()],["instructions",getArrayEncoder(Ft())],["addressTableLookups",getArrayEncoder(Jn())],["signers",getArrayEncoder($())]]),e=>({...e,discriminator:aa}))}function ua(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Gt())],["addressTableLookups",getArrayDecoder(Zn())],["signers",getArrayDecoder(Q())]])}function wC(){return combineCodec(ia(),ua())}function da(e,r){let t=r?.programAddress??A,n={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};n.slotHashSysvar.value||(n.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),n.instructionsSysvar.value||(n.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.settings),s(n.slotHashSysvar),s(n.instructionsSysvar),...a],data:ia().encode(c),programAddress:t})}function FC(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let r=0,t=()=>{let n=e.accounts[r];return r+=1,n},o=()=>{let n=t();return n.address===A?void 0:n};return {programAddress:e.programAddress,accounts:{settings:t(),slotHashSysvar:o(),instructionsSysvar:t()},data:ua().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",Wy=(c=>(c[c.DomainConfig=0]="DomainConfig",c[c.GlobalCounter=1]="GlobalCounter",c[c.Settings=2]="Settings",c[c.TransactionBuffer=3]="TransactionBuffer",c[c.User=4]="User",c))(Wy||{});function dM(e){let r="data"in e?e.data:e;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([201,232,212,229,59,241,106,197])),0))return 0;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([42,206,176,58,175,129,130,233])),0))return 1;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([223,179,163,190,177,224,67,173])),0))return 2;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([90,36,35,219,93,225,110,96])),0))return 3;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),8).encode(new Uint8Array([159,117,95,227,239,151,58,236])),0))return 4;throw new Error("The provided account could not be identified as a multiWallet account.")}var By=(l=>(l[l.ChangeConfig=0]="ChangeConfig",l[l.CreateDomainConfig=1]="CreateDomainConfig",l[l.CreateDomainUserAccount=2]="CreateDomainUserAccount",l[l.CreateGlobalCounter=3]="CreateGlobalCounter",l[l.CreateUserAccount=4]="CreateUserAccount",l[l.CreateWallet=5]="CreateWallet",l[l.DisableDomainConfig=6]="DisableDomainConfig",l[l.EditDomainConfig=7]="EditDomainConfig",l[l.EditTransactionManagerUrl=8]="EditTransactionManagerUrl",l[l.EditUserDelegate=9]="EditUserDelegate",l[l.NativeTransferIntent=10]="NativeTransferIntent",l[l.TokenTransferIntent=11]="TokenTransferIntent",l[l.TransactionBufferClose=12]="TransactionBufferClose",l[l.TransactionBufferCreate=13]="TransactionBufferCreate",l[l.TransactionBufferExecute=14]="TransactionBufferExecute",l[l.TransactionBufferExtend=15]="TransactionBufferExtend",l[l.TransactionBufferVote=16]="TransactionBufferVote",l[l.TransactionExecute=17]="TransactionExecute",l[l.TransactionExecuteSync=18]="TransactionExecuteSync",l))(By||{});function AM(e){let r="data"in e?e.data:e;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 1;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 2;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 3;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 4;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 5;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 6;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 7;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 8;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 9;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 10;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 11;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 12;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 13;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 14;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 15;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 16;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 17;if(containsBytes(r,fixEncoderSize(getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 18;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var wy=6e3,Fy=6001,Gy=6002,Vy=6003,Hy=6004,zy=6005,Ky=6006,qy=6007,jy=6008,Yy=6009,Jy=6010,Zy=6011,Xy=6012,$y=6013,Qy=6014,eT=6015,tT=6016,nT=6017,rT=6018,oT=6019,sT=6020,cT=6021,aT=6022,iT=6023,uT=6024,dT=6025,AT=6026,gT=6027,lT=6028,pT=6029,mT=6030,yT=6031,TT=6032,fT=6033,ST=6034,xT=6035,IT=6036,ET=6037,DT=6038,bT=6039,CT=6040,MT=6041,RT=6042,PT=6043,_T=6044,hT=6045,UT=6046,vT=6047,kT=6048,LT=6049,OT=6050,WT=6051,BT=6052,NT=6053,wT=6054,FT=6055,GT=6056,VT=6057,HT=6058,zT=6059,KT=6060,qT=6061,jT=6062,YT=6063,JT=6064,ZT=6065,XT=6066,$T=6067,QT=6068,ef=6069,tf=6070,nf=6071,rf=6072,of=6073,sf=6074,Aa;process.env.NODE_ENV!=="production"&&(Aa={[mT]:"This member is already delegated to another wallet.",[qy]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[OT]:"Missing credential id.",[BT]:"The domain configuration account is disabled. Please contact support or try again later.",[NT]:"Missing domain configuration account.",[QT]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[Jy]:"Duplicate public keys detected among members. Each member must have a unique key.",[Yy]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[cT]:"No members provided. A multisig wallet must contain at least one member.",[rT]:"Expected a User with Administrator role for this instruction.",[jy]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[tT]:"Expected a User with Transaction Manager role for this instruction.",[bT]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[CT]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[MT]:"Declared buffer size does not match the actual serialized size.",[FT]:"Failed to compute hash. This may indicate a system error.",[fT]:"Not enough members with vote permission to meet the approval threshold.",[yT]:"At least one signer with execute permission is required to proceed.",[TT]:"At least one signer with initiate permission is required to perform this action.",[AT]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[$T]:"Invalid account index in transaction message. The account index is out of bounds.",[oT]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[lT]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[DT]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[GT]:"Member key conversion failed. The provided key format is invalid.",[ST]:"Only delegated members are allowed for this transaction.",[dT]:"Unexpected number of accounts provided for this instruction.",[$y]:"User with Permanent Member role must have a delegated wallet.",[Fy]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[Hy]:"The extracted public key has an invalid length or encoding.",[wy]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[Vy]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[LT]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[vT]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[iT]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[XT]:"Invalid source type for token transfer. The source account type is not supported.",[nT]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[eT]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[uT]:"Malformed transaction message: structure or formatting does not match the expected layout.",[nf]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[gT]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[tf]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[ZT]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[zy]:"The extracted WebAuthn signed message payload is malformed.",[hT]:"An input string exceeds the maximum allowed character length.",[zT]:"Member not found in settings. Cannot remove a member that does not exist.",[pT]:"A required account is missing from the instruction context.",[VT]:"Compressed proof arguments are missing. Required for compressed account operations.",[jT]:"Missing compressed token account. Required for token transfer operations.",[rf]:"Missing destination token account. Required for token transfer operations.",[JT]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[HT]:"Light CPI accounts are missing. Required for compressed account operations.",[sf]:"Missing new authority account. Required for domain configuration updates.",[of]:"Missing settings account. Required for delegate operations.",[YT]:"Missing SPL interface PDA. Required for token transfer operations.",[UT]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[IT]:"No valid signer found in this transaction.",[sT]:"Only one administrator is allowed per wallet.",[Xy]:"Only one permanent member is allowed per wallet.",[Qy]:"Only one transaction manager is allowed per wallet.",[wT]:"The given origin index is not in the whitelisted origins.",[qT]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[Zy]:"Permanent members cannot be removed from a wallet.",[_T]:"Writable CPI calls to protected accounts are not permitted.",[Ky]:"The rpIdHash extracted from the signed message does not match the expected value.",[KT]:"Settings key mismatch. The provided settings key does not match the expected value.",[Gy]:"The signature index provided is out of bounds for the secp256r1 instruction.",[kT]:"The specified slot number was not found in the provided slot history.",[aT]:"Too many members: a maximum of 4 members are supported.",[RT]:"This transaction has expired. It must be executed within 3 minutes of approval.",[PT]:"This transaction has not yet reached the required approval threshold.",[WT]:"Missing transports.",[ET]:"Only the transaction creator or rent payer may close this transaction buffer.",[ef]:"Unauthorized: Only the admin account is allowed to perform this action.",[xT]:"Member is not part of the expected signers for this transaction."});function TM(e){return process.env.NODE_ENV!=="production"?Aa[e]:"Error message not available in production bundles."}function fM(e,r,t){return isProgramError(e,r,A,t)}var se=class extends Error{constructor(t,o,n){super(t);this.code=o;this.cause=n;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},Me=class extends se{constructor(r){super(`${r} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},ee=class extends se{constructor(r,t){super(`${r} not found.${t?` ${t}`:""}`,"NOT_FOUND");}},W=class extends se{constructor(r,t){super(r,"VALIDATION_ERROR",{field:t});}},q=class extends se{constructor(t,o,n){super(t,"NETWORK_ERROR",{statusCode:o,url:n});this.statusCode=o;this.url=n;}},xt=class extends se{constructor(t,o,n){super(`Operation "${t}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:n});this.attempts=o;this.lastError=n;}},It=class extends se{constructor(t,o,n){super(t,"PERMISSION_ERROR",{required:o,actual:n});this.required=o;this.actual=n;}};var je={Ed25519:1,Secp256r1:2};var cf=d.looseObject({publicKey:d.string(),walletAddress:d.string(),settingsIndexWithAddress:d.object({index:d.union([d.number(),d.bigint()])})}),af=d.object({devicePublicKey:d.string(),platform:d.enum(["web","ios","android"]),userAgent:d.string().optional(),browser:d.object({name:d.string().optional(),version:d.string().optional(),major:d.string().optional(),type:d.string().optional()}).optional(),engine:d.object({name:d.string().optional(),version:d.string().optional()}).optional(),cpu:d.object({architecture:d.string().optional()}).optional(),device:d.object({type:d.string().optional(),vendor:d.string().optional(),model:d.string().optional()}).optional(),os:d.object({name:d.string().optional(),version:d.string().optional()}).optional(),app:d.object({name:d.string().optional(),version:d.string().optional(),build:d.string().optional()}).optional(),display:d.object({screenWidth:d.number().optional(),screenHeight:d.number().optional(),viewportWidth:d.number().optional(),viewportHeight:d.number().optional(),devicePixelRatio:d.number().optional()}).optional(),locale:d.string().optional(),timezone:d.string().optional(),push:d.object({provider:d.enum(["expo","fcm","apns"]),token:d.string()}).optional(),website:d.string().optional(),nativeApp:d.string().optional(),createdAt:d.iso.datetime().optional()}).strict(),ga=d.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","transfer_intent","change_delegate","change_config"]),kM=d.object({transactionActionType:ga,transactionAddress:d.string(),transactionMessageBytes:d.array(d.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),uf=d.object({transactionActionType:ga,transactionAddress:d.string(),transactionMessageBytes:d.base64()}).strict(),la=d.object({phase:d.literal("start"),clientOrigin:d.url(),signer:d.string().optional(),rid:d.string(),validTill:d.number(),providerOrigin:d.string(),rpId:d.string(),data:d.object({type:d.literal("message"),payload:d.string(),requireTwoFactorAuthentication:d.boolean().default(false)}).strict()}).strict(),pa=d.object({phase:d.literal("start"),clientOrigin:d.url(),signer:d.string().optional(),rid:d.string(),validTill:d.number(),providerOrigin:d.string(),rpId:d.string(),data:d.object({type:d.literal("transaction"),payload:uf}).strict()}).strict(),ma=d.object({startRequest:d.union([la,pa]),authResponse:d.custom(),client:d.object({clientOrigin:d.url(),jws:d.string()}).strict(),device:d.object({jwk:d.base64(),jws:d.string(),deviceProfile:af}).strict(),user:cf}).strict(),ya=d.object({signer:d.string(),additionalInfo:d.looseObject({}).optional()}).strict(),df=d.object({slotHash:d.string(),slotNumber:d.string(),estimatedSlotHashExpiry:d.number(),originIndex:d.number(),crossOrigin:d.boolean(),transactionManagerAddress:d.string().optional()}).strict(),LM=d.object({phase:d.literal("complete"),data:d.object({type:d.literal("message"),payload:ya.extend(ma.shape).extend({startRequest:la,transactionManager:d.object({publicKey:d.string(),signature:d.string()}).optional()})}).strict()}).strict(),OM=d.object({phase:d.literal("complete"),data:d.object({type:d.literal("transaction"),payload:ya.extend(ma.shape).extend(df.shape).extend({startRequest:pa})}).strict()}).strict();var te={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},ce=class e{constructor(r){this.mask=r;}static fromPermissions(r){return new e(r.reduce((t,o)=>t|o,0))}static all(){return new e(Object.values(te).reduce((r,t)=>r|t,0))}static has(r,t){return (r.mask&t)===t}};var Dr=33,ae=class{_bn;constructor(r){typeof r=="string"?this._bn=new Uint8Array(getBase58Encoder().encode(r)):this._bn=new Uint8Array(r),this.validateKeyLength(this._bn);}validateKeyLength(r){if(r.length!==Dr)throw new Error(`Invalid public key length, expected ${Dr} bytes but got ${r.length}`)}toBase58(){return getBase58Decoder().decode(this.toBytes())}toTruncatedBuffer(){let r=this.toBuffer();return r.subarray(1,r.length)}toBuffer(){if(!this._bn)throw new Error("Invalid public key input");let r=this._bn;if(r.byteLength===Dr)return r;throw new Error("Invalid public key input")}toBytes(){let r=this.toBuffer();return new Uint8Array(r.buffer,r.byteOffset,r.byteLength)}toString(){return this.toBase58()}toJSON(){return this.toBase58()}},b=class extends ae{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(r,t){super(r),this.verifyArgs=t.verifyArgs,this.domainConfig=t.domainConfig,this.authData=t.authData,this.signature=t.signature,this.originIndex=t.originIndex,this.crossOrigin=t.crossOrigin,this.clientAndDeviceHash=t.clientAndDeviceHash,this.authResponse=t.authResponse;}};function lf(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function pf(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var fa=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(lf())],["addressTableLookups",getArrayCodec(pf())]]);function Sa(e){return fa.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(t=>({programAddressIndex:t.programAddressIndex,accountIndices:t.accountIndices??[],data:Array.from(t.data??[])})),addressTableLookups:e.version===0?e.addressTableLookups?.map(t=>({lookupTableAddress:t.lookupTableAddress,readonlyIndexes:t.readonlyIndexes,writableIndexes:t.writableIndexes}))??[]:[]})}function xa(e){let r=fa.decode(e);return {header:{numSignerAccounts:r.numSigners,numReadonlySignerAccounts:r.numSigners-r.numWritableSigners,numReadonlyNonSignerAccounts:r.accountKeys.length-r.numSigners-r.numWritableNonSigners},addressTableLookups:r.addressTableLookups.map(t=>({lookupTableAddress:t.lookupTableAddress,readonlyIndexes:t.readonlyIndexes.map(Number),writableIndexes:t.writableIndexes.map(Number),readableIndices:t.readonlyIndexes.map(Number),writableIndices:t.writableIndexes.map(Number)})),instructions:r.instructions.map(t=>({accountIndices:t.accountIndices.map(Number),data:new Uint8Array(t.data),programAddressIndex:t.programAddressIndex})),lifetimeToken:A,staticAccounts:r.accountKeys,version:0}}function Ia(e,r,t,o){if(e<r||e>t)throw new W(`${o} must be between ${r} and ${t} (inclusive), got ${e}`)}async function v(e){let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("user"),e instanceof ae?e.toTruncatedBuffer():getAddressEncoder().encode(e)]});return r}async function Re({rpIdHash:e,rpId:r}){if(!e)if(r)e=sha256(getUtf8Encoder().encode(r));else throw new W("Either rpId or rpIdHash must be provided");let[t]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("domain_config"),e]});return t}async function Dt(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("global_counter")]});return e}async function Ea(e,r,t){Ia(t,0,255,"buffer_index");let[o]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("transaction_buffer"),r instanceof ae?r.toTruncatedBuffer():getAddressEncoder().encode(r),getU8Encoder().encode(t)]});return o}async function ne(e){let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getAddressEncoder().encode(e),getUtf8Encoder().encode("vault")]});return r}async function ue(e){let[r]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("multi_wallet"),getU128Encoder().encode(e)]});return r}async function sR(e){let r=await ue(e);return await ne(r)}async function cR(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}var re={};function lR(){if(!re.solanaRpcEndpoint)throw new Me("RPC endpoint");return re.solanaRpcEndpoint}function Ye(){if(!re.lightProtocolRpc)throw new Me("Light Protocol RPC");return re.lightProtocolRpc}function L(){if(!re.solanaRpc)throw new Me("Solana RPC");return re.solanaRpc}function pR({rpcEndpoint:e,proverEndpoint:r,compressionApiEndpoint:t}){re.solanaRpcEndpoint=e,re.lightProtocolRpc=createRpc(e,t,r);let o=createSolanaRpc(e);re.solanaRpc=o;}function bt(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}function If(e){let r=new Uint8Array(e.length/2);for(let t=0;t<r.length;t++)r[t]=parseInt(e.slice(t*2,t*2+2),16);return r}function ba(e){let r=new Set(["type","challenge","origin","crossOrigin"]),t={};for(let n in e)r.has(n)||(t[n]=e[n]);if(Object.keys(t).length===0)return new Uint8Array([]);let o=JSON.stringify(t);return new Uint8Array(new TextEncoder().encode(o.slice(1,-1)))}function Ca(e,r){let t=[],o=0,n=new TextDecoder;for(let c=0;c<r;c++){if(o+2>e.length)throw new Error("MaxLengthExceeded");let i=e[o]|e[o+1]<<8;if(o+=2,o+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(o,o+i),s=n.decode(a);t.push(s),o+=i;}return t}function Ma(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let r=e[1],t=2;if(r>128){let O=r&127;t+=O;}if(e[t]!==2)throw new Error("Expected INTEGER for r");let o=e[t+1],n=t+2,c=e.slice(n,n+o);if(t=n+o,e[t]!==2)throw new Error("Expected INTEGER for s");let i=e[t+1],a=t+2,s=e.slice(a,a+i),u=c[0]===0&&c.length>32?c.slice(1):c,g=s[0]===0&&s.length>32?s.slice(1):s;if(u.length>32||g.length>32)throw new Error("r or s length > 32 bytes");let p=new Uint8Array(32);p.set(u,32-u.length);let m=p256.Point.CURVE().n>>1n,S=BigInt("0x"+bt(g)),x=(S>m?p256.Point.CURVE().n-S:S).toString(16).padStart(64,"0"),I=If(x);return new Uint8Array([...p,...I])}function Je(e){let r=z(e.response.clientDataJSON),t=z(e.response.authenticatorData),o=sha256(r);return new Uint8Array([...t,...o])}function UR(e){let r=decodeCBOR(e),t=p256.Point.fromAffine({x:BigInt("0x"+bt(r.get(-2))),y:BigInt("0x"+bt(r.get(-3)))});return getBase58Decoder().decode(t.toBytes(true))}function vR(e){let t=p256.Point.fromBytes(getBase58Encoder().encode(e)).toBytes(false),o=new Map;return o.set(1,2),o.set(3,-7),o.set(-1,1),o.set(-2,t.slice(1,33)),o.set(-3,t.slice(33,65)),new Uint8Array(encodeCBOR(o))}async function kR(e){let{authenticatorData:r,clientDataJSON:t,signature:o}=e.authResponse.response,n=z(r),c=JSON.parse(getUtf8Decoder().decode(z(t))),i=ba(c),a=Ma(z(o)),s=await Re({rpIdHash:n.subarray(0,32)});return new b(e.signer,{verifyArgs:{clientDataJson:z(t),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:Mr(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:s,authData:n,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function Mr(e,r,t){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(r),...getBase64Encoder().encode(t)]))}function LR(e){return sha256(getUtf8Encoder().encode(canonicalize(e)))}function OR(e){return Rr(e.data.payload.authResponse)}function WR(e,r,t,o){let n=Mr(r,t,o);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...n]))}async function BR(e,r,t,o,n,c,i){let a;if(!n||!c||!i){let p=(await L().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!p)throw new ee("Slot sysvar","Unable to fetch slot sysvar data");let m=getBase64Encoder().encode(p[0]);c=getU64Decoder().decode(m.subarray(0,8)).toString(),a=m.subarray(8,40),n=getBase58Decoder().decode(a),i=Date.now()+512*400;}else a=getBase58Encoder().encode(n);let s=sha256(typeof e.transactionMessageBytes=="string"?getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),u=Mr(r,t,o),g=sha256(new Uint8Array([...getUtf8Encoder().encode(e.transactionActionType),...getBase58Encoder().encode(e.transactionAddress),...s,...a,...u]));return {slotNumber:c,slotHash:n,challenge:g,estimatedSlotHashExpiry:i}}function NR(e,r){return new Uint8Array([...Je(e),...getUtf8Encoder().encode(canonicalize(r))])}function Rr(e){let r=Je(e);return sha256(r)}function wR(e){let r="";for(let o of e)r+=String.fromCharCode(o);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function z(e){let r=e.replace(/-/g,"+").replace(/_/g,"/"),t=(4-r.length%4)%4,o=r.padEnd(r.length+t,"="),n=atob(o),c=new ArrayBuffer(n.length),i=new Uint8Array(c);for(let a=0;a<n.length;a++)i[a]=n.charCodeAt(a);return i}async function FR(e,r){let{data:t}=await Fr(L(),e),n=Ca(t.origins,t.numOrigins).findIndex(c=>c===r);if(n===-1)throw new ee("Origin","Origin not found in domain config");return n}function GR(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function VR(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}function ZR(e,r){if(r.threshold>1)throw new W("Multi-signature transactions with threshold > 1 are not supported yet.");let t=r.members.find(s=>La(s.pubkey)===e);if(!t)throw new ee("Member",`Signer ${e} not found in settings`);let{permissions:o}=t;if(!o)throw new ee("Permissions","No permissions found for the current member");let n=ce.has(o,te.InitiateTransaction),c=ce.has(o,te.VoteTransaction),i=ce.has(o,te.ExecuteTransaction);if(n&&c&&i)return null;if(!c||!i)throw new It("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=r.members.find(s=>s.role===0);if(!a)throw new ee("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(La(a.pubkey))}}function Oa(e){let r=new URL(e);return r.protocol=r.protocol==="https:"?"wss:":"ws:",r.toString()}function he(e,r){let t=new q(e,void 0,r);return t.retryable=false,t}function vf(e){return e instanceof q?e.retryable!==false:e instanceof Error&&(e.message==="WebSocket connection failed"||e.message==="WebSocket connection timed out")}var Y=()=>{let e=new Error("Aborted");return e.name="AbortError",e};function Wa(e){return e instanceof Error&&e.name==="AbortError"}function Ie(e){if(e.aborted)throw Y();e.throwIfAborted?.();}function Pr(...e){let r=e.filter(n=>n!=null);if(r.length===0)return new AbortController().signal;if(r.length===1)return r[0];if(typeof AbortSignal<"u"&&"any"in AbortSignal)return AbortSignal.any(r);let t=new AbortController,o=()=>t.abort();for(let n of r){if(n.aborted){o();break}n.addEventListener("abort",o,{once:true});}return t.signal}function kf(e){return e<1e12?e*1e3:e}function Lf(e,r,t){return typeof e=="number"&&Number.isFinite(e)?kf(e):r!==null?r:Date.now()+t}function va(e,r){throw e instanceof q?e:new q(e instanceof Error?e.message:"Transaction manager request failed",void 0,r)}function Of(e,r,t){return r.aborted?Promise.reject(Y()):new Promise((o,n)=>{let c=new WebSocket(e),i=false,a=g=>{i||(i=true,s!==void 0&&clearTimeout(s),r.removeEventListener("abort",u),g());},s=t!==void 0?setTimeout(()=>{try{c.close();}catch{}a(()=>n(new Error("WebSocket connection timed out")));},t):void 0,u=()=>{try{c.close();}catch{}a(()=>n(Y()));};r.addEventListener("abort",u,{once:true}),c.onopen=()=>{if(r.aborted){try{c.close();}catch{}a(()=>n(Y()));return}a(()=>o(c));},c.onerror=()=>{a(()=>n(new Error("WebSocket connection failed")));},c.onclose=()=>{a(()=>n(new Error("WebSocket connection failed")));};})}async function Wf(e,r,t){return new Promise((o,n)=>{let c=false,i=false,a=()=>{e.removeEventListener("message",g),e.removeEventListener("error",p),e.removeEventListener("close",m),r.removeEventListener("abort",u);},s=S=>{c||(c=true,a(),S());},u=()=>{try{e.close();}catch{}s(()=>n(Y()));},g=S=>{if(r.aborted){s(()=>n(Y()));return}if(typeof S.data!="string")return;let f;try{f=JSON.parse(S.data);}catch{return}let x=f.event??"message";try{t(x,f.data)&&(i=!0,s(()=>o(!0)));}catch(I){s(()=>n(I));}},p=()=>s(()=>n(new q("Transaction manager request failed",0,e.url))),m=()=>s(()=>o(i));r.addEventListener("abort",u,{once:true}),e.addEventListener("message",g),e.addEventListener("error",p),e.addEventListener("close",m);})}var ka=(e,r)=>new Promise((t,o)=>{if(r.aborted)return o(Y());let n=()=>{clearTimeout(c),o(Y());},c=setTimeout(()=>{r.removeEventListener("abort",n),t();},e);r.addEventListener("abort",n,{once:true});});async function Bf(e){let{url:r,payload:t,expectedSignatureCount:o,callbacks:n,abortSignal:c,opts:i}=e,a=Pr(c),s=Oa(r),u=i?.maxAttempts??10,g=i?.retryDelayMs??400,p=i?.approvalPollMs??2e3,m=i?.defaultApprovalTimeoutMs??3e5,S=i?.connectionTimeoutMs??3e4;if(o===0)throw he("Transaction manager: no signatures requested",s);let f=null,x=0,I=()=>f!==null&&Date.now()<f;for(;;){if(Ie(a),f!==null&&Date.now()>=f)throw he("Transaction manager approval timed out",s);let O,N;try{if(O=await Of(s,a,S),Ie(a),O.send(t),await Wf(O,a,(X,K)=>{if(X==="error"){let V=typeof K=="object"&&K&&typeof K.error=="string"?K.error:"Unknown error";throw he(V,s)}if(X==="signatures"){let V=K.signatures;if(!V?.length)return !1;if(V.length!==o)throw he(`Transaction manager returned ${V.length} signature(s) but ${o} were expected`,s);return N=V,!0}if(X==="pending_transaction_approval"){let V=K.validTill;f=Lf(V,f,m),n?.onPendingApprovalsCallback?.(f);}return X==="transaction_approved"&&n?.onPendingApprovalsSuccess?.(),!1})){if(!N||N.length!==o)throw he("Transaction manager sent an invalid signatures event",s);return N}if(Ie(a),!I())throw new q("Transaction manager closed the connection before returning signatures",void 0,s)}catch(l){if(Wa(l))throw l;Ie(a),vf(l)||va(l,s),I()||(x++,x>=u&&va(l,s));}finally{try{O?.close();}catch{}}if(Ie(a),I()){let l=Math.min(p,f-Date.now());await ka(l>0?l:1,a);continue}if(x>0){await ka(g,a);continue}throw new q("Transaction manager: missing signatures",void 0,s)}}function XR(e){let{address:r,url:t,authResponses:o,transactionMessageBytes:n,onPendingApprovalsCallback:c,onPendingApprovalsSuccess:i,abortSignal:a,opts:s}=e,u=Pr(a),g=Oa(t),p=Promise.resolve();return u.aborted&&(p=Promise.reject(Y())),u.addEventListener("abort",()=>{p=Promise.reject(Y());},{once:true}),{address:r,async signTransactions(m,S){let f=Pr(u,S?.abortSignal);Ie(f);let x=p.then(async()=>{if(Ie(f),m.length===0)throw he("Transaction manager: no transactions to sign",g);let I=new Array(m.length);for(let l=0;l<m.length;l++)I[l]={transaction:getBase64Decoder().decode(getTransactionEncoder().encode(m[l])),transactionMessageBytes:n?getBase64Decoder().decode(n):void 0,authResponses:o};let O=JSON.stringify({type:"transaction",data:{publicKey:r.toString(),payload:I}});return (await Bf({url:t,payload:O,expectedSignatureCount:m.length,callbacks:{onPendingApprovalsCallback:c,onPendingApprovalsSuccess:i},abortSignal:f,opts:s})).map(l=>({[r]:getBase58Encoder().encode(l)}))});return p=x.catch(I=>{if(Wa(I))return Promise.reject(I)}),x}}}function La(e){return e.keyType===je.Ed25519?getBase58Decoder().decode(e.key.subarray(1,33)):getBase58Decoder().decode(e.key)}function $R(e){let r=e.map(c=>Be().encode(c)),t=4+r.reduce((c,i)=>c+i.length,0),o=new Uint8Array(t),n=0;o.set(getU32Encoder().encode(e.length),n),n+=4;for(let c of r)o.set(c,n),n+=c.length;return o}function QR(e){let r=0,[t,o]=getU32Decoder().read(e,r);r=o;let n=new Array(t);for(let c=0;c<t;c++){let i=Ne().read(e,r);n[c]=i[0],r=i[1];}if(r!==e.length)throw new W(`Trailing bytes detected: expected ${e.length} bytes but consumed ${r}`);return n}var _r=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"];function G(e,r=0){let t=e instanceof b?e:void 0,o=t?.verifyArgs&&r!==-1?some({signedMessageIndex:r,truncatedClientDataJson:t.verifyArgs.truncatedClientDataJson,slotNumber:t.verifyArgs.slotNumber,originIndex:t.originIndex,crossOrigin:t.crossOrigin,clientAndDeviceHash:t.clientAndDeviceHash}):none(),n=t?.domainConfig?t.domainConfig:void 0,c=t?.verifyArgs?t.signature:void 0,i=t?.authData&&t.verifyArgs.clientDataJson?Je(t.authResponse):void 0,a=t?.toBuffer();return {domainConfig:n,verifyArgs:o,signature:c,message:i,publicKey:a}}function Ue(e,r,t=[]){let o=[];for(let n of e)if(n instanceof b){let c=t.length,{domainConfig:i,verifyArgs:a,signature:s,publicKey:u,message:g}=G(n,c);if(g&&s&&u&&t.push({message:g,signature:s,publicKey:u}),i){let p=r.addPreAccounts([{address:i,role:AccountRole.READONLY}]).get(i)?.index;a.__option==="Some"&&p!==void 0&&o.push({__kind:"Secp256r1",fields:[{domainConfigIndex:p,verifyArgs:a.value}]});}}else {let c=r.addPreAccounts([{address:n.address,role:AccountRole.READONLY_SIGNER,signer:n}]).get(n.address)?.index;c!==void 0&&o.push({__kind:"Ed25519",fields:[c]});}return {secp256r1VerifyInput:t,transactionSyncSigners:o}}function oe(e){if(e instanceof ae)return {keyType:je.Secp256r1,key:e.toBytes()};{let r;try{r="address"in e?e.address:e;}catch{r=e;}return {keyType:je.Ed25519,key:new Uint8Array([0,...getAddressEncoder().encode(r)])}}}function Na(e){return e instanceof b?e.toString():e.address.toString()}function J(e){let r=new Set,t=[];for(let n of e)r.has(Na(n))||(t.push(n),r.add(Na(n)));let o=t.filter(n=>n instanceof b);if(o.length>1)throw new W(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return t}function wa({payer:e,tipAmount:r}){let t=_r[Math.floor(Math.random()*_r.length)];return getTransferSolInstruction({source:e,destination:address(t),amount:r})}var Ga=8,Va=1,zf=34,Kf=5,qf=Ga+Va,Ha=Ga+Va+32,jf=Ha+zf+Kf,Yf=20;async function TP(e,{member:r,credentialId:t}){let o=[{memcmp:{offset:BigInt(qf),encoding:"base64",bytes:getBase64Decoder().decode(getAddressEncoder().encode(e))}}];if(r)o.push({memcmp:{offset:BigInt(Ha),encoding:"base64",bytes:getBase64Decoder().decode(h().encode(oe(r)))}});else if(t)o.push({memcmp:{offset:BigInt(jf),encoding:"base64",bytes:getBase64Decoder().decode(z(t))}});else return null;let n=await L().getProgramAccounts(A,{filters:o,encoding:"base64"}).send();return n.length?n.map(c=>pt().decode(getBase64Encoder().encode(c.account.data[0])))[0]:null}async function fP(e){let r=(await ts(L(),await v(e))).data;if(r.role===1||r.role===0){let t=[];return (await L().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(Yf),encoding:"base64",bytes:getBase64Decoder().decode(h().encode(oe(e)))}}]}).send()).forEach(n=>{let c=ut().decode(getBase64Encoder().encode(n.account.data[0]));t.push({...c});}),t}else return await Promise.all(r.wallets.map(async t=>(await Bo(L(),await ue(t.index))).data))}async function UP({payer:e,rpId:r,origins:t,authority:o}){let n=await Re({rpId:r});return Is({origins:t,authority:o,payer:e,domainConfig:n,rpId:r,userAccount:await v(o.address),remainingAccounts:[]})}async function OP({payer:e}){let r=await Dt();return Us({payer:e,globalCounter:r})}async function wP({admin:e,rpId:r,disable:t}){let o=await Re({rpId:r});return qs({domainConfig:o,admin:e,disable:t,remainingAccounts:[]})}function Zf(e,r,t,o){let n=Xf(e,r),c=$f(e,r)&&t!==o;return n&&c?AccountRole.WRITABLE_SIGNER:n&&!c?AccountRole.WRITABLE:!n&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function Xf(e,r){let t=e.staticAccounts.length,{numSignerAccounts:o,numReadonlySignerAccounts:n,numReadonlyNonSignerAccounts:c}=e.header,i=o-n,a=t-o-c;return r>=t?false:r<i?true:r>=o?r-o<a:false}function $f(e,r){return r<e.header.numSignerAccounts}async function Rt({walletAddress:e,transactionMessageBytes:r,addressesByLookupTableAddress:t,additionalSigners:o}){let n=xa(r),c=t??(n.addressTableLookups?await fetchAddressesForLookupTables(n.addressTableLookups.map(a=>a.lookupTableAddress),L()):{}),i=[];i.push(...n.addressTableLookups?.map(a=>({role:AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,s]of n.staticAccounts.entries())i.push({address:s,role:Zf(n,a,s,e)});if(n.addressTableLookups)for(let a of n.addressTableLookups){let s=c[a.lookupTableAddress];if(!s)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let u of a.writableIndexes){let g=s[u];if(!g)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${u}`);i.push({address:g,role:AccountRole.WRITABLE});}for(let u of a.readonlyIndexes){let g=s[u];if(!g)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${u}`);i.push({address:g,role:AccountRole.READONLY});}}for(let a of o?.filter(s=>s.address!==e)??[]){let s=i.findIndex(u=>u.address===a.address);s===-1?i.push({address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}):i[s].role===AccountRole.READONLY||i[s].role===AccountRole.READONLY_SIGNER?i[s]={address:a.address,role:AccountRole.READONLY_SIGNER,signer:a}:(i[s].role===AccountRole.WRITABLE||i[s].role===AccountRole.WRITABLE_SIGNER)&&(i[s]={address:a.address,role:AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:n}}var ve=33,ke=64,kr=14,s1=2,c1=address("Secp256r1SigVerify1111111111111111111111111");function a1(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function i1(){return getStructDecoder([["signatureOffset",getU16Decoder()],["signatureInstructionIndex",getU16Decoder()],["publicKeyOffset",getU16Decoder()],["publicKeyInstructionIndex",getU16Decoder()],["messageDataOffset",getU16Decoder()],["messageDataSize",getU16Decoder()],["messageInstructionIndex",getU16Decoder()]])}function ja(){return createDecoder({read:(e,r=0)=>{let t=getU8Decoder().decode(e,r);r+=1;let o=getU8Decoder().decode(e,r);r+=1;let n=[],c=i1();for(let a=0;a<t;a++)n.push(c.decode(e,r)),r+=kr;let i=[];for(let a=0;a<t;a++){let s=fixDecoderSize(getBytesDecoder(),ve).decode(e,r);r+=ve;let u=fixDecoderSize(getBytesDecoder(),ke).decode(e,r);r+=ke;let g=n[a].messageDataSize,p=fixDecoderSize(getBytesDecoder(),g).decode(e,r);r+=g,i.push({publicKey:s,signature:u,message:p});}return [{numSignatures:t,padding:o,offsets:n,payload:i},r]}})}function Ya(){return createEncoder({getSizeFromValue:e=>{let r=kr*e.offsets.length,t=e.payload.reduce((o,n)=>o+ve+ke+n.message.length,0);return 2+r+t},write:(e,r,t=0)=>{t=getU8Encoder().write(e.numSignatures,r,t),t=getU8Encoder().write(e.padding,r,t);let o=a1();for(let n of e.offsets)t=o.write(n,r,t);for(let n of e.payload)t=fixEncoderSize(getBytesEncoder(),ve).write(n.publicKey,r,t),t=fixEncoderSize(getBytesEncoder(),ke).write(n.signature,r,t),t=getBytesEncoder().write(n.message,r,t);return t}})}function ZP(){return combineCodec(Ya(),ja())}function U(e,r){let t=e.length,o=s1+t*kr,n=[];for(let s=0;s<t;s++){let{message:u}=e[s],g=o,p=g+ve,m=p+ke;n.push({publicKeyOffset:g,publicKeyInstructionIndex:65535,signatureOffset:p,signatureInstructionIndex:65535,messageDataOffset:m,messageDataSize:u.length,messageInstructionIndex:65535}),o+=ve+ke+u.length;}let c=r?.programAddress??c1,i={numSignatures:t,padding:0,offsets:n,payload:e};return {accounts:[],programAddress:c,data:Ya().encode(i)}}function XP(e){return {programAddress:e.programAddress,accounts:{},data:ja().decode(e.data)}}async function Ja({settings:e,transactionBufferAddress:r,transactionMessageBytes:t,payer:o,addressesByLookupTableAddress:n,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a}){let s=await ne(e),{accountMetas:u,addressLookupTableAccounts:g}=await Rt({transactionMessageBytes:t,walletAddress:s,additionalSigners:i,addressesByLookupTableAddress:n}),p=[];return c.length>0&&p.push(U(c)),p.push(oa({transactionBuffer:r,payer:o.address,remainingAccounts:u,settings:e})),a&&p.push(wa({payer:o,tipAmount:a})),{instructions:p,addressLookupTableAccounts:g}}var Z=class{systemAccounts;nextPreIndex;preMap;nextPackedIndex;packedMap;outputTreeIndex;constructor(){this.systemAccounts=[],this.nextPreIndex=0,this.preMap=new Map,this.nextPackedIndex=0,this.packedMap=new Map,this.outputTreeIndex=-1;}addPreAccounts(r){for(let t of r)this.insertOrGet(t.address.toString(),t,false);return this.preMap}getAccountRole(r,t){return r?t?AccountRole.WRITABLE_SIGNER:AccountRole.READONLY_SIGNER:t?AccountRole.WRITABLE:AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...getLightSystemAccountMetasV2({selfProgram:new PublicKey(A.toString())}).map(r=>({address:address(r.pubkey.toString()),role:this.getAccountRole(r.isSigner,r.isWritable)})));}insertOrGet(r,t={address:address(r),role:AccountRole.WRITABLE},o=true){let n=o?this.packedMap:this.preMap;if(!n.has(r)){let c=o?this.nextPackedIndex++:this.nextPreIndex++;n.set(r,{index:c,accountMeta:t});}return n.get(r).index}packOutputTreeIndex(r){if(r.treeType===TreeType.StateV1)return this.insertOrGet(r.tree.toString());if(r.treeType===TreeType.StateV2)return this.insertOrGet(r.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let r=await Ye().getStateTreeInfos(),t=selectStateTreeInfo(r);return this.packOutputTreeIndex(t)}packTreeInfos(r,t){let o=[],n=[];for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());o.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let s=c.treeInfo.nextTreeInfo??c.treeInfo,u=this.packOutputTreeIndex(s);this.outputTreeIndex===-1&&(this.outputTreeIndex=u);}for(let c of t){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());n.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:o.length>0?{packedTreeInfos:o,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:n}}hashSetAccountsToMetas(r){return Array.from(r.entries()).sort((o,n)=>o[1].index-n[1].index).map(([,{accountMeta:o}])=>({...o}))}getOffsets(r){let t=r,o=t+this.systemAccounts.length;return [t,o]}toAccountMetas(){let r=this.hashSetAccountsToMetas(this.preMap),t=this.hashSetAccountsToMetas(this.packedMap),[o,n]=this.getOffsets(r.length);return {remainingAccounts:[...r,...this.systemAccounts,...t],systemOffset:o,packedOffset:n}}};async function $a({settings:e,transactionMessageBytes:r,additionalSigners:t,signers:o,addressesByLookupTableAddress:n,secp256r1VerifyInput:c=[]}){let i=J(o),a=await ne(e),[{accountMetas:s,addressLookupTableAccounts:u,transactionMessage:g}]=await Promise.all([Rt({transactionMessageBytes:r,walletAddress:a,additionalSigners:t,addressesByLookupTableAddress:n})]),p=new Z;p.addPreAccounts(s);let{secp256r1VerifyInput:m,transactionSyncSigners:S}=Ue(i,p,c),{remainingAccounts:f}=p.toAccountMetas(),x=[];m.length>0&&x.push(U(m));let I=g1(g,s);return x.push(da({signers:S,settings:e,...I,remainingAccounts:f})),{instructions:x,addressLookupTableAccounts:u}}function g1(e,r){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(t=>({...t,accountIndices:new Uint8Array(t.accountIndices??[]),data:t.data??[]})),addressTableLookups:e.addressTableLookups?.map(t=>({lookupTableAddressIndex:r.findIndex(o=>o.address===t.lookupTableAddress),writableIndexes:new Uint8Array(t.writableIndexes),readonlyIndexes:new Uint8Array(t.readonlyIndexes)}))??[]}}async function h_({settings:e,destination:r,signers:t,amount:o}){let n=J(t),c=await ne(e),{value:i}=await L().getAccountInfo(c,{encoding:"base64"}).send();if((i?.lamports??0)<BigInt(o))throw new W("Insufficient balance for native transfer.");let a=new Z,{secp256r1VerifyInput:s,transactionSyncSigners:u}=Ue(n,a),{remainingAccounts:g}=a.toAccountMetas(),p=[];return s.length>0&&p.push(U(s)),p.push(pc({amount:o,signers:u,source:c,destination:r,settings:e,remainingAccounts:g})),p}var l1=3,p1=500,m1=2,y1=3e4,T1={backoffBase:m1,maxDelayMs:y1,retryOnRateLimit:true,initialDelayMs:p1,maxRetries:l1};function f1(e,r,t,o){let n=r*Math.pow(t,e-1);return Math.min(n,o)}function S1(e){return new Promise(r=>setTimeout(r,e))}async function Qa(e,r){let{maxRetries:t,initialDelayMs:o,backoffBase:n,maxDelayMs:c,shouldRetry:i}={...T1,...r},a;for(let s=1;s<=t;s++)try{return await e()}catch(u){if(a=u,i&&!i(u,s))throw u;if(s>=t)break;let g=f1(s,o,n,c);await S1(g);}throw new xt(e.name||"retryWithBackoff",t,a)}var M1=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),R1=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),_t=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function j_({settings:e,destination:r,mint:t,signers:o,amount:n,payer:c,tokenProgram:i,splInterfacePdaArgs:a={index:0,restricted:false}}){let s=J(o),u=await ne(e),g=await P1(t,r,u,i,a),p=await _1(g),m=h1(p,g,n),[S,f]=await Promise.all([O1(u,t,m.splBalance,m.cTokenBalance,BigInt(n)),L1(m.requireSplInterface,g.splInterfacePda)]),x=BigInt(S.reduce(($e,mi)=>$e+(mi.parsed.amount.toNumber()??0),0));if(m.splBalance+m.cTokenBalance+x<BigInt(n))throw new W("Insufficient balance for token transfer.");let I=new Z;f&&I.addPreAccounts([{address:t,role:AccountRole.WRITABLE}]);let O=U1(S),{proof:N}=await v1(I,O),l=k1(S,N,I),{secp256r1VerifyInput:X,transactionSyncSigners:K}=Ue(s,I),{remainingAccounts:V,systemOffset:de}=I.toAccountMetas(),Wr=w1(N,de),_=[];return X.length>0&&_.push(U(X)),_.push(Ec({settings:e,payer:c,source:u,sourceSplTokenAccount:g.sourceSplAta,sourceCtokenTokenAccount:g.sourceCtokenAta,destination:r,destinationSplTokenAccount:m.destinationSplTokenAccount,destinationCtokenTokenAccount:m.destinationCtokenTokenAccount,tokenProgram:i,mint:t,splInterfacePda:m.requireSplInterface?g.splInterfacePda:void 0,compressibleConfig:M1,rentSponsor:m.requireRentSponsor?R1:void 0,amount:n,signers:K,sourceCompressedTokenAccounts:l,compressedProofArgs:Wr,splInterfacePdaArgs:m.requireSplInterface?some(a):none(),remainingAccounts:V})),_}async function P1(e,r,t,o,n){let c=m=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(m),getAddressEncoder().encode(_t),getAddressEncoder().encode(e)],programAddress:_t}),i=[getUtf8Encoder().encode("pool"),getAddressEncoder().encode(e)];n.restricted&&i.push(getUtf8Encoder().encode("restricted")),n.index>0&&i.push(getU8Encoder().encode(n.index));let[a,[s],u,[g],[p]]=await Promise.all([findAssociatedTokenPda({mint:e,owner:t,tokenProgram:o}).then(([m])=>m),c(t),findAssociatedTokenPda({mint:e,owner:r,tokenProgram:o}).then(([m])=>m),c(r),getProgramDerivedAddress({seeds:i,programAddress:_t})]);return {sourceSplAta:a,sourceCtokenAta:s,destinationSplAta:u,destinationCTokenAta:g,splInterfacePda:p}}async function _1(e){let[r,t,o]=await Promise.all([L().getAccountInfo(e.destinationSplAta,{encoding:"base64"}).send(),L().getAccountInfo(e.sourceSplAta,{encoding:"base64"}).send(),L().getAccountInfo(e.sourceCtokenAta,{encoding:"base64"}).send()]);return {destinationSplAtaInfo:r,sourceSplAtaInfo:t,sourceCTokenAtaInfo:o}}function h1(e,r,t){let o=!!e.destinationSplAtaInfo.value,n=!!e.sourceSplAtaInfo.value,c=!!e.sourceCTokenAtaInfo.value,i=n?getTokenDecoder().decode(getBase64Encoder().encode(e.sourceSplAtaInfo.value.data[0])).amount:BigInt(0),a=BigInt(c?B1(getBase64Encoder().encode(e.sourceCTokenAtaInfo.value.data[0]))?.amount??0:0),s=o?r.destinationSplAta:void 0,u=o?void 0:r.destinationCTokenAta,g=n&&(i+a<BigInt(t)||a>BigInt(0)||!o)||!n&&o;return {splBalance:i,cTokenBalance:a,destinationSplTokenAccount:s,destinationCtokenTokenAccount:u,requireSplInterface:g,requireRentSponsor:i+a<BigInt(t)||!o}}function U1(e){let r=[];return e.forEach(t=>r.push({hash:t.compressedAccount.hash,tree:t.compressedAccount.treeInfo.tree,queue:t.compressedAccount.treeInfo.queue,data:t.compressedAccount.data,address:t.compressedAccount.address})),r}async function v1(e,r){let t=null;return r.length===0?{proof:t}:(await e.addSystemAccounts(),t=await F1(r,[]),{proof:t})}function k1(e,r,t){return !r||!e.length?[]:e.map(o=>({amount:o.parsed.amount.toNumber(),merkleContext:{leafIndex:o.compressedAccount.leafIndex,merkleTreePubkeyIndex:t.insertOrGet(o.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:t.insertOrGet(o.compressedAccount.treeInfo.queue.toString()),proveByIndex:o.compressedAccount.proveByIndex},rootIndex:r.rootIndices[0],version:N1(o.compressedAccount.data?.discriminator),tlv:o.parsed.tlv?some(getArrayDecoder(We()).decode(o.parsed.tlv)):none(),state:o.parsed.state}))}async function L1(e,r){if(!e)return false;let{value:t}=await L().getAccountInfo(r,{encoding:"base64"}).send();return !t}async function O1(e,r,t,o,n){let c=n-t-o;if(c<=0)return [];let a=(await Ye().getCompressedTokenAccountsByOwner(new PublicKey(e),{mint:new PublicKey(r)})).items.filter(u=>!!u.compressedAccount.data?.data.length&&u.compressedAccount.owner.toString()===_t.toString()&&!u.parsed.amount.isZero());return a.length===0?[]:W1(a,Number(c),4,{treeType:TreeType.StateV2})}function W1(e,r,t=4,o){let n=e.filter(u=>u.compressedAccount.treeInfo.treeType===o?.treeType);if(n.length===0)throw new Error("No accounts found");let c=0,i=0,a=0,s=[];n.sort((u,g)=>g.parsed.amount.cmp(u.parsed.amount));for(let u of n){if(s.length>=t||c>=r)break;(!u.parsed.amount.isZero()||!u.compressedAccount.lamports.isZero())&&(c=c+u.parsed.amount.toNumber(),i=i+u.compressedAccount.lamports.toNumber(),s.push(u));}if(a=n.slice(0,t).reduce((u,g)=>u+g.parsed.amount.toNumber(),0),s.length===0)throw new Error("No accounts found.");if(c<r){let u=n.reduce((g,p)=>g+p.parsed.amount.toNumber(),0);throw s.length>=t?new Error(`Account limit exceeded: max ${a.toString()} (${t} accounts) per transaction. Total balance: ${u.toString()} (${n.length} accounts). Consider multiple transfers to spend full balance.`):new Error(`Insufficient balance for transfer. Required: ${r.toString()}, available: ${u.toString()}.`)}if(s.length===0)throw new Error("No accounts found.");return s}function B1(e){if(!e||e.length===0)return null;try{return {amount:getU64Decoder().decode(e.slice(64,72))}}catch(r){return console.error("Token data parsing error:",r),null}}function N1(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let r=e[7];return r===3?2:3}function w1(e,r){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:r}}async function F1(e,r){return Qa(()=>Ye().getValidityProofV0(e,r))}function rh({signers:e,payer:r,changeConfigArgs:t}){let{settings:o,configActions:n,packedAccounts:c}=t,i=J(e),a=[],s=[];for(let p of i)if(p instanceof b){let m=s.length,{domainConfig:S,verifyArgs:f,signature:x,publicKey:I,message:O}=G(p,m);if(O&&x&&I&&s.push({message:O,signature:x,publicKey:I}),S){let N=c.addPreAccounts([{address:S,role:AccountRole.READONLY}]).get(S)?.index;f.__option==="Some"&&N!==void 0&&a.push({__kind:"Secp256r1",fields:[{domainConfigIndex:N,verifyArgs:f.value}]});}}else {let m=c.addPreAccounts([{address:p.address,role:AccountRole.READONLY_SIGNER,signer:p}]).get(p.address)?.index;m!==void 0&&a.push({__kind:"Ed25519",fields:[m]});}let{remainingAccounts:u}=c.toAccountMetas(),g=[];return s.length>0&&g.push(U(s)),g.push(As({settings:o,configActions:n,payer:r,remainingAccounts:u,signers:a})),g}async function gh({authority:e,payer:r,createUserArgs:t,domainConfig:o}){return Rs({payer:r,authority:e,member:Ge().decode(t.member.toBuffer()),credentialId:z(t.credentialId),transports:t.transports,role:t.role,domainConfig:o,settings:t.settings,transactionManagerAccount:t.transactionManagerAccount,userAccount:await v(t.member),remainingAccounts:[]})}async function Th({createUserArgs:e,payer:r}){return Os({payer:r,member:e.member,role:e.role,transactionManagerUrl:e.role===0?e.transactionManagerUrl:null,userAccount:await v(e.member.address),remainingAccounts:[]})}async function Eh({index:e,payer:r,initialMember:t}){return Fs({globalCounter:await Dt(),userAccount:await v(t.address),settingsIndex:e,settings:await ue(e),payer:r,initialMember:t,remainingAccounts:[]})}async function Rh({authority:e,domainConfig:r,newAuthority:t,newOrigins:o}){return $s({domainConfig:r,authority:e,newOrigins:o?some(o):none(),newAuthority:t,userAccount:t?await v(t.address):void 0,remainingAccounts:[]})}async function Uh({signer:e,transactionManagerUrl:r}){return nc({signer:e,transactionManagerAccount:await v(e.address),transactionManagerUrl:r,remainingAccounts:[]})}async function wh({payer:e,user:r,oldDelegate:t,newDelegate:o}){let n,c;t!==void 0&&(n=await ue(t)),o!==void 0&&(c=await ue(o));let{domainConfig:i,verifyArgs:a,message:s,signature:u,publicKey:g}=G(r),p=[];s&&u&&g&&p.push({message:s,signature:u,publicKey:g});let m=[];return p.length>0&&m.push(U(p)),m.push(dc({secp256r1VerifyArgs:a,domainConfig:i,delegateTo:o!==void 0?some(o):none(),feePayer:e,signer:r instanceof b?void 0:r,oldSettings:n,newSettings:c,userAccount:await v(r instanceof b?r:r.address),remainingAccounts:[]})),m}function Qh({closer:e,payer:r,settings:t,transactionBufferAddress:o}){let{domainConfig:n,verifyArgs:c,message:i,signature:a,publicKey:s}=G(e),u=[];return i&&a&&s&&u.push(U([{message:i,signature:a,publicKey:s}])),u.push(Pc({transactionBuffer:o,domainConfig:n,closer:e instanceof b?void 0:e,settings:t,payer:r,secp256r1VerifyArgs:c,remainingAccounts:[]})),u}function ai({payer:e,creator:r,bufferIndex:t,settings:o,transactionBufferAddress:n,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,expectedSigners:u}){let{domainConfig:g,verifyArgs:p,message:m,signature:S,publicKey:f}=G(r),x=[];return m&&S&&f&&x.push(U([{message:m,signature:S,publicKey:f}])),x.push(Lc({settings:o,transactionBuffer:n,payer:e,secp256r1VerifyArgs:p,creator:r instanceof b?void 0:r,domainConfig:g,bufferIndex:t,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u,remainingAccounts:[]})),x}function ii({executor:e,transactionBufferAddress:r,settings:t}){let{domainConfig:o,verifyArgs:n,signature:c,message:i,publicKey:a}=G(e),s=[];return i&&c&&a&&s.push(U([{message:i,signature:c,publicKey:a}])),s.push(Fc({settings:t,transactionBuffer:r,secp256r1VerifyArgs:n,domainConfig:o,executor:e instanceof b?void 0:e,remainingAccounts:[]})),s}function ui({transactionMessageBytes:e,transactionBufferAddress:r,settings:t}){return qc({transactionBuffer:r,buffer:e,settings:t,remainingAccounts:[]})}function di({settings:e,voter:r,transactionBufferAddress:t}){let{domainConfig:o,verifyArgs:n,signature:c,publicKey:i,message:a}=G(r),s=[];return a&&c&&i&&s.push(U([{message:a,signature:c,publicKey:i}])),s.push($c({settings:e,transactionBuffer:t,secp256r1VerifyArgs:n,domainConfig:o,voter:r instanceof b?void 0:r,remainingAccounts:[]})),s}async function wU({settings:e,configActionsArgs:r}){let t=new Z;return {configActions:await K1({configActionsArgs:r,packedAccounts:t}),settings:e,packedAccounts:t}}async function K1({configActionsArgs:e,packedAccounts:r}){let t=[];for(let o of e)switch(o.type){case "AddMembers":{let n=[];for(let c of o.members)r.addPreAccounts([{address:await v(c.member),role:AccountRole.WRITABLE}]),n.push(Y1({permissionArgs:c.permissions,pubkey:c.member}));t.push({__kind:o.type,fields:[n]});break}case "RemoveMembers":{let n=await Promise.all(o.members.map(async c=>(r.addPreAccounts([{address:await v(c.member),role:AccountRole.WRITABLE}]),j1({pubkey:c.member}))));t.push({__kind:o.type,fields:[n]});break}case "EditPermissions":{let n=o.members.map(c=>q1({permissionArgs:c.permissions,pubkey:c.member}));t.push({__kind:o.type,fields:[n]});break}default:t.push({__kind:o.type,fields:[o.threshold]});}return t}function q1({pubkey:e,permissionArgs:r}){return {memberKey:oe(e),permissions:gi(r)}}function j1({pubkey:e}){return {memberKey:oe(e)}}function Y1({pubkey:e,permissionArgs:r}){return {memberKey:oe(e),permissions:gi(r)}}function gi(e){let r=[];return e.initiate&&r.push(te.InitiateTransaction),e.vote&&r.push(te.VoteTransaction),e.execute&&r.push(te.ExecuteTransaction),ce.fromPermissions(r)}async function qU({payer:e,settings:r,transactionMessageBytes:t,creator:o,executor:n,secp256r1VerifyInput:c,jitoBundlesTipAmount:i,addressesByLookupTableAddress:a,additionalVoters:s=[],additionalSigners:u=[],chunkSize:g=Math.ceil(t.length/2)}){let p=Math.floor(Math.random()*255),m=await Ea(r,o instanceof b?o:o.address,p),S=[],f=[];for(let _=0;_<t.length;_+=g){let $e=t.subarray(_,_+g);S.push($e),f.push(sha256($e));}let x=sha256(t),I=J([o,...n?[n]:[],...s]).map(_=>({memberKey:oe(_),messageHash:_ instanceof b?Rr(_.authResponse):null})),O=ai({finalBufferHash:x,finalBufferSize:t.length,bufferIndex:p,payer:e,transactionBufferAddress:m,settings:r,creator:o,preauthorizeExecution:!n,bufferExtendHashes:f,expectedSigners:I}),N=S.map(_=>ui({transactionMessageBytes:_,transactionBufferAddress:m,settings:r})),l=s.map(_=>di({voter:_,transactionBufferAddress:m,settings:r})),X=ii({settings:r,executor:n,transactionBufferAddress:m}),{instructions:K,addressLookupTableAccounts:V}=await Ja({settings:r,transactionMessageBytes:t,transactionBufferAddress:m,payer:e,additionalSigners:u,secp256r1VerifyInput:c,jitoBundlesTipAmount:i,addressesByLookupTableAddress:a}),de=_=>({payer:e,instructions:_,addressesByLookupTableAddress:V});return [de(O),...N.map(_=>de([_])),...l.length?[de(l.flat())]:[],de(X),de(K)]}var Ut=class e{payer;keyMetaMap;constructor(r,t){this.payer=r,this.keyMetaMap=t;}static compile(r,t){let o=new Map,n=i=>{let a=o.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},o.set(i,a)),a},c=n(t);c.isSigner=true,c.isWritable=true;for(let i of r){n(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let s=n(a.address);s.isSigner||=a.role===AccountRole.READONLY_SIGNER||a.role===AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===AccountRole.WRITABLE||a.role===AccountRole.WRITABLE_SIGNER;}}return new e(t,o)}getMessageComponents(){let r=[...this.keyMetaMap.entries()];if(r.length>256)throw new Error("Max static account keys length exceeded");let t=r.filter(([,u])=>u.isSigner&&u.isWritable),o=r.filter(([,u])=>u.isSigner&&!u.isWritable),n=r.filter(([,u])=>!u.isSigner&&u.isWritable),c=r.filter(([,u])=>!u.isSigner&&!u.isWritable),i={numSignerAccounts:t.length+o.length,numReadonlySignerAccounts:o.length,numReadonlyNonSignerAccounts:c.length};if(t.length===0)throw new Error("Expected at least one writable signer key");let[a]=t[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let s=[...t.map(([u])=>u),...o.map(([u])=>u),...n.map(([u])=>u),...c.map(([u])=>u)];return [i,s]}extractTableLookup(r){let[t,o]=this.drainKeysFoundInLookupTable(r[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[n,c]=this.drainKeysFoundInLookupTable(r[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(t.length===0&&n.length===0))return {addressTableLookup:{lookupTableAddress:r[0],writableIndexes:t,readonlyIndexes:n},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(r,t){let o=new Array,n=new Array;for(let[c,i]of this.keyMetaMap.entries())if(t(i)){let a=c,s=r.findIndex(u=>u===a);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),n.push(a),this.keyMetaMap.delete(c);}}return [o,n]}};var vt=class{staticAccountKeys;accountKeysFromLookups;constructor(r,t){this.staticAccountKeys=r,this.accountKeysFromLookups=t;}keySegments(){let r=[this.staticAccountKeys];return this.accountKeysFromLookups&&(r.push(this.accountKeysFromLookups.writable),r.push(this.accountKeysFromLookups.readonly)),r}get(r){for(let t of this.keySegments()){if(r<t.length)return t[r];r-=t.length;}}get length(){return this.keySegments().flat().length}compileInstructions(r){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let o=new Map;this.keySegments().flat().forEach((c,i)=>{o.set(c,i);});let n=c=>{let i=o.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return r.map(c=>({programAddressIndex:n(c.programAddress),accountIndices:c.accounts?.map(i=>n(i.address))??[],data:c.data}))}};function pi({payer:e,recentBlockhash:r,instructions:t,addressesByLookupTableAddress:o}){let n=Ut.compile(t,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(o??{});for(let m of a){let S=n.extractTableLookup(m);if(S!==void 0){let{addressTableLookup:f,drainedKeys:x}=S;c.push({readonlyIndexes:f.readonlyIndexes,readableIndices:f.readonlyIndexes,writableIndexes:f.writableIndexes,writableIndices:f.writableIndexes,lookupTableAddress:address(f.lookupTableAddress)}),i.writable.push(...x.writable),i.readonly.push(...x.readonly);}}let[s,u]=n.getMessageComponents(),p=new vt(u,i).compileInstructions(t);return {version:0,header:s,instructions:p,lifetimeToken:r,staticAccounts:u,addressTableLookups:c}}function sv({instructions:e,payer:r,addressesByLookupTableAddress:t}){let o=pi({instructions:e,payer:r,recentBlockhash:A,addressesByLookupTableAddress:t});return new Uint8Array(Sa(o))}async function dv({payer:e,settings:r,transactionMessageBytes:t,signers:o,additionalSigners:n,secp256r1VerifyInput:c,addressesByLookupTableAddress:i}){let{instructions:a,addressLookupTableAccounts:s}=await $a({settings:r,signers:o,additionalSigners:n,transactionMessageBytes:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i});return {payer:e,instructions:a,addressesByLookupTableAddress:s}}
2
+ export{kt as AccountState,ma as AuthenticationContextSchema,ya as BaseResponseSchema,is as CHANGE_CONFIG_DISCRIMINATOR,Ss as CREATE_DOMAIN_CONFIG_DISCRIMINATOR,bs as CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR,_s as CREATE_GLOBAL_COUNTER_DISCRIMINATOR,ks as CREATE_USER_ACCOUNT_DISCRIMINATOR,Ns as CREATE_WALLET_DISCRIMINATOR,LM as CompleteMessageRequestSchema,OM as CompleteTransactionRequestSchema,Hs as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,Br as DOMAIN_CONFIG_DISCRIMINATOR,af as DeviceProfileSchema,Js as EDIT_DOMAIN_CONFIG_DISCRIMINATOR,ec as EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR,ac as EDIT_USER_DELEGATE_DISCRIMINATOR,Hr as GLOBAL_COUNTER_DISCRIMINATOR,je as KeyType,mT as MULTI_WALLET_ERROR__ALREADY_DELEGATED,qy as MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH,OT as MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING,BT as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED,NT as MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING,QT as MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH,Jy as MULTI_WALLET_ERROR__DUPLICATE_MEMBER,Yy as MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED,cT as MULTI_WALLET_ERROR__EMPTY_MEMBERS,rT as MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH,jy as MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH,tT as MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH,bT as MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH,CT as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED,MT as MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH,FT as MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED,fT as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION,yT as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION,TT as MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION,AT as MULTI_WALLET_ERROR__INVALID_ACCOUNT,$T as MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX,oT as MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG,lT as MULTI_WALLET_ERROR__INVALID_ARGUMENTS,DT as MULTI_WALLET_ERROR__INVALID_BUFFER,GT as MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT,ST as MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS,dT as MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS,$y as MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG,Fy as MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION,Hy as MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY,wy as MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG,Vy as MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS,LT as MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER,vT as MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT,iT as MULTI_WALLET_ERROR__INVALID_THRESHOLD,XT as MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE,nT as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG,eT as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION,uT as MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE,nf as MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG,gT as MULTI_WALLET_ERROR__INVALID_USER_ROLE,tf as MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG,ZT as MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR,zy as MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE,hT as MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED,zT as MULTI_WALLET_ERROR__MEMBER_NOT_FOUND,pT as MULTI_WALLET_ERROR__MISSING_ACCOUNT,VT as MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS,jT as MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT,rf as MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT,JT as MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR,HT as MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS,sf as MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY,of as MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE,YT as MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA,UT as MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY,IT as MULTI_WALLET_ERROR__NO_SIGNER_FOUND,sT as MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED,Xy as MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED,Qy as MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED,wT as MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS,qT as MULTI_WALLET_ERROR__PAYER_MISMATCH,Zy as MULTI_WALLET_ERROR__PERMANENT_MEMBER,_T as MULTI_WALLET_ERROR__PROTECTED_ACCOUNT,Ky as MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH,KT as MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH,Gy as MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS,kT as MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND,aT as MULTI_WALLET_ERROR__TOO_MANY_MEMBERS,RT as MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED,PT as MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED,WT as MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING,ET as MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER,ef as MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY,xT as MULTI_WALLET_ERROR__UNEXPECTED_SIGNER,A as MULTI_WALLET_PROGRAM_ADDRESS,Wy as MultiWalletAccount,By as MultiWalletInstruction,gc as NATIVE_TRANSFER_INTENT_DISCRIMINATOR,te as Permission,ce as Permissions,Oo as SETTINGS_DISCRIMINATOR,ae as Secp256r1Key,b as SignedSecp256r1Key,la as StartMessageRequestSchema,pa as StartTransactionRequestSchema,xc as TOKEN_TRANSFER_INTENT_DISCRIMINATOR,Cc as TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR,Uc as TRANSACTION_BUFFER_CREATE_DISCRIMINATOR,Vo as TRANSACTION_BUFFER_DISCRIMINATOR,Bc as TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR,Hc as TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR,Jc as TRANSACTION_BUFFER_VOTE_DISCRIMINATOR,ta as TRANSACTION_EXECUTE_DISCRIMINATOR,aa as TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR,ga as TransactionActionTypeSchema,df as TransactionDetailsSchema,kM as TransactionPayloadSchema,uf as TransactionPayloadWithBase64MessageBytesSchema,Xn as Transports,Qo as USER_DISCRIMINATOR,cf as UserInfoSchema,be as UserRole,z as base64URLStringToBuffer,wR as bufferToBase64URLString,rh as changeConfig,Qh as closeTransactionBuffer,HS as configAction,VR as convertBase64StringToJWK,GR as convertJWKToBase64String,La as convertMemberKeyToString,vR as convertPubkeyCompressedToCose,UR as convertPubkeyCoseToCompressed,OR as createClientAuthorizationCompleteRequestChallenge,LR as createClientAuthorizationStartRequestChallenge,UP as createDomainConfig,gh as createDomainUserAccounts,OP as createGlobalCounter,WR as createMessageChallenge,ai as createTransactionBuffer,BR as createTransactionChallenge,XR as createTransactionManagerSigner,Th as createUserAccounts,Eh as createWallet,wr as decodeDomainConfig,Kr as decodeGlobalCounter,Wo as decodeSettings,zo as decodeTransactionBuffer,es as decodeUser,QR as deserializeConfigActions,wP as disableDomainConfig,Rh as editDomainConfig,Uh as editTransactionManagerUrl,wh as editUserDelegate,Ja as executeTransaction,ii as executeTransactionBuffer,$a as executeTransactionSync,ui as extendTransactionBuffer,rx as extensionStruct,Q1 as fetchAllDomainConfig,cS as fetchAllGlobalCounter,_i as fetchAllMaybeDomainConfig,Ki as fetchAllMaybeGlobalCounter,_g as fetchAllMaybeSettings,Jg as fetchAllMaybeTransactionBuffer,pl as fetchAllMaybeUser,iE as fetchAllSettings,fP as fetchAllSettingsAccountByMember,mE as fetchAllTransactionBuffer,IE as fetchAllUser,Fr as fetchDomainConfig,sS as fetchGlobalCounter,Pi as fetchMaybeDomainConfig,zi as fetchMaybeGlobalCounter,Pg as fetchMaybeSettings,Yg as fetchMaybeTransactionBuffer,ll as fetchMaybeUser,Bo as fetchSettings,Bf as fetchSignaturesFromTransactionManager,pE as fetchTransactionBuffer,ts as fetchUser,TP as fetchUserAccountByFilters,dS as getAccountStateCodec,Ot as getAccountStateDecoder,Lt as getAccountStateEncoder,TS as getAddMemberArgsCodec,wt as getAddMemberArgsDecoder,Nt as getAddMemberArgsEncoder,lS as getAdditionalMetadataCodec,Bt as getAdditionalMetadataDecoder,Wt as getAdditionalMetadataEncoder,wE as getChangeConfigDiscriminatorBytes,As as getChangeConfigInstruction,FE as getChangeConfigInstructionDataCodec,ds as getChangeConfigInstructionDataDecoder,us as getChangeConfigInstructionDataEncoder,Mr as getClientAndDeviceHash,xS as getCompiledInstructionCodec,Gt as getCompiledInstructionDecoder,Ft as getCompiledInstructionEncoder,DS as getCompressedOnlyExtensionCodec,Ht as getCompressedOnlyExtensionDecoder,Vt as getCompressedOnlyExtensionEncoder,MS as getCompressedProofCodec,Jt as getCompressedProofDecoder,Yt as getCompressedProofEncoder,hS as getCompressedTokenArgsCodec,Xt as getCompressedTokenArgsDecoder,Zt as getCompressedTokenArgsEncoder,LS as getCompressibleExtensionCodec,on as getCompressibleExtensionDecoder,rn as getCompressibleExtensionEncoder,NS as getCompressionInfoCodec,cn as getCompressionInfoDecoder,sn as getCompressionInfoEncoder,VS as getConfigActionCodec,Ne as getConfigActionDecoder,Be as getConfigActionEncoder,jE as getCreateDomainConfigDiscriminatorBytes,Is as getCreateDomainConfigInstruction,JE as getCreateDomainConfigInstructionAsync,YE as getCreateDomainConfigInstructionDataCodec,xs as getCreateDomainConfigInstructionDataDecoder,cr as getCreateDomainConfigInstructionDataEncoder,rD as getCreateDomainUserAccountDiscriminatorBytes,Rs as getCreateDomainUserAccountInstruction,oD as getCreateDomainUserAccountInstructionDataCodec,Ms as getCreateDomainUserAccountInstructionDataDecoder,Cs as getCreateDomainUserAccountInstructionDataEncoder,AD as getCreateGlobalCounterDiscriminatorBytes,lD as getCreateGlobalCounterInstruction,Us as getCreateGlobalCounterInstructionAsync,gD as getCreateGlobalCounterInstructionDataCodec,hs as getCreateGlobalCounterInstructionDataDecoder,ur as getCreateGlobalCounterInstructionDataEncoder,ID as getCreateUserAccountDiscriminatorBytes,Os as getCreateUserAccountInstruction,DD as getCreateUserAccountInstructionAsync,ED as getCreateUserAccountInstructionDataCodec,Ls as getCreateUserAccountInstructionDataDecoder,Ar as getCreateUserAccountInstructionDataEncoder,hD as getCreateWalletDiscriminatorBytes,Fs as getCreateWalletInstruction,vD as getCreateWalletInstructionAsync,UD as getCreateWalletInstructionDataCodec,ws as getCreateWalletInstructionDataDecoder,lr as getCreateWalletInstructionDataEncoder,NR as getDeviceMessageHash,wD as getDisableDomainConfigDiscriminatorBytes,qs as getDisableDomainConfigInstruction,FD as getDisableDomainConfigInstructionDataCodec,Ks as getDisableDomainConfigInstructionDataDecoder,zs as getDisableDomainConfigInstructionDataEncoder,Re as getDomainConfigAddress,$1 as getDomainConfigCodec,Nr as getDomainConfigDecoder,X1 as getDomainConfigDiscriminatorBytes,Ri as getDomainConfigEncoder,eS as getDomainConfigSize,jD as getEditDomainConfigDiscriminatorBytes,$s as getEditDomainConfigInstruction,YD as getEditDomainConfigInstructionDataCodec,Xs as getEditDomainConfigInstructionDataDecoder,Zs as getEditDomainConfigInstructionDataEncoder,YS as getEditMemberArgsCodec,mn as getEditMemberArgsDecoder,pn as getEditMemberArgsEncoder,tb as getEditTransactionManagerUrlDiscriminatorBytes,nc as getEditTransactionManagerUrlInstruction,rb as getEditTransactionManagerUrlInstructionAsync,nb as getEditTransactionManagerUrlInstructionDataCodec,tc as getEditTransactionManagerUrlInstructionDataDecoder,mr as getEditTransactionManagerUrlInstructionDataEncoder,Ab as getEditUserDelegateDiscriminatorBytes,dc as getEditUserDelegateInstruction,gb as getEditUserDelegateInstructionDataCodec,uc as getEditUserDelegateInstructionDataDecoder,ic as getEditUserDelegateInstructionDataEncoder,$S as getExpectedSignerCodec,Fe as getExpectedSignerDecoder,we as getExpectedSignerEncoder,nx as getExtensionStructCodec,We as getExtensionStructDecoder,$t as getExtensionStructEncoder,Dt as getGlobalCounterAddress,oS as getGlobalCounterCodec,zr as getGlobalCounterDecoder,rS as getGlobalCounterDiscriminatorBytes,Hi as getGlobalCounterEncoder,aS as getGlobalCounterSize,cR as getLightCpiSigner,Ye as getLightProtocolRpc,ix as getMemberCodec,Un as getMemberDecoder,hn as getMemberEncoder,Ax as getMemberKeyCodec,k as getMemberKeyDecoder,h as getMemberKeyEncoder,TM as getMultiWalletErrorMessage,xb as getNativeTransferIntentDiscriminatorBytes,pc as getNativeTransferIntentInstruction,Eb as getNativeTransferIntentInstructionAsync,Ib as getNativeTransferIntentInstructionDataCodec,lc as getNativeTransferIntentInstructionDataDecoder,yr as getNativeTransferIntentInstructionDataEncoder,FR as getOriginIndex,px as getPackedMerkleContextCodec,en as getPackedMerkleContextDecoder,Qt as getPackedMerkleContextEncoder,Tx as getPausableAccountExtensionCodec,Sn as getPausableAccountExtensionDecoder,fn as getPausableAccountExtensionEncoder,xx as getPermanentDelegateAccountExtensionCodec,In as getPermanentDelegateAccountExtensionDecoder,xn as getPermanentDelegateAccountExtensionEncoder,Dx as getPermissionsCodec,ge as getPermissionsDecoder,Ae as getPermissionsEncoder,Rx as getProofArgsCodec,kn as getProofArgsDecoder,vn as getProofArgsEncoder,Ux as getRemoveMemberArgsCodec,Tn as getRemoveMemberArgsDecoder,yn as getRemoveMemberArgsEncoder,Lx as getRentConfigCodec,An as getRentConfigDecoder,dn as getRentConfigEncoder,Rr as getSecp256r1MessageHash,Bx as getSecp256r1PubkeyCodec,Ge as getSecp256r1PubkeyDecoder,Wn as getSecp256r1PubkeyEncoder,i1 as getSecp256r1SignatureOffsetsDataDecoder,a1 as getSecp256r1SignatureOffsetsDataEncoder,Fx as getSecp256r1VerifyArgsCodec,F as getSecp256r1VerifyArgsDecoder,w as getSecp256r1VerifyArgsEncoder,zx as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,Nn as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,Bn as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,U as getSecp256r1VerifyInstruction,ZP as getSecp256r1VerifyInstructionDataCodec,ja as getSecp256r1VerifyInstructionDataDecoder,Ya as getSecp256r1VerifyInstructionDataEncoder,aE as getSettingsCodec,ut as getSettingsDecoder,cE as getSettingsDiscriminatorBytes,Rg as getSettingsEncoder,ue as getSettingsFromIndex,jx as getSettingsIndexWithDelegateInfoCodec,Fn as getSettingsIndexWithDelegateInfoDecoder,wn as getSettingsIndexWithDelegateInfoEncoder,kR as getSignedSecp256r1Key,L as getSolanaRpc,lR as getSolanaRpcEndpoint,Zx as getSplInterfacePdaArgsCodec,Vn as getSplInterfacePdaArgsDecoder,Gn as getSplInterfacePdaArgsEncoder,eI as getTokenMetadataCodec,Dn as getTokenMetadataDecoder,En as getTokenMetadataEncoder,hb as getTokenTransferIntentDiscriminatorBytes,Ec as getTokenTransferIntentInstruction,vb as getTokenTransferIntentInstructionAsync,Ub as getTokenTransferIntentInstructionDataCodec,Ic as getTokenTransferIntentInstructionDataDecoder,Tr as getTokenTransferIntentInstructionDataEncoder,Ea as getTransactionBufferAddress,Fb as getTransactionBufferCloseDiscriminatorBytes,Pc as getTransactionBufferCloseInstruction,Gb as getTransactionBufferCloseInstructionDataCodec,Rc as getTransactionBufferCloseInstructionDataDecoder,Mc as getTransactionBufferCloseInstructionDataEncoder,lE as getTransactionBufferCodec,Jb as getTransactionBufferCreateDiscriminatorBytes,Lc as getTransactionBufferCreateInstruction,Zb as getTransactionBufferCreateInstructionDataCodec,kc as getTransactionBufferCreateInstructionDataDecoder,vc as getTransactionBufferCreateInstructionDataEncoder,Ho as getTransactionBufferDecoder,gE as getTransactionBufferDiscriminatorBytes,jg as getTransactionBufferEncoder,oC as getTransactionBufferExecuteDiscriminatorBytes,Fc as getTransactionBufferExecuteInstruction,sC as getTransactionBufferExecuteInstructionDataCodec,wc as getTransactionBufferExecuteInstructionDataDecoder,Nc as getTransactionBufferExecuteInstructionDataEncoder,gC as getTransactionBufferExtendDiscriminatorBytes,qc as getTransactionBufferExtendInstruction,lC as getTransactionBufferExtendInstructionDataCodec,Kc as getTransactionBufferExtendInstructionDataDecoder,zc as getTransactionBufferExtendInstructionDataEncoder,IC as getTransactionBufferVoteDiscriminatorBytes,$c as getTransactionBufferVoteInstruction,EC as getTransactionBufferVoteInstructionDataCodec,Xc as getTransactionBufferVoteInstructionDataDecoder,Zc as getTransactionBufferVoteInstructionDataEncoder,_C as getTransactionExecuteDiscriminatorBytes,oa as getTransactionExecuteInstruction,hC as getTransactionExecuteInstructionDataCodec,ra as getTransactionExecuteInstructionDataDecoder,na as getTransactionExecuteInstructionDataEncoder,NC as getTransactionExecuteSyncDiscriminatorBytes,da as getTransactionExecuteSyncInstruction,wC as getTransactionExecuteSyncInstructionDataCodec,ua as getTransactionExecuteSyncInstructionDataDecoder,ia as getTransactionExecuteSyncInstructionDataEncoder,rI as getTransactionMessageAddressTableLookupCodec,Zn as getTransactionMessageAddressTableLookupDecoder,Jn as getTransactionMessageAddressTableLookupEncoder,aI as getTransactionSyncSignersCodec,Q as getTransactionSyncSignersDecoder,$ as getTransactionSyncSignersEncoder,gI as getTransferFeeAccountExtensionCodec,Cn as getTransferFeeAccountExtensionDecoder,bn as getTransferFeeAccountExtensionEncoder,mI as getTransferHookAccountExtensionCodec,Rn as getTransferHookAccountExtensionDecoder,Mn as getTransferHookAccountExtensionEncoder,fI as getTransportsCodec,He as getTransportsDecoder,Ve as getTransportsEncoder,v as getUserAddress,xE as getUserCodec,pt as getUserDecoder,SE as getUserDiscriminatorBytes,gl as getUserEncoder,II as getUserRoleCodec,fe as getUserRoleDecoder,Te as getUserRoleEncoder,N1 as getVersionFromDiscriminator,sR as getWalletAddressFromIndex,ne as getWalletAddressFromSettings,dM as identifyMultiWalletAccount,AM as identifyMultiWalletInstruction,pR as initialize,zS as isConfigAction,ox as isExtensionStruct,fM as isMultiWalletError,uI as isTransactionSyncSigners,h_ as nativeTransferIntent,GE as parseChangeConfigInstruction,ZE as parseCreateDomainConfigInstruction,sD as parseCreateDomainUserAccountInstruction,pD as parseCreateGlobalCounterInstruction,bD as parseCreateUserAccountInstruction,kD as parseCreateWalletInstruction,GD as parseDisableDomainConfigInstruction,JD as parseEditDomainConfigInstruction,ob as parseEditTransactionManagerUrlInstruction,lb as parseEditUserDelegateInstruction,Db as parseNativeTransferIntentInstruction,XP as parseSecp256r1VerifyInstruction,kb as parseTokenTransferIntentInstruction,Vb as parseTransactionBufferCloseInstruction,Xb as parseTransactionBufferCreateInstruction,cC as parseTransactionBufferExecuteInstruction,pC as parseTransactionBufferExtendInstruction,DC as parseTransactionBufferVoteInstruction,UC as parseTransactionExecuteInstruction,FC as parseTransactionExecuteSyncInstruction,wU as prepareChangeConfigArgs,qU as prepareTransactionBundle,sv as prepareTransactionMessage,dv as prepareTransactionSync,ZR as retrieveTransactionManager,$R as serializeConfigActions,j_ as tokenTransferIntent,iI as transactionSyncSigners,xa as vaultTransactionMessageDeserialize,Sa as vaultTransactionMessageSerialize,di as voteTransactionBuffer};//# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map