@revibase/core 0.0.40 → 0.0.41

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 CHANGED
@@ -1,3 +1,3 @@
1
- 'use strict';var gill=require('gill'),stateless_js=require('@lightprotocol/stateless.js'),sha2_js=require('@noble/hashes/sha2.js'),web3_js=require('@solana/web3.js'),programs=require('gill/programs'),nist_js=require('@noble/curves/nist.js'),tinyCbor=require('@levischuck/tiny-cbor'),utils_js=require('@noble/curves/utils.js');var zr=1644,sr=2e5,Es=1.1,Ds=30,Ms=3e3,_e=3,ve=500,or=2,cr=3e4,Kr=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Ps="https://mainnet.block-engine.jito.wtf/api/v1",Rs="https://bundles.jito.wtf/api/v1/bundles/tip_floor",hs="landed_tips_75th_percentile",bs=255,_s=400,vs=429,jr=500;var xe=class extends Error{constructor(r,s,t){super(r);this.code=s;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},Ue=class extends xe{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},$=class extends xe{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},H=class extends xe{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},Ie=class extends xe{constructor(r,s,t){super(r,"NETWORK_ERROR",{statusCode:s,url:t});this.statusCode=s;this.url=t;}},Us=class extends xe{constructor(r,s,t){super(r,"TRANSACTION_ERROR",{signature:s,logs:t});this.signature=s;this.logs=t;}},ue=class extends xe{constructor(r,s,t){super(r,"BUNDLE_ERROR",{bundleId:s,attempt:t});this.bundleId=s;this.attempt=t;}},ar=class extends xe{constructor(r,s,t){super(`Operation "${r}" failed after ${s} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=s;this.lastError=t;}},ir=class extends xe{constructor(r,s,t){super(r,"PERMISSION_ERROR",{required:s,actual:t});this.required=s;this.actual=t;}};var Ws=new Uint8Array([201,232,212,229,59,241,106,197]);function pD(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Ws)}function Gu(){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:Ws}))}function Ls(){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 mD(){return gill.combineCodec(Gu(),Ls())}function ks(e){return gill.decodeAccount(e,Ls())}async function Os(e,n,r){let s=await zu(e,n,r);return gill.assertAccountExists(s),s}async function zu(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return ks(s)}async function TD(e,n,r){let s=await Ku(e,n,r);return gill.assertAccountsExist(s),s}async function Ku(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>ks(t))}function yD(){return 846}var ws=new Uint8Array([42,206,176,58,175,129,130,233]);function SD(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(ws)}function oA(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:ws}))}function Vs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function xD(){return gill.combineCodec(oA(),Vs())}function Hs(e){return gill.decodeAccount(e,Vs())}async function ID(e,n,r){let s=await cA(e,n,r);return gill.assertAccountExists(s),s}async function cA(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Hs(s)}async function CD(e,n,r){let s=await aA(e,n,r);return gill.assertAccountsExist(s),s}async function aA(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Hs(t))}function ED(){return 24}function Jr(){return gill.getStructEncoder([["memberKey",ee()],["permissions",Ve()],["userReadonlyArgs",Pe()]])}function Yr(){return gill.getStructDecoder([["memberKey",te()],["permissions",He()],["userReadonlyArgs",Re()]])}function RD(){return gill.combineCodec(Jr(),Yr())}function qr(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Zr(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function _D(){return gill.combineCodec(qr(),Zr())}function lt(){return gill.getStructEncoder([["treeInfo",St()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["outputStateTreeIndex",gill.getU8Encoder()]])}function ft(){return gill.getStructDecoder([["treeInfo",xt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["outputStateTreeIndex",gill.getU8Decoder()]])}function LD(){return gill.combineCodec(lt(),ft())}function It(){return gill.getStructEncoder([["treeInfo",St()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Ct(){return gill.getStructDecoder([["treeInfo",xt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function ND(){return gill.combineCodec(It(),Ct())}function tn(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function rn(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function HD(){return gill.combineCodec(tn(),rn())}function Et(){return gill.getStructEncoder([["data",gill.getOptionEncoder(Dt())]])}function j(){return gill.getStructDecoder([["data",gill.getOptionDecoder(Mt())]])}function KD(){return gill.combineCodec(Et(),j())}function Dt(){return gill.getStructEncoder([["threshold",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["index",gill.getU128Encoder()],["multiWalletBump",gill.getU8Encoder()],["members",gill.getArrayEncoder(Pt())],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]])}function Mt(){return gill.getStructDecoder([["threshold",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["index",gill.getU128Decoder()],["multiWalletBump",gill.getU8Decoder()],["members",gill.getArrayDecoder(Rt())],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function qD(){return gill.combineCodec(Dt(),Mt())}function Fe(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(on())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Jr())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(an())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function Ge(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(cn())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Yr())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(dn())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function $D(){return gill.combineCodec(Fe(),Ge())}function eM(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function tM(e,n){return n.__kind===e}function un(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",ze()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",ye()]])}function An(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",Ke()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",le()]])}function oM(){return gill.combineCodec(un(),An())}function on(){return gill.getStructEncoder([["memberKey",ee()],["permissions",Ve()]])}function cn(){return gill.getStructDecoder([["memberKey",te()],["permissions",He()]])}function dM(){return gill.combineCodec(on(),cn())}function ht(){return gill.getStructEncoder([["memberKey",ee()],["messageHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function bt(){return gill.getStructDecoder([["memberKey",te()],["messageHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function pM(){return gill.combineCodec(ht(),bt())}function gn(){return gill.getStructEncoder([["settingsMutArgs",F()],["transactionManager",gill.getOptionEncoder(Pe())]])}function pn(){return gill.getStructDecoder([["settingsMutArgs",G()],["transactionManager",gill.getOptionDecoder(Re())]])}function lM(){return gill.combineCodec(gn(),pn())}function Pt(){return gill.getStructEncoder([["pubkey",ee()],["permissions",Ve()],["role",gill.getU8Encoder()],["userAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getU8Encoder()]])}function Rt(){return gill.getStructDecoder([["pubkey",te()],["permissions",He()],["role",gill.getU8Decoder()],["userAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getU8Decoder()]])}function IM(){return gill.combineCodec(Pt(),Rt())}function ee(){return gill.getStructEncoder([["keyType",gill.getU8Encoder()],["key",gill.fixEncoderSize(gill.getBytesEncoder(),33)]])}function te(){return gill.getStructDecoder([["keyType",gill.getU8Decoder()],["key",gill.fixDecoderSize(gill.getBytesDecoder(),33)]])}function DM(){return gill.combineCodec(ee(),te())}function yn(){return gill.getStructEncoder([["authorityCreationArgs",ye()],["compressedProofArgs",C()]])}function ln(){return gill.getStructDecoder([["authorityCreationArgs",le()],["compressedProofArgs",E()]])}function hM(){return gill.combineCodec(yn(),ln())}function _t(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function vt(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function vM(){return gill.combineCodec(_t(),vt())}function fn(){return gill.getStructEncoder([["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()],["proveByIndex",gill.getBooleanEncoder()]])}function Sn(){return gill.getStructDecoder([["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()],["proveByIndex",gill.getBooleanDecoder()]])}function LM(){return gill.combineCodec(fn(),Sn())}function St(){return gill.getStructEncoder([["rootIndex",gill.getU16Encoder()],["proveByIndex",gill.getBooleanEncoder()],["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()]])}function xt(){return gill.getStructDecoder([["rootIndex",gill.getU16Decoder()],["proveByIndex",gill.getBooleanDecoder()],["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()]])}function BM(){return gill.combineCodec(St(),xt())}function Ve(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function He(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function VM(){return gill.combineCodec(Ve(),He())}function C(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(tn())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function E(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(rn())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function zM(){return gill.combineCodec(C(),E())}function an(){return gill.getStructEncoder([["memberKey",ee()],["userArgs",xn()]])}function dn(){return gill.getStructDecoder([["memberKey",te()],["userArgs",In()]])}function YM(){return gill.combineCodec(an(),dn())}function Cn(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function Ut(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function XM(){return gill.combineCodec(Cn(),Ut())}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 eP(){return gill.combineCodec(N(),w())}function J(){return gill.getStructEncoder([["domainConfigKey",gill.getAddressEncoder()],["verifyArgs",N()]])}function Y(){return gill.getStructDecoder([["domainConfigKey",gill.getAddressDecoder()],["verifyArgs",w()]])}function sP(){return gill.combineCodec(J(),Y())}function Wt(){return gill.getStructEncoder([["addressTreeInfo",_t()],["outputStateTreeIndex",gill.getU8Encoder()]])}function Lt(){return gill.getStructDecoder([["addressTreeInfo",vt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function iP(){return gill.combineCodec(Wt(),Lt())}function kt(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function Ot(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function AP(){return gill.combineCodec(kt(),Ot())}function F(){return gill.getStructEncoder([["accountMeta",lt()],["data",Et()]])}function G(){return gill.getStructDecoder([["accountMeta",ft()],["data",j()]])}function TP(){return gill.combineCodec(F(),G())}function Bt(){return gill.getStructEncoder([["accountMeta",It()],["data",Et()]])}function Nt(){return gill.getStructDecoder([["accountMeta",Ct()],["data",j()]])}function SP(){return gill.combineCodec(Bt(),Nt())}function wt(){return gill.getStructEncoder([["version",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()],["amount",gill.getU64Encoder()],["merkleContext",fn()]])}function Vt(){return gill.getStructDecoder([["version",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()],["amount",gill.getU64Decoder()],["merkleContext",Sn()]])}function EP(){return gill.combineCodec(wt(),Vt())}function Ht(){return gill.getStructEncoder([["bufferIndex",gill.getU8Encoder()],["preauthorizeExecution",gill.getBooleanEncoder()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["finalBufferHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["finalBufferSize",gill.getU16Encoder()],["expectedSecp256r1Signers",gill.getArrayEncoder(ht())]])}function Ft(){return gill.getStructDecoder([["bufferIndex",gill.getU8Decoder()],["preauthorizeExecution",gill.getBooleanDecoder()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["finalBufferHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["finalBufferSize",gill.getU16Decoder()],["expectedSecp256r1Signers",gill.getArrayDecoder(bt())]])}function RP(){return gill.combineCodec(Ht(),Ft())}function Gt(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(qr())],["addressTableLookups",gill.getArrayEncoder(En())]])}function zt(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(Zr())],["addressTableLookups",gill.getArrayDecoder(Dn())]])}function vP(){return gill.combineCodec(Gt(),zt())}function En(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Dn(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function LP(){return gill.combineCodec(En(),Dn())}function je(){return gill.getStructEncoder([["member",ee()],["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["role",ze()],["delegatedTo",gill.getOptionEncoder(kt())],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function q(){return gill.getStructDecoder([["member",te()],["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["role",Ke()],["delegatedTo",gill.getOptionDecoder(Ot())],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function NP(){return gill.combineCodec(je(),q())}function ye(){return gill.getStructEncoder([["addressTreeInfo",_t()],["outputStateTreeIndex",gill.getU8Encoder()]])}function le(){return gill.getStructDecoder([["addressTreeInfo",vt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function FP(){return gill.combineCodec(ye(),le())}function Je(){return gill.getStructEncoder([["accountMeta",lt()],["data",je()]])}function Ye(){return gill.getStructDecoder([["accountMeta",ft()],["data",q()]])}function jP(){return gill.combineCodec(Je(),Ye())}function Pe(){return gill.getStructEncoder([["accountMeta",It()],["data",je()]])}function Re(){return gill.getStructDecoder([["accountMeta",Ct()],["data",q()]])}function ZP(){return gill.combineCodec(Pe(),Re())}function xn(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([Pe()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([Je()])]])]])}function In(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([Re()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([Ye()])]])]])}function eR(){return gill.combineCodec(xn(),In())}function tR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function rR(e,n){return n.__kind===e}var rt=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(rt||{});function ze(){return gill.getEnumEncoder(rt)}function Ke(){return gill.getEnumDecoder(rt)}function oR(){return gill.combineCodec(ze(),Ke())}var Mo=new Uint8Array([223,179,163,190,177,224,67,173]);function YR(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Mo)}function Wm(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(Pt())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]]),e=>({...e,discriminator:Mo}))}function Po(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(Rt())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function qR(){return gill.combineCodec(Wm(),Po())}function Ro(e){return gill.decodeAccount(e,Po())}async function ZR(e,n,r){let s=await Rn(e,n,r);return gill.assertAccountExists(s),s}async function Rn(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Ro(s)}async function XR(e,n,r){let s=await Lm(e,n,r);return gill.assertAccountsExist(s),s}async function Lm(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Ro(t))}var Uo=new Uint8Array([90,36,35,219,93,225,110,96]);function th(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Uo)}function Qm(){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",ee()],["executor",ee()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder(ee())],["expectedSecp256r1Signers",gill.getArrayEncoder(ht())],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Uo}))}function Wo(){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",te()],["executor",te()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["voters",gill.getArrayDecoder(te())],["expectedSecp256r1Signers",gill.getArrayDecoder(bt())],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function rh(){return gill.combineCodec(Qm(),Wo())}function Lo(e){return gill.decodeAccount(e,Wo())}async function ko(e,n,r){let s=await $m(e,n,r);return gill.assertAccountExists(s),s}async function $m(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Lo(s)}async function nh(e,n,r){let s=await eT(e,n,r);return gill.assertAccountsExist(s),s}async function eT(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Lo(t))}var No=new Uint8Array([105,23,173,2,197,255,80,87]);function ch(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(No)}function fT(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:No}))}function wo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function ah(){return gill.combineCodec(fT(),wo())}function Vo(e){return gill.decodeAccount(e,wo())}async function Ho(e,n,r){let s=await ST(e,n,r);return gill.assertAccountExists(s),s}async function ST(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Vo(s)}async function ih(e,n,r){let s=await xT(e,n,r);return gill.assertAccountsExist(s),s}async function xT(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Vo(t))}function m({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function Go(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function v(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function T(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:gill.AccountRole.READONLY});let s=r.isWritable?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY;return Object.freeze({address:v(r.value),role:Fo(r.value)?gill.upgradeRoleToSigner(s):s,...Fo(r.value)?{signer:r.value}:{}})}}function Fo(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var Ko=new Uint8Array([8]);function Mh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ko)}function kn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:Ko}))}function jo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function Ph(){return gill.combineCodec(kn(),jo())}async function Jo(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:kn().encode(c),programAddress:r})}function Rh(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:kn().encode(c),programAddress:r})}function hh(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:jo().decode(e.data)}}var Qo=new Uint8Array([9]);function kh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Qo)}function Bn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsIndex",gill.getU128Encoder()],["configActions",gill.getArrayEncoder(Fe())],["secp256r1VerifyArgs",gill.getArrayEncoder(J())],["compressedProofArgs",gill.getOptionEncoder(C())]]),e=>({...e,discriminator:Qo}))}function $o(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsIndex",gill.getU128Decoder()],["configActions",gill.getArrayDecoder(Ge())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["compressedProofArgs",gill.getOptionDecoder(E())]])}function Oh(){return gill.combineCodec(Bn(),$o())}async function ec(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.settings.value||(t.settings.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getU128Encoder().encode(Go(c.settingsIndex))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Bn().encode(c),programAddress:r})}function Bh(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Bn().encode(c),programAddress:r})}function Nh(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:$o().decode(e.data)}}var oc=new Uint8Array([19]);function Kh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(oc)}function cc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(Fe())],["secp256r1VerifyArgs",gill.getArrayEncoder(J())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:oc}))}function ac(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(Ge())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",G()],["compressedProofArgs",E()]])}function jh(){return gill.combineCodec(cc(),ac())}function ic(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:cc().encode(c),programAddress:r})}function Jh(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:ac().decode(e.data)}}var Ac=new Uint8Array([18]);function eb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ac)}function Nn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",C()],["settingsCreation",Wt()],["userReadonlyArgs",Pe()],["settingsIndex",gill.getU128Encoder()]]),e=>({...e,discriminator:Ac}))}function gc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",E()],["settingsCreation",Lt()],["userReadonlyArgs",Re()],["settingsIndex",gill.getU128Decoder()]])}function tb(){return gill.combineCodec(Nn(),gc())}async function pc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Nn().encode(c),programAddress:r})}function rb(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Nn().encode(c),programAddress:r})}function nb(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:gc().decode(e.data)}}var Ic=new Uint8Array([0]);function ub(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ic)}function Vn(){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()))],["authorityCreationArgs",ye()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ic}))}function Cc(){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()))],["authorityCreationArgs",le()],["compressedProofArgs",E()]])}function Ab(){return gill.combineCodec(Vn(),Cc())}async function Ec(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Vn().encode(c),programAddress:r})}function gb(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Vn().encode(c),programAddress:r})}function pb(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Cc().decode(e.data)}}var Mc=new Uint8Array([4]);function xb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Mc)}function Fn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",C()],["member",Cn()],["role",ze()],["userAccountCreationArgs",ye()],["linkWalletArgs",gill.getOptionEncoder(gn())]]),e=>({...e,discriminator:Mc}))}function Pc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",E()],["member",Ut()],["role",Ke()],["userAccountCreationArgs",le()],["linkWalletArgs",gill.getOptionDecoder(pn())]])}function Ib(){return gill.combineCodec(Fn(),Pc())}async function Rc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:Fn().encode(c),programAddress:r})}function Cb(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:Fn().encode(c),programAddress:r})}function Eb(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:Pc().decode(e.data)}}var bc=new Uint8Array([3]);function bb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(bc)}function zn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:bc}))}function _c(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function _b(){return gill.combineCodec(zn(),_c())}async function vc(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=T(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:zn().encode({}),programAddress:r})}function vb(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=T(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:zn().encode({}),programAddress:r})}function Ub(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:_c().decode(e.data)}}var Wc=new Uint8Array([5]);function wb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Wc)}function jn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",C()],["createUserArgs",gill.getArrayEncoder(un())]]),e=>({...e,discriminator:Wc}))}function Lc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",E()],["createUserArgs",gill.getArrayDecoder(An())]])}function Vb(){return gill.combineCodec(jn(),Lc())}async function kc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:jn().encode(c),programAddress:r})}function Hb(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:jn().encode(c),programAddress:r})}function Fb(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Lc().decode(e.data)}}var Nc=new Uint8Array([17]);function qb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Nc)}function wc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMutArgs",F()],["compressedProofArgs",C()],["secp256r1VerifyArgs",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:Nc}))}function Vc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMutArgs",G()],["compressedProofArgs",E()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function Zb(){return gill.combineCodec(wc(),Vc())}function Hc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:wc().encode(c),programAddress:r})}function Xb(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Vc().decode(e.data)}}var zc=new Uint8Array([2]);function n_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(zc)}function Kc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:zc}))}function jc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function s_(){return gill.combineCodec(Kc(),jc())}function Jc(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:Kc().encode(c),programAddress:r})}function o_(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:jc().decode(e.data)}}var Xc=new Uint8Array([1]);function g_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Xc)}function Yn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["newOrigins",gill.getOptionEncoder(gill.getArrayEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())))],["newAuthorityArgs",gill.getOptionEncoder(yn())]]),e=>({...e,discriminator:Xc}))}function Qc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))],["newAuthorityArgs",gill.getOptionDecoder(ln())]])}function p_(){return gill.combineCodec(Yn(),Qc())}async function m_(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Yn().encode(c),programAddress:r})}function $c(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Yn().encode(c),programAddress:r})}function T_(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:Qc().decode(e.data)}}var ra=new Uint8Array([6]);function C_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ra)}function na(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Je()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",C()]]),e=>({...e,discriminator:ra}))}function sa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Ye()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",E()]])}function E_(){return gill.combineCodec(na(),sa())}function oa(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.authority),...i],data:na().encode(c),programAddress:r})}function D_(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:sa().decode(e.data)}}var ia=new Uint8Array([7]);function v_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ia)}function da(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Je()],["secp256r1VerifyArgs",gill.getOptionEncoder(N())],["delegateTo",gill.getOptionEncoder(kt())],["oldSettingsMutArgs",gill.getOptionEncoder(F())],["newSettingsMutArgs",gill.getOptionEncoder(F())],["compressedProofArgs",C()]]),e=>({...e,discriminator:ia}))}function ua(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Ye()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["delegateTo",gill.getOptionDecoder(Ot())],["oldSettingsMutArgs",gill.getOptionDecoder(G())],["newSettingsMutArgs",gill.getOptionDecoder(G())],["compressedProofArgs",E()]])}function U_(){return gill.combineCodec(da(),ua())}function Aa(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...i],data:da().encode(c),programAddress:r})}function W_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:ua().decode(e.data)}}var ma=new Uint8Array([32]);function V_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ma)}function Ta(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Dt()],["compressedProofArgs",C()],["settingsCreationArgs",Wt()]]),e=>({...e,discriminator:ma}))}function ya(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Mt()],["compressedProofArgs",E()],["settingsCreationArgs",Lt()]])}function H_(){return gill.combineCodec(Ta(),ya())}function la(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.authority),...i],data:Ta().encode(c),programAddress:r})}function F_(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:ya().decode(e.data)}}var xa=new Uint8Array([31]);function q_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(xa)}function Ia(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",je()],["compressedProofArgs",C()],["userCreationArgs",ye()]]),e=>({...e,discriminator:xa}))}function Ca(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",q()],["compressedProofArgs",E()],["userCreationArgs",le()]])}function Z_(){return gill.combineCodec(Ia(),Ca())}function Ea(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.authority),...i],data:Ia().encode(c),programAddress:r})}function X_(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Ca().decode(e.data)}}var Ma=new Uint8Array([29]);function sv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ma)}function qn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:Ma}))}function Pa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function ov(){return gill.combineCodec(qn(),Pa())}async function cv(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(v(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:qn().encode(c),programAddress:r})}function Ra(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:qn().encode(c),programAddress:r})}function av(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Pa().decode(e.data)}}var _a=new Uint8Array([27]);function mv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(_a)}function va(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(J())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:_a}))}function Ua(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",G()],["compressedProofArgs",E()]])}function Tv(){return gill.combineCodec(va(),Ua())}function Wa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:va().encode(c),programAddress:r})}function yv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Ua().decode(e.data)}}var Ba=new Uint8Array([30]);function Ev(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ba)}function Zn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccount",gill.getOptionEncoder(wt())],["compressedProofArgs",gill.getOptionEncoder(C())],["secp256r1VerifyArgs",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:Ba}))}function Na(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccount",gill.getOptionDecoder(Vt())],["compressedProofArgs",gill.getOptionDecoder(E())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function Dv(){return gill.combineCodec(Zn(),Na())}async function Mv(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(v(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(v(t.source.value)),gill.getAddressEncoder().encode(v(t.tokenProgram.value)),gill.getAddressEncoder().encode(v(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(v(t.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(v(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(v(t.destination.value)),gill.getAddressEncoder().encode(v(t.tokenProgram.value)),gill.getAddressEncoder().encode(v(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(v(t.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(v(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.splInterfacePda.value||(t.splInterfacePda.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getBytesEncoder().encode(new Uint8Array([112,111,111,108])),gill.getAddressEncoder().encode(v(t.mint.value))]})),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Zn().encode(c),programAddress:r})}function wa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Zn().encode(c),programAddress:r})}function Pv(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:Na().decode(e.data)}}var Ha=new Uint8Array([28]);function Wv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ha)}function Xn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccount",gill.getOptionEncoder(wt())],["secp256r1VerifyArgs",gill.getArrayEncoder(J())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ha}))}function Fa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccount",gill.getOptionDecoder(Vt())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",G()],["compressedProofArgs",E()]])}function Lv(){return gill.combineCodec(Xn(),Fa())}async function kv(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(v(t.source.value)),gill.getAddressEncoder().encode(v(t.tokenProgram.value)),gill.getAddressEncoder().encode(v(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(v(t.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(v(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(v(t.destination.value)),gill.getAddressEncoder().encode(v(t.tokenProgram.value)),gill.getAddressEncoder().encode(v(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(v(t.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(v(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.splInterfacePda.value||(t.splInterfacePda.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getBytesEncoder().encode(new Uint8Array([112,111,111,108])),gill.getAddressEncoder().encode(v(t.mint.value))]})),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Xn().encode(c),programAddress:r})}function Ga(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Xn().encode(c),programAddress:r})}function Ov(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:Fa().decode(e.data)}}var ja=new Uint8Array([13]);function Gv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ja)}function Ja(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:ja}))}function Ya(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function zv(){return gill.combineCodec(Ja(),Ya())}function qa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ja().encode(c),programAddress:r})}function Kv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ya().decode(e.data)}}var Qa=new Uint8Array([23]);function Qv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Qa)}function $a(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Qa}))}function ei(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsMutArgs",G()],["compressedProofArgs",E()]])}function $v(){return gill.combineCodec($a(),ei())}function ti(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:$a().encode(c),programAddress:r})}function eU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ei().decode(e.data)}}var si=new Uint8Array([10]);function aU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(si)}function oi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Ht()],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:si}))}function ci(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Ft()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function iU(){return gill.combineCodec(oi(),ci())}function ai(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:oi().encode(c),programAddress:r})}function dU(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:ci().decode(e.data)}}var ui=new Uint8Array([20]);function yU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ui)}function Ai(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Ht()],["secp256r1VerifyArgs",gill.getOptionEncoder(N())],["settingsReadonlyArgs",Bt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ui}))}function gi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Ft()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",Nt()],["compressedProofArgs",E()]])}function lU(){return gill.combineCodec(Ai(),gi())}function pi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:Ai().encode(c),programAddress:r})}function fU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:gi().decode(e.data)}}var yi=new Uint8Array([14]);function MU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(yi)}function li(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:yi}))}function fi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function PU(){return gill.combineCodec(li(),fi())}function Si(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:li().encode(c),programAddress:r})}function RU(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:fi().decode(e.data)}}var Ci=new Uint8Array([24]);function LU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ci)}function Ei(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ci}))}function Di(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsMutArgs",G()],["compressedProofArgs",E()]])}function kU(){return gill.combineCodec(Ei(),Di())}function Mi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ei().encode(c),programAddress:r})}function OU(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Di().decode(e.data)}}var hi=new Uint8Array([12]);function FU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(hi)}function bi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:hi}))}function _i(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function GU(){return gill.combineCodec(bi(),_i())}function vi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:bi().encode(c),programAddress:r})}function zU(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:_i().decode(e.data)}}var Li=new Uint8Array([22]);function ZU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Li)}function ki(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:Li}))}function Oi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function XU(){return gill.combineCodec(ki(),Oi())}function Bi(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:ki().encode(c),programAddress:r})}function QU(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:Oi().decode(e.data)}}var Vi=new Uint8Array([11]);function oW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Vi)}function Hi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:Vi}))}function Fi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function cW(){return gill.combineCodec(Hi(),Fi())}function Gi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Hi().encode(c),programAddress:r})}function aW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Fi().decode(e.data)}}var ji=new Uint8Array([21]);function mW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ji)}function Ji(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())],["settingsReadonlyArgs",Bt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ji}))}function Yi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",Nt()],["compressedProofArgs",E()]])}function TW(){return gill.combineCodec(Ji(),Yi())}function qi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ji().encode(c),programAddress:r})}function yW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Yi().decode(e.data)}}var Qi=new Uint8Array([15]);function CW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Qi)}function $i(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Qi}))}function ed(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function EW(){return gill.combineCodec($i(),ed())}function td(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=m({}),i=T(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:$i().encode({}),programAddress:r})}function DW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:ed().decode(e.data)}}var sd=new Uint8Array([25]);function _W(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(sd)}function od(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:sd}))}function cd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function vW(){return gill.combineCodec(od(),cd())}function ad(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:od().encode(c),programAddress:r})}function UW(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:cd().decode(e.data)}}var ud=new Uint8Array([16]);function wW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ud)}function Ad(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Gt()],["secp256r1VerifyArgs",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:ud}))}function gd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",zt()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function VW(){return gill.combineCodec(Ad(),gd())}function pd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ad().encode(c),programAddress:r})}function HW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:gd().decode(e.data)}}var yd=new Uint8Array([26]);function YW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(yd)}function ld(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Gt()],["secp256r1VerifyArgs",gill.getArrayEncoder(J())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:yd}))}function fd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",zt()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",G()],["compressedProofArgs",E()]])}function qW(){return gill.combineCodec(ld(),fd())}function Sd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ld().encode(c),programAddress:r})}function ZW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:fd().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",Vx=(c=>(c[c.DomainConfig=0]="DomainConfig",c[c.GlobalCounter=1]="GlobalCounter",c[c.Settings=2]="Settings",c[c.TransactionBuffer=3]="TransactionBuffer",c[c.WhitelistedAddressTree=4]="WhitelistedAddressTree",c))(Vx||{});function LL(e){let n="data"in e?e.data:e;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([201,232,212,229,59,241,106,197])),0))return 0;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([42,206,176,58,175,129,130,233])),0))return 1;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([223,179,163,190,177,224,67,173])),0))return 2;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([90,36,35,219,93,225,110,96])),0))return 3;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([105,23,173,2,197,255,80,87])),0))return 4;throw new Error("The provided account could not be identified as a multiWallet account.")}var Hx=(y=>(y[y.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",y[y.ChangeConfig=1]="ChangeConfig",y[y.ChangeConfigCompressed=2]="ChangeConfigCompressed",y[y.CreateCompressedWallet=3]="CreateCompressedWallet",y[y.CreateDomainConfig=4]="CreateDomainConfig",y[y.CreateDomainUserAccount=5]="CreateDomainUserAccount",y[y.CreateGlobalCounter=6]="CreateGlobalCounter",y[y.CreateUserAccounts=7]="CreateUserAccounts",y[y.DecompressSettingsAccount=8]="DecompressSettingsAccount",y[y.DisableDomainConfig=9]="DisableDomainConfig",y[y.EditDomainConfig=10]="EditDomainConfig",y[y.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",y[y.EditUserDelegate=12]="EditUserDelegate",y[y.MigrateCompressedSettings=13]="MigrateCompressedSettings",y[y.MigrateCompressedUsers=14]="MigrateCompressedUsers",y[y.NativeTransferIntent=15]="NativeTransferIntent",y[y.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",y[y.TokenTransferIntent=17]="TokenTransferIntent",y[y.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",y[y.TransactionBufferClose=19]="TransactionBufferClose",y[y.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",y[y.TransactionBufferCreate=21]="TransactionBufferCreate",y[y.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",y[y.TransactionBufferExecute=23]="TransactionBufferExecute",y[y.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",y[y.TransactionBufferExtend=25]="TransactionBufferExtend",y[y.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",y[y.TransactionBufferVote=27]="TransactionBufferVote",y[y.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",y[y.TransactionExecute=29]="TransactionExecute",y[y.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",y[y.TransactionExecuteSync=31]="TransactionExecuteSync",y[y.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",y))(Hx||{});function kL(e){let n="data"in e?e.data:e;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 1;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 2;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 3;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 4;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 5;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 6;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 7;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 8;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 9;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 10;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 11;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 12;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([32])),0))return 13;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([31])),0))return 14;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 15;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 16;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 17;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 18;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 19;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 20;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 21;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 22;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 23;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 24;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 25;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 26;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 27;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 28;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 29;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 30;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 31;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 32;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var Gx=6e3,zx=6001,Kx=6002,jx=6003,Jx=6004,Yx=6005,qx=6006,Zx=6007,Xx=6008,Qx=6009,$x=6010,eI=6011,tI=6012,rI=6013,nI=6014,sI=6015,oI=6016,cI=6017,aI=6018,iI=6019,dI=6020,uI=6021,AI=6022,gI=6023,pI=6024,mI=6025,TI=6026,yI=6027,lI=6028,fI=6029,SI=6030,xI=6031,II=6032,CI=6033,EI=6034,DI=6035,MI=6036,PI=6037,RI=6038,hI=6039,bI=6040,_I=6041,vI=6042,UI=6043,WI=6044,LI=6045,kI=6046,OI=6047,BI=6048,NI=6049,wI=6050,VI=6051,HI=6052,FI=6053,GI=6054,zI=6055,KI=6056,jI=6057,JI=6058,YI=6059,qI=6060,ZI=6061,XI=6062,QI=6063,$I=6064,eC=6065,tC=6066,rC=6067,nC=6068,sC=6069,oC=6070,cC=6071,aC=6072,iC=6073,dC=6074,uC=6075,AC=6076,gC=6077,pC=6078,mC=6079,TC=6080,yC=6081,lC=6082,xd;process.env.NODE_ENV!=="production"&&(xd={[SI]:"This member is already delegated to another wallet.",[Zx]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[dC]:"Clock sysvar access failed. This may indicate a system error.",[wI]:"The domain configuration account is disabled. Please contact support or try again later.",[VI]:"Missing domain configuration account.",[aC]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[lC]:"Duplicate address tree detected. This address tree is already in the whitelist.",[$x]:"Duplicate public keys detected among members. Each member must have a unique key.",[Qx]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[dI]:"No members provided. A multisig wallet must contain at least one member.",[jI]:"Slot numbers list is empty. At least one slot number is required for validation.",[aI]:"Expected a User with Administrator role for this instruction.",[Xx]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[oI]:"Expected a User with Transaction Manager role for this instruction.",[hI]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[bI]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[_I]:"Declared buffer size does not match the actual serialized size.",[KI]:"Failed to compute hash. This may indicate a system error.",[CI]:"Not enough members with vote permission to meet the approval threshold.",[xI]:"At least one signer with execute permission is required to proceed.",[II]:"At least one signer with initiate permission is required to perform this action.",[mI]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[cC]:"Invalid account index in transaction message. The account index is out of bounds.",[GI]:"Address Tree supplied is not part of the whitelisted address trees.",[iI]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[yI]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[RI]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[JI]:"Member key conversion failed. The provided key format is invalid.",[EI]:"Only delegated members are allowed for this transaction.",[pI]:"Unexpected number of accounts provided for this instruction.",[rI]:"User with Permanent Member role must have a delegated wallet.",[zx]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[Jx]:"The extracted public key has an invalid length or encoding.",[Gx]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[jx]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[NI]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[OI]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[AI]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[nC]:"Invalid source type for token transfer. The source account type is not supported.",[cI]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[sI]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[gI]:"Malformed transaction message: structure or formatting does not match the expected layout.",[TI]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[AC]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[rC]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[Yx]:"The extracted WebAuthn signed message payload is malformed.",[LI]:"An input string exceeds the maximum allowed character length.",[HI]:"This member is not registered under the provided domain configuration.",[ZI]:"Member not found in settings. Cannot remove a member that does not exist.",[oC]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[lI]:"A required account is missing from the instruction context.",[YI]:"Compressed proof arguments are missing. Required for compressed account operations.",[$I]:"Missing compressed token account. Required for token transfer operations.",[gC]:"Missing destination token account. Required for token transfer operations.",[tC]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[qI]:"Light CPI accounts are missing. Required for compressed account operations.",[fI]:"User mutation arguments are required when performing add or remove delegate operations.",[TC]:"Missing new authority account. Required for domain configuration updates.",[mC]:"Missing settings account. Required for delegate operations on compressed wallets.",[zI]:"Compressed settings data is missing. The settings account must be initialized with data.",[pC]:"Missing source token account. Required for token transfer operations.",[eC]:"Missing SPL interface PDA. Required for token transfer operations.",[kI]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[iC]:"User account address is missing. Required for secp256r1 signature verification.",[yC]:"Missing whitelisted address trees account. Required for domain configuration updates.",[MI]:"No valid signer found in this transaction.",[tI]:"Only one permanent member is allowed per wallet.",[nI]:"Only one transaction manager is allowed per wallet.",[FI]:"The given origin index is not in the whitelisted origins.",[QI]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[eI]:"Permanent members cannot be removed from a wallet.",[WI]:"Writable CPI calls to protected accounts are not permitted.",[qx]:"The rpIdHash extracted from the signed message does not match the expected value.",[XI]:"Settings key mismatch. The provided settings key does not match the expected value.",[Kx]:"The signature index provided is out of bounds for the secp256r1 instruction.",[BI]:"The specified slot number was not found in the provided slot history.",[sC]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[uI]:"Too many members: a maximum of 4 members are supported.",[vI]:"This transaction has expired. It must be executed within 3 minutes of approval.",[UI]:"This transaction has not yet reached the required approval threshold.",[PI]:"Only the transaction creator or rent payer may close this transaction buffer.",[uC]:"Unauthorized: Only the admin account is allowed to perform this action.",[DI]:"Member is not part of the expected signers for this transaction."});function HL(e){return process.env.NODE_ENV!=="production"?xd[e]:"Error message not available in production bundles."}function FL(e,n,r){return gill.isProgramError(e,n,A,r)}async function $L({admin:e,addressTree:n}){return Jo({payer:e,addressTree:n,remainingAccounts:[]})}var Yt={Ed25519:1,Secp256r1:2};var he={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},We=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(he).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var es=33,Le=class{_bn;constructor(n){typeof n=="string"?this._bn=new Uint8Array(gill.getBase58Encoder().encode(n)):this._bn=new Uint8Array(n),this.validateKeyLength(this._bn);}validateKeyLength(n){if(n.length!==es)throw new Error(`Invalid public key length, expected ${es} bytes but got ${n.length}`)}toBase58(){return gill.getBase58Decoder().decode(this.toBytes())}toTruncatedBuffer(){let n=this.toBuffer();return n.subarray(1,n.length)}toBuffer(){if(!this._bn)throw new Error("Invalid public key input");let n=this._bn;if(n.byteLength===es)return n;throw new Error("Invalid public key input")}toBytes(){let n=this.toBuffer();return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}toString(){return this.toBase58()}toJSON(){return this.toBase58()}},D=class extends Le{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(n,r){super(n),this.verifyArgs=r.verifyArgs,this.domainConfig=r.domainConfig,this.authData=r.authData,this.signature=r.signature,this.originIndex=r.originIndex,this.crossOrigin=r.crossOrigin,this.clientAndDeviceHash=r.clientAndDeviceHash,this.authResponse=r.authResponse;}};function xC(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function IC(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var Cd=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(xC())],["addressTableLookups",gill.getArrayCodec(IC())]]);function Ed(e){return Cd.encode({numSigners:e.header.numSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,accountKeys:e.staticAccounts,instructions:e.instructions.map(r=>({programAddressIndex:r.programAddressIndex,accountIndices:r.accountIndices??[],data:Array.from(r.data??[])})),addressTableLookups:e.version!=="legacy"?e.addressTableLookups?.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes,writableIndexes:r.writableIndexes}))??[]:[]})}function Dd(e){let n=Cd.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}function Md(e,n,r,s){if(e<n||e>r)throw new H(`${s} must be between ${n} and ${r} (inclusive), got ${e}`)}function Pd(e,n){if(e<0)throw new H(`${n} must be non-negative, got ${e}`)}function qt(e,n){if(e.length===0)throw new H(`${n} cannot be empty`)}function Rd(e,n){if(e.trim().length===0)throw new H(`${n} cannot be empty`)}stateless_js.featureFlags.version=stateless_js.VERSION.V2;var X={};function hd(){if(!X.solanaRpcEndpoint)throw new Ue("RPC endpoint");return X.solanaRpcEndpoint}function st(){if(!X.lightProtocolRpc)throw new Ue("Light Protocol RPC");return X.lightProtocolRpc}function re(){if(!X.solanaRpc)throw new Ue("Solana RPC");return X.solanaRpc}function bd(){if(!X.sendAndConfirm)throw new Ue("Send and confirm transaction function");return X.sendAndConfirm}function _d(){if(!X.computeEstimate)throw new Ue("Compute budget estimate function");return X.computeEstimate}function rs(){return X.jitoTipsConfig?X.jitoTipsConfig:{blockEngineUrl:Ps,getJitoTipsUrl:Rs,priority:hs}}function hk({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){X.solanaRpcEndpoint=e,X.lightProtocolRpc=stateless_js.createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=gill.createSolanaClient({urlOrMoniker:e});X.solanaRpc=t,X.sendAndConfirm=c,X.computeEstimate=programs.estimateComputeUnitLimitFactory({rpc:t}),X.jitoTipsConfig=s??null;}function vd(e){return typeof e=="string"?e:e.toString()}function Ud(e,n){return e.toString()+(n?n.toString():"")}function Wd(e){return e.toString()}async function br(e,n,r){let s=e?.get(n);if(s)return s;let t=await r();return t&&e&&e.set(n,t),t}var RC={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true};function hC(e,n,r=2,s=3e4){let t=n*Math.pow(r,e-1);return Math.min(t,s)}function bC(e){return new Promise(n=>setTimeout(n,e))}async function Zt(e,n){let{maxRetries:r,initialDelayMs:s,backoffBase:t=2,maxDelayMs:c=3e4,shouldRetry:a}={...RC,...n},i;for(let o=1;o<=r;o++)try{return await e()}catch(d){if(i=d,a&&!a(d,o))throw d;if(o>=r)break;let u=hC(o,s,t,c);await bC(u);}throw new ar(e.name||"retryWithBackoff",r,i)}async function ot(e,n){let r=(s,t)=>s instanceof Response?s.status===429?n.retryOnRateLimit??true:s.status>=400&&s.status<500?false:s.status>=500:s instanceof TypeError||s instanceof Error;return Zt(e,{...n,shouldRetry:n.shouldRetry??r})}var U=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?gill.AccountRole.WRITABLE_SIGNER:gill.AccountRole.READONLY_SIGNER:r?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...stateless_js.getLightSystemAccountMetasV2({selfProgram:new web3_js.PublicKey(A.toString())}).map(n=>({address:gill.address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,gill.AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:gill.address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===stateless_js.TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===stateless_js.TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await st().getStateTreeInfos(),r=stateless_js.selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:a,queuePubkeyIndex:i,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:a,addressQueuePubkeyIndex:i});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function _r(e,n){let r=vd(e);return br(n,r,()=>st().getCompressedAccount(e))}async function Od(e,n,r){let s=Ud(e,n?.mint);return br(r,s,()=>st().getCompressedTokenAccountsByOwner(e,n))}async function Qt(e,n){let r=Wd(e);return br(n,r,()=>re().getAccountInfo(e,{encoding:"base64"}).send())}async function Ae(e,n){let s=(await Promise.all(e.map(async t=>_r(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new $("Compressed account",`Expected ${e.length} accounts but found ${s.length}`);return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function _(e,n){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:n}}async function ie(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:s[u],address:d.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:a[u],outputStateTreeIndex:i,address:d.address,type:d.type}))}function oe(e,n,r,s,t,c,a){let i=[];for(let u=0;u<n.length;u++)i.push({treeInfo:n[u],rootIndex:s[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new H("Unable to parse state tree data");return c.map((u,g)=>({data:a.decode(u.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Ce(e,n,r,s,t){let c=null,a=null,i=null,o=new U;if(e){await o.addSystemAccounts();let{address:d}=await ne(n,r),u=(await Ae([{address:d,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:i=await O([u],[]);let g=o.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!g)throw new H("Unable to parse state tree data");c={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0]},data:j().decode(u.data?.data)},a={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:j().decode(u.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:o,settingsMutArgs:a}}async function O(e,n,r=3,s=500){return Zt(()=>st().getValidityProofV0(e,n),{maxRetries:r,initialDelayMs:s})}async function Ee(){return (await vr()).length-1}var ns;async function vr(){if(!ns){let{data:e}=await Ho(re(),await Bd());ns=e.whitelistedAddressTrees;}return ns}async function Ur(e,n,r){let s=await LC(e,n,r);if(!s)throw new $("User account");return s}async function LC(e,n,r){let{address:s}=await k(e,n),t=await _r(s,r);return t?.data?.data?q().decode(t.data.data):null}async function ss(e,n,r){let s=await kC(e,n,r);if(!s)throw new $("Settings account");return s}async function kC(e,n,r){try{let{address:s}=await ne(e,n),t=await _r(s,r);if(!t?.data?.data)throw new $("Compressed settings account");let c=j().decode(t.data.data);if(c.data.__option==="None")throw new $("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let s=await Rn(re(),await ce(e));return s.exists?{...s.data,isCompressed:false}:null}}async function os(e){Pd(e,"index");let n=await vr();if(e>=n.length)throw new H(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function oO(e){let r=(await vr()).findIndex(s=>s.toString()===e);if(r===-1)throw new $("Address tree",`Address ${e} not found in whitelist`);return r}async function ne(e,n=0){let r=await os(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("multi_wallet")),new Uint8Array(gill.getU128Encoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function k(e,n=0){let r=await os(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("user")),e instanceof Le?e.toTruncatedBuffer():new Uint8Array(gill.getAddressEncoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function at({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha2_js.sha256(new Uint8Array(gill.getUtf8Encoder().encode(n)));else throw new H("Either rpId or rpIdHash must be provided");let[r]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("domain_config"),e]});return r}async function Fd(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function Bd(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Gd(e,n,r){Md(r,0,255,"buffer_index");let[s]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),n instanceof Le?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return s}async function be(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return n}async function ce(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function lO(e){let n=await ce(e);return await be(n)}async function fO(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}async function $t(e,n){if(!e.ok){await e.text().catch(()=>e.statusText);throw new Ie(`Request failed: ${e.statusText} (${e.status})`,e.status,n)}return e}async function er(e){try{return await e.json()}catch(n){throw new Ie(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function _O(e){let n=tinyCbor.decodeCBOR(e),r=nist_js.p256.Point.fromAffine({x:BigInt("0x"+Lr(n.get(-2))),y:BigInt("0x"+Lr(n.get(-3)))});return gill.getBase58Decoder().decode(r.toBytes(true))}function vO(e){let r=nist_js.p256.Point.fromBytes(new Uint8Array(gill.getBase58Encoder().encode(e))).toBytes(false),s=new Map;return s.set(1,2),s.set(3,-7),s.set(-1,1),s.set(-2,r.slice(1,33)),s.set(-3,r.slice(33,65)),new Uint8Array(tinyCbor.encodeCBOR(s))}async function UO(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Oe(n)),c=JSON.parse(new TextDecoder().decode(Oe(r))),a=jd(c),i=Yd(new Uint8Array(Oe(s))),o=await at({rpIdHash:t.subarray(0,32)});return new D(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Oe(r)),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(gill.getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:cs(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function cs(e,n,r){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...gill.getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function kO(e){return sha2_js.sha256(new Uint8Array(gill.getUtf8Encoder().encode(JSON.stringify(e))))}function OO(e){return as(e.data.payload.authResponse)}function BO(e,n,r,s){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...cs(n,r,s)]))}async function NO(e,n,r,s,t,c){let a;if(!t||!c){let o=(await re().getAccountInfo(gill.address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!o)throw new $("Slot sysvar","Unable to fetch slot sysvar data");let d=gill.getBase64Encoder().encode(o[0]);c=gill.getU64Decoder().decode(d.subarray(0,8)).toString(),a=d.subarray(8,40),t=gill.getBase58Decoder().decode(a);}else a=new Uint8Array(gill.getBase58Encoder().encode(t));let i=sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e.transactionActionType),...gill.getBase58Encoder().encode(e.transactionAddress),...sha2_js.sha256(typeof e.transactionMessageBytes=="string"?new Uint8Array(Oe(e.transactionMessageBytes)):e.transactionMessageBytes),...a,...cs(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:i}}function as(e){return sha2_js.sha256(Or(e))}function wO(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Oe(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),a=new Uint8Array(c);for(let i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return c}async function VO(e,n){let{data:r}=await Os(re(),e),t=Jd(new Uint8Array(r.origins),r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Error("Origin not found in domain config");return t}function Lr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function zC(e){let n=new Uint8Array(e.length/2);for(let r=0;r<n.length;r++)n[r]=parseInt(e.slice(r*2,r*2+2),16);return n}function jd(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let s=JSON.stringify(r);return new TextEncoder().encode(s.slice(1,-1))}function Jd(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let a=e[s]|e[s+1]<<8;if(s+=2,s+a>e.length)throw new Error("MaxLengthExceeded");let i=e.slice(s,s+a),o=t.decode(i);r.push(o),s+=a;}return r}function Yd(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let I=n&127;r+=I;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let a=e[r+1],i=r+2,o=e.slice(i,i+a),d=c[0]===0&&c.length>32?c.slice(1):c,u=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let p=nist_js.p256.Point.CURVE().n>>1n,l=BigInt("0x"+Lr(u)),b=(l>p?nist_js.p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),x=zC(b);return new Uint8Array([...g,...x])}function Or(e){return new Uint8Array([...new Uint8Array(Oe(e.response.authenticatorData)),...sha2_js.sha256(new Uint8Array(Oe(e.response.clientDataJSON)))])}async function is(e,n=false){let r=n?{blockhash:gill.getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await re().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(s.instructions,c),c=>gill.setTransactionMessageFeePayerSigner(s.payer,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?gill.compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let a=Math.ceil((s.unitsConsumed??0)*1.1);return a>2e5?gill.prependTransactionMessageInstructions([programs.getSetComputeUnitLimitInstruction({units:a})],c):c},async c=>n?gill.compileTransaction(await c):await gill.signTransactionMessageWithSigners(await c))))}async function Qd(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===gill.AccountRole.WRITABLE||c.role===gill.AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,a)=>c-a);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function $d(e,n){qt(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new H(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await ot(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})}),{maxRetries:3,initialDelayMs:500});await $t(r,n);let s=await er(r);if(!s.result||s.error)throw new ue(`Unable to simulate bundle: ${JSON.stringify(s.error??s.result)}`);if(typeof s.result.value.summary!="string"&&s.result.value.summary.failed){let{TransactionFailure:t}=s.result.value.summary.failed.error,[,c]=t;throw new ue(`Simulation failed: ${c}`)}return s.result.value.transactionResults.map(t=>t.unitsConsumed)}function z(e,n=0){let r=e instanceof D?e:void 0,s=r?.verifyArgs&&n!==-1?gill.some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):gill.none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,a=r?.authData&&r.verifyArgs.clientDataJson?Or(r.authResponse):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function dt(e){if(e instanceof Le)return {keyType:Yt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Yt.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function Xd(e){return e instanceof D?e.toString():e.address.toString()}function Te(e){let n=new Set,r=[];for(let t of e)n.has(Xd(t))||(r.push(t),n.add(Xd(t)));let s=r.filter(t=>t instanceof D);if(s.length>1)throw new H(`More than 1 Secp256r1 signers in an instruction is not supported (found ${s.length})`);return r}function eu({payer:e,tipAmount:n}){let r=Kr[Math.floor(Math.random()*Kr.length)];return programs.getTransferSolInstruction({source:e,destination:gill.address(r),amount:n})}async function gB(e){qt(e,"bundle");let n=await is(e,true),r=await $d(n.map(gill.getBase64EncodedWireTransaction),hd()),s=await is(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await aE(s.map(gill.getBase64EncodedWireTransaction))}async function aE(e,n=3,r=500,s=rs()){qt(e,"serializedTransactions");let{blockEngineUrl:t}=s,c=`${t}/bundles`,a=await ot(()=>fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})}),{maxRetries:n,initialDelayMs:r});await $t(a,c);let i=await er(a);if(i.error)throw new ue(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new ue("No bundle ID returned from Jito");return i.result}async function pB(e,n=30,r=3e3,s=rs()){Rd(e,"bundleId");let{blockEngineUrl:t}=s,c=`${t}/getBundleStatuses`;return Zt(async()=>{let a=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await $t(a,c);let i=await er(a);if(i.error)throw new ue(`Error getting bundle status: ${JSON.stringify(i.error,null,2)}`,e);if(!i.result?.value?.length)throw new ue("Bundle not yet confirmed",e);let o=i.result.value[0];if(o.confirmation_status==="confirmed"||o.confirmation_status==="finalized"){let d=o.transactions[o.transactions.length-1];if(!d)throw new ue("No transactions in confirmed bundle",e);return d}throw new ue(`Bundle status: ${o.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:a=>a instanceof ue||a instanceof Ie})}async function xB({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await re().getLatestBlockhash().send(),t=await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(e,c),c=>gill.setTransactionMessageFeePayerSigner(n,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?gill.compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([_d()(c),Qd(re(),c.instructions.flatMap(d=>d.accounts??[]))]),o=Math.ceil(a*1.1);return gill.prependTransactionMessageInstructions([...o>2e5?[programs.getSetComputeUnitLimitInstruction({units:o})]:[],...i>0?[programs.getSetComputeUnitPriceInstruction({microLamports:i})]:[]],c)},async c=>await gill.signTransactionMessageWithSigners(await c));return await bd()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}function OB(e,n){if(n.threshold>1)throw new H("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(o=>nu(o.pubkey)===e);if(!r)throw new $("Member",`Signer ${e} not found in settings`);let{permissions:s}=r;if(!s)throw new $("Permissions","No permissions found for the current member");let t=We.has(s,he.InitiateTransaction),c=We.has(s,he.VoteTransaction),a=We.has(s,he.ExecuteTransaction);if(t&&c&&a)return {};if(!c||!a)throw new ir("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,a?"ExecuteTransaction":void 0].filter(Boolean));let i=n.members.find(o=>o.role===2);if(!i)throw new $("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:gill.address(nu(i.pubkey)),userAddressTreeIndex:i.userAddressTreeIndex}}async function BB({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await Ur(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new $("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return ME(n,c.transactionManagerUrl.value,e,s)}function ME(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(gill.getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=gill.getBase64Decoder().decode(s)),r&&(c.authResponses=r);let a=await ot(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)}),{maxRetries:3,initialDelayMs:500});if(!a.ok)throw new Ie(`Transaction manager request failed: ${a.statusText}`,a.status,n);let i=await a.json();if("error"in i)throw new Ie(`Transaction manager error: ${i.error}`,a.status,n);return i.signatures.map(o=>({[e]:gill.getBase58Encoder().encode(o)}))}}}function nu(e){return e.keyType===Yt.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}function NB(e){let n=e.map(c=>Fe().encode(c)),r=4+n.reduce((c,a)=>c+a.length,0),s=new Uint8Array(r),t=0;s.set(gill.getU32Encoder().encode(e.length),t),t+=4;for(let c of n)s.set(c,t),t+=c.length;return s}function wB(e){let n=0,[r,s]=gill.getU32Decoder().read(e,n);n=s;let t=new Array(r);for(let c=0;c<r;c++){let a=Ge().read(e,n);t[c]=a[0],n=a[1];}if(n!==e.length)throw new H(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function oN({payer:e,rpId:n,origins:r,authority:s}){let t=await at({rpId:n}),c=new U;await c.addSystemAccounts();let a=await Ee(),{address:i,addressTree:o}=await k(s.address,a),d=[{address:i,tree:o,queue:o,type:"User"}],u=await O([],d),g=(await ie(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),f=_(u,l);return await Ec({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:f,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function TN({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await ne(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await k(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await Ae(a,t):[],o=await Ee(),{address:d,addressTree:u}=await k(r.member,o),g=[{address:d,type:"User",tree:u,queue:u}],p=await O(i,g),l=null,f=null,b=i.filter(W=>W.type==="Settings"),x=i.filter(W=>W.type==="User");b.length&&(l=oe(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),b,j())[0]),x.length&&(f=oe(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,q())[0]);let I=await ie(c,p.treeInfos.slice(i.length),p.roots.slice(i.length),p.rootIndices.slice(i.length),g),{remainingAccounts:M,systemOffset:S}=c.toAccountMetas(),L=_(p,S);return await Rc({payer:n,authority:e,compressedProofArgs:L,member:Ut().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:l?gill.some({settingsMutArgs:l,transactionManager:f?gill.some(f):gill.none()}):gill.none(),userAccountCreationArgs:I[0],domainConfig:s,remainingAccounts:M})}async function SN({payer:e}){let n=await Fd();return vc({payer:e,globalCounter:n})}async function EN({admin:e,rpId:n,disable:r}){let s=await at({rpId:n});return Jc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function _N({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new U;await t.addSystemAccounts();let{address:c,addressTree:a}=await ne(r,s),i=[{address:c,tree:a,queue:a,type:"Settings"}],o=await O([],i),d=(await ie(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),p=_(o,g);return la({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function BN({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new U;await t.addSystemAccounts();let{address:c,addressTree:a}=await k(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await O([],i),d=(await ie(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),p=_(o,g);return Ea({compressedProofArgs:p,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}function RE(e,n,r,s){let t=hE(e,n),c=bE(e,n)&&r!==s;return t&&c?gill.AccountRole.WRITABLE_SIGNER:t&&!c?gill.AccountRole.WRITABLE:!t&&c?gill.AccountRole.READONLY_SIGNER:gill.AccountRole.READONLY}function hE(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,a=s-t,i=r-s-c;return n>=r?false:n<a?true:n>=s?n-s<i:false}function bE(e,n){return n<e.header.numSignerAccounts}async function Br({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Dd(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await gill.fetchAddressesForLookupTables(t.addressTableLookups.map(i=>i.lookupTableAddress),re()):{}),a=[];a.push(...t.addressTableLookups?.map(i=>({role:gill.AccountRole.READONLY,address:i.lookupTableAddress}))??[]);for(let[i,o]of t.staticAccounts.entries())a.push({address:o,role:RE(t,i,o,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let o=c[i.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let d of i.writableIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:u,role:gill.AccountRole.WRITABLE});}for(let d of i.readonlyIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:u,role:gill.AccountRole.READONLY});}}for(let i of s?.filter(o=>o.address!==e)??[]){let o=a.findIndex(d=>d.address===i.address);o===-1?a.push({address:i.address,role:gill.AccountRole.READONLY_SIGNER,signer:i}):a[o].role===gill.AccountRole.READONLY||a[o].role===gill.AccountRole.READONLY_SIGNER?a[o]={address:i.address,role:gill.AccountRole.READONLY_SIGNER,signer:i}:(a[o].role===gill.AccountRole.WRITABLE||a[o].role===gill.AccountRole.WRITABLE_SIGNER)&&(a[o]={address:i.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:i});}return {accountMetas:a,addressLookupTableAccounts:c,transactionMessage:t}}var ut=33,At=64,gs=14,OE=2,BE=gill.address("Secp256r1SigVerify1111111111111111111111111");function NE(){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 wE(){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 du(){return gill.createDecoder({read:(e,n=0)=>{let r=gill.getU8Decoder().decode(e,n);n+=1;let s=gill.getU8Decoder().decode(e,n);n+=1;let t=[],c=wE();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=gs;let a=[];for(let i=0;i<r;i++){let o=gill.fixDecoderSize(gill.getBytesDecoder(),ut).decode(e,n);n+=ut;let d=gill.fixDecoderSize(gill.getBytesDecoder(),At).decode(e,n);n+=At;let u=t[i].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),u).decode(e,n);n+=u,a.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function uu(){return gill.createEncoder({getSizeFromValue:e=>{let n=gs*e.offsets.length,r=e.payload.reduce((s,t)=>s+ut+At+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=gill.getU8Encoder().write(e.numSignatures,n,r),r=gill.getU8Encoder().write(e.padding,n,r);let s=NE();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=gill.fixEncoderSize(gill.getBytesEncoder(),ut).write(t.publicKey,n,r),r=gill.fixEncoderSize(gill.getBytesEncoder(),At).write(t.signature,n,r),r=gill.getBytesEncoder().write(t.message,n,r);return r}})}function QN(){return gill.combineCodec(uu(),du())}function B(e,n){let r=e.length,s=OE+r*gs,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,g=u+ut,p=g+At;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),s+=ut+At+d.length;}let c=n?.programAddress??BE,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:uu().encode(a)}}function $N(e){return {programAddress:e.programAddress,accounts:{},data:du().decode(e.data)}}async function Au({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let d=await be(e),{accountMetas:u,addressLookupTableAccounts:g}=await Br({transactionMessageBytes:r,walletAddress:d,additionalSigners:a,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(B(c)),p.push(o?ad({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):td({transactionBuffer:n,payer:s.address,settings:e})),i&&p.push(eu({payer:s,tipAmount:i})),{instructions:p,addressLookupTableAccounts:g}}async function gu({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:d}){let u=Te(s),g=await ce(e),p=await be(g),[{accountMetas:l,addressLookupTableAccounts:f,transactionMessage:b},{settingsMutArgs:x,proof:I,packedAccounts:M}]=await Promise.all([Br({transactionMessageBytes:r,walletAddress:p,additionalSigners:u.filter(Z=>!(Z instanceof D)),addressesByLookupTableAddress:c}),Ce(i,e,n,o,d)]);M.addPreAccounts(l);let S=u.filter(Z=>Z instanceof D),{secp256r1VerifyArgs:L}=HE(S,a,M),{remainingAccounts:W,systemOffset:K}=M.toAccountMetas();return {instructions:FE({secp256r1VerifyInput:a,transactionMessage:b,accountMetas:l,compressed:i,payer:t,settingsMutArgs:x,proof:I,systemOffset:K,secp256r1VerifyArgs:L,settings:g,remainingAccounts:W}),addressLookupTableAccounts:f}}function HE(e,n,r){let s=[];for(let t of e){let c=n.length,{domainConfig:a,verifyArgs:i,signature:o,publicKey:d,message:u}=z(t,c);u&&o&&d&&n.push({message:u,signature:o,publicKey:d}),a&&(r.addPreAccounts([{address:a,role:gill.AccountRole.READONLY}]),i.__option==="Some"&&s.push({domainConfigKey:a,verifyArgs:i.value}));}return {secp256r1VerifyArgs:s}}function FE({secp256r1VerifyInput:e,transactionMessage:n,accountMetas:r,compressed:s,payer:t,settingsMutArgs:c,proof:a,systemOffset:i,secp256r1VerifyArgs:o,settings:d,remainingAccounts:u}){let g=[];e.length>0&&g.push(B(e));let p=GE(n,r);if(s){if(!t||!c)throw new Error("Payer not found or proof args is missing.");let l=_(a,i);g.push(Sd({secp256r1VerifyArgs:o,transactionMessage:p,settingsMutArgs:c,compressedProofArgs:l,payer:t,remainingAccounts:u}));}else g.push(pd({secp256r1VerifyArgs:o,settings:d,transactionMessage:p,remainingAccounts:u}));return g}function GE(e,n){if(e.version==="legacy")throw new Error("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:new Uint8Array(r.data??[])})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(s=>s.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function Ew({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=Te(s),d=await ce(e),u=await be(d),{packedAccounts:g,proof:p,settingsMutArgs:l}=await Ce(i,e,n,false,t),f=[],b=[];for(let S of o)if(S instanceof D){let L=f.length,{domainConfig:W,verifyArgs:K,signature:Q,publicKey:Z,message:De}=z(S,L);De&&Q&&Z&&f.push({message:De,signature:Q,publicKey:Z}),W&&(g.addPreAccounts([{address:W,role:gill.AccountRole.READONLY}]),K.__option==="Some"&&b.push({domainConfigKey:W,verifyArgs:K.value}));}else g.addPreAccounts([{address:S.address,role:gill.AccountRole.READONLY_SIGNER,signer:S}]);let{remainingAccounts:x,systemOffset:I}=g.toAccountMetas(),M=[];if(f.length>0&&M.push(B(f)),i){if(!a||!l)throw new Error("Payer not found or proof args is missing.");let S=_(p,I);M.push(Wa({amount:c,settingsMutArgs:l,compressedProofArgs:S,payer:a,secp256r1VerifyArgs:b,source:u,destination:r,remainingAccounts:x}));}else M.push(Ra({amount:c,secp256r1VerifyArgs:b,source:u,destination:r,settings:d,remainingAccounts:x}));return M}var lu=gill.address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),fu=gill.address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti");async function Ow({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,compressed:d=false}){let u=Te(t),g=await ce(e),p=await be(g),[l,[f],b,[x],[I]]=await Promise.all([programs.getAssociatedTokenAccountAddress(s,p,o),gill.getProgramDerivedAddress({seeds:[gill.getAddressEncoder().encode(p),gill.getAddressEncoder().encode(gill.address(stateless_js.CTOKEN_PROGRAM_ID.toString())),gill.getAddressEncoder().encode(s)],programAddress:gill.address(stateless_js.CTOKEN_PROGRAM_ID.toString())}),programs.getAssociatedTokenAccountAddress(s,r,o),gill.getProgramDerivedAddress({seeds:[gill.getAddressEncoder().encode(r),gill.getAddressEncoder().encode(gill.address(stateless_js.CTOKEN_PROGRAM_ID.toString())),gill.getAddressEncoder().encode(s)],programAddress:gill.address(stateless_js.CTOKEN_PROGRAM_ID.toString())}),gill.getProgramDerivedAddress({seeds:[gill.getUtf8Encoder().encode("pool"),gill.getAddressEncoder().encode(s)],programAddress:gill.address(stateless_js.CTOKEN_PROGRAM_ID.toString())})]),[M,S,L]=await Promise.all([Qt(b,c),Qt(l,c),XE(d,e,n,c)]),W=!!M.value,K=!!S.value,Q=K?programs.getTokenDecoder().decode(gill.getBase64Encoder().encode(S.value.data[0])).amount:BigInt(0),Z=BigInt(0),De=true;if(Q<BigInt(a)){let ge=await Qt(f,c);De=!!ge.value,Z=BigInt(De?$E(new Uint8Array(gill.getBase64Encoder().encode(ge.value.data[0])))?.amount??0:0);}let Se=W?b:void 0,Be=W?void 0:x,pt=K&&(Q+Z<BigInt(a)||Z>BigInt(0)||!W)||!K&&W,rr=!!Be,[{parsed:mt,compressedAccount:se},Hr]=await Promise.all([ZE(p,s,Q,Z,BigInt(a),c),qE(pt,I,c)]),y=null,ae=null,Me=new U;if(Hr&&Me.addPreAccounts([{address:s,role:gill.AccountRole.WRITABLE}]),L||se){await Me.addSystemAccounts();let ge=[];if(se&&ge.push({hash:se.hash,tree:se.treeInfo.tree,queue:se.treeInfo.queue,data:se.data,address:se.address}),L&&ge.push(L),ae=await O(ge,[]),L){let we=se?1:0;y=oe(Me,ae.treeInfos.slice(we),ae.leafIndices.slice(we),ae.rootIndices.slice(we),ae.proveByIndices.slice(we),ge.slice(we),j())[0];}}let V=se&&mt&&ae?gill.some({amount:mt.amount.toNumber(),merkleContext:{leafIndex:se.leafIndex,merkleTreePubkeyIndex:Me.insertOrGet(se.treeInfo.tree.toString()),queuePubkeyIndex:Me.insertOrGet(se.treeInfo.queue.toString()),proveByIndex:se.proveByIndex},rootIndex:ae.rootIndices[0],version:QE(se.data?.discriminator)}):gill.none(),Ne=[],Fr=[];for(let ge of u)if(ge instanceof D){let we=Ne.length,{domainConfig:Gr,verifyArgs:Ss,signature:xs,publicKey:Is,message:Cs}=z(ge,we);Cs&&xs&&Is&&Ne.push({message:Cs,signature:xs,publicKey:Is}),Gr&&(Me.addPreAccounts([{address:Gr,role:gill.AccountRole.READONLY}]),Ss.__option==="Some"&&Fr.push({domainConfigKey:Gr,verifyArgs:Ss.value}));}else Me.addPreAccounts([{address:ge.address,role:gill.AccountRole.READONLY_SIGNER,signer:ge}]);let{remainingAccounts:ls,systemOffset:vu}=Me.toAccountMetas(),nr=[];Ne.length>0&&nr.push(B(Ne));let fs=_(ae,vu);if(d){if(!y)throw new Error("Payer not found or proof args is missing.");nr.push(Ga({amount:a,settingsMutArgs:y,compressedProofArgs:fs,payer:i,secp256r1VerifyArgs:Fr,source:p,destination:r,sourceCtokenTokenAccount:f,sourceSplTokenAccount:l,destinationCtokenTokenAccount:Be,destinationSplTokenAccount:Se,mint:s,tokenProgram:o,remainingAccounts:ls,sourceCompressedTokenAccount:V,compressibleConfig:lu,splInterfacePda:pt?I:void 0,rentSponsor:rr?fu:void 0}));}else nr.push(wa({amount:a,secp256r1VerifyArgs:Fr,source:p,destination:r,destinationCtokenTokenAccount:Be,destinationSplTokenAccount:Se,settings:g,mint:s,tokenProgram:o,remainingAccounts:ls,payer:i,sourceCompressedTokenAccount:V,compressedProofArgs:fs,sourceSplTokenAccount:l,sourceCtokenTokenAccount:f,compressibleConfig:lu,splInterfacePda:pt?I:void 0,rentSponsor:rr?fu:void 0}));return nr}async function qE(e,n,r){let s=false;if(e){let{value:t}=await Qt(n,r);s=!t;}return s}async function ZE(e,n,r,s,t,c){if(r+s>=t)return {};let a=await Od(new web3_js.PublicKey(e),{mint:new web3_js.PublicKey(n)},c),i=a.items.length>0?a.items[0]:null;return i?i.compressedAccount.data?.data.length?i.compressedAccount.owner.equals(stateless_js.CTOKEN_PROGRAM_ID)?{compressedAccount:i.compressedAccount,parsed:i.parsed}:{}:{}:{}}async function XE(e,n,r,s){if(!e)return null;let{address:t}=await ne(n,r);return (await Ae([{address:t,type:"Settings"}],s))[0]}function QE(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let n=e[7];return n===3?2:3}function $E(e){if(!e||e.length===0)return null;try{return {amount:gill.getU64Decoder().decode(e.slice(64,72))}}catch(n){return console.error("Token data parsing error:",n),null}}async function Jw({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:a,proof:i,settingsMutArgs:o}=r,d=Te(e),u=d.filter(M=>!(M instanceof D));a.addPreAccounts(u.map(M=>({address:M.address,role:gill.AccountRole.READONLY_SIGNER,signer:M})));let g=d.filter(M=>M instanceof D),p=[],l=[];for(let M of g){let S=l.length,{domainConfig:L,verifyArgs:W,signature:K,publicKey:Q,message:Z}=z(M,S);Z&&K&&Q&&l.push({message:Z,signature:K,publicKey:Q}),L&&(a.addPreAccounts([{address:L,role:gill.AccountRole.READONLY}]),W.__option==="Some"&&p.push({domainConfigKey:L,verifyArgs:W.value}));}let{remainingAccounts:f,systemOffset:b}=a.toAccountMetas(),x=_(i,b),I=[];if(l.length>0&&I.push(B(l)),c){if(!o)throw new Error("Payer not found or proof args is missing.");I.push(ic({configActions:t,payer:n,compressedProofArgs:x,settingsMutArgs:o,remainingAccounts:f,secp256r1VerifyArgs:p}));}else I.push(await ec({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:f,secp256r1VerifyArgs:p}));return I}async function e2({createUserArgs:e,payer:n}){let r=new U;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:u.member})));let s=await Ee(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:p}=await k(u.member.address,s);return {address:g,tree:p,queue:p,type:"User"}})),c=await O([],t),a=await ie(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),d=_(c,o);return await kc({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:a[g],transactionManagerUrl:u.role===2?u.transactionManagerUrl:null})),remainingAccounts:i})}async function a2({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let a=[],i=[];i.push(...await Ae([{address:(await k(r.address,s)).address,type:"User"}],t));let o=await Ee(),{address:d,addressTree:u}=await ne(e,o);a.push({address:d,queue:u,tree:u,type:"Settings"});let g=i.length,p=await O(i,a),l=oe(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),i.filter(S=>S.type==="User"),q())[0],b=(await ie(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),a)).find(S=>S.type==="Settings")??null,{remainingAccounts:x,systemOffset:I}=c.toAccountMetas(),M=_(p,I);if(!b)throw new Error("Settings creation args is missing.");return await pc({settingsIndex:e,payer:n,initialMember:r,userReadonlyArgs:l,compressedProofArgs:M,settingsCreation:b,remainingAccounts:x})}async function y2({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:a,settingsMutArgs:i}=await Ce(true,e,n,false,t);if(!i)throw new Error("Proof args is missing");let o=Te(s),d=o.filter(I=>I instanceof D),u=[],g=[];for(let I of d){let M=u.length,{domainConfig:S,verifyArgs:L,signature:W,publicKey:K,message:Q}=z(I,M);Q&&W&&K&&u.push({message:Q,signature:W,publicKey:K}),S&&(c.addPreAccounts([{address:S,role:gill.AccountRole.READONLY}]),L.__option==="Some"&&g.push({domainConfigKey:S,verifyArgs:L.value}));}c.addPreAccounts(o.filter(I=>"address"in I).map(I=>({address:I.address,role:gill.AccountRole.READONLY_SIGNER,signer:I})));let{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),f=_(a,l),b=[];u.length>0&&b.push(B(u));let x=await ce(e);return b.push(Hc({settings:x,payer:r,settingsMutArgs:i,compressedProofArgs:f,secp256r1VerifyArgs:g,remainingAccounts:p})),b}async function E2({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new U;await a.addSystemAccounts();let i=await Ee(),{address:o,addressTree:d}=await k(r.address,i),u=[{address:o,tree:d,queue:d,type:"User"}],g=await O([],u),p=(await ie(a,g.treeInfos,g.roots,g.rootIndices,u))[0],l=a.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:_(g,l.systemOffset),authorityCreationArgs:p};}return $c({domainConfig:n,authority:e,newOrigins:s?gill.some(s):gill.none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function b2({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new U;await s.addSystemAccounts();let t=await Ae([{address:(await k(e.address,n)).address,type:"User"}]),c=await O(t,[]),a=oe(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,q())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),d=_(c,o);return oa({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:a,remainingAccounts:i})}async function w2({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:a,message:i,signature:o,publicKey:d}=z(n),u=[];i&&o&&d&&u.push({message:i,signature:o,publicKey:d});let g=await Ur(n instanceof D?n:n.address,r,t),p=[];p.push({address:(await k(n instanceof D?n:n.address,r)).address,type:"User"});let l,f=null,b,x=null;g.delegatedTo.__option==="Some"&&((await ss(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ne(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),f={start:p.length-1,end:p.length}):l=await ce(g.delegatedTo.value.index)),s&&((await ss(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ne(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):b=await ce(s.index));let I=new U;await I.addSystemAccounts();let M=await Ae(p,t),S=await O(M,[]),L=oe(I,S.treeInfos.slice(0,1),S.leafIndices.slice(0,1),S.rootIndices.slice(0,1),S.proveByIndices.slice(0,1),M.slice(0,1),q())[0],W=f?gill.some(oe(I,S.treeInfos.slice(f.start,f.end),S.leafIndices.slice(f.start,f.end),S.rootIndices.slice(f.start,f.end),S.proveByIndices.slice(f.start,f.end),M.slice(f.start,f.end),j())[0]):gill.none(),K=x?gill.some(oe(I,S.treeInfos.slice(x.start,x.end),S.leafIndices.slice(x.start,x.end),S.rootIndices.slice(x.start,x.end),S.proveByIndices.slice(x.start,x.end),M.slice(x.start,x.end),j())[0]):gill.none(),{remainingAccounts:Q,systemOffset:Z}=I.toAccountMetas(),De=_(S,Z),Se=[];return u.length>0&&Se.push(B(u)),Se.push(Aa({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:s?gill.some(s):gill.none(),feePayer:e,signer:n instanceof D?void 0:n,oldSettings:l,oldSettingsMutArgs:W,newSettings:b,newSettingsMutArgs:K,compressedProofArgs:De,userMutArgs:L,remainingAccounts:Q})),Se}async function t5({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await ko(re(),s),o=i.data.multiWalletSettings,{packedAccounts:d,proof:u,settingsMutArgs:g}=await Ce(c,e,n,false,a),{remainingAccounts:p,systemOffset:l}=d.toAccountMetas(),{domainConfig:f,verifyArgs:b,message:x,signature:I,publicKey:M}=z(r),S=[];if(x&&I&&M&&S.push(B([{message:x,signature:I,publicKey:M}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let L=_(u,l);S.push(ti({transactionBuffer:s,domainConfig:f,closer:r instanceof D?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:b,settingsMutArgs:g,payer:t,compressedProofArgs:L,remainingAccounts:p}));}else S.push(qa({transactionBuffer:s,domainConfig:f,closer:r instanceof D?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:b,remainingAccounts:[]}));return S}function Iu({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:p,message:l,signature:f,publicKey:b}=z(n),x=[];if(l&&f&&b&&x.push(B([{message:l,signature:f,publicKey:b}])),d){let{settingsReadonlyArgs:I,compressedProofArgs:M,remainingAccounts:S}=d;x.push(pi({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof D?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:u},settingsReadonlyArgs:I,compressedProofArgs:M,remainingAccounts:S}));}else x.push(ai({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof D?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:u},remainingAccounts:[]}));return x}function Cu({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=z(e),d=[];return i&&a&&o&&d.push(B([{message:i,signature:a,publicKey:o}])),s?d.push(Mi({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof D?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Si({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof D?void 0:e,remainingAccounts:[]})),d}function Eu({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Bi({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):vi({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Du({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=z(n),d=[];return o&&a&&i&&d.push(B([{message:o,signature:a,publicKey:i}])),s?d.push(qi({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof D?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Gi({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof D?void 0:n,remainingAccounts:[]})),d}async function z5({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await nD(r),a=new U,i=null,o=null,d=[];if(c.length||t){let g=await sD({packedAccounts:a,userAccounts:c,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:s});i=g.proof,o=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await oD({configActionsArgs:r,userMutArgs:d,index:e}),index:e,proof:i,settingsMutArgs:o,packedAccounts:a,compressed:t}}async function nD(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>k(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let s=await Promise.all(r.members.map(t=>k(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function sD({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let a=[];if(r){let l=(await ne(s,t)).address;a.push({address:l,type:"Settings"});}n.length&&a.push(...n);let i=a.length?await Ae(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await O(i,[]),d=[],u=[];for(let l of i)l.type==="Settings"?d.push(l):l.type==="User"&&u.push(l);let g,p=[];if(r&&o&&(g=oe(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),d,j())[0]),u.length&&o){let l=r?1:0;p=oe(e,o.treeInfos.slice(l),o.leafIndices.slice(l),o.rootIndices.slice(l),o.proveByIndices.slice(l),u,q());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function oD({index:e,configActionsArgs:n,userMutArgs:r}){let s=[];for(let t of n)switch(t.type){case "AddMembers":{let c=[];for(let a of t.members){let i=await k(a.member,a.userAddressTreeIndex).then(o=>r.find(d=>utils_js.equalBytes(new Uint8Array(d.accountMeta.address),new Uint8Array(gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(o.address))))));if(!i)throw new Error("Unable to find user account");c.push(iD({permissionArgs:a.permissions,userMutArgs:i,pubkey:a.member}));}s.push({__kind:t.type,fields:[c]});break}case "RemoveMembers":{let c=await Promise.all(t.members.map(a=>k(a.member,a.userAddressTreeIndex).then(i=>{let o=r.find(d=>utils_js.equalBytes(new Uint8Array(d.accountMeta.address),new Uint8Array(gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(i.address)))));if(!o)throw new Error("Unable to find user account");return aD({pubkey:a.member,userMutArgs:o,index:e})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(a=>cD({permissionArgs:a.permissions,pubkey:a.member}));s.push({__kind:t.type,fields:[c]});break}default:s.push({__kind:t.type,fields:[t.threshold]});}return s}function cD({pubkey:e,permissionArgs:n}){return {memberKey:dt(e),permissions:hu(n)}}function aD({pubkey:e,userMutArgs:n,index:r}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");let s=n.data.delegatedTo.__option==="Some"?Number(n.data.delegatedTo.value.index.toString())===r:false;return {memberKey:dt(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function iD({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===1)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===2&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:dt(e),permissions:hu(n),userReadonlyArgs:r}}function hu(e){let n=[];return e.initiate&&n.push(he.InitiateTransaction),e.vote&&n.push(he.VoteTransaction),e.execute&&n.push(he.ExecuteTransaction),We.fromPermissions(n)}async function Q5({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:l}){let f=await ce(n),b=Math.floor(Math.random()*255),x=await Gd(f,t instanceof D?t:t.address,b),I=[],M=[];for(let V=0;V<s.length;V+=p){let Ne=s.subarray(V,V+p);I.push(Ne),M.push(sha2_js.sha256(Ne));}let S=sha2_js.sha256(new Uint8Array(s)),{settingsReadonlyArgs:L,settingsMutArgs:W,proof:K,packedAccounts:Q}=await Ce(d,n,r,false,l),{remainingAccounts:Z,systemOffset:De}=Q.toAccountMetas(),Se=K&&L&&W?{settingsReadonlyArgs:L,settingsMutArgs:W,compressedProofArgs:_(K,De),remainingAccounts:Z,payer:e}:null,Be=Te([t,...c?[c]:[],...u]).filter(V=>V instanceof D).map(V=>({memberKey:dt(V),messageHash:as(V.authResponse)})),pt=Iu({finalBufferHash:S,finalBufferSize:s.length,bufferIndex:b,payer:e,transactionBufferAddress:x,settings:f,creator:t,preauthorizeExecution:!c,bufferExtendHashes:M,compressedArgs:Se,expectedSecp256r1Signers:Be}),rr=I.map(V=>Eu({transactionMessageBytes:V,transactionBufferAddress:x,settings:f,compressed:d})),mt=u.map(V=>Du({voter:V,transactionBufferAddress:x,settings:f,compressedArgs:Se})),se=Cu({compressedArgs:Se,settings:f,executor:c,transactionBufferAddress:x}),{instructions:Hr,addressLookupTableAccounts:y}=await Au({compressed:d,settings:f,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),ae=V=>({payer:e,instructions:V,addressesByLookupTableAddress:y});return [ae(pt),...rr.map(V=>ae([V])),...mt.length?[ae(mt.flat())]:[],ae(se),ae(Hr)]}var wr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=a=>{let i=s.get(a);return i===void 0&&(i={isSigner:false,isWritable:false,isInvoked:false},s.set(a,i)),i},c=t(r);c.isSigner=true,c.isWritable=true;for(let a of n){t(a.programAddress).isInvoked=false;for(let i of a.accounts??[]){let o=t(i.address);o.isSigner||=i.role===gill.AccountRole.READONLY_SIGNER||i.role===gill.AccountRole.WRITABLE_SIGNER,o.isWritable||=i.role===gill.AccountRole.WRITABLE||i.role===gill.AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),a={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let i=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [a,i]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&a.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&!a.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,a]of this.keyMetaMap.entries())if(r(a)){let i=c,o=n.findIndex(d=>d===i);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(i),this.keyMetaMap.delete(c);}}return [s,t]}};var Vr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,a)=>{s.set(c,a);});let t=c=>{let a=s.get(c);if(a===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return a};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(a=>t(a.address))??[],data:c.data}))}};function _u({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=wr.compile(r,e),c=new Array,a={writable:[],readonly:[]},i=Object.entries(s??{});for(let p of i){let l=t.extractTableLookup(p);if(l!==void 0){let{addressTableLookup:f,drainedKeys:b}=l;c.push({readonlyIndexes:f.readonlyIndexes,readableIndices:f.readonlyIndexes,writableIndexes:f.writableIndexes,writableIndices:f.writableIndexes,lookupTableAddress:gill.address(f.lookupTableAddress)}),a.writable.push(...b.writable),a.readonly.push(...b.readonly);}}let[o,d]=t.getMessageComponents(),g=new Vr(d,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function A6({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=_u({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return Ed(s)}async function y6({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await gu({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:d,cachedAccounts:i});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}
2
- exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=Ko;exports.BACKOFF_MAX_DELAY_MS=cr;exports.BUNDLE_POLL_DELAY_MS=Ms;exports.BUNDLE_POLL_MAX_RETRIES=Ds;exports.BundleError=ue;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=oc;exports.CHANGE_CONFIG_DISCRIMINATOR=Qo;exports.COMPUTE_UNIT_MULTIPLIER=Es;exports.CREATE_COMPRESSED_WALLET_DISCRIMINATOR=Ac;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=Ic;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=Mc;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=bc;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=Wc;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=Nc;exports.DEFAULT_JITO_BLOCK_ENGINE_URL=Ps;exports.DEFAULT_JITO_TIPS_URL=Rs;exports.DEFAULT_JITO_TIP_PRIORITY=hs;exports.DEFAULT_NETWORK_RETRY_DELAY_MS=ve;exports.DEFAULT_NETWORK_RETRY_MAX_RETRIES=_e;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=zc;exports.DOMAIN_CONFIG_DISCRIMINATOR=Ws;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=Xc;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=ra;exports.EDIT_USER_DELEGATE_DISCRIMINATOR=ia;exports.EXPONENTIAL_BACKOFF_BASE=or;exports.GLOBAL_COUNTER_DISCRIMINATOR=ws;exports.HTTP_STATUS_BAD_REQUEST=_s;exports.HTTP_STATUS_INTERNAL_SERVER_ERROR=jr;exports.HTTP_STATUS_TOO_MANY_REQUESTS=vs;exports.JITO_TIP_ACCOUNTS=Kr;exports.KeyType=Yt;exports.MAX_TRANSACTION_BUFFER_INDEX=bs;exports.MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR=ma;exports.MIGRATE_COMPRESSED_USERS_DISCRIMINATOR=xa;exports.MIN_COMPUTE_UNITS=sr;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=SI;exports.MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH=Zx;exports.MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED=dC;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=wI;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=VI;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH=aC;exports.MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE=lC;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=$x;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=Qx;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=dI;exports.MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS=jI;exports.MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH=aI;exports.MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH=Xx;exports.MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH=oI;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=hI;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=bI;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=_I;exports.MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED=KI;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=CI;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=xI;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=II;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=mI;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX=cC;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=GI;exports.MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG=iI;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=yI;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=RI;exports.MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT=JI;exports.MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS=EI;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=pI;exports.MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG=rI;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION=zx;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY=Jx;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=Gx;exports.MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS=jx;exports.MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER=NI;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=OI;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=AI;exports.MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE=nC;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG=cI;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION=sI;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=gI;exports.MULTI_WALLET_ERROR__INVALID_USER_ROLE=TI;exports.MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG=AC;exports.MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR=rC;exports.MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE=Yx;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=LI;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=HI;exports.MULTI_WALLET_ERROR__MEMBER_NOT_FOUND=ZI;exports.MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS=oC;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=lI;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS=YI;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT=$I;exports.MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT=gC;exports.MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR=tC;exports.MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS=qI;exports.MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS=fI;exports.MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY=TC;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE=mC;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA=zI;exports.MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT=pC;exports.MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA=eC;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=kI;exports.MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS=iC;exports.MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES=yC;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=MI;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=tI;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=nI;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=FI;exports.MULTI_WALLET_ERROR__PAYER_MISMATCH=QI;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=eI;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=WI;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=qx;exports.MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH=XI;exports.MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS=Kx;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=BI;exports.MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH=sC;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=uI;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=vI;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=UI;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=PI;exports.MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY=uC;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=DI;exports.MULTI_WALLET_PROGRAM_ADDRESS=A;exports.MultiWalletAccount=Vx;exports.MultiWalletInstruction=Hx;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=_a;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=Ma;exports.NetworkError=Ie;exports.NotFoundError=$;exports.NotInitializedError=Ue;exports.Permission=he;exports.PermissionError=ir;exports.Permissions=We;exports.RetryExhaustedError=ar;exports.RevibaseError=xe;exports.SETTINGS_DISCRIMINATOR=Mo;exports.Secp256r1Key=Le;exports.SignedSecp256r1Key=D;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=Ha;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=Ba;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=Qa;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=ja;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=ui;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=si;exports.TRANSACTION_BUFFER_DISCRIMINATOR=Uo;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=Ci;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=yi;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=Li;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=hi;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=ji;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=Vi;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=sd;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=Qi;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=yd;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=ud;exports.TRANSACTION_SIZE_LIMIT=zr;exports.TransactionError=Us;exports.UserRole=rt;exports.ValidationError=H;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=No;exports.addWhitelistedAddressTrees=$L;exports.base64URLStringToBuffer=Oe;exports.bufferToBase64URLString=wO;exports.calculateBackoffDelay=hC;exports.changeConfig=Jw;exports.closeTransactionBuffer=t5;exports.configAction=eM;exports.convertMemberKeyToString=nu;exports.convertPubkeyCompressedToCose=vO;exports.convertPubkeyCoseToCompressed=_O;exports.createAccountInfoCacheKey=Wd;exports.createClientAuthorizationCompleteRequestChallenge=OO;exports.createClientAuthorizationStartRequestChallenge=kO;exports.createCompressedAccountCacheKey=vd;exports.createDomainConfig=oN;exports.createDomainUserAccounts=TN;exports.createGlobalCounter=SN;exports.createMessageChallenge=BO;exports.createTokenAccountCacheKey=Ud;exports.createTransactionBuffer=Iu;exports.createTransactionChallenge=NO;exports.createTransactionManagerSigner=ME;exports.createUserAccounts=e2;exports.createWallet=a2;exports.decodeDomainConfig=ks;exports.decodeGlobalCounter=Hs;exports.decodeSettings=Ro;exports.decodeTransactionBuffer=Lo;exports.decodeWhitelistedAddressTree=Vo;exports.decompressSettingsAccount=y2;exports.deserializeConfigActions=wB;exports.disableDomainConfig=EN;exports.editDomainConfig=E2;exports.editTransactionManagerUrl=b2;exports.editUserDelegate=w2;exports.executeTransaction=Au;exports.executeTransactionBuffer=Cu;exports.executeTransactionSync=gu;exports.extendTransactionBuffer=Eu;exports.fetchAllDomainConfig=TD;exports.fetchAllGlobalCounter=CD;exports.fetchAllMaybeDomainConfig=Ku;exports.fetchAllMaybeGlobalCounter=aA;exports.fetchAllMaybeSettings=Lm;exports.fetchAllMaybeTransactionBuffer=eT;exports.fetchAllMaybeWhitelistedAddressTree=xT;exports.fetchAllSettings=XR;exports.fetchAllTransactionBuffer=nh;exports.fetchAllWhitelistedAddressTree=ih;exports.fetchDomainConfig=Os;exports.fetchGlobalCounter=ID;exports.fetchMaybeDomainConfig=zu;exports.fetchMaybeGlobalCounter=cA;exports.fetchMaybeSettings=Rn;exports.fetchMaybeSettingsAccountData=kC;exports.fetchMaybeTransactionBuffer=$m;exports.fetchMaybeUserAccountData=LC;exports.fetchMaybeWhitelistedAddressTree=ST;exports.fetchSettings=ZR;exports.fetchSettingsAccountData=ss;exports.fetchTransactionBuffer=ko;exports.fetchUserAccountData=Ur;exports.fetchWhitelistedAddressTree=Ho;exports.getAddMemberArgsCodec=RD;exports.getAddMemberArgsDecoder=Yr;exports.getAddMemberArgsEncoder=Jr;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=Mh;exports.getAddWhitelistedAddressTreesInstruction=Rh;exports.getAddWhitelistedAddressTreesInstructionAsync=Jo;exports.getAddWhitelistedAddressTreesInstructionDataCodec=Ph;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=jo;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=kn;exports.getCachedOrFetch=br;exports.getChangeConfigCompressedDiscriminatorBytes=Kh;exports.getChangeConfigCompressedInstruction=ic;exports.getChangeConfigCompressedInstructionDataCodec=jh;exports.getChangeConfigCompressedInstructionDataDecoder=ac;exports.getChangeConfigCompressedInstructionDataEncoder=cc;exports.getChangeConfigDiscriminatorBytes=kh;exports.getChangeConfigInstruction=Bh;exports.getChangeConfigInstructionAsync=ec;exports.getChangeConfigInstructionDataCodec=Oh;exports.getChangeConfigInstructionDataDecoder=$o;exports.getChangeConfigInstructionDataEncoder=Bn;exports.getClientAndDeviceHash=cs;exports.getCompiledInstructionCodec=_D;exports.getCompiledInstructionDecoder=Zr;exports.getCompiledInstructionEncoder=qr;exports.getCompressedAccountMetaCodec=LD;exports.getCompressedAccountMetaDecoder=ft;exports.getCompressedAccountMetaEncoder=lt;exports.getCompressedAccountMetaReadOnlyCodec=ND;exports.getCompressedAccountMetaReadOnlyDecoder=Ct;exports.getCompressedAccountMetaReadOnlyEncoder=It;exports.getCompressedProofCodec=HD;exports.getCompressedProofDecoder=rn;exports.getCompressedProofEncoder=tn;exports.getCompressedSettingsAddressFromIndex=ne;exports.getCompressedSettingsCodec=KD;exports.getCompressedSettingsDataCodec=qD;exports.getCompressedSettingsDataDecoder=Mt;exports.getCompressedSettingsDataEncoder=Dt;exports.getCompressedSettingsDecoder=j;exports.getCompressedSettingsEncoder=Et;exports.getComputeBudgetEstimate=_d;exports.getConfigActionCodec=$D;exports.getConfigActionDecoder=Ge;exports.getConfigActionEncoder=Fe;exports.getCreateCompressedWalletDiscriminatorBytes=eb;exports.getCreateCompressedWalletInstruction=rb;exports.getCreateCompressedWalletInstructionAsync=pc;exports.getCreateCompressedWalletInstructionDataCodec=tb;exports.getCreateCompressedWalletInstructionDataDecoder=gc;exports.getCreateCompressedWalletInstructionDataEncoder=Nn;exports.getCreateDomainConfigDiscriminatorBytes=ub;exports.getCreateDomainConfigInstruction=gb;exports.getCreateDomainConfigInstructionAsync=Ec;exports.getCreateDomainConfigInstructionDataCodec=Ab;exports.getCreateDomainConfigInstructionDataDecoder=Cc;exports.getCreateDomainConfigInstructionDataEncoder=Vn;exports.getCreateDomainUserAccountDiscriminatorBytes=xb;exports.getCreateDomainUserAccountInstruction=Cb;exports.getCreateDomainUserAccountInstructionAsync=Rc;exports.getCreateDomainUserAccountInstructionDataCodec=Ib;exports.getCreateDomainUserAccountInstructionDataDecoder=Pc;exports.getCreateDomainUserAccountInstructionDataEncoder=Fn;exports.getCreateGlobalCounterDiscriminatorBytes=bb;exports.getCreateGlobalCounterInstruction=vb;exports.getCreateGlobalCounterInstructionAsync=vc;exports.getCreateGlobalCounterInstructionDataCodec=_b;exports.getCreateGlobalCounterInstructionDataDecoder=_c;exports.getCreateGlobalCounterInstructionDataEncoder=zn;exports.getCreateUserAccountArgsCodec=oM;exports.getCreateUserAccountArgsDecoder=An;exports.getCreateUserAccountArgsEncoder=un;exports.getCreateUserAccountsDiscriminatorBytes=wb;exports.getCreateUserAccountsInstruction=Hb;exports.getCreateUserAccountsInstructionAsync=kc;exports.getCreateUserAccountsInstructionDataCodec=Vb;exports.getCreateUserAccountsInstructionDataDecoder=Lc;exports.getCreateUserAccountsInstructionDataEncoder=jn;exports.getDecompressSettingsAccountDiscriminatorBytes=qb;exports.getDecompressSettingsAccountInstruction=Hc;exports.getDecompressSettingsAccountInstructionDataCodec=Zb;exports.getDecompressSettingsAccountInstructionDataDecoder=Vc;exports.getDecompressSettingsAccountInstructionDataEncoder=wc;exports.getDisableDomainConfigDiscriminatorBytes=n_;exports.getDisableDomainConfigInstruction=Jc;exports.getDisableDomainConfigInstructionDataCodec=s_;exports.getDisableDomainConfigInstructionDataDecoder=jc;exports.getDisableDomainConfigInstructionDataEncoder=Kc;exports.getDomainConfigAddress=at;exports.getDomainConfigCodec=mD;exports.getDomainConfigDecoder=Ls;exports.getDomainConfigDiscriminatorBytes=pD;exports.getDomainConfigEncoder=Gu;exports.getDomainConfigSize=yD;exports.getEditDomainConfigDiscriminatorBytes=g_;exports.getEditDomainConfigInstruction=$c;exports.getEditDomainConfigInstructionAsync=m_;exports.getEditDomainConfigInstructionDataCodec=p_;exports.getEditDomainConfigInstructionDataDecoder=Qc;exports.getEditDomainConfigInstructionDataEncoder=Yn;exports.getEditMemberArgsCodec=dM;exports.getEditMemberArgsDecoder=cn;exports.getEditMemberArgsEncoder=on;exports.getEditTransactionManagerUrlDiscriminatorBytes=C_;exports.getEditTransactionManagerUrlInstruction=oa;exports.getEditTransactionManagerUrlInstructionDataCodec=E_;exports.getEditTransactionManagerUrlInstructionDataDecoder=sa;exports.getEditTransactionManagerUrlInstructionDataEncoder=na;exports.getEditUserDelegateDiscriminatorBytes=v_;exports.getEditUserDelegateInstruction=Aa;exports.getEditUserDelegateInstructionDataCodec=U_;exports.getEditUserDelegateInstructionDataDecoder=ua;exports.getEditUserDelegateInstructionDataEncoder=da;exports.getExpectedSecp256r1SignersCodec=pM;exports.getExpectedSecp256r1SignersDecoder=bt;exports.getExpectedSecp256r1SignersEncoder=ht;exports.getGlobalCounterAddress=Fd;exports.getGlobalCounterCodec=xD;exports.getGlobalCounterDecoder=Vs;exports.getGlobalCounterDiscriminatorBytes=SD;exports.getGlobalCounterEncoder=oA;exports.getGlobalCounterSize=ED;exports.getJitoTipsConfig=rs;exports.getLightCpiSigner=fO;exports.getLightProtocolRpc=st;exports.getLinkWalletArgsCodec=lM;exports.getLinkWalletArgsDecoder=pn;exports.getLinkWalletArgsEncoder=gn;exports.getMemberCodec=IM;exports.getMemberDecoder=Rt;exports.getMemberEncoder=Pt;exports.getMemberKeyCodec=DM;exports.getMemberKeyDecoder=te;exports.getMemberKeyEncoder=ee;exports.getMigrateCompressedSettingsDiscriminatorBytes=V_;exports.getMigrateCompressedSettingsInstruction=la;exports.getMigrateCompressedSettingsInstructionDataCodec=H_;exports.getMigrateCompressedSettingsInstructionDataDecoder=ya;exports.getMigrateCompressedSettingsInstructionDataEncoder=Ta;exports.getMigrateCompressedUsersDiscriminatorBytes=q_;exports.getMigrateCompressedUsersInstruction=Ea;exports.getMigrateCompressedUsersInstructionDataCodec=Z_;exports.getMigrateCompressedUsersInstructionDataDecoder=Ca;exports.getMigrateCompressedUsersInstructionDataEncoder=Ia;exports.getMultiWalletErrorMessage=HL;exports.getNativeTransferIntentCompressedDiscriminatorBytes=mv;exports.getNativeTransferIntentCompressedInstruction=Wa;exports.getNativeTransferIntentCompressedInstructionDataCodec=Tv;exports.getNativeTransferIntentCompressedInstructionDataDecoder=Ua;exports.getNativeTransferIntentCompressedInstructionDataEncoder=va;exports.getNativeTransferIntentDiscriminatorBytes=sv;exports.getNativeTransferIntentInstruction=Ra;exports.getNativeTransferIntentInstructionAsync=cv;exports.getNativeTransferIntentInstructionDataCodec=ov;exports.getNativeTransferIntentInstructionDataDecoder=Pa;exports.getNativeTransferIntentInstructionDataEncoder=qn;exports.getNewAuthorityArgsCodec=hM;exports.getNewAuthorityArgsDecoder=ln;exports.getNewAuthorityArgsEncoder=yn;exports.getOriginIndex=VO;exports.getPackedAddressTreeInfoCodec=vM;exports.getPackedAddressTreeInfoDecoder=vt;exports.getPackedAddressTreeInfoEncoder=_t;exports.getPackedMerkleContextCodec=LM;exports.getPackedMerkleContextDecoder=Sn;exports.getPackedMerkleContextEncoder=fn;exports.getPackedStateTreeInfoCodec=BM;exports.getPackedStateTreeInfoDecoder=xt;exports.getPackedStateTreeInfoEncoder=St;exports.getPermissionsCodec=VM;exports.getPermissionsDecoder=He;exports.getPermissionsEncoder=Ve;exports.getProofArgsCodec=zM;exports.getProofArgsDecoder=E;exports.getProofArgsEncoder=C;exports.getRemoveMemberArgsCodec=YM;exports.getRemoveMemberArgsDecoder=dn;exports.getRemoveMemberArgsEncoder=an;exports.getSecp256r1MessageHash=as;exports.getSecp256r1PubkeyCodec=XM;exports.getSecp256r1PubkeyDecoder=Ut;exports.getSecp256r1PubkeyEncoder=Cn;exports.getSecp256r1SignatureOffsetsDataDecoder=wE;exports.getSecp256r1SignatureOffsetsDataEncoder=NE;exports.getSecp256r1VerifyArgsCodec=eP;exports.getSecp256r1VerifyArgsDecoder=w;exports.getSecp256r1VerifyArgsEncoder=N;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=sP;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=Y;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=J;exports.getSecp256r1VerifyInstruction=B;exports.getSecp256r1VerifyInstructionDataCodec=QN;exports.getSecp256r1VerifyInstructionDataDecoder=du;exports.getSecp256r1VerifyInstructionDataEncoder=uu;exports.getSendAndConfirmTransaction=bd;exports.getSettingsCodec=qR;exports.getSettingsCreationArgsCodec=iP;exports.getSettingsCreationArgsDecoder=Lt;exports.getSettingsCreationArgsEncoder=Wt;exports.getSettingsDecoder=Po;exports.getSettingsDiscriminatorBytes=YR;exports.getSettingsEncoder=Wm;exports.getSettingsFromIndex=ce;exports.getSettingsIndexWithAddressCodec=AP;exports.getSettingsIndexWithAddressDecoder=Ot;exports.getSettingsIndexWithAddressEncoder=kt;exports.getSettingsMutArgsCodec=TP;exports.getSettingsMutArgsDecoder=G;exports.getSettingsMutArgsEncoder=F;exports.getSettingsReadonlyArgsCodec=SP;exports.getSettingsReadonlyArgsDecoder=Nt;exports.getSettingsReadonlyArgsEncoder=Bt;exports.getSignedSecp256r1Key=UO;exports.getSignedTransactionManager=BB;exports.getSolanaRpc=re;exports.getSolanaRpcEndpoint=hd;exports.getSourceCompressedTokenArgsCodec=EP;exports.getSourceCompressedTokenArgsDecoder=Vt;exports.getSourceCompressedTokenArgsEncoder=wt;exports.getTokenTransferIntentCompressedDiscriminatorBytes=Wv;exports.getTokenTransferIntentCompressedInstruction=Ga;exports.getTokenTransferIntentCompressedInstructionAsync=kv;exports.getTokenTransferIntentCompressedInstructionDataCodec=Lv;exports.getTokenTransferIntentCompressedInstructionDataDecoder=Fa;exports.getTokenTransferIntentCompressedInstructionDataEncoder=Xn;exports.getTokenTransferIntentDiscriminatorBytes=Ev;exports.getTokenTransferIntentInstruction=wa;exports.getTokenTransferIntentInstructionAsync=Mv;exports.getTokenTransferIntentInstructionDataCodec=Dv;exports.getTokenTransferIntentInstructionDataDecoder=Na;exports.getTokenTransferIntentInstructionDataEncoder=Zn;exports.getTransactionBufferAddress=Gd;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=Qv;exports.getTransactionBufferCloseCompressedInstruction=ti;exports.getTransactionBufferCloseCompressedInstructionDataCodec=$v;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=ei;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=$a;exports.getTransactionBufferCloseDiscriminatorBytes=Gv;exports.getTransactionBufferCloseInstruction=qa;exports.getTransactionBufferCloseInstructionDataCodec=zv;exports.getTransactionBufferCloseInstructionDataDecoder=Ya;exports.getTransactionBufferCloseInstructionDataEncoder=Ja;exports.getTransactionBufferCodec=rh;exports.getTransactionBufferCreateArgsCodec=RP;exports.getTransactionBufferCreateArgsDecoder=Ft;exports.getTransactionBufferCreateArgsEncoder=Ht;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=yU;exports.getTransactionBufferCreateCompressedInstruction=pi;exports.getTransactionBufferCreateCompressedInstructionDataCodec=lU;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=gi;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=Ai;exports.getTransactionBufferCreateDiscriminatorBytes=aU;exports.getTransactionBufferCreateInstruction=ai;exports.getTransactionBufferCreateInstructionDataCodec=iU;exports.getTransactionBufferCreateInstructionDataDecoder=ci;exports.getTransactionBufferCreateInstructionDataEncoder=oi;exports.getTransactionBufferDecoder=Wo;exports.getTransactionBufferDiscriminatorBytes=th;exports.getTransactionBufferEncoder=Qm;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=LU;exports.getTransactionBufferExecuteCompressedInstruction=Mi;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=kU;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=Di;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=Ei;exports.getTransactionBufferExecuteDiscriminatorBytes=MU;exports.getTransactionBufferExecuteInstruction=Si;exports.getTransactionBufferExecuteInstructionDataCodec=PU;exports.getTransactionBufferExecuteInstructionDataDecoder=fi;exports.getTransactionBufferExecuteInstructionDataEncoder=li;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=ZU;exports.getTransactionBufferExtendCompressedInstruction=Bi;exports.getTransactionBufferExtendCompressedInstructionDataCodec=XU;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=Oi;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=ki;exports.getTransactionBufferExtendDiscriminatorBytes=FU;exports.getTransactionBufferExtendInstruction=vi;exports.getTransactionBufferExtendInstructionDataCodec=GU;exports.getTransactionBufferExtendInstructionDataDecoder=_i;exports.getTransactionBufferExtendInstructionDataEncoder=bi;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=mW;exports.getTransactionBufferVoteCompressedInstruction=qi;exports.getTransactionBufferVoteCompressedInstructionDataCodec=TW;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=Yi;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=Ji;exports.getTransactionBufferVoteDiscriminatorBytes=oW;exports.getTransactionBufferVoteInstruction=Gi;exports.getTransactionBufferVoteInstructionDataCodec=cW;exports.getTransactionBufferVoteInstructionDataDecoder=Fi;exports.getTransactionBufferVoteInstructionDataEncoder=Hi;exports.getTransactionExecuteCompressedDiscriminatorBytes=_W;exports.getTransactionExecuteCompressedInstruction=ad;exports.getTransactionExecuteCompressedInstructionDataCodec=vW;exports.getTransactionExecuteCompressedInstructionDataDecoder=cd;exports.getTransactionExecuteCompressedInstructionDataEncoder=od;exports.getTransactionExecuteDiscriminatorBytes=CW;exports.getTransactionExecuteInstruction=td;exports.getTransactionExecuteInstructionDataCodec=EW;exports.getTransactionExecuteInstructionDataDecoder=ed;exports.getTransactionExecuteInstructionDataEncoder=$i;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=YW;exports.getTransactionExecuteSyncCompressedInstruction=Sd;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=qW;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=fd;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=ld;exports.getTransactionExecuteSyncDiscriminatorBytes=wW;exports.getTransactionExecuteSyncInstruction=pd;exports.getTransactionExecuteSyncInstructionDataCodec=VW;exports.getTransactionExecuteSyncInstructionDataDecoder=gd;exports.getTransactionExecuteSyncInstructionDataEncoder=Ad;exports.getTransactionMessageAddressTableLookupCodec=LP;exports.getTransactionMessageAddressTableLookupDecoder=Dn;exports.getTransactionMessageAddressTableLookupEncoder=En;exports.getTransactionMessageCodec=vP;exports.getTransactionMessageDecoder=zt;exports.getTransactionMessageEncoder=Gt;exports.getUserAccountAddress=k;exports.getUserCodec=NP;exports.getUserCreationArgsCodec=FP;exports.getUserCreationArgsDecoder=le;exports.getUserCreationArgsEncoder=ye;exports.getUserDecoder=q;exports.getUserEncoder=je;exports.getUserMutArgsCodec=jP;exports.getUserMutArgsDecoder=Ye;exports.getUserMutArgsEncoder=Je;exports.getUserReadOnlyArgsCodec=ZP;exports.getUserReadOnlyArgsDecoder=Re;exports.getUserReadOnlyArgsEncoder=Pe;exports.getUserReadOnlyOrMutateArgsCodec=eR;exports.getUserReadOnlyOrMutateArgsDecoder=In;exports.getUserReadOnlyOrMutateArgsEncoder=xn;exports.getUserRoleCodec=oR;exports.getUserRoleDecoder=Ke;exports.getUserRoleEncoder=ze;exports.getWalletAddressFromIndex=lO;exports.getWalletAddressFromSettings=be;exports.getWhitelistedAddressTreeCodec=ah;exports.getWhitelistedAddressTreeDecoder=wo;exports.getWhitelistedAddressTreeDiscriminatorBytes=ch;exports.getWhitelistedAddressTreeEncoder=fT;exports.getWhitelistedAddressTreeFromIndex=os;exports.getWhitelistedAddressTreeIndexFromAddress=oO;exports.getWhitelistedAddressTreesAddress=Bd;exports.identifyMultiWalletAccount=LL;exports.identifyMultiWalletInstruction=kL;exports.initialize=hk;exports.isConfigAction=tM;exports.isMultiWalletError=FL;exports.isUserReadOnlyOrMutateArgs=rR;exports.migrateSettings=_N;exports.migrateUsers=BN;exports.nativeTransferIntent=Ew;exports.parseAddWhitelistedAddressTreesInstruction=hh;exports.parseChangeConfigCompressedInstruction=Jh;exports.parseChangeConfigInstruction=Nh;exports.parseCreateCompressedWalletInstruction=nb;exports.parseCreateDomainConfigInstruction=pb;exports.parseCreateDomainUserAccountInstruction=Eb;exports.parseCreateGlobalCounterInstruction=Ub;exports.parseCreateUserAccountsInstruction=Fb;exports.parseDecompressSettingsAccountInstruction=Xb;exports.parseDisableDomainConfigInstruction=o_;exports.parseEditDomainConfigInstruction=T_;exports.parseEditTransactionManagerUrlInstruction=D_;exports.parseEditUserDelegateInstruction=W_;exports.parseJson=er;exports.parseMigrateCompressedSettingsInstruction=F_;exports.parseMigrateCompressedUsersInstruction=X_;exports.parseNativeTransferIntentCompressedInstruction=yv;exports.parseNativeTransferIntentInstruction=av;exports.parseSecp256r1VerifyInstruction=$N;exports.parseTokenTransferIntentCompressedInstruction=Ov;exports.parseTokenTransferIntentInstruction=Pv;exports.parseTransactionBufferCloseCompressedInstruction=eU;exports.parseTransactionBufferCloseInstruction=Kv;exports.parseTransactionBufferCreateCompressedInstruction=fU;exports.parseTransactionBufferCreateInstruction=dU;exports.parseTransactionBufferExecuteCompressedInstruction=OU;exports.parseTransactionBufferExecuteInstruction=RU;exports.parseTransactionBufferExtendCompressedInstruction=QU;exports.parseTransactionBufferExtendInstruction=zU;exports.parseTransactionBufferVoteCompressedInstruction=yW;exports.parseTransactionBufferVoteInstruction=aW;exports.parseTransactionExecuteCompressedInstruction=UW;exports.parseTransactionExecuteInstruction=DW;exports.parseTransactionExecuteSyncCompressedInstruction=ZW;exports.parseTransactionExecuteSyncInstruction=HW;exports.pollJitoBundleConfirmation=pB;exports.prepareChangeConfigArgs=z5;exports.prepareTransactionBundle=Q5;exports.prepareTransactionMessage=A6;exports.prepareTransactionSync=y6;exports.requireInRange=Md;exports.requireNonEmpty=qt;exports.requireNonEmptyString=Rd;exports.requireNonNegative=Pd;exports.retrieveTransactionManager=OB;exports.retryFetch=ot;exports.retryWithBackoff=Zt;exports.sendJitoBundle=aE;exports.serializeConfigActions=NB;exports.signAndSendBundledTransactions=gB;exports.signAndSendTransaction=xB;exports.sleep=bC;exports.tokenTransferIntent=Ow;exports.userReadOnlyOrMutateArgs=tR;exports.validateResponse=$t;exports.vaultTransactionMessageDeserialize=Dd;exports.vaultTransactionMessageSerialize=Ed;exports.voteTransactionBuffer=Du;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';var gill=require('gill'),stateless_js=require('@lightprotocol/stateless.js'),sha2_js=require('@noble/hashes/sha2.js'),web3_js=require('@solana/web3.js'),S=require('zod'),programs=require('gill/programs'),nist_js=require('@noble/curves/nist.js'),tinyCbor=require('@levischuck/tiny-cbor'),utils_js=require('@noble/curves/utils.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var S__default=/*#__PURE__*/_interopDefault(S);var Kr=1644,or=2e5,Ds=1.1,Ms=30,Ps=3e3,ve=3,Ue=500,cr=2,ar=3e4,jr=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],hs="https://mainnet.block-engine.jito.wtf/api/v1",Rs="https://bundles.jito.wtf/api/v1/bundles/tip_floor",bs="landed_tips_75th_percentile",_s=255,vs=400,Us=429,qr=500;var Ie=class extends Error{constructor(r,s,t){super(r);this.code=s;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},We=class extends Ie{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},ee=class extends Ie{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},F=class extends Ie{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},Ce=class extends Ie{constructor(r,s,t){super(r,"NETWORK_ERROR",{statusCode:s,url:t});this.statusCode=s;this.url=t;}},Ws=class extends Ie{constructor(r,s,t){super(r,"TRANSACTION_ERROR",{signature:s,logs:t});this.signature=s;this.logs=t;}},Ae=class extends Ie{constructor(r,s,t){super(r,"BUNDLE_ERROR",{bundleId:s,attempt:t});this.bundleId=s;this.attempt=t;}},ir=class extends Ie{constructor(r,s,t){super(`Operation "${r}" failed after ${s} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=s;this.lastError=t;}},dr=class extends Ie{constructor(r,s,t){super(r,"PERMISSION_ERROR",{required:s,actual:t});this.required=s;this.actual=t;}};var Ls=new Uint8Array([201,232,212,229,59,241,106,197]);function SD(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Ls)}function Ju(){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:Ls}))}function ks(){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 xD(){return gill.combineCodec(Ju(),ks())}function Os(e){return gill.decodeAccount(e,ks())}async function Bs(e,n,r){let s=await Yu(e,n,r);return gill.assertAccountExists(s),s}async function Yu(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Os(s)}async function ID(e,n,r){let s=await Zu(e,n,r);return gill.assertAccountsExist(s),s}async function Zu(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Os(t))}function CD(){return 846}var Vs=new Uint8Array([42,206,176,58,175,129,130,233]);function MD(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Vs)}function uA(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:Vs}))}function Hs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function PD(){return gill.combineCodec(uA(),Hs())}function Fs(e){return gill.decodeAccount(e,Hs())}async function hD(e,n,r){let s=await AA(e,n,r);return gill.assertAccountExists(s),s}async function AA(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Fs(s)}async function RD(e,n,r){let s=await gA(e,n,r);return gill.assertAccountsExist(s),s}async function gA(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Fs(t))}function bD(){return 24}function Jr(){return gill.getStructEncoder([["memberKey",te()],["permissions",He()],["userReadonlyArgs",he()]])}function Yr(){return gill.getStructDecoder([["memberKey",re()],["permissions",Fe()],["userReadonlyArgs",Re()]])}function WD(){return gill.combineCodec(Jr(),Yr())}function Zr(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Xr(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function OD(){return gill.combineCodec(Zr(),Xr())}function ft(){return gill.getStructEncoder([["treeInfo",xt()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["outputStateTreeIndex",gill.getU8Encoder()]])}function St(){return gill.getStructDecoder([["treeInfo",It()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["outputStateTreeIndex",gill.getU8Decoder()]])}function VD(){return gill.combineCodec(ft(),St())}function Ct(){return gill.getStructEncoder([["treeInfo",xt()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Et(){return gill.getStructDecoder([["treeInfo",It()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function zD(){return gill.combineCodec(Ct(),Et())}function rn(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function nn(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function qD(){return gill.combineCodec(rn(),nn())}function Dt(){return gill.getStructEncoder([["data",gill.getOptionEncoder(Mt())]])}function q(){return gill.getStructDecoder([["data",gill.getOptionDecoder(Pt())]])}function XD(){return gill.combineCodec(Dt(),q())}function Mt(){return gill.getStructEncoder([["threshold",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["index",gill.getU128Encoder()],["multiWalletBump",gill.getU8Encoder()],["members",gill.getArrayEncoder(ht())],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]])}function Pt(){return gill.getStructDecoder([["threshold",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["index",gill.getU128Decoder()],["multiWalletBump",gill.getU8Decoder()],["members",gill.getArrayDecoder(Rt())],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function tM(){return gill.combineCodec(Mt(),Pt())}function Ge(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(cn())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Jr())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(dn())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function ze(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(an())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Yr())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(un())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function oM(){return gill.combineCodec(Ge(),ze())}function cM(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function aM(e,n){return n.__kind===e}function An(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",Ke()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",le()]])}function gn(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",je()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",fe()]])}function AM(){return gill.combineCodec(An(),gn())}function cn(){return gill.getStructEncoder([["memberKey",te()],["permissions",He()]])}function an(){return gill.getStructDecoder([["memberKey",re()],["permissions",Fe()]])}function TM(){return gill.combineCodec(cn(),an())}function bt(){return gill.getStructEncoder([["memberKey",te()],["messageHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function _t(){return gill.getStructDecoder([["memberKey",re()],["messageHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function SM(){return gill.combineCodec(bt(),_t())}function pn(){return gill.getStructEncoder([["settingsMutArgs",G()],["transactionManager",gill.getOptionEncoder(he())]])}function mn(){return gill.getStructDecoder([["settingsMutArgs",z()],["transactionManager",gill.getOptionDecoder(Re())]])}function EM(){return gill.combineCodec(pn(),mn())}function ht(){return gill.getStructEncoder([["pubkey",te()],["permissions",He()],["role",gill.getU8Encoder()],["userAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getU8Encoder()]])}function Rt(){return gill.getStructDecoder([["pubkey",re()],["permissions",Fe()],["role",gill.getU8Decoder()],["userAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getU8Decoder()]])}function hM(){return gill.combineCodec(ht(),Rt())}function te(){return gill.getStructEncoder([["keyType",gill.getU8Encoder()],["key",gill.fixEncoderSize(gill.getBytesEncoder(),33)]])}function re(){return gill.getStructDecoder([["keyType",gill.getU8Decoder()],["key",gill.fixDecoderSize(gill.getBytesDecoder(),33)]])}function _M(){return gill.combineCodec(te(),re())}function ln(){return gill.getStructEncoder([["authorityCreationArgs",le()],["compressedProofArgs",E()]])}function fn(){return gill.getStructDecoder([["authorityCreationArgs",fe()],["compressedProofArgs",D()]])}function LM(){return gill.combineCodec(ln(),fn())}function vt(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function Ut(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function BM(){return gill.combineCodec(vt(),Ut())}function Sn(){return gill.getStructEncoder([["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()],["proveByIndex",gill.getBooleanEncoder()]])}function xn(){return gill.getStructDecoder([["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()],["proveByIndex",gill.getBooleanDecoder()]])}function VM(){return gill.combineCodec(Sn(),xn())}function xt(){return gill.getStructEncoder([["rootIndex",gill.getU16Encoder()],["proveByIndex",gill.getBooleanEncoder()],["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()]])}function It(){return gill.getStructDecoder([["rootIndex",gill.getU16Decoder()],["proveByIndex",gill.getBooleanDecoder()],["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()]])}function GM(){return gill.combineCodec(xt(),It())}function He(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function Fe(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function jM(){return gill.combineCodec(He(),Fe())}function E(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(rn())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function D(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(nn())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function ZM(){return gill.combineCodec(E(),D())}function dn(){return gill.getStructEncoder([["memberKey",te()],["userArgs",In()]])}function un(){return gill.getStructDecoder([["memberKey",re()],["userArgs",Cn()]])}function eP(){return gill.combineCodec(dn(),un())}function En(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function Wt(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function nP(){return gill.combineCodec(En(),Wt())}function w(){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 V(){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 cP(){return gill.combineCodec(w(),V())}function J(){return gill.getStructEncoder([["domainConfigKey",gill.getAddressEncoder()],["verifyArgs",w()]])}function Y(){return gill.getStructDecoder([["domainConfigKey",gill.getAddressDecoder()],["verifyArgs",V()]])}function uP(){return gill.combineCodec(J(),Y())}function Lt(){return gill.getStructEncoder([["addressTreeInfo",vt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function kt(){return gill.getStructDecoder([["addressTreeInfo",Ut()],["outputStateTreeIndex",gill.getU8Decoder()]])}function mP(){return gill.combineCodec(Lt(),kt())}function Ot(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function Bt(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function lP(){return gill.combineCodec(Ot(),Bt())}function G(){return gill.getStructEncoder([["accountMeta",ft()],["data",Dt()]])}function z(){return gill.getStructDecoder([["accountMeta",St()],["data",q()]])}function IP(){return gill.combineCodec(G(),z())}function Nt(){return gill.getStructEncoder([["accountMeta",Ct()],["data",Dt()]])}function wt(){return gill.getStructDecoder([["accountMeta",Et()],["data",q()]])}function MP(){return gill.combineCodec(Nt(),wt())}function Vt(){return gill.getStructEncoder([["version",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()],["amount",gill.getU64Encoder()],["merkleContext",Sn()]])}function Ht(){return gill.getStructDecoder([["version",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()],["amount",gill.getU64Decoder()],["merkleContext",xn()]])}function bP(){return gill.combineCodec(Vt(),Ht())}function Ft(){return gill.getStructEncoder([["bufferIndex",gill.getU8Encoder()],["preauthorizeExecution",gill.getBooleanEncoder()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["finalBufferHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["finalBufferSize",gill.getU16Encoder()],["expectedSecp256r1Signers",gill.getArrayEncoder(bt())]])}function Gt(){return gill.getStructDecoder([["bufferIndex",gill.getU8Decoder()],["preauthorizeExecution",gill.getBooleanDecoder()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["finalBufferHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["finalBufferSize",gill.getU16Decoder()],["expectedSecp256r1Signers",gill.getArrayDecoder(_t())]])}function WP(){return gill.combineCodec(Ft(),Gt())}function zt(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(Zr())],["addressTableLookups",gill.getArrayEncoder(Dn())]])}function Kt(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(Xr())],["addressTableLookups",gill.getArrayDecoder(Mn())]])}function BP(){return gill.combineCodec(zt(),Kt())}function Dn(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Mn(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function VP(){return gill.combineCodec(Dn(),Mn())}function qe(){return gill.getStructEncoder([["member",te()],["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["role",Ke()],["delegatedTo",gill.getOptionEncoder(Ot())],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function Z(){return gill.getStructDecoder([["member",re()],["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["role",je()],["delegatedTo",gill.getOptionDecoder(Bt())],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function zP(){return gill.combineCodec(qe(),Z())}function le(){return gill.getStructEncoder([["addressTreeInfo",vt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function fe(){return gill.getStructDecoder([["addressTreeInfo",Ut()],["outputStateTreeIndex",gill.getU8Decoder()]])}function JP(){return gill.combineCodec(le(),fe())}function Je(){return gill.getStructEncoder([["accountMeta",ft()],["data",qe()]])}function Ye(){return gill.getStructDecoder([["accountMeta",St()],["data",Z()]])}function QP(){return gill.combineCodec(Je(),Ye())}function he(){return gill.getStructEncoder([["accountMeta",Ct()],["data",qe()]])}function Re(){return gill.getStructDecoder([["accountMeta",Et()],["data",Z()]])}function rh(){return gill.combineCodec(he(),Re())}function In(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([he()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([Je()])]])]])}function Cn(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([Re()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([Ye()])]])]])}function ch(){return gill.combineCodec(In(),Cn())}function ah(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function ih(e,n){return n.__kind===e}var nt=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(nt||{});function Ke(){return gill.getEnumEncoder(nt)}function je(){return gill.getEnumDecoder(nt)}function Ah(){return gill.combineCodec(Ke(),je())}var Po=new Uint8Array([223,179,163,190,177,224,67,173]);function eR(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Po)}function N1(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(ht())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]]),e=>({...e,discriminator:Po}))}function ho(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(Rt())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function tR(){return gill.combineCodec(N1(),ho())}function Ro(e){return gill.decodeAccount(e,ho())}async function rR(e,n,r){let s=await Rn(e,n,r);return gill.assertAccountExists(s),s}async function Rn(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Ro(s)}async function nR(e,n,r){let s=await w1(e,n,r);return gill.assertAccountsExist(s),s}async function w1(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Ro(t))}var Wo=new Uint8Array([90,36,35,219,93,225,110,96]);function aR(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Wo)}function nT(){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",te()],["executor",te()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder(te())],["expectedSecp256r1Signers",gill.getArrayEncoder(bt())],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Wo}))}function Lo(){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",re()],["executor",re()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["voters",gill.getArrayDecoder(re())],["expectedSecp256r1Signers",gill.getArrayDecoder(_t())],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function iR(){return gill.combineCodec(nT(),Lo())}function ko(e){return gill.decodeAccount(e,Lo())}async function Oo(e,n,r){let s=await sT(e,n,r);return gill.assertAccountExists(s),s}async function sT(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return ko(s)}async function dR(e,n,r){let s=await oT(e,n,r);return gill.assertAccountsExist(s),s}async function oT(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>ko(t))}var wo=new Uint8Array([105,23,173,2,197,255,80,87]);function gR(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(wo)}function ET(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:wo}))}function Vo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function pR(){return gill.combineCodec(ET(),Vo())}function Ho(e){return gill.decodeAccount(e,Vo())}async function Fo(e,n,r){let s=await DT(e,n,r);return gill.assertAccountExists(s),s}async function DT(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Ho(s)}async function mR(e,n,r){let s=await MT(e,n,r);return gill.assertAccountsExist(s),s}async function MT(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Ho(t))}function m({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function zo(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function U(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function T(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:gill.AccountRole.READONLY});let s=r.isWritable?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY;return Object.freeze({address:U(r.value),role:Go(r.value)?gill.upgradeRoleToSigner(s):s,...Go(r.value)?{signer:r.value}:{}})}}function Go(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var jo=new Uint8Array([8]);function vR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(jo)}function On(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:jo}))}function qo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function UR(){return gill.combineCodec(On(),qo())}async function Jo(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:On().encode(c),programAddress:r})}function WR(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:On().encode(c),programAddress:r})}function LR(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:qo().decode(e.data)}}var $o=new Uint8Array([9]);function HR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode($o)}function Nn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsIndex",gill.getU128Encoder()],["configActions",gill.getArrayEncoder(Ge())],["secp256r1VerifyArgs",gill.getArrayEncoder(J())],["compressedProofArgs",gill.getOptionEncoder(E())]]),e=>({...e,discriminator:$o}))}function ec(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsIndex",gill.getU128Decoder()],["configActions",gill.getArrayDecoder(ze())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["compressedProofArgs",gill.getOptionDecoder(D())]])}function FR(){return gill.combineCodec(Nn(),ec())}async function tc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.settings.value||(t.settings.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getU128Encoder().encode(zo(c.settingsIndex))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Nn().encode(c),programAddress:r})}function GR(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Nn().encode(c),programAddress:r})}function zR(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:ec().decode(e.data)}}var cc=new Uint8Array([19]);function XR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(cc)}function ac(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(Ge())],["secp256r1VerifyArgs",gill.getArrayEncoder(J())],["settingsMutArgs",G()],["compressedProofArgs",E()]]),e=>({...e,discriminator:cc}))}function ic(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(ze())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function QR(){return gill.combineCodec(ac(),ic())}function dc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ac().encode(c),programAddress:r})}function $R(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:ic().decode(e.data)}}var gc=new Uint8Array([18]);function cb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(gc)}function wn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",E()],["settingsCreation",Lt()],["userReadonlyArgs",he()],["settingsIndex",gill.getU128Encoder()]]),e=>({...e,discriminator:gc}))}function pc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",D()],["settingsCreation",kt()],["userReadonlyArgs",Re()],["settingsIndex",gill.getU128Decoder()]])}function ab(){return gill.combineCodec(wn(),pc())}async function mc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:wn().encode(c),programAddress:r})}function ib(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:wn().encode(c),programAddress:r})}function db(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:pc().decode(e.data)}}var Cc=new Uint8Array([0]);function yb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Cc)}function Hn(){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()))],["authorityCreationArgs",le()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Cc}))}function Ec(){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()))],["authorityCreationArgs",fe()],["compressedProofArgs",D()]])}function lb(){return gill.combineCodec(Hn(),Ec())}async function Dc(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Hn().encode(c),programAddress:r})}function fb(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Hn().encode(c),programAddress:r})}function Sb(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Ec().decode(e.data)}}var Pc=new Uint8Array([4]);function Pb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Pc)}function Gn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",E()],["member",En()],["role",Ke()],["userAccountCreationArgs",le()],["linkWalletArgs",gill.getOptionEncoder(pn())]]),e=>({...e,discriminator:Pc}))}function hc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",D()],["member",Wt()],["role",je()],["userAccountCreationArgs",fe()],["linkWalletArgs",gill.getOptionDecoder(mn())]])}function hb(){return gill.combineCodec(Gn(),hc())}async function Rc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:Gn().encode(c),programAddress:r})}function Rb(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:Gn().encode(c),programAddress:r})}function bb(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:hc().decode(e.data)}}var _c=new Uint8Array([3]);function kb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(_c)}function Kn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:_c}))}function vc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function Ob(){return gill.combineCodec(Kn(),vc())}async function Uc(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=T(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Kn().encode({}),programAddress:r})}function Bb(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=T(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Kn().encode({}),programAddress:r})}function Nb(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:vc().decode(e.data)}}var Lc=new Uint8Array([5]);function Kb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Lc)}function qn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",E()],["createUserArgs",gill.getArrayEncoder(An())]]),e=>({...e,discriminator:Lc}))}function kc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",D()],["createUserArgs",gill.getArrayDecoder(gn())]])}function jb(){return gill.combineCodec(qn(),kc())}async function Oc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:qn().encode(c),programAddress:r})}function qb(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:qn().encode(c),programAddress:r})}function Jb(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:kc().decode(e.data)}}var wc=new Uint8Array([17]);function t_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(wc)}function Vc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMutArgs",G()],["compressedProofArgs",E()],["secp256r1VerifyArgs",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:wc}))}function Hc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMutArgs",z()],["compressedProofArgs",D()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function r_(){return gill.combineCodec(Vc(),Hc())}function Fc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Vc().encode(c),programAddress:r})}function n_(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Hc().decode(e.data)}}var Kc=new Uint8Array([2]);function d_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Kc)}function jc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:Kc}))}function qc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function u_(){return gill.combineCodec(jc(),qc())}function Jc(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:jc().encode(c),programAddress:r})}function A_(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:qc().decode(e.data)}}var Qc=new Uint8Array([1]);function f_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Qc)}function Yn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["newOrigins",gill.getOptionEncoder(gill.getArrayEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())))],["newAuthorityArgs",gill.getOptionEncoder(ln())]]),e=>({...e,discriminator:Qc}))}function $c(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))],["newAuthorityArgs",gill.getOptionDecoder(fn())]])}function S_(){return gill.combineCodec(Yn(),$c())}async function x_(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Yn().encode(c),programAddress:r})}function ea(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Yn().encode(c),programAddress:r})}function I_(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:$c().decode(e.data)}}var na=new Uint8Array([6]);function R_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(na)}function sa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Je()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",E()]]),e=>({...e,discriminator:na}))}function oa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Ye()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",D()]])}function b_(){return gill.combineCodec(sa(),oa())}function ca(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.authority),...i],data:sa().encode(c),programAddress:r})}function __(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:oa().decode(e.data)}}var da=new Uint8Array([7]);function B_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(da)}function ua(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Je()],["secp256r1VerifyArgs",gill.getOptionEncoder(w())],["delegateTo",gill.getOptionEncoder(Ot())],["oldSettingsMutArgs",gill.getOptionEncoder(G())],["newSettingsMutArgs",gill.getOptionEncoder(G())],["compressedProofArgs",E()]]),e=>({...e,discriminator:da}))}function Aa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Ye()],["secp256r1VerifyArgs",gill.getOptionDecoder(V())],["delegateTo",gill.getOptionDecoder(Bt())],["oldSettingsMutArgs",gill.getOptionDecoder(z())],["newSettingsMutArgs",gill.getOptionDecoder(z())],["compressedProofArgs",D()]])}function N_(){return gill.combineCodec(ua(),Aa())}function ga(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...i],data:ua().encode(c),programAddress:r})}function w_(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:Aa().decode(e.data)}}var Ta=new Uint8Array([32]);function j_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ta)}function ya(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Mt()],["compressedProofArgs",E()],["settingsCreationArgs",Lt()]]),e=>({...e,discriminator:Ta}))}function la(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Pt()],["compressedProofArgs",D()],["settingsCreationArgs",kt()]])}function q_(){return gill.combineCodec(ya(),la())}function fa(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.authority),...i],data:ya().encode(c),programAddress:r})}function J_(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:la().decode(e.data)}}var Ia=new Uint8Array([31]);function tv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ia)}function Ca(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",qe()],["compressedProofArgs",E()],["userCreationArgs",le()]]),e=>({...e,discriminator:Ia}))}function Ea(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Z()],["compressedProofArgs",D()],["userCreationArgs",fe()]])}function rv(){return gill.combineCodec(Ca(),Ea())}function Da(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.authority),...i],data:Ca().encode(c),programAddress:r})}function nv(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Ea().decode(e.data)}}var Pa=new Uint8Array([29]);function uv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Pa)}function Zn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:Pa}))}function ha(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function Av(){return gill.combineCodec(Zn(),ha())}async function gv(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(U(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Zn().encode(c),programAddress:r})}function Ra(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Zn().encode(c),programAddress:r})}function pv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:ha().decode(e.data)}}var va=new Uint8Array([27]);function xv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(va)}function Ua(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(J())],["settingsMutArgs",G()],["compressedProofArgs",E()]]),e=>({...e,discriminator:va}))}function Wa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function Iv(){return gill.combineCodec(Ua(),Wa())}function La(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Ua().encode(c),programAddress:r})}function Cv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Wa().decode(e.data)}}var Na=new Uint8Array([30]);function bv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Na)}function Xn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccount",gill.getOptionEncoder(Vt())],["compressedProofArgs",gill.getOptionEncoder(E())],["secp256r1VerifyArgs",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:Na}))}function wa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccount",gill.getOptionDecoder(Ht())],["compressedProofArgs",gill.getOptionDecoder(D())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function _v(){return gill.combineCodec(Xn(),wa())}async function vv(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(U(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(U(t.source.value)),gill.getAddressEncoder().encode(U(t.tokenProgram.value)),gill.getAddressEncoder().encode(U(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(U(t.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(U(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(U(t.destination.value)),gill.getAddressEncoder().encode(U(t.tokenProgram.value)),gill.getAddressEncoder().encode(U(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(U(t.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(U(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.splInterfacePda.value||(t.splInterfacePda.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getBytesEncoder().encode(new Uint8Array([112,111,111,108])),gill.getAddressEncoder().encode(U(t.mint.value))]})),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Xn().encode(c),programAddress:r})}function Va(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Xn().encode(c),programAddress:r})}function Uv(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:wa().decode(e.data)}}var Fa=new Uint8Array([28]);function wv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Fa)}function Qn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccount",gill.getOptionEncoder(Vt())],["secp256r1VerifyArgs",gill.getArrayEncoder(J())],["settingsMutArgs",G()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Fa}))}function Ga(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccount",gill.getOptionDecoder(Ht())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function Vv(){return gill.combineCodec(Qn(),Ga())}async function Hv(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(U(t.source.value)),gill.getAddressEncoder().encode(U(t.tokenProgram.value)),gill.getAddressEncoder().encode(U(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(U(t.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(U(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(U(t.destination.value)),gill.getAddressEncoder().encode(U(t.tokenProgram.value)),gill.getAddressEncoder().encode(U(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(U(t.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(U(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.splInterfacePda.value||(t.splInterfacePda.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getBytesEncoder().encode(new Uint8Array([112,111,111,108])),gill.getAddressEncoder().encode(U(t.mint.value))]})),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Qn().encode(c),programAddress:r})}function za(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Qn().encode(c),programAddress:r})}function Fv(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:Ga().decode(e.data)}}var qa=new Uint8Array([13]);function Yv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(qa)}function Ja(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(w())]]),e=>({...e,discriminator:qa}))}function Ya(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(V())]])}function Zv(){return gill.combineCodec(Ja(),Ya())}function Za(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ja().encode(c),programAddress:r})}function Xv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ya().decode(e.data)}}var $a=new Uint8Array([23]);function sU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode($a)}function ei(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(w())],["settingsMutArgs",G()],["compressedProofArgs",E()]]),e=>({...e,discriminator:$a}))}function ti(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(V())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function oU(){return gill.combineCodec(ei(),ti())}function ri(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ei().encode(c),programAddress:r})}function cU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ti().decode(e.data)}}var oi=new Uint8Array([10]);function pU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(oi)}function ci(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Ft()],["secp256r1VerifyArgs",gill.getOptionEncoder(w())]]),e=>({...e,discriminator:oi}))}function ai(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Gt()],["secp256r1VerifyArgs",gill.getOptionDecoder(V())]])}function mU(){return gill.combineCodec(ci(),ai())}function ii(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:ci().encode(c),programAddress:r})}function TU(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:ai().decode(e.data)}}var Ai=new Uint8Array([20]);function CU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ai)}function gi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Ft()],["secp256r1VerifyArgs",gill.getOptionEncoder(w())],["settingsReadonlyArgs",Nt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ai}))}function pi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Gt()],["secp256r1VerifyArgs",gill.getOptionDecoder(V())],["settingsReadonlyArgs",wt()],["compressedProofArgs",D()]])}function EU(){return gill.combineCodec(gi(),pi())}function mi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:gi().encode(c),programAddress:r})}function DU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:pi().decode(e.data)}}var li=new Uint8Array([14]);function vU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(li)}function fi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(w())]]),e=>({...e,discriminator:li}))}function Si(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(V())]])}function UU(){return gill.combineCodec(fi(),Si())}function xi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:fi().encode(c),programAddress:r})}function WU(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Si().decode(e.data)}}var Ei=new Uint8Array([24]);function VU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ei)}function Di(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(w())],["settingsMutArgs",G()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ei}))}function Mi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(V())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function HU(){return gill.combineCodec(Di(),Mi())}function Pi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Di().encode(c),programAddress:r})}function FU(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Mi().decode(e.data)}}var bi=new Uint8Array([12]);function JU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(bi)}function _i(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:bi}))}function vi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function YU(){return gill.combineCodec(_i(),vi())}function Ui(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:_i().encode(c),programAddress:r})}function ZU(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:vi().decode(e.data)}}var ki=new Uint8Array([22]);function rW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ki)}function Oi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:ki}))}function Bi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function nW(){return gill.combineCodec(Oi(),Bi())}function Ni(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:Oi().encode(c),programAddress:r})}function sW(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:Bi().decode(e.data)}}var Hi=new Uint8Array([11]);function AW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Hi)}function Fi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(w())]]),e=>({...e,discriminator:Hi}))}function Gi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(V())]])}function gW(){return gill.combineCodec(Fi(),Gi())}function zi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Fi().encode(c),programAddress:r})}function pW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Gi().decode(e.data)}}var qi=new Uint8Array([21]);function xW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(qi)}function Ji(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(w())],["settingsReadonlyArgs",Nt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:qi}))}function Yi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(V())],["settingsReadonlyArgs",wt()],["compressedProofArgs",D()]])}function IW(){return gill.combineCodec(Ji(),Yi())}function Zi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ji().encode(c),programAddress:r})}function CW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Yi().decode(e.data)}}var $i=new Uint8Array([15]);function RW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode($i)}function ed(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:$i}))}function td(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function bW(){return gill.combineCodec(ed(),td())}function rd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=m({}),i=T(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:ed().encode({}),programAddress:r})}function _W(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:td().decode(e.data)}}var od=new Uint8Array([25]);function OW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(od)}function cd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:od}))}function ad(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function BW(){return gill.combineCodec(cd(),ad())}function id(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:cd().encode(c),programAddress:r})}function NW(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:ad().decode(e.data)}}var Ad=new Uint8Array([16]);function KW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ad)}function gd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",zt()],["secp256r1VerifyArgs",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:Ad}))}function pd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Kt()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function jW(){return gill.combineCodec(gd(),pd())}function md(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:gd().encode(c),programAddress:r})}function qW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:pd().decode(e.data)}}var ld=new Uint8Array([26]);function eL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ld)}function fd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",zt()],["secp256r1VerifyArgs",gill.getArrayEncoder(J())],["settingsMutArgs",G()],["compressedProofArgs",E()]]),e=>({...e,discriminator:ld}))}function Sd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Kt()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function tL(){return gill.combineCodec(fd(),Sd())}function xd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:fd().encode(c),programAddress:r})}function rL(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Sd().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",Kx=(c=>(c[c.DomainConfig=0]="DomainConfig",c[c.GlobalCounter=1]="GlobalCounter",c[c.Settings=2]="Settings",c[c.TransactionBuffer=3]="TransactionBuffer",c[c.WhitelistedAddressTree=4]="WhitelistedAddressTree",c))(Kx||{});function VL(e){let n="data"in e?e.data:e;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([201,232,212,229,59,241,106,197])),0))return 0;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([42,206,176,58,175,129,130,233])),0))return 1;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([223,179,163,190,177,224,67,173])),0))return 2;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([90,36,35,219,93,225,110,96])),0))return 3;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(new Uint8Array([105,23,173,2,197,255,80,87])),0))return 4;throw new Error("The provided account could not be identified as a multiWallet account.")}var jx=(y=>(y[y.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",y[y.ChangeConfig=1]="ChangeConfig",y[y.ChangeConfigCompressed=2]="ChangeConfigCompressed",y[y.CreateCompressedWallet=3]="CreateCompressedWallet",y[y.CreateDomainConfig=4]="CreateDomainConfig",y[y.CreateDomainUserAccount=5]="CreateDomainUserAccount",y[y.CreateGlobalCounter=6]="CreateGlobalCounter",y[y.CreateUserAccounts=7]="CreateUserAccounts",y[y.DecompressSettingsAccount=8]="DecompressSettingsAccount",y[y.DisableDomainConfig=9]="DisableDomainConfig",y[y.EditDomainConfig=10]="EditDomainConfig",y[y.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",y[y.EditUserDelegate=12]="EditUserDelegate",y[y.MigrateCompressedSettings=13]="MigrateCompressedSettings",y[y.MigrateCompressedUsers=14]="MigrateCompressedUsers",y[y.NativeTransferIntent=15]="NativeTransferIntent",y[y.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",y[y.TokenTransferIntent=17]="TokenTransferIntent",y[y.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",y[y.TransactionBufferClose=19]="TransactionBufferClose",y[y.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",y[y.TransactionBufferCreate=21]="TransactionBufferCreate",y[y.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",y[y.TransactionBufferExecute=23]="TransactionBufferExecute",y[y.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",y[y.TransactionBufferExtend=25]="TransactionBufferExtend",y[y.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",y[y.TransactionBufferVote=27]="TransactionBufferVote",y[y.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",y[y.TransactionExecute=29]="TransactionExecute",y[y.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",y[y.TransactionExecuteSync=31]="TransactionExecuteSync",y[y.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",y))(jx||{});function HL(e){let n="data"in e?e.data:e;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 1;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 2;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 3;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 4;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 5;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 6;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 7;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 8;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 9;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 10;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 11;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 12;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([32])),0))return 13;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([31])),0))return 14;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 15;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 16;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 17;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 18;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 19;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 20;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 21;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 22;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 23;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 24;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 25;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 26;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 27;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 28;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 29;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 30;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 31;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 32;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var Jx=6e3,Yx=6001,Zx=6002,Xx=6003,Qx=6004,$x=6005,eI=6006,tI=6007,rI=6008,nI=6009,sI=6010,oI=6011,cI=6012,aI=6013,iI=6014,dI=6015,uI=6016,AI=6017,gI=6018,pI=6019,mI=6020,TI=6021,yI=6022,lI=6023,fI=6024,SI=6025,xI=6026,II=6027,CI=6028,EI=6029,DI=6030,MI=6031,PI=6032,hI=6033,RI=6034,bI=6035,_I=6036,vI=6037,UI=6038,WI=6039,LI=6040,kI=6041,OI=6042,BI=6043,NI=6044,wI=6045,VI=6046,HI=6047,FI=6048,GI=6049,zI=6050,KI=6051,jI=6052,qI=6053,JI=6054,YI=6055,ZI=6056,XI=6057,QI=6058,$I=6059,eC=6060,tC=6061,rC=6062,nC=6063,sC=6064,oC=6065,cC=6066,aC=6067,iC=6068,dC=6069,uC=6070,AC=6071,gC=6072,pC=6073,mC=6074,TC=6075,yC=6076,lC=6077,fC=6078,SC=6079,xC=6080,IC=6081,CC=6082,Id;process.env.NODE_ENV!=="production"&&(Id={[DI]:"This member is already delegated to another wallet.",[tI]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[mC]:"Clock sysvar access failed. This may indicate a system error.",[zI]:"The domain configuration account is disabled. Please contact support or try again later.",[KI]:"Missing domain configuration account.",[gC]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[CC]:"Duplicate address tree detected. This address tree is already in the whitelist.",[sI]:"Duplicate public keys detected among members. Each member must have a unique key.",[nI]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[mI]:"No members provided. A multisig wallet must contain at least one member.",[XI]:"Slot numbers list is empty. At least one slot number is required for validation.",[gI]:"Expected a User with Administrator role for this instruction.",[rI]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[uI]:"Expected a User with Transaction Manager role for this instruction.",[WI]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[LI]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[kI]:"Declared buffer size does not match the actual serialized size.",[ZI]:"Failed to compute hash. This may indicate a system error.",[hI]:"Not enough members with vote permission to meet the approval threshold.",[MI]:"At least one signer with execute permission is required to proceed.",[PI]:"At least one signer with initiate permission is required to perform this action.",[SI]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[AC]:"Invalid account index in transaction message. The account index is out of bounds.",[JI]:"Address Tree supplied is not part of the whitelisted address trees.",[pI]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[II]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[UI]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[QI]:"Member key conversion failed. The provided key format is invalid.",[RI]:"Only delegated members are allowed for this transaction.",[fI]:"Unexpected number of accounts provided for this instruction.",[aI]:"User with Permanent Member role must have a delegated wallet.",[Yx]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[Qx]:"The extracted public key has an invalid length or encoding.",[Jx]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[Xx]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[GI]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[HI]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[yI]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[iC]:"Invalid source type for token transfer. The source account type is not supported.",[AI]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[dI]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[lI]:"Malformed transaction message: structure or formatting does not match the expected layout.",[xI]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[yC]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[aC]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[$x]:"The extracted WebAuthn signed message payload is malformed.",[wI]:"An input string exceeds the maximum allowed character length.",[jI]:"This member is not registered under the provided domain configuration.",[tC]:"Member not found in settings. Cannot remove a member that does not exist.",[uC]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[CI]:"A required account is missing from the instruction context.",[$I]:"Compressed proof arguments are missing. Required for compressed account operations.",[sC]:"Missing compressed token account. Required for token transfer operations.",[lC]:"Missing destination token account. Required for token transfer operations.",[cC]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[eC]:"Light CPI accounts are missing. Required for compressed account operations.",[EI]:"User mutation arguments are required when performing add or remove delegate operations.",[xC]:"Missing new authority account. Required for domain configuration updates.",[SC]:"Missing settings account. Required for delegate operations on compressed wallets.",[YI]:"Compressed settings data is missing. The settings account must be initialized with data.",[fC]:"Missing source token account. Required for token transfer operations.",[oC]:"Missing SPL interface PDA. Required for token transfer operations.",[VI]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[pC]:"User account address is missing. Required for secp256r1 signature verification.",[IC]:"Missing whitelisted address trees account. Required for domain configuration updates.",[_I]:"No valid signer found in this transaction.",[cI]:"Only one permanent member is allowed per wallet.",[iI]:"Only one transaction manager is allowed per wallet.",[qI]:"The given origin index is not in the whitelisted origins.",[nC]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[oI]:"Permanent members cannot be removed from a wallet.",[NI]:"Writable CPI calls to protected accounts are not permitted.",[eI]:"The rpIdHash extracted from the signed message does not match the expected value.",[rC]:"Settings key mismatch. The provided settings key does not match the expected value.",[Zx]:"The signature index provided is out of bounds for the secp256r1 instruction.",[FI]:"The specified slot number was not found in the provided slot history.",[dC]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[TI]:"Too many members: a maximum of 4 members are supported.",[OI]:"This transaction has expired. It must be executed within 3 minutes of approval.",[BI]:"This transaction has not yet reached the required approval threshold.",[vI]:"Only the transaction creator or rent payer may close this transaction buffer.",[TC]:"Unauthorized: Only the admin account is allowed to perform this action.",[bI]:"Member is not part of the expected signers for this transaction."});function qL(e){return process.env.NODE_ENV!=="production"?Id[e]:"Error message not available in production bundles."}function JL(e,n,r){return gill.isProgramError(e,n,A,r)}async function ok({admin:e,addressTree:n}){return Jo({payer:e,addressTree:n,remainingAccounts:[]})}var Yt={Ed25519:1,Secp256r1:2};var Cd=S__default.default.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),Ak=S__default.default.object({transactionActionType:Cd,transactionAddress:S__default.default.string(),transactionMessageBytes:S__default.default.array(S__default.default.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),Ed=S__default.default.object({transactionActionType:Cd,transactionAddress:S__default.default.string(),transactionMessageBytes:S__default.default.string()}).strict(),Dd=S__default.default.object({authResponse:S__default.default.custom(),nonce:S__default.default.string(),clientSignature:S__default.default.object({clientOrigin:S__default.default.string(),signature:S__default.default.string()}).strict(),deviceSignature:S__default.default.object({publicKey:S__default.default.string(),signature:S__default.default.string()}).strict(),authProviderSignature:S__default.default.object({publicKey:S__default.default.string(),signature:S__default.default.string()}).strict().optional()}).strict(),Md=S__default.default.object({signer:S__default.default.string(),userAddressTreeIndex:S__default.default.number().optional(),additionalInfo:S__default.default.looseObject({})}).strict(),EC=S__default.default.object({transactionPayload:Ed,slotHash:S__default.default.string(),slotNumber:S__default.default.string(),originIndex:S__default.default.number(),crossOrigin:S__default.default.boolean()}).strict(),gk=S__default.default.object({phase:S__default.default.literal("start"),redirectOrigin:S__default.default.url(),signer:S__default.default.string().optional(),data:S__default.default.object({type:S__default.default.literal("message"),payload:S__default.default.string().optional()}).strict()}).strict(),pk=S__default.default.object({phase:S__default.default.literal("start"),redirectOrigin:S__default.default.url(),signer:S__default.default.string().optional(),data:S__default.default.object({type:S__default.default.literal("transaction"),payload:Ed}).strict()}).strict(),mk=S__default.default.object({phase:S__default.default.literal("complete"),data:S__default.default.object({type:S__default.default.literal("message"),payload:Md.extend(Dd.shape).extend({id:S__default.default.string().optional(),message:S__default.default.string(),clientSignature:S__default.default.object({clientOrigin:S__default.default.string()}).strict()})}).strict()}).strict(),Tk=S__default.default.object({phase:S__default.default.literal("complete"),data:S__default.default.object({type:S__default.default.literal("transaction"),payload:Md.extend(Dd.shape).extend(EC.shape).extend({clientSignature:S__default.default.object({clientOrigin:S__default.default.string()}).strict()})}).strict()}).strict();var be={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Le=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(be).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var ts=33,ke=class{_bn;constructor(n){typeof n=="string"?this._bn=new Uint8Array(gill.getBase58Encoder().encode(n)):this._bn=new Uint8Array(n),this.validateKeyLength(this._bn);}validateKeyLength(n){if(n.length!==ts)throw new Error(`Invalid public key length, expected ${ts} bytes but got ${n.length}`)}toBase58(){return gill.getBase58Decoder().decode(this.toBytes())}toTruncatedBuffer(){let n=this.toBuffer();return n.subarray(1,n.length)}toBuffer(){if(!this._bn)throw new Error("Invalid public key input");let n=this._bn;if(n.byteLength===ts)return n;throw new Error("Invalid public key input")}toBytes(){let n=this.toBuffer();return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}toString(){return this.toBase58()}toJSON(){return this.toBase58()}},M=class extends ke{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;clientAndDeviceHash;authResponse;constructor(n,r){super(n),this.verifyArgs=r.verifyArgs,this.domainConfig=r.domainConfig,this.authData=r.authData,this.signature=r.signature,this.originIndex=r.originIndex,this.crossOrigin=r.crossOrigin,this.clientAndDeviceHash=r.clientAndDeviceHash,this.authResponse=r.authResponse;}};function PC(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function hC(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var hd=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(PC())],["addressTableLookups",gill.getArrayCodec(hC())]]);function Rd(e){return hd.encode({numSigners:e.header.numSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,accountKeys:e.staticAccounts,instructions:e.instructions.map(r=>({programAddressIndex:r.programAddressIndex,accountIndices:r.accountIndices??[],data:Array.from(r.data??[])})),addressTableLookups:e.version!=="legacy"?e.addressTableLookups?.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes,writableIndexes:r.writableIndexes}))??[]:[]})}function bd(e){let n=hd.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}function _d(e,n,r,s){if(e<n||e>r)throw new F(`${s} must be between ${n} and ${r} (inclusive), got ${e}`)}function vd(e,n){if(e<0)throw new F(`${n} must be non-negative, got ${e}`)}function Zt(e,n){if(e.length===0)throw new F(`${n} cannot be empty`)}function Ud(e,n){if(e.trim().length===0)throw new F(`${n} cannot be empty`)}stateless_js.featureFlags.version=stateless_js.VERSION.V2;var Q={};function Wd(){if(!Q.solanaRpcEndpoint)throw new We("RPC endpoint");return Q.solanaRpcEndpoint}function ot(){if(!Q.lightProtocolRpc)throw new We("Light Protocol RPC");return Q.lightProtocolRpc}function ne(){if(!Q.solanaRpc)throw new We("Solana RPC");return Q.solanaRpc}function Ld(){if(!Q.sendAndConfirm)throw new We("Send and confirm transaction function");return Q.sendAndConfirm}function kd(){if(!Q.computeEstimate)throw new We("Compute budget estimate function");return Q.computeEstimate}function ns(){return Q.jitoTipsConfig?Q.jitoTipsConfig:{blockEngineUrl:hs,getJitoTipsUrl:Rs,priority:bs}}function Hk({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){Q.solanaRpcEndpoint=e,Q.lightProtocolRpc=stateless_js.createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=gill.createSolanaClient({urlOrMoniker:e});Q.solanaRpc=t,Q.sendAndConfirm=c,Q.computeEstimate=programs.estimateComputeUnitLimitFactory({rpc:t}),Q.jitoTipsConfig=s??null;}function Od(e){return typeof e=="string"?e:e.toString()}function Bd(e,n){return e.toString()+(n?n.toString():"")}function Nd(e){return e.toString()}async function _r(e,n,r){let s=e?.get(n);if(s)return s;let t=await r();return t&&e&&e.set(n,t),t}var WC={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true};function LC(e,n,r=2,s=3e4){let t=n*Math.pow(r,e-1);return Math.min(t,s)}function kC(e){return new Promise(n=>setTimeout(n,e))}async function Xt(e,n){let{maxRetries:r,initialDelayMs:s,backoffBase:t=2,maxDelayMs:c=3e4,shouldRetry:a}={...WC,...n},i;for(let o=1;o<=r;o++)try{return await e()}catch(d){if(i=d,a&&!a(d,o))throw d;if(o>=r)break;let u=LC(o,s,t,c);await kC(u);}throw new ir(e.name||"retryWithBackoff",r,i)}async function ct(e,n){let r=(s,t)=>s instanceof Response?s.status===429?n.retryOnRateLimit??true:s.status>=400&&s.status<500?false:s.status>=500:s instanceof TypeError||s instanceof Error;return Xt(e,{...n,shouldRetry:n.shouldRetry??r})}var W=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?gill.AccountRole.WRITABLE_SIGNER:gill.AccountRole.READONLY_SIGNER:r?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...stateless_js.getLightSystemAccountMetasV2({selfProgram:new web3_js.PublicKey(A.toString())}).map(n=>({address:gill.address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,gill.AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:gill.address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===stateless_js.TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===stateless_js.TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await ot().getStateTreeInfos(),r=stateless_js.selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:a,queuePubkeyIndex:i,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:a,addressQueuePubkeyIndex:i});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function vr(e,n){let r=Od(e);return _r(n,r,()=>ot().getCompressedAccount(e))}async function Hd(e,n,r){let s=Bd(e,n?.mint);return _r(r,s,()=>ot().getCompressedTokenAccountsByOwner(e,n))}async function $t(e,n){let r=Nd(e);return _r(n,r,()=>ne().getAccountInfo(e,{encoding:"base64"}).send())}async function ge(e,n){let s=(await Promise.all(e.map(async t=>vr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new ee("Compressed account",`Expected ${e.length} accounts but found ${s.length}`);return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function v(e,n){return {proof:e?.compressedProof?gill.some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function de(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:s[u],address:d.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:a[u],outputStateTreeIndex:i,address:d.address,type:d.type}))}function ce(e,n,r,s,t,c,a){let i=[];for(let u=0;u<n.length;u++)i.push({treeInfo:n[u],rootIndex:s[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new F("Unable to parse state tree data");return c.map((u,g)=>({data:a.decode(u.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Ee(e,n,r,s,t){let c=null,a=null,i=null,o=new W;if(e){await o.addSystemAccounts();let{address:d}=await se(n,r),u=(await ge([{address:d,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:i=await B([u],[]);let g=o.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!g)throw new F("Unable to parse state tree data");c={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0]},data:q().decode(u.data?.data)},a={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:q().decode(u.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:o,settingsMutArgs:a}}async function B(e,n,r=3,s=500){return Xt(()=>ot().getValidityProofV0(e,n),{maxRetries:r,initialDelayMs:s})}async function De(){return (await Ur()).length-1}var ss;async function Ur(){if(!ss){let{data:e}=await Fo(ne(),await Fd());ss=e.whitelistedAddressTrees;}return ss}async function Wr(e,n,r){let s=await VC(e,n,r);if(!s)throw new ee("User account");return s}async function VC(e,n,r){let{address:s}=await O(e,n),t=await vr(s,r);return t?.data?.data?Z().decode(t.data.data):null}async function os(e,n,r){let s=await HC(e,n,r);if(!s)throw new ee("Settings account");return s}async function HC(e,n,r){try{let{address:s}=await se(e,n),t=await vr(s,r);if(!t?.data?.data)throw new ee("Compressed settings account");let c=q().decode(t.data.data);if(c.data.__option==="None")throw new ee("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let s=await Rn(ne(),await ae(e));return s.exists?{...s.data,isCompressed:false}:null}}async function cs(e){vd(e,"index");let n=await Ur();if(e>=n.length)throw new F(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function fO(e){let r=(await Ur()).findIndex(s=>s.toString()===e);if(r===-1)throw new ee("Address tree",`Address ${e} not found in whitelist`);return r}async function se(e,n=0){let r=await cs(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("multi_wallet")),new Uint8Array(gill.getU128Encoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function O(e,n=0){let r=await cs(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("user")),e instanceof ke?e.toTruncatedBuffer():new Uint8Array(gill.getAddressEncoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function it({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha2_js.sha256(new Uint8Array(gill.getUtf8Encoder().encode(n)));else throw new F("Either rpId or rpIdHash must be provided");let[r]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("domain_config"),e]});return r}async function qd(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function Fd(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function Jd(e,n,r){_d(r,0,255,"buffer_index");let[s]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),n instanceof ke?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return s}async function _e(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return n}async function ae(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function _O(e){let n=await ae(e);return await _e(n)}async function vO(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}async function er(e,n){if(!e.ok){await e.text().catch(()=>e.statusText);throw new Ce(`Request failed: ${e.statusText} (${e.status})`,e.status,n)}return e}async function tr(e){try{return await e.json()}catch(n){throw new Ce(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function GO(e){let n=tinyCbor.decodeCBOR(e),r=nist_js.p256.Point.fromAffine({x:BigInt("0x"+kr(n.get(-2))),y:BigInt("0x"+kr(n.get(-3)))});return gill.getBase58Decoder().decode(r.toBytes(true))}function zO(e){let r=nist_js.p256.Point.fromBytes(new Uint8Array(gill.getBase58Encoder().encode(e))).toBytes(false),s=new Map;return s.set(1,2),s.set(3,-7),s.set(-1,1),s.set(-2,r.slice(1,33)),s.set(-3,r.slice(33,65)),new Uint8Array(tinyCbor.encodeCBOR(s))}async function KO(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Be(n)),c=JSON.parse(new TextDecoder().decode(Be(r))),a=Xd(c),i=$d(new Uint8Array(Be(s))),o=await it({rpIdHash:t.subarray(0,32)});return new M(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Be(r)),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(gill.getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:as(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function as(e,n,r){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...gill.getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function JO(e){return sha2_js.sha256(new Uint8Array(gill.getUtf8Encoder().encode(JSON.stringify(e))))}function YO(e){return is(e.data.payload.authResponse)}function ZO(e,n,r,s){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...as(n,r,s)]))}async function XO(e,n,r,s,t,c){let a;if(!t||!c){let o=(await ne().getAccountInfo(gill.address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!o)throw new ee("Slot sysvar","Unable to fetch slot sysvar data");let d=gill.getBase64Encoder().encode(o[0]);c=gill.getU64Decoder().decode(d.subarray(0,8)).toString(),a=d.subarray(8,40),t=gill.getBase58Decoder().decode(a);}else a=new Uint8Array(gill.getBase58Encoder().encode(t));let i=sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e.transactionActionType),...gill.getBase58Encoder().encode(e.transactionAddress),...sha2_js.sha256(typeof e.transactionMessageBytes=="string"?new Uint8Array(Be(e.transactionMessageBytes)):e.transactionMessageBytes),...a,...as(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:i}}function is(e){return sha2_js.sha256(Br(e))}function QO(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Be(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),a=new Uint8Array(c);for(let i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return c}async function $O(e,n){let{data:r}=await Bs(ne(),e),t=Qd(new Uint8Array(r.origins),r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Error("Origin not found in domain config");return t}function kr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function ZC(e){let n=new Uint8Array(e.length/2);for(let r=0;r<n.length;r++)n[r]=parseInt(e.slice(r*2,r*2+2),16);return n}function Xd(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let s=JSON.stringify(r);return new TextEncoder().encode(s.slice(1,-1))}function Qd(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let a=e[s]|e[s+1]<<8;if(s+=2,s+a>e.length)throw new Error("MaxLengthExceeded");let i=e.slice(s,s+a),o=t.decode(i);r.push(o),s+=a;}return r}function $d(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let C=n&127;r+=C;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let a=e[r+1],i=r+2,o=e.slice(i,i+a),d=c[0]===0&&c.length>32?c.slice(1):c,u=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let p=nist_js.p256.Point.CURVE().n>>1n,l=BigInt("0x"+kr(u)),_=(l>p?nist_js.p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),I=ZC(_);return new Uint8Array([...g,...I])}function Br(e){return new Uint8Array([...new Uint8Array(Be(e.response.authenticatorData)),...sha2_js.sha256(new Uint8Array(Be(e.response.clientDataJSON)))])}async function ds(e,n=false){let r=n?{blockhash:gill.getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await ne().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(s.instructions,c),c=>gill.setTransactionMessageFeePayerSigner(s.payer,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?gill.compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let a=Math.ceil((s.unitsConsumed??0)*1.1);return a>2e5?gill.prependTransactionMessageInstructions([programs.getSetComputeUnitLimitInstruction({units:a})],c):c},async c=>n?gill.compileTransaction(await c):await gill.signTransactionMessageWithSigners(await c))))}async function nu(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===gill.AccountRole.WRITABLE||c.role===gill.AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,a)=>c-a);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function su(e,n){Zt(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new F(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await ct(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})}),{maxRetries:3,initialDelayMs:500});await er(r,n);let s=await tr(r);if(!s.result||s.error)throw new Ae(`Unable to simulate bundle: ${JSON.stringify(s.error??s.result)}`);if(typeof s.result.value.summary!="string"&&s.result.value.summary.failed){let{TransactionFailure:t}=s.result.value.summary.failed.error,[,c]=t;throw new Ae(`Simulation failed: ${c}`)}return s.result.value.transactionResults.map(t=>t.unitsConsumed)}function K(e,n=0){let r=e instanceof M?e:void 0,s=r?.verifyArgs&&n!==-1?gill.some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):gill.none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,a=r?.authData&&r.verifyArgs.clientDataJson?Br(r.authResponse):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function ut(e){if(e instanceof ke)return {keyType:Yt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Yt.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function ru(e){return e instanceof M?e.toString():e.address.toString()}function ye(e){let n=new Set,r=[];for(let t of e)n.has(ru(t))||(r.push(t),n.add(ru(t)));let s=r.filter(t=>t instanceof M);if(s.length>1)throw new F(`More than 1 Secp256r1 signers in an instruction is not supported (found ${s.length})`);return r}function ou({payer:e,tipAmount:n}){let r=jr[Math.floor(Math.random()*jr.length)];return programs.getTransferSolInstruction({source:e,destination:gill.address(r),amount:n})}async function MB(e){Zt(e,"bundle");let n=await ds(e,true),r=await su(n.map(gill.getBase64EncodedWireTransaction),Wd()),s=await ds(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await pE(s.map(gill.getBase64EncodedWireTransaction))}async function pE(e,n=3,r=500,s=ns()){Zt(e,"serializedTransactions");let{blockEngineUrl:t}=s,c=`${t}/bundles`,a=await ct(()=>fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})}),{maxRetries:n,initialDelayMs:r});await er(a,c);let i=await tr(a);if(i.error)throw new Ae(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new Ae("No bundle ID returned from Jito");return i.result}async function PB(e,n=30,r=3e3,s=ns()){Ud(e,"bundleId");let{blockEngineUrl:t}=s,c=`${t}/getBundleStatuses`;return Xt(async()=>{let a=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await er(a,c);let i=await tr(a);if(i.error)throw new Ae(`Error getting bundle status: ${JSON.stringify(i.error,null,2)}`,e);if(!i.result?.value?.length)throw new Ae("Bundle not yet confirmed",e);let o=i.result.value[0];if(o.confirmation_status==="confirmed"||o.confirmation_status==="finalized"){let d=o.transactions[o.transactions.length-1];if(!d)throw new Ae("No transactions in confirmed bundle",e);return d}throw new Ae(`Bundle status: ${o.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:a=>a instanceof Ae||a instanceof Ce})}async function WB({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await ne().getLatestBlockhash().send(),t=await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(e,c),c=>gill.setTransactionMessageFeePayerSigner(n,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?gill.compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([kd()(c),nu(ne(),c.instructions.flatMap(d=>d.accounts??[]))]),o=Math.ceil(a*1.1);return gill.prependTransactionMessageInstructions([...o>2e5?[programs.getSetComputeUnitLimitInstruction({units:o})]:[],...i>0?[programs.getSetComputeUnitPriceInstruction({microLamports:i})]:[]],c)},async c=>await gill.signTransactionMessageWithSigners(await c));return await Ld()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}function YB(e,n){if(n.threshold>1)throw new F("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(o=>iu(o.pubkey)===e);if(!r)throw new ee("Member",`Signer ${e} not found in settings`);let{permissions:s}=r;if(!s)throw new ee("Permissions","No permissions found for the current member");let t=Le.has(s,be.InitiateTransaction),c=Le.has(s,be.VoteTransaction),a=Le.has(s,be.ExecuteTransaction);if(t&&c&&a)return {};if(!c||!a)throw new dr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,a?"ExecuteTransaction":void 0].filter(Boolean));let i=n.members.find(o=>o.role===2);if(!i)throw new ee("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:gill.address(iu(i.pubkey)),userAddressTreeIndex:i.userAddressTreeIndex}}async function ZB({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await Wr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new ee("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return vE(n,c.transactionManagerUrl.value,e,s)}function vE(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(gill.getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=gill.getBase64Decoder().decode(s)),r&&(c.authResponses=r);let a=await ct(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)}),{maxRetries:3,initialDelayMs:500});if(!a.ok)throw new Ce(`Transaction manager request failed: ${a.statusText}`,a.status,n);let i=await a.json();if("error"in i)throw new Ce(`Transaction manager error: ${i.error}`,a.status,n);return i.signatures.map(o=>({[e]:gill.getBase58Encoder().encode(o)}))}}}function iu(e){return e.keyType===Yt.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}function XB(e){let n=e.map(c=>Ge().encode(c)),r=4+n.reduce((c,a)=>c+a.length,0),s=new Uint8Array(r),t=0;s.set(gill.getU32Encoder().encode(e.length),t),t+=4;for(let c of n)s.set(c,t),t+=c.length;return s}function QB(e){let n=0,[r,s]=gill.getU32Decoder().read(e,n);n=s;let t=new Array(r);for(let c=0;c<r;c++){let a=ze().read(e,n);t[c]=a[0],n=a[1];}if(n!==e.length)throw new F(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function mN({payer:e,rpId:n,origins:r,authority:s}){let t=await it({rpId:n}),c=new W;await c.addSystemAccounts();let a=await De(),{address:i,addressTree:o}=await O(s.address,a),d=[{address:i,tree:o,queue:o,type:"User"}],u=await B([],d),g=(await de(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),f=v(u,l);return await Dc({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:f,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function DN({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new W;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await se(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await O(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await ge(a,t):[],o=await De(),{address:d,addressTree:u}=await O(r.member,o),g=[{address:d,type:"User",tree:u,queue:u}],p=await B(i,g),l=null,f=null,_=i.filter(L=>L.type==="Settings"),I=i.filter(L=>L.type==="User");_.length&&(l=ce(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),_,q())[0]),I.length&&(f=ce(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),I,Z())[0]);let C=await de(c,p.treeInfos.slice(i.length),p.roots.slice(i.length),p.rootIndices.slice(i.length),g),{remainingAccounts:P,systemOffset:x}=c.toAccountMetas(),k=v(p,x);return await Rc({payer:n,authority:e,compressedProofArgs:k,member:Wt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:l?gill.some({settingsMutArgs:l,transactionManager:f?gill.some(f):gill.none()}):gill.none(),userAccountCreationArgs:C[0],domainConfig:s,remainingAccounts:P})}async function RN({payer:e}){let n=await qd();return Uc({payer:e,globalCounter:n})}async function UN({admin:e,rpId:n,disable:r}){let s=await it({rpId:n});return Jc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function wN({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new W;await t.addSystemAccounts();let{address:c,addressTree:a}=await se(r,s),i=[{address:c,tree:a,queue:a,type:"Settings"}],o=await B([],i),d=(await de(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return fa({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function jN({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new W;await t.addSystemAccounts();let{address:c,addressTree:a}=await O(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await B([],i),d=(await de(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Da({compressedProofArgs:p,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}function WE(e,n,r,s){let t=LE(e,n),c=kE(e,n)&&r!==s;return t&&c?gill.AccountRole.WRITABLE_SIGNER:t&&!c?gill.AccountRole.WRITABLE:!t&&c?gill.AccountRole.READONLY_SIGNER:gill.AccountRole.READONLY}function LE(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,a=s-t,i=r-s-c;return n>=r?false:n<a?true:n>=s?n-s<i:false}function kE(e,n){return n<e.header.numSignerAccounts}async function Nr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=bd(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await gill.fetchAddressesForLookupTables(t.addressTableLookups.map(i=>i.lookupTableAddress),ne()):{}),a=[];a.push(...t.addressTableLookups?.map(i=>({role:gill.AccountRole.READONLY,address:i.lookupTableAddress}))??[]);for(let[i,o]of t.staticAccounts.entries())a.push({address:o,role:WE(t,i,o,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let o=c[i.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let d of i.writableIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:u,role:gill.AccountRole.WRITABLE});}for(let d of i.readonlyIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:u,role:gill.AccountRole.READONLY});}}for(let i of s?.filter(o=>o.address!==e)??[]){let o=a.findIndex(d=>d.address===i.address);o===-1?a.push({address:i.address,role:gill.AccountRole.READONLY_SIGNER,signer:i}):a[o].role===gill.AccountRole.READONLY||a[o].role===gill.AccountRole.READONLY_SIGNER?a[o]={address:i.address,role:gill.AccountRole.READONLY_SIGNER,signer:i}:(a[o].role===gill.AccountRole.WRITABLE||a[o].role===gill.AccountRole.WRITABLE_SIGNER)&&(a[o]={address:i.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:i});}return {accountMetas:a,addressLookupTableAccounts:c,transactionMessage:t}}var At=33,gt=64,ps=14,FE=2,GE=gill.address("Secp256r1SigVerify1111111111111111111111111");function zE(){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 KE(){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 mu(){return gill.createDecoder({read:(e,n=0)=>{let r=gill.getU8Decoder().decode(e,n);n+=1;let s=gill.getU8Decoder().decode(e,n);n+=1;let t=[],c=KE();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=ps;let a=[];for(let i=0;i<r;i++){let o=gill.fixDecoderSize(gill.getBytesDecoder(),At).decode(e,n);n+=At;let d=gill.fixDecoderSize(gill.getBytesDecoder(),gt).decode(e,n);n+=gt;let u=t[i].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),u).decode(e,n);n+=u,a.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function Tu(){return gill.createEncoder({getSizeFromValue:e=>{let n=ps*e.offsets.length,r=e.payload.reduce((s,t)=>s+At+gt+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=gill.getU8Encoder().write(e.numSignatures,n,r),r=gill.getU8Encoder().write(e.padding,n,r);let s=zE();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=gill.fixEncoderSize(gill.getBytesEncoder(),At).write(t.publicKey,n,r),r=gill.fixEncoderSize(gill.getBytesEncoder(),gt).write(t.signature,n,r),r=gill.getBytesEncoder().write(t.message,n,r);return r}})}function aw(){return gill.combineCodec(Tu(),mu())}function N(e,n){let r=e.length,s=FE+r*ps,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,g=u+At,p=g+gt;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),s+=At+gt+d.length;}let c=n?.programAddress??GE,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:Tu().encode(a)}}function iw(e){return {programAddress:e.programAddress,accounts:{},data:mu().decode(e.data)}}async function yu({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let d=await _e(e),{accountMetas:u,addressLookupTableAccounts:g}=await Nr({transactionMessageBytes:r,walletAddress:d,additionalSigners:a,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(N(c)),p.push(o?id({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):rd({transactionBuffer:n,payer:s.address,settings:e})),i&&p.push(ou({payer:s,tipAmount:i})),{instructions:p,addressLookupTableAccounts:g}}async function lu({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:d}){let u=ye(s),g=await ae(e),p=await _e(g),[{accountMetas:l,addressLookupTableAccounts:f,transactionMessage:_},{settingsMutArgs:I,proof:C,packedAccounts:P}]=await Promise.all([Nr({transactionMessageBytes:r,walletAddress:p,additionalSigners:u.filter(X=>!(X instanceof M)),addressesByLookupTableAddress:c}),Ee(i,e,n,o,d)]);P.addPreAccounts(l);let x=u.filter(X=>X instanceof M),{secp256r1VerifyArgs:k}=qE(x,a,P),{remainingAccounts:L,systemOffset:j}=P.toAccountMetas();return {instructions:JE({secp256r1VerifyInput:a,transactionMessage:_,accountMetas:l,compressed:i,payer:t,settingsMutArgs:I,proof:C,systemOffset:j,secp256r1VerifyArgs:k,settings:g,remainingAccounts:L}),addressLookupTableAccounts:f}}function qE(e,n,r){let s=[];for(let t of e){let c=n.length,{domainConfig:a,verifyArgs:i,signature:o,publicKey:d,message:u}=K(t,c);u&&o&&d&&n.push({message:u,signature:o,publicKey:d}),a&&(r.addPreAccounts([{address:a,role:gill.AccountRole.READONLY}]),i.__option==="Some"&&s.push({domainConfigKey:a,verifyArgs:i.value}));}return {secp256r1VerifyArgs:s}}function JE({secp256r1VerifyInput:e,transactionMessage:n,accountMetas:r,compressed:s,payer:t,settingsMutArgs:c,proof:a,systemOffset:i,secp256r1VerifyArgs:o,settings:d,remainingAccounts:u}){let g=[];e.length>0&&g.push(N(e));let p=YE(n,r);if(s){if(!t||!c)throw new Error("Payer not found or proof args is missing.");let l=v(a,i);g.push(xd({secp256r1VerifyArgs:o,transactionMessage:p,settingsMutArgs:c,compressedProofArgs:l,payer:t,remainingAccounts:u}));}else g.push(md({secp256r1VerifyArgs:o,settings:d,transactionMessage:p,remainingAccounts:u}));return g}function YE(e,n){if(e.version==="legacy")throw new Error("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:new Uint8Array(r.data??[])})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(s=>s.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function Uw({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=ye(s),d=await ae(e),u=await _e(d),{packedAccounts:g,proof:p,settingsMutArgs:l}=await Ee(i,e,n,false,t),f=[],_=[];for(let x of o)if(x instanceof M){let k=f.length,{domainConfig:L,verifyArgs:j,signature:$,publicKey:X,message:Me}=K(x,k);Me&&$&&X&&f.push({message:Me,signature:$,publicKey:X}),L&&(g.addPreAccounts([{address:L,role:gill.AccountRole.READONLY}]),j.__option==="Some"&&_.push({domainConfigKey:L,verifyArgs:j.value}));}else g.addPreAccounts([{address:x.address,role:gill.AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:I,systemOffset:C}=g.toAccountMetas(),P=[];if(f.length>0&&P.push(N(f)),i){if(!a||!l)throw new Error("Payer not found or proof args is missing.");let x=v(p,C);P.push(La({amount:c,settingsMutArgs:l,compressedProofArgs:x,payer:a,secp256r1VerifyArgs:_,source:u,destination:r,remainingAccounts:I}));}else P.push(Ra({amount:c,secp256r1VerifyArgs:_,source:u,destination:r,settings:d,remainingAccounts:I}));return P}var Cu=gill.address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),Eu=gill.address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti");async function Kw({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,compressed:d=false}){let u=ye(t),g=await ae(e),p=await _e(g),[l,[f],_,[I],[C]]=await Promise.all([programs.getAssociatedTokenAccountAddress(s,p,o),gill.getProgramDerivedAddress({seeds:[gill.getAddressEncoder().encode(p),gill.getAddressEncoder().encode(gill.address(stateless_js.CTOKEN_PROGRAM_ID.toString())),gill.getAddressEncoder().encode(s)],programAddress:gill.address(stateless_js.CTOKEN_PROGRAM_ID.toString())}),programs.getAssociatedTokenAccountAddress(s,r,o),gill.getProgramDerivedAddress({seeds:[gill.getAddressEncoder().encode(r),gill.getAddressEncoder().encode(gill.address(stateless_js.CTOKEN_PROGRAM_ID.toString())),gill.getAddressEncoder().encode(s)],programAddress:gill.address(stateless_js.CTOKEN_PROGRAM_ID.toString())}),gill.getProgramDerivedAddress({seeds:[gill.getUtf8Encoder().encode("pool"),gill.getAddressEncoder().encode(s)],programAddress:gill.address(stateless_js.CTOKEN_PROGRAM_ID.toString())})]),[P,x,k]=await Promise.all([$t(_,c),$t(l,c),nD(d,e,n,c)]),L=!!P.value,j=!!x.value,$=j?programs.getTokenDecoder().decode(gill.getBase64Encoder().encode(x.value.data[0])).amount:BigInt(0),X=BigInt(0),Me=true;if($<BigInt(a)){let pe=await $t(f,c);Me=!!pe.value,X=BigInt(Me?oD(new Uint8Array(gill.getBase64Encoder().encode(pe.value.data[0])))?.amount??0:0);}let xe=L?_:void 0,Ne=L?void 0:I,mt=j&&($+X<BigInt(a)||X>BigInt(0)||!L)||!j&&L,nr=!!Ne,[{parsed:Tt,compressedAccount:oe},Fr]=await Promise.all([rD(p,s,$,X,BigInt(a),c),tD(mt,C,c)]),y=null,ie=null,Pe=new W;if(Fr&&Pe.addPreAccounts([{address:s,role:gill.AccountRole.WRITABLE}]),k||oe){await Pe.addSystemAccounts();let pe=[];if(oe&&pe.push({hash:oe.hash,tree:oe.treeInfo.tree,queue:oe.treeInfo.queue,data:oe.data,address:oe.address}),k&&pe.push(k),ie=await B(pe,[]),k){let Ve=oe?1:0;y=ce(Pe,ie.treeInfos.slice(Ve),ie.leafIndices.slice(Ve),ie.rootIndices.slice(Ve),ie.proveByIndices.slice(Ve),pe.slice(Ve),q())[0];}}let H=oe&&Tt&&ie?gill.some({amount:Tt.amount.toNumber(),merkleContext:{leafIndex:oe.leafIndex,merkleTreePubkeyIndex:Pe.insertOrGet(oe.treeInfo.tree.toString()),queuePubkeyIndex:Pe.insertOrGet(oe.treeInfo.queue.toString()),proveByIndex:oe.proveByIndex},rootIndex:ie.rootIndices[0],version:sD(oe.data?.discriminator)}):gill.none(),we=[],Gr=[];for(let pe of u)if(pe instanceof M){let Ve=we.length,{domainConfig:zr,verifyArgs:xs,signature:Is,publicKey:Cs,message:Es}=K(pe,Ve);Es&&Is&&Cs&&we.push({message:Es,signature:Is,publicKey:Cs}),zr&&(Pe.addPreAccounts([{address:zr,role:gill.AccountRole.READONLY}]),xs.__option==="Some"&&Gr.push({domainConfigKey:zr,verifyArgs:xs.value}));}else Pe.addPreAccounts([{address:pe.address,role:gill.AccountRole.READONLY_SIGNER,signer:pe}]);let{remainingAccounts:fs,systemOffset:Ou}=Pe.toAccountMetas(),sr=[];we.length>0&&sr.push(N(we));let Ss=v(ie,Ou);if(d){if(!y)throw new Error("Payer not found or proof args is missing.");sr.push(za({amount:a,settingsMutArgs:y,compressedProofArgs:Ss,payer:i,secp256r1VerifyArgs:Gr,source:p,destination:r,sourceCtokenTokenAccount:f,sourceSplTokenAccount:l,destinationCtokenTokenAccount:Ne,destinationSplTokenAccount:xe,mint:s,tokenProgram:o,remainingAccounts:fs,sourceCompressedTokenAccount:H,compressibleConfig:Cu,splInterfacePda:mt?C:void 0,rentSponsor:nr?Eu:void 0}));}else sr.push(Va({amount:a,secp256r1VerifyArgs:Gr,source:p,destination:r,destinationCtokenTokenAccount:Ne,destinationSplTokenAccount:xe,settings:g,mint:s,tokenProgram:o,remainingAccounts:fs,payer:i,sourceCompressedTokenAccount:H,compressedProofArgs:Ss,sourceSplTokenAccount:l,sourceCtokenTokenAccount:f,compressibleConfig:Cu,splInterfacePda:mt?C:void 0,rentSponsor:nr?Eu:void 0}));return sr}async function tD(e,n,r){let s=false;if(e){let{value:t}=await $t(n,r);s=!t;}return s}async function rD(e,n,r,s,t,c){if(r+s>=t)return {};let a=await Hd(new web3_js.PublicKey(e),{mint:new web3_js.PublicKey(n)},c),i=a.items.length>0?a.items[0]:null;return i?i.compressedAccount.data?.data.length?i.compressedAccount.owner.equals(stateless_js.CTOKEN_PROGRAM_ID)?{compressedAccount:i.compressedAccount,parsed:i.parsed}:{}:{}:{}}async function nD(e,n,r,s){if(!e)return null;let{address:t}=await se(n,r);return (await ge([{address:t,type:"Settings"}],s))[0]}function sD(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let n=e[7];return n===3?2:3}function oD(e){if(!e||e.length===0)return null;try{return {amount:gill.getU64Decoder().decode(e.slice(64,72))}}catch(n){return console.error("Token data parsing error:",n),null}}async function r2({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:a,proof:i,settingsMutArgs:o}=r,d=ye(e),u=d.filter(P=>!(P instanceof M));a.addPreAccounts(u.map(P=>({address:P.address,role:gill.AccountRole.READONLY_SIGNER,signer:P})));let g=d.filter(P=>P instanceof M),p=[],l=[];for(let P of g){let x=l.length,{domainConfig:k,verifyArgs:L,signature:j,publicKey:$,message:X}=K(P,x);X&&j&&$&&l.push({message:X,signature:j,publicKey:$}),k&&(a.addPreAccounts([{address:k,role:gill.AccountRole.READONLY}]),L.__option==="Some"&&p.push({domainConfigKey:k,verifyArgs:L.value}));}let{remainingAccounts:f,systemOffset:_}=a.toAccountMetas(),I=v(i,_),C=[];if(l.length>0&&C.push(N(l)),c){if(!o)throw new Error("Payer not found or proof args is missing.");C.push(dc({configActions:t,payer:n,compressedProofArgs:I,settingsMutArgs:o,remainingAccounts:f,secp256r1VerifyArgs:p}));}else C.push(await tc({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:I,remainingAccounts:f,secp256r1VerifyArgs:p}));return C}async function d2({createUserArgs:e,payer:n}){let r=new W;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:u.member})));let s=await De(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:p}=await O(u.member.address,s);return {address:g,tree:p,queue:p,type:"User"}})),c=await B([],t),a=await de(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),d=v(c,o);return await Oc({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:a[g],transactionManagerUrl:u.role===2?u.transactionManagerUrl:null})),remainingAccounts:i})}async function y2({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new W;await c.addSystemAccounts();let a=[],i=[];i.push(...await ge([{address:(await O(r.address,s)).address,type:"User"}],t));let o=await De(),{address:d,addressTree:u}=await se(e,o);a.push({address:d,queue:u,tree:u,type:"Settings"});let g=i.length,p=await B(i,a),l=ce(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),i.filter(x=>x.type==="User"),Z())[0],_=(await de(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),a)).find(x=>x.type==="Settings")??null,{remainingAccounts:I,systemOffset:C}=c.toAccountMetas(),P=v(p,C);if(!_)throw new Error("Settings creation args is missing.");return await mc({settingsIndex:e,payer:n,initialMember:r,userReadonlyArgs:l,compressedProofArgs:P,settingsCreation:_,remainingAccounts:I})}async function M2({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:a,settingsMutArgs:i}=await Ee(true,e,n,false,t);if(!i)throw new Error("Proof args is missing");let o=ye(s),d=o.filter(C=>C instanceof M),u=[],g=[];for(let C of d){let P=u.length,{domainConfig:x,verifyArgs:k,signature:L,publicKey:j,message:$}=K(C,P);$&&L&&j&&u.push({message:$,signature:L,publicKey:j}),x&&(c.addPreAccounts([{address:x,role:gill.AccountRole.READONLY}]),k.__option==="Some"&&g.push({domainConfigKey:x,verifyArgs:k.value}));}c.addPreAccounts(o.filter(C=>"address"in C).map(C=>({address:C.address,role:gill.AccountRole.READONLY_SIGNER,signer:C})));let{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),f=v(a,l),_=[];u.length>0&&_.push(N(u));let I=await ae(e);return _.push(Fc({settings:I,payer:r,settingsMutArgs:i,compressedProofArgs:f,secp256r1VerifyArgs:g,remainingAccounts:p})),_}async function U2({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new W;await a.addSystemAccounts();let i=await De(),{address:o,addressTree:d}=await O(r.address,i),u=[{address:o,tree:d,queue:d,type:"User"}],g=await B([],u),p=(await de(a,g.treeInfos,g.roots,g.rootIndices,u))[0],l=a.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:v(g,l.systemOffset),authorityCreationArgs:p};}return ea({domainConfig:n,authority:e,newOrigins:s?gill.some(s):gill.none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function N2({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new W;await s.addSystemAccounts();let t=await ge([{address:(await O(e.address,n)).address,type:"User"}]),c=await B(t,[]),a=ce(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,Z())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),d=v(c,o);return ca({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:a,remainingAccounts:i})}async function J2({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:a,message:i,signature:o,publicKey:d}=K(n),u=[];i&&o&&d&&u.push({message:i,signature:o,publicKey:d});let g=await Wr(n instanceof M?n:n.address,r,t),p=[];p.push({address:(await O(n instanceof M?n:n.address,r)).address,type:"User"});let l,f=null,_,I=null;g.delegatedTo.__option==="Some"&&((await os(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await se(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),f={start:p.length-1,end:p.length}):l=await ae(g.delegatedTo.value.index)),s&&((await os(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await se(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),I={start:p.length-1,end:p.length}):_=await ae(s.index));let C=new W;await C.addSystemAccounts();let P=await ge(p,t),x=await B(P,[]),k=ce(C,x.treeInfos.slice(0,1),x.leafIndices.slice(0,1),x.rootIndices.slice(0,1),x.proveByIndices.slice(0,1),P.slice(0,1),Z())[0],L=f?gill.some(ce(C,x.treeInfos.slice(f.start,f.end),x.leafIndices.slice(f.start,f.end),x.rootIndices.slice(f.start,f.end),x.proveByIndices.slice(f.start,f.end),P.slice(f.start,f.end),q())[0]):gill.none(),j=I?gill.some(ce(C,x.treeInfos.slice(I.start,I.end),x.leafIndices.slice(I.start,I.end),x.rootIndices.slice(I.start,I.end),x.proveByIndices.slice(I.start,I.end),P.slice(I.start,I.end),q())[0]):gill.none(),{remainingAccounts:$,systemOffset:X}=C.toAccountMetas(),Me=v(x,X),xe=[];return u.length>0&&xe.push(N(u)),xe.push(ga({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:s?gill.some(s):gill.none(),feePayer:e,signer:n instanceof M?void 0:n,oldSettings:l,oldSettingsMutArgs:L,newSettings:_,newSettingsMutArgs:j,compressedProofArgs:Me,userMutArgs:k,remainingAccounts:$})),xe}async function u5({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await Oo(ne(),s),o=i.data.multiWalletSettings,{packedAccounts:d,proof:u,settingsMutArgs:g}=await Ee(c,e,n,false,a),{remainingAccounts:p,systemOffset:l}=d.toAccountMetas(),{domainConfig:f,verifyArgs:_,message:I,signature:C,publicKey:P}=K(r),x=[];if(I&&C&&P&&x.push(N([{message:I,signature:C,publicKey:P}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let k=v(u,l);x.push(ri({transactionBuffer:s,domainConfig:f,closer:r instanceof M?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:_,settingsMutArgs:g,payer:t,compressedProofArgs:k,remainingAccounts:p}));}else x.push(Za({transactionBuffer:s,domainConfig:f,closer:r instanceof M?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:_,remainingAccounts:[]}));return x}function Pu({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:p,message:l,signature:f,publicKey:_}=K(n),I=[];if(l&&f&&_&&I.push(N([{message:l,signature:f,publicKey:_}])),d){let{settingsReadonlyArgs:C,compressedProofArgs:P,remainingAccounts:x}=d;I.push(mi({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof M?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:u},settingsReadonlyArgs:C,compressedProofArgs:P,remainingAccounts:x}));}else I.push(ii({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof M?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:u},remainingAccounts:[]}));return I}function hu({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=K(e),d=[];return i&&a&&o&&d.push(N([{message:i,signature:a,publicKey:o}])),s?d.push(Pi({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(xi({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,remainingAccounts:[]})),d}function Ru({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Ni({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Ui({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function bu({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=K(n),d=[];return o&&a&&i&&d.push(N([{message:o,signature:a,publicKey:i}])),s?d.push(Zi({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(zi({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,remainingAccounts:[]})),d}async function $5({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await dD(r),a=new W,i=null,o=null,d=[];if(c.length||t){let g=await uD({packedAccounts:a,userAccounts:c,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:s});i=g.proof,o=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await AD({configActionsArgs:r,userMutArgs:d,index:e}),index:e,proof:i,settingsMutArgs:o,packedAccounts:a,compressed:t}}async function dD(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>O(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let s=await Promise.all(r.members.map(t=>O(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function uD({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let a=[];if(r){let l=(await se(s,t)).address;a.push({address:l,type:"Settings"});}n.length&&a.push(...n);let i=a.length?await ge(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await B(i,[]),d=[],u=[];for(let l of i)l.type==="Settings"?d.push(l):l.type==="User"&&u.push(l);let g,p=[];if(r&&o&&(g=ce(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),d,q())[0]),u.length&&o){let l=r?1:0;p=ce(e,o.treeInfos.slice(l),o.leafIndices.slice(l),o.rootIndices.slice(l),o.proveByIndices.slice(l),u,Z());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function AD({index:e,configActionsArgs:n,userMutArgs:r}){let s=[];for(let t of n)switch(t.type){case "AddMembers":{let c=[];for(let a of t.members){let i=await O(a.member,a.userAddressTreeIndex).then(o=>r.find(d=>utils_js.equalBytes(new Uint8Array(d.accountMeta.address),new Uint8Array(gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(o.address))))));if(!i)throw new Error("Unable to find user account");c.push(mD({permissionArgs:a.permissions,userMutArgs:i,pubkey:a.member}));}s.push({__kind:t.type,fields:[c]});break}case "RemoveMembers":{let c=await Promise.all(t.members.map(a=>O(a.member,a.userAddressTreeIndex).then(i=>{let o=r.find(d=>utils_js.equalBytes(new Uint8Array(d.accountMeta.address),new Uint8Array(gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(i.address)))));if(!o)throw new Error("Unable to find user account");return pD({pubkey:a.member,userMutArgs:o,index:e})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(a=>gD({permissionArgs:a.permissions,pubkey:a.member}));s.push({__kind:t.type,fields:[c]});break}default:s.push({__kind:t.type,fields:[t.threshold]});}return s}function gD({pubkey:e,permissionArgs:n}){return {memberKey:ut(e),permissions:Wu(n)}}function pD({pubkey:e,userMutArgs:n,index:r}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");let s=n.data.delegatedTo.__option==="Some"?Number(n.data.delegatedTo.value.index.toString())===r:false;return {memberKey:ut(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function mD({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===1)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===2&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:ut(e),permissions:Wu(n),userReadonlyArgs:r}}function Wu(e){let n=[];return e.initiate&&n.push(be.InitiateTransaction),e.vote&&n.push(be.VoteTransaction),e.execute&&n.push(be.ExecuteTransaction),Le.fromPermissions(n)}async function a6({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:l}){let f=await ae(n),_=Math.floor(Math.random()*255),I=await Jd(f,t instanceof M?t:t.address,_),C=[],P=[];for(let H=0;H<s.length;H+=p){let we=s.subarray(H,H+p);C.push(we),P.push(sha2_js.sha256(we));}let x=sha2_js.sha256(new Uint8Array(s)),{settingsReadonlyArgs:k,settingsMutArgs:L,proof:j,packedAccounts:$}=await Ee(d,n,r,false,l),{remainingAccounts:X,systemOffset:Me}=$.toAccountMetas(),xe=j&&k&&L?{settingsReadonlyArgs:k,settingsMutArgs:L,compressedProofArgs:v(j,Me),remainingAccounts:X,payer:e}:null,Ne=ye([t,...c?[c]:[],...u]).filter(H=>H instanceof M).map(H=>({memberKey:ut(H),messageHash:is(H.authResponse)})),mt=Pu({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:_,payer:e,transactionBufferAddress:I,settings:f,creator:t,preauthorizeExecution:!c,bufferExtendHashes:P,compressedArgs:xe,expectedSecp256r1Signers:Ne}),nr=C.map(H=>Ru({transactionMessageBytes:H,transactionBufferAddress:I,settings:f,compressed:d})),Tt=u.map(H=>bu({voter:H,transactionBufferAddress:I,settings:f,compressedArgs:xe})),oe=hu({compressedArgs:xe,settings:f,executor:c,transactionBufferAddress:I}),{instructions:Fr,addressLookupTableAccounts:y}=await yu({compressed:d,settings:f,transactionMessageBytes:s,transactionBufferAddress:I,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),ie=H=>({payer:e,instructions:H,addressesByLookupTableAddress:y});return [ie(mt),...nr.map(H=>ie([H])),...Tt.length?[ie(Tt.flat())]:[],ie(oe),ie(Fr)]}var Vr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=a=>{let i=s.get(a);return i===void 0&&(i={isSigner:false,isWritable:false,isInvoked:false},s.set(a,i)),i},c=t(r);c.isSigner=true,c.isWritable=true;for(let a of n){t(a.programAddress).isInvoked=false;for(let i of a.accounts??[]){let o=t(i.address);o.isSigner||=i.role===gill.AccountRole.READONLY_SIGNER||i.role===gill.AccountRole.WRITABLE_SIGNER,o.isWritable||=i.role===gill.AccountRole.WRITABLE||i.role===gill.AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),a={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let i=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [a,i]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&a.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&!a.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,a]of this.keyMetaMap.entries())if(r(a)){let i=c,o=n.findIndex(d=>d===i);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(i),this.keyMetaMap.delete(c);}}return [s,t]}};var Hr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,a)=>{s.set(c,a);});let t=c=>{let a=s.get(c);if(a===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return a};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(a=>t(a.address))??[],data:c.data}))}};function ku({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Vr.compile(r,e),c=new Array,a={writable:[],readonly:[]},i=Object.entries(s??{});for(let p of i){let l=t.extractTableLookup(p);if(l!==void 0){let{addressTableLookup:f,drainedKeys:_}=l;c.push({readonlyIndexes:f.readonlyIndexes,readableIndices:f.readonlyIndexes,writableIndexes:f.writableIndexes,writableIndices:f.writableIndexes,lookupTableAddress:gill.address(f.lookupTableAddress)}),a.writable.push(..._.writable),a.readonly.push(..._.readonly);}}let[o,d]=t.getMessageComponents(),g=new Hr(d,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function x6({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=ku({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return Rd(s)}async function M6({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await lu({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:d,cachedAccounts:i});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}
2
+ exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=jo;exports.BACKOFF_MAX_DELAY_MS=ar;exports.BUNDLE_POLL_DELAY_MS=Ps;exports.BUNDLE_POLL_MAX_RETRIES=Ms;exports.BundleError=Ae;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=cc;exports.CHANGE_CONFIG_DISCRIMINATOR=$o;exports.COMPUTE_UNIT_MULTIPLIER=Ds;exports.CREATE_COMPRESSED_WALLET_DISCRIMINATOR=gc;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=Cc;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=Pc;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=_c;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=Lc;exports.CompleteMessageRequestSchema=mk;exports.CompleteTransactionRequestSchema=Tk;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=wc;exports.DEFAULT_JITO_BLOCK_ENGINE_URL=hs;exports.DEFAULT_JITO_TIPS_URL=Rs;exports.DEFAULT_JITO_TIP_PRIORITY=bs;exports.DEFAULT_NETWORK_RETRY_DELAY_MS=Ue;exports.DEFAULT_NETWORK_RETRY_MAX_RETRIES=ve;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=Kc;exports.DOMAIN_CONFIG_DISCRIMINATOR=Ls;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=Qc;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=na;exports.EDIT_USER_DELEGATE_DISCRIMINATOR=da;exports.EXPONENTIAL_BACKOFF_BASE=cr;exports.GLOBAL_COUNTER_DISCRIMINATOR=Vs;exports.HTTP_STATUS_BAD_REQUEST=vs;exports.HTTP_STATUS_INTERNAL_SERVER_ERROR=qr;exports.HTTP_STATUS_TOO_MANY_REQUESTS=Us;exports.JITO_TIP_ACCOUNTS=jr;exports.KeyType=Yt;exports.MAX_TRANSACTION_BUFFER_INDEX=_s;exports.MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR=Ta;exports.MIGRATE_COMPRESSED_USERS_DISCRIMINATOR=Ia;exports.MIN_COMPUTE_UNITS=or;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=DI;exports.MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH=tI;exports.MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED=mC;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=zI;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=KI;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH=gC;exports.MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE=CC;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=sI;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=nI;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=mI;exports.MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS=XI;exports.MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH=gI;exports.MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH=rI;exports.MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH=uI;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=WI;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=LI;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=kI;exports.MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED=ZI;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=hI;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=MI;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=PI;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=SI;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX=AC;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=JI;exports.MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG=pI;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=II;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=UI;exports.MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT=QI;exports.MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS=RI;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=fI;exports.MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG=aI;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION=Yx;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY=Qx;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=Jx;exports.MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS=Xx;exports.MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER=GI;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=HI;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=yI;exports.MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE=iC;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG=AI;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION=dI;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=lI;exports.MULTI_WALLET_ERROR__INVALID_USER_ROLE=xI;exports.MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG=yC;exports.MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR=aC;exports.MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE=$x;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=wI;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=jI;exports.MULTI_WALLET_ERROR__MEMBER_NOT_FOUND=tC;exports.MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS=uC;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=CI;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS=$I;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT=sC;exports.MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT=lC;exports.MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR=cC;exports.MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS=eC;exports.MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS=EI;exports.MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY=xC;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE=SC;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA=YI;exports.MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT=fC;exports.MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA=oC;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=VI;exports.MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS=pC;exports.MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES=IC;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=_I;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=cI;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=iI;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=qI;exports.MULTI_WALLET_ERROR__PAYER_MISMATCH=nC;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=oI;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=NI;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=eI;exports.MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH=rC;exports.MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS=Zx;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=FI;exports.MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH=dC;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=TI;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=OI;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=BI;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=vI;exports.MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY=TC;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=bI;exports.MULTI_WALLET_PROGRAM_ADDRESS=A;exports.MultiWalletAccount=Kx;exports.MultiWalletInstruction=jx;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=va;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=Pa;exports.NetworkError=Ce;exports.NotFoundError=ee;exports.NotInitializedError=We;exports.Permission=be;exports.PermissionError=dr;exports.Permissions=Le;exports.RetryExhaustedError=ir;exports.RevibaseError=Ie;exports.SETTINGS_DISCRIMINATOR=Po;exports.Secp256r1Key=ke;exports.SignedSecp256r1Key=M;exports.StartMessageRequestSchema=gk;exports.StartTransactionRequestSchema=pk;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=Fa;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=Na;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=$a;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=qa;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=Ai;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=oi;exports.TRANSACTION_BUFFER_DISCRIMINATOR=Wo;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=Ei;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=li;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=ki;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=bi;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=qi;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=Hi;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=od;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=$i;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=ld;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=Ad;exports.TRANSACTION_SIZE_LIMIT=Kr;exports.TransactionActionTypeSchema=Cd;exports.TransactionError=Ws;exports.TransactionPayloadSchema=Ak;exports.TransactionPayloadWithBase64MessageBytesSchema=Ed;exports.UserRole=nt;exports.ValidationError=F;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=wo;exports.addWhitelistedAddressTrees=ok;exports.base64URLStringToBuffer=Be;exports.bufferToBase64URLString=QO;exports.changeConfig=r2;exports.closeTransactionBuffer=u5;exports.configAction=cM;exports.convertMemberKeyToString=iu;exports.convertPubkeyCompressedToCose=zO;exports.convertPubkeyCoseToCompressed=GO;exports.createClientAuthorizationCompleteRequestChallenge=YO;exports.createClientAuthorizationStartRequestChallenge=JO;exports.createDomainConfig=mN;exports.createDomainUserAccounts=DN;exports.createGlobalCounter=RN;exports.createMessageChallenge=ZO;exports.createTransactionBuffer=Pu;exports.createTransactionChallenge=XO;exports.createTransactionManagerSigner=vE;exports.createUserAccounts=d2;exports.createWallet=y2;exports.decodeDomainConfig=Os;exports.decodeGlobalCounter=Fs;exports.decodeSettings=Ro;exports.decodeTransactionBuffer=ko;exports.decodeWhitelistedAddressTree=Ho;exports.decompressSettingsAccount=M2;exports.deserializeConfigActions=QB;exports.disableDomainConfig=UN;exports.editDomainConfig=U2;exports.editTransactionManagerUrl=N2;exports.editUserDelegate=J2;exports.executeTransaction=yu;exports.executeTransactionBuffer=hu;exports.executeTransactionSync=lu;exports.extendTransactionBuffer=Ru;exports.fetchAllDomainConfig=ID;exports.fetchAllGlobalCounter=RD;exports.fetchAllMaybeDomainConfig=Zu;exports.fetchAllMaybeGlobalCounter=gA;exports.fetchAllMaybeSettings=w1;exports.fetchAllMaybeTransactionBuffer=oT;exports.fetchAllMaybeWhitelistedAddressTree=MT;exports.fetchAllSettings=nR;exports.fetchAllTransactionBuffer=dR;exports.fetchAllWhitelistedAddressTree=mR;exports.fetchDomainConfig=Bs;exports.fetchGlobalCounter=hD;exports.fetchMaybeDomainConfig=Yu;exports.fetchMaybeGlobalCounter=AA;exports.fetchMaybeSettings=Rn;exports.fetchMaybeSettingsAccountData=HC;exports.fetchMaybeTransactionBuffer=sT;exports.fetchMaybeUserAccountData=VC;exports.fetchMaybeWhitelistedAddressTree=DT;exports.fetchSettings=rR;exports.fetchSettingsAccountData=os;exports.fetchTransactionBuffer=Oo;exports.fetchUserAccountData=Wr;exports.fetchWhitelistedAddressTree=Fo;exports.getAddMemberArgsCodec=WD;exports.getAddMemberArgsDecoder=Yr;exports.getAddMemberArgsEncoder=Jr;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=vR;exports.getAddWhitelistedAddressTreesInstruction=WR;exports.getAddWhitelistedAddressTreesInstructionAsync=Jo;exports.getAddWhitelistedAddressTreesInstructionDataCodec=UR;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=qo;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=On;exports.getChangeConfigCompressedDiscriminatorBytes=XR;exports.getChangeConfigCompressedInstruction=dc;exports.getChangeConfigCompressedInstructionDataCodec=QR;exports.getChangeConfigCompressedInstructionDataDecoder=ic;exports.getChangeConfigCompressedInstructionDataEncoder=ac;exports.getChangeConfigDiscriminatorBytes=HR;exports.getChangeConfigInstruction=GR;exports.getChangeConfigInstructionAsync=tc;exports.getChangeConfigInstructionDataCodec=FR;exports.getChangeConfigInstructionDataDecoder=ec;exports.getChangeConfigInstructionDataEncoder=Nn;exports.getClientAndDeviceHash=as;exports.getCompiledInstructionCodec=OD;exports.getCompiledInstructionDecoder=Xr;exports.getCompiledInstructionEncoder=Zr;exports.getCompressedAccountMetaCodec=VD;exports.getCompressedAccountMetaDecoder=St;exports.getCompressedAccountMetaEncoder=ft;exports.getCompressedAccountMetaReadOnlyCodec=zD;exports.getCompressedAccountMetaReadOnlyDecoder=Et;exports.getCompressedAccountMetaReadOnlyEncoder=Ct;exports.getCompressedProofCodec=qD;exports.getCompressedProofDecoder=nn;exports.getCompressedProofEncoder=rn;exports.getCompressedSettingsAddressFromIndex=se;exports.getCompressedSettingsCodec=XD;exports.getCompressedSettingsDataCodec=tM;exports.getCompressedSettingsDataDecoder=Pt;exports.getCompressedSettingsDataEncoder=Mt;exports.getCompressedSettingsDecoder=q;exports.getCompressedSettingsEncoder=Dt;exports.getComputeBudgetEstimate=kd;exports.getConfigActionCodec=oM;exports.getConfigActionDecoder=ze;exports.getConfigActionEncoder=Ge;exports.getCreateCompressedWalletDiscriminatorBytes=cb;exports.getCreateCompressedWalletInstruction=ib;exports.getCreateCompressedWalletInstructionAsync=mc;exports.getCreateCompressedWalletInstructionDataCodec=ab;exports.getCreateCompressedWalletInstructionDataDecoder=pc;exports.getCreateCompressedWalletInstructionDataEncoder=wn;exports.getCreateDomainConfigDiscriminatorBytes=yb;exports.getCreateDomainConfigInstruction=fb;exports.getCreateDomainConfigInstructionAsync=Dc;exports.getCreateDomainConfigInstructionDataCodec=lb;exports.getCreateDomainConfigInstructionDataDecoder=Ec;exports.getCreateDomainConfigInstructionDataEncoder=Hn;exports.getCreateDomainUserAccountDiscriminatorBytes=Pb;exports.getCreateDomainUserAccountInstruction=Rb;exports.getCreateDomainUserAccountInstructionAsync=Rc;exports.getCreateDomainUserAccountInstructionDataCodec=hb;exports.getCreateDomainUserAccountInstructionDataDecoder=hc;exports.getCreateDomainUserAccountInstructionDataEncoder=Gn;exports.getCreateGlobalCounterDiscriminatorBytes=kb;exports.getCreateGlobalCounterInstruction=Bb;exports.getCreateGlobalCounterInstructionAsync=Uc;exports.getCreateGlobalCounterInstructionDataCodec=Ob;exports.getCreateGlobalCounterInstructionDataDecoder=vc;exports.getCreateGlobalCounterInstructionDataEncoder=Kn;exports.getCreateUserAccountArgsCodec=AM;exports.getCreateUserAccountArgsDecoder=gn;exports.getCreateUserAccountArgsEncoder=An;exports.getCreateUserAccountsDiscriminatorBytes=Kb;exports.getCreateUserAccountsInstruction=qb;exports.getCreateUserAccountsInstructionAsync=Oc;exports.getCreateUserAccountsInstructionDataCodec=jb;exports.getCreateUserAccountsInstructionDataDecoder=kc;exports.getCreateUserAccountsInstructionDataEncoder=qn;exports.getDecompressSettingsAccountDiscriminatorBytes=t_;exports.getDecompressSettingsAccountInstruction=Fc;exports.getDecompressSettingsAccountInstructionDataCodec=r_;exports.getDecompressSettingsAccountInstructionDataDecoder=Hc;exports.getDecompressSettingsAccountInstructionDataEncoder=Vc;exports.getDisableDomainConfigDiscriminatorBytes=d_;exports.getDisableDomainConfigInstruction=Jc;exports.getDisableDomainConfigInstructionDataCodec=u_;exports.getDisableDomainConfigInstructionDataDecoder=qc;exports.getDisableDomainConfigInstructionDataEncoder=jc;exports.getDomainConfigAddress=it;exports.getDomainConfigCodec=xD;exports.getDomainConfigDecoder=ks;exports.getDomainConfigDiscriminatorBytes=SD;exports.getDomainConfigEncoder=Ju;exports.getDomainConfigSize=CD;exports.getEditDomainConfigDiscriminatorBytes=f_;exports.getEditDomainConfigInstruction=ea;exports.getEditDomainConfigInstructionAsync=x_;exports.getEditDomainConfigInstructionDataCodec=S_;exports.getEditDomainConfigInstructionDataDecoder=$c;exports.getEditDomainConfigInstructionDataEncoder=Yn;exports.getEditMemberArgsCodec=TM;exports.getEditMemberArgsDecoder=an;exports.getEditMemberArgsEncoder=cn;exports.getEditTransactionManagerUrlDiscriminatorBytes=R_;exports.getEditTransactionManagerUrlInstruction=ca;exports.getEditTransactionManagerUrlInstructionDataCodec=b_;exports.getEditTransactionManagerUrlInstructionDataDecoder=oa;exports.getEditTransactionManagerUrlInstructionDataEncoder=sa;exports.getEditUserDelegateDiscriminatorBytes=B_;exports.getEditUserDelegateInstruction=ga;exports.getEditUserDelegateInstructionDataCodec=N_;exports.getEditUserDelegateInstructionDataDecoder=Aa;exports.getEditUserDelegateInstructionDataEncoder=ua;exports.getExpectedSecp256r1SignersCodec=SM;exports.getExpectedSecp256r1SignersDecoder=_t;exports.getExpectedSecp256r1SignersEncoder=bt;exports.getGlobalCounterAddress=qd;exports.getGlobalCounterCodec=PD;exports.getGlobalCounterDecoder=Hs;exports.getGlobalCounterDiscriminatorBytes=MD;exports.getGlobalCounterEncoder=uA;exports.getGlobalCounterSize=bD;exports.getJitoTipsConfig=ns;exports.getLightCpiSigner=vO;exports.getLightProtocolRpc=ot;exports.getLinkWalletArgsCodec=EM;exports.getLinkWalletArgsDecoder=mn;exports.getLinkWalletArgsEncoder=pn;exports.getMemberCodec=hM;exports.getMemberDecoder=Rt;exports.getMemberEncoder=ht;exports.getMemberKeyCodec=_M;exports.getMemberKeyDecoder=re;exports.getMemberKeyEncoder=te;exports.getMigrateCompressedSettingsDiscriminatorBytes=j_;exports.getMigrateCompressedSettingsInstruction=fa;exports.getMigrateCompressedSettingsInstructionDataCodec=q_;exports.getMigrateCompressedSettingsInstructionDataDecoder=la;exports.getMigrateCompressedSettingsInstructionDataEncoder=ya;exports.getMigrateCompressedUsersDiscriminatorBytes=tv;exports.getMigrateCompressedUsersInstruction=Da;exports.getMigrateCompressedUsersInstructionDataCodec=rv;exports.getMigrateCompressedUsersInstructionDataDecoder=Ea;exports.getMigrateCompressedUsersInstructionDataEncoder=Ca;exports.getMultiWalletErrorMessage=qL;exports.getNativeTransferIntentCompressedDiscriminatorBytes=xv;exports.getNativeTransferIntentCompressedInstruction=La;exports.getNativeTransferIntentCompressedInstructionDataCodec=Iv;exports.getNativeTransferIntentCompressedInstructionDataDecoder=Wa;exports.getNativeTransferIntentCompressedInstructionDataEncoder=Ua;exports.getNativeTransferIntentDiscriminatorBytes=uv;exports.getNativeTransferIntentInstruction=Ra;exports.getNativeTransferIntentInstructionAsync=gv;exports.getNativeTransferIntentInstructionDataCodec=Av;exports.getNativeTransferIntentInstructionDataDecoder=ha;exports.getNativeTransferIntentInstructionDataEncoder=Zn;exports.getNewAuthorityArgsCodec=LM;exports.getNewAuthorityArgsDecoder=fn;exports.getNewAuthorityArgsEncoder=ln;exports.getOriginIndex=$O;exports.getPackedAddressTreeInfoCodec=BM;exports.getPackedAddressTreeInfoDecoder=Ut;exports.getPackedAddressTreeInfoEncoder=vt;exports.getPackedMerkleContextCodec=VM;exports.getPackedMerkleContextDecoder=xn;exports.getPackedMerkleContextEncoder=Sn;exports.getPackedStateTreeInfoCodec=GM;exports.getPackedStateTreeInfoDecoder=It;exports.getPackedStateTreeInfoEncoder=xt;exports.getPermissionsCodec=jM;exports.getPermissionsDecoder=Fe;exports.getPermissionsEncoder=He;exports.getProofArgsCodec=ZM;exports.getProofArgsDecoder=D;exports.getProofArgsEncoder=E;exports.getRemoveMemberArgsCodec=eP;exports.getRemoveMemberArgsDecoder=un;exports.getRemoveMemberArgsEncoder=dn;exports.getSecp256r1MessageHash=is;exports.getSecp256r1PubkeyCodec=nP;exports.getSecp256r1PubkeyDecoder=Wt;exports.getSecp256r1PubkeyEncoder=En;exports.getSecp256r1SignatureOffsetsDataDecoder=KE;exports.getSecp256r1SignatureOffsetsDataEncoder=zE;exports.getSecp256r1VerifyArgsCodec=cP;exports.getSecp256r1VerifyArgsDecoder=V;exports.getSecp256r1VerifyArgsEncoder=w;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=uP;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=Y;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=J;exports.getSecp256r1VerifyInstruction=N;exports.getSecp256r1VerifyInstructionDataCodec=aw;exports.getSecp256r1VerifyInstructionDataDecoder=mu;exports.getSecp256r1VerifyInstructionDataEncoder=Tu;exports.getSendAndConfirmTransaction=Ld;exports.getSettingsCodec=tR;exports.getSettingsCreationArgsCodec=mP;exports.getSettingsCreationArgsDecoder=kt;exports.getSettingsCreationArgsEncoder=Lt;exports.getSettingsDecoder=ho;exports.getSettingsDiscriminatorBytes=eR;exports.getSettingsEncoder=N1;exports.getSettingsFromIndex=ae;exports.getSettingsIndexWithAddressCodec=lP;exports.getSettingsIndexWithAddressDecoder=Bt;exports.getSettingsIndexWithAddressEncoder=Ot;exports.getSettingsMutArgsCodec=IP;exports.getSettingsMutArgsDecoder=z;exports.getSettingsMutArgsEncoder=G;exports.getSettingsReadonlyArgsCodec=MP;exports.getSettingsReadonlyArgsDecoder=wt;exports.getSettingsReadonlyArgsEncoder=Nt;exports.getSignedSecp256r1Key=KO;exports.getSignedTransactionManager=ZB;exports.getSolanaRpc=ne;exports.getSolanaRpcEndpoint=Wd;exports.getSourceCompressedTokenArgsCodec=bP;exports.getSourceCompressedTokenArgsDecoder=Ht;exports.getSourceCompressedTokenArgsEncoder=Vt;exports.getTokenTransferIntentCompressedDiscriminatorBytes=wv;exports.getTokenTransferIntentCompressedInstruction=za;exports.getTokenTransferIntentCompressedInstructionAsync=Hv;exports.getTokenTransferIntentCompressedInstructionDataCodec=Vv;exports.getTokenTransferIntentCompressedInstructionDataDecoder=Ga;exports.getTokenTransferIntentCompressedInstructionDataEncoder=Qn;exports.getTokenTransferIntentDiscriminatorBytes=bv;exports.getTokenTransferIntentInstruction=Va;exports.getTokenTransferIntentInstructionAsync=vv;exports.getTokenTransferIntentInstructionDataCodec=_v;exports.getTokenTransferIntentInstructionDataDecoder=wa;exports.getTokenTransferIntentInstructionDataEncoder=Xn;exports.getTransactionBufferAddress=Jd;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=sU;exports.getTransactionBufferCloseCompressedInstruction=ri;exports.getTransactionBufferCloseCompressedInstructionDataCodec=oU;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=ti;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=ei;exports.getTransactionBufferCloseDiscriminatorBytes=Yv;exports.getTransactionBufferCloseInstruction=Za;exports.getTransactionBufferCloseInstructionDataCodec=Zv;exports.getTransactionBufferCloseInstructionDataDecoder=Ya;exports.getTransactionBufferCloseInstructionDataEncoder=Ja;exports.getTransactionBufferCodec=iR;exports.getTransactionBufferCreateArgsCodec=WP;exports.getTransactionBufferCreateArgsDecoder=Gt;exports.getTransactionBufferCreateArgsEncoder=Ft;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=CU;exports.getTransactionBufferCreateCompressedInstruction=mi;exports.getTransactionBufferCreateCompressedInstructionDataCodec=EU;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=pi;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=gi;exports.getTransactionBufferCreateDiscriminatorBytes=pU;exports.getTransactionBufferCreateInstruction=ii;exports.getTransactionBufferCreateInstructionDataCodec=mU;exports.getTransactionBufferCreateInstructionDataDecoder=ai;exports.getTransactionBufferCreateInstructionDataEncoder=ci;exports.getTransactionBufferDecoder=Lo;exports.getTransactionBufferDiscriminatorBytes=aR;exports.getTransactionBufferEncoder=nT;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=VU;exports.getTransactionBufferExecuteCompressedInstruction=Pi;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=HU;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=Mi;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=Di;exports.getTransactionBufferExecuteDiscriminatorBytes=vU;exports.getTransactionBufferExecuteInstruction=xi;exports.getTransactionBufferExecuteInstructionDataCodec=UU;exports.getTransactionBufferExecuteInstructionDataDecoder=Si;exports.getTransactionBufferExecuteInstructionDataEncoder=fi;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=rW;exports.getTransactionBufferExtendCompressedInstruction=Ni;exports.getTransactionBufferExtendCompressedInstructionDataCodec=nW;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=Bi;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=Oi;exports.getTransactionBufferExtendDiscriminatorBytes=JU;exports.getTransactionBufferExtendInstruction=Ui;exports.getTransactionBufferExtendInstructionDataCodec=YU;exports.getTransactionBufferExtendInstructionDataDecoder=vi;exports.getTransactionBufferExtendInstructionDataEncoder=_i;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=xW;exports.getTransactionBufferVoteCompressedInstruction=Zi;exports.getTransactionBufferVoteCompressedInstructionDataCodec=IW;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=Yi;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=Ji;exports.getTransactionBufferVoteDiscriminatorBytes=AW;exports.getTransactionBufferVoteInstruction=zi;exports.getTransactionBufferVoteInstructionDataCodec=gW;exports.getTransactionBufferVoteInstructionDataDecoder=Gi;exports.getTransactionBufferVoteInstructionDataEncoder=Fi;exports.getTransactionExecuteCompressedDiscriminatorBytes=OW;exports.getTransactionExecuteCompressedInstruction=id;exports.getTransactionExecuteCompressedInstructionDataCodec=BW;exports.getTransactionExecuteCompressedInstructionDataDecoder=ad;exports.getTransactionExecuteCompressedInstructionDataEncoder=cd;exports.getTransactionExecuteDiscriminatorBytes=RW;exports.getTransactionExecuteInstruction=rd;exports.getTransactionExecuteInstructionDataCodec=bW;exports.getTransactionExecuteInstructionDataDecoder=td;exports.getTransactionExecuteInstructionDataEncoder=ed;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=eL;exports.getTransactionExecuteSyncCompressedInstruction=xd;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=tL;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=Sd;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=fd;exports.getTransactionExecuteSyncDiscriminatorBytes=KW;exports.getTransactionExecuteSyncInstruction=md;exports.getTransactionExecuteSyncInstructionDataCodec=jW;exports.getTransactionExecuteSyncInstructionDataDecoder=pd;exports.getTransactionExecuteSyncInstructionDataEncoder=gd;exports.getTransactionMessageAddressTableLookupCodec=VP;exports.getTransactionMessageAddressTableLookupDecoder=Mn;exports.getTransactionMessageAddressTableLookupEncoder=Dn;exports.getTransactionMessageCodec=BP;exports.getTransactionMessageDecoder=Kt;exports.getTransactionMessageEncoder=zt;exports.getUserAccountAddress=O;exports.getUserCodec=zP;exports.getUserCreationArgsCodec=JP;exports.getUserCreationArgsDecoder=fe;exports.getUserCreationArgsEncoder=le;exports.getUserDecoder=Z;exports.getUserEncoder=qe;exports.getUserMutArgsCodec=QP;exports.getUserMutArgsDecoder=Ye;exports.getUserMutArgsEncoder=Je;exports.getUserReadOnlyArgsCodec=rh;exports.getUserReadOnlyArgsDecoder=Re;exports.getUserReadOnlyArgsEncoder=he;exports.getUserReadOnlyOrMutateArgsCodec=ch;exports.getUserReadOnlyOrMutateArgsDecoder=Cn;exports.getUserReadOnlyOrMutateArgsEncoder=In;exports.getUserRoleCodec=Ah;exports.getUserRoleDecoder=je;exports.getUserRoleEncoder=Ke;exports.getWalletAddressFromIndex=_O;exports.getWalletAddressFromSettings=_e;exports.getWhitelistedAddressTreeCodec=pR;exports.getWhitelistedAddressTreeDecoder=Vo;exports.getWhitelistedAddressTreeDiscriminatorBytes=gR;exports.getWhitelistedAddressTreeEncoder=ET;exports.getWhitelistedAddressTreeFromIndex=cs;exports.getWhitelistedAddressTreeIndexFromAddress=fO;exports.getWhitelistedAddressTreesAddress=Fd;exports.identifyMultiWalletAccount=VL;exports.identifyMultiWalletInstruction=HL;exports.initialize=Hk;exports.isConfigAction=aM;exports.isMultiWalletError=JL;exports.isUserReadOnlyOrMutateArgs=ih;exports.migrateSettings=wN;exports.migrateUsers=jN;exports.nativeTransferIntent=Uw;exports.parseAddWhitelistedAddressTreesInstruction=LR;exports.parseChangeConfigCompressedInstruction=$R;exports.parseChangeConfigInstruction=zR;exports.parseCreateCompressedWalletInstruction=db;exports.parseCreateDomainConfigInstruction=Sb;exports.parseCreateDomainUserAccountInstruction=bb;exports.parseCreateGlobalCounterInstruction=Nb;exports.parseCreateUserAccountsInstruction=Jb;exports.parseDecompressSettingsAccountInstruction=n_;exports.parseDisableDomainConfigInstruction=A_;exports.parseEditDomainConfigInstruction=I_;exports.parseEditTransactionManagerUrlInstruction=__;exports.parseEditUserDelegateInstruction=w_;exports.parseMigrateCompressedSettingsInstruction=J_;exports.parseMigrateCompressedUsersInstruction=nv;exports.parseNativeTransferIntentCompressedInstruction=Cv;exports.parseNativeTransferIntentInstruction=pv;exports.parseSecp256r1VerifyInstruction=iw;exports.parseTokenTransferIntentCompressedInstruction=Fv;exports.parseTokenTransferIntentInstruction=Uv;exports.parseTransactionBufferCloseCompressedInstruction=cU;exports.parseTransactionBufferCloseInstruction=Xv;exports.parseTransactionBufferCreateCompressedInstruction=DU;exports.parseTransactionBufferCreateInstruction=TU;exports.parseTransactionBufferExecuteCompressedInstruction=FU;exports.parseTransactionBufferExecuteInstruction=WU;exports.parseTransactionBufferExtendCompressedInstruction=sW;exports.parseTransactionBufferExtendInstruction=ZU;exports.parseTransactionBufferVoteCompressedInstruction=CW;exports.parseTransactionBufferVoteInstruction=pW;exports.parseTransactionExecuteCompressedInstruction=NW;exports.parseTransactionExecuteInstruction=_W;exports.parseTransactionExecuteSyncCompressedInstruction=rL;exports.parseTransactionExecuteSyncInstruction=qW;exports.pollJitoBundleConfirmation=PB;exports.prepareChangeConfigArgs=$5;exports.prepareTransactionBundle=a6;exports.prepareTransactionMessage=x6;exports.prepareTransactionSync=M6;exports.retrieveTransactionManager=YB;exports.sendJitoBundle=pE;exports.serializeConfigActions=XB;exports.signAndSendBundledTransactions=MB;exports.signAndSendTransaction=WB;exports.tokenTransferIntent=Kw;exports.userReadOnlyOrMutateArgs=ah;exports.vaultTransactionMessageDeserialize=bd;exports.vaultTransactionMessageSerialize=Rd;exports.voteTransactionBuffer=bu;//# sourceMappingURL=index.cjs.map
3
3
  //# sourceMappingURL=index.cjs.map