@revibase/core 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {getStructCodec,getU8Codec,getArrayCodec,getAddressCodec,address,fixEncoderSize,getBytesEncoder,transformEncoder,getStructEncoder,getAddressEncoder,getU8Encoder,getStructDecoder,fixDecoderSize,getAddressDecoder,getU8Decoder,getBytesDecoder,combineCodec,decodeAccount,assertAccountExists,fetchEncodedAccount,assertAccountsExist,fetchEncodedAccounts,getU128Encoder,getU128Decoder,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,createSolanaClient,getBase64Encoder,getBase64Decoder,getTransactionEncoder,createDecoder,createEncoder,AccountRole,some,none,upgradeRoleToSigner,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {sha256}from'@noble/hashes/sha2.js';import u from'zod';import {createRpc,TreeType,getLightSystemAccountMetasV2,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {p256}from'@noble/curves/nist.js';import {canonicalize}from'json-canonicalize';import {getAssociatedTokenAccountAddress,getTokenDecoder,getTransferSolInstruction}from'gill/programs';import {PublicKey}from'@solana/web3.js';var kr=new Uint8Array([201,232,212,229,59,241,106,197]);function H1(){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 z1(){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 K1(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 q1(){return 846}var Fr=new Uint8Array([42,206,176,58,175,129,130,233]);function J1(){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 Z1(){return combineCodec(Wi(),Gr())}function Vr(e){return decodeAccount(e,Gr())}async function X1(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 $1(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 Q1(){return 24}var ht=(t=>(t[t.Initialized=0]="Initialized",t[t.Frozen=1]="Frozen",t))(ht||{});function Ut(){return getEnumEncoder(ht)}function vt(){return getEnumDecoder(ht)}function nS(){return combineCodec(Ut(),vt())}function Lt(){return getStructEncoder([["key",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["value",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function kt(){return getStructDecoder([["key",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["value",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function sS(){return combineCodec(Lt(),kt())}function Ot(){return getStructEncoder([["memberKey",U()],["permissions",ae()]])}function Wt(){return getStructDecoder([["memberKey",k()],["permissions",ie()]])}function uS(){return combineCodec(Ot(),Wt())}function Bt(){return getStructEncoder([["programAddressIndex",getU8Encoder()],["accountIndices",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["data",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function Nt(){return getStructDecoder([["programAddressIndex",getU8Decoder()],["accountIndices",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["data",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function gS(){return combineCodec(Bt(),Nt())}function wt(){return getStructEncoder([["delegatedAmount",getU64Encoder()],["withheldTransferFee",getU64Encoder()],["isAta",getU8Encoder()]])}function Ft(){return getStructDecoder([["delegatedAmount",getU64Decoder()],["withheldTransferFee",getU64Decoder()],["isAta",getU8Decoder()]])}function mS(){return combineCodec(wt(),Ft())}function Kt(){return getStructEncoder([["a",fixEncoderSize(getBytesEncoder(),32)],["b",fixEncoderSize(getBytesEncoder(),64)],["c",fixEncoderSize(getBytesEncoder(),32)]])}function qt(){return getStructDecoder([["a",fixDecoderSize(getBytesDecoder(),32)],["b",fixDecoderSize(getBytesDecoder(),64)],["c",fixDecoderSize(getBytesDecoder(),32)]])}function fS(){return combineCodec(Kt(),qt())}function jt(){return getStructEncoder([["version",getU8Encoder()],["rootIndex",getU16Encoder()],["amount",getU64Encoder()],["merkleContext",Zt()],["tlv",getOptionEncoder(getArrayEncoder(Jt()))],["state",Ut()]])}function Yt(){return getStructDecoder([["version",getU8Decoder()],["rootIndex",getU16Decoder()],["amount",getU64Decoder()],["merkleContext",Xt()],["tlv",getOptionDecoder(getArrayDecoder(Le()))],["state",vt()]])}function ES(){return combineCodec(jt(),Yt())}function en(){return getStructEncoder([["decimalsOption",getU8Encoder()],["decimals",getU8Encoder()],["compressionOnly",getBooleanEncoder()],["isAta",getU8Encoder()],["info",nn()]])}function tn(){return getStructDecoder([["decimalsOption",getU8Decoder()],["decimals",getU8Decoder()],["compressionOnly",getBooleanDecoder()],["isAta",getU8Decoder()],["info",rn()]])}function MS(){return combineCodec(en(),tn())}function nn(){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",cn()]])}function rn(){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 hS(){return combineCodec(nn(),rn())}function ke(){return getDiscriminatedUnionEncoder([["EditPermissions",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(An())])]])],["AddMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(Ot())])]])],["RemoveMembers",getStructEncoder([["fields",getTupleEncoder([getArrayEncoder(ln())])]])],["SetThreshold",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])]])}function Oe(){return getDiscriminatedUnionDecoder([["EditPermissions",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(gn())])]])],["AddMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(Wt())])]])],["RemoveMembers",getStructDecoder([["fields",getTupleDecoder([getArrayDecoder(pn())])]])],["SetThreshold",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])]])}function kS(){return combineCodec(ke(),Oe())}function OS(e,r){return Array.isArray(r)?{__kind:e,fields:r}:{__kind:e,...r??{}}}function WS(e,r){return r.__kind===e}function An(){return getStructEncoder([["memberKey",U()],["permissions",ae()]])}function gn(){return getStructDecoder([["memberKey",k()],["permissions",ie()]])}function FS(){return combineCodec(An(),gn())}function We(){return getStructEncoder([["memberKey",U()],["messageHash",getOptionEncoder(fixEncoderSize(getBytesEncoder(),32))]])}function Be(){return getStructDecoder([["memberKey",k()],["messageHash",getOptionDecoder(fixDecoderSize(getBytesDecoder(),32))]])}function zS(){return combineCodec(We(),Be())}function Jt(){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([Sn()])]])],["Placeholder20",getUnitEncoder()],["Placeholder21",getUnitEncoder()],["Placeholder22",getUnitEncoder()],["Placeholder23",getUnitEncoder()],["Placeholder24",getUnitEncoder()],["Placeholder25",getUnitEncoder()],["Placeholder26",getUnitEncoder()],["PausableAccount",getStructEncoder([["fields",getTupleEncoder([mn()])]])],["PermanentDelegateAccount",getStructEncoder([["fields",getTupleEncoder([Tn()])]])],["TransferFeeAccount",getStructEncoder([["fields",getTupleEncoder([In()])]])],["TransferHookAccount",getStructEncoder([["fields",getTupleEncoder([Dn()])]])],["CompressedOnly",getStructEncoder([["fields",getTupleEncoder([wt()])]])],["Compressible",getStructEncoder([["fields",getTupleEncoder([en()])]])]])}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([xn()])]])],["Placeholder20",getUnitDecoder()],["Placeholder21",getUnitDecoder()],["Placeholder22",getUnitDecoder()],["Placeholder23",getUnitDecoder()],["Placeholder24",getUnitDecoder()],["Placeholder25",getUnitDecoder()],["Placeholder26",getUnitDecoder()],["PausableAccount",getStructDecoder([["fields",getTupleDecoder([yn()])]])],["PermanentDelegateAccount",getStructDecoder([["fields",getTupleDecoder([fn()])]])],["TransferFeeAccount",getStructDecoder([["fields",getTupleDecoder([En()])]])],["TransferHookAccount",getStructDecoder([["fields",getTupleDecoder([bn()])]])],["CompressedOnly",getStructDecoder([["fields",getTupleDecoder([Ft()])]])],["Compressible",getStructDecoder([["fields",getTupleDecoder([tn()])]])]])}function YS(){return combineCodec(Jt(),Le())}function JS(e,r){return Array.isArray(r)?{__kind:e,fields:r}:{__kind:e,...r??{}}}function ZS(e,r){return r.__kind===e}function Rn(){return getStructEncoder([["pubkey",U()],["role",getU8Encoder()],["permissions",ae()],["padding",getU8Encoder()],["isDelegate",getU8Encoder()]])}function Pn(){return getStructDecoder([["pubkey",k()],["role",getU8Decoder()],["permissions",ie()],["padding",getU8Decoder()],["isDelegate",getU8Decoder()]])}function ex(){return combineCodec(Rn(),Pn())}function U(){return getStructEncoder([["keyType",getU8Encoder()],["key",fixEncoderSize(getBytesEncoder(),33)]])}function k(){return getStructDecoder([["keyType",getU8Decoder()],["key",fixDecoderSize(getBytesDecoder(),33)]])}function rx(){return combineCodec(U(),k())}function Zt(){return getStructEncoder([["merkleTreePubkeyIndex",getU8Encoder()],["queuePubkeyIndex",getU8Encoder()],["leafIndex",getU32Encoder()],["proveByIndex",getBooleanEncoder()]])}function Xt(){return getStructDecoder([["merkleTreePubkeyIndex",getU8Decoder()],["queuePubkeyIndex",getU8Decoder()],["leafIndex",getU32Decoder()],["proveByIndex",getBooleanDecoder()]])}function cx(){return combineCodec(Zt(),Xt())}function mn(){return getStructEncoder([])}function yn(){return getStructDecoder([])}function ux(){return combineCodec(mn(),yn())}function Tn(){return getStructEncoder([])}function fn(){return getStructDecoder([])}function gx(){return combineCodec(Tn(),fn())}function ae(){return getStructEncoder([["mask",getU8Encoder()]])}function ie(){return getStructDecoder([["mask",getU8Decoder()]])}function mx(){return combineCodec(ae(),ie())}function _n(){return getStructEncoder([["proof",getOptionEncoder(Kt())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function hn(){return getStructDecoder([["proof",getOptionDecoder(qt())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function Sx(){return combineCodec(_n(),hn())}function ln(){return getStructEncoder([["memberKey",U()]])}function pn(){return getStructDecoder([["memberKey",k()]])}function Dx(){return combineCodec(ln(),pn())}function cn(){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 Mx(){return combineCodec(cn(),an())}function Ln(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Ne(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function _x(){return combineCodec(Ln(),Ne())}function B(){return getStructEncoder([["signedMessageIndex",getU8Encoder()],["slotNumber",getU64Encoder()],["originIndex",getU8Encoder()],["crossOrigin",getBooleanEncoder()],["truncatedClientDataJson",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["clientAndDeviceHash",fixEncoderSize(getBytesEncoder(),32)]])}function N(){return getStructDecoder([["signedMessageIndex",getU8Decoder()],["slotNumber",getU64Decoder()],["originIndex",getU8Decoder()],["crossOrigin",getBooleanDecoder()],["truncatedClientDataJson",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["clientAndDeviceHash",fixDecoderSize(getBytesDecoder(),32)]])}function vx(){return combineCodec(B(),N())}function kn(){return getStructEncoder([["verifyArgs",B()],["domainConfigIndex",getU8Encoder()]])}function On(){return getStructDecoder([["verifyArgs",N()],["domainConfigIndex",getU8Decoder()]])}function Wx(){return combineCodec(kn(),On())}function Wn(){return getStructEncoder([["index",getU128Encoder()],["isDelegate",getBooleanEncoder()]])}function Bn(){return getStructDecoder([["index",getU128Decoder()],["isDelegate",getBooleanDecoder()]])}function wx(){return combineCodec(Wn(),Bn())}function Nn(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function wn(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function Vx(){return combineCodec(Nn(),wn())}function Sn(){return getStructEncoder([["updateAuthority",getAddressEncoder()],["mint",getAddressEncoder()],["name",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["symbol",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["uri",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["additionalMetadata",getArrayEncoder(Lt())]])}function xn(){return getStructDecoder([["updateAuthority",getAddressDecoder()],["mint",getAddressDecoder()],["name",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["symbol",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["uri",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["additionalMetadata",getArrayDecoder(kt())]])}function qx(){return combineCodec(Sn(),xn())}function qn(){return getStructEncoder([["lookupTableAddressIndex",getU8Encoder()],["writableIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())],["readonlyIndexes",addEncoderSizePrefix(getBytesEncoder(),getU32Encoder())]])}function jn(){return getStructDecoder([["lookupTableAddressIndex",getU8Decoder()],["writableIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())],["readonlyIndexes",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function Jx(){return combineCodec(qn(),jn())}function J(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([kn()])]])]])}function Z(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([On()])]])]])}function Qx(){return combineCodec(J(),Z())}function eI(e,r){return Array.isArray(r)?{__kind:e,fields:r}:{__kind:e,...r??{}}}function tI(e,r){return r.__kind===e}function In(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function En(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function oI(){return combineCodec(In(),En())}function Dn(){return getStructEncoder([["transferring",getU8Encoder()]])}function bn(){return getStructDecoder([["transferring",getU8Decoder()]])}function aI(){return combineCodec(Dn(),bn())}var Yn=(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))(Yn||{});function we(){return getEnumEncoder(Yn)}function Fe(){return getEnumDecoder(Yn)}function dI(){return combineCodec(we(),Fe())}var Ie=(n=>(n[n.TransactionManager=0]="TransactionManager",n[n.Administrator=1]="Administrator",n[n.PermanentMember=2]="PermanentMember",n[n.Member=3]="Member",n))(Ie||{});function le(){return getEnumEncoder(Ie)}function pe(){return getEnumDecoder(Ie)}function lI(){return combineCodec(le(),pe())}var vo=new Uint8Array([223,179,163,190,177,224,67,173]);function $I(){return fixEncoderSize(getBytesEncoder(),8).encode(vo)}function xg(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["index",getU128Encoder()],["members",getArrayEncoder(Rn())],["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(Pn())],["threshold",getU8Decoder()],["multiWalletBump",getU8Decoder()],["bump",getU8Decoder()],["padding",getU8Decoder()],["latestSlotNumber",getU64Decoder()]])}function QI(){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 eE(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 oE(){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",U()],["executor",U()],["bufferExtendHashes",getArrayEncoder(fixEncoderSize(getBytesEncoder(),32))],["voters",getArrayEncoder(U())],["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",k()],["executor",k()],["bufferExtendHashes",getArrayDecoder(fixDecoderSize(getBytesDecoder(),32))],["voters",getArrayDecoder(k())],["expectedSigners",getArrayDecoder(Be())],["buffer",addDecoderSizePrefix(getBytesDecoder(),getU32Decoder())]])}function sE(){return combineCodec(Fg(),Fo())}function Go(e){return decodeAccount(e,Fo())}async function Vo(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 Xo=new Uint8Array([159,117,95,227,239,151,58,236]);function dE(){return fixEncoderSize(getBytesEncoder(),8).encode(Xo)}function sl(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),8)],["domainConfig",getOptionEncoder(getAddressEncoder())],["member",U()],["credentialId",getOptionEncoder(addEncoderSizePrefix(getBytesEncoder(),getU32Encoder()))],["transports",getOptionEncoder(getArrayEncoder(we()))],["wallets",getArrayEncoder(Wn())],["role",le()],["transactionManagerUrl",getOptionEncoder(addEncoderSizePrefix(getUtf8Encoder(),getU32Encoder()))],["bump",getU8Encoder()]]),e=>({...e,discriminator:Xo}))}function At(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),8)],["domainConfig",getOptionDecoder(getAddressDecoder())],["member",k()],["credentialId",getOptionDecoder(addDecoderSizePrefix(getBytesDecoder(),getU32Decoder()))],["transports",getOptionDecoder(getArrayDecoder(Fe()))],["wallets",getArrayDecoder(Bn())],["role",pe()],["transactionManagerUrl",getOptionDecoder(addDecoderSizePrefix(getUtf8Decoder(),getU32Decoder()))],["bump",getU8Decoder()]])}function AE(){return combineCodec(sl(),At())}function $o(e){return decodeAccount(e,At())}async function gt(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 $o(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=>$o(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 R(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:R(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(J())]]),e=>({...e,discriminator:ss}))}function as(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Oe())],["signers",getArrayDecoder(Z())]])}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 rr(){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(rr(),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(R(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:rr().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:rr().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",Ln()],["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 cr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)]]),e=>({...e,discriminator:Ms}))}function Rs(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)]])}function rD(){return combineCodec(cr(),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:cr().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:cr().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 ir(){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(ir(),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(R(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:ir().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:ir().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 dr(){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(dr(),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(R(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:dr().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:dr().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 gr(){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(gr(),$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(R(n.signer.value))]}));let a=y(i),s=T(t);return Object.freeze({accounts:[s(n.signer),s(n.transactionManagerAccount),...a],data:gr().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:gr().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(B())],["delegateTo",getOptionEncoder(getU128Encoder())]]),e=>({...e,discriminator:oc}))}function cc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(N())],["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 lr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(J())]]),e=>({...e,discriminator:uc}))}function dc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(Z())]])}function gb(){return combineCodec(lr(),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(R(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:lr().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:lr().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 pr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["splInterfacePdaArgs",getOptionEncoder(Nn())],["amount",getU64Encoder()],["sourceCompressedTokenAccounts",getArrayEncoder(jt())],["compressedProofArgs",getOptionEncoder(_n())],["signers",getArrayEncoder(J())]]),e=>({...e,discriminator:Tc}))}function fc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["splInterfacePdaArgs",getOptionDecoder(wn())],["amount",getU64Decoder()],["sourceCompressedTokenAccounts",getArrayDecoder(Yt())],["compressedProofArgs",getOptionDecoder(hn())],["signers",getArrayDecoder(Z())]])}function Eb(){return combineCodec(pr(),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(R(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(R(n.source.value)),getAddressEncoder().encode(R(n.tokenProgram.value)),getAddressEncoder().encode(R(n.mint.value))]})),n.sourceCtokenTokenAccount.value||(n.sourceCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(R(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(R(n.mint.value))]})),n.destinationSplTokenAccount.value||(n.destinationSplTokenAccount.value=await getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[getAddressEncoder().encode(R(n.destination.value)),getAddressEncoder().encode(R(n.tokenProgram.value)),getAddressEncoder().encode(R(n.mint.value))]})),n.destinationCtokenTokenAccount.value||(n.destinationCtokenTokenAccount.value=await getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[getAddressEncoder().encode(R(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(R(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:pr().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:pr().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(B())]]),e=>({...e,discriminator:Ec}))}function bc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(N())]])}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(B())]]),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(N())]])}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(B())]]),e=>({...e,discriminator:kc}))}function Wc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(N())]])}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(B())]]),e=>({...e,discriminator:qc}))}function Yc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["secp256r1VerifyArgs",getOptionDecoder(N())]])}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}},i=y({}),a=T(t);return Object.freeze({accounts:[a(n.settings),a(n.payer),a(n.transactionBuffer),...i],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(Bt())],["addressTableLookups",getArrayEncoder(qn())],["signers",getArrayEncoder(J())]]),e=>({...e,discriminator:oa}))}function ca(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["numSigners",getU8Decoder()],["numWritableSigners",getU8Decoder()],["numWritableNonSigners",getU8Decoder()],["numAccountKeys",getU8Decoder()],["instructions",getArrayDecoder(Nt())],["addressTableLookups",getArrayDecoder(jn())],["signers",getArrayDecoder(Z())]])}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=(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))(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);}},me=class extends te{constructor(r){super(`${r} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},X=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;}},ft=class extends te{constructor(t,o,n){super(`Operation "${t}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:n});this.attempts=o;this.lastError=n;}},St=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 bM=u.looseObject({publicKey:u.string(),walletAddress:u.string(),settingsIndexWithAddress:u.object({index:u.union([u.number(),u.bigint()])})}),QT=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"]),CM=u.object({transactionActionType:ua,transactionAddress:u.string(),transactionMessageBytes:u.array(u.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),ef=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:ef}).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:QT}).strict()}).strict(),la=u.object({signer:u.string(),additionalInfo:u.looseObject({}).optional()}).strict(),tf=u.object({slotHash:u.string(),slotNumber:u.string(),estimatedSlotHashExpiry:u.number(),originIndex:u.number(),crossOrigin:u.boolean()}).strict(),MM=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(),RM=u.object({phase:u.literal("complete"),data:u.object({type:u.literal("transaction"),payload:la.extend(ga.shape).extend(tf.shape).extend({startRequest:Aa})}).strict()}).strict();var $={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($).reduce((r,t)=>r|t,0))}static has(r,t){return (r.mask&t)===t}};var xr=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!==xr)throw new Error(`Invalid public key length, expected ${xr} 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===xr)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 of(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function sf(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var ma=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(of())],["addressTableLookups",getArrayCodec(sf())]]);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!=="legacy"?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 It(){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 Q(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 XM(e){let r=await se(e);return await Q(r)}async function $M(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}var V={};function oR(){if(!V.solanaRpcEndpoint)throw new me("RPC endpoint");return V.solanaRpcEndpoint}function Ke(){if(!V.lightProtocolRpc)throw new me("Light Protocol RPC");return V.lightProtocolRpc}function _(){if(!V.solanaRpc)throw new me("Solana RPC");return V.solanaRpc}function sR(){if(!V.sendAndConfirm)throw new me("Send and confirm transaction function");return V.sendAndConfirm}function cR({rpcEndpoint:e,proverEndpoint:r,compressionApiEndpoint:t}){V.solanaRpcEndpoint=e,V.lightProtocolRpc=createRpc(e,t,r);let{rpc:o,sendAndConfirmTransaction:n}=createSolanaClient({urlOrMoniker:e});V.solanaRpc=o,V.sendAndConfirm=n;}function Et(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}function lf(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 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 F=r&127;t+=F;}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 p=new Uint8Array(32);p.set(d,32-d.length);let m=p256.Point.CURVE().n>>1n,f=BigInt("0x"+Et(g)),M=(f>m?p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),P=lf(M);return new Uint8Array([...p,...P])}function qe(e){let r=K(e.response.clientDataJSON),t=K(e.response.authenticatorData),o=sha256(r);return new Uint8Array([...t,...o])}function DR(e){let r=decodeCBOR(e),t=p256.Point.fromAffine({x:BigInt("0x"+Et(r.get(-2))),y:BigInt("0x"+Et(r.get(-3)))});return getBase58Decoder().decode(t.toBytes(true))}function bR(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 CR(e){let{authenticatorData:r,clientDataJSON:t,signature:o}=e.authResponse.response,n=K(r),c=JSON.parse(getUtf8Decoder().decode(K(t))),i=Ia(c),a=Da(K(o)),s=await be({rpIdHash:n.subarray(0,32)});return new I(e.signer.toString(),{verifyArgs:{clientDataJson:K(t),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:Dr(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 Dr(e,r,t){return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...getBase64Encoder().encode(r),...getBase64Encoder().encode(t)]))}function MR(e){return sha256(getUtf8Encoder().encode(canonicalize(e)))}function RR(e){return br(e.data.payload.authResponse)}function PR(e,r,t,o){let n=Dr(r,t,o);return sha256(new Uint8Array([...getUtf8Encoder().encode(e),...n]))}async function _R(e,r,t,o,n,c,i){let a;if(!n||!c||!i){let p=(await _().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!p)throw new X("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),d=Dr(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 hR(e,r){return new Uint8Array([...qe(e),...getUtf8Encoder().encode(canonicalize(r))])}function br(e){let r=qe(e);return sha256(r)}function UR(e){let r="";for(let o of e)r+=String.fromCharCode(o);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function K(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 vR(e,r){let{data:t}=await Br(_(),e),n=Ea(t.origins,t.numOrigins).findIndex(c=>c===r);if(n===-1)throw new X("Origin","Origin not found in domain config");return n}function LR(e){return getBase64Decoder().decode(getUtf8Encoder().encode(canonicalize(e)))}function kR(e){return JSON.parse(getUtf8Decoder().decode(getBase64Encoder().encode(e)))}function VR(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 X("Member",`Signer ${e} not found in settings`);let{permissions:o}=t;if(!o)throw new X("Permissions","No permissions found for the current member");let n=ne.has(o,$.InitiateTransaction),c=ne.has(o,$.VoteTransaction),i=ne.has(o,$.ExecuteTransaction);if(n&&c&&i)return null;if(!c||!i)throw new St("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 X("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(_a(a.pubkey))}}function bf(e){let r=new URL(e);return r.protocol==="https:"?r.protocol="wss:":r.protocol==="http:"&&(r.protocol="ws:"),r.toString()}function Cf(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 Mf(e,r,t){return new Promise((o,n)=>{let c=false,i=()=>{r.removeEventListener("abort",s),e.removeEventListener("message",d),e.removeEventListener("error",g),e.removeEventListener("close",p);},a=m=>{c||(c=true,i(),m());},s=()=>{try{e.close();}catch{}};r.addEventListener("abort",s);let d=m=>{if(typeof m.data!="string")return;let f;try{f=JSON.parse(m.data);}catch{return}let E=typeof f.event=="string"?f.event:"message",M=f.data;try{t(E,M)&&a(()=>o());}catch(P){a(()=>n(P));}},g=()=>{a(()=>n(new De("Transaction manager request failed",0,e.url)));},p=()=>{a(()=>o());};e.addEventListener("message",d),e.addEventListener("error",g),e.addEventListener("close",p);})}function Cr(e="Aborted"){let r=new Error(e);return r.name="AbortError",r}var Rf=(e,r)=>new Promise((t,o)=>{if(r.aborted)return o(Cr());let n=setTimeout(t,e);r.addEventListener("abort",()=>{clearTimeout(n),o(Cr());},{once:true});});function HR(e){let{address:r,url:t,authResponses:o,transactionMessageBytes:n,onPendingApprovalsCallback:c,onPendingApprovalsSuccess:i,abortController:a,opts:s}=e,d=a??new AbortController,g=s?.maxAttempts??10,p=s?.retryDelayMs??400;return {address:r,async signTransactions(m){let{signal:f}=d,E=bf(t),M=JSON.stringify({type:"transaction",data:{publicKey:r.toString(),payload:m.map(P=>({transaction:getBase64Decoder().decode(getTransactionEncoder().encode(P)),transactionMessageBytes:n?getBase64Decoder().decode(n):void 0,authResponses:o}))}});for(let P=0;P<g;P++){if(f.aborted)throw Cr();let F,G;try{G=await Cf(E,f),G.send(M),await Mf(G,f,(l,H)=>{if(l==="error"){let he=H&&typeof H=="object"&&typeof H.error=="string"?H.error:"Unknown error",xe=new Error(he);throw xe.noRetry=!0,xe}return l==="signatures"?(F=H.signatures,!0):(l==="pending_transaction_approval"?c?.(H.validTill):l==="transaction_approved"&&i?.(),!1)});}catch(l){if(l&&typeof l=="object"&&l.noRetry)throw new De(`${l.message}`);if(l&&typeof l=="object"&&l.name==="AbortError")throw l}finally{try{G?.close();}catch{}}if(F?.length)return F.map(l=>({[r]:getBase58Encoder().encode(l)}));P<g-1&&await Rf(p,f);}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 zR(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 KR(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 w(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}=w(n,c);if(g&&s&&d&&t.push({message:g,signature:s,publicKey:d}),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 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 j(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,Wf=34,Bf=5,Nf=ka+Oa,Wa=ka+Oa+32,wf=Wa+Wf+Bf,Ff=20;async function uP(e,{member:r,credentialId:t}){let o=[{memcmp:{offset:BigInt(Nf),encoding:"base58",bytes:e.toString()}}];if(r)o.push({memcmp:{offset:BigInt(Wa),encoding:"base58",bytes:getBase58Decoder().decode(U().encode(ee(r)))}});else if(t)o.push({memcmp:{offset:BigInt(wf),encoding:"base58",bytes:getBase58Decoder().decode(K(t))}});else return null;let n=await _().getProgramAccounts(A,{filters:o}).send();return n.length?n.map(c=>At().decode(getBase58Encoder().encode(c.account.data)))[0]:null}async function dP(e){let r=(await gt(_(),await v(e))).data;if(r.role===1||r.role===0){let t=[];return (await _().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(Ff),encoding:"base64",bytes:getBase64Decoder().decode(U().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=>ko(_(),await se(t.index))))}async function DP({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 RP({payer:e}){let r=await It();return Ps({payer:e,globalCounter:r})}async function UP({admin:e,rpId:r,disable:t}){let o=await be({rpId:r});return Hs({domainConfig:o,admin:e,disable:t,remainingAccounts:[]})}function Vf(e,r,t,o){let n=Hf(e,r),c=zf(e,r)&&t!==o;return n&&c?AccountRole.WRITABLE_SIGNER:n&&!c?AccountRole.WRITABLE:!n&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function Hf(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 zf(e,r){return r<e.header.numSignerAccounts}async function bt({walletAddress:e,transactionMessageBytes:r,addressesByLookupTableAddress:t,additionalSigners:o}){let n=Ta(r);if(n.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=t??(n.addressTableLookups?await fetchAddressesForLookupTables(n.addressTableLookups.map(a=>a.lookupTableAddress),_()):{}),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:Vf(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,Xf=2,$f=address("Secp256r1SigVerify1111111111111111111111111");function Qf(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function e1(){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=e1();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,p=fixDecoderSize(getBytesDecoder(),g).decode(e,r);r+=g,i.push({publicKey:s,signature:d,message:p});}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=Qf();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 VP(){return combineCodec(Ga(),Fa())}function L(e,r){let t=e.length,o=Xf+t*hr,n=[];for(let s=0;s<t;s++){let{message:d}=e[s],g=o,p=g+Pe,m=p+_e;n.push({publicKeyOffset:g,publicKeyInstructionIndex:65535,signatureOffset:p,signatureInstructionIndex:65535,messageDataOffset:m,messageDataSize:d.length,messageInstructionIndex:65535}),o+=Pe+_e+d.length;}let c=r?.programAddress??$f,i={numSignatures:t,padding:0,offsets:n,payload:e};return {accounts:[],programAddress:c,data:Ga().encode(i)}}function HP(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 Q(e),{accountMetas:d,addressLookupTableAccounts:g}=await bt({transactionMessageBytes:t,walletAddress:s,additionalSigners:i,addressesByLookupTableAddress:n}),p=[];return c.length>0&&p.push(L(c)),p.push(ta({transactionBuffer:r,payer:o.address,settings:e})),a&&p.push(va({payer:o,tipAmount:a})),{instructions:p,addressLookupTableAccounts:g}}var Y=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=j(o),a=await Q(e),[{accountMetas:s,addressLookupTableAccounts:d,transactionMessage:g}]=await Promise.all([bt({transactionMessageBytes:r,walletAddress:a,additionalSigners:t,addressesByLookupTableAddress:n})]),p=new Y;p.addPreAccounts(s);let{secp256r1VerifyInput:m,transactionSyncSigners:f}=Re(i,p,c),{remainingAccounts:E}=p.toAccountMetas(),M=[];m.length>0&&M.push(L(m));let P=o1(g,s);return M.push(aa({signers:f,settings:e,...P,remainingAccounts:E})),{instructions:M,addressLookupTableAccounts:d}}function o1(e,r){if(e.version==="legacy")throw new O("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(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 D_({settings:e,destination:r,signers:t,amount:o}){let n=j(t),c=await Q(e),{value:i}=await _().getAccountInfo(c,{encoding:"base64"}).send();if((i?.lamports??0)<BigInt(o))throw new O("Insufficient balance for native transfer.");let a=new Y,{secp256r1VerifyInput:s,transactionSyncSigners:d}=Re(n,a),{remainingAccounts:g}=a.toAccountMetas(),p=[];return s.length>0&&p.push(L(s)),p.push(Ac({amount:o,signers:d,source:c,destination:r,settings:e,remainingAccounts:g})),p}var s1=3,c1=500,a1=2,i1=3e4,u1={backoffBase:a1,maxDelayMs:i1,retryOnRateLimit:true,initialDelayMs:c1,maxRetries:s1};function d1(e,r,t,o){let n=r*Math.pow(t,e-1);return Math.min(n,o)}function A1(e){return new Promise(r=>setTimeout(r,e))}async function qa(e,r){let{maxRetries:t,initialDelayMs:o,backoffBase:n,maxDelayMs:c,shouldRetry:i}={...u1,...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=d1(s,o,n,c);await A1(g);}throw new ft(e.name||"retryWithBackoff",t,a)}var f1=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),S1=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Mt=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function F_({settings:e,destination:r,mint:t,signers:o,amount:n,payer:c,tokenProgram:i,splInterfacePdaArgs:a={index:0,restricted:false}}){let s=j(o),d=await Q(e),g=await x1(t,r,d,i,a),p=await I1(g),m=E1(p,g,n),[f,E]=await Promise.all([R1(d,t,m.splBalance,m.cTokenBalance,BigInt(n)),M1(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 P=new Y;E&&P.addPreAccounts([{address:t,role:AccountRole.WRITABLE}]);let F=D1(f),{proof:G}=await b1(P,F),l=C1(f,G,P),{secp256r1VerifyInput:H,transactionSyncSigners:he}=Re(s,P),{remainingAccounts:xe,systemOffset:ce}=P.toAccountMetas(),Lr=U1(G,ce),h=[];return H.length>0&&h.push(L(H)),h.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:f1,rentSponsor:m.requireRentSponsor?S1:void 0,amount:n,signers:he,sourceCompressedTokenAccounts:l,compressedProofArgs:Lr,splInterfacePdaArgs:m.requireSplInterface?some(a):none(),remainingAccounts:xe})),h}async function x1(e,r,t,o,n){let c=m=>getProgramDerivedAddress({seeds:[getAddressEncoder().encode(m),getAddressEncoder().encode(Mt),getAddressEncoder().encode(e)],programAddress:Mt}),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],[p]]=await Promise.all([getAssociatedTokenAccountAddress(e,t,o),c(t),getAssociatedTokenAccountAddress(e,r,o),c(r),getProgramDerivedAddress({seeds:i,programAddress:Mt})]);return {sourceSplAta:a,sourceCtokenAta:s,destinationSplAta:d,destinationCTokenAta:g,splInterfacePda:p}}async function I1(e){let[r,t,o]=await Promise.all([_().getAccountInfo(e.destinationSplAta,{encoding:"base64"}).send(),_().getAccountInfo(e.sourceSplAta,{encoding:"base64"}).send(),_().getAccountInfo(e.sourceCtokenAta,{encoding:"base64"}).send()]);return {destinationSplAtaInfo:r,sourceSplAtaInfo:t,sourceCTokenAtaInfo:o}}function E1(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?_1(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 D1(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 b1(e,r){let t=null;return r.length===0?{proof:t}:(await e.addSystemAccounts(),t=await v1(r,[]),{proof:t})}function C1(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:h1(o.compressedAccount.data?.discriminator),tlv:o.parsed.tlv?some(getArrayDecoder(Le()).decode(o.parsed.tlv)):none(),state:o.parsed.state}))}async function M1(e,r){if(!e)return false;let{value:t}=await _().getAccountInfo(r,{encoding:"base64"}).send();return !t}async function R1(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()===Mt.toString()&&!d.parsed.amount.isZero());return a.length===0?[]:P1(a,Number(c),4,{treeType:TreeType.StateV2})}function P1(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,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: ${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 _1(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 h1(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let r=e[7];return r===3?2:3}function U1(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 v1(e,r){return qa(()=>Ke().getValidityProofV0(e,r))}function Z_({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 I){let m=s.length,{domainConfig:f,verifyArgs:E,signature:M,publicKey:P,message:F}=w(p,m);if(F&&M&&P&&s.push({message:F,signature:M,publicKey:P}),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:p.address,role:AccountRole.READONLY_SIGNER,signer:p}]).get(p.address)?.index;m!==void 0&&a.push({__kind:"Ed25519",fields:[m]});}let{remainingAccounts:d}=c.toAccountMetas(),g=[];return s.length>0&&g.push(L(s)),g.push(is({settings:o,configActions:n,payer:r,remainingAccounts:d,signers:a})),g}async function sh({authority:e,payer:r,createUserArgs:t,domainConfig:o}){return bs({payer:r,authority:e,member:Ne().decode(t.member.toBuffer()),credentialId:K(t.credentialId),transports:t.transports,role:t.role,domainConfig:o,settings:t.settings,transactionManagerAccount:t.transactionManagerAccount,userAccount:await v(t.member),remainingAccounts:[]})}async function dh({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 mh({index:e,payer:r,initialMember:t}){return Bs({globalCounter:await It(),userAccount:await v(t.address),settingsIndex:e,settings:await se(e),payer:r,initialMember:t,remainingAccounts:[]})}async function xh({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 bh({signer:e,transactionManagerUrl:r}){return Qs({signer:e,transactionManagerAccount:await v(e.address),transactionManagerUrl:r,remainingAccounts:[]})}async function vh({payer:e,user:r,newDelegate:t}){let o=(await gt(_(),await v(r instanceof I?r:r.address))).data,n,c,i=o.wallets.find(E=>E.isDelegate);i&&(n=await se(i.index)),t!==void 0&&(c=await se(t));let{domainConfig:a,verifyArgs:s,message:d,signature:g,publicKey:p}=w(r),m=[];d&&g&&p&&m.push({message:d,signature:g,publicKey:p});let f=[];return m.length>0&&f.push(L(m)),f.push(ac({secp256r1VerifyArgs:s,domainConfig:a,delegateTo:t!==void 0?some(t):none(),feePayer:e,signer:r instanceof I?void 0:r,oldSettings:n,newSettings:c,userAccount:await v(r instanceof I?r:r.address),remainingAccounts:[]})),f}async function jh({closer:e,transactionBufferAddress:r}){let t=await Vo(_(),r),o=t.data.multiWalletSettings,{domainConfig:n,verifyArgs:c,message:i,signature:a,publicKey:s}=w(e),d=[];return i&&a&&s&&d.push(L([{message:i,signature:a,publicKey:s}])),d.push(Cc({transactionBuffer:r,domainConfig:n,closer:e instanceof I?void 0:e,settings:o,payer:t.data.payer,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:p,message:m,signature:f,publicKey:E}=w(r),M=[];return m&&f&&E&&M.push(L([{message:m,signature:f,publicKey:E}])),M.push(Uc({settings:o,transactionBuffer:n,payer:e,secp256r1VerifyArgs:p,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}=w(e),s=[];return i&&c&&a&&s.push(L([{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}=w(r),s=[];return a&&c&&i&&s.push(L([{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 LU({settings:e,configActionsArgs:r}){let t=new Y;return {configActions:await B1({configActionsArgs:r,packedAccounts:t}),settings:e,packedAccounts:t}}async function B1({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(F1({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}]),w1({pubkey:c.member}))));t.push({__kind:o.type,fields:[n]});break}case "EditPermissions":{let n=o.members.map(c=>N1({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 N1({pubkey:e,permissionArgs:r}){return {memberKey:ee(e),permissions:si(r)}}function w1({pubkey:e}){return {memberKey:ee(e)}}function F1({pubkey:e,permissionArgs:r}){return {memberKey:ee(e),permissions:si(r)}}function si(e){let r=[];return e.initiate&&r.push($.InitiateTransaction),e.vote&&r.push($.VoteTransaction),e.execute&&r.push($.ExecuteTransaction),ne.fromPermissions(r)}async function FU({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 p=Math.floor(Math.random()*255),m=await Sa(r,o instanceof I?o:o.address,p),f=[],E=[];for(let h=0;h<t.length;h+=g){let Je=t.subarray(h,h+g);f.push(Je),E.push(sha256(Je));}let M=sha256(t),P=j([o,...n?[n]:[],...s]).map(h=>({memberKey:ee(h),messageHash:h instanceof I?br(h.authResponse):null})),F=ei({finalBufferHash:M,finalBufferSize:t.length,bufferIndex:p,payer:e,transactionBufferAddress:m,settings:r,creator:o,preauthorizeExecution:!n,bufferExtendHashes:E,expectedSigners:P}),G=f.map(h=>ni({transactionMessageBytes:h,transactionBufferAddress:m,settings:r})),l=s.map(h=>ri({voter:h,transactionBufferAddress:m,settings:r})),H=ti({settings:r,executor:n,transactionBufferAddress:m}),{instructions:he,addressLookupTableAccounts:xe}=await Va({settings:r,transactionMessageBytes:t,transactionBufferAddress:m,payer:e,additionalSigners:d,secp256r1VerifyInput:c,jitoBundlesTipAmount:i,addressesByLookupTableAddress:a}),ce=h=>({payer:e,instructions:h,addressesByLookupTableAddress:xe});return [ce(F),...G.map(h=>ce([h])),...l.length?[ce(l.flat())]:[],ce(H),ce(he)]}var Pt=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 _t=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=Pt.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(),p=new _t(d,i).compileInstructions(t);return {version:0,header:s,instructions:p,lifetimeToken:r,staticAccounts:d,addressTableLookups:c}}function QU({instructions:e,payer:r,addressesByLookupTableAddress:t}){let o=ai({instructions:e,payer:r,recentBlockhash:A,addressesByLookupTableAddress:t});return new Uint8Array(ya(o))}async function ov({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{ht 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,MM as CompleteMessageRequestSchema,RM as CompleteTransactionRequestSchema,Fs as DISABLE_DOMAIN_CONFIG_DISCRIMINATOR,kr as DOMAIN_CONFIG_DISCRIMINATOR,QT 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,$ 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,tf as TransactionDetailsSchema,CM as TransactionPayloadSchema,ef as TransactionPayloadWithBase64MessageBytesSchema,Yn as Transports,Xo as USER_DISCRIMINATOR,bM as UserInfoSchema,Ie as UserRole,K as base64URLStringToBuffer,UR as bufferToBase64URLString,Z_ as changeConfig,jh as closeTransactionBuffer,OS as configAction,kR as convertBase64StringToJWK,LR as convertJWKToBase64String,_a as convertMemberKeyToString,bR as convertPubkeyCompressedToCose,DR as convertPubkeyCoseToCompressed,RR as createClientAuthorizationCompleteRequestChallenge,MR as createClientAuthorizationStartRequestChallenge,DP as createDomainConfig,sh as createDomainUserAccounts,RP as createGlobalCounter,PR as createMessageChallenge,ei as createTransactionBuffer,_R as createTransactionChallenge,HR as createTransactionManagerSigner,dh as createUserAccounts,mh as createWallet,Wr as decodeDomainConfig,Vr as decodeGlobalCounter,Lo as decodeSettings,Go as decodeTransactionBuffer,$o as decodeUser,KR as deserializeConfigActions,UP as disableDomainConfig,xh as editDomainConfig,bh as editTransactionManagerUrl,vh as editUserDelegate,Va as executeTransaction,ti as executeTransactionBuffer,Ka as executeTransactionSync,ni as extendTransactionBuffer,JS as extensionStruct,K1 as fetchAllDomainConfig,$1 as fetchAllGlobalCounter,Ei as fetchAllMaybeDomainConfig,Ni as fetchAllMaybeGlobalCounter,Eg as fetchAllMaybeSettings,Vg as fetchAllMaybeTransactionBuffer,al as fetchAllMaybeUser,eE as fetchAllSettings,dP as fetchAllSettingsAccountByMember,cE as fetchAllTransactionBuffer,gE as fetchAllUser,Br as fetchDomainConfig,X1 as fetchGlobalCounter,Ii as fetchMaybeDomainConfig,Bi as fetchMaybeGlobalCounter,Ig as fetchMaybeSettings,Gg as fetchMaybeTransactionBuffer,cl as fetchMaybeUser,ko as fetchSettings,Vo as fetchTransactionBuffer,gt as fetchUser,uP as fetchUserAccountByFilters,nS as getAccountStateCodec,vt as getAccountStateDecoder,Ut as getAccountStateEncoder,uS as getAddMemberArgsCodec,Wt as getAddMemberArgsDecoder,Ot as getAddMemberArgsEncoder,sS as getAdditionalMetadataCodec,kt as getAdditionalMetadataDecoder,Lt as getAdditionalMetadataEncoder,hE as getChangeConfigDiscriminatorBytes,is as getChangeConfigInstruction,UE as getChangeConfigInstructionDataCodec,as as getChangeConfigInstructionDataDecoder,cs as getChangeConfigInstructionDataEncoder,Dr as getClientAndDeviceHash,gS as getCompiledInstructionCodec,Nt as getCompiledInstructionDecoder,Bt as getCompiledInstructionEncoder,mS as getCompressedOnlyExtensionCodec,Ft as getCompressedOnlyExtensionDecoder,wt as getCompressedOnlyExtensionEncoder,fS as getCompressedProofCodec,qt as getCompressedProofDecoder,Kt as getCompressedProofEncoder,ES as getCompressedTokenArgsCodec,Yt as getCompressedTokenArgsDecoder,jt as getCompressedTokenArgsEncoder,MS as getCompressibleExtensionCodec,tn as getCompressibleExtensionDecoder,en as getCompressibleExtensionEncoder,hS as getCompressionInfoCodec,rn as getCompressionInfoDecoder,nn as getCompressionInfoEncoder,kS as getConfigActionCodec,Oe as getConfigActionDecoder,ke as getConfigActionEncoder,NE as getCreateDomainConfigDiscriminatorBytes,fs as getCreateDomainConfigInstruction,FE as getCreateDomainConfigInstructionAsync,wE as getCreateDomainConfigInstructionDataCodec,Ts as getCreateDomainConfigInstructionDataDecoder,rr 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,cr as getCreateGlobalCounterInstructionDataEncoder,gD as getCreateUserAccountDiscriminatorBytes,vs as getCreateUserAccountInstruction,pD as getCreateUserAccountInstructionAsync,lD as getCreateUserAccountInstructionDataCodec,Us as getCreateUserAccountInstructionDataDecoder,ir as getCreateUserAccountInstructionDataEncoder,ID as getCreateWalletDiscriminatorBytes,Bs as getCreateWalletInstruction,DD as getCreateWalletInstructionAsync,ED as getCreateWalletInstructionDataCodec,Ws as getCreateWalletInstructionDataDecoder,dr as getCreateWalletInstructionDataEncoder,hR as getDeviceMessageHash,hD as getDisableDomainConfigDiscriminatorBytes,Hs as getDisableDomainConfigInstruction,UD as getDisableDomainConfigInstructionDataCodec,Vs as getDisableDomainConfigInstructionDataDecoder,Gs as getDisableDomainConfigInstructionDataEncoder,be as getDomainConfigAddress,z1 as getDomainConfigCodec,Or as getDomainConfigDecoder,H1 as getDomainConfigDiscriminatorBytes,xi as getDomainConfigEncoder,q1 as getDomainConfigSize,ND as getEditDomainConfigDiscriminatorBytes,Js as getEditDomainConfigInstruction,wD as getEditDomainConfigInstructionDataCodec,Ys as getEditDomainConfigInstructionDataDecoder,js as getEditDomainConfigInstructionDataEncoder,FS as getEditMemberArgsCodec,gn as getEditMemberArgsDecoder,An as getEditMemberArgsEncoder,qD as getEditTransactionManagerUrlDiscriminatorBytes,Qs as getEditTransactionManagerUrlInstruction,YD as getEditTransactionManagerUrlInstructionAsync,jD as getEditTransactionManagerUrlInstructionDataCodec,$s as getEditTransactionManagerUrlInstructionDataDecoder,gr as getEditTransactionManagerUrlInstructionDataEncoder,nb as getEditUserDelegateDiscriminatorBytes,ac as getEditUserDelegateInstruction,rb as getEditUserDelegateInstructionDataCodec,cc as getEditUserDelegateInstructionDataDecoder,sc as getEditUserDelegateInstructionDataEncoder,zS as getExpectedSignerCodec,Be as getExpectedSignerDecoder,We as getExpectedSignerEncoder,YS as getExtensionStructCodec,Le as getExtensionStructDecoder,Jt as getExtensionStructEncoder,It as getGlobalCounterAddress,Z1 as getGlobalCounterCodec,Gr as getGlobalCounterDecoder,J1 as getGlobalCounterDiscriminatorBytes,Wi as getGlobalCounterEncoder,Q1 as getGlobalCounterSize,$M as getLightCpiSigner,Ke as getLightProtocolRpc,ex as getMemberCodec,Pn as getMemberDecoder,Rn as getMemberEncoder,rx as getMemberKeyCodec,k as getMemberKeyDecoder,U as getMemberKeyEncoder,iM as getMultiWalletErrorMessage,Ab as getNativeTransferIntentDiscriminatorBytes,Ac as getNativeTransferIntentInstruction,lb as getNativeTransferIntentInstructionAsync,gb as getNativeTransferIntentInstructionDataCodec,dc as getNativeTransferIntentInstructionDataDecoder,lr as getNativeTransferIntentInstructionDataEncoder,vR as getOriginIndex,cx as getPackedMerkleContextCodec,Xt as getPackedMerkleContextDecoder,Zt as getPackedMerkleContextEncoder,ux as getPausableAccountExtensionCodec,yn as getPausableAccountExtensionDecoder,mn as getPausableAccountExtensionEncoder,gx as getPermanentDelegateAccountExtensionCodec,fn as getPermanentDelegateAccountExtensionDecoder,Tn as getPermanentDelegateAccountExtensionEncoder,mx as getPermissionsCodec,ie as getPermissionsDecoder,ae as getPermissionsEncoder,Sx as getProofArgsCodec,hn as getProofArgsDecoder,_n as getProofArgsEncoder,Dx as getRemoveMemberArgsCodec,pn as getRemoveMemberArgsDecoder,ln as getRemoveMemberArgsEncoder,Mx as getRentConfigCodec,an as getRentConfigDecoder,cn as getRentConfigEncoder,br as getSecp256r1MessageHash,_x as getSecp256r1PubkeyCodec,Ne as getSecp256r1PubkeyDecoder,Ln as getSecp256r1PubkeyEncoder,e1 as getSecp256r1SignatureOffsetsDataDecoder,Qf as getSecp256r1SignatureOffsetsDataEncoder,vx as getSecp256r1VerifyArgsCodec,N as getSecp256r1VerifyArgsDecoder,B as getSecp256r1VerifyArgsEncoder,Wx as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,On as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,kn as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,L as getSecp256r1VerifyInstruction,VP as getSecp256r1VerifyInstructionDataCodec,Fa as getSecp256r1VerifyInstructionDataDecoder,Ga as getSecp256r1VerifyInstructionDataEncoder,sR as getSendAndConfirmTransaction,QI as getSettingsCodec,ct as getSettingsDecoder,$I as getSettingsDiscriminatorBytes,xg as getSettingsEncoder,se as getSettingsFromIndex,wx as getSettingsIndexWithDelegateInfoCodec,Bn as getSettingsIndexWithDelegateInfoDecoder,Wn as getSettingsIndexWithDelegateInfoEncoder,CR as getSignedSecp256r1Key,_ as getSolanaRpc,oR as getSolanaRpcEndpoint,Vx as getSplInterfacePdaArgsCodec,wn as getSplInterfacePdaArgsDecoder,Nn as getSplInterfacePdaArgsEncoder,qx as getTokenMetadataCodec,xn as getTokenMetadataDecoder,Sn as getTokenMetadataEncoder,Ib as getTokenTransferIntentDiscriminatorBytes,Sc as getTokenTransferIntentInstruction,Db as getTokenTransferIntentInstructionAsync,Eb as getTokenTransferIntentInstructionDataCodec,fc as getTokenTransferIntentInstructionDataDecoder,pr as getTokenTransferIntentInstructionDataEncoder,Sa as getTransactionBufferAddress,Ub as getTransactionBufferCloseDiscriminatorBytes,Cc as getTransactionBufferCloseInstruction,vb as getTransactionBufferCloseInstructionDataCodec,bc as getTransactionBufferCloseInstructionDataDecoder,Dc as getTransactionBufferCloseInstructionDataEncoder,sE as getTransactionBufferCodec,Fb as getTransactionBufferCreateDiscriminatorBytes,Uc as getTransactionBufferCreateInstruction,Gb as getTransactionBufferCreateInstructionDataCodec,hc as getTransactionBufferCreateInstructionDataDecoder,_c as getTransactionBufferCreateInstructionDataEncoder,Fo as getTransactionBufferDecoder,oE 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,Jx as getTransactionMessageAddressTableLookupCodec,jn as getTransactionMessageAddressTableLookupDecoder,qn as getTransactionMessageAddressTableLookupEncoder,Qx as getTransactionSyncSignersCodec,Z as getTransactionSyncSignersDecoder,J as getTransactionSyncSignersEncoder,oI as getTransferFeeAccountExtensionCodec,En as getTransferFeeAccountExtensionDecoder,In as getTransferFeeAccountExtensionEncoder,aI as getTransferHookAccountExtensionCodec,bn as getTransferHookAccountExtensionDecoder,Dn as getTransferHookAccountExtensionEncoder,dI as getTransportsCodec,Fe as getTransportsDecoder,we as getTransportsEncoder,v as getUserAddress,AE as getUserCodec,At as getUserDecoder,dE as getUserDiscriminatorBytes,sl as getUserEncoder,lI as getUserRoleCodec,pe as getUserRoleDecoder,le as getUserRoleEncoder,h1 as getVersionFromDiscriminator,XM as getWalletAddressFromIndex,Q as getWalletAddressFromSettings,tM as identifyMultiWalletAccount,nM as identifyMultiWalletInstruction,cR as initialize,WS as isConfigAction,ZS as isExtensionStruct,uM as isMultiWalletError,tI as isTransactionSyncSigners,D_ 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,HP 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,LU as prepareChangeConfigArgs,FU as prepareTransactionBundle,QU as prepareTransactionMessage,ov as prepareTransactionSync,VR as retrieveTransactionManager,zR as serializeConfigActions,F_ as tokenTransferIntent,eI 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,createSolanaClient,getBase64Encoder,getBase64Decoder,getTransactionEncoder,createDecoder,createEncoder,AccountRole,some,none,upgradeRoleToSigner,fetchAddressesForLookupTables,isTransactionSigner}from'gill';import {sha256}from'@noble/hashes/sha2.js';import d from'zod';import {createRpc,TreeType,getLightSystemAccountMetasV2,selectStateTreeInfo}from'@lightprotocol/stateless.js';import {decodeCBOR,encodeCBOR}from'@levischuck/tiny-cbor';import {p256}from'@noble/curves/nist.js';import {canonicalize}from'json-canonicalize';import {getAssociatedTokenAccountAddress,getTokenDecoder,getTransferSolInstruction}from'gill/programs';import {PublicKey}from'@solana/web3.js';var kr=new Uint8Array([201,232,212,229,59,241,106,197]);function G1(){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 V1(){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 H1(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 z1(){return 846}var Fr=new Uint8Array([42,206,176,58,175,129,130,233]);function j1(){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 Y1(){return combineCodec(Wi(),Gr())}function Vr(e){return decodeAccount(e,Gr())}async function J1(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 Z1(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 X1(){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 eS(){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 rS(){return combineCodec(kt(),Ot())}function Wt(){return getStructEncoder([["memberKey",h()],["permissions",ae()]])}function Bt(){return getStructDecoder([["memberKey",L()],["permissions",ie()]])}function aS(){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 dS(){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 lS(){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 yS(){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 xS(){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 bS(){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 PS(){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 vS(){return combineCodec(ke(),Oe())}function LS(e,r){return Array.isArray(r)?{__kind:e,fields:r}:{__kind:e,...r??{}}}function kS(e,r){return r.__kind===e}function gn(){return getStructEncoder([["memberKey",h()],["permissions",ae()]])}function ln(){return getStructDecoder([["memberKey",L()],["permissions",ie()]])}function NS(){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 VS(){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 qS(){return combineCodec(Zt(),Le())}function jS(e,r){return Array.isArray(r)?{__kind:e,fields:r}:{__kind:e,...r??{}}}function YS(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 $S(){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 tx(){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 ox(){return combineCodec(Xt(),$t())}function yn(){return getStructEncoder([])}function Tn(){return getStructDecoder([])}function ax(){return combineCodec(yn(),Tn())}function fn(){return getStructEncoder([])}function Sn(){return getStructDecoder([])}function dx(){return combineCodec(fn(),Sn())}function ae(){return getStructEncoder([["mask",getU8Encoder()]])}function ie(){return getStructDecoder([["mask",getU8Decoder()]])}function lx(){return combineCodec(ae(),ie())}function hn(){return getStructEncoder([["proof",getOptionEncoder(qt())],["lightCpiAccountsStartIndex",getU8Encoder()]])}function Un(){return getStructDecoder([["proof",getOptionDecoder(jt())],["lightCpiAccountsStartIndex",getU8Decoder()]])}function Tx(){return combineCodec(hn(),Un())}function pn(){return getStructEncoder([["memberKey",h()]])}function mn(){return getStructDecoder([["memberKey",L()]])}function Ix(){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 bx(){return combineCodec(an(),un())}function kn(){return getTupleEncoder([fixEncoderSize(getBytesEncoder(),33)])}function Ne(){return getTupleDecoder([fixDecoderSize(getBytesDecoder(),33)])}function Rx(){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 hx(){return combineCodec(N(),w())}function On(){return getStructEncoder([["verifyArgs",N()],["domainConfigIndex",getU8Encoder()]])}function Wn(){return getStructDecoder([["verifyArgs",w()],["domainConfigIndex",getU8Decoder()]])}function kx(){return combineCodec(On(),Wn())}function Bn(){return getStructEncoder([["index",getU128Encoder()],["isDelegate",getBooleanEncoder()]])}function Nn(){return getStructDecoder([["index",getU128Decoder()],["isDelegate",getBooleanDecoder()]])}function Bx(){return combineCodec(Bn(),Nn())}function wn(){return getStructEncoder([["index",getU8Encoder()],["restricted",getBooleanEncoder()]])}function Fn(){return getStructDecoder([["index",getU8Decoder()],["restricted",getBooleanDecoder()]])}function Fx(){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 zx(){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 jx(){return combineCodec(jn(),Yn())}function J(){return getDiscriminatedUnionEncoder([["Ed25519",getStructEncoder([["fields",getTupleEncoder([getU8Encoder()])]])],["Secp256r1",getStructEncoder([["fields",getTupleEncoder([On()])]])]])}function Z(){return getDiscriminatedUnionDecoder([["Ed25519",getStructDecoder([["fields",getTupleDecoder([getU8Decoder()])]])],["Secp256r1",getStructDecoder([["fields",getTupleDecoder([Wn()])]])]])}function Xx(){return combineCodec(J(),Z())}function $x(e,r){return Array.isArray(r)?{__kind:e,fields:r}:{__kind:e,...r??{}}}function Qx(e,r){return r.__kind===e}function En(){return getStructEncoder([["withheldAmount",getU64Encoder()]])}function Dn(){return getStructDecoder([["withheldAmount",getU64Decoder()]])}function nI(){return combineCodec(En(),Dn())}function bn(){return getStructEncoder([["transferring",getU8Encoder()]])}function Cn(){return getStructDecoder([["transferring",getU8Decoder()]])}function sI(){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 iI(){return combineCodec(we(),Fe())}var Ie=(n=>(n[n.TransactionManager=0]="TransactionManager",n[n.Administrator=1]="Administrator",n[n.PermanentMember=2]="PermanentMember",n[n.Member=3]="Member",n))(Ie||{});function le(){return getEnumEncoder(Ie)}function pe(){return getEnumDecoder(Ie)}function AI(){return combineCodec(le(),pe())}var vo=new Uint8Array([223,179,163,190,177,224,67,173]);function ZI(){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 XI(){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 $I(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 nE(){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 rE(){return combineCodec(Fg(),Fo())}function Go(e){return decodeAccount(e,Fo())}async function oE(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 sE(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 uE(){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 dE(){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 AE(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 _E(){return fixEncoderSize(getBytesEncoder(),1).encode(ss)}function cs(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["configActions",getArrayEncoder(ke())],["signers",getArrayEncoder(J())]]),e=>({...e,discriminator:ss}))}function as(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["configActions",getArrayDecoder(Oe())],["signers",getArrayDecoder(Z())]])}function hE(){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 UE(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 BE(){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 NE(){return combineCodec(or(),Ts())}async function wE(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 FE(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 jE(){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 YE(){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 JE(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 tD(){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 nD(){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 rD(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 oD(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 AD(){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 gD(){return combineCodec(ur(),Us())}async function lD(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 pD(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 xD(){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 ID(){return combineCodec(Ar(),Ws())}async function ED(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 DD(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 _D(){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 hD(){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 UD(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 BD(){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 ND(){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 wD(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 KD(){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 qD(){return combineCodec(lr(),$s())}async function jD(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 YD(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 tb(){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 nb(){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 rb(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 db(){return fixEncoderSize(getBytesEncoder(),1).encode(uc)}function pr(){return transformEncoder(getStructEncoder([["discriminator",fixEncoderSize(getBytesEncoder(),1)],["amount",getU64Encoder()],["signers",getArrayEncoder(J())]]),e=>({...e,discriminator:uc}))}function dc(){return getStructDecoder([["discriminator",fixDecoderSize(getBytesDecoder(),1)],["amount",getU64Decoder()],["signers",getArrayDecoder(Z())]])}function Ab(){return combineCodec(pr(),dc())}async function gb(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 lb(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 xb(){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(J())]]),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(Z())]])}function Ib(){return combineCodec(mr(),fc())}async function Eb(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 Db(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 hb(){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 Ub(){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 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:bc().decode(e.data)}}var Pc=new Uint8Array([9]);function wb(){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 Fb(){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 Gb(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 Yb(){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 Jb(){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 Zb(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 nC(){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 rC(){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 oC(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 AC(){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 gC(){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 lC(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 SC(){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 xC(){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 IC(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 PC(){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(J())]]),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(Z())]])}function _C(){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 hC(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 eM(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 tM(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 aM(e){return process.env.NODE_ENV!=="production"?ia[e]:"Error message not available in production bundles."}function iM(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);}},me=class extends te{constructor(r){super(`${r} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},X=class extends te{constructor(r,t){super(`${r} not found.${t?` ${t}`:""}`,"NOT_FOUND");}},k=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 DM=d.looseObject({publicKey:d.string(),walletAddress:d.string(),settingsIndexWithAddress:d.object({index:d.union([d.number(),d.bigint()])})}),QT=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(),ua=d.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","transfer_intent","change_delegate","change_config"]),bM=d.object({transactionActionType:ua,transactionAddress:d.string(),transactionMessageBytes:d.array(d.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),ef=d.object({transactionActionType:ua,transactionAddress:d.string(),transactionMessageBytes:d.base64()}).strict(),da=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(),Aa=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:ef}).strict()}).strict(),ga=d.object({startRequest:d.union([da,Aa]),authResponse:d.custom(),client:d.object({clientOrigin:d.url(),jws:d.string()}).strict(),device:d.object({jwk:d.base64(),jws:d.string(),deviceProfile:QT}).strict()}).strict(),la=d.object({signer:d.string(),additionalInfo:d.looseObject({}).optional()}).strict(),tf=d.object({slotHash:d.string(),slotNumber:d.string(),estimatedSlotHashExpiry:d.number(),originIndex:d.number(),crossOrigin:d.boolean()}).strict(),CM=d.object({phase:d.literal("complete"),data:d.object({type:d.literal("message"),payload:la.extend(ga.shape).extend({startRequest:da,transactionManager:d.object({publicKey:d.string(),signature:d.string()}).optional()})}).strict()}).strict(),MM=d.object({phase:d.literal("complete"),data:d.object({type:d.literal("transaction"),payload:la.extend(ga.shape).extend(tf.shape).extend({startRequest:Aa})}).strict()}).strict();var $={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($).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 of(){return getStructCodec([["programAddressIndex",getU8Codec()],["accountIndices",getArrayCodec(getU8Codec())],["data",getArrayCodec(getU8Codec())]])}function sf(){return getStructCodec([["lookupTableAddress",getAddressCodec()],["writableIndexes",getArrayCodec(getU8Codec())],["readonlyIndexes",getArrayCodec(getU8Codec())]])}var ma=getStructCodec([["numSigners",getU8Codec()],["numWritableSigners",getU8Codec()],["numWritableNonSigners",getU8Codec()],["accountKeys",getArrayCodec(getAddressCodec())],["instructions",getArrayCodec(of())],["addressTableLookups",getArrayCodec(sf())]]);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!=="legacy"?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 k(`${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 k("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 Q(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 Q(r)}async function XM(){let[e]=await getProgramDerivedAddress({programAddress:A,seeds:[getUtf8Encoder().encode("cpi_authority")]});return e}var G={};function rR(){if(!G.solanaRpcEndpoint)throw new me("RPC endpoint");return G.solanaRpcEndpoint}function Ke(){if(!G.lightProtocolRpc)throw new me("Light Protocol RPC");return G.lightProtocolRpc}function O(){if(!G.solanaRpc)throw new me("Solana RPC");return G.solanaRpc}function oR(){if(!G.sendAndConfirm)throw new me("Send and confirm transaction function");return G.sendAndConfirm}function sR({rpcEndpoint:e,proverEndpoint:r,compressionApiEndpoint:t}){G.solanaRpcEndpoint=e,G.lightProtocolRpc=createRpc(e,t,r);let{rpc:o,sendAndConfirmTransaction:n}=createSolanaClient({urlOrMoniker:e});G.solanaRpc=o,G.sendAndConfirm=n;}function It(e){return Array.from(e).map(r=>r.toString(16).padStart(2,"0")).join("")}function lf(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 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),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 l=new Uint8Array(32);l.set(u,32-u.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=lf(M);return new Uint8Array([...l,...R])}function qe(e){let r=K(e.response.clientDataJSON),t=K(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=K(r),c=JSON.parse(getUtf8Decoder().decode(K(t))),i=Ia(c),a=Da(K(o)),s=await be({rpIdHash:n.subarray(0,32)});return new I(e.signer.toString(),{verifyArgs:{clientDataJson:K(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 O().getAccountInfo(address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!l)throw new X("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),u=br(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 _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 K(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(O(),e),n=Ea(t.origins,t.numOrigins).findIndex(c=>c===r);if(n===-1)throw new X("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 k("Multi-signature transactions with threshold > 1 are not supported yet.");let t=r.members.find(s=>_a(s.pubkey)===e);if(!t)throw new X("Member",`Signer ${e} not found in settings`);let{permissions:o}=t;if(!o)throw new X("Permissions","No permissions found for the current member");let n=ne.has(o,$.InitiateTransaction),c=ne.has(o,$.VoteTransaction),i=ne.has(o,$.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 X("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:address(_a(a.pubkey))}}function bf(e){let r=new URL(e);return r.protocol=r.protocol==="https:"?"wss:":"ws:",r.toString()}function Cf(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 Mf(e,r,t){return new Promise((o,n)=>{let c=false,i=()=>{e.removeEventListener("message",u),e.removeEventListener("error",g),e.removeEventListener("close",l),r.removeEventListener("abort",s);},a=m=>{c||(c=true,i(),m());},s=()=>{try{e.close();}catch{}},u=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",u),e.addEventListener("error",g),e.addEventListener("close",l);})}var Dt=()=>{let e=new Error("Aborted");return e.name="AbortError",e},Rf=(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,u=a?.signal??new AbortController().signal,g=bf(t),l=s?.maxAttempts??10,m=s?.retryDelayMs??400;return {address:r,async signTransactions(f){if(u.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(u.aborted)throw Dt();let B,V;try{B=await Cf(g,u),B.send(M),await Mf(B,u,(p,H)=>{if(p==="error"){let he=typeof H=="object"&&H&&typeof H.error=="string"?H.error:"Unknown error",xe=new Error(he);throw xe.noRetry=!0,xe}return p==="signatures"?(V=H.signatures,!0):(p==="pending_transaction_approval"&&c?.(H.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(V?.length)return V.map(p=>({[r]:getBase58Encoder().encode(p)}));R<l-1&&await Rf(m,u);}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 k(`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:u,message:g}=F(n,c);if(g&&s&&u&&t.push({message:g,signature:s,publicKey:u}),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 j(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 k(`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,kf=34,Of=5,Wf=ka+Oa,Wa=ka+Oa+32,Bf=Wa+kf+Of,Nf=20;async function iP(e,{member:r,credentialId:t}){let o=[{memcmp:{offset:BigInt(Wf),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(Bf),encoding:"base64",bytes:getBase64Decoder().decode(K(t))}});else return null;let n=await O().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(O(),await v(e))).data;if(r.role===1||r.role===0){let t=[];return (await O().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(Nf),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(O(),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 Ff(e,r,t,o){let n=Gf(e,r),c=Vf(e,r)&&t!==o;return n&&c?AccountRole.WRITABLE_SIGNER:n&&!c?AccountRole.WRITABLE:!n&&c?AccountRole.READONLY_SIGNER:AccountRole.READONLY}function Gf(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 Vf(e,r){return r<e.header.numSignerAccounts}async function Ct({walletAddress:e,transactionMessageBytes:r,addressesByLookupTableAddress:t,additionalSigners:o}){let n=Ta(r);if(n.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=t??(n.addressTableLookups?await fetchAddressesForLookupTables(n.addressTableLookups.map(a=>a.lookupTableAddress),O()):{}),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:Ff(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 Pe=33,_e=64,hr=14,Jf=2,Zf=address("Secp256r1SigVerify1111111111111111111111111");function Xf(){return getStructEncoder([["signatureOffset",getU16Encoder()],["signatureInstructionIndex",getU16Encoder()],["publicKeyOffset",getU16Encoder()],["publicKeyInstructionIndex",getU16Encoder()],["messageDataOffset",getU16Encoder()],["messageDataSize",getU16Encoder()],["messageInstructionIndex",getU16Encoder()]])}function $f(){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=$f();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 u=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:u,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=Xf();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=Jf+t*hr,n=[];for(let s=0;s<t;s++){let{message:u}=e[s],g=o,l=g+Pe,m=l+_e;n.push({publicKeyOffset:g,publicKeyInstructionIndex:65535,signatureOffset:l,signatureInstructionIndex:65535,messageDataOffset:m,messageDataSize:u.length,messageInstructionIndex:65535}),o+=Pe+_e+u.length;}let c=r?.programAddress??Zf,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 Q(e),{accountMetas:u,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:u,settings:e})),a&&l.push(va({payer:o,tipAmount:a})),{instructions:l,addressLookupTableAccounts:g}}var Y=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,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 Ka({settings:e,transactionMessageBytes:r,additionalSigners:t,signers:o,addressesByLookupTableAddress:n,secp256r1VerifyInput:c=[]}){let i=j(o),a=await Q(e),[{accountMetas:s,addressLookupTableAccounts:u,transactionMessage:g}]=await Promise.all([Ct({transactionMessageBytes:r,walletAddress:a,additionalSigners:t,addressesByLookupTableAddress:n})]),l=new Y;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=n1(g,s);return M.push(aa({signers:f,settings:e,...R,remainingAccounts:E})),{instructions:M,addressLookupTableAccounts:u}}function n1(e,r){if(e.version==="legacy")throw new k("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(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 E_({settings:e,destination:r,signers:t,amount:o}){let n=j(t),c=await Q(e),{value:i}=await O().getAccountInfo(c,{encoding:"base64"}).send();if((i?.lamports??0)<BigInt(o))throw new k("Insufficient balance for native transfer.");let a=new Y,{secp256r1VerifyInput:s,transactionSyncSigners:u}=Re(n,a),{remainingAccounts:g}=a.toAccountMetas(),l=[];return s.length>0&&l.push(U(s)),l.push(Ac({amount:o,signers:u,source:c,destination:r,settings:e,remainingAccounts:g})),l}var r1=3,o1=500,s1=2,c1=3e4,a1={backoffBase:s1,maxDelayMs:c1,retryOnRateLimit:true,initialDelayMs:o1,maxRetries:r1};function i1(e,r,t,o){let n=r*Math.pow(t,e-1);return Math.min(n,o)}function u1(e){return new Promise(r=>setTimeout(r,e))}async function qa(e,r){let{maxRetries:t,initialDelayMs:o,backoffBase:n,maxDelayMs:c,shouldRetry:i}={...a1,...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=i1(s,o,n,c);await u1(g);}throw new Tt(e.name||"retryWithBackoff",t,a)}var y1=address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),T1=address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Rt=address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function w_({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 Q(e),g=await f1(t,r,u,i,a),l=await S1(g),m=x1(l,g,n),[f,E]=await Promise.all([C1(u,t,m.splBalance,m.cTokenBalance,BigInt(n)),b1(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 k("Insufficient balance for token transfer.");let R=new Y;E&&R.addPreAccounts([{address:t,role:AccountRole.WRITABLE}]);let B=I1(f),{proof:V}=await E1(R,B),p=D1(f,V,R),{secp256r1VerifyInput:H,transactionSyncSigners:he}=Re(s,R),{remainingAccounts:xe,systemOffset:ce}=R.toAccountMetas(),Lr=_1(V,ce),_=[];return H.length>0&&_.push(U(H)),_.push(Sc({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:y1,rentSponsor:m.requireRentSponsor?T1:void 0,amount:n,signers:he,sourceCompressedTokenAccounts:p,compressedProofArgs:Lr,splInterfacePdaArgs:m.requireSplInterface?some(a):none(),remainingAccounts:xe})),_}async function f1(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],u,[g],[l]]=await Promise.all([getAssociatedTokenAccountAddress(e,t,o),c(t),getAssociatedTokenAccountAddress(e,r,o),c(r),getProgramDerivedAddress({seeds:i,programAddress:Rt})]);return {sourceSplAta:a,sourceCtokenAta:s,destinationSplAta:u,destinationCTokenAta:g,splInterfacePda:l}}async function S1(e){let[r,t,o]=await Promise.all([O().getAccountInfo(e.destinationSplAta,{encoding:"base64"}).send(),O().getAccountInfo(e.sourceSplAta,{encoding:"base64"}).send(),O().getAccountInfo(e.sourceCtokenAta,{encoding:"base64"}).send()]);return {destinationSplAtaInfo:r,sourceSplAtaInfo:t,sourceCTokenAtaInfo:o}}function x1(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?R1(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 I1(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 E1(e,r){let t=null;return r.length===0?{proof:t}:(await e.addSystemAccounts(),t=await h1(r,[]),{proof:t})}function D1(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:P1(o.compressedAccount.data?.discriminator),tlv:o.parsed.tlv?some(getArrayDecoder(Le()).decode(o.parsed.tlv)):none(),state:o.parsed.state}))}async function b1(e,r){if(!e)return false;let{value:t}=await O().getAccountInfo(r,{encoding:"base64"}).send();return !t}async function C1(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(u=>!!u.compressedAccount.data?.data.length&&u.compressedAccount.owner.toString()===Rt.toString()&&!u.parsed.amount.isZero());return a.length===0?[]:M1(a,Number(c),4,{treeType:TreeType.StateV2})}function M1(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,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: ${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 R1(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 P1(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let r=e[7];return r===3?2:3}function _1(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 h1(e,r){return qa(()=>Ke().getValidityProofV0(e,r))}function J_({signers:e,payer:r,changeConfigArgs:t}){let{settings:o,configActions:n,packedAccounts:c}=t,i=j(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 V=c.addPreAccounts([{address:f,role:AccountRole.READONLY}]).get(f)?.index;E.__option==="Some"&&V!==void 0&&a.push({__kind:"Secp256r1",fields:[{domainConfigIndex:V,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:u}=c.toAccountMetas(),g=[];return s.length>0&&g.push(U(s)),g.push(is({settings:o,configActions:n,payer:r,remainingAccounts:u,signers:a})),g}async function oh({authority:e,payer:r,createUserArgs:t,domainConfig:o}){return bs({payer:r,authority:e,member:Ne().decode(t.member.toBuffer()),credentialId:K(t.credentialId),transports:t.transports,role:t.role,domainConfig:o,settings:t.settings,transactionManagerAccount:t.transactionManagerAccount,userAccount:await v(t.member),remainingAccounts:[]})}async function uh({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 ph({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 Sh({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 Dh({signer:e,transactionManagerUrl:r}){return Qs({signer:e,transactionManagerAccount:await v(e.address),transactionManagerUrl:r,remainingAccounts:[]})}async function Uh({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:u,publicKey:g}=F(r),l=[];s&&u&&g&&l.push({message:s,signature:u,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 Kh({closer:e,payer:r,settings:t,transactionBufferAddress:o}){let{domainConfig:n,verifyArgs:c,message:i,signature:a,publicKey:s}=F(e),u=[];return i&&a&&s&&u.push(U([{message:i,signature:a,publicKey:s}])),u.push(Cc({transactionBuffer:o,domainConfig:n,closer:e instanceof I?void 0:e,settings:t,payer:r,secp256r1VerifyArgs:c,remainingAccounts:[]})),u}function ei({payer:e,creator:r,bufferIndex:t,settings:o,transactionBufferAddress:n,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,expectedSigners:u}){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:u,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 UU({settings:e,configActionsArgs:r}){let t=new Y;return {configActions:await O1({configActionsArgs:r,packedAccounts:t}),settings:e,packedAccounts:t}}async function O1({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(N1({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}]),B1({pubkey:c.member}))));t.push({__kind:o.type,fields:[n]});break}case "EditPermissions":{let n=o.members.map(c=>W1({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 W1({pubkey:e,permissionArgs:r}){return {memberKey:ee(e),permissions:si(r)}}function B1({pubkey:e}){return {memberKey:ee(e)}}function N1({pubkey:e,permissionArgs:r}){return {memberKey:ee(e),permissions:si(r)}}function si(e){let r=[];return e.initiate&&r.push($.InitiateTransaction),e.vote&&r.push($.VoteTransaction),e.execute&&r.push($.ExecuteTransaction),ne.fromPermissions(r)}async function NU({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 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=j([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}),V=f.map(_=>ni({transactionMessageBytes:_,transactionBufferAddress:m,settings:r})),p=s.map(_=>ri({voter:_,transactionBufferAddress:m,settings:r})),H=ti({settings:r,executor:n,transactionBufferAddress:m}),{instructions:he,addressLookupTableAccounts:xe}=await Va({settings:r,transactionMessageBytes:t,transactionBufferAddress:m,payer:e,additionalSigners:u,secp256r1VerifyInput:c,jitoBundlesTipAmount:i,addressesByLookupTableAddress:a}),ce=_=>({payer:e,instructions:_,addressesByLookupTableAddress:xe});return [ce(B),...V.map(_=>ce([_])),...p.length?[ce(p.flat())]:[],ce(H),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(([,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 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,u]=n.getMessageComponents(),l=new ht(u,i).compileInstructions(t);return {version:0,header:s,instructions:l,lifetimeToken:r,staticAccounts:u,addressTableLookups:c}}function XU({instructions:e,payer:r,addressesByLookupTableAddress:t}){let o=ai({instructions:e,payer:r,recentBlockhash:A,addressesByLookupTableAddress:t});return new Uint8Array(ya(o))}async function nv({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,QT 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,$ 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,tf as TransactionDetailsSchema,bM as TransactionPayloadSchema,ef as TransactionPayloadWithBase64MessageBytesSchema,Jn as Transports,Zo as USER_DISCRIMINATOR,DM as UserInfoSchema,Ie as UserRole,K as base64URLStringToBuffer,hR as bufferToBase64URLString,J_ as changeConfig,Kh as closeTransactionBuffer,LS 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,oh as createDomainUserAccounts,MP as createGlobalCounter,RR as createMessageChallenge,ei as createTransactionBuffer,PR as createTransactionChallenge,VR as createTransactionManagerSigner,uh as createUserAccounts,ph as createWallet,Wr as decodeDomainConfig,Vr as decodeGlobalCounter,Lo as decodeSettings,Go as decodeTransactionBuffer,Xo as decodeUser,zR as deserializeConfigActions,hP as disableDomainConfig,Sh as editDomainConfig,Dh as editTransactionManagerUrl,Uh as editUserDelegate,Va as executeTransaction,ti as executeTransactionBuffer,Ka as executeTransactionSync,ni as extendTransactionBuffer,jS as extensionStruct,H1 as fetchAllDomainConfig,Z1 as fetchAllGlobalCounter,Ei as fetchAllMaybeDomainConfig,Ni as fetchAllMaybeGlobalCounter,Eg as fetchAllMaybeSettings,Vg as fetchAllMaybeTransactionBuffer,al as fetchAllMaybeUser,$I as fetchAllSettings,uP as fetchAllSettingsAccountByMember,sE as fetchAllTransactionBuffer,AE as fetchAllUser,Br as fetchDomainConfig,J1 as fetchGlobalCounter,Ii as fetchMaybeDomainConfig,Bi as fetchMaybeGlobalCounter,Ig as fetchMaybeSettings,Gg as fetchMaybeTransactionBuffer,cl as fetchMaybeUser,ko as fetchSettings,oE as fetchTransactionBuffer,$o as fetchUser,iP as fetchUserAccountByFilters,eS as getAccountStateCodec,Lt as getAccountStateDecoder,vt as getAccountStateEncoder,aS as getAddMemberArgsCodec,Bt as getAddMemberArgsDecoder,Wt as getAddMemberArgsEncoder,rS as getAdditionalMetadataCodec,Ot as getAdditionalMetadataDecoder,kt as getAdditionalMetadataEncoder,_E as getChangeConfigDiscriminatorBytes,is as getChangeConfigInstruction,hE as getChangeConfigInstructionDataCodec,as as getChangeConfigInstructionDataDecoder,cs as getChangeConfigInstructionDataEncoder,br as getClientAndDeviceHash,dS as getCompiledInstructionCodec,wt as getCompiledInstructionDecoder,Nt as getCompiledInstructionEncoder,lS as getCompressedOnlyExtensionCodec,Gt as getCompressedOnlyExtensionDecoder,Ft as getCompressedOnlyExtensionEncoder,yS as getCompressedProofCodec,jt as getCompressedProofDecoder,qt as getCompressedProofEncoder,xS as getCompressedTokenArgsCodec,Jt as getCompressedTokenArgsDecoder,Yt as getCompressedTokenArgsEncoder,bS as getCompressibleExtensionCodec,nn as getCompressibleExtensionDecoder,tn as getCompressibleExtensionEncoder,PS as getCompressionInfoCodec,on as getCompressionInfoDecoder,rn as getCompressionInfoEncoder,vS as getConfigActionCodec,Oe as getConfigActionDecoder,ke as getConfigActionEncoder,BE as getCreateDomainConfigDiscriminatorBytes,fs as getCreateDomainConfigInstruction,wE as getCreateDomainConfigInstructionAsync,NE as getCreateDomainConfigInstructionDataCodec,Ts as getCreateDomainConfigInstructionDataDecoder,or as getCreateDomainConfigInstructionDataEncoder,jE as getCreateDomainUserAccountDiscriminatorBytes,bs as getCreateDomainUserAccountInstruction,YE as getCreateDomainUserAccountInstructionDataCodec,Ds as getCreateDomainUserAccountInstructionDataDecoder,Es as getCreateDomainUserAccountInstructionDataEncoder,tD as getCreateGlobalCounterDiscriminatorBytes,rD as getCreateGlobalCounterInstruction,Ps as getCreateGlobalCounterInstructionAsync,nD as getCreateGlobalCounterInstructionDataCodec,Rs as getCreateGlobalCounterInstructionDataDecoder,ar as getCreateGlobalCounterInstructionDataEncoder,AD as getCreateUserAccountDiscriminatorBytes,vs as getCreateUserAccountInstruction,lD as getCreateUserAccountInstructionAsync,gD as getCreateUserAccountInstructionDataCodec,Us as getCreateUserAccountInstructionDataDecoder,ur as getCreateUserAccountInstructionDataEncoder,xD as getCreateWalletDiscriminatorBytes,Bs as getCreateWalletInstruction,ED as getCreateWalletInstructionAsync,ID as getCreateWalletInstructionDataCodec,Ws as getCreateWalletInstructionDataDecoder,Ar as getCreateWalletInstructionDataEncoder,_R as getDeviceMessageHash,_D as getDisableDomainConfigDiscriminatorBytes,Hs as getDisableDomainConfigInstruction,hD as getDisableDomainConfigInstructionDataCodec,Vs as getDisableDomainConfigInstructionDataDecoder,Gs as getDisableDomainConfigInstructionDataEncoder,be as getDomainConfigAddress,V1 as getDomainConfigCodec,Or as getDomainConfigDecoder,G1 as getDomainConfigDiscriminatorBytes,xi as getDomainConfigEncoder,z1 as getDomainConfigSize,BD as getEditDomainConfigDiscriminatorBytes,Js as getEditDomainConfigInstruction,ND as getEditDomainConfigInstructionDataCodec,Ys as getEditDomainConfigInstructionDataDecoder,js as getEditDomainConfigInstructionDataEncoder,NS as getEditMemberArgsCodec,ln as getEditMemberArgsDecoder,gn as getEditMemberArgsEncoder,KD as getEditTransactionManagerUrlDiscriminatorBytes,Qs as getEditTransactionManagerUrlInstruction,jD as getEditTransactionManagerUrlInstructionAsync,qD as getEditTransactionManagerUrlInstructionDataCodec,$s as getEditTransactionManagerUrlInstructionDataDecoder,lr as getEditTransactionManagerUrlInstructionDataEncoder,tb as getEditUserDelegateDiscriminatorBytes,ac as getEditUserDelegateInstruction,nb as getEditUserDelegateInstructionDataCodec,cc as getEditUserDelegateInstructionDataDecoder,sc as getEditUserDelegateInstructionDataEncoder,VS as getExpectedSignerCodec,Be as getExpectedSignerDecoder,We as getExpectedSignerEncoder,qS as getExtensionStructCodec,Le as getExtensionStructDecoder,Zt as getExtensionStructEncoder,xt as getGlobalCounterAddress,Y1 as getGlobalCounterCodec,Gr as getGlobalCounterDecoder,j1 as getGlobalCounterDiscriminatorBytes,Wi as getGlobalCounterEncoder,X1 as getGlobalCounterSize,XM as getLightCpiSigner,Ke as getLightProtocolRpc,$S as getMemberCodec,_n as getMemberDecoder,Pn as getMemberEncoder,tx as getMemberKeyCodec,L as getMemberKeyDecoder,h as getMemberKeyEncoder,aM as getMultiWalletErrorMessage,db as getNativeTransferIntentDiscriminatorBytes,Ac as getNativeTransferIntentInstruction,gb as getNativeTransferIntentInstructionAsync,Ab as getNativeTransferIntentInstructionDataCodec,dc as getNativeTransferIntentInstructionDataDecoder,pr as getNativeTransferIntentInstructionDataEncoder,UR as getOriginIndex,ox as getPackedMerkleContextCodec,$t as getPackedMerkleContextDecoder,Xt as getPackedMerkleContextEncoder,ax as getPausableAccountExtensionCodec,Tn as getPausableAccountExtensionDecoder,yn as getPausableAccountExtensionEncoder,dx as getPermanentDelegateAccountExtensionCodec,Sn as getPermanentDelegateAccountExtensionDecoder,fn as getPermanentDelegateAccountExtensionEncoder,lx as getPermissionsCodec,ie as getPermissionsDecoder,ae as getPermissionsEncoder,Tx as getProofArgsCodec,Un as getProofArgsDecoder,hn as getProofArgsEncoder,Ix as getRemoveMemberArgsCodec,mn as getRemoveMemberArgsDecoder,pn as getRemoveMemberArgsEncoder,bx as getRentConfigCodec,un as getRentConfigDecoder,an as getRentConfigEncoder,Cr as getSecp256r1MessageHash,Rx as getSecp256r1PubkeyCodec,Ne as getSecp256r1PubkeyDecoder,kn as getSecp256r1PubkeyEncoder,$f as getSecp256r1SignatureOffsetsDataDecoder,Xf as getSecp256r1SignatureOffsetsDataEncoder,hx as getSecp256r1VerifyArgsCodec,w as getSecp256r1VerifyArgsDecoder,N as getSecp256r1VerifyArgsEncoder,kx as getSecp256r1VerifyArgsWithDomainConfigIndexCodec,Wn as getSecp256r1VerifyArgsWithDomainConfigIndexDecoder,On as getSecp256r1VerifyArgsWithDomainConfigIndexEncoder,U as getSecp256r1VerifyInstruction,GP as getSecp256r1VerifyInstructionDataCodec,Fa as getSecp256r1VerifyInstructionDataDecoder,Ga as getSecp256r1VerifyInstructionDataEncoder,oR as getSendAndConfirmTransaction,XI as getSettingsCodec,ct as getSettingsDecoder,ZI as getSettingsDiscriminatorBytes,xg as getSettingsEncoder,se as getSettingsFromIndex,Bx as getSettingsIndexWithDelegateInfoCodec,Nn as getSettingsIndexWithDelegateInfoDecoder,Bn as getSettingsIndexWithDelegateInfoEncoder,bR as getSignedSecp256r1Key,O as getSolanaRpc,rR as getSolanaRpcEndpoint,Fx as getSplInterfacePdaArgsCodec,Fn as getSplInterfacePdaArgsDecoder,wn as getSplInterfacePdaArgsEncoder,zx as getTokenMetadataCodec,In as getTokenMetadataDecoder,xn as getTokenMetadataEncoder,xb as getTokenTransferIntentDiscriminatorBytes,Sc as getTokenTransferIntentInstruction,Eb as getTokenTransferIntentInstructionAsync,Ib as getTokenTransferIntentInstructionDataCodec,fc as getTokenTransferIntentInstructionDataDecoder,mr as getTokenTransferIntentInstructionDataEncoder,Sa as getTransactionBufferAddress,hb as getTransactionBufferCloseDiscriminatorBytes,Cc as getTransactionBufferCloseInstruction,Ub as getTransactionBufferCloseInstructionDataCodec,bc as getTransactionBufferCloseInstructionDataDecoder,Dc as getTransactionBufferCloseInstructionDataEncoder,rE as getTransactionBufferCodec,wb as getTransactionBufferCreateDiscriminatorBytes,Uc as getTransactionBufferCreateInstruction,Fb as getTransactionBufferCreateInstructionDataCodec,hc as getTransactionBufferCreateInstructionDataDecoder,_c as getTransactionBufferCreateInstructionDataEncoder,Fo as getTransactionBufferDecoder,nE as getTransactionBufferDiscriminatorBytes,Fg as getTransactionBufferEncoder,Yb as getTransactionBufferExecuteDiscriminatorBytes,Bc as getTransactionBufferExecuteInstruction,Jb as getTransactionBufferExecuteInstructionDataCodec,Wc as getTransactionBufferExecuteInstructionDataDecoder,Oc as getTransactionBufferExecuteInstructionDataEncoder,nC as getTransactionBufferExtendDiscriminatorBytes,Hc as getTransactionBufferExtendInstruction,rC as getTransactionBufferExtendInstructionDataCodec,Vc as getTransactionBufferExtendInstructionDataDecoder,Gc as getTransactionBufferExtendInstructionDataEncoder,AC as getTransactionBufferVoteDiscriminatorBytes,Jc as getTransactionBufferVoteInstruction,gC as getTransactionBufferVoteInstructionDataCodec,Yc as getTransactionBufferVoteInstructionDataDecoder,jc as getTransactionBufferVoteInstructionDataEncoder,SC as getTransactionExecuteDiscriminatorBytes,ta as getTransactionExecuteInstruction,xC as getTransactionExecuteInstructionDataCodec,ea as getTransactionExecuteInstructionDataDecoder,Qc as getTransactionExecuteInstructionDataEncoder,PC as getTransactionExecuteSyncDiscriminatorBytes,aa as getTransactionExecuteSyncInstruction,_C as getTransactionExecuteSyncInstructionDataCodec,ca as getTransactionExecuteSyncInstructionDataDecoder,sa as getTransactionExecuteSyncInstructionDataEncoder,jx as getTransactionMessageAddressTableLookupCodec,Yn as getTransactionMessageAddressTableLookupDecoder,jn as getTransactionMessageAddressTableLookupEncoder,Xx as getTransactionSyncSignersCodec,Z as getTransactionSyncSignersDecoder,J as getTransactionSyncSignersEncoder,nI as getTransferFeeAccountExtensionCodec,Dn as getTransferFeeAccountExtensionDecoder,En as getTransferFeeAccountExtensionEncoder,sI as getTransferHookAccountExtensionCodec,Cn as getTransferHookAccountExtensionDecoder,bn as getTransferHookAccountExtensionEncoder,iI as getTransportsCodec,Fe as getTransportsDecoder,we as getTransportsEncoder,v as getUserAddress,dE as getUserCodec,At as getUserDecoder,uE as getUserDiscriminatorBytes,sl as getUserEncoder,AI as getUserRoleCodec,pe as getUserRoleDecoder,le as getUserRoleEncoder,P1 as getVersionFromDiscriminator,ZM as getWalletAddressFromIndex,Q as getWalletAddressFromSettings,eM as identifyMultiWalletAccount,tM as identifyMultiWalletInstruction,sR as initialize,kS as isConfigAction,YS as isExtensionStruct,iM as isMultiWalletError,Qx as isTransactionSyncSigners,E_ as nativeTransferIntent,UE as parseChangeConfigInstruction,FE as parseCreateDomainConfigInstruction,JE as parseCreateDomainUserAccountInstruction,oD as parseCreateGlobalCounterInstruction,pD as parseCreateUserAccountInstruction,DD as parseCreateWalletInstruction,UD as parseDisableDomainConfigInstruction,wD as parseEditDomainConfigInstruction,YD as parseEditTransactionManagerUrlInstruction,rb as parseEditUserDelegateInstruction,lb as parseNativeTransferIntentInstruction,VP as parseSecp256r1VerifyInstruction,Db as parseTokenTransferIntentInstruction,vb as parseTransactionBufferCloseInstruction,Gb as parseTransactionBufferCreateInstruction,Zb as parseTransactionBufferExecuteInstruction,oC as parseTransactionBufferExtendInstruction,lC as parseTransactionBufferVoteInstruction,IC as parseTransactionExecuteInstruction,hC as parseTransactionExecuteSyncInstruction,UU as prepareChangeConfigArgs,NU as prepareTransactionBundle,XU as prepareTransactionMessage,nv as prepareTransactionSync,GR as retrieveTransactionManager,HR as serializeConfigActions,w_ as tokenTransferIntent,$x as transactionSyncSigners,Ta as vaultTransactionMessageDeserialize,ya as vaultTransactionMessageSerialize,ri as voteTransactionBuffer};//# sourceMappingURL=index.js.map
|
|
3
3
|
//# sourceMappingURL=index.js.map
|