@revibase/core 0.7.1 → 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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var gill=require('gill'),sha2_js=require('@noble/hashes/sha2.js'),d=require('zod'),stateless_js=require('@lightprotocol/stateless.js'),tinyCbor=require('@levischuck/tiny-cbor'),nist_js=require('@noble/curves/nist.js'),jsonCanonicalize=require('json-canonicalize'),programs=require('gill/programs'),web3_js=require('@solana/web3.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var d__default=/*#__PURE__*/_interopDefault(d);var kr=new Uint8Array([201,232,212,229,59,241,106,197]);function G1(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(kr)}function xi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["authority",gill.getAddressEncoder()],["rpIdHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["bump",gill.getU8Encoder()],["isDisabled",gill.getU8Encoder()],["rpIdLength",gill.getU8Encoder()],["numOrigins",gill.getU8Encoder()],["rpId",gill.fixEncoderSize(gill.getBytesEncoder(),255)],["origins",gill.fixEncoderSize(gill.getBytesEncoder(),515)]]),e=>({...e,discriminator:kr}))}function Or(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["authority",gill.getAddressDecoder()],["rpIdHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["bump",gill.getU8Decoder()],["isDisabled",gill.getU8Decoder()],["rpIdLength",gill.getU8Decoder()],["numOrigins",gill.getU8Decoder()],["rpId",gill.fixDecoderSize(gill.getBytesDecoder(),255)],["origins",gill.fixDecoderSize(gill.getBytesDecoder(),515)]])}function V1(){return gill.combineCodec(xi(),Or())}function Wr(e){return gill.decodeAccount(e,Or())}async function Br(e,r,t){let o=await Ii(e,r,t);return gill.assertAccountExists(o),o}async function Ii(e,r,t){let o=await gill.fetchEncodedAccount(e,r,t);return Wr(o)}async function H1(e,r,t){let o=await Ei(e,r,t);return gill.assertAccountsExist(o),o}async function Ei(e,r,t){return (await gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Fr)}function Wi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:Fr}))}function Gr(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function Y1(){return gill.combineCodec(Wi(),Gr())}function Vr(e){return gill.decodeAccount(e,Gr())}async function J1(e,r,t){let o=await Bi(e,r,t);return gill.assertAccountExists(o),o}async function Bi(e,r,t){let o=await gill.fetchEncodedAccount(e,r,t);return Vr(o)}async function Z1(e,r,t){let o=await Ni(e,r,t);return gill.assertAccountsExist(o),o}async function Ni(e,r,t){return (await gill.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 gill.getEnumEncoder(Ut)}function Lt(){return gill.getEnumDecoder(Ut)}function eS(){return gill.combineCodec(vt(),Lt())}function kt(){return gill.getStructEncoder([["key",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["value",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Ot(){return gill.getStructDecoder([["key",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["value",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function rS(){return gill.combineCodec(kt(),Ot())}function Wt(){return gill.getStructEncoder([["memberKey",h()],["permissions",ae()]])}function Bt(){return gill.getStructDecoder([["memberKey",L()],["permissions",ie()]])}function aS(){return gill.combineCodec(Wt(),Bt())}function Nt(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function wt(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function dS(){return gill.combineCodec(Nt(),wt())}function Ft(){return gill.getStructEncoder([["delegatedAmount",gill.getU64Encoder()],["withheldTransferFee",gill.getU64Encoder()],["isAta",gill.getU8Encoder()]])}function Gt(){return gill.getStructDecoder([["delegatedAmount",gill.getU64Decoder()],["withheldTransferFee",gill.getU64Decoder()],["isAta",gill.getU8Decoder()]])}function lS(){return gill.combineCodec(Ft(),Gt())}function qt(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function jt(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function yS(){return gill.combineCodec(qt(),jt())}function Yt(){return gill.getStructEncoder([["version",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()],["amount",gill.getU64Encoder()],["merkleContext",Xt()],["tlv",gill.getOptionEncoder(gill.getArrayEncoder(Zt()))],["state",vt()]])}function Jt(){return gill.getStructDecoder([["version",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()],["amount",gill.getU64Decoder()],["merkleContext",$t()],["tlv",gill.getOptionDecoder(gill.getArrayDecoder(Le()))],["state",Lt()]])}function xS(){return gill.combineCodec(Yt(),Jt())}function tn(){return gill.getStructEncoder([["decimalsOption",gill.getU8Encoder()],["decimals",gill.getU8Encoder()],["compressionOnly",gill.getBooleanEncoder()],["isAta",gill.getU8Encoder()],["info",rn()]])}function nn(){return gill.getStructDecoder([["decimalsOption",gill.getU8Decoder()],["decimals",gill.getU8Decoder()],["compressionOnly",gill.getBooleanDecoder()],["isAta",gill.getU8Decoder()],["info",on()]])}function bS(){return gill.combineCodec(tn(),nn())}function rn(){return gill.getStructEncoder([["configAccountVersion",gill.getU16Encoder()],["compressToPubkey",gill.getU8Encoder()],["accountVersion",gill.getU8Encoder()],["lamportsPerWrite",gill.getU32Encoder()],["compressionAuthority",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["rentSponsor",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["lastClaimedSlot",gill.getU64Encoder()],["rentExemptionPaid",gill.getU32Encoder()],["reserved",gill.getU32Encoder()],["rentConfig",an()]])}function on(){return gill.getStructDecoder([["configAccountVersion",gill.getU16Decoder()],["compressToPubkey",gill.getU8Decoder()],["accountVersion",gill.getU8Decoder()],["lamportsPerWrite",gill.getU32Decoder()],["compressionAuthority",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["rentSponsor",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["lastClaimedSlot",gill.getU64Decoder()],["rentExemptionPaid",gill.getU32Decoder()],["reserved",gill.getU32Decoder()],["rentConfig",un()]])}function PS(){return gill.combineCodec(rn(),on())}function ke(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(gn())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Wt())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(pn())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function Oe(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(ln())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Bt())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(mn())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function vS(){return gill.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 gill.getStructEncoder([["memberKey",h()],["permissions",ae()]])}function ln(){return gill.getStructDecoder([["memberKey",L()],["permissions",ie()]])}function NS(){return gill.combineCodec(gn(),ln())}function We(){return gill.getStructEncoder([["memberKey",h()],["messageHash",gill.getOptionEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))]])}function Be(){return gill.getStructDecoder([["memberKey",L()],["messageHash",gill.getOptionDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))]])}function VS(){return gill.combineCodec(We(),Be())}function Zt(){return gill.getDiscriminatedUnionEncoder([["Placeholder0",gill.getUnitEncoder()],["Placeholder1",gill.getUnitEncoder()],["Placeholder2",gill.getUnitEncoder()],["Placeholder3",gill.getUnitEncoder()],["Placeholder4",gill.getUnitEncoder()],["Placeholder5",gill.getUnitEncoder()],["Placeholder6",gill.getUnitEncoder()],["Placeholder7",gill.getUnitEncoder()],["Placeholder8",gill.getUnitEncoder()],["Placeholder9",gill.getUnitEncoder()],["Placeholder10",gill.getUnitEncoder()],["Placeholder11",gill.getUnitEncoder()],["Placeholder12",gill.getUnitEncoder()],["Placeholder13",gill.getUnitEncoder()],["Placeholder14",gill.getUnitEncoder()],["Placeholder15",gill.getUnitEncoder()],["Placeholder16",gill.getUnitEncoder()],["Placeholder17",gill.getUnitEncoder()],["Placeholder18",gill.getUnitEncoder()],["TokenMetadata",gill.getStructEncoder([["fields",gill.getTupleEncoder([xn()])]])],["Placeholder20",gill.getUnitEncoder()],["Placeholder21",gill.getUnitEncoder()],["Placeholder22",gill.getUnitEncoder()],["Placeholder23",gill.getUnitEncoder()],["Placeholder24",gill.getUnitEncoder()],["Placeholder25",gill.getUnitEncoder()],["Placeholder26",gill.getUnitEncoder()],["PausableAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([yn()])]])],["PermanentDelegateAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([fn()])]])],["TransferFeeAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([En()])]])],["TransferHookAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([bn()])]])],["CompressedOnly",gill.getStructEncoder([["fields",gill.getTupleEncoder([Ft()])]])],["Compressible",gill.getStructEncoder([["fields",gill.getTupleEncoder([tn()])]])]])}function Le(){return gill.getDiscriminatedUnionDecoder([["Placeholder0",gill.getUnitDecoder()],["Placeholder1",gill.getUnitDecoder()],["Placeholder2",gill.getUnitDecoder()],["Placeholder3",gill.getUnitDecoder()],["Placeholder4",gill.getUnitDecoder()],["Placeholder5",gill.getUnitDecoder()],["Placeholder6",gill.getUnitDecoder()],["Placeholder7",gill.getUnitDecoder()],["Placeholder8",gill.getUnitDecoder()],["Placeholder9",gill.getUnitDecoder()],["Placeholder10",gill.getUnitDecoder()],["Placeholder11",gill.getUnitDecoder()],["Placeholder12",gill.getUnitDecoder()],["Placeholder13",gill.getUnitDecoder()],["Placeholder14",gill.getUnitDecoder()],["Placeholder15",gill.getUnitDecoder()],["Placeholder16",gill.getUnitDecoder()],["Placeholder17",gill.getUnitDecoder()],["Placeholder18",gill.getUnitDecoder()],["TokenMetadata",gill.getStructDecoder([["fields",gill.getTupleDecoder([In()])]])],["Placeholder20",gill.getUnitDecoder()],["Placeholder21",gill.getUnitDecoder()],["Placeholder22",gill.getUnitDecoder()],["Placeholder23",gill.getUnitDecoder()],["Placeholder24",gill.getUnitDecoder()],["Placeholder25",gill.getUnitDecoder()],["Placeholder26",gill.getUnitDecoder()],["PausableAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Tn()])]])],["PermanentDelegateAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Sn()])]])],["TransferFeeAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Dn()])]])],["TransferHookAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Cn()])]])],["CompressedOnly",gill.getStructDecoder([["fields",gill.getTupleDecoder([Gt()])]])],["Compressible",gill.getStructDecoder([["fields",gill.getTupleDecoder([nn()])]])]])}function qS(){return gill.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 gill.getStructEncoder([["pubkey",h()],["role",gill.getU8Encoder()],["permissions",ae()],["padding",gill.getU8Encoder()],["isDelegate",gill.getU8Encoder()]])}function _n(){return gill.getStructDecoder([["pubkey",L()],["role",gill.getU8Decoder()],["permissions",ie()],["padding",gill.getU8Decoder()],["isDelegate",gill.getU8Decoder()]])}function $S(){return gill.combineCodec(Pn(),_n())}function h(){return gill.getStructEncoder([["keyType",gill.getU8Encoder()],["key",gill.fixEncoderSize(gill.getBytesEncoder(),33)]])}function L(){return gill.getStructDecoder([["keyType",gill.getU8Decoder()],["key",gill.fixDecoderSize(gill.getBytesDecoder(),33)]])}function tx(){return gill.combineCodec(h(),L())}function Xt(){return gill.getStructEncoder([["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()],["proveByIndex",gill.getBooleanEncoder()]])}function $t(){return gill.getStructDecoder([["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()],["proveByIndex",gill.getBooleanDecoder()]])}function ox(){return gill.combineCodec(Xt(),$t())}function yn(){return gill.getStructEncoder([])}function Tn(){return gill.getStructDecoder([])}function ax(){return gill.combineCodec(yn(),Tn())}function fn(){return gill.getStructEncoder([])}function Sn(){return gill.getStructDecoder([])}function dx(){return gill.combineCodec(fn(),Sn())}function ae(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function ie(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function lx(){return gill.combineCodec(ae(),ie())}function hn(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(qt())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function Un(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(jt())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function Tx(){return gill.combineCodec(hn(),Un())}function pn(){return gill.getStructEncoder([["memberKey",h()]])}function mn(){return gill.getStructDecoder([["memberKey",L()]])}function Ix(){return gill.combineCodec(pn(),mn())}function an(){return gill.getStructEncoder([["baseRent",gill.getU16Encoder()],["compressionCost",gill.getU16Encoder()],["lamportsPerBytePerEpoch",gill.getU8Encoder()],["maxFundedEpochs",gill.getU8Encoder()],["maxTopUp",gill.getU16Encoder()]])}function un(){return gill.getStructDecoder([["baseRent",gill.getU16Decoder()],["compressionCost",gill.getU16Decoder()],["lamportsPerBytePerEpoch",gill.getU8Decoder()],["maxFundedEpochs",gill.getU8Decoder()],["maxTopUp",gill.getU16Decoder()]])}function bx(){return gill.combineCodec(an(),un())}function kn(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function Ne(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function Rx(){return gill.combineCodec(kn(),Ne())}function N(){return gill.getStructEncoder([["signedMessageIndex",gill.getU8Encoder()],["slotNumber",gill.getU64Encoder()],["originIndex",gill.getU8Encoder()],["crossOrigin",gill.getBooleanEncoder()],["truncatedClientDataJson",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["clientAndDeviceHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function w(){return gill.getStructDecoder([["signedMessageIndex",gill.getU8Decoder()],["slotNumber",gill.getU64Decoder()],["originIndex",gill.getU8Decoder()],["crossOrigin",gill.getBooleanDecoder()],["truncatedClientDataJson",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["clientAndDeviceHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function hx(){return gill.combineCodec(N(),w())}function On(){return gill.getStructEncoder([["verifyArgs",N()],["domainConfigIndex",gill.getU8Encoder()]])}function Wn(){return gill.getStructDecoder([["verifyArgs",w()],["domainConfigIndex",gill.getU8Decoder()]])}function kx(){return gill.combineCodec(On(),Wn())}function Bn(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["isDelegate",gill.getBooleanEncoder()]])}function Nn(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["isDelegate",gill.getBooleanDecoder()]])}function Bx(){return gill.combineCodec(Bn(),Nn())}function wn(){return gill.getStructEncoder([["index",gill.getU8Encoder()],["restricted",gill.getBooleanEncoder()]])}function Fn(){return gill.getStructDecoder([["index",gill.getU8Decoder()],["restricted",gill.getBooleanDecoder()]])}function Fx(){return gill.combineCodec(wn(),Fn())}function xn(){return gill.getStructEncoder([["updateAuthority",gill.getAddressEncoder()],["mint",gill.getAddressEncoder()],["name",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["symbol",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["uri",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["additionalMetadata",gill.getArrayEncoder(kt())]])}function In(){return gill.getStructDecoder([["updateAuthority",gill.getAddressDecoder()],["mint",gill.getAddressDecoder()],["name",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["symbol",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["uri",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["additionalMetadata",gill.getArrayDecoder(Ot())]])}function zx(){return gill.combineCodec(xn(),In())}function jn(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Yn(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function jx(){return gill.combineCodec(jn(),Yn())}function J(){return gill.getDiscriminatedUnionEncoder([["Ed25519",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])],["Secp256r1",gill.getStructEncoder([["fields",gill.getTupleEncoder([On()])]])]])}function Z(){return gill.getDiscriminatedUnionDecoder([["Ed25519",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])],["Secp256r1",gill.getStructDecoder([["fields",gill.getTupleDecoder([Wn()])]])]])}function Xx(){return gill.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 gill.getStructEncoder([["withheldAmount",gill.getU64Encoder()]])}function Dn(){return gill.getStructDecoder([["withheldAmount",gill.getU64Decoder()]])}function nI(){return gill.combineCodec(En(),Dn())}function bn(){return gill.getStructEncoder([["transferring",gill.getU8Encoder()]])}function Cn(){return gill.getStructDecoder([["transferring",gill.getU8Decoder()]])}function sI(){return gill.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 gill.getEnumEncoder(Jn)}function Fe(){return gill.getEnumDecoder(Jn)}function iI(){return gill.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 gill.getEnumEncoder(Ie)}function pe(){return gill.getEnumDecoder(Ie)}function AI(){return gill.combineCodec(le(),pe())}var vo=new Uint8Array([223,179,163,190,177,224,67,173]);function ZI(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(vo)}function xg(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(Pn())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["padding",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]]),e=>({...e,discriminator:vo}))}function ct(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(_n())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["padding",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function XI(){return gill.combineCodec(xg(),ct())}function Lo(e){return gill.decodeAccount(e,ct())}async function ko(e,r,t){let o=await Ig(e,r,t);return gill.assertAccountExists(o),o}async function Ig(e,r,t){let o=await gill.fetchEncodedAccount(e,r,t);return Lo(o)}async function $I(e,r,t){let o=await Eg(e,r,t);return gill.assertAccountsExist(o),o}async function Eg(e,r,t){return (await gill.fetchEncodedAccounts(e,r,t)).map(n=>Lo(n))}var wo=new Uint8Array([90,36,35,219,93,225,110,96]);function nE(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(wo)}function Fg(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["multiWalletSettings",gill.getAddressEncoder()],["multiWalletBump",gill.getU8Encoder()],["canExecute",gill.getBooleanEncoder()],["preauthorizeExecution",gill.getBooleanEncoder()],["validTill",gill.getU64Encoder()],["payer",gill.getAddressEncoder()],["bump",gill.getU8Encoder()],["bufferIndex",gill.getU8Encoder()],["finalBufferHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["finalBufferSize",gill.getU16Encoder()],["creator",h()],["executor",h()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder(h())],["expectedSigners",gill.getArrayEncoder(We())],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:wo}))}function Fo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["multiWalletSettings",gill.getAddressDecoder()],["multiWalletBump",gill.getU8Decoder()],["canExecute",gill.getBooleanDecoder()],["preauthorizeExecution",gill.getBooleanDecoder()],["validTill",gill.getU64Decoder()],["payer",gill.getAddressDecoder()],["bump",gill.getU8Decoder()],["bufferIndex",gill.getU8Decoder()],["finalBufferHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["finalBufferSize",gill.getU16Decoder()],["creator",L()],["executor",L()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["voters",gill.getArrayDecoder(L())],["expectedSigners",gill.getArrayDecoder(Be())],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function rE(){return gill.combineCodec(Fg(),Fo())}function Go(e){return gill.decodeAccount(e,Fo())}async function oE(e,r,t){let o=await Gg(e,r,t);return gill.assertAccountExists(o),o}async function Gg(e,r,t){let o=await gill.fetchEncodedAccount(e,r,t);return Go(o)}async function sE(e,r,t){let o=await Vg(e,r,t);return gill.assertAccountsExist(o),o}async function Vg(e,r,t){return (await gill.fetchEncodedAccounts(e,r,t)).map(n=>Go(n))}var Zo=new Uint8Array([159,117,95,227,239,151,58,236]);function uE(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Zo)}function sl(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["member",h()],["credentialId",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder()))],["transports",gill.getOptionEncoder(gill.getArrayEncoder(we()))],["wallets",gill.getArrayEncoder(Bn())],["role",le()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:Zo}))}function At(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["member",L()],["credentialId",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder()))],["transports",gill.getOptionDecoder(gill.getArrayDecoder(Fe()))],["wallets",gill.getArrayDecoder(Nn())],["role",pe()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["bump",gill.getU8Decoder()]])}function dE(){return gill.combineCodec(sl(),At())}function Xo(e){return gill.decodeAccount(e,At())}async function $o(e,r,t){let o=await cl(e,r,t);return gill.assertAccountExists(o),o}async function cl(e,r,t){let o=await gill.fetchEncodedAccount(e,r,t);return Xo(o)}async function AE(e,r,t){let o=await al(e,r,t);return gill.assertAccountsExist(o),o}async function al(e,r,t){return (await gill.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:gill.AccountRole.READONLY});let o=t.isWritable?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY;return Object.freeze({address:P(t.value),role:Qo(t.value)?gill.upgradeRoleToSigner(o):o,...Qo(t.value)?{signer:t.value}:{}})}}function Qo(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var ss=new Uint8Array([8]);function _E(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ss)}function cs(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(ke())],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:ss}))}function as(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(Oe())],["signers",gill.getArrayDecoder(Z())]])}function hE(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ys)}function or(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["rpId",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["origins",gill.getArrayEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))]]),e=>({...e,discriminator:ys}))}function Ts(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["rpId",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["origins",gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))]])}function NE(){return gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.getBytesEncoder().encode(new Uint8Array([117,115,101,114])),gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Is)}function Es(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["member",kn()],["role",le()],["credentialId",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["transports",gill.getArrayEncoder(we())]]),e=>({...e,discriminator:Is}))}function Ds(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["member",Ne()],["role",pe()],["credentialId",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["transports",gill.getArrayDecoder(Fe())]])}function YE(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ms)}function ar(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Ms}))}function Rs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function nD(){return gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(hs)}function ur(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["role",le()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))]]),e=>({...e,discriminator:hs}))}function Us(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["role",pe()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))]])}function gD(){return gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.getBytesEncoder().encode(new Uint8Array([117,115,101,114])),gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Os)}function Ar(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsIndex",gill.getU128Encoder()]]),e=>({...e,discriminator:Os}))}function Ws(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsIndex",gill.getU128Decoder()]])}function ID(){return gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.getBytesEncoder().encode(new Uint8Array([117,115,101,114])),gill.getAddressEncoder().encode(P(n.initialMember.value))]})),n.settings.value||(n.settings.value=await gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Fs)}function Gs(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:Fs}))}function Vs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function hD(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(qs)}function js(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["newOrigins",gill.getOptionEncoder(gill.getArrayEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())))]]),e=>({...e,discriminator:qs}))}function Ys(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))]])}function ND(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Xs)}function lr(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Xs}))}function $s(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())]])}function qD(){return gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.getBytesEncoder().encode(new Uint8Array([117,115,101,114])),gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(oc)}function sc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())],["delegateTo",gill.getOptionEncoder(gill.getU128Encoder())]]),e=>({...e,discriminator:oc}))}function cc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["delegateTo",gill.getOptionDecoder(gill.getU128Decoder())]])}function nb(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(uc)}function pr(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:uc}))}function dc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["signers",gill.getArrayDecoder(Z())]])}function Ab(){return gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(P(n.settings.value)),gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Tc)}function mr(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["splInterfacePdaArgs",gill.getOptionEncoder(wn())],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccounts",gill.getArrayEncoder(Yt())],["compressedProofArgs",gill.getOptionEncoder(hn())],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:Tc}))}function fc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["splInterfacePdaArgs",gill.getOptionDecoder(Fn())],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccounts",gill.getArrayDecoder(Jt())],["compressedProofArgs",gill.getOptionDecoder(Un())],["signers",gill.getArrayDecoder(Z())]])}function Ib(){return gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(P(n.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),n.tokenProgram.value||(n.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),n.sourceSplTokenAccount.value||(n.sourceSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(P(n.source.value)),gill.getAddressEncoder().encode(P(n.tokenProgram.value)),gill.getAddressEncoder().encode(P(n.mint.value))]})),n.sourceCtokenTokenAccount.value||(n.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(P(n.source.value)),gill.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])),gill.getAddressEncoder().encode(P(n.mint.value))]})),n.destinationSplTokenAccount.value||(n.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(P(n.destination.value)),gill.getAddressEncoder().encode(P(n.tokenProgram.value)),gill.getAddressEncoder().encode(P(n.mint.value))]})),n.destinationCtokenTokenAccount.value||(n.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(P(n.destination.value)),gill.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])),gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ec)}function Dc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:Ec}))}function bc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Ub(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Pc)}function _c(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["bufferIndex",gill.getU8Encoder()],["preauthorizeExecution",gill.getBooleanEncoder()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["finalBufferHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["finalBufferSize",gill.getU16Encoder()],["expectedSigners",gill.getArrayEncoder(We())],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:Pc}))}function hc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["bufferIndex",gill.getU8Decoder()],["preauthorizeExecution",gill.getBooleanDecoder()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["finalBufferHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["finalBufferSize",gill.getU16Decoder()],["expectedSigners",gill.getArrayDecoder(Be())],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Fb(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(kc)}function Oc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:kc}))}function Wc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Jb(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Fc)}function Gc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Fc}))}function Vc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function rC(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(qc)}function jc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:qc}))}function Yc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function gC(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode($c)}function Qc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:$c}))}function ea(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function xC(){return gill.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 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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(oa)}function sa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(Nt())],["addressTableLookups",gill.getArrayEncoder(jn())],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:oa}))}function ca(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(wt())],["addressTableLookups",gill.getArrayDecoder(Yn())],["signers",gill.getArrayDecoder(Z())]])}function _C(){return gill.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(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([201,232,212,229,59,241,106,197])),0))return 0;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([42,206,176,58,175,129,130,233])),0))return 1;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([223,179,163,190,177,224,67,173])),0))return 2;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([90,36,35,219,93,225,110,96])),0))return 3;if(gill.containsBytes(r,gill.fixEncoderSize(gill.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(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 1;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 2;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 3;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 4;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 5;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 6;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 7;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 8;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 9;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 10;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 11;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 12;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 13;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 14;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 15;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 16;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 17;if(gill.containsBytes(r,gill.fixEncoderSize(gill.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 gill.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__default.default.looseObject({publicKey:d__default.default.string(),walletAddress:d__default.default.string(),settingsIndexWithAddress:d__default.default.object({index:d__default.default.union([d__default.default.number(),d__default.default.bigint()])})}),QT=d__default.default.object({devicePublicKey:d__default.default.string(),platform:d__default.default.enum(["web","ios","android"]),userAgent:d__default.default.string().optional(),browser:d__default.default.object({name:d__default.default.string().optional(),version:d__default.default.string().optional(),major:d__default.default.string().optional(),type:d__default.default.string().optional()}).optional(),engine:d__default.default.object({name:d__default.default.string().optional(),version:d__default.default.string().optional()}).optional(),cpu:d__default.default.object({architecture:d__default.default.string().optional()}).optional(),device:d__default.default.object({type:d__default.default.string().optional(),vendor:d__default.default.string().optional(),model:d__default.default.string().optional()}).optional(),os:d__default.default.object({name:d__default.default.string().optional(),version:d__default.default.string().optional()}).optional(),app:d__default.default.object({name:d__default.default.string().optional(),version:d__default.default.string().optional(),build:d__default.default.string().optional()}).optional(),display:d__default.default.object({screenWidth:d__default.default.number().optional(),screenHeight:d__default.default.number().optional(),viewportWidth:d__default.default.number().optional(),viewportHeight:d__default.default.number().optional(),devicePixelRatio:d__default.default.number().optional()}).optional(),locale:d__default.default.string().optional(),timezone:d__default.default.string().optional(),push:d__default.default.object({provider:d__default.default.enum(["expo","fcm","apns"]),token:d__default.default.string()}).optional(),website:d__default.default.string().optional(),nativeApp:d__default.default.string().optional(),createdAt:d__default.default.iso.datetime().optional()}).strict(),ua=d__default.default.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","transfer_intent","change_delegate","change_config"]),bM=d__default.default.object({transactionActionType:ua,transactionAddress:d__default.default.string(),transactionMessageBytes:d__default.default.array(d__default.default.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),ef=d__default.default.object({transactionActionType:ua,transactionAddress:d__default.default.string(),transactionMessageBytes:d__default.default.base64()}).strict(),da=d__default.default.object({phase:d__default.default.literal("start"),clientOrigin:d__default.default.url(),signer:d__default.default.string().optional(),rid:d__default.default.string(),validTill:d__default.default.number(),providerOrigin:d__default.default.string(),rpId:d__default.default.string(),data:d__default.default.object({type:d__default.default.literal("message"),payload:d__default.default.string(),requireTwoFactorAuthentication:d__default.default.boolean().default(false)}).strict()}).strict(),Aa=d__default.default.object({phase:d__default.default.literal("start"),clientOrigin:d__default.default.url(),signer:d__default.default.string().optional(),rid:d__default.default.string(),validTill:d__default.default.number(),providerOrigin:d__default.default.string(),rpId:d__default.default.string(),data:d__default.default.object({type:d__default.default.literal("transaction"),payload:ef}).strict()}).strict(),ga=d__default.default.object({startRequest:d__default.default.union([da,Aa]),authResponse:d__default.default.custom(),client:d__default.default.object({clientOrigin:d__default.default.url(),jws:d__default.default.string()}).strict(),device:d__default.default.object({jwk:d__default.default.base64(),jws:d__default.default.string(),deviceProfile:QT}).strict()}).strict(),la=d__default.default.object({signer:d__default.default.string(),additionalInfo:d__default.default.looseObject({}).optional()}).strict(),tf=d__default.default.object({slotHash:d__default.default.string(),slotNumber:d__default.default.string(),estimatedSlotHashExpiry:d__default.default.number(),originIndex:d__default.default.number(),crossOrigin:d__default.default.boolean()}).strict(),CM=d__default.default.object({phase:d__default.default.literal("complete"),data:d__default.default.object({type:d__default.default.literal("message"),payload:la.extend(ga.shape).extend({startRequest:da,transactionManager:d__default.default.object({publicKey:d__default.default.string(),signature:d__default.default.string()}).optional()})}).strict()}).strict(),MM=d__default.default.object({phase:d__default.default.literal("complete"),data:d__default.default.object({type:d__default.default.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(gill.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 gill.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 gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function sf(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var ma=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(of())],["addressTableLookups",gill.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 gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("user"),e instanceof re?e.toTruncatedBuffer():gill.getAddressEncoder().encode(e)]});return r}async function be({rpIdHash:e,rpId:r}){if(!e)if(r)e=sha2_js.sha256(gill.getUtf8Encoder().encode(r));else throw new k("Either rpId or rpIdHash must be provided");let[t]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("domain_config"),e]});return t}async function xt(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function Sa(e,r,t){fa(t,0,255,"buffer_index");let[o]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),r instanceof re?r.toTruncatedBuffer():gill.getAddressEncoder().encode(r),gill.getU8Encoder().encode(t)]});return o}async function Q(e){let[r]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return r}async function se(e){let[r]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return r}async function ZM(e){let r=await se(e);return await Q(r)}async function XM(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.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=stateless_js.createRpc(e,t,r);let{rpc:o,sendAndConfirmTransaction:n}=gill.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=nist_js.p256.Point.CURVE().n>>1n,f=BigInt("0x"+It(g)),M=(f>m?nist_js.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=sha2_js.sha256(r);return new Uint8Array([...t,...o])}function ER(e){let r=tinyCbor.decodeCBOR(e),t=nist_js.p256.Point.fromAffine({x:BigInt("0x"+It(r.get(-2))),y:BigInt("0x"+It(r.get(-3)))});return gill.getBase58Decoder().decode(t.toBytes(true))}function DR(e){let t=nist_js.p256.Point.fromBytes(gill.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(tinyCbor.encodeCBOR(o))}async function bR(e){let{authenticatorData:r,clientDataJSON:t,signature:o}=e.authResponse.response,n=K(r),c=JSON.parse(gill.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:gill.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 sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...gill.getBase64Encoder().encode(r),...gill.getBase64Encoder().encode(t)]))}function CR(e){return sha2_js.sha256(gill.getUtf8Encoder().encode(jsonCanonicalize.canonicalize(e)))}function MR(e){return Cr(e.data.payload.authResponse)}function RR(e,r,t,o){let n=br(r,t,o);return sha2_js.sha256(new Uint8Array([...gill.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(gill.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=gill.getBase64Encoder().encode(l[0]);c=gill.getU64Decoder().decode(m.subarray(0,8)).toString(),a=m.subarray(8,40),n=gill.getBase58Decoder().decode(a),i=Date.now()+512*400;}else a=gill.getBase58Encoder().encode(n);let s=sha2_js.sha256(typeof e.transactionMessageBytes=="string"?gill.getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),u=br(r,t,o),g=sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e.transactionActionType),...gill.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),...gill.getUtf8Encoder().encode(jsonCanonicalize.canonicalize(r))])}function Cr(e){let r=qe(e);return sha2_js.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 gill.getBase64Decoder().decode(gill.getUtf8Encoder().encode(jsonCanonicalize.canonicalize(e)))}function LR(e){return JSON.parse(gill.getUtf8Decoder().decode(gill.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:gill.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:gill.getBase64Decoder().decode(gill.getTransactionEncoder().encode(f[R])),transactionMessageBytes:n?gill.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]:gill.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?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.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(gill.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]=gill.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?gill.some({signedMessageIndex:r,truncatedClientDataJson:t.verifyArgs.truncatedClientDataJson,slotNumber:t.verifyArgs.slotNumber,originIndex:t.originIndex,crossOrigin:t.crossOrigin,clientAndDeviceHash:t.clientAndDeviceHash}):gill.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:gill.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:gill.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,...gill.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 programs.getTransferSolInstruction({source:e,destination:gill.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:gill.getBase64Decoder().decode(gill.getAddressEncoder().encode(e))}}];if(r)o.push({memcmp:{offset:BigInt(Wa),encoding:"base64",bytes:gill.getBase64Decoder().decode(h().encode(ee(r)))}});else if(t)o.push({memcmp:{offset:BigInt(Bf),encoding:"base64",bytes:gill.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(gill.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:gill.getBase64Decoder().decode(h().encode(ee(e)))}}]}).send()).forEach(n=>{let c=ct().decode(gill.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?gill.AccountRole.WRITABLE_SIGNER:n&&!c?gill.AccountRole.WRITABLE:!n&&c?gill.AccountRole.READONLY_SIGNER:gill.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 gill.fetchAddressesForLookupTables(n.addressTableLookups.map(a=>a.lookupTableAddress),O()):{}),i=[];i.push(...n.addressTableLookups?.map(a=>({role:gill.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:gill.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:gill.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:gill.AccountRole.READONLY_SIGNER,signer:a}):i[s].role===gill.AccountRole.READONLY||i[s].role===gill.AccountRole.READONLY_SIGNER?i[s]={address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}:(i[s].role===gill.AccountRole.WRITABLE||i[s].role===gill.AccountRole.WRITABLE_SIGNER)&&(i[s]={address:a.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:n}}var Pe=33,_e=64,hr=14,Jf=2,Zf=gill.address("Secp256r1SigVerify1111111111111111111111111");function Xf(){return gill.getStructEncoder([["signatureOffset",gill.getU16Encoder()],["signatureInstructionIndex",gill.getU16Encoder()],["publicKeyOffset",gill.getU16Encoder()],["publicKeyInstructionIndex",gill.getU16Encoder()],["messageDataOffset",gill.getU16Encoder()],["messageDataSize",gill.getU16Encoder()],["messageInstructionIndex",gill.getU16Encoder()]])}function $f(){return gill.getStructDecoder([["signatureOffset",gill.getU16Decoder()],["signatureInstructionIndex",gill.getU16Decoder()],["publicKeyOffset",gill.getU16Decoder()],["publicKeyInstructionIndex",gill.getU16Decoder()],["messageDataOffset",gill.getU16Decoder()],["messageDataSize",gill.getU16Decoder()],["messageInstructionIndex",gill.getU16Decoder()]])}function Fa(){return gill.createDecoder({read:(e,r=0)=>{let t=gill.getU8Decoder().decode(e,r);r+=1;let o=gill.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=gill.fixDecoderSize(gill.getBytesDecoder(),Pe).decode(e,r);r+=Pe;let u=gill.fixDecoderSize(gill.getBytesDecoder(),_e).decode(e,r);r+=_e;let g=n[a].messageDataSize,l=gill.fixDecoderSize(gill.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 gill.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=gill.getU8Encoder().write(e.numSignatures,r,t),t=gill.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=gill.fixEncoderSize(gill.getBytesEncoder(),Pe).write(n.publicKey,r,t),t=gill.fixEncoderSize(gill.getBytesEncoder(),_e).write(n.signature,r,t),t=gill.getBytesEncoder().write(n.message,r,t);return t}})}function GP(){return gill.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,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?gill.AccountRole.WRITABLE_SIGNER:gill.AccountRole.READONLY_SIGNER:t?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...stateless_js.getLightSystemAccountMetasV2({selfProgram:new web3_js.PublicKey(A.toString())}).map(r=>({address:gill.address(r.pubkey.toString()),role:this.getAccountRole(r.isSigner,r.isWritable)})));}insertOrGet(r,t={address:gill.address(r),role:gill.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===stateless_js.TreeType.StateV1)return this.insertOrGet(r.tree.toString());if(r.treeType===stateless_js.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=stateless_js.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=gill.address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),T1=gill.address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Rt=gill.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:gill.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?gill.some(a):gill.none(),remainingAccounts:xe})),_}async function f1(e,r,t,o,n){let c=m=>gill.getProgramDerivedAddress({seeds:[gill.getAddressEncoder().encode(m),gill.getAddressEncoder().encode(Rt),gill.getAddressEncoder().encode(e)],programAddress:Rt}),i=[gill.getUtf8Encoder().encode("pool"),gill.getAddressEncoder().encode(e)];n.restricted&&i.push(gill.getUtf8Encoder().encode("restricted")),n.index>0&&i.push(gill.getU8Encoder().encode(n.index));let[a,[s],u,[g],[l]]=await Promise.all([programs.getAssociatedTokenAccountAddress(e,t,o),c(t),programs.getAssociatedTokenAccountAddress(e,r,o),c(r),gill.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?programs.getTokenDecoder().decode(gill.getBase64Encoder().encode(e.sourceSplAtaInfo.value.data[0])).amount:BigInt(0),a=BigInt(c?R1(gill.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?gill.some(gill.getArrayDecoder(Le()).decode(o.parsed.tlv)):gill.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 web3_js.PublicKey(e),{mint:new web3_js.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:stateless_js.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:gill.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?gill.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:gill.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:gill.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?gill.some(o):gill.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?gill.some(o):gill.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:gill.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:gill.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(sha2_js.sha256(Je));}let M=sha2_js.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===gill.AccountRole.READONLY_SIGNER||a.role===gill.AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===gill.AccountRole.WRITABLE||a.role===gill.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:gill.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}}
|
|
1
|
+
'use strict';var gill=require('gill'),sha2_js=require('@noble/hashes/sha2.js'),d=require('zod'),stateless_js=require('@lightprotocol/stateless.js'),tinyCbor=require('@levischuck/tiny-cbor'),nist_js=require('@noble/curves/nist.js'),jsonCanonicalize=require('json-canonicalize'),programs=require('gill/programs'),web3_js=require('@solana/web3.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var d__default=/*#__PURE__*/_interopDefault(d);var kr=new Uint8Array([201,232,212,229,59,241,106,197]);function G1(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(kr)}function xi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["authority",gill.getAddressEncoder()],["rpIdHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["bump",gill.getU8Encoder()],["isDisabled",gill.getU8Encoder()],["rpIdLength",gill.getU8Encoder()],["numOrigins",gill.getU8Encoder()],["rpId",gill.fixEncoderSize(gill.getBytesEncoder(),255)],["origins",gill.fixEncoderSize(gill.getBytesEncoder(),515)]]),e=>({...e,discriminator:kr}))}function Or(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["authority",gill.getAddressDecoder()],["rpIdHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["bump",gill.getU8Decoder()],["isDisabled",gill.getU8Decoder()],["rpIdLength",gill.getU8Decoder()],["numOrigins",gill.getU8Decoder()],["rpId",gill.fixDecoderSize(gill.getBytesDecoder(),255)],["origins",gill.fixDecoderSize(gill.getBytesDecoder(),515)]])}function V1(){return gill.combineCodec(xi(),Or())}function Wr(e){return gill.decodeAccount(e,Or())}async function Br(e,r,t){let o=await Ii(e,r,t);return gill.assertAccountExists(o),o}async function Ii(e,r,t){let o=await gill.fetchEncodedAccount(e,r,t);return Wr(o)}async function H1(e,r,t){let o=await Ei(e,r,t);return gill.assertAccountsExist(o),o}async function Ei(e,r,t){return (await gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Fr)}function Wi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:Fr}))}function Gr(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function Y1(){return gill.combineCodec(Wi(),Gr())}function Vr(e){return gill.decodeAccount(e,Gr())}async function J1(e,r,t){let o=await Bi(e,r,t);return gill.assertAccountExists(o),o}async function Bi(e,r,t){let o=await gill.fetchEncodedAccount(e,r,t);return Vr(o)}async function Z1(e,r,t){let o=await Ni(e,r,t);return gill.assertAccountsExist(o),o}async function Ni(e,r,t){return (await gill.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 gill.getEnumEncoder(Ut)}function Lt(){return gill.getEnumDecoder(Ut)}function eS(){return gill.combineCodec(vt(),Lt())}function kt(){return gill.getStructEncoder([["key",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["value",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Ot(){return gill.getStructDecoder([["key",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["value",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function rS(){return gill.combineCodec(kt(),Ot())}function Wt(){return gill.getStructEncoder([["memberKey",h()],["permissions",ae()]])}function Bt(){return gill.getStructDecoder([["memberKey",L()],["permissions",ie()]])}function aS(){return gill.combineCodec(Wt(),Bt())}function Nt(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function wt(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function dS(){return gill.combineCodec(Nt(),wt())}function Ft(){return gill.getStructEncoder([["delegatedAmount",gill.getU64Encoder()],["withheldTransferFee",gill.getU64Encoder()],["isAta",gill.getU8Encoder()]])}function Gt(){return gill.getStructDecoder([["delegatedAmount",gill.getU64Decoder()],["withheldTransferFee",gill.getU64Decoder()],["isAta",gill.getU8Decoder()]])}function lS(){return gill.combineCodec(Ft(),Gt())}function qt(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function jt(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function yS(){return gill.combineCodec(qt(),jt())}function Yt(){return gill.getStructEncoder([["version",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()],["amount",gill.getU64Encoder()],["merkleContext",Xt()],["tlv",gill.getOptionEncoder(gill.getArrayEncoder(Zt()))],["state",vt()]])}function Jt(){return gill.getStructDecoder([["version",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()],["amount",gill.getU64Decoder()],["merkleContext",$t()],["tlv",gill.getOptionDecoder(gill.getArrayDecoder(Le()))],["state",Lt()]])}function xS(){return gill.combineCodec(Yt(),Jt())}function tn(){return gill.getStructEncoder([["decimalsOption",gill.getU8Encoder()],["decimals",gill.getU8Encoder()],["compressionOnly",gill.getBooleanEncoder()],["isAta",gill.getU8Encoder()],["info",rn()]])}function nn(){return gill.getStructDecoder([["decimalsOption",gill.getU8Decoder()],["decimals",gill.getU8Decoder()],["compressionOnly",gill.getBooleanDecoder()],["isAta",gill.getU8Decoder()],["info",on()]])}function bS(){return gill.combineCodec(tn(),nn())}function rn(){return gill.getStructEncoder([["configAccountVersion",gill.getU16Encoder()],["compressToPubkey",gill.getU8Encoder()],["accountVersion",gill.getU8Encoder()],["lamportsPerWrite",gill.getU32Encoder()],["compressionAuthority",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["rentSponsor",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["lastClaimedSlot",gill.getU64Encoder()],["rentExemptionPaid",gill.getU32Encoder()],["reserved",gill.getU32Encoder()],["rentConfig",an()]])}function on(){return gill.getStructDecoder([["configAccountVersion",gill.getU16Decoder()],["compressToPubkey",gill.getU8Decoder()],["accountVersion",gill.getU8Decoder()],["lamportsPerWrite",gill.getU32Decoder()],["compressionAuthority",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["rentSponsor",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["lastClaimedSlot",gill.getU64Decoder()],["rentExemptionPaid",gill.getU32Decoder()],["reserved",gill.getU32Decoder()],["rentConfig",un()]])}function PS(){return gill.combineCodec(rn(),on())}function ke(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(gn())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Wt())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(pn())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function Oe(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(ln())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Bt())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(mn())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function vS(){return gill.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 gill.getStructEncoder([["memberKey",h()],["permissions",ae()]])}function ln(){return gill.getStructDecoder([["memberKey",L()],["permissions",ie()]])}function NS(){return gill.combineCodec(gn(),ln())}function We(){return gill.getStructEncoder([["memberKey",h()],["messageHash",gill.getOptionEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))]])}function Be(){return gill.getStructDecoder([["memberKey",L()],["messageHash",gill.getOptionDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))]])}function VS(){return gill.combineCodec(We(),Be())}function Zt(){return gill.getDiscriminatedUnionEncoder([["Placeholder0",gill.getUnitEncoder()],["Placeholder1",gill.getUnitEncoder()],["Placeholder2",gill.getUnitEncoder()],["Placeholder3",gill.getUnitEncoder()],["Placeholder4",gill.getUnitEncoder()],["Placeholder5",gill.getUnitEncoder()],["Placeholder6",gill.getUnitEncoder()],["Placeholder7",gill.getUnitEncoder()],["Placeholder8",gill.getUnitEncoder()],["Placeholder9",gill.getUnitEncoder()],["Placeholder10",gill.getUnitEncoder()],["Placeholder11",gill.getUnitEncoder()],["Placeholder12",gill.getUnitEncoder()],["Placeholder13",gill.getUnitEncoder()],["Placeholder14",gill.getUnitEncoder()],["Placeholder15",gill.getUnitEncoder()],["Placeholder16",gill.getUnitEncoder()],["Placeholder17",gill.getUnitEncoder()],["Placeholder18",gill.getUnitEncoder()],["TokenMetadata",gill.getStructEncoder([["fields",gill.getTupleEncoder([xn()])]])],["Placeholder20",gill.getUnitEncoder()],["Placeholder21",gill.getUnitEncoder()],["Placeholder22",gill.getUnitEncoder()],["Placeholder23",gill.getUnitEncoder()],["Placeholder24",gill.getUnitEncoder()],["Placeholder25",gill.getUnitEncoder()],["Placeholder26",gill.getUnitEncoder()],["PausableAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([yn()])]])],["PermanentDelegateAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([fn()])]])],["TransferFeeAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([En()])]])],["TransferHookAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([bn()])]])],["CompressedOnly",gill.getStructEncoder([["fields",gill.getTupleEncoder([Ft()])]])],["Compressible",gill.getStructEncoder([["fields",gill.getTupleEncoder([tn()])]])]])}function Le(){return gill.getDiscriminatedUnionDecoder([["Placeholder0",gill.getUnitDecoder()],["Placeholder1",gill.getUnitDecoder()],["Placeholder2",gill.getUnitDecoder()],["Placeholder3",gill.getUnitDecoder()],["Placeholder4",gill.getUnitDecoder()],["Placeholder5",gill.getUnitDecoder()],["Placeholder6",gill.getUnitDecoder()],["Placeholder7",gill.getUnitDecoder()],["Placeholder8",gill.getUnitDecoder()],["Placeholder9",gill.getUnitDecoder()],["Placeholder10",gill.getUnitDecoder()],["Placeholder11",gill.getUnitDecoder()],["Placeholder12",gill.getUnitDecoder()],["Placeholder13",gill.getUnitDecoder()],["Placeholder14",gill.getUnitDecoder()],["Placeholder15",gill.getUnitDecoder()],["Placeholder16",gill.getUnitDecoder()],["Placeholder17",gill.getUnitDecoder()],["Placeholder18",gill.getUnitDecoder()],["TokenMetadata",gill.getStructDecoder([["fields",gill.getTupleDecoder([In()])]])],["Placeholder20",gill.getUnitDecoder()],["Placeholder21",gill.getUnitDecoder()],["Placeholder22",gill.getUnitDecoder()],["Placeholder23",gill.getUnitDecoder()],["Placeholder24",gill.getUnitDecoder()],["Placeholder25",gill.getUnitDecoder()],["Placeholder26",gill.getUnitDecoder()],["PausableAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Tn()])]])],["PermanentDelegateAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Sn()])]])],["TransferFeeAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Dn()])]])],["TransferHookAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Cn()])]])],["CompressedOnly",gill.getStructDecoder([["fields",gill.getTupleDecoder([Gt()])]])],["Compressible",gill.getStructDecoder([["fields",gill.getTupleDecoder([nn()])]])]])}function qS(){return gill.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 gill.getStructEncoder([["pubkey",h()],["role",gill.getU8Encoder()],["permissions",ae()],["padding",gill.getU8Encoder()],["isDelegate",gill.getU8Encoder()]])}function _n(){return gill.getStructDecoder([["pubkey",L()],["role",gill.getU8Decoder()],["permissions",ie()],["padding",gill.getU8Decoder()],["isDelegate",gill.getU8Decoder()]])}function $S(){return gill.combineCodec(Pn(),_n())}function h(){return gill.getStructEncoder([["keyType",gill.getU8Encoder()],["key",gill.fixEncoderSize(gill.getBytesEncoder(),33)]])}function L(){return gill.getStructDecoder([["keyType",gill.getU8Decoder()],["key",gill.fixDecoderSize(gill.getBytesDecoder(),33)]])}function tx(){return gill.combineCodec(h(),L())}function Xt(){return gill.getStructEncoder([["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()],["proveByIndex",gill.getBooleanEncoder()]])}function $t(){return gill.getStructDecoder([["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()],["proveByIndex",gill.getBooleanDecoder()]])}function ox(){return gill.combineCodec(Xt(),$t())}function yn(){return gill.getStructEncoder([])}function Tn(){return gill.getStructDecoder([])}function ax(){return gill.combineCodec(yn(),Tn())}function fn(){return gill.getStructEncoder([])}function Sn(){return gill.getStructDecoder([])}function dx(){return gill.combineCodec(fn(),Sn())}function ae(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function ie(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function lx(){return gill.combineCodec(ae(),ie())}function hn(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(qt())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function Un(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(jt())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function Tx(){return gill.combineCodec(hn(),Un())}function pn(){return gill.getStructEncoder([["memberKey",h()]])}function mn(){return gill.getStructDecoder([["memberKey",L()]])}function Ix(){return gill.combineCodec(pn(),mn())}function an(){return gill.getStructEncoder([["baseRent",gill.getU16Encoder()],["compressionCost",gill.getU16Encoder()],["lamportsPerBytePerEpoch",gill.getU8Encoder()],["maxFundedEpochs",gill.getU8Encoder()],["maxTopUp",gill.getU16Encoder()]])}function un(){return gill.getStructDecoder([["baseRent",gill.getU16Decoder()],["compressionCost",gill.getU16Decoder()],["lamportsPerBytePerEpoch",gill.getU8Decoder()],["maxFundedEpochs",gill.getU8Decoder()],["maxTopUp",gill.getU16Decoder()]])}function bx(){return gill.combineCodec(an(),un())}function kn(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function Ne(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function Rx(){return gill.combineCodec(kn(),Ne())}function N(){return gill.getStructEncoder([["signedMessageIndex",gill.getU8Encoder()],["slotNumber",gill.getU64Encoder()],["originIndex",gill.getU8Encoder()],["crossOrigin",gill.getBooleanEncoder()],["truncatedClientDataJson",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["clientAndDeviceHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function w(){return gill.getStructDecoder([["signedMessageIndex",gill.getU8Decoder()],["slotNumber",gill.getU64Decoder()],["originIndex",gill.getU8Decoder()],["crossOrigin",gill.getBooleanDecoder()],["truncatedClientDataJson",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["clientAndDeviceHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function hx(){return gill.combineCodec(N(),w())}function On(){return gill.getStructEncoder([["verifyArgs",N()],["domainConfigIndex",gill.getU8Encoder()]])}function Wn(){return gill.getStructDecoder([["verifyArgs",w()],["domainConfigIndex",gill.getU8Decoder()]])}function kx(){return gill.combineCodec(On(),Wn())}function Bn(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["isDelegate",gill.getBooleanEncoder()]])}function Nn(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["isDelegate",gill.getBooleanDecoder()]])}function Bx(){return gill.combineCodec(Bn(),Nn())}function wn(){return gill.getStructEncoder([["index",gill.getU8Encoder()],["restricted",gill.getBooleanEncoder()]])}function Fn(){return gill.getStructDecoder([["index",gill.getU8Decoder()],["restricted",gill.getBooleanDecoder()]])}function Fx(){return gill.combineCodec(wn(),Fn())}function xn(){return gill.getStructEncoder([["updateAuthority",gill.getAddressEncoder()],["mint",gill.getAddressEncoder()],["name",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["symbol",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["uri",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["additionalMetadata",gill.getArrayEncoder(kt())]])}function In(){return gill.getStructDecoder([["updateAuthority",gill.getAddressDecoder()],["mint",gill.getAddressDecoder()],["name",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["symbol",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["uri",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["additionalMetadata",gill.getArrayDecoder(Ot())]])}function zx(){return gill.combineCodec(xn(),In())}function jn(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Yn(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function jx(){return gill.combineCodec(jn(),Yn())}function J(){return gill.getDiscriminatedUnionEncoder([["Ed25519",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])],["Secp256r1",gill.getStructEncoder([["fields",gill.getTupleEncoder([On()])]])]])}function Z(){return gill.getDiscriminatedUnionDecoder([["Ed25519",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])],["Secp256r1",gill.getStructDecoder([["fields",gill.getTupleDecoder([Wn()])]])]])}function Xx(){return gill.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 gill.getStructEncoder([["withheldAmount",gill.getU64Encoder()]])}function Dn(){return gill.getStructDecoder([["withheldAmount",gill.getU64Decoder()]])}function nI(){return gill.combineCodec(En(),Dn())}function bn(){return gill.getStructEncoder([["transferring",gill.getU8Encoder()]])}function Cn(){return gill.getStructDecoder([["transferring",gill.getU8Decoder()]])}function sI(){return gill.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 gill.getEnumEncoder(Jn)}function Fe(){return gill.getEnumDecoder(Jn)}function iI(){return gill.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 gill.getEnumEncoder(Ie)}function pe(){return gill.getEnumDecoder(Ie)}function AI(){return gill.combineCodec(le(),pe())}var vo=new Uint8Array([223,179,163,190,177,224,67,173]);function ZI(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(vo)}function xg(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(Pn())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["padding",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]]),e=>({...e,discriminator:vo}))}function ct(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(_n())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["padding",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function XI(){return gill.combineCodec(xg(),ct())}function Lo(e){return gill.decodeAccount(e,ct())}async function ko(e,r,t){let o=await Ig(e,r,t);return gill.assertAccountExists(o),o}async function Ig(e,r,t){let o=await gill.fetchEncodedAccount(e,r,t);return Lo(o)}async function $I(e,r,t){let o=await Eg(e,r,t);return gill.assertAccountsExist(o),o}async function Eg(e,r,t){return (await gill.fetchEncodedAccounts(e,r,t)).map(n=>Lo(n))}var wo=new Uint8Array([90,36,35,219,93,225,110,96]);function nE(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(wo)}function Fg(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["multiWalletSettings",gill.getAddressEncoder()],["multiWalletBump",gill.getU8Encoder()],["canExecute",gill.getBooleanEncoder()],["preauthorizeExecution",gill.getBooleanEncoder()],["validTill",gill.getU64Encoder()],["payer",gill.getAddressEncoder()],["bump",gill.getU8Encoder()],["bufferIndex",gill.getU8Encoder()],["finalBufferHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["finalBufferSize",gill.getU16Encoder()],["creator",h()],["executor",h()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder(h())],["expectedSigners",gill.getArrayEncoder(We())],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:wo}))}function Fo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["multiWalletSettings",gill.getAddressDecoder()],["multiWalletBump",gill.getU8Decoder()],["canExecute",gill.getBooleanDecoder()],["preauthorizeExecution",gill.getBooleanDecoder()],["validTill",gill.getU64Decoder()],["payer",gill.getAddressDecoder()],["bump",gill.getU8Decoder()],["bufferIndex",gill.getU8Decoder()],["finalBufferHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["finalBufferSize",gill.getU16Decoder()],["creator",L()],["executor",L()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["voters",gill.getArrayDecoder(L())],["expectedSigners",gill.getArrayDecoder(Be())],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function rE(){return gill.combineCodec(Fg(),Fo())}function Go(e){return gill.decodeAccount(e,Fo())}async function oE(e,r,t){let o=await Gg(e,r,t);return gill.assertAccountExists(o),o}async function Gg(e,r,t){let o=await gill.fetchEncodedAccount(e,r,t);return Go(o)}async function sE(e,r,t){let o=await Vg(e,r,t);return gill.assertAccountsExist(o),o}async function Vg(e,r,t){return (await gill.fetchEncodedAccounts(e,r,t)).map(n=>Go(n))}var Zo=new Uint8Array([159,117,95,227,239,151,58,236]);function uE(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Zo)}function sl(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["member",h()],["credentialId",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder()))],["transports",gill.getOptionEncoder(gill.getArrayEncoder(we()))],["wallets",gill.getArrayEncoder(Bn())],["role",le()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:Zo}))}function At(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["member",L()],["credentialId",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder()))],["transports",gill.getOptionDecoder(gill.getArrayDecoder(Fe()))],["wallets",gill.getArrayDecoder(Nn())],["role",pe()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["bump",gill.getU8Decoder()]])}function dE(){return gill.combineCodec(sl(),At())}function Xo(e){return gill.decodeAccount(e,At())}async function $o(e,r,t){let o=await cl(e,r,t);return gill.assertAccountExists(o),o}async function cl(e,r,t){let o=await gill.fetchEncodedAccount(e,r,t);return Xo(o)}async function AE(e,r,t){let o=await al(e,r,t);return gill.assertAccountsExist(o),o}async function al(e,r,t){return (await gill.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:gill.AccountRole.READONLY});let o=t.isWritable?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY;return Object.freeze({address:P(t.value),role:Qo(t.value)?gill.upgradeRoleToSigner(o):o,...Qo(t.value)?{signer:t.value}:{}})}}function Qo(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var ss=new Uint8Array([8]);function _E(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ss)}function cs(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(ke())],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:ss}))}function as(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(Oe())],["signers",gill.getArrayDecoder(Z())]])}function hE(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ys)}function or(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["rpId",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["origins",gill.getArrayEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))]]),e=>({...e,discriminator:ys}))}function Ts(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["rpId",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["origins",gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))]])}function NE(){return gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.getBytesEncoder().encode(new Uint8Array([117,115,101,114])),gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Is)}function Es(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["member",kn()],["role",le()],["credentialId",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["transports",gill.getArrayEncoder(we())]]),e=>({...e,discriminator:Is}))}function Ds(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["member",Ne()],["role",pe()],["credentialId",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["transports",gill.getArrayDecoder(Fe())]])}function YE(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ms)}function ar(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Ms}))}function Rs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function nD(){return gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(hs)}function ur(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["role",le()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))]]),e=>({...e,discriminator:hs}))}function Us(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["role",pe()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))]])}function gD(){return gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.getBytesEncoder().encode(new Uint8Array([117,115,101,114])),gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Os)}function Ar(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsIndex",gill.getU128Encoder()]]),e=>({...e,discriminator:Os}))}function Ws(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsIndex",gill.getU128Decoder()]])}function ID(){return gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.getBytesEncoder().encode(new Uint8Array([117,115,101,114])),gill.getAddressEncoder().encode(P(n.initialMember.value))]})),n.settings.value||(n.settings.value=await gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Fs)}function Gs(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:Fs}))}function Vs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function hD(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(qs)}function js(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["newOrigins",gill.getOptionEncoder(gill.getArrayEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())))]]),e=>({...e,discriminator:qs}))}function Ys(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))]])}function ND(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Xs)}function lr(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Xs}))}function $s(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())]])}function qD(){return gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.getBytesEncoder().encode(new Uint8Array([117,115,101,114])),gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(oc)}function sc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())],["delegateTo",gill.getOptionEncoder(gill.getU128Encoder())]]),e=>({...e,discriminator:oc}))}function cc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["delegateTo",gill.getOptionDecoder(gill.getU128Decoder())]])}function nb(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(uc)}function pr(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:uc}))}function dc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["signers",gill.getArrayDecoder(Z())]])}function Ab(){return gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(P(n.settings.value)),gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Tc)}function mr(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["splInterfacePdaArgs",gill.getOptionEncoder(wn())],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccounts",gill.getArrayEncoder(Yt())],["compressedProofArgs",gill.getOptionEncoder(hn())],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:Tc}))}function fc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["splInterfacePdaArgs",gill.getOptionDecoder(Fn())],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccounts",gill.getArrayDecoder(Jt())],["compressedProofArgs",gill.getOptionDecoder(Un())],["signers",gill.getArrayDecoder(Z())]])}function Ib(){return gill.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 gill.getProgramDerivedAddress({programAddress:t,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(P(n.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),n.tokenProgram.value||(n.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),n.sourceSplTokenAccount.value||(n.sourceSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(P(n.source.value)),gill.getAddressEncoder().encode(P(n.tokenProgram.value)),gill.getAddressEncoder().encode(P(n.mint.value))]})),n.sourceCtokenTokenAccount.value||(n.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(P(n.source.value)),gill.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])),gill.getAddressEncoder().encode(P(n.mint.value))]})),n.destinationSplTokenAccount.value||(n.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(P(n.destination.value)),gill.getAddressEncoder().encode(P(n.tokenProgram.value)),gill.getAddressEncoder().encode(P(n.mint.value))]})),n.destinationCtokenTokenAccount.value||(n.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(P(n.destination.value)),gill.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])),gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ec)}function Dc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:Ec}))}function bc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Ub(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Pc)}function _c(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["bufferIndex",gill.getU8Encoder()],["preauthorizeExecution",gill.getBooleanEncoder()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["finalBufferHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["finalBufferSize",gill.getU16Encoder()],["expectedSigners",gill.getArrayEncoder(We())],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:Pc}))}function hc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["bufferIndex",gill.getU8Decoder()],["preauthorizeExecution",gill.getBooleanDecoder()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["finalBufferHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["finalBufferSize",gill.getU16Decoder()],["expectedSigners",gill.getArrayDecoder(Be())],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Fb(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(kc)}function Oc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:kc}))}function Wc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Jb(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Fc)}function Gc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Fc}))}function Vc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function rC(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(qc)}function jc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:qc}))}function Yc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function gC(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode($c)}function Qc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:$c}))}function ea(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function xC(){return gill.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 gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(oa)}function sa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(Nt())],["addressTableLookups",gill.getArrayEncoder(jn())],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:oa}))}function ca(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(wt())],["addressTableLookups",gill.getArrayDecoder(Yn())],["signers",gill.getArrayDecoder(Z())]])}function _C(){return gill.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(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([201,232,212,229,59,241,106,197])),0))return 0;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([42,206,176,58,175,129,130,233])),0))return 1;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([223,179,163,190,177,224,67,173])),0))return 2;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([90,36,35,219,93,225,110,96])),0))return 3;if(gill.containsBytes(r,gill.fixEncoderSize(gill.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(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 1;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 2;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 3;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 4;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 5;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 6;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 7;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 8;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 9;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 10;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 11;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 12;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 13;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 14;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 15;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 16;if(gill.containsBytes(r,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 17;if(gill.containsBytes(r,gill.fixEncoderSize(gill.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 gill.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__default.default.looseObject({publicKey:d__default.default.string(),walletAddress:d__default.default.string(),settingsIndexWithAddress:d__default.default.object({index:d__default.default.union([d__default.default.number(),d__default.default.bigint()])})}),QT=d__default.default.object({devicePublicKey:d__default.default.string(),platform:d__default.default.enum(["web","ios","android"]),userAgent:d__default.default.string().optional(),browser:d__default.default.object({name:d__default.default.string().optional(),version:d__default.default.string().optional(),major:d__default.default.string().optional(),type:d__default.default.string().optional()}).optional(),engine:d__default.default.object({name:d__default.default.string().optional(),version:d__default.default.string().optional()}).optional(),cpu:d__default.default.object({architecture:d__default.default.string().optional()}).optional(),device:d__default.default.object({type:d__default.default.string().optional(),vendor:d__default.default.string().optional(),model:d__default.default.string().optional()}).optional(),os:d__default.default.object({name:d__default.default.string().optional(),version:d__default.default.string().optional()}).optional(),app:d__default.default.object({name:d__default.default.string().optional(),version:d__default.default.string().optional(),build:d__default.default.string().optional()}).optional(),display:d__default.default.object({screenWidth:d__default.default.number().optional(),screenHeight:d__default.default.number().optional(),viewportWidth:d__default.default.number().optional(),viewportHeight:d__default.default.number().optional(),devicePixelRatio:d__default.default.number().optional()}).optional(),locale:d__default.default.string().optional(),timezone:d__default.default.string().optional(),push:d__default.default.object({provider:d__default.default.enum(["expo","fcm","apns"]),token:d__default.default.string()}).optional(),website:d__default.default.string().optional(),nativeApp:d__default.default.string().optional(),createdAt:d__default.default.iso.datetime().optional()}).strict(),ua=d__default.default.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","transfer_intent","change_delegate","change_config"]),bM=d__default.default.object({transactionActionType:ua,transactionAddress:d__default.default.string(),transactionMessageBytes:d__default.default.array(d__default.default.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),ef=d__default.default.object({transactionActionType:ua,transactionAddress:d__default.default.string(),transactionMessageBytes:d__default.default.base64()}).strict(),da=d__default.default.object({phase:d__default.default.literal("start"),clientOrigin:d__default.default.url(),signer:d__default.default.string().optional(),rid:d__default.default.string(),validTill:d__default.default.number(),providerOrigin:d__default.default.string(),rpId:d__default.default.string(),data:d__default.default.object({type:d__default.default.literal("message"),payload:d__default.default.string(),requireTwoFactorAuthentication:d__default.default.boolean().default(false)}).strict()}).strict(),Aa=d__default.default.object({phase:d__default.default.literal("start"),clientOrigin:d__default.default.url(),signer:d__default.default.string().optional(),rid:d__default.default.string(),validTill:d__default.default.number(),providerOrigin:d__default.default.string(),rpId:d__default.default.string(),data:d__default.default.object({type:d__default.default.literal("transaction"),payload:ef}).strict()}).strict(),ga=d__default.default.object({startRequest:d__default.default.union([da,Aa]),authResponse:d__default.default.custom(),client:d__default.default.object({clientOrigin:d__default.default.url(),jws:d__default.default.string()}).strict(),device:d__default.default.object({jwk:d__default.default.base64(),jws:d__default.default.string(),deviceProfile:QT}).strict()}).strict(),la=d__default.default.object({signer:d__default.default.string(),additionalInfo:d__default.default.looseObject({}).optional()}).strict(),tf=d__default.default.object({slotHash:d__default.default.string(),slotNumber:d__default.default.string(),estimatedSlotHashExpiry:d__default.default.number(),originIndex:d__default.default.number(),crossOrigin:d__default.default.boolean()}).strict(),CM=d__default.default.object({phase:d__default.default.literal("complete"),data:d__default.default.object({type:d__default.default.literal("message"),payload:la.extend(ga.shape).extend({startRequest:da,transactionManager:d__default.default.object({publicKey:d__default.default.string(),signature:d__default.default.string()}).optional()})}).strict()}).strict(),MM=d__default.default.object({phase:d__default.default.literal("complete"),data:d__default.default.object({type:d__default.default.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(gill.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 gill.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 gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function sf(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var ma=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(of())],["addressTableLookups",gill.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 gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("user"),e instanceof re?e.toTruncatedBuffer():gill.getAddressEncoder().encode(e)]});return r}async function be({rpIdHash:e,rpId:r}){if(!e)if(r)e=sha2_js.sha256(gill.getUtf8Encoder().encode(r));else throw new k("Either rpId or rpIdHash must be provided");let[t]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("domain_config"),e]});return t}async function xt(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function Sa(e,r,t){fa(t,0,255,"buffer_index");let[o]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),r instanceof re?r.toTruncatedBuffer():gill.getAddressEncoder().encode(r),gill.getU8Encoder().encode(t)]});return o}async function Q(e){let[r]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return r}async function se(e){let[r]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return r}async function ZM(e){let r=await se(e);return await Q(r)}async function XM(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.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=stateless_js.createRpc(e,t,r);let{rpc:o,sendAndConfirmTransaction:n}=gill.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=nist_js.p256.Point.CURVE().n>>1n,f=BigInt("0x"+It(g)),M=(f>m?nist_js.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=sha2_js.sha256(r);return new Uint8Array([...t,...o])}function ER(e){let r=tinyCbor.decodeCBOR(e),t=nist_js.p256.Point.fromAffine({x:BigInt("0x"+It(r.get(-2))),y:BigInt("0x"+It(r.get(-3)))});return gill.getBase58Decoder().decode(t.toBytes(true))}function DR(e){let t=nist_js.p256.Point.fromBytes(gill.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(tinyCbor.encodeCBOR(o))}async function bR(e){let{authenticatorData:r,clientDataJSON:t,signature:o}=e.authResponse.response,n=K(r),c=JSON.parse(gill.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:gill.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 sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...gill.getBase64Encoder().encode(r),...gill.getBase64Encoder().encode(t)]))}function CR(e){return sha2_js.sha256(gill.getUtf8Encoder().encode(jsonCanonicalize.canonicalize(e)))}function MR(e){return Cr(e.data.payload.authResponse)}function RR(e,r,t,o){let n=br(r,t,o);return sha2_js.sha256(new Uint8Array([...gill.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(gill.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=gill.getBase64Encoder().encode(l[0]);c=gill.getU64Decoder().decode(m.subarray(0,8)).toString(),a=m.subarray(8,40),n=gill.getBase58Decoder().decode(a),i=Date.now()+512*400;}else a=gill.getBase58Encoder().encode(n);let s=sha2_js.sha256(typeof e.transactionMessageBytes=="string"?gill.getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),u=br(r,t,o),g=sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e.transactionActionType),...gill.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),...gill.getUtf8Encoder().encode(jsonCanonicalize.canonicalize(r))])}function Cr(e){let r=qe(e);return sha2_js.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 gill.getBase64Decoder().decode(gill.getUtf8Encoder().encode(jsonCanonicalize.canonicalize(e)))}function LR(e){return JSON.parse(gill.getUtf8Decoder().decode(gill.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:gill.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:gill.getBase64Decoder().decode(gill.getTransactionEncoder().encode(f[R])),transactionMessageBytes:n?gill.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]:gill.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?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.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(gill.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]=gill.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?gill.some({signedMessageIndex:r,truncatedClientDataJson:t.verifyArgs.truncatedClientDataJson,slotNumber:t.verifyArgs.slotNumber,originIndex:t.originIndex,crossOrigin:t.crossOrigin,clientAndDeviceHash:t.clientAndDeviceHash}):gill.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:gill.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:gill.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,...gill.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 programs.getTransferSolInstruction({source:e,destination:gill.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:gill.getBase64Decoder().decode(gill.getAddressEncoder().encode(e))}}];if(r)o.push({memcmp:{offset:BigInt(Wa),encoding:"base64",bytes:gill.getBase64Decoder().decode(h().encode(ee(r)))}});else if(t)o.push({memcmp:{offset:BigInt(Bf),encoding:"base64",bytes:gill.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(gill.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:gill.getBase64Decoder().decode(h().encode(ee(e)))}}]}).send()).forEach(n=>{let c=ct().decode(gill.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?gill.AccountRole.WRITABLE_SIGNER:n&&!c?gill.AccountRole.WRITABLE:!n&&c?gill.AccountRole.READONLY_SIGNER:gill.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 gill.fetchAddressesForLookupTables(n.addressTableLookups.map(a=>a.lookupTableAddress),O()):{}),i=[];i.push(...n.addressTableLookups?.map(a=>({role:gill.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:gill.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:gill.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:gill.AccountRole.READONLY_SIGNER,signer:a}):i[s].role===gill.AccountRole.READONLY||i[s].role===gill.AccountRole.READONLY_SIGNER?i[s]={address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}:(i[s].role===gill.AccountRole.WRITABLE||i[s].role===gill.AccountRole.WRITABLE_SIGNER)&&(i[s]={address:a.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:n}}var Pe=33,_e=64,hr=14,Jf=2,Zf=gill.address("Secp256r1SigVerify1111111111111111111111111");function Xf(){return gill.getStructEncoder([["signatureOffset",gill.getU16Encoder()],["signatureInstructionIndex",gill.getU16Encoder()],["publicKeyOffset",gill.getU16Encoder()],["publicKeyInstructionIndex",gill.getU16Encoder()],["messageDataOffset",gill.getU16Encoder()],["messageDataSize",gill.getU16Encoder()],["messageInstructionIndex",gill.getU16Encoder()]])}function $f(){return gill.getStructDecoder([["signatureOffset",gill.getU16Decoder()],["signatureInstructionIndex",gill.getU16Decoder()],["publicKeyOffset",gill.getU16Decoder()],["publicKeyInstructionIndex",gill.getU16Decoder()],["messageDataOffset",gill.getU16Decoder()],["messageDataSize",gill.getU16Decoder()],["messageInstructionIndex",gill.getU16Decoder()]])}function Fa(){return gill.createDecoder({read:(e,r=0)=>{let t=gill.getU8Decoder().decode(e,r);r+=1;let o=gill.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=gill.fixDecoderSize(gill.getBytesDecoder(),Pe).decode(e,r);r+=Pe;let u=gill.fixDecoderSize(gill.getBytesDecoder(),_e).decode(e,r);r+=_e;let g=n[a].messageDataSize,l=gill.fixDecoderSize(gill.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 gill.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=gill.getU8Encoder().write(e.numSignatures,r,t),t=gill.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=gill.fixEncoderSize(gill.getBytesEncoder(),Pe).write(n.publicKey,r,t),t=gill.fixEncoderSize(gill.getBytesEncoder(),_e).write(n.signature,r,t),t=gill.getBytesEncoder().write(n.message,r,t);return t}})}function GP(){return gill.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?gill.AccountRole.WRITABLE_SIGNER:gill.AccountRole.READONLY_SIGNER:t?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...stateless_js.getLightSystemAccountMetasV2({selfProgram:new web3_js.PublicKey(A.toString())}).map(r=>({address:gill.address(r.pubkey.toString()),role:this.getAccountRole(r.isSigner,r.isWritable)})));}insertOrGet(r,t={address:gill.address(r),role:gill.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===stateless_js.TreeType.StateV1)return this.insertOrGet(r.tree.toString());if(r.treeType===stateless_js.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=stateless_js.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=gill.address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),T1=gill.address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Rt=gill.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:gill.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?gill.some(a):gill.none(),remainingAccounts:xe})),_}async function f1(e,r,t,o,n){let c=m=>gill.getProgramDerivedAddress({seeds:[gill.getAddressEncoder().encode(m),gill.getAddressEncoder().encode(Rt),gill.getAddressEncoder().encode(e)],programAddress:Rt}),i=[gill.getUtf8Encoder().encode("pool"),gill.getAddressEncoder().encode(e)];n.restricted&&i.push(gill.getUtf8Encoder().encode("restricted")),n.index>0&&i.push(gill.getU8Encoder().encode(n.index));let[a,[s],u,[g],[l]]=await Promise.all([programs.getAssociatedTokenAccountAddress(e,t,o),c(t),programs.getAssociatedTokenAccountAddress(e,r,o),c(r),gill.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?programs.getTokenDecoder().decode(gill.getBase64Encoder().encode(e.sourceSplAtaInfo.value.data[0])).amount:BigInt(0),a=BigInt(c?R1(gill.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?gill.some(gill.getArrayDecoder(Le()).decode(o.parsed.tlv)):gill.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 web3_js.PublicKey(e),{mint:new web3_js.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:stateless_js.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:gill.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?gill.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:gill.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:gill.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?gill.some(o):gill.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?gill.some(o):gill.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:gill.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:gill.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(sha2_js.sha256(Je));}let M=sha2_js.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===gill.AccountRole.READONLY_SIGNER||a.role===gill.AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===gill.AccountRole.WRITABLE||a.role===gill.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:gill.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
2
|
exports.AccountState=Ut;exports.AuthenticationContextSchema=ga;exports.BaseResponseSchema=la;exports.CHANGE_CONFIG_DISCRIMINATOR=ss;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=ys;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=Is;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=Ms;exports.CREATE_USER_ACCOUNT_DISCRIMINATOR=hs;exports.CREATE_WALLET_DISCRIMINATOR=Os;exports.CompleteMessageRequestSchema=CM;exports.CompleteTransactionRequestSchema=MM;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=Fs;exports.DOMAIN_CONFIG_DISCRIMINATOR=kr;exports.DeviceProfileSchema=QT;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=qs;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=Xs;exports.EDIT_USER_DELEGATE_DISCRIMINATOR=oc;exports.GLOBAL_COUNTER_DISCRIMINATOR=Fr;exports.KeyType=ze;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=iT;exports.MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH=wy;exports.MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING=PT;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=hT;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=UT;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH=qT;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=Vy;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=Gy;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=Qy;exports.MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH=Zy;exports.MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH=Fy;exports.MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH=Yy;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=TT;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=fT;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=ST;exports.MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED=LT;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=AT;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=uT;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=dT;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=oT;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX=KT;exports.MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG=Xy;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=cT;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=yT;exports.MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT=kT;exports.MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS=gT;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=rT;exports.MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG=Ky;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION=Ly;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY=Wy;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=vy;exports.MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS=Oy;exports.MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER=RT;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=CT;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=tT;exports.MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE=zT;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG=Jy;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION=jy;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=nT;exports.MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG=JT;exports.MULTI_WALLET_ERROR__INVALID_USER_ROLE=sT;exports.MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG=YT;exports.MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR=HT;exports.MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE=By;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=DT;exports.MULTI_WALLET_ERROR__MEMBER_NOT_FOUND=BT;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=aT;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS=OT;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT=FT;exports.MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT=ZT;exports.MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR=VT;exports.MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS=WT;exports.MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY=$T;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE=XT;exports.MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA=GT;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=bT;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=pT;exports.MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED=$y;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=zy;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=qy;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=vT;exports.MULTI_WALLET_ERROR__PAYER_MISMATCH=wT;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=Hy;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=ET;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=Ny;exports.MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH=NT;exports.MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS=ky;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=MT;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=eT;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=xT;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=IT;exports.MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING=_T;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=mT;exports.MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY=jT;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=lT;exports.MULTI_WALLET_PROGRAM_ADDRESS=A;exports.MultiWalletAccount=_y;exports.MultiWalletInstruction=hy;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=uc;exports.Permission=$;exports.Permissions=ne;exports.SETTINGS_DISCRIMINATOR=vo;exports.Secp256r1Key=re;exports.SignedSecp256r1Key=I;exports.StartMessageRequestSchema=da;exports.StartTransactionRequestSchema=Aa;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=Tc;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=Ec;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=Pc;exports.TRANSACTION_BUFFER_DISCRIMINATOR=wo;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=kc;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=Fc;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=qc;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=$c;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=oa;exports.TransactionActionTypeSchema=ua;exports.TransactionDetailsSchema=tf;exports.TransactionPayloadSchema=bM;exports.TransactionPayloadWithBase64MessageBytesSchema=ef;exports.Transports=Jn;exports.USER_DISCRIMINATOR=Zo;exports.UserInfoSchema=DM;exports.UserRole=Ie;exports.base64URLStringToBuffer=K;exports.bufferToBase64URLString=hR;exports.changeConfig=J_;exports.closeTransactionBuffer=Kh;exports.configAction=LS;exports.convertBase64StringToJWK=LR;exports.convertJWKToBase64String=vR;exports.convertMemberKeyToString=_a;exports.convertPubkeyCompressedToCose=DR;exports.convertPubkeyCoseToCompressed=ER;exports.createClientAuthorizationCompleteRequestChallenge=MR;exports.createClientAuthorizationStartRequestChallenge=CR;exports.createDomainConfig=EP;exports.createDomainUserAccounts=oh;exports.createGlobalCounter=MP;exports.createMessageChallenge=RR;exports.createTransactionBuffer=ei;exports.createTransactionChallenge=PR;exports.createTransactionManagerSigner=VR;exports.createUserAccounts=uh;exports.createWallet=ph;exports.decodeDomainConfig=Wr;exports.decodeGlobalCounter=Vr;exports.decodeSettings=Lo;exports.decodeTransactionBuffer=Go;exports.decodeUser=Xo;exports.deserializeConfigActions=zR;exports.disableDomainConfig=hP;exports.editDomainConfig=Sh;exports.editTransactionManagerUrl=Dh;exports.editUserDelegate=Uh;exports.executeTransaction=Va;exports.executeTransactionBuffer=ti;exports.executeTransactionSync=Ka;exports.extendTransactionBuffer=ni;exports.extensionStruct=jS;exports.fetchAllDomainConfig=H1;exports.fetchAllGlobalCounter=Z1;exports.fetchAllMaybeDomainConfig=Ei;exports.fetchAllMaybeGlobalCounter=Ni;exports.fetchAllMaybeSettings=Eg;exports.fetchAllMaybeTransactionBuffer=Vg;exports.fetchAllMaybeUser=al;exports.fetchAllSettings=$I;exports.fetchAllSettingsAccountByMember=uP;exports.fetchAllTransactionBuffer=sE;exports.fetchAllUser=AE;exports.fetchDomainConfig=Br;exports.fetchGlobalCounter=J1;exports.fetchMaybeDomainConfig=Ii;exports.fetchMaybeGlobalCounter=Bi;exports.fetchMaybeSettings=Ig;exports.fetchMaybeTransactionBuffer=Gg;exports.fetchMaybeUser=cl;exports.fetchSettings=ko;exports.fetchTransactionBuffer=oE;exports.fetchUser=$o;exports.fetchUserAccountByFilters=iP;exports.getAccountStateCodec=eS;exports.getAccountStateDecoder=Lt;exports.getAccountStateEncoder=vt;exports.getAddMemberArgsCodec=aS;exports.getAddMemberArgsDecoder=Bt;exports.getAddMemberArgsEncoder=Wt;exports.getAdditionalMetadataCodec=rS;exports.getAdditionalMetadataDecoder=Ot;exports.getAdditionalMetadataEncoder=kt;exports.getChangeConfigDiscriminatorBytes=_E;exports.getChangeConfigInstruction=is;exports.getChangeConfigInstructionDataCodec=hE;exports.getChangeConfigInstructionDataDecoder=as;exports.getChangeConfigInstructionDataEncoder=cs;exports.getClientAndDeviceHash=br;exports.getCompiledInstructionCodec=dS;exports.getCompiledInstructionDecoder=wt;exports.getCompiledInstructionEncoder=Nt;exports.getCompressedOnlyExtensionCodec=lS;exports.getCompressedOnlyExtensionDecoder=Gt;exports.getCompressedOnlyExtensionEncoder=Ft;exports.getCompressedProofCodec=yS;exports.getCompressedProofDecoder=jt;exports.getCompressedProofEncoder=qt;exports.getCompressedTokenArgsCodec=xS;exports.getCompressedTokenArgsDecoder=Jt;exports.getCompressedTokenArgsEncoder=Yt;exports.getCompressibleExtensionCodec=bS;exports.getCompressibleExtensionDecoder=nn;exports.getCompressibleExtensionEncoder=tn;exports.getCompressionInfoCodec=PS;exports.getCompressionInfoDecoder=on;exports.getCompressionInfoEncoder=rn;exports.getConfigActionCodec=vS;exports.getConfigActionDecoder=Oe;exports.getConfigActionEncoder=ke;exports.getCreateDomainConfigDiscriminatorBytes=BE;exports.getCreateDomainConfigInstruction=fs;exports.getCreateDomainConfigInstructionAsync=wE;exports.getCreateDomainConfigInstructionDataCodec=NE;exports.getCreateDomainConfigInstructionDataDecoder=Ts;exports.getCreateDomainConfigInstructionDataEncoder=or;exports.getCreateDomainUserAccountDiscriminatorBytes=jE;exports.getCreateDomainUserAccountInstruction=bs;exports.getCreateDomainUserAccountInstructionDataCodec=YE;exports.getCreateDomainUserAccountInstructionDataDecoder=Ds;exports.getCreateDomainUserAccountInstructionDataEncoder=Es;exports.getCreateGlobalCounterDiscriminatorBytes=tD;exports.getCreateGlobalCounterInstruction=rD;exports.getCreateGlobalCounterInstructionAsync=Ps;exports.getCreateGlobalCounterInstructionDataCodec=nD;exports.getCreateGlobalCounterInstructionDataDecoder=Rs;exports.getCreateGlobalCounterInstructionDataEncoder=ar;exports.getCreateUserAccountDiscriminatorBytes=AD;exports.getCreateUserAccountInstruction=vs;exports.getCreateUserAccountInstructionAsync=lD;exports.getCreateUserAccountInstructionDataCodec=gD;exports.getCreateUserAccountInstructionDataDecoder=Us;exports.getCreateUserAccountInstructionDataEncoder=ur;exports.getCreateWalletDiscriminatorBytes=xD;exports.getCreateWalletInstruction=Bs;exports.getCreateWalletInstructionAsync=ED;exports.getCreateWalletInstructionDataCodec=ID;exports.getCreateWalletInstructionDataDecoder=Ws;exports.getCreateWalletInstructionDataEncoder=Ar;exports.getDeviceMessageHash=_R;exports.getDisableDomainConfigDiscriminatorBytes=_D;exports.getDisableDomainConfigInstruction=Hs;exports.getDisableDomainConfigInstructionDataCodec=hD;exports.getDisableDomainConfigInstructionDataDecoder=Vs;exports.getDisableDomainConfigInstructionDataEncoder=Gs;exports.getDomainConfigAddress=be;exports.getDomainConfigCodec=V1;exports.getDomainConfigDecoder=Or;exports.getDomainConfigDiscriminatorBytes=G1;exports.getDomainConfigEncoder=xi;exports.getDomainConfigSize=z1;exports.getEditDomainConfigDiscriminatorBytes=BD;exports.getEditDomainConfigInstruction=Js;exports.getEditDomainConfigInstructionDataCodec=ND;exports.getEditDomainConfigInstructionDataDecoder=Ys;exports.getEditDomainConfigInstructionDataEncoder=js;exports.getEditMemberArgsCodec=NS;exports.getEditMemberArgsDecoder=ln;exports.getEditMemberArgsEncoder=gn;exports.getEditTransactionManagerUrlDiscriminatorBytes=KD;exports.getEditTransactionManagerUrlInstruction=Qs;exports.getEditTransactionManagerUrlInstructionAsync=jD;exports.getEditTransactionManagerUrlInstructionDataCodec=qD;exports.getEditTransactionManagerUrlInstructionDataDecoder=$s;exports.getEditTransactionManagerUrlInstructionDataEncoder=lr;exports.getEditUserDelegateDiscriminatorBytes=tb;exports.getEditUserDelegateInstruction=ac;exports.getEditUserDelegateInstructionDataCodec=nb;exports.getEditUserDelegateInstructionDataDecoder=cc;exports.getEditUserDelegateInstructionDataEncoder=sc;exports.getExpectedSignerCodec=VS;exports.getExpectedSignerDecoder=Be;exports.getExpectedSignerEncoder=We;exports.getExtensionStructCodec=qS;exports.getExtensionStructDecoder=Le;exports.getExtensionStructEncoder=Zt;exports.getGlobalCounterAddress=xt;exports.getGlobalCounterCodec=Y1;exports.getGlobalCounterDecoder=Gr;exports.getGlobalCounterDiscriminatorBytes=j1;exports.getGlobalCounterEncoder=Wi;exports.getGlobalCounterSize=X1;exports.getLightCpiSigner=XM;exports.getLightProtocolRpc=Ke;exports.getMemberCodec=$S;exports.getMemberDecoder=_n;exports.getMemberEncoder=Pn;exports.getMemberKeyCodec=tx;exports.getMemberKeyDecoder=L;exports.getMemberKeyEncoder=h;exports.getMultiWalletErrorMessage=aM;exports.getNativeTransferIntentDiscriminatorBytes=db;exports.getNativeTransferIntentInstruction=Ac;exports.getNativeTransferIntentInstructionAsync=gb;exports.getNativeTransferIntentInstructionDataCodec=Ab;exports.getNativeTransferIntentInstructionDataDecoder=dc;exports.getNativeTransferIntentInstructionDataEncoder=pr;exports.getOriginIndex=UR;exports.getPackedMerkleContextCodec=ox;exports.getPackedMerkleContextDecoder=$t;exports.getPackedMerkleContextEncoder=Xt;exports.getPausableAccountExtensionCodec=ax;exports.getPausableAccountExtensionDecoder=Tn;exports.getPausableAccountExtensionEncoder=yn;exports.getPermanentDelegateAccountExtensionCodec=dx;exports.getPermanentDelegateAccountExtensionDecoder=Sn;exports.getPermanentDelegateAccountExtensionEncoder=fn;exports.getPermissionsCodec=lx;exports.getPermissionsDecoder=ie;exports.getPermissionsEncoder=ae;exports.getProofArgsCodec=Tx;exports.getProofArgsDecoder=Un;exports.getProofArgsEncoder=hn;exports.getRemoveMemberArgsCodec=Ix;exports.getRemoveMemberArgsDecoder=mn;exports.getRemoveMemberArgsEncoder=pn;exports.getRentConfigCodec=bx;exports.getRentConfigDecoder=un;exports.getRentConfigEncoder=an;exports.getSecp256r1MessageHash=Cr;exports.getSecp256r1PubkeyCodec=Rx;exports.getSecp256r1PubkeyDecoder=Ne;exports.getSecp256r1PubkeyEncoder=kn;exports.getSecp256r1SignatureOffsetsDataDecoder=$f;exports.getSecp256r1SignatureOffsetsDataEncoder=Xf;exports.getSecp256r1VerifyArgsCodec=hx;exports.getSecp256r1VerifyArgsDecoder=w;exports.getSecp256r1VerifyArgsEncoder=N;exports.getSecp256r1VerifyArgsWithDomainConfigIndexCodec=kx;exports.getSecp256r1VerifyArgsWithDomainConfigIndexDecoder=Wn;exports.getSecp256r1VerifyArgsWithDomainConfigIndexEncoder=On;exports.getSecp256r1VerifyInstruction=U;exports.getSecp256r1VerifyInstructionDataCodec=GP;exports.getSecp256r1VerifyInstructionDataDecoder=Fa;exports.getSecp256r1VerifyInstructionDataEncoder=Ga;exports.getSendAndConfirmTransaction=oR;exports.getSettingsCodec=XI;exports.getSettingsDecoder=ct;exports.getSettingsDiscriminatorBytes=ZI;exports.getSettingsEncoder=xg;exports.getSettingsFromIndex=se;exports.getSettingsIndexWithDelegateInfoCodec=Bx;exports.getSettingsIndexWithDelegateInfoDecoder=Nn;exports.getSettingsIndexWithDelegateInfoEncoder=Bn;exports.getSignedSecp256r1Key=bR;exports.getSolanaRpc=O;exports.getSolanaRpcEndpoint=rR;exports.getSplInterfacePdaArgsCodec=Fx;exports.getSplInterfacePdaArgsDecoder=Fn;exports.getSplInterfacePdaArgsEncoder=wn;exports.getTokenMetadataCodec=zx;exports.getTokenMetadataDecoder=In;exports.getTokenMetadataEncoder=xn;exports.getTokenTransferIntentDiscriminatorBytes=xb;exports.getTokenTransferIntentInstruction=Sc;exports.getTokenTransferIntentInstructionAsync=Eb;exports.getTokenTransferIntentInstructionDataCodec=Ib;exports.getTokenTransferIntentInstructionDataDecoder=fc;exports.getTokenTransferIntentInstructionDataEncoder=mr;exports.getTransactionBufferAddress=Sa;exports.getTransactionBufferCloseDiscriminatorBytes=hb;exports.getTransactionBufferCloseInstruction=Cc;exports.getTransactionBufferCloseInstructionDataCodec=Ub;exports.getTransactionBufferCloseInstructionDataDecoder=bc;exports.getTransactionBufferCloseInstructionDataEncoder=Dc;exports.getTransactionBufferCodec=rE;exports.getTransactionBufferCreateDiscriminatorBytes=wb;exports.getTransactionBufferCreateInstruction=Uc;exports.getTransactionBufferCreateInstructionDataCodec=Fb;exports.getTransactionBufferCreateInstructionDataDecoder=hc;exports.getTransactionBufferCreateInstructionDataEncoder=_c;exports.getTransactionBufferDecoder=Fo;exports.getTransactionBufferDiscriminatorBytes=nE;exports.getTransactionBufferEncoder=Fg;exports.getTransactionBufferExecuteDiscriminatorBytes=Yb;exports.getTransactionBufferExecuteInstruction=Bc;exports.getTransactionBufferExecuteInstructionDataCodec=Jb;exports.getTransactionBufferExecuteInstructionDataDecoder=Wc;exports.getTransactionBufferExecuteInstructionDataEncoder=Oc;exports.getTransactionBufferExtendDiscriminatorBytes=nC;exports.getTransactionBufferExtendInstruction=Hc;exports.getTransactionBufferExtendInstructionDataCodec=rC;exports.getTransactionBufferExtendInstructionDataDecoder=Vc;exports.getTransactionBufferExtendInstructionDataEncoder=Gc;exports.getTransactionBufferVoteDiscriminatorBytes=AC;exports.getTransactionBufferVoteInstruction=Jc;exports.getTransactionBufferVoteInstructionDataCodec=gC;exports.getTransactionBufferVoteInstructionDataDecoder=Yc;exports.getTransactionBufferVoteInstructionDataEncoder=jc;exports.getTransactionExecuteDiscriminatorBytes=SC;exports.getTransactionExecuteInstruction=ta;exports.getTransactionExecuteInstructionDataCodec=xC;exports.getTransactionExecuteInstructionDataDecoder=ea;exports.getTransactionExecuteInstructionDataEncoder=Qc;exports.getTransactionExecuteSyncDiscriminatorBytes=PC;exports.getTransactionExecuteSyncInstruction=aa;exports.getTransactionExecuteSyncInstructionDataCodec=_C;exports.getTransactionExecuteSyncInstructionDataDecoder=ca;exports.getTransactionExecuteSyncInstructionDataEncoder=sa;exports.getTransactionMessageAddressTableLookupCodec=jx;exports.getTransactionMessageAddressTableLookupDecoder=Yn;exports.getTransactionMessageAddressTableLookupEncoder=jn;exports.getTransactionSyncSignersCodec=Xx;exports.getTransactionSyncSignersDecoder=Z;exports.getTransactionSyncSignersEncoder=J;exports.getTransferFeeAccountExtensionCodec=nI;exports.getTransferFeeAccountExtensionDecoder=Dn;exports.getTransferFeeAccountExtensionEncoder=En;exports.getTransferHookAccountExtensionCodec=sI;exports.getTransferHookAccountExtensionDecoder=Cn;exports.getTransferHookAccountExtensionEncoder=bn;exports.getTransportsCodec=iI;exports.getTransportsDecoder=Fe;exports.getTransportsEncoder=we;exports.getUserAddress=v;exports.getUserCodec=dE;exports.getUserDecoder=At;exports.getUserDiscriminatorBytes=uE;exports.getUserEncoder=sl;exports.getUserRoleCodec=AI;exports.getUserRoleDecoder=pe;exports.getUserRoleEncoder=le;exports.getVersionFromDiscriminator=P1;exports.getWalletAddressFromIndex=ZM;exports.getWalletAddressFromSettings=Q;exports.identifyMultiWalletAccount=eM;exports.identifyMultiWalletInstruction=tM;exports.initialize=sR;exports.isConfigAction=kS;exports.isExtensionStruct=YS;exports.isMultiWalletError=iM;exports.isTransactionSyncSigners=Qx;exports.nativeTransferIntent=E_;exports.parseChangeConfigInstruction=UE;exports.parseCreateDomainConfigInstruction=FE;exports.parseCreateDomainUserAccountInstruction=JE;exports.parseCreateGlobalCounterInstruction=oD;exports.parseCreateUserAccountInstruction=pD;exports.parseCreateWalletInstruction=DD;exports.parseDisableDomainConfigInstruction=UD;exports.parseEditDomainConfigInstruction=wD;exports.parseEditTransactionManagerUrlInstruction=YD;exports.parseEditUserDelegateInstruction=rb;exports.parseNativeTransferIntentInstruction=lb;exports.parseSecp256r1VerifyInstruction=VP;exports.parseTokenTransferIntentInstruction=Db;exports.parseTransactionBufferCloseInstruction=vb;exports.parseTransactionBufferCreateInstruction=Gb;exports.parseTransactionBufferExecuteInstruction=Zb;exports.parseTransactionBufferExtendInstruction=oC;exports.parseTransactionBufferVoteInstruction=lC;exports.parseTransactionExecuteInstruction=IC;exports.parseTransactionExecuteSyncInstruction=hC;exports.prepareChangeConfigArgs=UU;exports.prepareTransactionBundle=NU;exports.prepareTransactionMessage=XU;exports.prepareTransactionSync=nv;exports.retrieveTransactionManager=GR;exports.serializeConfigActions=HR;exports.tokenTransferIntent=w_;exports.transactionSyncSigners=$x;exports.vaultTransactionMessageDeserialize=Ta;exports.vaultTransactionMessageSerialize=ya;exports.voteTransactionBuffer=ri;//# sourceMappingURL=index.cjs.map
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|