@revibase/core 0.0.36 → 0.0.38

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'),Hd=require('bn.js'),tinyCbor=require('@levischuck/tiny-cbor'),nist_js=require('@noble/curves/nist.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Hd__default=/*#__PURE__*/_interopDefault(Hd);var rs=new Uint8Array([201,232,212,229,59,241,106,197]);function zC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(rs)}function nu(){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:rs}))}function ns(){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 KC(){return gill.combineCodec(nu(),ns())}function ss(e){return gill.decodeAccount(e,ns())}async function os(e,n,r){let s=await su(e,n,r);return gill.assertAccountExists(s),s}async function su(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return ss(s)}async function jC(e,n,r){let s=await ou(e,n,r);return gill.assertAccountsExist(s),s}async function ou(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>ss(t))}function JC(){return 846}var is=new Uint8Array([42,206,176,58,175,129,130,233]);function YC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(is)}function Su(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:is}))}function ds(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function XC(){return gill.combineCodec(Su(),ds())}function us(e){return gill.decodeAccount(e,ds())}async function QC(e,n,r){let s=await xu(e,n,r);return gill.assertAccountExists(s),s}async function xu(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return us(s)}async function $C(e,n,r){let s=await Iu(e,n,r);return gill.assertAccountsExist(s),s}async function Iu(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>us(t))}function eD(){return 24}function Er(){return gill.getStructEncoder([["memberKey",ee()],["permissions",Ue()],["userReadonlyArgs",Ie()]])}function hr(){return gill.getStructDecoder([["memberKey",te()],["permissions",We()],["userReadonlyArgs",Ce()]])}function sD(){return gill.combineCodec(Er(),hr())}function Rr(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function br(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function aD(){return gill.combineCodec(Rr(),br())}function dt(){return gill.getStructEncoder([["treeInfo",At()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["outputStateTreeIndex",gill.getU8Encoder()]])}function ut(){return gill.getStructDecoder([["treeInfo",gt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["outputStateTreeIndex",gill.getU8Decoder()]])}function AD(){return gill.combineCodec(dt(),ut())}function pt(){return gill.getStructEncoder([["treeInfo",At()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function mt(){return gill.getStructDecoder([["treeInfo",gt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function yD(){return gill.combineCodec(pt(),mt())}function kr(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Lr(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function fD(){return gill.combineCodec(kr(),Lr())}function yt(){return gill.getStructEncoder([["data",gill.getOptionEncoder(Tt())]])}function q(){return gill.getStructDecoder([["data",gill.getOptionDecoder(lt())]])}function CD(){return gill.combineCodec(yt(),q())}function Tt(){return gill.getStructEncoder([["threshold",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["index",gill.getU128Encoder()],["multiWalletBump",gill.getU8Encoder()],["members",gill.getArrayEncoder(ft())],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]])}function lt(){return gill.getStructDecoder([["threshold",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["index",gill.getU128Decoder()],["multiWalletBump",gill.getU8Decoder()],["members",gill.getArrayDecoder(St())],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function ED(){return gill.combineCodec(Tt(),lt())}function xt(){return gill.getStructEncoder([["version",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()],["amount",gill.getU64Encoder()],["merkleContext",Or()]])}function It(){return gill.getStructDecoder([["version",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()],["amount",gill.getU64Decoder()],["merkleContext",Br()]])}function vD(){return gill.combineCodec(xt(),It())}function ke(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Vr())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Er())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Fr())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function Le(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Hr())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(hr())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Gr())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function kD(){return gill.combineCodec(ke(),Le())}function LD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function OD(e,n){return n.__kind===e}function zr(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",Oe()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",Te()]])}function Kr(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",Be()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",le()]])}function VD(){return gill.combineCodec(zr(),Kr())}function Vr(){return gill.getStructEncoder([["memberKey",ee()],["permissions",Ue()]])}function Hr(){return gill.getStructDecoder([["memberKey",te()],["permissions",We()]])}function zD(){return gill.combineCodec(Vr(),Hr())}function Ct(){return gill.getStructEncoder([["memberKey",ee()],["messageHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Dt(){return gill.getStructDecoder([["memberKey",te()],["messageHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function qD(){return gill.combineCodec(Ct(),Dt())}function jr(){return gill.getStructEncoder([["settingsMutArgs",G()],["transactionManager",gill.getOptionEncoder(Ie())]])}function Jr(){return gill.getStructDecoder([["settingsMutArgs",z()],["transactionManager",gill.getOptionDecoder(Ce())]])}function QD(){return gill.combineCodec(jr(),Jr())}function ft(){return gill.getStructEncoder([["pubkey",ee()],["permissions",Ue()],["role",gill.getU8Encoder()],["userAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getU8Encoder()]])}function St(){return gill.getStructDecoder([["pubkey",te()],["permissions",We()],["role",gill.getU8Decoder()],["userAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getU8Decoder()]])}function rM(){return gill.combineCodec(ft(),St())}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 oM(){return gill.combineCodec(ee(),te())}function Yr(){return gill.getStructEncoder([["authorityCreationArgs",Te()],["compressedProofArgs",C()]])}function Xr(){return gill.getStructDecoder([["authorityCreationArgs",le()],["compressedProofArgs",D()]])}function dM(){return gill.combineCodec(Yr(),Xr())}function Mt(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function Pt(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function gM(){return gill.combineCodec(Mt(),Pt())}function Or(){return gill.getStructEncoder([["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()],["proveByIndex",gill.getBooleanEncoder()]])}function Br(){return gill.getStructDecoder([["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()],["proveByIndex",gill.getBooleanDecoder()]])}function yM(){return gill.combineCodec(Or(),Br())}function At(){return gill.getStructEncoder([["rootIndex",gill.getU16Encoder()],["proveByIndex",gill.getBooleanEncoder()],["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()]])}function gt(){return gill.getStructDecoder([["rootIndex",gill.getU16Decoder()],["proveByIndex",gill.getBooleanDecoder()],["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()]])}function fM(){return gill.combineCodec(At(),gt())}function Ue(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function We(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function IM(){return gill.combineCodec(Ue(),We())}function C(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(kr())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function D(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(Lr())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function PM(){return gill.combineCodec(C(),D())}function Fr(){return gill.getStructEncoder([["memberKey",ee()],["userArgs",Qr()]])}function Gr(){return gill.getStructDecoder([["memberKey",te()],["userArgs",$r()]])}function bM(){return gill.combineCodec(Fr(),Gr())}function en(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function Et(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function UM(){return gill.combineCodec(en(),Et())}function V(){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 H(){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 LM(){return gill.combineCodec(V(),H())}function Z(){return gill.getStructEncoder([["domainConfigKey",gill.getAddressEncoder()],["verifyArgs",V()]])}function Y(){return gill.getStructDecoder([["domainConfigKey",gill.getAddressDecoder()],["verifyArgs",H()]])}function NM(){return gill.combineCodec(Z(),Y())}function ht(){return gill.getStructEncoder([["addressTreeInfo",Mt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function Rt(){return gill.getStructDecoder([["addressTreeInfo",Pt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function GM(){return gill.combineCodec(ht(),Rt())}function bt(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function vt(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function jM(){return gill.combineCodec(bt(),vt())}function G(){return gill.getStructEncoder([["accountMeta",dt()],["data",yt()]])}function z(){return gill.getStructDecoder([["accountMeta",ut()],["data",q()]])}function YM(){return gill.combineCodec(G(),z())}function _t(){return gill.getStructEncoder([["accountMeta",pt()],["data",yt()]])}function Ut(){return gill.getStructDecoder([["accountMeta",mt()],["data",q()]])}function eP(){return gill.combineCodec(_t(),Ut())}function Wt(){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(Ct())]])}function kt(){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(Dt())]])}function sP(){return gill.combineCodec(Wt(),kt())}function Lt(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(Rr())],["addressTableLookups",gill.getArrayEncoder(tn())]])}function Ot(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(br())],["addressTableLookups",gill.getArrayDecoder(rn())]])}function iP(){return gill.combineCodec(Lt(),Ot())}function tn(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function rn(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function AP(){return gill.combineCodec(tn(),rn())}function we(){return gill.getStructEncoder([["member",ee()],["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["role",Oe()],["delegatedTo",gill.getOptionEncoder(bt())],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function X(){return gill.getStructDecoder([["member",te()],["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["role",Be()],["delegatedTo",gill.getOptionDecoder(vt())],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function yP(){return gill.combineCodec(we(),X())}function Te(){return gill.getStructEncoder([["addressTreeInfo",Mt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function le(){return gill.getStructDecoder([["addressTreeInfo",Pt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function SP(){return gill.combineCodec(Te(),le())}function Ne(){return gill.getStructEncoder([["accountMeta",dt()],["data",we()]])}function Ve(){return gill.getStructDecoder([["accountMeta",ut()],["data",X()]])}function DP(){return gill.combineCodec(Ne(),Ve())}function Ie(){return gill.getStructEncoder([["accountMeta",pt()],["data",we()]])}function Ce(){return gill.getStructDecoder([["accountMeta",mt()],["data",X()]])}function hP(){return gill.combineCodec(Ie(),Ce())}function Qr(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([Ie()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([Ne()])]])]])}function $r(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([Ce()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([Ve()])]])]])}function _P(){return gill.combineCodec(Qr(),$r())}function UP(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function WP(e,n){return n.__kind===e}var Ye=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(Ye||{});function Oe(){return gill.getEnumEncoder(Ye)}function Be(){return gill.getEnumDecoder(Ye)}function OP(){return gill.combineCodec(Oe(),Be())}var Js=new Uint8Array([223,179,163,190,177,224,67,173]);function PE(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Js)}function Jp(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(ft())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]]),e=>({...e,discriminator:Js}))}function qs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(St())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function EE(){return gill.combineCodec(Jp(),qs())}function Zs(e){return gill.decodeAccount(e,qs())}async function hE(e,n,r){let s=await on(e,n,r);return gill.assertAccountExists(s),s}async function on(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Zs(s)}async function RE(e,n,r){let s=await qp(e,n,r);return gill.assertAccountsExist(s),s}async function qp(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Zs(t))}var eo=new Uint8Array([90,36,35,219,93,225,110,96]);function UE(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(eo)}function gm(){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(Ct())],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:eo}))}function to(){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(Dt())],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function WE(){return gill.combineCodec(gm(),to())}function ro(e){return gill.decodeAccount(e,to())}async function no(e,n,r){let s=await pm(e,n,r);return gill.assertAccountExists(s),s}async function pm(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return ro(s)}async function kE(e,n,r){let s=await mm(e,n,r);return gill.assertAccountsExist(s),s}async function mm(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>ro(t))}var co=new Uint8Array([105,23,173,2,197,255,80,87]);function BE(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(co)}function Um(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:co}))}function ao(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function wE(){return gill.combineCodec(Um(),ao())}function io(e){return gill.decodeAccount(e,ao())}async function uo(e,n,r){let s=await Wm(e,n,r);return gill.assertAccountExists(s),s}async function Wm(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return io(s)}async function NE(e,n,r){let s=await km(e,n,r);return gill.assertAccountsExist(s),s}async function km(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>io(t))}function y({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 _(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:_(r.value),role:Ao(r.value)?gill.upgradeRoleToSigner(s):s,...Ao(r.value)?{signer:r.value}:{}})}}function Ao(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var mo=new Uint8Array([8]);function rh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(mo)}function mn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:mo}))}function yo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function nh(){return gill.combineCodec(mn(),yo())}async function To(e,n){let r=n?.programAddress??u,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=y(a),o=T(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:mn().encode(c),programAddress:r})}function sh(e,n){let r=n?.programAddress??u,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=y(a),o=T(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:mn().encode(c),programAddress:r})}function oh(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:yo().decode(e.data)}}var Co=new Uint8Array([9]);function gh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Co)}function yn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsIndex",gill.getU128Encoder()],["configActions",gill.getArrayEncoder(ke())],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())],["compressedProofArgs",gill.getOptionEncoder(C())]]),e=>({...e,discriminator:Co}))}function Do(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsIndex",gill.getU128Decoder()],["configActions",gill.getArrayDecoder(Le())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["compressedProofArgs",gill.getOptionDecoder(D())]])}function ph(){return gill.combineCodec(yn(),Do())}async function Mo(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??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.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.authority.value||(t.authority.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(_(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:yn().encode(c),programAddress:r})}function mh(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??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=y(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:yn().encode(c),programAddress:r})}function yh(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Do().decode(e.data)}}var bo=new Uint8Array([19]);function Ch(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(bo)}function vo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(ke())],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())],["settingsMutArgs",G()],["compressedProofArgs",C()]]),e=>({...e,discriminator:bo}))}function _o(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(Le())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function Dh(){return gill.combineCodec(vo(),_o())}function Uo(e,n){let r=n?.programAddress??u,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=y(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:vo().encode(c),programAddress:r})}function Mh(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:_o().decode(e.data)}}var Lo=new Uint8Array([18]);function _h(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Lo)}function Tn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",C()],["settingsCreation",ht()],["userReadonlyArgs",Ie()],["settingsIndex",gill.getU128Encoder()]]),e=>({...e,discriminator:Lo}))}function Oo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",D()],["settingsCreation",Rt()],["userReadonlyArgs",Ce()],["settingsIndex",gill.getU128Decoder()]])}function Uh(){return gill.combineCodec(Tn(),Oo())}async function Bo(e,n){let r=n?.programAddress??u,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=y(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:Tn().encode(c),programAddress:r})}function Wh(e,n){let r=n?.programAddress??u,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=y(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:Tn().encode(c),programAddress:r})}function kh(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:Oo().decode(e.data)}}var Ko=new Uint8Array([0]);function Hh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ko)}function fn(){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",Te()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ko}))}function jo(){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",D()]])}function Fh(){return gill.combineCodec(fn(),jo())}async function Jo(e,n){let r=n?.programAddress??u,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=y(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:fn().encode(c),programAddress:r})}function Gh(e,n){let r=n?.programAddress??u,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=y(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:fn().encode(c),programAddress:r})}function zh(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:jo().decode(e.data)}}var Zo=new Uint8Array([4]);function Xh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Zo)}function xn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",C()],["member",en()],["role",Oe()],["userAccountCreationArgs",Te()],["linkWalletArgs",gill.getOptionEncoder(jr())]]),e=>({...e,discriminator:Zo}))}function Yo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",D()],["member",Et()],["role",Be()],["userAccountCreationArgs",le()],["linkWalletArgs",gill.getOptionDecoder(Jr())]])}function Qh(){return gill.combineCodec(xn(),Yo())}async function Xo(e,n){let r=n?.programAddress??u,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=y(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:xn().encode(c),programAddress:r})}function $h(e,n){let r=n?.programAddress??u,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=y({args:c}),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:xn().encode(c),programAddress:r})}function eR(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:Yo().decode(e.data)}}var $o=new Uint8Array([3]);function cR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode($o)}function Cn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:$o}))}function ec(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function aR(){return gill.combineCodec(Cn(),ec())}async function tc(e,n){let r=n?.programAddress??u,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=y(c),i=T(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Cn().encode({}),programAddress:r})}function iR(e,n){let r=n?.programAddress??u,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=y(c),i=T(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Cn().encode({}),programAddress:r})}function dR(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:ec().decode(e.data)}}var nc=new Uint8Array([5]);function TR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(nc)}function Mn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",C()],["createUserArgs",gill.getArrayEncoder(zr())]]),e=>({...e,discriminator:nc}))}function sc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",D()],["createUserArgs",gill.getArrayDecoder(Kr())]])}function lR(){return gill.combineCodec(Mn(),sc())}async function oc(e,n){let r=n?.programAddress??u,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=y(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Mn().encode(c),programAddress:r})}function fR(e,n){let r=n?.programAddress??u,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=y(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Mn().encode(c),programAddress:r})}function SR(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:sc().decode(e.data)}}var ic=new Uint8Array([17]);function ER(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ic)}function dc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMutArgs",G()],["compressedProofArgs",C()],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())]]),e=>({...e,discriminator:ic}))}function uc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMutArgs",z()],["compressedProofArgs",D()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function hR(){return gill.combineCodec(dc(),uc())}function Ac(e,n){let r=n?.programAddress??u,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=y(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:dc().encode(c),programAddress:r})}function RR(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:uc().decode(e.data)}}var mc=new Uint8Array([2]);function kR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(mc)}function yc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:mc}))}function Tc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function LR(){return gill.combineCodec(yc(),Tc())}function lc(e,n){let r=n?.programAddress??u,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=y({args:c}),o=T(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:yc().encode(c),programAddress:r})}function OR(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:Tc().decode(e.data)}}var Ic=new Uint8Array([1]);function GR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ic)}function En(){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(Yr())]]),e=>({...e,discriminator:Ic}))}function Cc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))],["newAuthorityArgs",gill.getOptionDecoder(Xr())]])}function zR(){return gill.combineCodec(En(),Cc())}async function KR(e,n){let r=n?.programAddress??u,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=y(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:En().encode(c),programAddress:r})}function Dc(e,n){let r=n?.programAddress??u,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=y(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:En().encode(c),programAddress:r})}function jR(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:Cc().decode(e.data)}}var Ec=new Uint8Array([6]);function $R(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ec)}function hc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Ne()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ec}))}function Rc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Ve()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",D()]])}function eb(){return gill.combineCodec(hc(),Rc())}function bc(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i=y({args:c}),o=T(r);return Object.freeze({accounts:[o(t.authority),...i],data:hc().encode(c),programAddress:r})}function tb(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:Rc().decode(e.data)}}var Uc=new Uint8Array([7]);function ib(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Uc)}function Wc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Ne()],["secp256r1VerifyArgs",gill.getOptionEncoder(V())],["delegateTo",gill.getOptionEncoder(bt())],["oldSettingsMutArgs",gill.getOptionEncoder(G())],["newSettingsMutArgs",gill.getOptionEncoder(G())],["compressedProofArgs",C()]]),e=>({...e,discriminator:Uc}))}function kc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Ve()],["secp256r1VerifyArgs",gill.getOptionDecoder(H())],["delegateTo",gill.getOptionDecoder(vt())],["oldSettingsMutArgs",gill.getOptionDecoder(z())],["newSettingsMutArgs",gill.getOptionDecoder(z())],["compressedProofArgs",D()]])}function db(){return gill.combineCodec(Wc(),kc())}function Lc(e,n){let r=n?.programAddress??u,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=y(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:Wc().encode(c),programAddress:r})}function ub(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===u?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:kc().decode(e.data)}}var wc=new Uint8Array([32]);function lb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(wc)}function Nc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Tt()],["compressedProofArgs",C()],["settingsCreationArgs",ht()]]),e=>({...e,discriminator:wc}))}function Vc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",lt()],["compressedProofArgs",D()],["settingsCreationArgs",Rt()]])}function fb(){return gill.combineCodec(Nc(),Vc())}function Hc(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.authority),...i],data:Nc().encode(c),programAddress:r})}function Sb(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:Vc().decode(e.data)}}var zc=new Uint8Array([31]);function Eb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(zc)}function Kc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",we()],["compressedProofArgs",C()],["userCreationArgs",Te()]]),e=>({...e,discriminator:zc}))}function jc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",X()],["compressedProofArgs",D()],["userCreationArgs",le()]])}function hb(){return gill.combineCodec(Kc(),jc())}function Jc(e,n){let r=n?.programAddress??u,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=y(a),o=T(r);return Object.freeze({accounts:[o(t.authority),...i],data:Kc().encode(c),programAddress:r})}function Rb(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:jc().decode(e.data)}}var Zc=new Uint8Array([29]);function Lb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Zc)}function hn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())]]),e=>({...e,discriminator:Zc}))}function Yc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function Ob(){return gill.combineCodec(hn(),Yc())}async function Bb(e,n){let r=n?.programAddress??u,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(_(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(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:hn().encode(c),programAddress:r})}function Xc(e,n){let r=n?.programAddress??u,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=y(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:hn().encode(c),programAddress:r})}function wb(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Yc().decode(e.data)}}var ea=new Uint8Array([27]);function Kb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ea)}function ta(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())],["settingsMutArgs",G()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ea}))}function ra(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function jb(){return gill.combineCodec(ta(),ra())}function na(e,n){let r=n?.programAddress??u,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=y(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:ta().encode(c),programAddress:r})}function Jb(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:ra().decode(e.data)}}var aa=new Uint8Array([30]);function ev(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(aa)}function Rn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["compressedTokenAccount",gill.getOptionEncoder(xt())],["compressedProofArgs",gill.getOptionEncoder(C())],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())]]),e=>({...e,discriminator:aa}))}function ia(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["compressedTokenAccount",gill.getOptionDecoder(It())],["compressedProofArgs",gill.getOptionDecoder(D())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function tv(){return gill.combineCodec(Rn(),ia())}async function rv(e,n){let r=n?.programAddress??u,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(_(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(_(t.source.value)),gill.getAddressEncoder().encode(_(t.tokenProgram.value)),gill.getAddressEncoder().encode(_(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(_(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(_(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(_(t.destination.value)),gill.getAddressEncoder().encode(_(t.tokenProgram.value)),gill.getAddressEncoder().encode(_(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(_(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(_(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(_(t.mint.value))]})),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=y(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:Rn().encode(c),programAddress:r})}function da(e,n){let r=n?.programAddress??u,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=y(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:Rn().encode(c),programAddress:r})}function nv(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===u?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:ia().decode(e.data)}}var Aa=new Uint8Array([28]);function uv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Aa)}function bn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["compressedTokenAccount",gill.getOptionEncoder(xt())],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())],["settingsMutArgs",G()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Aa}))}function ga(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["compressedTokenAccount",gill.getOptionDecoder(It())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function Av(){return gill.combineCodec(bn(),ga())}async function gv(e,n){let r=n?.programAddress??u,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(_(t.source.value)),gill.getAddressEncoder().encode(_(t.tokenProgram.value)),gill.getAddressEncoder().encode(_(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(_(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(_(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(_(t.destination.value)),gill.getAddressEncoder().encode(_(t.tokenProgram.value)),gill.getAddressEncoder().encode(_(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(_(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(_(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(_(t.mint.value))]})),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=y(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:bn().encode(c),programAddress:r})}function pa(e,n){let r=n?.programAddress??u,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=y(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:bn().encode(c),programAddress:r})}function pv(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===u?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 Ta=new Uint8Array([13]);function xv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ta)}function la(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(V())]]),e=>({...e,discriminator:Ta}))}function fa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(H())]])}function Iv(){return gill.combineCodec(la(),fa())}function Sa(e,n){let r=n?.programAddress??u,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=y(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:la().encode(c),programAddress:r})}function Cv(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:fa().decode(e.data)}}var Ca=new Uint8Array([23]);function bv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ca)}function Da(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(V())],["settingsMutArgs",G()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ca}))}function Ma(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(H())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function vv(){return gill.combineCodec(Da(),Ma())}function Pa(e,n){let r=n?.programAddress??u,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=y(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:Da().encode(c),programAddress:r})}function _v(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ma().decode(e.data)}}var Ra=new Uint8Array([10]);function wv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ra)}function ba(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Wt()],["secp256r1VerifyArgs",gill.getOptionEncoder(V())]]),e=>({...e,discriminator:Ra}))}function va(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",kt()],["secp256r1VerifyArgs",gill.getOptionDecoder(H())]])}function Nv(){return gill.combineCodec(ba(),va())}function _a(e,n){let r=n?.programAddress??u,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=y(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:ba().encode(c),programAddress:r})}function Vv(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===u?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:va().decode(e.data)}}var ka=new Uint8Array([20]);function Jv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ka)}function La(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Wt()],["secp256r1VerifyArgs",gill.getOptionEncoder(V())],["settingsReadonlyArgs",_t()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ka}))}function Oa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",kt()],["secp256r1VerifyArgs",gill.getOptionDecoder(H())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",D()]])}function qv(){return gill.combineCodec(La(),Oa())}function Ba(e,n){let r=n?.programAddress??u,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=y(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:La().encode(c),programAddress:r})}function Zv(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Oa().decode(e.data)}}var Va=new Uint8Array([14]);function r_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Va)}function Ha(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(V())]]),e=>({...e,discriminator:Va}))}function Fa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(H())]])}function n_(){return gill.combineCodec(Ha(),Fa())}function Ga(e,n){let r=n?.programAddress??u,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=y(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:Ha().encode(c),programAddress:r})}function s_(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Fa().decode(e.data)}}var ja=new Uint8Array([24]);function A_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ja)}function Ja(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(V())],["settingsMutArgs",G()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ja}))}function qa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(H())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function g_(){return gill.combineCodec(Ja(),qa())}function Za(e,n){let r=n?.programAddress??u,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=y(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:Ja().encode(c),programAddress:r})}function p_(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:qa().decode(e.data)}}var Qa=new Uint8Array([12]);function S_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Qa)}function $a(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Qa}))}function ei(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function x_(){return gill.combineCodec($a(),ei())}function ti(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=y({args:c}),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:$a().encode(c),programAddress:r})}function I_(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:ei().decode(e.data)}}var si=new Uint8Array([22]);function h_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(si)}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:si}))}function ci(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function R_(){return gill.combineCodec(oi(),ci())}function ai(e,n){let r=n?.programAddress??u,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=y({args:c}),o=T(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:oi().encode(c),programAddress:r})}function b_(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:ci().decode(e.data)}}var ui=new Uint8Array([11]);function O_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ui)}function Ai(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(V())]]),e=>({...e,discriminator:ui}))}function gi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(H())]])}function B_(){return gill.combineCodec(Ai(),gi())}function pi(e,n){let r=n?.programAddress??u,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=y(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:Ai().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===u?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 Ti=new Uint8Array([21]);function K_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ti)}function li(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(V())],["settingsReadonlyArgs",_t()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ti}))}function fi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(H())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",D()]])}function j_(){return gill.combineCodec(li(),fi())}function Si(e,n){let r=n?.programAddress??u,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=y(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:li().encode(c),programAddress:r})}function J_(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:fi().decode(e.data)}}var Ci=new Uint8Array([15]);function $_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ci)}function Di(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Ci}))}function Mi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function eU(){return gill.combineCodec(Di(),Mi())}function Pi(e,n){let r=n?.programAddress??u,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=y({}),i=T(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:Di().encode({}),programAddress:r})}function tU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:Mi().decode(e.data)}}var Ri=new Uint8Array([25]);function aU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ri)}function bi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:Ri}))}function vi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function iU(){return gill.combineCodec(bi(),vi())}function _i(e,n){let r=n?.programAddress??u,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=y({args:c}),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:bi().encode(c),programAddress:r})}function dU(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:vi().decode(e.data)}}var ki=new Uint8Array([16]);function TU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ki)}function Li(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Lt()],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())]]),e=>({...e,discriminator:ki}))}function Oi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Ot()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function lU(){return gill.combineCodec(Li(),Oi())}function Bi(e,n){let r=n?.programAddress??u,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=y(a),o=T(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Li().encode(c),programAddress:r})}function fU(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Oi().decode(e.data)}}var Vi=new Uint8Array([26]);function PU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Vi)}function Hi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Lt()],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())],["settingsMutArgs",G()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Vi}))}function Fi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Ot()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",z()],["compressedProofArgs",D()]])}function EU(){return gill.combineCodec(Hi(),Fi())}function Gi(e,n){let r=n?.programAddress??u,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=y(a),o=T(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Hi().encode(c),programAddress:r})}function hU(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===u?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Fi().decode(e.data)}}var u="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",ex=(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))(ex||{});function AW(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 tx=(m=>(m[m.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",m[m.ChangeConfig=1]="ChangeConfig",m[m.ChangeConfigCompressed=2]="ChangeConfigCompressed",m[m.CreateCompressedWallet=3]="CreateCompressedWallet",m[m.CreateDomainConfig=4]="CreateDomainConfig",m[m.CreateDomainUserAccount=5]="CreateDomainUserAccount",m[m.CreateGlobalCounter=6]="CreateGlobalCounter",m[m.CreateUserAccounts=7]="CreateUserAccounts",m[m.DecompressSettingsAccount=8]="DecompressSettingsAccount",m[m.DisableDomainConfig=9]="DisableDomainConfig",m[m.EditDomainConfig=10]="EditDomainConfig",m[m.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",m[m.EditUserDelegate=12]="EditUserDelegate",m[m.MigrateCompressedSettings=13]="MigrateCompressedSettings",m[m.MigrateCompressedUsers=14]="MigrateCompressedUsers",m[m.NativeTransferIntent=15]="NativeTransferIntent",m[m.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",m[m.TokenTransferIntent=17]="TokenTransferIntent",m[m.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",m[m.TransactionBufferClose=19]="TransactionBufferClose",m[m.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",m[m.TransactionBufferCreate=21]="TransactionBufferCreate",m[m.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",m[m.TransactionBufferExecute=23]="TransactionBufferExecute",m[m.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",m[m.TransactionBufferExtend=25]="TransactionBufferExtend",m[m.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",m[m.TransactionBufferVote=27]="TransactionBufferVote",m[m.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",m[m.TransactionExecute=29]="TransactionExecute",m[m.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",m[m.TransactionExecuteSync=31]="TransactionExecuteSync",m[m.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",m))(tx||{});function gW(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 nx=6e3,sx=6001,ox=6002,cx=6003,ax=6004,ix=6005,dx=6006,ux=6007,Ax=6008,gx=6009,px=6010,mx=6011,yx=6012,Tx=6013,lx=6014,fx=6015,Sx=6016,xx=6017,Ix=6018,Cx=6019,Dx=6020,Mx=6021,Px=6022,Ex=6023,hx=6024,Rx=6025,bx=6026,vx=6027,_x=6028,Ux=6029,Wx=6030,kx=6031,Lx=6032,Ox=6033,Bx=6034,wx=6035,Nx=6036,Vx=6037,Hx=6038,Fx=6039,Gx=6040,zx=6041,Kx=6042,jx=6043,Jx=6044,qx=6045,Zx=6046,Yx=6047,Xx=6048,Qx=6049,$x=6050,eI=6051,tI=6052,rI=6053,nI=6054,zi;process.env.NODE_ENV!=="production"&&(zi={[Wx]:"This member is already delegated to another wallet.",[ux]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[$x]:"The domain configuration account is disabled. Please contact support or try again later.",[eI]:"Missing domain configuration account.",[px]:"Duplicate public keys detected among members. Each member must have a unique key.",[gx]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[Dx]:"No members provided. A multisig wallet must contain at least one member.",[Ix]:"Expected a User with Administrator role for this instruction.",[Ax]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[Sx]:"Expected a User with Transaction Manager role for this instruction.",[Fx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[Gx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[zx]:"Declared buffer size does not match the actual serialized size.",[Ox]:"Not enough members with vote permission to meet the approval threshold.",[kx]:"At least one signer with execute permission is required to proceed.",[Lx]:"At least one signer with initiate permission is required to perform this action.",[Rx]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[nI]:"Address Tree supplied is not part of the whitelisted address trees",[Cx]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[vx]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Hx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[Bx]:"Only delegated members are allowed for this transaction.",[hx]:"Unexpected number of accounts provided for this instruction.",[Tx]:"User with Permanent Member role requires a must have a delegated wallet.",[sx]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[ax]:"The extracted public key has an invalid length or encoding.",[nx]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[cx]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[Qx]:"The specified slot number is not recent.",[Yx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[Px]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[xx]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[fx]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[Ex]:"Malformed transaction message: structure or formatting does not match the expected layout.",[bx]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[ix]:"The extracted WebAuthn signed message payload is malformed.",[qx]:"An input string exceeds the maximum allowed character length.",[tI]:"This member is not registered under the provided domain configuration.",[_x]:"A required account is missing from the instruction context.",[Ux]:"User mutation arguments are required when performing add or remove delegate operations.",[Zx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[Nx]:"No valid signer found in this transaction.",[yx]:"Only one permanent member is allowed per wallet.",[lx]:"Only one transaction manager is allowed per wallet.",[rI]:"The given origin index is not in the whitelisted origins.",[mx]:"Permanent members cannot be removed from a wallet.",[Jx]:"Writable CPI calls to protected accounts are not permitted.",[dx]:"The rpIdHash extracted from the signed message does not match the expected value.",[ox]:"The signature index provided is out of bounds for the secp256r1 instruction.",[Xx]:"The specified slot number was not found in the provided slot history.",[Mx]:"Too many members: a maximum of 4 members are supported.",[Kx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[jx]:"This transaction has not yet reached the required approval threshold.",[Vx]:"Only the transaction creator or rent payer may close this transaction buffer.",[wx]:"Member is not part of the expected signers for this transaction."});function fW(e){return process.env.NODE_ENV!=="production"?zi[e]:"Error message not available in production bundles."}function SW(e,n,r){return gill.isProgramError(e,n,u,r)}async function vW({admin:e,addressTree:n}){return To({payer:e,addressTree:n,remainingAccounts:[]})}var Ht={Ed25519:1,Secp256r1:2};var De={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Pe=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(De).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var Un=33,Ee=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!==Un)throw new Error(`Invalid public key length, expected ${Un} 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===Un)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 Ee{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 cI(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function aI(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var ji=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(cI())],["addressTableLookups",gill.getArrayCodec(aI())]]);function Ji(e){return ji.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 qi(e){let n=ji.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:u,staticAccounts:n.accountKeys,version:0}}stateless_js.featureFlags.version=stateless_js.VERSION.V2;var K={};function Zi(){if(!K.solanaRpcEndpoint)throw new Error("Rpc is not initialized yet.");return K.solanaRpcEndpoint}function Qe(){if(!K.lightProtocolRpc)throw new Error("Rpc is not initialized yet");return K.lightProtocolRpc}function re(){if(!K.solanaRpc)throw new Error("Rpc is not initialized yet");return K.solanaRpc}function Yi(){if(!K.sendAndConfirm)throw new Error("Rpc is not initialized yet.");return K.sendAndConfirm}function Xi(){if(!K.computeEstimate)throw new Error("Rpc is not initialized yet");return K.computeEstimate}function kn(){return K.jitoTipsConfig?K.jitoTipsConfig:{blockEngineUrl:"https://mainnet.block-engine.jito.wtf/api/v1",getJitoTipsUrl:"https://bundles.jito.wtf/api/v1/bundles/tip_floor",priority:"landed_tips_75th_percentile"}}function ek(){Object.keys(K).forEach(e=>{K[e]=void 0;});}function tk({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){K.solanaRpcEndpoint=e,K.lightProtocolRpc=stateless_js.createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=gill.createSolanaClient({urlOrMoniker:e});K.solanaRpc=t,K.sendAndConfirm=c,K.computeEstimate=programs.estimateComputeUnitLimitFactory({rpc:t}),K.jitoTipsConfig=s??null;}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(u.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 Qe().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 pr(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await Qe().getCompressedAccount(e);return s&&n?.set(e.toString(),s),s}}async function ed(e,n,r){let s=e.toString()+(n?.mint?n?.mint.toString():""),t=r?.get(s);if(t)return t;{let c=await Qe().getCompressedTokenAccountsByOwner(e,n);return c&&r?.set(s,c),c}}async function Gt(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await re().getAccountInfo(e,{encoding:"base64"}).send();return s&&n?.set(e.toString(),s),s}}async function ue(e,n){let s=(await Promise.all(e.map(async t=>pr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new Error("Unable to find compressed account.");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 ie(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,A)=>({treeInfo:n[A],root:r[A],rootIndex:s[A],address:d.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((d,A)=>({addressTreeInfo:a[A],outputStateTreeIndex:i,address:d.address,type:d.type}))}function se(e,n,r,s,t,c,a){let i=[];for(let A=0;A<n.length;A++)i.push({treeInfo:n[A],rootIndex:s[A],leafIndex:r[A],proveByIndex:t[A],hash:c[A].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((A,g)=>({data:a.decode(A.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(A.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Se(e,n,r,s,t){let c=null,a=null,i=null,o=new W;if(e){await o.addSystemAccounts();let{address:d}=await ne(n,r),A=(await ue([{address:d,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[A.leafIndex],leaves:[],treeInfos:[A.treeInfo],proveByIndices:[A.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([A],[]);let g=o.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:A.hash}],[]).stateTrees;if(!g)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(A.address),treeInfo:g.packedTreeInfos[0]},data:q().decode(A.data?.data)},a={accountMeta:{address:new Uint8Array(A.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:q().decode(A.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:o,settingsMutArgs:a}}async function O(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await Qe().getValidityProofV0(e,n)}catch(c){if(console.error(`Attempt ${t}, Get Validity Proof failed. ${c}`),t++,t>=r)throw new Error(`Failed to get validity proof after ${r} attempts: ${c}`);await new Promise(a=>setTimeout(a,s));}throw new Error(`Failed to get validity proof after ${r} attempts`)}async function xe(){return (await mr()).length-1}var Ln;async function mr(){if(!Ln){let{data:e}=await uo(re(),await td());Ln=e.whitelistedAddressTrees;}return Ln}async function yr(e,n,r){let s=await lI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function lI(e,n,r){let{address:s}=await L(e,n),t=await pr(s,r);return t?.data?.data?X().decode(t.data.data):null}async function On(e,n,r){let s=await fI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function fI(e,n,r){try{let{address:s}=await ne(e,n),t=await pr(s,r);if(!t?.data?.data)throw new Error("No compressed settings account found.");let c=q().decode(t.data.data);if(c.data.__option==="None")throw new Error("No compressed settings account found.");return {...c.data.value,isCompressed:!0}}catch{let s=await on(re(),await oe(e));return s.exists?{...s.data,isCompressed:false}:null}}async function Bn(e){let n=await mr();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function Mk(e){let r=(await mr()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function ne(e,n=0){let r=await Bn(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(u)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function L(e,n=0){let r=await Bn(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("user")),e instanceof Ee?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(u.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function et({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha2_js.sha256(new Uint8Array(gill.getUtf8Encoder().encode(n)));else throw new Error("RpId not found.");if(!e)throw new Error("RpIdHash not found.");let[r]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("domain_config"),e]});return r}async function cd(){let[e]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function td(){let[e]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function ad(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),n instanceof Ee?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return s}async function Me(e){let[n]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return n}async function oe(e){let[n]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function Wk(e){let n=await oe(e);return await Me(n)}async function kk(){let[e]=await gill.getProgramDerivedAddress({programAddress:u,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}function lr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function CI(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 dd(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 ud(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 Ad(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,A=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||A.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(A)),b=(l>p?nist_js.p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),S=CI(b);return new Uint8Array([...g,...S])}function fr(e){return new Uint8Array([...new Uint8Array(Re(e.response.authenticatorData)),...sha2_js.sha256(new Uint8Array(Re(e.response.clientDataJSON)))])}function Xk(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 Qk(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 $k(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Re(n)),c=JSON.parse(new TextDecoder().decode(Re(r))),a=dd(c),i=Ad(new Uint8Array(Re(s))),o=await et({rpIdHash:t.subarray(0,32)});return new M(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Re(r)),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(gill.getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:wn(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}async function eL(e,n){let{data:r}=await os(re(),e),t=ud(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 wn(e,n,r){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...gill.getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function tL(e){return sha2_js.sha256(new Uint8Array(gill.getUtf8Encoder().encode(JSON.stringify(e))))}function rL(e){return Nn(e.data.payload.authResponse)}function nL(e,n,r,s){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...wn(n,r,s)]))}async function sL(e,n,r,s,t,c){let a;if(!t||!c){let o=(await re().getAccountInfo(gill.address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed"}).send()).value?.data;if(!o)throw new Error("Unable to fetch slot sysvar");let d=gill.getBase64Encoder().encode(o[0]);c=gill.getU64Decoder().decode(d.subarray(8,16)).toString(),a=d.subarray(16,48),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(Re(e.transactionMessageBytes)):e.transactionMessageBytes),...a,...wn(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:i}}function Nn(e){return sha2_js.sha256(fr(e))}function oL(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Re(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 Vn(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)||8e5;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 Td(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 ld(e,n){if(e.length===0)throw new Error("Bundle is empty.");for(let c=0;c<e.length;c++){if(e[c].length>1644)throw new Error(`Transaction ${c} exceeds maximum length, ${e[c].length}. Retry again.`);console.log(`Transaction ${c} length: ${e[c].length}`);}let r=await 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:[]}))}]})});if(!r.ok)throw console.error(await r.json()),new Error("Failed to simulate bundle");let{result:s,error:t}=await r.json();if(!s||t)throw console.error(t??s),new Error(`Unable to simulate bundle: ${JSON.stringify(t??s)}`);if(typeof s.value.summary!="string"&&s.value.summary.failed){let{TransactionFailure:c}=s.value.summary.failed.error,[,a]=c;throw console.error(t??s),new Error(`Simulation failed: ${a}`)}return s.value.transactionResults.map(c=>c.unitsConsumed)}function j(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}):null,t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,a=r?.authData&&r.verifyArgs?.clientDataJson?fr(r.authResponse):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function rt(e){if(e instanceof Ee)return {keyType:Ht.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Ht.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function yd(e){return e instanceof M?e.toString():e.address.toString()}function me(e){let n=new Set,r=[];for(let s of e)n.has(yd(s))||(r.push(s),n.add(yd(s)));if(r.filter(s=>s instanceof M).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function fd({payer:e,tipAmount:n}){let r=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],s=r[Math.floor(Math.random()*r.length)];return programs.getTransferSolInstruction({source:e,destination:gill.address(s),amount:n})}async function CL(e){let n=await Vn(e,true),r=await ld(n.map(gill.getBase64EncodedWireTransaction),Zi()),s=await Vn(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await oC(s.map(gill.getBase64EncodedWireTransaction))}async function DL({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([Xi()(c),Td(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 Yi()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}async function oC(e,n=10,r=1e3,s=kn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/bundles`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})});if(a.status===429&&c<n){await new Promise(o=>setTimeout(o,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);return i.result}throw new Error("Failed to send bundle after retries.")}async function ML(e,n=30,r=3e3,s=kn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/getBundleStatuses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});if(a.status===429&&c<n){await new Promise(d=>setTimeout(d,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);let o=i.result;if(o.value.length){let d=o.value[0];if(d.confirmation_status==="confirmed"||d.confirmation_status==="finalized")return d.transactions[d.transactions.length-1]}if(c<n){await new Promise(d=>setTimeout(d,r));continue}}throw new Error("Failed to get bundle status after retries.")}function PL(e,n){if(n.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:r}=n.members.find(i=>xd(i.pubkey)===e)??{};if(!r)throw new Error("No permissions found for the current member.");let s=Pe.has(r,De.InitiateTransaction),t=Pe.has(r,De.VoteTransaction),c=Pe.has(r,De.ExecuteTransaction);if(s&&t&&c)return {};if(!t||!c)throw new Error("Signer lacks the required Vote/Execute permissions.");let a=n.members.find(i=>i.role===2);if(!a)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:gill.address(xd(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function EL({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await yr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return cC(n,c.transactionManagerUrl.value,e,s)}function cC(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 i=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json();if("error"in i)throw new Error(i.error);return i.signatures.map(o=>({[e]:gill.getBase58Encoder().encode(o)}))}}}function xd(e){return e.keyType===Ht.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}function hL(e){let n=e.map(c=>ke().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 RL(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=Le().read(e,n);t[c]=a[0],n=a[1];}if(n!==e.length)throw new Error(`Trailing bytes: ${e.length-n}`);return t}async function GL({payer:e,rpId:n,origins:r,authority:s}){let t=await et({rpId:n}),c=new W;await c.addSystemAccounts();let a=await xe(),{address:i,addressTree:o}=await L(s.address,a),d=[{address:i,tree:o,queue:o,type:"User"}],A=await O([],d),g=(await ie(c,A.treeInfos,A.roots,A.rootIndices,d))[0],{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),f=v(A,l);return await Jo({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:f,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function $L({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 ne(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await L(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await ue(a,t):[],o=await xe(),{address:d,addressTree:A}=await L(r.member,o),g=[{address:d,type:"User",tree:A,queue:A}],p=await O(i,g),l=null,f=null,b=i.filter(k=>k.type==="Settings"),S=i.filter(k=>k.type==="User");b.length&&(l=se(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),b,q())[0]),S.length&&(f=se(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),S,X())[0]);let I=await ie(c,p.treeInfos.slice(i.length),p.roots.slice(i.length),p.rootIndices.slice(i.length),g),{remainingAccounts:P,systemOffset:x}=c.toAccountMetas(),U=v(p,x);return await Xo({payer:n,authority:e,compressedProofArgs:U,member:Et().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:P})}async function nO({payer:e}){let n=await cd();return tc({payer:e,globalCounter:n})}async function aO({admin:e,rpId:n,disable:r}){let s=await et({rpId:n});return lc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function mO({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new W;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:A,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Hc({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:A})}async function IO({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new W;await t.addSystemAccounts();let{address:c,addressTree:a}=await L(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:A,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Jc({compressedProofArgs:p,args:e,authority:n,userCreationArgs:d,remainingAccounts:A})}function iC(e,n,r,s){let t=dC(e,n),c=uC(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 dC(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 uC(e,n){return n<e.header.numSignerAccounts}async function xr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=qi(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:iC(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 A=o[d];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:A,role:gill.AccountRole.WRITABLE});}for(let d of i.readonlyIndexes){let A=o[d];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:A,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 nt=33,st=64,Kn=14,lC=2,fC=gill.address("Secp256r1SigVerify1111111111111111111111111");function SC(){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 xC(){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 Ed(){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=xC();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=Kn;let a=[];for(let i=0;i<r;i++){let o=gill.fixDecoderSize(gill.getBytesDecoder(),nt).decode(e,n);n+=nt;let d=gill.fixDecoderSize(gill.getBytesDecoder(),st).decode(e,n);n+=st;let A=t[i].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),A).decode(e,n);n+=A,a.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function hd(){return gill.createEncoder({getSizeFromValue:e=>{let n=Kn*e.offsets.length,r=e.payload.reduce((s,t)=>s+nt+st+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=SC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=gill.fixEncoderSize(gill.getBytesEncoder(),nt).write(t.publicKey,n,r),r=gill.fixEncoderSize(gill.getBytesEncoder(),st).write(t.signature,n,r),r=gill.getBytesEncoder().write(t.message,n,r);return r}})}function OO(){return gill.combineCodec(hd(),Ed())}function w(e,n){let r=e.length,s=lC+r*Kn,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],A=s,g=A+nt,p=g+st;t.push({publicKeyOffset:A,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),s+=nt+st+d.length;}let c=n?.programAddress??fC,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:hd().encode(a)}}function BO(e){return {programAddress:e.programAddress,accounts:{},data:Ed().decode(e.data)}}async function Rd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let d=await Me(e),{accountMetas:A,addressLookupTableAccounts:g}=await xr({transactionMessageBytes:r,walletAddress:d,additionalSigners:a,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(w(c)),p.push(o?_i({transactionBuffer:n,payer:s.address,remainingAccounts:A,settingsKey:e}):Pi({transactionBuffer:n,payer:s.address,settings:e})),i&&p.push(fd({payer:s,tipAmount:i})),{instructions:p,addressLookupTableAccounts:g}}async function bd({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:d}){let A=me(s),g=await oe(e),p=await Me(g),[{accountMetas:l,addressLookupTableAccounts:f,transactionMessage:b},{settingsMutArgs:S,proof:I,packedAccounts:P}]=await Promise.all([xr({transactionMessageBytes:r,walletAddress:p,additionalSigners:A.filter(Q=>!(Q instanceof M)),addressesByLookupTableAddress:c}),Se(i,e,n,o,d)]);P.addPreAccounts(l);let x=A.filter(Q=>Q instanceof M),U=[];for(let Q of x){let ce=a.length,{domainConfig:ye,verifyArgs:be,signature:ve,publicKey:F,message:qe}=j(Q,ce);qe&&ve&&F&&a.push({message:qe,signature:ve,publicKey:F}),ye&&(P.addPreAccounts([{address:ye,role:gill.AccountRole.READONLY}]),be?.__option==="Some"&&U.push({domainConfigKey:ye,verifyArgs:be.value}));}let{remainingAccounts:k,systemOffset:J}=P.toAccountMetas(),N=[];a.length>0&&N.push(w(a));let $=CC(b,l);if(i){if(!t||!S)throw new Error("Payer not found or proof args is missing.");let Q=v(I,J);N.push(Gi({secp256r1VerifyArgs:U,transactionMessage:$,settingsMutArgs:S,compressedProofArgs:Q,payer:t,remainingAccounts:k}));}else N.push(Bi({secp256r1VerifyArgs:U,settings:g,transactionMessage:$,remainingAccounts:k}));return {instructions:N,addressLookupTableAccounts:f}}function CC(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 aB({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=me(s),d=await oe(e),A=await Me(d),{packedAccounts:g,proof:p,settingsMutArgs:l}=await Se(i,e,n,false,t),f=[],b=[];for(let x of o)if(x instanceof M){let U=f.length,{domainConfig:k,verifyArgs:J,signature:N,publicKey:$,message:Q}=j(x,U);Q&&N&&$&&f.push({message:Q,signature:N,publicKey:$}),k&&(g.addPreAccounts([{address:k,role:gill.AccountRole.READONLY}]),J?.__option==="Some"&&b.push({domainConfigKey:k,verifyArgs:J.value}));}else g.addPreAccounts([{address:x.address,role:gill.AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:S,systemOffset:I}=g.toAccountMetas(),P=[];if(f.length>0&&P.push(w(f)),i){if(!a||!l)throw new Error("Payer not found or proof args is missing.");let x=v(p,I);P.push(na({amount:c,settingsMutArgs:l,compressedProofArgs:x,payer:a,secp256r1VerifyArgs:b,source:A,destination:r,remainingAccounts:S}));}else P.push(Xc({amount:c,secp256r1VerifyArgs:b,source:A,destination:r,settings:d,remainingAccounts:S}));return P}var Wd=gill.address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),kd=gill.address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti");async function IB({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,compressed:d=false}){let A=me(t),g=await oe(e),p=await Me(g),[l,[f],b,[S],[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())})]),[P,x,U]=await Promise.all([Gt(b,c),Gt(l,c),vC(d,e,n,c)]),k=!!P.value,J=!!x.value,N=J?programs.getTokenDecoder().decode(gill.getBase64Encoder().encode(x.value.data[0])).amount:BigInt(0),$=BigInt(0);if(N<BigInt(a)){let Ae=await Gt(f,c);$=Ae.value?BigInt(UC(new Uint8Array(gill.getBase64Encoder().encode(Ae.value.data[0])))?.amount.toNumber()??0):BigInt(0);}let Q=k?b:void 0,ce=k?void 0:S,ye=J&&($>BigInt(0)||N+$<BigInt(a)||!!ce)||!J&&!!Q,be=!!ce,[{parsed:ve,compressedAccount:F},qe]=await Promise.all([bC(p,s,N,$,BigInt(a),c),RC(ye,I,c)]),ct=null,m=null,ae=new W;if(qe&&ae.addPreAccounts([{address:s,role:gill.AccountRole.WRITABLE}]),U||F){await ae.addSystemAccounts();let Ae=[];if(F&&Ae.push({hash:F.hash,tree:F.treeInfo.tree,queue:F.treeInfo.queue,data:F.data,address:F.address}),U&&Ae.push(U),m=await O(Ae,[]),U){let _e=F?1:0;ct=se(ae,m.treeInfos.slice(_e),m.leafIndices.slice(_e),m.rootIndices.slice(_e),m.proveByIndices.slice(_e),Ae.slice(_e),q())[0];}}let Mr=F&&ve&&m?gill.some({amount:ve.amount.toNumber(),merkleContext:{leafIndex:F.leafIndex,merkleTreePubkeyIndex:ae.insertOrGet(F.treeInfo.tree.toString()),queuePubkeyIndex:ae.insertOrGet(F.treeInfo.queue.toString()),proveByIndex:F.proveByIndex},rootIndex:m.rootIndices[0],version:_C(F.data?.discriminator)}):gill.none(),B=[],Ze=[];for(let Ae of A)if(Ae instanceof M){let _e=B.length,{domainConfig:Pr,verifyArgs:Qn,signature:$n,publicKey:es,message:ts}=j(Ae,_e);ts&&$n&&es&&B.push({message:ts,signature:$n,publicKey:es}),Pr&&(ae.addPreAccounts([{address:Pr,role:gill.AccountRole.READONLY}]),Qn?.__option==="Some"&&Ze.push({domainConfigKey:Pr,verifyArgs:Qn.value}));}else ae.addPreAccounts([{address:Ae.address,role:gill.AccountRole.READONLY_SIGNER,signer:Ae}]);let{remainingAccounts:Yn,systemOffset:Kd}=ae.toAccountMetas(),jt=[];B.length>0&&jt.push(w(B));let Xn=v(m,Kd);if(d){if(!ct)throw new Error("Payer not found or proof args is missing.");jt.push(pa({amount:a,settingsMutArgs:ct,compressedProofArgs:Xn,payer:i,secp256r1VerifyArgs:Ze,source:p,destination:r,sourceCtokenTokenAccount:f,sourceSplTokenAccount:l,destinationCtokenTokenAccount:ce,destinationSplTokenAccount:Q,mint:s,tokenProgram:o,remainingAccounts:Yn,compressedTokenAccount:Mr,compressibleConfig:Wd,splInterfacePda:ye?I:void 0,rentSponsor:be?kd:void 0}));}else jt.push(da({amount:a,secp256r1VerifyArgs:Ze,source:p,destination:r,destinationCtokenTokenAccount:ce,destinationSplTokenAccount:Q,settings:g,mint:s,tokenProgram:o,remainingAccounts:Yn,payer:i,compressedTokenAccount:Mr,compressedProofArgs:Xn,sourceSplTokenAccount:l,sourceCtokenTokenAccount:f,compressibleConfig:Wd,splInterfacePda:ye?I:void 0,rentSponsor:be?kd:void 0}));return jt}async function RC(e,n,r){let s=false;if(e){let{value:t}=await Gt(n,r);s=!t;}return s}async function bC(e,n,r,s,t,c){if(r+s>=t)return {};let a=await ed(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 vC(e,n,r,s){if(!e)return null;let{address:t}=await ne(n,r);return (await ue([{address:t,type:"Settings"}],s))[0]}function _C(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let n=e[7];return n===3?2:3}function UC(e){if(!e||e.length===0)return null;try{let n=0,r=new web3_js.PublicKey(e.slice(n,n+32));n+=32;let s=new web3_js.PublicKey(e.slice(n,n+32));n+=32;let t=new Hd__default.default(e.slice(n,n+8),"le");n+=8;let c=e[n];n+=1;let a=c?new web3_js.PublicKey(e.slice(n,n+32)):null;n+=32;let i=e[n];n+=1;let o=e[n];n+=1;let d=o?e.slice(n):null;return {mint:r,owner:s,amount:t,delegate:a,state:i,tlv:d}}catch(n){return console.error("Token data parsing error:",n),null}}async function UB({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:a,proof:i,settingsMutArgs:o}=r,d=me(e),A=d.filter(P=>!(P instanceof M));a.addPreAccounts(A.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:U,verifyArgs:k,signature:J,publicKey:N,message:$}=j(P,x);$&&J&&N&&l.push({message:$,signature:J,publicKey:N}),U&&(a.addPreAccounts([{address:U,role:gill.AccountRole.READONLY}]),k?.__option==="Some"&&p.push({domainConfigKey:U,verifyArgs:k.value}));}let{remainingAccounts:f,systemOffset:b}=a.toAccountMetas(),S=v(i,b),I=[];if(l.length>0&&I.push(w(l)),c){if(!o)throw new Error("Payer not found or proof args is missing.");I.push(Uo({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:o,remainingAccounts:f,secp256r1VerifyArgs:p}));}else I.push(await Mo({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:f,secp256r1VerifyArgs:p}));return I}async function NB({createUserArgs:e,payer:n}){let r=new W;await r.addSystemAccounts(),r.addPreAccounts(e.map(A=>({address:A.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:A.member})));let s=await xe(),t=await Promise.all(e.map(async A=>{let{address:g,addressTree:p}=await L(A.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=v(c,o);return await oc({compressedProofArgs:d,payer:n,createUserArgs:e.map((A,g)=>({member:A.member.address,role:A.role,userCreationArgs:a[g],transactionManagerUrl:A.role===2?A.transactionManagerUrl:null})),remainingAccounts:i})}async function jB({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new W;await c.addSystemAccounts();let a=[],i=[];i.push(...await ue([{address:(await L(r.address,s)).address,type:"User"}],t));let o=await xe(),{address:d,addressTree:A}=await ne(e,o);a.push({address:d,queue:A,tree:A,type:"Settings"});let g=i.length,p=await O(i,a),l=se(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"),X())[0],b=(await ie(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),a)).find(x=>x.type==="Settings")??null,{remainingAccounts:S,systemOffset:I}=c.toAccountMetas(),P=v(p,I);if(!b)throw new Error("Settings creation args is missing.");return await Bo({settingsIndex:e,payer:n,initialMember:r,userReadonlyArgs:l,compressedProofArgs:P,settingsCreation:b,remainingAccounts:S})}async function tw({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:a,settingsMutArgs:i}=await Se(true,e,n,false,t);if(!i)throw new Error("Proof args is missing");let o=me(s),d=o.filter(I=>I instanceof M),A=[],g=[];for(let I of d){let P=A.length,{domainConfig:x,verifyArgs:U,signature:k,publicKey:J,message:N}=j(I,P);N&&k&&J&&A.push({message:N,signature:k,publicKey:J}),x&&(c.addPreAccounts([{address:x,role:gill.AccountRole.READONLY}]),U?.__option==="Some"&&g.push({domainConfigKey:x,verifyArgs:U.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=v(a,l),b=[];A.length>0&&b.push(w(A));let S=await oe(e);return b.push(Ac({settings:S,payer:r,settingsMutArgs:i,compressedProofArgs:f,secp256r1VerifyArgs:g,remainingAccounts:p})),b}async function iw({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new W;await a.addSystemAccounts();let i=await xe(),{address:o,addressTree:d}=await L(r.address,i),A=[{address:o,tree:d,queue:d,type:"User"}],g=await O([],A),p=(await ie(a,g.treeInfos,g.roots,g.rootIndices,A))[0],l=a.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:v(g,l.systemOffset),authorityCreationArgs:p};}return Dc({domainConfig:n,authority:e,newOrigins:s?gill.some(s):gill.none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function mw({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new W;await s.addSystemAccounts();let t=await ue([{address:(await L(e.address,n)).address,type:"User"}]),c=await O(t,[]),a=se(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),d=v(c,o);return bc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:a,remainingAccounts:i})}async function Mw({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:a,message:i,signature:o,publicKey:d}=j(n),A=[];i&&o&&d&&A.push({message:i,signature:o,publicKey:d});let g=await yr(n instanceof M?n:n.address,r,t),p=[];p.push({address:(await L(n instanceof M?n:n.address,r)).address,type:"User"});let l,f=null,b,S=null;g.delegatedTo.__option==="Some"&&((await On(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 oe(g.delegatedTo.value.index)),s&&((await On(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ne(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):b=await oe(s.index));let I=new W;await I.addSystemAccounts();let P=await ue(p,t),x=await O(P,[]),U=se(I,x.treeInfos.slice(0,1),x.leafIndices.slice(0,1),x.rootIndices.slice(0,1),x.proveByIndices.slice(0,1),P.slice(0,1),X())[0],k=f?gill.some(se(I,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=S?gill.some(se(I,x.treeInfos.slice(S.start,S.end),x.leafIndices.slice(S.start,S.end),x.rootIndices.slice(S.start,S.end),x.proveByIndices.slice(S.start,S.end),P.slice(S.start,S.end),q())[0]):gill.none(),{remainingAccounts:N,systemOffset:$}=I.toAccountMetas(),Q=v(x,$),ce=[];return A.length>0&&ce.push(w(A)),ce.push(Lc({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:s?gill.some(s):gill.none(),feePayer:e,signer:n instanceof M?void 0:n,oldSettings:l,oldSettingsMutArgs:k,newSettings:b,newSettingsMutArgs:J,compressedProofArgs:Q,userMutArgs:U,remainingAccounts:N})),ce}async function Vw({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await no(re(),s),o=i.data.multiWalletSettings,{packedAccounts:d,proof:A,settingsMutArgs:g}=await Se(c,e,n,false,a),{remainingAccounts:p,systemOffset:l}=d.toAccountMetas(),{domainConfig:f,verifyArgs:b,message:S,signature:I,publicKey:P}=j(r),x=[];if(S&&I&&P&&x.push(w([{message:S,signature:I,publicKey:P}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let U=v(A,l);x.push(Pa({transactionBuffer:s,domainConfig:f,closer:r instanceof M?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:b,settingsMutArgs:g,payer:t,compressedProofArgs:U,remainingAccounts:p}));}else x.push(Sa({transactionBuffer:s,domainConfig:f,closer:r instanceof M?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:b,remainingAccounts:[]}));return x}function Bd({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:A}){let{domainConfig:g,verifyArgs:p,message:l,signature:f,publicKey:b}=j(n),S=[];if(l&&f&&b&&S.push(w([{message:l,signature:f,publicKey:b}])),d){let{settingsReadonlyArgs:I,compressedProofArgs:P,remainingAccounts:x}=d;S.push(Ba({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:A},settingsReadonlyArgs:I,compressedProofArgs:P,remainingAccounts:x}));}else S.push(_a({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:A},remainingAccounts:[]}));return S}function wd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=j(e),d=[];return i&&a&&o&&d.push(w([{message:i,signature:a,publicKey:o}])),s?d.push(Za({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(Ga({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,remainingAccounts:[]})),d}function Nd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?ai({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):ti({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Vd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=j(n),d=[];return o&&a&&i&&d.push(w([{message:o,signature:a,publicKey:i}])),s?d.push(Si({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(pi({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,remainingAccounts:[]})),d}async function R2({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await OC(r),a=new W,i=null,o=null,d=[];if(c.length||t){let g=await BC({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 wC({configActionsArgs:r,userMutArgs:d,index:e}),index:e,proof:i,settingsMutArgs:o,packedAccounts:a,compressed:t}}async function OC(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>L(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=>L(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function BC({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 ue(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await O(i,[]),d=[],A=[];for(let l of i)l.type==="Settings"?d.push(l):l.type==="User"&&A.push(l);let g,p=[];if(r&&o&&(g=se(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),d,q())[0]),A.length&&o){let l=r?1:0;p=se(e,o.treeInfos.slice(l),o.leafIndices.slice(l),o.rootIndices.slice(l),o.proveByIndices.slice(l),A,X());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function wC({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 L(a.member,a.userAddressTreeIndex).then(o=>r.find(d=>new Hd__default.default(new Uint8Array(d.accountMeta.address)).eq(o.address)));if(!i)throw new Error("Unable to find user account");c.push(HC({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=>L(a.member,a.userAddressTreeIndex).then(i=>{let o=r.find(d=>new Hd__default.default(new Uint8Array(d.accountMeta.address)).eq(i.address));if(!o)throw new Error("Unable to find user account");return VC({pubkey:a.member,userMutArgs:o,index:e})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(a=>NC({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 NC({pubkey:e,permissionArgs:n}){return {memberKey:rt(e),permissions:Fd(n)}}function VC({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:rt(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function HC({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:rt(e),permissions:Fd(n),userReadonlyArgs:r}}function Fd(e){let n=[];return e.initiate&&n.push(De.InitiateTransaction),e.vote&&n.push(De.VoteTransaction),e.execute&&n.push(De.ExecuteTransaction),Pe.fromPermissions(n)}async function O2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:d=false,additionalVoters:A=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:l}){let f=await oe(n),b=Math.floor(Math.random()*255),S=await ad(f,t instanceof M?t:t.address,b),I=[],P=[];for(let B=0;B<s.length;B+=p){let Ze=s.subarray(B,B+p);I.push(Ze),P.push(sha2_js.sha256(Ze));}let x=sha2_js.sha256(new Uint8Array(s)),{settingsReadonlyArgs:U,settingsMutArgs:k,proof:J,packedAccounts:N}=await Se(d,n,r,false,l),{remainingAccounts:$,systemOffset:Q}=N.toAccountMetas(),ce=J&&U&&k?{settingsReadonlyArgs:U,settingsMutArgs:k,compressedProofArgs:v(J,Q),remainingAccounts:$,payer:e}:null,ye=me([t,...c?[c]:[],...A]).filter(B=>B instanceof M).map(B=>({memberKey:rt(B),messageHash:Nn(B.authResponse)})),be=Bd({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:b,payer:e,transactionBufferAddress:S,settings:f,creator:t,preauthorizeExecution:!c,bufferExtendHashes:P,compressedArgs:ce,expectedSecp256r1Signers:ye}),ve=I.map(B=>Nd({transactionMessageBytes:B,transactionBufferAddress:S,settings:f,compressed:d})),F=A.map(B=>Vd({voter:B,transactionBufferAddress:S,settings:f,compressedArgs:ce})),qe=wd({compressedArgs:ce,settings:f,executor:c,transactionBufferAddress:S}),{instructions:ct,addressLookupTableAccounts:m}=await Rd({compressed:d,settings:f,transactionMessageBytes:s,transactionBufferAddress:S,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),ae=B=>({payer:e,instructions:B,addressesByLookupTableAddress:m});return [ae(be),...ve.map(B=>ae([B])),...F.length?[ae(F.flat())]:[],ae(qe),ae(ct)]}var Cr=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 Dr=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 zd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Cr.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 Dr(d,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function Z2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=zd({instructions:e,payer:n,recentBlockhash:u,addressesByLookupTableAddress:r});return Ji(s)}async function eN({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:d=false}){let{instructions:A,addressLookupTableAccounts:g}=await bd({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:d,cachedAccounts:i});return {payer:e,instructions:A,addressesByLookupTableAddress:g}}
2
- exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=mo;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=bo;exports.CHANGE_CONFIG_DISCRIMINATOR=Co;exports.CREATE_COMPRESSED_WALLET_DISCRIMINATOR=Lo;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=Ko;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=Zo;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=$o;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=nc;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=ic;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=mc;exports.DOMAIN_CONFIG_DISCRIMINATOR=rs;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=Ic;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=Ec;exports.EDIT_USER_DELEGATE_DISCRIMINATOR=Uc;exports.GLOBAL_COUNTER_DISCRIMINATOR=is;exports.KeyType=Ht;exports.MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR=wc;exports.MIGRATE_COMPRESSED_USERS_DISCRIMINATOR=zc;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=Wx;exports.MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH=ux;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=$x;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=eI;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=px;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=gx;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=Dx;exports.MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH=Ix;exports.MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH=Ax;exports.MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH=Sx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=Fx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=Gx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=zx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=Ox;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=kx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=Lx;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=Rx;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=nI;exports.MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG=Cx;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=vx;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=Hx;exports.MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS=Bx;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=hx;exports.MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG=Tx;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION=sx;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY=ax;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=nx;exports.MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS=cx;exports.MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER=Qx;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=Yx;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=Px;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG=xx;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION=fx;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=Ex;exports.MULTI_WALLET_ERROR__INVALID_USER_ROLE=bx;exports.MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE=ix;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=qx;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=tI;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=_x;exports.MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS=Ux;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=Zx;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=Nx;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=yx;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=lx;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=rI;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=mx;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=Jx;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=dx;exports.MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS=ox;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=Xx;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=Mx;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=Kx;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=jx;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=Vx;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=wx;exports.MULTI_WALLET_PROGRAM_ADDRESS=u;exports.MultiWalletAccount=ex;exports.MultiWalletInstruction=tx;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=ea;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=Zc;exports.Permission=De;exports.Permissions=Pe;exports.SETTINGS_DISCRIMINATOR=Js;exports.Secp256r1Key=Ee;exports.SignedSecp256r1Key=M;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=Aa;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=aa;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=Ca;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=Ta;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=ka;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=Ra;exports.TRANSACTION_BUFFER_DISCRIMINATOR=eo;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=ja;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=Va;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=si;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=Qa;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=Ti;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=ui;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=Ri;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=Ci;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=Vi;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=ki;exports.UserRole=Ye;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=co;exports.addWhitelistedAddressTrees=vW;exports.base64URLStringToBuffer=Re;exports.bufferToBase64URLString=oL;exports.changeConfig=UB;exports.closeTransactionBuffer=Vw;exports.configAction=LD;exports.convertMemberKeyToString=xd;exports.convertPubkeyCompressedToCose=Qk;exports.convertPubkeyCoseToCompressed=Xk;exports.createClientAuthorizationCompleteRequestChallenge=rL;exports.createClientAuthorizationStartRequestChallenge=tL;exports.createDomainConfig=GL;exports.createDomainUserAccounts=$L;exports.createGlobalCounter=nO;exports.createMessageChallenge=nL;exports.createTransactionBuffer=Bd;exports.createTransactionChallenge=sL;exports.createTransactionManagerSigner=cC;exports.createUserAccounts=NB;exports.createWallet=jB;exports.decodeDomainConfig=ss;exports.decodeGlobalCounter=us;exports.decodeSettings=Zs;exports.decodeTransactionBuffer=ro;exports.decodeWhitelistedAddressTree=io;exports.decompressSettingsAccount=tw;exports.deserializeConfigActions=RL;exports.disableDomainConfig=aO;exports.editDomainConfig=iw;exports.editTransactionManagerUrl=mw;exports.editUserDelegate=Mw;exports.executeTransaction=Rd;exports.executeTransactionBuffer=wd;exports.executeTransactionSync=bd;exports.extendTransactionBuffer=Nd;exports.fetchAllDomainConfig=jC;exports.fetchAllGlobalCounter=$C;exports.fetchAllMaybeDomainConfig=ou;exports.fetchAllMaybeGlobalCounter=Iu;exports.fetchAllMaybeSettings=qp;exports.fetchAllMaybeTransactionBuffer=mm;exports.fetchAllMaybeWhitelistedAddressTree=km;exports.fetchAllSettings=RE;exports.fetchAllTransactionBuffer=kE;exports.fetchAllWhitelistedAddressTree=NE;exports.fetchDomainConfig=os;exports.fetchGlobalCounter=QC;exports.fetchMaybeDomainConfig=su;exports.fetchMaybeGlobalCounter=xu;exports.fetchMaybeSettings=on;exports.fetchMaybeSettingsAccountData=fI;exports.fetchMaybeTransactionBuffer=pm;exports.fetchMaybeUserAccountData=lI;exports.fetchMaybeWhitelistedAddressTree=Wm;exports.fetchSettings=hE;exports.fetchSettingsAccountData=On;exports.fetchTransactionBuffer=no;exports.fetchUserAccountData=yr;exports.fetchWhitelistedAddressTree=uo;exports.getAddMemberArgsCodec=sD;exports.getAddMemberArgsDecoder=hr;exports.getAddMemberArgsEncoder=Er;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=rh;exports.getAddWhitelistedAddressTreesInstruction=sh;exports.getAddWhitelistedAddressTreesInstructionAsync=To;exports.getAddWhitelistedAddressTreesInstructionDataCodec=nh;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=yo;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=mn;exports.getChangeConfigCompressedDiscriminatorBytes=Ch;exports.getChangeConfigCompressedInstruction=Uo;exports.getChangeConfigCompressedInstructionDataCodec=Dh;exports.getChangeConfigCompressedInstructionDataDecoder=_o;exports.getChangeConfigCompressedInstructionDataEncoder=vo;exports.getChangeConfigDiscriminatorBytes=gh;exports.getChangeConfigInstruction=mh;exports.getChangeConfigInstructionAsync=Mo;exports.getChangeConfigInstructionDataCodec=ph;exports.getChangeConfigInstructionDataDecoder=Do;exports.getChangeConfigInstructionDataEncoder=yn;exports.getClientAndDeviceHash=wn;exports.getCompiledInstructionCodec=aD;exports.getCompiledInstructionDecoder=br;exports.getCompiledInstructionEncoder=Rr;exports.getCompressedAccountMetaCodec=AD;exports.getCompressedAccountMetaDecoder=ut;exports.getCompressedAccountMetaEncoder=dt;exports.getCompressedAccountMetaReadOnlyCodec=yD;exports.getCompressedAccountMetaReadOnlyDecoder=mt;exports.getCompressedAccountMetaReadOnlyEncoder=pt;exports.getCompressedProofCodec=fD;exports.getCompressedProofDecoder=Lr;exports.getCompressedProofEncoder=kr;exports.getCompressedSettingsAddressFromIndex=ne;exports.getCompressedSettingsCodec=CD;exports.getCompressedSettingsDataCodec=ED;exports.getCompressedSettingsDataDecoder=lt;exports.getCompressedSettingsDataEncoder=Tt;exports.getCompressedSettingsDecoder=q;exports.getCompressedSettingsEncoder=yt;exports.getCompressedTokenArgsCodec=vD;exports.getCompressedTokenArgsDecoder=It;exports.getCompressedTokenArgsEncoder=xt;exports.getComputeBudgetEstimate=Xi;exports.getConfigActionCodec=kD;exports.getConfigActionDecoder=Le;exports.getConfigActionEncoder=ke;exports.getCreateCompressedWalletDiscriminatorBytes=_h;exports.getCreateCompressedWalletInstruction=Wh;exports.getCreateCompressedWalletInstructionAsync=Bo;exports.getCreateCompressedWalletInstructionDataCodec=Uh;exports.getCreateCompressedWalletInstructionDataDecoder=Oo;exports.getCreateCompressedWalletInstructionDataEncoder=Tn;exports.getCreateDomainConfigDiscriminatorBytes=Hh;exports.getCreateDomainConfigInstruction=Gh;exports.getCreateDomainConfigInstructionAsync=Jo;exports.getCreateDomainConfigInstructionDataCodec=Fh;exports.getCreateDomainConfigInstructionDataDecoder=jo;exports.getCreateDomainConfigInstructionDataEncoder=fn;exports.getCreateDomainUserAccountDiscriminatorBytes=Xh;exports.getCreateDomainUserAccountInstruction=$h;exports.getCreateDomainUserAccountInstructionAsync=Xo;exports.getCreateDomainUserAccountInstructionDataCodec=Qh;exports.getCreateDomainUserAccountInstructionDataDecoder=Yo;exports.getCreateDomainUserAccountInstructionDataEncoder=xn;exports.getCreateGlobalCounterDiscriminatorBytes=cR;exports.getCreateGlobalCounterInstruction=iR;exports.getCreateGlobalCounterInstructionAsync=tc;exports.getCreateGlobalCounterInstructionDataCodec=aR;exports.getCreateGlobalCounterInstructionDataDecoder=ec;exports.getCreateGlobalCounterInstructionDataEncoder=Cn;exports.getCreateUserAccountArgsCodec=VD;exports.getCreateUserAccountArgsDecoder=Kr;exports.getCreateUserAccountArgsEncoder=zr;exports.getCreateUserAccountsDiscriminatorBytes=TR;exports.getCreateUserAccountsInstruction=fR;exports.getCreateUserAccountsInstructionAsync=oc;exports.getCreateUserAccountsInstructionDataCodec=lR;exports.getCreateUserAccountsInstructionDataDecoder=sc;exports.getCreateUserAccountsInstructionDataEncoder=Mn;exports.getDecompressSettingsAccountDiscriminatorBytes=ER;exports.getDecompressSettingsAccountInstruction=Ac;exports.getDecompressSettingsAccountInstructionDataCodec=hR;exports.getDecompressSettingsAccountInstructionDataDecoder=uc;exports.getDecompressSettingsAccountInstructionDataEncoder=dc;exports.getDisableDomainConfigDiscriminatorBytes=kR;exports.getDisableDomainConfigInstruction=lc;exports.getDisableDomainConfigInstructionDataCodec=LR;exports.getDisableDomainConfigInstructionDataDecoder=Tc;exports.getDisableDomainConfigInstructionDataEncoder=yc;exports.getDomainConfigAddress=et;exports.getDomainConfigCodec=KC;exports.getDomainConfigDecoder=ns;exports.getDomainConfigDiscriminatorBytes=zC;exports.getDomainConfigEncoder=nu;exports.getDomainConfigSize=JC;exports.getEditDomainConfigDiscriminatorBytes=GR;exports.getEditDomainConfigInstruction=Dc;exports.getEditDomainConfigInstructionAsync=KR;exports.getEditDomainConfigInstructionDataCodec=zR;exports.getEditDomainConfigInstructionDataDecoder=Cc;exports.getEditDomainConfigInstructionDataEncoder=En;exports.getEditMemberArgsCodec=zD;exports.getEditMemberArgsDecoder=Hr;exports.getEditMemberArgsEncoder=Vr;exports.getEditTransactionManagerUrlDiscriminatorBytes=$R;exports.getEditTransactionManagerUrlInstruction=bc;exports.getEditTransactionManagerUrlInstructionDataCodec=eb;exports.getEditTransactionManagerUrlInstructionDataDecoder=Rc;exports.getEditTransactionManagerUrlInstructionDataEncoder=hc;exports.getEditUserDelegateDiscriminatorBytes=ib;exports.getEditUserDelegateInstruction=Lc;exports.getEditUserDelegateInstructionDataCodec=db;exports.getEditUserDelegateInstructionDataDecoder=kc;exports.getEditUserDelegateInstructionDataEncoder=Wc;exports.getExpectedSecp256r1SignersCodec=qD;exports.getExpectedSecp256r1SignersDecoder=Dt;exports.getExpectedSecp256r1SignersEncoder=Ct;exports.getGlobalCounterAddress=cd;exports.getGlobalCounterCodec=XC;exports.getGlobalCounterDecoder=ds;exports.getGlobalCounterDiscriminatorBytes=YC;exports.getGlobalCounterEncoder=Su;exports.getGlobalCounterSize=eD;exports.getJitoTipsConfig=kn;exports.getLightCpiSigner=kk;exports.getLightProtocolRpc=Qe;exports.getLinkWalletArgsCodec=QD;exports.getLinkWalletArgsDecoder=Jr;exports.getLinkWalletArgsEncoder=jr;exports.getMemberCodec=rM;exports.getMemberDecoder=St;exports.getMemberEncoder=ft;exports.getMemberKeyCodec=oM;exports.getMemberKeyDecoder=te;exports.getMemberKeyEncoder=ee;exports.getMigrateCompressedSettingsDiscriminatorBytes=lb;exports.getMigrateCompressedSettingsInstruction=Hc;exports.getMigrateCompressedSettingsInstructionDataCodec=fb;exports.getMigrateCompressedSettingsInstructionDataDecoder=Vc;exports.getMigrateCompressedSettingsInstructionDataEncoder=Nc;exports.getMigrateCompressedUsersDiscriminatorBytes=Eb;exports.getMigrateCompressedUsersInstruction=Jc;exports.getMigrateCompressedUsersInstructionDataCodec=hb;exports.getMigrateCompressedUsersInstructionDataDecoder=jc;exports.getMigrateCompressedUsersInstructionDataEncoder=Kc;exports.getMultiWalletErrorMessage=fW;exports.getNativeTransferIntentCompressedDiscriminatorBytes=Kb;exports.getNativeTransferIntentCompressedInstruction=na;exports.getNativeTransferIntentCompressedInstructionDataCodec=jb;exports.getNativeTransferIntentCompressedInstructionDataDecoder=ra;exports.getNativeTransferIntentCompressedInstructionDataEncoder=ta;exports.getNativeTransferIntentDiscriminatorBytes=Lb;exports.getNativeTransferIntentInstruction=Xc;exports.getNativeTransferIntentInstructionAsync=Bb;exports.getNativeTransferIntentInstructionDataCodec=Ob;exports.getNativeTransferIntentInstructionDataDecoder=Yc;exports.getNativeTransferIntentInstructionDataEncoder=hn;exports.getNewAuthorityArgsCodec=dM;exports.getNewAuthorityArgsDecoder=Xr;exports.getNewAuthorityArgsEncoder=Yr;exports.getOriginIndex=eL;exports.getPackedAddressTreeInfoCodec=gM;exports.getPackedAddressTreeInfoDecoder=Pt;exports.getPackedAddressTreeInfoEncoder=Mt;exports.getPackedMerkleContextCodec=yM;exports.getPackedMerkleContextDecoder=Br;exports.getPackedMerkleContextEncoder=Or;exports.getPackedStateTreeInfoCodec=fM;exports.getPackedStateTreeInfoDecoder=gt;exports.getPackedStateTreeInfoEncoder=At;exports.getPermissionsCodec=IM;exports.getPermissionsDecoder=We;exports.getPermissionsEncoder=Ue;exports.getProofArgsCodec=PM;exports.getProofArgsDecoder=D;exports.getProofArgsEncoder=C;exports.getRemoveMemberArgsCodec=bM;exports.getRemoveMemberArgsDecoder=Gr;exports.getRemoveMemberArgsEncoder=Fr;exports.getSecp256r1MessageHash=Nn;exports.getSecp256r1PubkeyCodec=UM;exports.getSecp256r1PubkeyDecoder=Et;exports.getSecp256r1PubkeyEncoder=en;exports.getSecp256r1SignatureOffsetsDataDecoder=xC;exports.getSecp256r1SignatureOffsetsDataEncoder=SC;exports.getSecp256r1VerifyArgsCodec=LM;exports.getSecp256r1VerifyArgsDecoder=H;exports.getSecp256r1VerifyArgsEncoder=V;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=NM;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=Y;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=Z;exports.getSecp256r1VerifyInstruction=w;exports.getSecp256r1VerifyInstructionDataCodec=OO;exports.getSecp256r1VerifyInstructionDataDecoder=Ed;exports.getSecp256r1VerifyInstructionDataEncoder=hd;exports.getSendAndConfirmTransaction=Yi;exports.getSettingsCodec=EE;exports.getSettingsCreationArgsCodec=GM;exports.getSettingsCreationArgsDecoder=Rt;exports.getSettingsCreationArgsEncoder=ht;exports.getSettingsDecoder=qs;exports.getSettingsDiscriminatorBytes=PE;exports.getSettingsEncoder=Jp;exports.getSettingsFromIndex=oe;exports.getSettingsIndexWithAddressCodec=jM;exports.getSettingsIndexWithAddressDecoder=vt;exports.getSettingsIndexWithAddressEncoder=bt;exports.getSettingsMutArgsCodec=YM;exports.getSettingsMutArgsDecoder=z;exports.getSettingsMutArgsEncoder=G;exports.getSettingsReadonlyArgsCodec=eP;exports.getSettingsReadonlyArgsDecoder=Ut;exports.getSettingsReadonlyArgsEncoder=_t;exports.getSignedSecp256r1Key=$k;exports.getSignedTransactionManager=EL;exports.getSolanaRpc=re;exports.getSolanaRpcEndpoint=Zi;exports.getTokenTransferIntentCompressedDiscriminatorBytes=uv;exports.getTokenTransferIntentCompressedInstruction=pa;exports.getTokenTransferIntentCompressedInstructionAsync=gv;exports.getTokenTransferIntentCompressedInstructionDataCodec=Av;exports.getTokenTransferIntentCompressedInstructionDataDecoder=ga;exports.getTokenTransferIntentCompressedInstructionDataEncoder=bn;exports.getTokenTransferIntentDiscriminatorBytes=ev;exports.getTokenTransferIntentInstruction=da;exports.getTokenTransferIntentInstructionAsync=rv;exports.getTokenTransferIntentInstructionDataCodec=tv;exports.getTokenTransferIntentInstructionDataDecoder=ia;exports.getTokenTransferIntentInstructionDataEncoder=Rn;exports.getTransactionBufferAddress=ad;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=bv;exports.getTransactionBufferCloseCompressedInstruction=Pa;exports.getTransactionBufferCloseCompressedInstructionDataCodec=vv;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=Ma;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=Da;exports.getTransactionBufferCloseDiscriminatorBytes=xv;exports.getTransactionBufferCloseInstruction=Sa;exports.getTransactionBufferCloseInstructionDataCodec=Iv;exports.getTransactionBufferCloseInstructionDataDecoder=fa;exports.getTransactionBufferCloseInstructionDataEncoder=la;exports.getTransactionBufferCodec=WE;exports.getTransactionBufferCreateArgsCodec=sP;exports.getTransactionBufferCreateArgsDecoder=kt;exports.getTransactionBufferCreateArgsEncoder=Wt;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=Jv;exports.getTransactionBufferCreateCompressedInstruction=Ba;exports.getTransactionBufferCreateCompressedInstructionDataCodec=qv;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=Oa;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=La;exports.getTransactionBufferCreateDiscriminatorBytes=wv;exports.getTransactionBufferCreateInstruction=_a;exports.getTransactionBufferCreateInstructionDataCodec=Nv;exports.getTransactionBufferCreateInstructionDataDecoder=va;exports.getTransactionBufferCreateInstructionDataEncoder=ba;exports.getTransactionBufferDecoder=to;exports.getTransactionBufferDiscriminatorBytes=UE;exports.getTransactionBufferEncoder=gm;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=A_;exports.getTransactionBufferExecuteCompressedInstruction=Za;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=g_;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=qa;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=Ja;exports.getTransactionBufferExecuteDiscriminatorBytes=r_;exports.getTransactionBufferExecuteInstruction=Ga;exports.getTransactionBufferExecuteInstructionDataCodec=n_;exports.getTransactionBufferExecuteInstructionDataDecoder=Fa;exports.getTransactionBufferExecuteInstructionDataEncoder=Ha;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=h_;exports.getTransactionBufferExtendCompressedInstruction=ai;exports.getTransactionBufferExtendCompressedInstructionDataCodec=R_;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=ci;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=oi;exports.getTransactionBufferExtendDiscriminatorBytes=S_;exports.getTransactionBufferExtendInstruction=ti;exports.getTransactionBufferExtendInstructionDataCodec=x_;exports.getTransactionBufferExtendInstructionDataDecoder=ei;exports.getTransactionBufferExtendInstructionDataEncoder=$a;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=K_;exports.getTransactionBufferVoteCompressedInstruction=Si;exports.getTransactionBufferVoteCompressedInstructionDataCodec=j_;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=fi;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=li;exports.getTransactionBufferVoteDiscriminatorBytes=O_;exports.getTransactionBufferVoteInstruction=pi;exports.getTransactionBufferVoteInstructionDataCodec=B_;exports.getTransactionBufferVoteInstructionDataDecoder=gi;exports.getTransactionBufferVoteInstructionDataEncoder=Ai;exports.getTransactionExecuteCompressedDiscriminatorBytes=aU;exports.getTransactionExecuteCompressedInstruction=_i;exports.getTransactionExecuteCompressedInstructionDataCodec=iU;exports.getTransactionExecuteCompressedInstructionDataDecoder=vi;exports.getTransactionExecuteCompressedInstructionDataEncoder=bi;exports.getTransactionExecuteDiscriminatorBytes=$_;exports.getTransactionExecuteInstruction=Pi;exports.getTransactionExecuteInstructionDataCodec=eU;exports.getTransactionExecuteInstructionDataDecoder=Mi;exports.getTransactionExecuteInstructionDataEncoder=Di;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=PU;exports.getTransactionExecuteSyncCompressedInstruction=Gi;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=EU;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=Fi;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=Hi;exports.getTransactionExecuteSyncDiscriminatorBytes=TU;exports.getTransactionExecuteSyncInstruction=Bi;exports.getTransactionExecuteSyncInstructionDataCodec=lU;exports.getTransactionExecuteSyncInstructionDataDecoder=Oi;exports.getTransactionExecuteSyncInstructionDataEncoder=Li;exports.getTransactionMessageAddressTableLookupCodec=AP;exports.getTransactionMessageAddressTableLookupDecoder=rn;exports.getTransactionMessageAddressTableLookupEncoder=tn;exports.getTransactionMessageCodec=iP;exports.getTransactionMessageDecoder=Ot;exports.getTransactionMessageEncoder=Lt;exports.getUserAccountAddress=L;exports.getUserCodec=yP;exports.getUserCreationArgsCodec=SP;exports.getUserCreationArgsDecoder=le;exports.getUserCreationArgsEncoder=Te;exports.getUserDecoder=X;exports.getUserEncoder=we;exports.getUserMutArgsCodec=DP;exports.getUserMutArgsDecoder=Ve;exports.getUserMutArgsEncoder=Ne;exports.getUserReadOnlyArgsCodec=hP;exports.getUserReadOnlyArgsDecoder=Ce;exports.getUserReadOnlyArgsEncoder=Ie;exports.getUserReadOnlyOrMutateArgsCodec=_P;exports.getUserReadOnlyOrMutateArgsDecoder=$r;exports.getUserReadOnlyOrMutateArgsEncoder=Qr;exports.getUserRoleCodec=OP;exports.getUserRoleDecoder=Be;exports.getUserRoleEncoder=Oe;exports.getWalletAddressFromIndex=Wk;exports.getWalletAddressFromSettings=Me;exports.getWhitelistedAddressTreeCodec=wE;exports.getWhitelistedAddressTreeDecoder=ao;exports.getWhitelistedAddressTreeDiscriminatorBytes=BE;exports.getWhitelistedAddressTreeEncoder=Um;exports.getWhitelistedAddressTreeFromIndex=Bn;exports.getWhitelistedAddressTreeIndexFromAddress=Mk;exports.getWhitelistedAddressTreesAddress=td;exports.identifyMultiWalletAccount=AW;exports.identifyMultiWalletInstruction=gW;exports.initialize=tk;exports.isConfigAction=OD;exports.isMultiWalletError=SW;exports.isUserReadOnlyOrMutateArgs=WP;exports.migrateSettings=mO;exports.migrateUsers=IO;exports.nativeTransferIntent=aB;exports.parseAddWhitelistedAddressTreesInstruction=oh;exports.parseChangeConfigCompressedInstruction=Mh;exports.parseChangeConfigInstruction=yh;exports.parseCreateCompressedWalletInstruction=kh;exports.parseCreateDomainConfigInstruction=zh;exports.parseCreateDomainUserAccountInstruction=eR;exports.parseCreateGlobalCounterInstruction=dR;exports.parseCreateUserAccountsInstruction=SR;exports.parseDecompressSettingsAccountInstruction=RR;exports.parseDisableDomainConfigInstruction=OR;exports.parseEditDomainConfigInstruction=jR;exports.parseEditTransactionManagerUrlInstruction=tb;exports.parseEditUserDelegateInstruction=ub;exports.parseMigrateCompressedSettingsInstruction=Sb;exports.parseMigrateCompressedUsersInstruction=Rb;exports.parseNativeTransferIntentCompressedInstruction=Jb;exports.parseNativeTransferIntentInstruction=wb;exports.parseSecp256r1VerifyInstruction=BO;exports.parseTokenTransferIntentCompressedInstruction=pv;exports.parseTokenTransferIntentInstruction=nv;exports.parseTransactionBufferCloseCompressedInstruction=_v;exports.parseTransactionBufferCloseInstruction=Cv;exports.parseTransactionBufferCreateCompressedInstruction=Zv;exports.parseTransactionBufferCreateInstruction=Vv;exports.parseTransactionBufferExecuteCompressedInstruction=p_;exports.parseTransactionBufferExecuteInstruction=s_;exports.parseTransactionBufferExtendCompressedInstruction=b_;exports.parseTransactionBufferExtendInstruction=I_;exports.parseTransactionBufferVoteCompressedInstruction=J_;exports.parseTransactionBufferVoteInstruction=w_;exports.parseTransactionExecuteCompressedInstruction=dU;exports.parseTransactionExecuteInstruction=tU;exports.parseTransactionExecuteSyncCompressedInstruction=hU;exports.parseTransactionExecuteSyncInstruction=fU;exports.pollJitoBundleConfirmation=ML;exports.prepareChangeConfigArgs=R2;exports.prepareTransactionBundle=O2;exports.prepareTransactionMessage=Z2;exports.prepareTransactionSync=eN;exports.retrieveTransactionManager=PL;exports.sendJitoBundle=oC;exports.serializeConfigActions=hL;exports.signAndSendBundledTransactions=CL;exports.signAndSendTransaction=DL;exports.tokenTransferIntent=IB;exports.uninitialize=ek;exports.userReadOnlyOrMutateArgs=UP;exports.vaultTransactionMessageDeserialize=qi;exports.vaultTransactionMessageSerialize=Ji;exports.voteTransactionBuffer=Vd;//# 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'),programs=require('gill/programs'),Fd=require('bn.js'),tinyCbor=require('@levischuck/tiny-cbor'),nist_js=require('@noble/curves/nist.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var Fd__default=/*#__PURE__*/_interopDefault(Fd);var rs=new Uint8Array([201,232,212,229,59,241,106,197]);function KC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(rs)}function su(){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:rs}))}function ns(){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 jC(){return gill.combineCodec(su(),ns())}function ss(e){return gill.decodeAccount(e,ns())}async function os(e,n,r){let s=await ou(e,n,r);return gill.assertAccountExists(s),s}async function ou(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return ss(s)}async function JC(e,n,r){let s=await cu(e,n,r);return gill.assertAccountsExist(s),s}async function cu(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>ss(t))}function qC(){return 846}var is=new Uint8Array([42,206,176,58,175,129,130,233]);function XC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(is)}function xu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:is}))}function ds(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function QC(){return gill.combineCodec(xu(),ds())}function us(e){return gill.decodeAccount(e,ds())}async function $C(e,n,r){let s=await Iu(e,n,r);return gill.assertAccountExists(s),s}async function Iu(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return us(s)}async function eD(e,n,r){let s=await Cu(e,n,r);return gill.assertAccountsExist(s),s}async function Cu(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>us(t))}function tD(){return 24}function Er(){return gill.getStructEncoder([["memberKey",ee()],["permissions",Le()],["userReadonlyArgs",Ce()]])}function hr(){return gill.getStructDecoder([["memberKey",te()],["permissions",Oe()],["userReadonlyArgs",De()]])}function oD(){return gill.combineCodec(Er(),hr())}function Rr(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function br(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function iD(){return gill.combineCodec(Rr(),br())}function dt(){return gill.getStructEncoder([["treeInfo",At()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["outputStateTreeIndex",gill.getU8Encoder()]])}function ut(){return gill.getStructDecoder([["treeInfo",gt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["outputStateTreeIndex",gill.getU8Decoder()]])}function gD(){return gill.combineCodec(dt(),ut())}function pt(){return gill.getStructEncoder([["treeInfo",At()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function mt(){return gill.getStructDecoder([["treeInfo",gt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function TD(){return gill.combineCodec(pt(),mt())}function kr(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Lr(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function SD(){return gill.combineCodec(kr(),Lr())}function yt(){return gill.getStructEncoder([["data",gill.getOptionEncoder(Tt())]])}function q(){return gill.getStructDecoder([["data",gill.getOptionDecoder(lt())]])}function DD(){return gill.combineCodec(yt(),q())}function Tt(){return gill.getStructEncoder([["threshold",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["index",gill.getU128Encoder()],["multiWalletBump",gill.getU8Encoder()],["members",gill.getArrayEncoder(ft())],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]])}function lt(){return gill.getStructDecoder([["threshold",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["index",gill.getU128Decoder()],["multiWalletBump",gill.getU8Decoder()],["members",gill.getArrayDecoder(St())],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function hD(){return gill.combineCodec(Tt(),lt())}function Be(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(wr())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Er())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Vr())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function we(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Nr())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(hr())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Hr())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function _D(){return gill.combineCodec(Be(),we())}function UD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function WD(e,n){return n.__kind===e}function Fr(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",Ne()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",Te()]])}function Gr(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",Ve()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",le()]])}function BD(){return gill.combineCodec(Fr(),Gr())}function wr(){return gill.getStructEncoder([["memberKey",ee()],["permissions",Le()]])}function Nr(){return gill.getStructDecoder([["memberKey",te()],["permissions",Oe()]])}function HD(){return gill.combineCodec(wr(),Nr())}function xt(){return gill.getStructEncoder([["memberKey",ee()],["messageHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function It(){return gill.getStructDecoder([["memberKey",te()],["messageHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function KD(){return gill.combineCodec(xt(),It())}function zr(){return gill.getStructEncoder([["settingsMutArgs",F()],["transactionManager",gill.getOptionEncoder(Ce())]])}function Kr(){return gill.getStructDecoder([["settingsMutArgs",G()],["transactionManager",gill.getOptionDecoder(De())]])}function ZD(){return gill.combineCodec(zr(),Kr())}function ft(){return gill.getStructEncoder([["pubkey",ee()],["permissions",Le()],["role",gill.getU8Encoder()],["userAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getU8Encoder()]])}function St(){return gill.getStructDecoder([["pubkey",te()],["permissions",Oe()],["role",gill.getU8Decoder()],["userAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getU8Decoder()]])}function $D(){return gill.combineCodec(ft(),St())}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 rM(){return gill.combineCodec(ee(),te())}function qr(){return gill.getStructEncoder([["authorityCreationArgs",Te()],["compressedProofArgs",C()]])}function Zr(){return gill.getStructDecoder([["authorityCreationArgs",le()],["compressedProofArgs",D()]])}function cM(){return gill.combineCodec(qr(),Zr())}function Ct(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function Dt(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function dM(){return gill.combineCodec(Ct(),Dt())}function Yr(){return gill.getStructEncoder([["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()],["proveByIndex",gill.getBooleanEncoder()]])}function Xr(){return gill.getStructDecoder([["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()],["proveByIndex",gill.getBooleanDecoder()]])}function gM(){return gill.combineCodec(Yr(),Xr())}function At(){return gill.getStructEncoder([["rootIndex",gill.getU16Encoder()],["proveByIndex",gill.getBooleanEncoder()],["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()]])}function gt(){return gill.getStructDecoder([["rootIndex",gill.getU16Decoder()],["proveByIndex",gill.getBooleanDecoder()],["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()]])}function yM(){return gill.combineCodec(At(),gt())}function Le(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function Oe(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function fM(){return gill.combineCodec(Le(),Oe())}function C(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(kr())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function D(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(Lr())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function CM(){return gill.combineCodec(C(),D())}function Vr(){return gill.getStructEncoder([["memberKey",ee()],["userArgs",Qr()]])}function Hr(){return gill.getStructDecoder([["memberKey",te()],["userArgs",$r()]])}function EM(){return gill.combineCodec(Vr(),Hr())}function en(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function Mt(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function bM(){return gill.combineCodec(en(),Mt())}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 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 UM(){return gill.combineCodec(N(),V())}function Z(){return gill.getStructEncoder([["domainConfigKey",gill.getAddressEncoder()],["verifyArgs",N()]])}function Y(){return gill.getStructDecoder([["domainConfigKey",gill.getAddressDecoder()],["verifyArgs",V()]])}function OM(){return gill.combineCodec(Z(),Y())}function Pt(){return gill.getStructEncoder([["addressTreeInfo",Ct()],["outputStateTreeIndex",gill.getU8Encoder()]])}function Et(){return gill.getStructDecoder([["addressTreeInfo",Dt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function VM(){return gill.combineCodec(Pt(),Et())}function ht(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function Rt(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function GM(){return gill.combineCodec(ht(),Rt())}function F(){return gill.getStructEncoder([["accountMeta",dt()],["data",yt()]])}function G(){return gill.getStructDecoder([["accountMeta",ut()],["data",q()]])}function JM(){return gill.combineCodec(F(),G())}function bt(){return gill.getStructEncoder([["accountMeta",pt()],["data",yt()]])}function vt(){return gill.getStructDecoder([["accountMeta",mt()],["data",q()]])}function XM(){return gill.combineCodec(bt(),vt())}function _t(){return gill.getStructEncoder([["version",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()],["amount",gill.getU64Encoder()],["merkleContext",Yr()]])}function Ut(){return gill.getStructDecoder([["version",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()],["amount",gill.getU64Decoder()],["merkleContext",Xr()]])}function tP(){return gill.combineCodec(_t(),Ut())}function Wt(){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(xt())]])}function kt(){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(It())]])}function oP(){return gill.combineCodec(Wt(),kt())}function Lt(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(Rr())],["addressTableLookups",gill.getArrayEncoder(tn())]])}function Ot(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(br())],["addressTableLookups",gill.getArrayDecoder(rn())]])}function dP(){return gill.combineCodec(Lt(),Ot())}function tn(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function rn(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function gP(){return gill.combineCodec(tn(),rn())}function He(){return gill.getStructEncoder([["member",ee()],["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["role",Ne()],["delegatedTo",gill.getOptionEncoder(ht())],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function X(){return gill.getStructDecoder([["member",te()],["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["role",Ve()],["delegatedTo",gill.getOptionDecoder(Rt())],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function TP(){return gill.combineCodec(He(),X())}function Te(){return gill.getStructEncoder([["addressTreeInfo",Ct()],["outputStateTreeIndex",gill.getU8Encoder()]])}function le(){return gill.getStructDecoder([["addressTreeInfo",Dt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function xP(){return gill.combineCodec(Te(),le())}function Fe(){return gill.getStructEncoder([["accountMeta",dt()],["data",He()]])}function Ge(){return gill.getStructDecoder([["accountMeta",ut()],["data",X()]])}function MP(){return gill.combineCodec(Fe(),Ge())}function Ce(){return gill.getStructEncoder([["accountMeta",pt()],["data",He()]])}function De(){return gill.getStructDecoder([["accountMeta",mt()],["data",X()]])}function RP(){return gill.combineCodec(Ce(),De())}function Qr(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([Ce()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([Fe()])]])]])}function $r(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([De()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([Ge()])]])]])}function UP(){return gill.combineCodec(Qr(),$r())}function WP(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function kP(e,n){return n.__kind===e}var Xe=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(Xe||{});function Ne(){return gill.getEnumEncoder(Xe)}function Ve(){return gill.getEnumDecoder(Xe)}function BP(){return gill.combineCodec(Ne(),Ve())}var Js=new Uint8Array([223,179,163,190,177,224,67,173]);function EE(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Js)}function qp(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(ft())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]]),e=>({...e,discriminator:Js}))}function qs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(St())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function hE(){return gill.combineCodec(qp(),qs())}function Zs(e){return gill.decodeAccount(e,qs())}async function RE(e,n,r){let s=await on(e,n,r);return gill.assertAccountExists(s),s}async function on(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Zs(s)}async function bE(e,n,r){let s=await Zp(e,n,r);return gill.assertAccountsExist(s),s}async function Zp(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Zs(t))}var eo=new Uint8Array([90,36,35,219,93,225,110,96]);function WE(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(eo)}function pm(){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(xt())],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:eo}))}function to(){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(It())],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function kE(){return gill.combineCodec(pm(),to())}function ro(e){return gill.decodeAccount(e,to())}async function no(e,n,r){let s=await mm(e,n,r);return gill.assertAccountExists(s),s}async function mm(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return ro(s)}async function LE(e,n,r){let s=await ym(e,n,r);return gill.assertAccountsExist(s),s}async function ym(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>ro(t))}var co=new Uint8Array([105,23,173,2,197,255,80,87]);function wE(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(co)}function Wm(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:co}))}function ao(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function NE(){return gill.combineCodec(Wm(),ao())}function io(e){return gill.decodeAccount(e,ao())}async function uo(e,n,r){let s=await km(e,n,r);return gill.assertAccountExists(s),s}async function km(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return io(s)}async function VE(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=>io(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 _(e){if(!e)throw new Error("Expected a Address.");return typeof e=="object"&&"address"in e?e.address:Array.isArray(e)?e[0]:e}function y(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:gill.AccountRole.READONLY});let s=r.isWritable?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY;return Object.freeze({address:_(r.value),role:Ao(r.value)?gill.upgradeRoleToSigner(s):s,...Ao(r.value)?{signer:r.value}:{}})}}function Ao(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var mo=new Uint8Array([8]);function nh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(mo)}function mn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:mo}))}function yo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function sh(){return gill.combineCodec(mn(),yo())}async function To(e,n){let r=n?.programAddress??d,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=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:mn().encode(c),programAddress:r})}function oh(e,n){let r=n?.programAddress??d,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:mn().encode(c),programAddress:r})}function ch(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:yo().decode(e.data)}}var Co=new Uint8Array([9]);function ph(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Co)}function yn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsIndex",gill.getU128Encoder()],["configActions",gill.getArrayEncoder(Be())],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())],["compressedProofArgs",gill.getOptionEncoder(C())]]),e=>({...e,discriminator:Co}))}function Do(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsIndex",gill.getU128Decoder()],["configActions",gill.getArrayDecoder(we())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["compressedProofArgs",gill.getOptionDecoder(D())]])}function mh(){return gill.combineCodec(yn(),Do())}async function Mo(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??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.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.authority.value||(t.authority.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(_(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:yn().encode(c),programAddress:r})}function yh(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:yn().encode(c),programAddress:r})}function Th(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Do().decode(e.data)}}var bo=new Uint8Array([19]);function Dh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(bo)}function vo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(Be())],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:bo}))}function _o(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(we())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",G()],["compressedProofArgs",D()]])}function Mh(){return gill.combineCodec(vo(),_o())}function Uo(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:vo().encode(c),programAddress:r})}function Ph(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:_o().decode(e.data)}}var Lo=new Uint8Array([18]);function Uh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Lo)}function Tn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",C()],["settingsCreation",Pt()],["userReadonlyArgs",Ce()],["settingsIndex",gill.getU128Encoder()]]),e=>({...e,discriminator:Lo}))}function Oo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",D()],["settingsCreation",Et()],["userReadonlyArgs",De()],["settingsIndex",gill.getU128Decoder()]])}function Wh(){return gill.combineCodec(Tn(),Oo())}async function Bo(e,n){let r=n?.programAddress??d,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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Tn().encode(c),programAddress:r})}function kh(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Tn().encode(c),programAddress:r})}function Lh(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:Oo().decode(e.data)}}var Ko=new Uint8Array([0]);function Fh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ko)}function fn(){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",Te()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ko}))}function jo(){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",D()]])}function Gh(){return gill.combineCodec(fn(),jo())}async function Jo(e,n){let r=n?.programAddress??d,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=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:fn().encode(c),programAddress:r})}function zh(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:fn().encode(c),programAddress:r})}function Kh(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:jo().decode(e.data)}}var Zo=new Uint8Array([4]);function Qh(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Zo)}function xn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",C()],["member",en()],["role",Ne()],["userAccountCreationArgs",Te()],["linkWalletArgs",gill.getOptionEncoder(zr())]]),e=>({...e,discriminator:Zo}))}function Yo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",D()],["member",Mt()],["role",Ve()],["userAccountCreationArgs",le()],["linkWalletArgs",gill.getOptionDecoder(Kr())]])}function $h(){return gill.combineCodec(xn(),Yo())}async function Xo(e,n){let r=n?.programAddress??d,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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:xn().encode(c),programAddress:r})}function eR(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:xn().encode(c),programAddress:r})}function tR(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:Yo().decode(e.data)}}var $o=new Uint8Array([3]);function aR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode($o)}function Cn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:$o}))}function ec(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function iR(){return gill.combineCodec(Cn(),ec())}async function tc(e,n){let r=n?.programAddress??d,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=y(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Cn().encode({}),programAddress:r})}function dR(e,n){let r=n?.programAddress??d,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=y(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Cn().encode({}),programAddress:r})}function uR(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:ec().decode(e.data)}}var nc=new Uint8Array([5]);function lR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(nc)}function Mn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",C()],["createUserArgs",gill.getArrayEncoder(Fr())]]),e=>({...e,discriminator:nc}))}function sc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",D()],["createUserArgs",gill.getArrayDecoder(Gr())]])}function fR(){return gill.combineCodec(Mn(),sc())}async function oc(e,n){let r=n?.programAddress??d,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=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Mn().encode(c),programAddress:r})}function SR(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Mn().encode(c),programAddress:r})}function xR(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:sc().decode(e.data)}}var ic=new Uint8Array([17]);function hR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ic)}function dc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMutArgs",F()],["compressedProofArgs",C()],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())]]),e=>({...e,discriminator:ic}))}function uc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMutArgs",G()],["compressedProofArgs",D()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function RR(){return gill.combineCodec(dc(),uc())}function Ac(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:dc().encode(c),programAddress:r})}function bR(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:uc().decode(e.data)}}var mc=new Uint8Array([2]);function LR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(mc)}function yc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:mc}))}function Tc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function OR(){return gill.combineCodec(yc(),Tc())}function lc(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:yc().encode(c),programAddress:r})}function BR(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:Tc().decode(e.data)}}var Ic=new Uint8Array([1]);function zR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ic)}function En(){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(qr())]]),e=>({...e,discriminator:Ic}))}function Cc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))],["newAuthorityArgs",gill.getOptionDecoder(Zr())]])}function KR(){return gill.combineCodec(En(),Cc())}async function jR(e,n){let r=n?.programAddress??d,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=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:En().encode(c),programAddress:r})}function Dc(e,n){let r=n?.programAddress??d,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:En().encode(c),programAddress:r})}function JR(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:Cc().decode(e.data)}}var Ec=new Uint8Array([6]);function eb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ec)}function hc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Fe()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ec}))}function Rc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Ge()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",D()]])}function tb(){return gill.combineCodec(hc(),Rc())}function bc(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:hc().encode(c),programAddress:r})}function rb(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:Rc().decode(e.data)}}var Uc=new Uint8Array([7]);function db(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Uc)}function Wc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Fe()],["secp256r1VerifyArgs",gill.getOptionEncoder(N())],["delegateTo",gill.getOptionEncoder(ht())],["oldSettingsMutArgs",gill.getOptionEncoder(F())],["newSettingsMutArgs",gill.getOptionEncoder(F())],["compressedProofArgs",C()]]),e=>({...e,discriminator:Uc}))}function kc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Ge()],["secp256r1VerifyArgs",gill.getOptionDecoder(V())],["delegateTo",gill.getOptionDecoder(Rt())],["oldSettingsMutArgs",gill.getOptionDecoder(G())],["newSettingsMutArgs",gill.getOptionDecoder(G())],["compressedProofArgs",D()]])}function ub(){return gill.combineCodec(Wc(),kc())}function Lc(e,n){let r=n?.programAddress??d,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...i],data:Wc().encode(c),programAddress:r})}function Ab(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:kc().decode(e.data)}}var wc=new Uint8Array([32]);function fb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(wc)}function Nc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Tt()],["compressedProofArgs",C()],["settingsCreationArgs",Pt()]]),e=>({...e,discriminator:wc}))}function Vc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",lt()],["compressedProofArgs",D()],["settingsCreationArgs",Et()]])}function Sb(){return gill.combineCodec(Nc(),Vc())}function Hc(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:Nc().encode(c),programAddress:r})}function xb(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:Vc().decode(e.data)}}var zc=new Uint8Array([31]);function hb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(zc)}function Kc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",He()],["compressedProofArgs",C()],["userCreationArgs",Te()]]),e=>({...e,discriminator:zc}))}function jc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",X()],["compressedProofArgs",D()],["userCreationArgs",le()]])}function Rb(){return gill.combineCodec(Kc(),jc())}function Jc(e,n){let r=n?.programAddress??d,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:Kc().encode(c),programAddress:r})}function bb(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:jc().decode(e.data)}}var Zc=new Uint8Array([29]);function Ob(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Zc)}function hn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())]]),e=>({...e,discriminator:Zc}))}function Yc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function Bb(){return gill.combineCodec(hn(),Yc())}async function wb(e,n){let r=n?.programAddress??d,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(_(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=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:hn().encode(c),programAddress:r})}function Xc(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:hn().encode(c),programAddress:r})}function Nb(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Yc().decode(e.data)}}var ea=new Uint8Array([27]);function jb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ea)}function ta(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ea}))}function ra(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",G()],["compressedProofArgs",D()]])}function Jb(){return gill.combineCodec(ta(),ra())}function na(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:ta().encode(c),programAddress:r})}function qb(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:ra().decode(e.data)}}var aa=new Uint8Array([30]);function tv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(aa)}function Rn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccount",gill.getOptionEncoder(_t())],["compressedProofArgs",gill.getOptionEncoder(C())],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())]]),e=>({...e,discriminator:aa}))}function ia(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccount",gill.getOptionDecoder(Ut())],["compressedProofArgs",gill.getOptionDecoder(D())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function rv(){return gill.combineCodec(Rn(),ia())}async function nv(e,n){let r=n?.programAddress??d,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(_(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(_(t.source.value)),gill.getAddressEncoder().encode(_(t.tokenProgram.value)),gill.getAddressEncoder().encode(_(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(_(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(_(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(_(t.destination.value)),gill.getAddressEncoder().encode(_(t.tokenProgram.value)),gill.getAddressEncoder().encode(_(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(_(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(_(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(_(t.mint.value))]})),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Rn().encode(c),programAddress:r})}function da(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Rn().encode(c),programAddress:r})}function sv(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===d?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:ia().decode(e.data)}}var Aa=new Uint8Array([28]);function Av(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Aa)}function bn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccount",gill.getOptionEncoder(_t())],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Aa}))}function ga(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccount",gill.getOptionDecoder(Ut())],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",G()],["compressedProofArgs",D()]])}function gv(){return gill.combineCodec(bn(),ga())}async function pv(e,n){let r=n?.programAddress??d,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(_(t.source.value)),gill.getAddressEncoder().encode(_(t.tokenProgram.value)),gill.getAddressEncoder().encode(_(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(_(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(_(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(_(t.destination.value)),gill.getAddressEncoder().encode(_(t.tokenProgram.value)),gill.getAddressEncoder().encode(_(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(_(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(_(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(_(t.mint.value))]})),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:bn().encode(c),programAddress:r})}function pa(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:bn().encode(c),programAddress:r})}function mv(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===d?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 Ta=new Uint8Array([13]);function Iv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ta)}function la(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:Ta}))}function fa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(V())]])}function Cv(){return gill.combineCodec(la(),fa())}function Sa(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:la().encode(c),programAddress:r})}function Dv(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:fa().decode(e.data)}}var Ca=new Uint8Array([23]);function vv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ca)}function Da(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ca}))}function Ma(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(V())],["settingsMutArgs",G()],["compressedProofArgs",D()]])}function _v(){return gill.combineCodec(Da(),Ma())}function Pa(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Da().encode(c),programAddress:r})}function Uv(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ma().decode(e.data)}}var Ra=new Uint8Array([10]);function Nv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ra)}function ba(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Wt()],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:Ra}))}function va(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",kt()],["secp256r1VerifyArgs",gill.getOptionDecoder(V())]])}function Vv(){return gill.combineCodec(ba(),va())}function _a(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:ba().encode(c),programAddress:r})}function Hv(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===d?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:va().decode(e.data)}}var ka=new Uint8Array([20]);function qv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ka)}function La(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Wt()],["secp256r1VerifyArgs",gill.getOptionEncoder(N())],["settingsReadonlyArgs",bt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ka}))}function Oa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",kt()],["secp256r1VerifyArgs",gill.getOptionDecoder(V())],["settingsReadonlyArgs",vt()],["compressedProofArgs",D()]])}function Zv(){return gill.combineCodec(La(),Oa())}function Ba(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:La().encode(c),programAddress:r})}function Yv(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Oa().decode(e.data)}}var Va=new Uint8Array([14]);function n_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Va)}function Ha(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:Va}))}function Fa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(V())]])}function s_(){return gill.combineCodec(Ha(),Fa())}function Ga(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ha().encode(c),programAddress:r})}function o_(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Fa().decode(e.data)}}var ja=new Uint8Array([24]);function g_(){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())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:ja}))}function qa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(V())],["settingsMutArgs",G()],["compressedProofArgs",D()]])}function p_(){return gill.combineCodec(Ja(),qa())}function Za(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ja().encode(c),programAddress:r})}function m_(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:qa().decode(e.data)}}var Qa=new Uint8Array([12]);function x_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Qa)}function $a(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Qa}))}function ei(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function I_(){return gill.combineCodec($a(),ei())}function ti(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:$a().encode(c),programAddress:r})}function C_(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:ei().decode(e.data)}}var si=new Uint8Array([22]);function R_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(si)}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:si}))}function ci(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function b_(){return gill.combineCodec(oi(),ci())}function ai(e,n){let r=n?.programAddress??d,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:oi().encode(c),programAddress:r})}function v_(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:ci().decode(e.data)}}var ui=new Uint8Array([11]);function B_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ui)}function Ai(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())]]),e=>({...e,discriminator:ui}))}function gi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(V())]])}function w_(){return gill.combineCodec(Ai(),gi())}function pi(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ai().encode(c),programAddress:r})}function N_(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===d?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 Ti=new Uint8Array([21]);function j_(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ti)}function li(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(N())],["settingsReadonlyArgs",bt()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Ti}))}function fi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(V())],["settingsReadonlyArgs",vt()],["compressedProofArgs",D()]])}function J_(){return gill.combineCodec(li(),fi())}function Si(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:li().encode(c),programAddress:r})}function q_(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:fi().decode(e.data)}}var Ci=new Uint8Array([15]);function eU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ci)}function Di(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Ci}))}function Mi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function tU(){return gill.combineCodec(Di(),Mi())}function Pi(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=m({}),i=y(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:Di().encode({}),programAddress:r})}function rU(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:Mi().decode(e.data)}}var Ri=new Uint8Array([25]);function iU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ri)}function bi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:Ri}))}function vi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function dU(){return gill.combineCodec(bi(),vi())}function _i(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:bi().encode(c),programAddress:r})}function uU(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:vi().decode(e.data)}}var ki=new Uint8Array([16]);function lU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ki)}function Li(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Lt()],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())]]),e=>({...e,discriminator:ki}))}function Oi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Ot()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())]])}function fU(){return gill.combineCodec(Li(),Oi())}function Bi(e,n){let r=n?.programAddress??d,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Li().encode(c),programAddress:r})}function SU(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Oi().decode(e.data)}}var Vi=new Uint8Array([26]);function EU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Vi)}function Hi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Lt()],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())],["settingsMutArgs",F()],["compressedProofArgs",C()]]),e=>({...e,discriminator:Vi}))}function Fi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Ot()],["secp256r1VerifyArgs",gill.getArrayDecoder(Y())],["settingsMutArgs",G()],["compressedProofArgs",D()]])}function hU(){return gill.combineCodec(Hi(),Fi())}function Gi(e,n){let r=n?.programAddress??d,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Hi().encode(c),programAddress:r})}function RU(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===d?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Fi().decode(e.data)}}var d="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",tx=(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))(tx||{});function gW(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 rx=(T=>(T[T.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",T[T.ChangeConfig=1]="ChangeConfig",T[T.ChangeConfigCompressed=2]="ChangeConfigCompressed",T[T.CreateCompressedWallet=3]="CreateCompressedWallet",T[T.CreateDomainConfig=4]="CreateDomainConfig",T[T.CreateDomainUserAccount=5]="CreateDomainUserAccount",T[T.CreateGlobalCounter=6]="CreateGlobalCounter",T[T.CreateUserAccounts=7]="CreateUserAccounts",T[T.DecompressSettingsAccount=8]="DecompressSettingsAccount",T[T.DisableDomainConfig=9]="DisableDomainConfig",T[T.EditDomainConfig=10]="EditDomainConfig",T[T.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",T[T.EditUserDelegate=12]="EditUserDelegate",T[T.MigrateCompressedSettings=13]="MigrateCompressedSettings",T[T.MigrateCompressedUsers=14]="MigrateCompressedUsers",T[T.NativeTransferIntent=15]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=17]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=19]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=21]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=23]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=25]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=27]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",T[T.TransactionExecute=29]="TransactionExecute",T[T.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=31]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",T))(rx||{});function pW(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 sx=6e3,ox=6001,cx=6002,ax=6003,ix=6004,dx=6005,ux=6006,Ax=6007,gx=6008,px=6009,mx=6010,yx=6011,Tx=6012,lx=6013,fx=6014,Sx=6015,xx=6016,Ix=6017,Cx=6018,Dx=6019,Mx=6020,Px=6021,Ex=6022,hx=6023,Rx=6024,bx=6025,vx=6026,_x=6027,Ux=6028,Wx=6029,kx=6030,Lx=6031,Ox=6032,Bx=6033,wx=6034,Nx=6035,Vx=6036,Hx=6037,Fx=6038,Gx=6039,zx=6040,Kx=6041,jx=6042,Jx=6043,qx=6044,Zx=6045,Yx=6046,Xx=6047,Qx=6048,$x=6049,eI=6050,tI=6051,rI=6052,nI=6053,sI=6054,zi;process.env.NODE_ENV!=="production"&&(zi={[kx]:"This member is already delegated to another wallet.",[Ax]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[eI]:"The domain configuration account is disabled. Please contact support or try again later.",[tI]:"Missing domain configuration account.",[mx]:"Duplicate public keys detected among members. Each member must have a unique key.",[px]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[Mx]:"No members provided. A multisig wallet must contain at least one member.",[Cx]:"Expected a User with Administrator role for this instruction.",[gx]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[xx]:"Expected a User with Transaction Manager role for this instruction.",[Gx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[zx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Kx]:"Declared buffer size does not match the actual serialized size.",[Bx]:"Not enough members with vote permission to meet the approval threshold.",[Lx]:"At least one signer with execute permission is required to proceed.",[Ox]:"At least one signer with initiate permission is required to perform this action.",[bx]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[sI]:"Address Tree supplied is not part of the whitelisted address trees",[Dx]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[_x]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Fx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[wx]:"Only delegated members are allowed for this transaction.",[Rx]:"Unexpected number of accounts provided for this instruction.",[lx]:"User with Permanent Member role requires a must have a delegated wallet.",[ox]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[ix]:"The extracted public key has an invalid length or encoding.",[sx]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[ax]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[$x]:"The specified slot number is not recent.",[Xx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[Ex]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[Ix]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[Sx]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[hx]:"Malformed transaction message: structure or formatting does not match the expected layout.",[vx]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[dx]:"The extracted WebAuthn signed message payload is malformed.",[Zx]:"An input string exceeds the maximum allowed character length.",[rI]:"This member is not registered under the provided domain configuration.",[Ux]:"A required account is missing from the instruction context.",[Wx]:"User mutation arguments are required when performing add or remove delegate operations.",[Yx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[Vx]:"No valid signer found in this transaction.",[Tx]:"Only one permanent member is allowed per wallet.",[fx]:"Only one transaction manager is allowed per wallet.",[nI]:"The given origin index is not in the whitelisted origins.",[yx]:"Permanent members cannot be removed from a wallet.",[qx]:"Writable CPI calls to protected accounts are not permitted.",[ux]:"The rpIdHash extracted from the signed message does not match the expected value.",[cx]:"The signature index provided is out of bounds for the secp256r1 instruction.",[Qx]:"The specified slot number was not found in the provided slot history.",[Px]:"Too many members: a maximum of 4 members are supported.",[jx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[Jx]:"This transaction has not yet reached the required approval threshold.",[Hx]:"Only the transaction creator or rent payer may close this transaction buffer.",[Nx]:"Member is not part of the expected signers for this transaction."});function SW(e){return process.env.NODE_ENV!=="production"?zi[e]:"Error message not available in production bundles."}function xW(e,n,r){return gill.isProgramError(e,n,d,r)}async function _W({admin:e,addressTree:n}){return To({payer:e,addressTree:n,remainingAccounts:[]})}var Ht={Ed25519:1,Secp256r1:2};var Me={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Re=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(Me).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var Un=33,be=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!==Un)throw new Error(`Invalid public key length, expected ${Un} 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===Un)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 be{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 aI(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function iI(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var ji=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(aI())],["addressTableLookups",gill.getArrayCodec(iI())]]);function Ji(e){return ji.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 qi(e){let n=ji.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:d,staticAccounts:n.accountKeys,version:0}}stateless_js.featureFlags.version=stateless_js.VERSION.V2;var z={};function Zi(){if(!z.solanaRpcEndpoint)throw new Error("Rpc is not initialized yet.");return z.solanaRpcEndpoint}function $e(){if(!z.lightProtocolRpc)throw new Error("Rpc is not initialized yet");return z.lightProtocolRpc}function re(){if(!z.solanaRpc)throw new Error("Rpc is not initialized yet");return z.solanaRpc}function Yi(){if(!z.sendAndConfirm)throw new Error("Rpc is not initialized yet.");return z.sendAndConfirm}function Xi(){if(!z.computeEstimate)throw new Error("Rpc is not initialized yet");return z.computeEstimate}function kn(){return z.jitoTipsConfig?z.jitoTipsConfig:{blockEngineUrl:"https://mainnet.block-engine.jito.wtf/api/v1",getJitoTipsUrl:"https://bundles.jito.wtf/api/v1/bundles/tip_floor",priority:"landed_tips_75th_percentile"}}function tk(){Object.keys(z).forEach(e=>{z[e]=void 0;});}function rk({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){z.solanaRpcEndpoint=e,z.lightProtocolRpc=stateless_js.createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=gill.createSolanaClient({urlOrMoniker:e});z.solanaRpc=t,z.sendAndConfirm=c,z.computeEstimate=programs.estimateComputeUnitLimitFactory({rpc:t}),z.jitoTipsConfig=s??null;}var k=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(d.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 $e().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,u=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=u);}for(let c of r){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:a,addressQueuePubkeyIndex:i});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function gr(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await $e().getCompressedAccount(e);return s&&n?.set(e.toString(),s),s}}async function ed(e,n,r){let s=e.toString()+(n?.mint?n?.mint.toString():""),t=r?.get(s);if(t)return t;{let c=await $e().getCompressedTokenAccountsByOwner(e,n);return c&&r?.set(s,c),c}}async function Gt(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await re().getAccountInfo(e,{encoding:"base64"}).send();return s&&n?.set(e.toString(),s),s}}async function de(e,n){let s=(await Promise.all(e.map(async t=>gr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new Error("Unable to find compressed account.");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 ae(e,n,r,s,t){if(t.length===0)return [];let c=t.map((u,A)=>({treeInfo:n[A],root:r[A],rootIndex:s[A],address:u.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((u,A)=>({addressTreeInfo:a[A],outputStateTreeIndex:i,address:u.address,type:u.type}))}function se(e,n,r,s,t,c,a){let i=[];for(let A=0;A<n.length;A++)i.push({treeInfo:n[A],rootIndex:s[A],leafIndex:r[A],proveByIndex:t[A],hash:c[A].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((A,g)=>({data:a.decode(A.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(A.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Se(e,n,r,s,t){let c=null,a=null,i=null,o=new k;if(e){await o.addSystemAccounts();let{address:u}=await ne(n,r),A=(await de([{address:u,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[A.leafIndex],leaves:[],treeInfos:[A.treeInfo],proveByIndices:[A.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([A],[]);let g=o.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:A.hash}],[]).stateTrees;if(!g)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(A.address),treeInfo:g.packedTreeInfos[0]},data:q().decode(A.data?.data)},a={accountMeta:{address:new Uint8Array(A.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:q().decode(A.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:o,settingsMutArgs:a}}async function O(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await $e().getValidityProofV0(e,n)}catch(c){if(console.error(`Attempt ${t}, Get Validity Proof failed. ${c}`),t++,t>=r)throw new Error(`Failed to get validity proof after ${r} attempts: ${c}`);await new Promise(a=>setTimeout(a,s));}throw new Error(`Failed to get validity proof after ${r} attempts`)}async function xe(){return (await pr()).length-1}var Ln;async function pr(){if(!Ln){let{data:e}=await uo(re(),await td());Ln=e.whitelistedAddressTrees;}return Ln}async function mr(e,n,r){let s=await fI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function fI(e,n,r){let{address:s}=await L(e,n),t=await gr(s,r);return t?.data?.data?X().decode(t.data.data):null}async function On(e,n,r){let s=await SI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function SI(e,n,r){try{let{address:s}=await ne(e,n),t=await gr(s,r);if(!t?.data?.data)throw new Error("No compressed settings account found.");let c=q().decode(t.data.data);if(c.data.__option==="None")throw new Error("No compressed settings account found.");return {...c.data.value,isCompressed:!0}}catch{let s=await on(re(),await oe(e));return s.exists?{...s.data,isCompressed:false}:null}}async function Bn(e){let n=await pr();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function Pk(e){let r=(await pr()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function ne(e,n=0){let r=await Bn(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(d)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function L(e,n=0){let r=await Bn(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("user")),e instanceof be?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(d.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function tt({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha2_js.sha256(new Uint8Array(gill.getUtf8Encoder().encode(n)));else throw new Error("RpId not found.");if(!e)throw new Error("RpIdHash not found.");let[r]=await gill.getProgramDerivedAddress({programAddress:d,seeds:[gill.getUtf8Encoder().encode("domain_config"),e]});return r}async function cd(){let[e]=await gill.getProgramDerivedAddress({programAddress:d,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function td(){let[e]=await gill.getProgramDerivedAddress({programAddress:d,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function ad(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await gill.getProgramDerivedAddress({programAddress:d,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),n instanceof be?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return s}async function Pe(e){let[n]=await gill.getProgramDerivedAddress({programAddress:d,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return n}async function oe(e){let[n]=await gill.getProgramDerivedAddress({programAddress:d,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function kk(e){let n=await oe(e);return await Pe(n)}async function Lk(){let[e]=await gill.getProgramDerivedAddress({programAddress:d,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}function Tr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function DI(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 dd(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 ud(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 Ad(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),u=c[0]===0&&c.length>32?c.slice(1):c,A=o[0]===0&&o.length>32?o.slice(1):o;if(u.length>32||A.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(u,32-u.length);let p=nist_js.p256.Point.CURVE().n>>1n,l=BigInt("0x"+Tr(A)),b=(l>p?nist_js.p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),S=DI(b);return new Uint8Array([...g,...S])}function lr(e){return new Uint8Array([...new Uint8Array(_e(e.response.authenticatorData)),...sha2_js.sha256(new Uint8Array(_e(e.response.clientDataJSON)))])}function Qk(e){let n=tinyCbor.decodeCBOR(e),r=nist_js.p256.Point.fromAffine({x:BigInt("0x"+Tr(n.get(-2))),y:BigInt("0x"+Tr(n.get(-3)))});return gill.getBase58Decoder().decode(r.toBytes(true))}function $k(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 eL(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(_e(n)),c=JSON.parse(new TextDecoder().decode(_e(r))),a=dd(c),i=Ad(new Uint8Array(_e(s))),o=await tt({rpIdHash:t.subarray(0,32)});return new M(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(_e(r)),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(gill.getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:wn(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}async function tL(e,n){let{data:r}=await os(re(),e),t=ud(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 wn(e,n,r){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...gill.getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function rL(e){return sha2_js.sha256(new Uint8Array(gill.getUtf8Encoder().encode(JSON.stringify(e))))}function nL(e){return Nn(e.data.payload.authResponse)}function sL(e,n,r,s){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...wn(n,r,s)]))}async function oL(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 Error("Unable to fetch slot sysvar");let u=gill.getBase64Encoder().encode(o[0]);c=gill.getU64Decoder().decode(u.subarray(0,8)).toString(),a=u.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(_e(e.transactionMessageBytes)):e.transactionMessageBytes),...a,...wn(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:i}}function Nn(e){return sha2_js.sha256(lr(e))}function cL(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function _e(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 Vn(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)||8e5;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 Td(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 ld(e,n){if(e.length===0)throw new Error("Bundle is empty.");for(let c=0;c<e.length;c++){if(e[c].length>1644)throw new Error(`Transaction ${c} exceeds maximum length, ${e[c].length}. Retry again.`);console.log(`Transaction ${c} length: ${e[c].length}`);}let r=await 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:[]}))}]})});if(!r.ok)throw console.error(await r.json()),new Error("Failed to simulate bundle");let{result:s,error:t}=await r.json();if(!s||t)throw console.error(t??s),new Error(`Unable to simulate bundle: ${JSON.stringify(t??s)}`);if(typeof s.value.summary!="string"&&s.value.summary.failed){let{TransactionFailure:c}=s.value.summary.failed.error,[,a]=c;throw console.error(t??s),new Error(`Simulation failed: ${a}`)}return s.value.transactionResults.map(c=>c.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}):null,t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,a=r?.authData&&r.verifyArgs?.clientDataJson?lr(r.authResponse):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function nt(e){if(e instanceof be)return {keyType:Ht.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Ht.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function yd(e){return e instanceof M?e.toString():e.address.toString()}function me(e){let n=new Set,r=[];for(let s of e)n.has(yd(s))||(r.push(s),n.add(yd(s)));if(r.filter(s=>s instanceof M).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function fd({payer:e,tipAmount:n}){let r=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],s=r[Math.floor(Math.random()*r.length)];return programs.getTransferSolInstruction({source:e,destination:gill.address(s),amount:n})}async function DL(e){let n=await Vn(e,true),r=await ld(n.map(gill.getBase64EncodedWireTransaction),Zi()),s=await Vn(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await cC(s.map(gill.getBase64EncodedWireTransaction))}async function ML({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([Xi()(c),Td(re(),c.instructions.flatMap(u=>u.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 Yi()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}async function cC(e,n=10,r=1e3,s=kn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/bundles`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})});if(a.status===429&&c<n){await new Promise(o=>setTimeout(o,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);return i.result}throw new Error("Failed to send bundle after retries.")}async function PL(e,n=30,r=3e3,s=kn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/getBundleStatuses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});if(a.status===429&&c<n){await new Promise(u=>setTimeout(u,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);let o=i.result;if(o.value.length){let u=o.value[0];if(u.confirmation_status==="confirmed"||u.confirmation_status==="finalized")return u.transactions[u.transactions.length-1]}if(c<n){await new Promise(u=>setTimeout(u,r));continue}}throw new Error("Failed to get bundle status after retries.")}function EL(e,n){if(n.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:r}=n.members.find(i=>xd(i.pubkey)===e)??{};if(!r)throw new Error("No permissions found for the current member.");let s=Re.has(r,Me.InitiateTransaction),t=Re.has(r,Me.VoteTransaction),c=Re.has(r,Me.ExecuteTransaction);if(s&&t&&c)return {};if(!t||!c)throw new Error("Signer lacks the required Vote/Execute permissions.");let a=n.members.find(i=>i.role===2);if(!a)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:gill.address(xd(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function hL({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await mr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return aC(n,c.transactionManagerUrl.value,e,s)}function aC(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 i=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json();if("error"in i)throw new Error(i.error);return i.signatures.map(o=>({[e]:gill.getBase58Encoder().encode(o)}))}}}function xd(e){return e.keyType===Ht.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}function RL(e){let n=e.map(c=>Be().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 bL(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=we().read(e,n);t[c]=a[0],n=a[1];}if(n!==e.length)throw new Error(`Trailing bytes: ${e.length-n}`);return t}async function zL({payer:e,rpId:n,origins:r,authority:s}){let t=await tt({rpId:n}),c=new k;await c.addSystemAccounts();let a=await xe(),{address:i,addressTree:o}=await L(s.address,a),u=[{address:i,tree:o,queue:o,type:"User"}],A=await O([],u),g=(await ae(c,A.treeInfos,A.roots,A.rootIndices,u))[0],{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),f=v(A,l);return await Jo({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:f,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function eO({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new k;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 L(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await de(a,t):[],o=await xe(),{address:u,addressTree:A}=await L(r.member,o),g=[{address:u,type:"User",tree:A,queue:A}],p=await O(i,g),l=null,f=null,b=i.filter(W=>W.type==="Settings"),S=i.filter(W=>W.type==="User");b.length&&(l=se(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),b,q())[0]),S.length&&(f=se(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),S,X())[0]);let I=await ae(c,p.treeInfos.slice(i.length),p.roots.slice(i.length),p.rootIndices.slice(i.length),g),{remainingAccounts:P,systemOffset:x}=c.toAccountMetas(),U=v(p,x);return await Xo({payer:n,authority:e,compressedProofArgs:U,member:Mt().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:P})}async function sO({payer:e}){let n=await cd();return tc({payer:e,globalCounter:n})}async function iO({admin:e,rpId:n,disable:r}){let s=await tt({rpId:n});return lc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function yO({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new k;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),u=(await ae(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:A,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Hc({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:u,remainingAccounts:A})}async function CO({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new k;await t.addSystemAccounts();let{address:c,addressTree:a}=await L(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await O([],i),u=(await ae(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:A,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Jc({compressedProofArgs:p,args:e,authority:n,userCreationArgs:u,remainingAccounts:A})}function dC(e,n,r,s){let t=uC(e,n),c=AC(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 uC(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 AC(e,n){return n<e.header.numSignerAccounts}async function Sr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=qi(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:dC(t,i,o,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let o=c[i.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let u of i.writableIndexes){let A=o[u];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:A,role:gill.AccountRole.WRITABLE});}for(let u of i.readonlyIndexes){let A=o[u];if(!A)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:A,role:gill.AccountRole.READONLY});}}for(let i of s?.filter(o=>o.address!==e)??[]){let o=a.findIndex(u=>u.address===i.address);o===-1?a.push({address:i.address,role: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 st=33,ot=64,Kn=14,fC=2,SC=gill.address("Secp256r1SigVerify1111111111111111111111111");function xC(){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 IC(){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 Ed(){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=IC();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=Kn;let a=[];for(let i=0;i<r;i++){let o=gill.fixDecoderSize(gill.getBytesDecoder(),st).decode(e,n);n+=st;let u=gill.fixDecoderSize(gill.getBytesDecoder(),ot).decode(e,n);n+=ot;let A=t[i].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),A).decode(e,n);n+=A,a.push({publicKey:o,signature:u,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function hd(){return gill.createEncoder({getSizeFromValue:e=>{let n=Kn*e.offsets.length,r=e.payload.reduce((s,t)=>s+st+ot+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=xC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=gill.fixEncoderSize(gill.getBytesEncoder(),st).write(t.publicKey,n,r),r=gill.fixEncoderSize(gill.getBytesEncoder(),ot).write(t.signature,n,r),r=gill.getBytesEncoder().write(t.message,n,r);return r}})}function BO(){return gill.combineCodec(hd(),Ed())}function B(e,n){let r=e.length,s=fC+r*Kn,t=[];for(let o=0;o<r;o++){let{message:u}=e[o],A=s,g=A+st,p=g+ot;t.push({publicKeyOffset:A,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:u.length,messageInstructionIndex:65535}),s+=st+ot+u.length;}let c=n?.programAddress??SC,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:hd().encode(a)}}function wO(e){return {programAddress:e.programAddress,accounts:{},data:Ed().decode(e.data)}}async function Rd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let u=await Pe(e),{accountMetas:A,addressLookupTableAccounts:g}=await Sr({transactionMessageBytes:r,walletAddress:u,additionalSigners:a,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(B(c)),p.push(o?_i({transactionBuffer:n,payer:s.address,remainingAccounts:A,settingsKey:e}):Pi({transactionBuffer:n,payer:s.address,settings:e})),i&&p.push(fd({payer:s,tipAmount:i})),{instructions:p,addressLookupTableAccounts:g}}async function bd({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:u}){let A=me(s),g=await oe(e),p=await Pe(g),[{accountMetas:l,addressLookupTableAccounts:f,transactionMessage:b},{settingsMutArgs:S,proof:I,packedAccounts:P}]=await Promise.all([Sr({transactionMessageBytes:r,walletAddress:p,additionalSigners:A.filter($=>!($ instanceof M)),addressesByLookupTableAddress:c}),Se(i,e,n,o,u)]);P.addPreAccounts(l);let x=A.filter($=>$ instanceof M),U=[];for(let $ of x){let ue=a.length,{domainConfig:ye,verifyArgs:Ee,signature:Ue,publicKey:he,message:J}=K($,ue);J&&Ue&&he&&a.push({message:J,signature:Ue,publicKey:he}),ye&&(P.addPreAccounts([{address:ye,role:gill.AccountRole.READONLY}]),Ee?.__option==="Some"&&U.push({domainConfigKey:ye,verifyArgs:Ee.value}));}let{remainingAccounts:W,systemOffset:j}=P.toAccountMetas(),w=[];a.length>0&&w.push(B(a));let Q=DC(b,l);if(i){if(!t||!S)throw new Error("Payer not found or proof args is missing.");let $=v(I,j);w.push(Gi({secp256r1VerifyArgs:U,transactionMessage:Q,settingsMutArgs:S,compressedProofArgs:$,payer:t,remainingAccounts:W}));}else w.push(Bi({secp256r1VerifyArgs:U,settings:g,transactionMessage:Q,remainingAccounts:W}));return {instructions:w,addressLookupTableAccounts:f}}function DC(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 iB({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=me(s),u=await oe(e),A=await Pe(u),{packedAccounts:g,proof:p,settingsMutArgs:l}=await Se(i,e,n,false,t),f=[],b=[];for(let x of o)if(x instanceof M){let U=f.length,{domainConfig:W,verifyArgs:j,signature:w,publicKey:Q,message:$}=K(x,U);$&&w&&Q&&f.push({message:$,signature:w,publicKey:Q}),W&&(g.addPreAccounts([{address:W,role:gill.AccountRole.READONLY}]),j?.__option==="Some"&&b.push({domainConfigKey:W,verifyArgs:j.value}));}else g.addPreAccounts([{address:x.address,role:gill.AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:S,systemOffset:I}=g.toAccountMetas(),P=[];if(f.length>0&&P.push(B(f)),i){if(!a||!l)throw new Error("Payer not found or proof args is missing.");let x=v(p,I);P.push(na({amount:c,settingsMutArgs:l,compressedProofArgs:x,payer:a,secp256r1VerifyArgs:b,source:A,destination:r,remainingAccounts:S}));}else P.push(Xc({amount:c,secp256r1VerifyArgs:b,source:A,destination:r,settings:u,remainingAccounts:S}));return P}var kd=gill.address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),Ld=gill.address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti");async function IB({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,compressed:u=false}){let A=me(t),g=await oe(e),p=await Pe(g),[l,[f],b,[S],[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())})]),[P,x,U]=await Promise.all([Gt(b,c),Gt(l,c),_C(u,e,n,c)]),W=!!P.value,j=!!x.value,w=j?programs.getTokenDecoder().decode(gill.getBase64Encoder().encode(x.value.data[0])).amount:BigInt(0),Q=BigInt(0),$=true;if(w<BigInt(a)){let Ae=await Gt(f,c);$=!!Ae.value,Q=BigInt($?WC(new Uint8Array(gill.getBase64Encoder().encode(Ae.value.data[0])))?.amount??0:0);}let ue=W?b:void 0,ye=W?void 0:S,Ee=j&&(w+Q<BigInt(a)||Q>BigInt(0)||!W)||!j&&W,Ue=!!ye,[{parsed:he,compressedAccount:J},Dr]=await Promise.all([vC(p,s,w,Q,BigInt(a),c),bC(Ee,I,c)]),T=null,ce=null,Ie=new k;if(Dr&&Ie.addPreAccounts([{address:s,role:gill.AccountRole.WRITABLE}]),U||J){await Ie.addSystemAccounts();let Ae=[];if(J&&Ae.push({hash:J.hash,tree:J.treeInfo.tree,queue:J.treeInfo.queue,data:J.data,address:J.address}),U&&Ae.push(U),ce=await O(Ae,[]),U){let ke=J?1:0;T=se(Ie,ce.treeInfos.slice(ke),ce.leafIndices.slice(ke),ce.rootIndices.slice(ke),ce.proveByIndices.slice(ke),Ae.slice(ke),q())[0];}}let H=J&&he&&ce?gill.some({amount:he.amount.toNumber(),merkleContext:{leafIndex:J.leafIndex,merkleTreePubkeyIndex:Ie.insertOrGet(J.treeInfo.tree.toString()),queuePubkeyIndex:Ie.insertOrGet(J.treeInfo.queue.toString()),proveByIndex:J.proveByIndex},rootIndex:ce.rootIndices[0],version:UC(J.data?.discriminator)}):gill.none(),We=[],Mr=[];for(let Ae of A)if(Ae instanceof M){let ke=We.length,{domainConfig:Pr,verifyArgs:Qn,signature:$n,publicKey:es,message:ts}=K(Ae,ke);ts&&$n&&es&&We.push({message:ts,signature:$n,publicKey:es}),Pr&&(Ie.addPreAccounts([{address:Pr,role:gill.AccountRole.READONLY}]),Qn?.__option==="Some"&&Mr.push({domainConfigKey:Pr,verifyArgs:Qn.value}));}else Ie.addPreAccounts([{address:Ae.address,role:gill.AccountRole.READONLY_SIGNER,signer:Ae}]);let{remainingAccounts:Yn,systemOffset:jd}=Ie.toAccountMetas(),Kt=[];We.length>0&&Kt.push(B(We));let Xn=v(ce,jd);if(u){if(!T)throw new Error("Payer not found or proof args is missing.");Kt.push(pa({amount:a,settingsMutArgs:T,compressedProofArgs:Xn,payer:i,secp256r1VerifyArgs:Mr,source:p,destination:r,sourceCtokenTokenAccount:f,sourceSplTokenAccount:l,destinationCtokenTokenAccount:ye,destinationSplTokenAccount:ue,mint:s,tokenProgram:o,remainingAccounts:Yn,sourceCompressedTokenAccount:H,compressibleConfig:kd,splInterfacePda:Ee?I:void 0,rentSponsor:Ue?Ld:void 0}));}else Kt.push(da({amount:a,secp256r1VerifyArgs:Mr,source:p,destination:r,destinationCtokenTokenAccount:ye,destinationSplTokenAccount:ue,settings:g,mint:s,tokenProgram:o,remainingAccounts:Yn,payer:i,sourceCompressedTokenAccount:H,compressedProofArgs:Xn,sourceSplTokenAccount:l,sourceCtokenTokenAccount:f,compressibleConfig:kd,splInterfacePda:Ee?I:void 0,rentSponsor:Ue?Ld:void 0}));return Kt}async function bC(e,n,r){let s=false;if(e){let{value:t}=await Gt(n,r);s=!t;}return s}async function vC(e,n,r,s,t,c){if(r+s>=t)return {};let a=await ed(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 _C(e,n,r,s){if(!e)return null;let{address:t}=await ne(n,r);return (await de([{address:t,type:"Settings"}],s))[0]}function UC(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let n=e[7];return n===3?2:3}function WC(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 UB({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:a,proof:i,settingsMutArgs:o}=r,u=me(e),A=u.filter(P=>!(P instanceof M));a.addPreAccounts(A.map(P=>({address:P.address,role:gill.AccountRole.READONLY_SIGNER,signer:P})));let g=u.filter(P=>P instanceof M),p=[],l=[];for(let P of g){let x=l.length,{domainConfig:U,verifyArgs:W,signature:j,publicKey:w,message:Q}=K(P,x);Q&&j&&w&&l.push({message:Q,signature:j,publicKey:w}),U&&(a.addPreAccounts([{address:U,role:gill.AccountRole.READONLY}]),W?.__option==="Some"&&p.push({domainConfigKey:U,verifyArgs:W.value}));}let{remainingAccounts:f,systemOffset:b}=a.toAccountMetas(),S=v(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(Uo({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:o,remainingAccounts:f,secp256r1VerifyArgs:p}));}else I.push(await Mo({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:f,secp256r1VerifyArgs:p}));return I}async function NB({createUserArgs:e,payer:n}){let r=new k;await r.addSystemAccounts(),r.addPreAccounts(e.map(A=>({address:A.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:A.member})));let s=await xe(),t=await Promise.all(e.map(async A=>{let{address:g,addressTree:p}=await L(A.member.address,s);return {address:g,tree:p,queue:p,type:"User"}})),c=await O([],t),a=await ae(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),u=v(c,o);return await oc({compressedProofArgs:u,payer:n,createUserArgs:e.map((A,g)=>({member:A.member.address,role:A.role,userCreationArgs:a[g],transactionManagerUrl:A.role===2?A.transactionManagerUrl:null})),remainingAccounts:i})}async function jB({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new k;await c.addSystemAccounts();let a=[],i=[];i.push(...await de([{address:(await L(r.address,s)).address,type:"User"}],t));let o=await xe(),{address:u,addressTree:A}=await ne(e,o);a.push({address:u,queue:A,tree:A,type:"Settings"});let g=i.length,p=await O(i,a),l=se(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"),X())[0],b=(await ae(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),a)).find(x=>x.type==="Settings")??null,{remainingAccounts:S,systemOffset:I}=c.toAccountMetas(),P=v(p,I);if(!b)throw new Error("Settings creation args is missing.");return await Bo({settingsIndex:e,payer:n,initialMember:r,userReadonlyArgs:l,compressedProofArgs:P,settingsCreation:b,remainingAccounts:S})}async function tw({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:a,settingsMutArgs:i}=await Se(true,e,n,false,t);if(!i)throw new Error("Proof args is missing");let o=me(s),u=o.filter(I=>I instanceof M),A=[],g=[];for(let I of u){let P=A.length,{domainConfig:x,verifyArgs:U,signature:W,publicKey:j,message:w}=K(I,P);w&&W&&j&&A.push({message:w,signature:W,publicKey:j}),x&&(c.addPreAccounts([{address:x,role:gill.AccountRole.READONLY}]),U?.__option==="Some"&&g.push({domainConfigKey:x,verifyArgs:U.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=v(a,l),b=[];A.length>0&&b.push(B(A));let S=await oe(e);return b.push(Ac({settings:S,payer:r,settingsMutArgs:i,compressedProofArgs:f,secp256r1VerifyArgs:g,remainingAccounts:p})),b}async function iw({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new k;await a.addSystemAccounts();let i=await xe(),{address:o,addressTree:u}=await L(r.address,i),A=[{address:o,tree:u,queue:u,type:"User"}],g=await O([],A),p=(await ae(a,g.treeInfos,g.roots,g.rootIndices,A))[0],l=a.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:v(g,l.systemOffset),authorityCreationArgs:p};}return Dc({domainConfig:n,authority:e,newOrigins:s?gill.some(s):gill.none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function mw({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new k;await s.addSystemAccounts();let t=await de([{address:(await L(e.address,n)).address,type:"User"}]),c=await O(t,[]),a=se(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),u=v(c,o);return bc({authority:e,transactionManagerUrl:r,compressedProofArgs:u,userMutArgs:a,remainingAccounts:i})}async function Mw({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:a,message:i,signature:o,publicKey:u}=K(n),A=[];i&&o&&u&&A.push({message:i,signature:o,publicKey:u});let g=await mr(n instanceof M?n:n.address,r,t),p=[];p.push({address:(await L(n instanceof M?n:n.address,r)).address,type:"User"});let l,f=null,b,S=null;g.delegatedTo.__option==="Some"&&((await On(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 oe(g.delegatedTo.value.index)),s&&((await On(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ne(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):b=await oe(s.index));let I=new k;await I.addSystemAccounts();let P=await de(p,t),x=await O(P,[]),U=se(I,x.treeInfos.slice(0,1),x.leafIndices.slice(0,1),x.rootIndices.slice(0,1),x.proveByIndices.slice(0,1),P.slice(0,1),X())[0],W=f?gill.some(se(I,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=S?gill.some(se(I,x.treeInfos.slice(S.start,S.end),x.leafIndices.slice(S.start,S.end),x.rootIndices.slice(S.start,S.end),x.proveByIndices.slice(S.start,S.end),P.slice(S.start,S.end),q())[0]):gill.none(),{remainingAccounts:w,systemOffset:Q}=I.toAccountMetas(),$=v(x,Q),ue=[];return A.length>0&&ue.push(B(A)),ue.push(Lc({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:s?gill.some(s):gill.none(),feePayer:e,signer:n instanceof M?void 0:n,oldSettings:l,oldSettingsMutArgs:W,newSettings:b,newSettingsMutArgs:j,compressedProofArgs:$,userMutArgs:U,remainingAccounts:w})),ue}async function Vw({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await no(re(),s),o=i.data.multiWalletSettings,{packedAccounts:u,proof:A,settingsMutArgs:g}=await Se(c,e,n,false,a),{remainingAccounts:p,systemOffset:l}=u.toAccountMetas(),{domainConfig:f,verifyArgs:b,message:S,signature:I,publicKey:P}=K(r),x=[];if(S&&I&&P&&x.push(B([{message:S,signature:I,publicKey:P}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let U=v(A,l);x.push(Pa({transactionBuffer:s,domainConfig:f,closer:r instanceof M?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:b,settingsMutArgs:g,payer:t,compressedProofArgs:U,remainingAccounts:p}));}else x.push(Sa({transactionBuffer:s,domainConfig:f,closer:r instanceof M?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:b,remainingAccounts:[]}));return x}function wd({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:u,expectedSecp256r1Signers:A}){let{domainConfig:g,verifyArgs:p,message:l,signature:f,publicKey:b}=K(n),S=[];if(l&&f&&b&&S.push(B([{message:l,signature:f,publicKey:b}])),u){let{settingsReadonlyArgs:I,compressedProofArgs:P,remainingAccounts:x}=u;S.push(Ba({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:A},settingsReadonlyArgs:I,compressedProofArgs:P,remainingAccounts:x}));}else S.push(_a({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:A},remainingAccounts:[]}));return S}function Nd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=K(e),u=[];return i&&a&&o&&u.push(B([{message:i,signature:a,publicKey:o}])),s?u.push(Za({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})):u.push(Ga({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof M?void 0:e,remainingAccounts:[]})),u}function Vd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?ai({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):ti({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Hd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=K(n),u=[];return o&&a&&i&&u.push(B([{message:o,signature:a,publicKey:i}])),s?u.push(Si({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})):u.push(pi({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof M?void 0:n,remainingAccounts:[]})),u}async function R2({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await BC(r),a=new k,i=null,o=null,u=[];if(c.length||t){let g=await wC({packedAccounts:a,userAccounts:c,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:s});i=g.proof,o=g.settingsMutArgs??null,u=g.userMutArgs??[];}return {configActions:await NC({configActionsArgs:r,userMutArgs:u,index:e}),index:e,proof:i,settingsMutArgs:o,packedAccounts:a,compressed:t}}async function BC(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>L(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=>L(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function wC({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 de(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await O(i,[]),u=[],A=[];for(let l of i)l.type==="Settings"?u.push(l):l.type==="User"&&A.push(l);let g,p=[];if(r&&o&&(g=se(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),u,q())[0]),A.length&&o){let l=r?1:0;p=se(e,o.treeInfos.slice(l),o.leafIndices.slice(l),o.rootIndices.slice(l),o.proveByIndices.slice(l),A,X());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function NC({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 L(a.member,a.userAddressTreeIndex).then(o=>r.find(u=>new Fd__default.default(new Uint8Array(u.accountMeta.address)).eq(o.address)));if(!i)throw new Error("Unable to find user account");c.push(FC({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=>L(a.member,a.userAddressTreeIndex).then(i=>{let o=r.find(u=>new Fd__default.default(new Uint8Array(u.accountMeta.address)).eq(i.address));if(!o)throw new Error("Unable to find user account");return HC({pubkey:a.member,userMutArgs:o,index:e})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(a=>VC({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 VC({pubkey:e,permissionArgs:n}){return {memberKey:nt(e),permissions:Gd(n)}}function HC({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:nt(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function FC({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:nt(e),permissions:Gd(n),userReadonlyArgs:r}}function Gd(e){let n=[];return e.initiate&&n.push(Me.InitiateTransaction),e.vote&&n.push(Me.VoteTransaction),e.execute&&n.push(Me.ExecuteTransaction),Re.fromPermissions(n)}async function O2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:u=false,additionalVoters:A=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:l}){let f=await oe(n),b=Math.floor(Math.random()*255),S=await ad(f,t instanceof M?t:t.address,b),I=[],P=[];for(let H=0;H<s.length;H+=p){let We=s.subarray(H,H+p);I.push(We),P.push(sha2_js.sha256(We));}let x=sha2_js.sha256(new Uint8Array(s)),{settingsReadonlyArgs:U,settingsMutArgs:W,proof:j,packedAccounts:w}=await Se(u,n,r,false,l),{remainingAccounts:Q,systemOffset:$}=w.toAccountMetas(),ue=j&&U&&W?{settingsReadonlyArgs:U,settingsMutArgs:W,compressedProofArgs:v(j,$),remainingAccounts:Q,payer:e}:null,ye=me([t,...c?[c]:[],...A]).filter(H=>H instanceof M).map(H=>({memberKey:nt(H),messageHash:Nn(H.authResponse)})),Ee=wd({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:b,payer:e,transactionBufferAddress:S,settings:f,creator:t,preauthorizeExecution:!c,bufferExtendHashes:P,compressedArgs:ue,expectedSecp256r1Signers:ye}),Ue=I.map(H=>Vd({transactionMessageBytes:H,transactionBufferAddress:S,settings:f,compressed:u})),he=A.map(H=>Hd({voter:H,transactionBufferAddress:S,settings:f,compressedArgs:ue})),J=Nd({compressedArgs:ue,settings:f,executor:c,transactionBufferAddress:S}),{instructions:Dr,addressLookupTableAccounts:T}=await Rd({compressed:u,settings:f,transactionMessageBytes:s,transactionBufferAddress:S,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),ce=H=>({payer:e,instructions:H,addressesByLookupTableAddress:T});return [ce(Ee),...Ue.map(H=>ce([H])),...he.length?[ce(he.flat())]:[],ce(J),ce(Dr)]}var Ir=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(u=>u===i);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(i),this.keyMetaMap.delete(c);}}return [s,t]}};var Cr=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 Kd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Ir.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,u]=t.getMessageComponents(),g=new Cr(u,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:u,addressTableLookups:c}}function Z2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Kd({instructions:e,payer:n,recentBlockhash:d,addressesByLookupTableAddress:r});return Ji(s)}async function eN({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:u=false}){let{instructions:A,addressLookupTableAccounts:g}=await bd({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:i});return {payer:e,instructions:A,addressesByLookupTableAddress:g}}
2
+ exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=mo;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=bo;exports.CHANGE_CONFIG_DISCRIMINATOR=Co;exports.CREATE_COMPRESSED_WALLET_DISCRIMINATOR=Lo;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=Ko;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=Zo;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=$o;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=nc;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=ic;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=mc;exports.DOMAIN_CONFIG_DISCRIMINATOR=rs;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=Ic;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=Ec;exports.EDIT_USER_DELEGATE_DISCRIMINATOR=Uc;exports.GLOBAL_COUNTER_DISCRIMINATOR=is;exports.KeyType=Ht;exports.MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR=wc;exports.MIGRATE_COMPRESSED_USERS_DISCRIMINATOR=zc;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=kx;exports.MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH=Ax;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=eI;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=tI;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=mx;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=px;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=Mx;exports.MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH=Cx;exports.MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH=gx;exports.MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH=xx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=Gx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=zx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=Kx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=Bx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=Lx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=Ox;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=bx;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=sI;exports.MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG=Dx;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=_x;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=Fx;exports.MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS=wx;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=Rx;exports.MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG=lx;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION=ox;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY=ix;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=sx;exports.MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS=ax;exports.MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER=$x;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=Xx;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=Ex;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG=Ix;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION=Sx;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=hx;exports.MULTI_WALLET_ERROR__INVALID_USER_ROLE=vx;exports.MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE=dx;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=Zx;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=rI;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=Ux;exports.MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS=Wx;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=Yx;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=Vx;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=Tx;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=fx;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=nI;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=yx;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=qx;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=ux;exports.MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS=cx;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=Qx;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=Px;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=jx;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=Jx;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=Hx;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=Nx;exports.MULTI_WALLET_PROGRAM_ADDRESS=d;exports.MultiWalletAccount=tx;exports.MultiWalletInstruction=rx;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=ea;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=Zc;exports.Permission=Me;exports.Permissions=Re;exports.SETTINGS_DISCRIMINATOR=Js;exports.Secp256r1Key=be;exports.SignedSecp256r1Key=M;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=Aa;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=aa;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=Ca;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=Ta;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=ka;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=Ra;exports.TRANSACTION_BUFFER_DISCRIMINATOR=eo;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=ja;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=Va;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=si;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=Qa;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=Ti;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=ui;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=Ri;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=Ci;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=Vi;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=ki;exports.UserRole=Xe;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=co;exports.addWhitelistedAddressTrees=_W;exports.base64URLStringToBuffer=_e;exports.bufferToBase64URLString=cL;exports.changeConfig=UB;exports.closeTransactionBuffer=Vw;exports.configAction=UD;exports.convertMemberKeyToString=xd;exports.convertPubkeyCompressedToCose=$k;exports.convertPubkeyCoseToCompressed=Qk;exports.createClientAuthorizationCompleteRequestChallenge=nL;exports.createClientAuthorizationStartRequestChallenge=rL;exports.createDomainConfig=zL;exports.createDomainUserAccounts=eO;exports.createGlobalCounter=sO;exports.createMessageChallenge=sL;exports.createTransactionBuffer=wd;exports.createTransactionChallenge=oL;exports.createTransactionManagerSigner=aC;exports.createUserAccounts=NB;exports.createWallet=jB;exports.decodeDomainConfig=ss;exports.decodeGlobalCounter=us;exports.decodeSettings=Zs;exports.decodeTransactionBuffer=ro;exports.decodeWhitelistedAddressTree=io;exports.decompressSettingsAccount=tw;exports.deserializeConfigActions=bL;exports.disableDomainConfig=iO;exports.editDomainConfig=iw;exports.editTransactionManagerUrl=mw;exports.editUserDelegate=Mw;exports.executeTransaction=Rd;exports.executeTransactionBuffer=Nd;exports.executeTransactionSync=bd;exports.extendTransactionBuffer=Vd;exports.fetchAllDomainConfig=JC;exports.fetchAllGlobalCounter=eD;exports.fetchAllMaybeDomainConfig=cu;exports.fetchAllMaybeGlobalCounter=Cu;exports.fetchAllMaybeSettings=Zp;exports.fetchAllMaybeTransactionBuffer=ym;exports.fetchAllMaybeWhitelistedAddressTree=Lm;exports.fetchAllSettings=bE;exports.fetchAllTransactionBuffer=LE;exports.fetchAllWhitelistedAddressTree=VE;exports.fetchDomainConfig=os;exports.fetchGlobalCounter=$C;exports.fetchMaybeDomainConfig=ou;exports.fetchMaybeGlobalCounter=Iu;exports.fetchMaybeSettings=on;exports.fetchMaybeSettingsAccountData=SI;exports.fetchMaybeTransactionBuffer=mm;exports.fetchMaybeUserAccountData=fI;exports.fetchMaybeWhitelistedAddressTree=km;exports.fetchSettings=RE;exports.fetchSettingsAccountData=On;exports.fetchTransactionBuffer=no;exports.fetchUserAccountData=mr;exports.fetchWhitelistedAddressTree=uo;exports.getAddMemberArgsCodec=oD;exports.getAddMemberArgsDecoder=hr;exports.getAddMemberArgsEncoder=Er;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=nh;exports.getAddWhitelistedAddressTreesInstruction=oh;exports.getAddWhitelistedAddressTreesInstructionAsync=To;exports.getAddWhitelistedAddressTreesInstructionDataCodec=sh;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=yo;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=mn;exports.getChangeConfigCompressedDiscriminatorBytes=Dh;exports.getChangeConfigCompressedInstruction=Uo;exports.getChangeConfigCompressedInstructionDataCodec=Mh;exports.getChangeConfigCompressedInstructionDataDecoder=_o;exports.getChangeConfigCompressedInstructionDataEncoder=vo;exports.getChangeConfigDiscriminatorBytes=ph;exports.getChangeConfigInstruction=yh;exports.getChangeConfigInstructionAsync=Mo;exports.getChangeConfigInstructionDataCodec=mh;exports.getChangeConfigInstructionDataDecoder=Do;exports.getChangeConfigInstructionDataEncoder=yn;exports.getClientAndDeviceHash=wn;exports.getCompiledInstructionCodec=iD;exports.getCompiledInstructionDecoder=br;exports.getCompiledInstructionEncoder=Rr;exports.getCompressedAccountMetaCodec=gD;exports.getCompressedAccountMetaDecoder=ut;exports.getCompressedAccountMetaEncoder=dt;exports.getCompressedAccountMetaReadOnlyCodec=TD;exports.getCompressedAccountMetaReadOnlyDecoder=mt;exports.getCompressedAccountMetaReadOnlyEncoder=pt;exports.getCompressedProofCodec=SD;exports.getCompressedProofDecoder=Lr;exports.getCompressedProofEncoder=kr;exports.getCompressedSettingsAddressFromIndex=ne;exports.getCompressedSettingsCodec=DD;exports.getCompressedSettingsDataCodec=hD;exports.getCompressedSettingsDataDecoder=lt;exports.getCompressedSettingsDataEncoder=Tt;exports.getCompressedSettingsDecoder=q;exports.getCompressedSettingsEncoder=yt;exports.getComputeBudgetEstimate=Xi;exports.getConfigActionCodec=_D;exports.getConfigActionDecoder=we;exports.getConfigActionEncoder=Be;exports.getCreateCompressedWalletDiscriminatorBytes=Uh;exports.getCreateCompressedWalletInstruction=kh;exports.getCreateCompressedWalletInstructionAsync=Bo;exports.getCreateCompressedWalletInstructionDataCodec=Wh;exports.getCreateCompressedWalletInstructionDataDecoder=Oo;exports.getCreateCompressedWalletInstructionDataEncoder=Tn;exports.getCreateDomainConfigDiscriminatorBytes=Fh;exports.getCreateDomainConfigInstruction=zh;exports.getCreateDomainConfigInstructionAsync=Jo;exports.getCreateDomainConfigInstructionDataCodec=Gh;exports.getCreateDomainConfigInstructionDataDecoder=jo;exports.getCreateDomainConfigInstructionDataEncoder=fn;exports.getCreateDomainUserAccountDiscriminatorBytes=Qh;exports.getCreateDomainUserAccountInstruction=eR;exports.getCreateDomainUserAccountInstructionAsync=Xo;exports.getCreateDomainUserAccountInstructionDataCodec=$h;exports.getCreateDomainUserAccountInstructionDataDecoder=Yo;exports.getCreateDomainUserAccountInstructionDataEncoder=xn;exports.getCreateGlobalCounterDiscriminatorBytes=aR;exports.getCreateGlobalCounterInstruction=dR;exports.getCreateGlobalCounterInstructionAsync=tc;exports.getCreateGlobalCounterInstructionDataCodec=iR;exports.getCreateGlobalCounterInstructionDataDecoder=ec;exports.getCreateGlobalCounterInstructionDataEncoder=Cn;exports.getCreateUserAccountArgsCodec=BD;exports.getCreateUserAccountArgsDecoder=Gr;exports.getCreateUserAccountArgsEncoder=Fr;exports.getCreateUserAccountsDiscriminatorBytes=lR;exports.getCreateUserAccountsInstruction=SR;exports.getCreateUserAccountsInstructionAsync=oc;exports.getCreateUserAccountsInstructionDataCodec=fR;exports.getCreateUserAccountsInstructionDataDecoder=sc;exports.getCreateUserAccountsInstructionDataEncoder=Mn;exports.getDecompressSettingsAccountDiscriminatorBytes=hR;exports.getDecompressSettingsAccountInstruction=Ac;exports.getDecompressSettingsAccountInstructionDataCodec=RR;exports.getDecompressSettingsAccountInstructionDataDecoder=uc;exports.getDecompressSettingsAccountInstructionDataEncoder=dc;exports.getDisableDomainConfigDiscriminatorBytes=LR;exports.getDisableDomainConfigInstruction=lc;exports.getDisableDomainConfigInstructionDataCodec=OR;exports.getDisableDomainConfigInstructionDataDecoder=Tc;exports.getDisableDomainConfigInstructionDataEncoder=yc;exports.getDomainConfigAddress=tt;exports.getDomainConfigCodec=jC;exports.getDomainConfigDecoder=ns;exports.getDomainConfigDiscriminatorBytes=KC;exports.getDomainConfigEncoder=su;exports.getDomainConfigSize=qC;exports.getEditDomainConfigDiscriminatorBytes=zR;exports.getEditDomainConfigInstruction=Dc;exports.getEditDomainConfigInstructionAsync=jR;exports.getEditDomainConfigInstructionDataCodec=KR;exports.getEditDomainConfigInstructionDataDecoder=Cc;exports.getEditDomainConfigInstructionDataEncoder=En;exports.getEditMemberArgsCodec=HD;exports.getEditMemberArgsDecoder=Nr;exports.getEditMemberArgsEncoder=wr;exports.getEditTransactionManagerUrlDiscriminatorBytes=eb;exports.getEditTransactionManagerUrlInstruction=bc;exports.getEditTransactionManagerUrlInstructionDataCodec=tb;exports.getEditTransactionManagerUrlInstructionDataDecoder=Rc;exports.getEditTransactionManagerUrlInstructionDataEncoder=hc;exports.getEditUserDelegateDiscriminatorBytes=db;exports.getEditUserDelegateInstruction=Lc;exports.getEditUserDelegateInstructionDataCodec=ub;exports.getEditUserDelegateInstructionDataDecoder=kc;exports.getEditUserDelegateInstructionDataEncoder=Wc;exports.getExpectedSecp256r1SignersCodec=KD;exports.getExpectedSecp256r1SignersDecoder=It;exports.getExpectedSecp256r1SignersEncoder=xt;exports.getGlobalCounterAddress=cd;exports.getGlobalCounterCodec=QC;exports.getGlobalCounterDecoder=ds;exports.getGlobalCounterDiscriminatorBytes=XC;exports.getGlobalCounterEncoder=xu;exports.getGlobalCounterSize=tD;exports.getJitoTipsConfig=kn;exports.getLightCpiSigner=Lk;exports.getLightProtocolRpc=$e;exports.getLinkWalletArgsCodec=ZD;exports.getLinkWalletArgsDecoder=Kr;exports.getLinkWalletArgsEncoder=zr;exports.getMemberCodec=$D;exports.getMemberDecoder=St;exports.getMemberEncoder=ft;exports.getMemberKeyCodec=rM;exports.getMemberKeyDecoder=te;exports.getMemberKeyEncoder=ee;exports.getMigrateCompressedSettingsDiscriminatorBytes=fb;exports.getMigrateCompressedSettingsInstruction=Hc;exports.getMigrateCompressedSettingsInstructionDataCodec=Sb;exports.getMigrateCompressedSettingsInstructionDataDecoder=Vc;exports.getMigrateCompressedSettingsInstructionDataEncoder=Nc;exports.getMigrateCompressedUsersDiscriminatorBytes=hb;exports.getMigrateCompressedUsersInstruction=Jc;exports.getMigrateCompressedUsersInstructionDataCodec=Rb;exports.getMigrateCompressedUsersInstructionDataDecoder=jc;exports.getMigrateCompressedUsersInstructionDataEncoder=Kc;exports.getMultiWalletErrorMessage=SW;exports.getNativeTransferIntentCompressedDiscriminatorBytes=jb;exports.getNativeTransferIntentCompressedInstruction=na;exports.getNativeTransferIntentCompressedInstructionDataCodec=Jb;exports.getNativeTransferIntentCompressedInstructionDataDecoder=ra;exports.getNativeTransferIntentCompressedInstructionDataEncoder=ta;exports.getNativeTransferIntentDiscriminatorBytes=Ob;exports.getNativeTransferIntentInstruction=Xc;exports.getNativeTransferIntentInstructionAsync=wb;exports.getNativeTransferIntentInstructionDataCodec=Bb;exports.getNativeTransferIntentInstructionDataDecoder=Yc;exports.getNativeTransferIntentInstructionDataEncoder=hn;exports.getNewAuthorityArgsCodec=cM;exports.getNewAuthorityArgsDecoder=Zr;exports.getNewAuthorityArgsEncoder=qr;exports.getOriginIndex=tL;exports.getPackedAddressTreeInfoCodec=dM;exports.getPackedAddressTreeInfoDecoder=Dt;exports.getPackedAddressTreeInfoEncoder=Ct;exports.getPackedMerkleContextCodec=gM;exports.getPackedMerkleContextDecoder=Xr;exports.getPackedMerkleContextEncoder=Yr;exports.getPackedStateTreeInfoCodec=yM;exports.getPackedStateTreeInfoDecoder=gt;exports.getPackedStateTreeInfoEncoder=At;exports.getPermissionsCodec=fM;exports.getPermissionsDecoder=Oe;exports.getPermissionsEncoder=Le;exports.getProofArgsCodec=CM;exports.getProofArgsDecoder=D;exports.getProofArgsEncoder=C;exports.getRemoveMemberArgsCodec=EM;exports.getRemoveMemberArgsDecoder=Hr;exports.getRemoveMemberArgsEncoder=Vr;exports.getSecp256r1MessageHash=Nn;exports.getSecp256r1PubkeyCodec=bM;exports.getSecp256r1PubkeyDecoder=Mt;exports.getSecp256r1PubkeyEncoder=en;exports.getSecp256r1SignatureOffsetsDataDecoder=IC;exports.getSecp256r1SignatureOffsetsDataEncoder=xC;exports.getSecp256r1VerifyArgsCodec=UM;exports.getSecp256r1VerifyArgsDecoder=V;exports.getSecp256r1VerifyArgsEncoder=N;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=OM;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=Y;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=Z;exports.getSecp256r1VerifyInstruction=B;exports.getSecp256r1VerifyInstructionDataCodec=BO;exports.getSecp256r1VerifyInstructionDataDecoder=Ed;exports.getSecp256r1VerifyInstructionDataEncoder=hd;exports.getSendAndConfirmTransaction=Yi;exports.getSettingsCodec=hE;exports.getSettingsCreationArgsCodec=VM;exports.getSettingsCreationArgsDecoder=Et;exports.getSettingsCreationArgsEncoder=Pt;exports.getSettingsDecoder=qs;exports.getSettingsDiscriminatorBytes=EE;exports.getSettingsEncoder=qp;exports.getSettingsFromIndex=oe;exports.getSettingsIndexWithAddressCodec=GM;exports.getSettingsIndexWithAddressDecoder=Rt;exports.getSettingsIndexWithAddressEncoder=ht;exports.getSettingsMutArgsCodec=JM;exports.getSettingsMutArgsDecoder=G;exports.getSettingsMutArgsEncoder=F;exports.getSettingsReadonlyArgsCodec=XM;exports.getSettingsReadonlyArgsDecoder=vt;exports.getSettingsReadonlyArgsEncoder=bt;exports.getSignedSecp256r1Key=eL;exports.getSignedTransactionManager=hL;exports.getSolanaRpc=re;exports.getSolanaRpcEndpoint=Zi;exports.getSourceCompressedTokenArgsCodec=tP;exports.getSourceCompressedTokenArgsDecoder=Ut;exports.getSourceCompressedTokenArgsEncoder=_t;exports.getTokenTransferIntentCompressedDiscriminatorBytes=Av;exports.getTokenTransferIntentCompressedInstruction=pa;exports.getTokenTransferIntentCompressedInstructionAsync=pv;exports.getTokenTransferIntentCompressedInstructionDataCodec=gv;exports.getTokenTransferIntentCompressedInstructionDataDecoder=ga;exports.getTokenTransferIntentCompressedInstructionDataEncoder=bn;exports.getTokenTransferIntentDiscriminatorBytes=tv;exports.getTokenTransferIntentInstruction=da;exports.getTokenTransferIntentInstructionAsync=nv;exports.getTokenTransferIntentInstructionDataCodec=rv;exports.getTokenTransferIntentInstructionDataDecoder=ia;exports.getTokenTransferIntentInstructionDataEncoder=Rn;exports.getTransactionBufferAddress=ad;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=vv;exports.getTransactionBufferCloseCompressedInstruction=Pa;exports.getTransactionBufferCloseCompressedInstructionDataCodec=_v;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=Ma;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=Da;exports.getTransactionBufferCloseDiscriminatorBytes=Iv;exports.getTransactionBufferCloseInstruction=Sa;exports.getTransactionBufferCloseInstructionDataCodec=Cv;exports.getTransactionBufferCloseInstructionDataDecoder=fa;exports.getTransactionBufferCloseInstructionDataEncoder=la;exports.getTransactionBufferCodec=kE;exports.getTransactionBufferCreateArgsCodec=oP;exports.getTransactionBufferCreateArgsDecoder=kt;exports.getTransactionBufferCreateArgsEncoder=Wt;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=qv;exports.getTransactionBufferCreateCompressedInstruction=Ba;exports.getTransactionBufferCreateCompressedInstructionDataCodec=Zv;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=Oa;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=La;exports.getTransactionBufferCreateDiscriminatorBytes=Nv;exports.getTransactionBufferCreateInstruction=_a;exports.getTransactionBufferCreateInstructionDataCodec=Vv;exports.getTransactionBufferCreateInstructionDataDecoder=va;exports.getTransactionBufferCreateInstructionDataEncoder=ba;exports.getTransactionBufferDecoder=to;exports.getTransactionBufferDiscriminatorBytes=WE;exports.getTransactionBufferEncoder=pm;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=g_;exports.getTransactionBufferExecuteCompressedInstruction=Za;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=p_;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=qa;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=Ja;exports.getTransactionBufferExecuteDiscriminatorBytes=n_;exports.getTransactionBufferExecuteInstruction=Ga;exports.getTransactionBufferExecuteInstructionDataCodec=s_;exports.getTransactionBufferExecuteInstructionDataDecoder=Fa;exports.getTransactionBufferExecuteInstructionDataEncoder=Ha;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=R_;exports.getTransactionBufferExtendCompressedInstruction=ai;exports.getTransactionBufferExtendCompressedInstructionDataCodec=b_;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=ci;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=oi;exports.getTransactionBufferExtendDiscriminatorBytes=x_;exports.getTransactionBufferExtendInstruction=ti;exports.getTransactionBufferExtendInstructionDataCodec=I_;exports.getTransactionBufferExtendInstructionDataDecoder=ei;exports.getTransactionBufferExtendInstructionDataEncoder=$a;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=j_;exports.getTransactionBufferVoteCompressedInstruction=Si;exports.getTransactionBufferVoteCompressedInstructionDataCodec=J_;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=fi;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=li;exports.getTransactionBufferVoteDiscriminatorBytes=B_;exports.getTransactionBufferVoteInstruction=pi;exports.getTransactionBufferVoteInstructionDataCodec=w_;exports.getTransactionBufferVoteInstructionDataDecoder=gi;exports.getTransactionBufferVoteInstructionDataEncoder=Ai;exports.getTransactionExecuteCompressedDiscriminatorBytes=iU;exports.getTransactionExecuteCompressedInstruction=_i;exports.getTransactionExecuteCompressedInstructionDataCodec=dU;exports.getTransactionExecuteCompressedInstructionDataDecoder=vi;exports.getTransactionExecuteCompressedInstructionDataEncoder=bi;exports.getTransactionExecuteDiscriminatorBytes=eU;exports.getTransactionExecuteInstruction=Pi;exports.getTransactionExecuteInstructionDataCodec=tU;exports.getTransactionExecuteInstructionDataDecoder=Mi;exports.getTransactionExecuteInstructionDataEncoder=Di;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=EU;exports.getTransactionExecuteSyncCompressedInstruction=Gi;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=hU;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=Fi;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=Hi;exports.getTransactionExecuteSyncDiscriminatorBytes=lU;exports.getTransactionExecuteSyncInstruction=Bi;exports.getTransactionExecuteSyncInstructionDataCodec=fU;exports.getTransactionExecuteSyncInstructionDataDecoder=Oi;exports.getTransactionExecuteSyncInstructionDataEncoder=Li;exports.getTransactionMessageAddressTableLookupCodec=gP;exports.getTransactionMessageAddressTableLookupDecoder=rn;exports.getTransactionMessageAddressTableLookupEncoder=tn;exports.getTransactionMessageCodec=dP;exports.getTransactionMessageDecoder=Ot;exports.getTransactionMessageEncoder=Lt;exports.getUserAccountAddress=L;exports.getUserCodec=TP;exports.getUserCreationArgsCodec=xP;exports.getUserCreationArgsDecoder=le;exports.getUserCreationArgsEncoder=Te;exports.getUserDecoder=X;exports.getUserEncoder=He;exports.getUserMutArgsCodec=MP;exports.getUserMutArgsDecoder=Ge;exports.getUserMutArgsEncoder=Fe;exports.getUserReadOnlyArgsCodec=RP;exports.getUserReadOnlyArgsDecoder=De;exports.getUserReadOnlyArgsEncoder=Ce;exports.getUserReadOnlyOrMutateArgsCodec=UP;exports.getUserReadOnlyOrMutateArgsDecoder=$r;exports.getUserReadOnlyOrMutateArgsEncoder=Qr;exports.getUserRoleCodec=BP;exports.getUserRoleDecoder=Ve;exports.getUserRoleEncoder=Ne;exports.getWalletAddressFromIndex=kk;exports.getWalletAddressFromSettings=Pe;exports.getWhitelistedAddressTreeCodec=NE;exports.getWhitelistedAddressTreeDecoder=ao;exports.getWhitelistedAddressTreeDiscriminatorBytes=wE;exports.getWhitelistedAddressTreeEncoder=Wm;exports.getWhitelistedAddressTreeFromIndex=Bn;exports.getWhitelistedAddressTreeIndexFromAddress=Pk;exports.getWhitelistedAddressTreesAddress=td;exports.identifyMultiWalletAccount=gW;exports.identifyMultiWalletInstruction=pW;exports.initialize=rk;exports.isConfigAction=WD;exports.isMultiWalletError=xW;exports.isUserReadOnlyOrMutateArgs=kP;exports.migrateSettings=yO;exports.migrateUsers=CO;exports.nativeTransferIntent=iB;exports.parseAddWhitelistedAddressTreesInstruction=ch;exports.parseChangeConfigCompressedInstruction=Ph;exports.parseChangeConfigInstruction=Th;exports.parseCreateCompressedWalletInstruction=Lh;exports.parseCreateDomainConfigInstruction=Kh;exports.parseCreateDomainUserAccountInstruction=tR;exports.parseCreateGlobalCounterInstruction=uR;exports.parseCreateUserAccountsInstruction=xR;exports.parseDecompressSettingsAccountInstruction=bR;exports.parseDisableDomainConfigInstruction=BR;exports.parseEditDomainConfigInstruction=JR;exports.parseEditTransactionManagerUrlInstruction=rb;exports.parseEditUserDelegateInstruction=Ab;exports.parseMigrateCompressedSettingsInstruction=xb;exports.parseMigrateCompressedUsersInstruction=bb;exports.parseNativeTransferIntentCompressedInstruction=qb;exports.parseNativeTransferIntentInstruction=Nb;exports.parseSecp256r1VerifyInstruction=wO;exports.parseTokenTransferIntentCompressedInstruction=mv;exports.parseTokenTransferIntentInstruction=sv;exports.parseTransactionBufferCloseCompressedInstruction=Uv;exports.parseTransactionBufferCloseInstruction=Dv;exports.parseTransactionBufferCreateCompressedInstruction=Yv;exports.parseTransactionBufferCreateInstruction=Hv;exports.parseTransactionBufferExecuteCompressedInstruction=m_;exports.parseTransactionBufferExecuteInstruction=o_;exports.parseTransactionBufferExtendCompressedInstruction=v_;exports.parseTransactionBufferExtendInstruction=C_;exports.parseTransactionBufferVoteCompressedInstruction=q_;exports.parseTransactionBufferVoteInstruction=N_;exports.parseTransactionExecuteCompressedInstruction=uU;exports.parseTransactionExecuteInstruction=rU;exports.parseTransactionExecuteSyncCompressedInstruction=RU;exports.parseTransactionExecuteSyncInstruction=SU;exports.pollJitoBundleConfirmation=PL;exports.prepareChangeConfigArgs=R2;exports.prepareTransactionBundle=O2;exports.prepareTransactionMessage=Z2;exports.prepareTransactionSync=eN;exports.retrieveTransactionManager=EL;exports.sendJitoBundle=cC;exports.serializeConfigActions=RL;exports.signAndSendBundledTransactions=DL;exports.signAndSendTransaction=ML;exports.tokenTransferIntent=IB;exports.uninitialize=tk;exports.userReadOnlyOrMutateArgs=WP;exports.vaultTransactionMessageDeserialize=qi;exports.vaultTransactionMessageSerialize=Ji;exports.voteTransactionBuffer=Hd;//# sourceMappingURL=index.cjs.map
3
3
  //# sourceMappingURL=index.cjs.map