@revibase/core 0.0.51 → 0.0.53
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 +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +27 -145
- package/dist/index.d.ts +27 -145
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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'),T=require('zod'),programs=require('gill/programs'),nist_js=require('@noble/curves/nist.js'),tinyCbor=require('@levischuck/tiny-cbor'),jsonCanonicalize=require('json-canonicalize'),utils_js=require('@noble/curves/utils.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var T__default=/*#__PURE__*/_interopDefault(T);var fo=new Uint8Array([201,232,212,229,59,241,106,197]);function lh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(fo)}function Eg(){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:fo}))}function So(){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 Th(){return gill.combineCodec(Eg(),So())}function xo(e){return gill.decodeAccount(e,So())}async function Io(e,n,r){let s=await Dg(e,n,r);return gill.assertAccountExists(s),s}async function Dg(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return xo(s)}async function fh(e,n,r){let s=await Pg(e,n,r);return gill.assertAccountsExist(s),s}async function Pg(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>xo(t))}function Sh(){return 846}var Do=new Uint8Array([42,206,176,58,175,129,130,233]);function Ch(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Do)}function wg(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:Do}))}function Po(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function Eh(){return gill.combineCodec(wg(),Po())}function Mo(e){return gill.decodeAccount(e,Po())}async function Dh(e,n,r){let s=await Vg(e,n,r);return gill.assertAccountExists(s),s}async function Vg(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Mo(s)}async function Ph(e,n,r){let s=await Hg(e,n,r);return gill.assertAccountsExist(s),s}async function Hg(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Mo(t))}function Mh(){return 24}function rn(){return gill.getStructEncoder([["key",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["value",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function nn(){return gill.getStructDecoder([["key",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["value",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function bh(){return gill.combineCodec(rn(),nn())}function sn(){return gill.getStructEncoder([["memberKey",F()],["permissions",we()],["userArgs",He()]])}function on(){return gill.getStructDecoder([["memberKey",se()],["permissions",Ve()],["userArgs",Fe()]])}function Wh(){return gill.combineCodec(sn(),on())}function cn(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function an(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function Oh(){return gill.combineCodec(cn(),an())}function St(){return gill.getStructEncoder([["treeInfo",It()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["outputStateTreeIndex",gill.getU8Encoder()]])}function xt(){return gill.getStructDecoder([["treeInfo",Ct()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["outputStateTreeIndex",gill.getU8Decoder()]])}function Vh(){return gill.combineCodec(St(),xt())}function Et(){return gill.getStructEncoder([["treeInfo",It()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Dt(){return gill.getStructDecoder([["treeInfo",Ct()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function zh(){return gill.combineCodec(Et(),Dt())}function dn(){return gill.getStructEncoder([["delegatedAmount",gill.getU64Encoder()],["withheldTransferFee",gill.getU64Encoder()],["isAta",gill.getU8Encoder()]])}function un(){return gill.getStructDecoder([["delegatedAmount",gill.getU64Decoder()],["withheldTransferFee",gill.getU64Decoder()],["isAta",gill.getU8Decoder()]])}function Jh(){return gill.combineCodec(dn(),un())}function yn(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function ln(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function Zh(){return gill.combineCodec(yn(),ln())}function Pt(){return gill.getStructEncoder([["data",gill.getOptionEncoder(Mt())]])}function j(){return gill.getStructDecoder([["data",gill.getOptionDecoder(ht())]])}function eR(){return gill.combineCodec(Pt(),j())}function Mt(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(Rt())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]])}function ht(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(bt())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function sR(){return gill.combineCodec(Mt(),ht())}function _t(){return gill.getStructEncoder([["version",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()],["amount",gill.getU64Encoder()],["merkleContext",fn()],["tlv",gill.getOptionEncoder(gill.getArrayEncoder(Tn()))],["hasDelegate",gill.getBooleanEncoder()],["isFrozen",gill.getBooleanEncoder()]])}function vt(){return gill.getStructDecoder([["version",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()],["amount",gill.getU64Decoder()],["merkleContext",Sn()],["tlv",gill.getOptionDecoder(gill.getArrayDecoder(Ut()))],["hasDelegate",gill.getBooleanDecoder()],["isFrozen",gill.getBooleanDecoder()]])}function iR(){return gill.combineCodec(_t(),vt())}function Cn(){return gill.getStructEncoder([["decimalsOption",gill.getU8Encoder()],["decimals",gill.getU8Encoder()],["compressionOnly",gill.getBooleanEncoder()],["isAta",gill.getU8Encoder()],["info",Dn()]])}function En(){return gill.getStructDecoder([["decimalsOption",gill.getU8Decoder()],["decimals",gill.getU8Decoder()],["compressionOnly",gill.getBooleanDecoder()],["isAta",gill.getU8Decoder()],["info",Pn()]])}function gR(){return gill.combineCodec(Cn(),En())}function Dn(){return gill.getStructEncoder([["configAccountVersion",gill.getU16Encoder()],["compressToPubkey",gill.getU8Encoder()],["accountVersion",gill.getU8Encoder()],["lamportsPerWrite",gill.getU32Encoder()],["compressionAuthority",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["rentSponsor",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["lastClaimedSlot",gill.getU64Encoder()],["rentExemptionPaid",gill.getU32Encoder()],["reserved",gill.getU32Encoder()],["rentConfig",Rn()]])}function Pn(){return gill.getStructDecoder([["configAccountVersion",gill.getU16Decoder()],["compressToPubkey",gill.getU8Decoder()],["accountVersion",gill.getU8Decoder()],["lamportsPerWrite",gill.getU32Decoder()],["compressionAuthority",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["rentSponsor",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["lastClaimedSlot",gill.getU64Decoder()],["rentExemptionPaid",gill.getU32Decoder()],["reserved",gill.getU32Decoder()],["rentConfig",bn()]])}function lR(){return gill.combineCodec(Dn(),Pn())}function Ge(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Un())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(sn())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(kn())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function ze(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Wn())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(on())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Ln())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function xR(){return gill.combineCodec(Ge(),ze())}function IR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function CR(e,n){return n.__kind===e}function On(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",Ke()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",fe()]])}function Bn(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",je()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",Se()]])}function MR(){return gill.combineCodec(On(),Bn())}function Un(){return gill.getStructEncoder([["memberKey",F()],["permissions",we()]])}function Wn(){return gill.getStructDecoder([["memberKey",se()],["permissions",Ve()]])}function _R(){return gill.combineCodec(Un(),Wn())}function Wt(){return gill.getStructEncoder([["memberKey",F()],["messageHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function kt(){return gill.getStructDecoder([["memberKey",se()],["messageHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function kR(){return gill.combineCodec(Wt(),kt())}function Tn(){return gill.getDiscriminatedUnionEncoder([["Placeholder0",gill.getUnitEncoder()],["Placeholder1",gill.getUnitEncoder()],["Placeholder2",gill.getUnitEncoder()],["Placeholder3",gill.getUnitEncoder()],["Placeholder4",gill.getUnitEncoder()],["Placeholder5",gill.getUnitEncoder()],["Placeholder6",gill.getUnitEncoder()],["Placeholder7",gill.getUnitEncoder()],["Placeholder8",gill.getUnitEncoder()],["Placeholder9",gill.getUnitEncoder()],["Placeholder10",gill.getUnitEncoder()],["Placeholder11",gill.getUnitEncoder()],["Placeholder12",gill.getUnitEncoder()],["Placeholder13",gill.getUnitEncoder()],["Placeholder14",gill.getUnitEncoder()],["Placeholder15",gill.getUnitEncoder()],["Placeholder16",gill.getUnitEncoder()],["Placeholder17",gill.getUnitEncoder()],["Placeholder18",gill.getUnitEncoder()],["TokenMetadata",gill.getStructEncoder([["fields",gill.getTupleEncoder([Fn()])]])],["Placeholder20",gill.getUnitEncoder()],["Placeholder21",gill.getUnitEncoder()],["Placeholder22",gill.getUnitEncoder()],["Placeholder23",gill.getUnitEncoder()],["Placeholder24",gill.getUnitEncoder()],["Placeholder25",gill.getUnitEncoder()],["Placeholder26",gill.getUnitEncoder()],["PausableAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([Nn()])]])],["PermanentDelegateAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([Vn()])]])],["TransferFeeAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([zn()])]])],["TransferHookAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([jn()])]])],["CompressedOnly",gill.getStructEncoder([["fields",gill.getTupleEncoder([dn()])]])],["Compressible",gill.getStructEncoder([["fields",gill.getTupleEncoder([Cn()])]])]])}function Ut(){return gill.getDiscriminatedUnionDecoder([["Placeholder0",gill.getUnitDecoder()],["Placeholder1",gill.getUnitDecoder()],["Placeholder2",gill.getUnitDecoder()],["Placeholder3",gill.getUnitDecoder()],["Placeholder4",gill.getUnitDecoder()],["Placeholder5",gill.getUnitDecoder()],["Placeholder6",gill.getUnitDecoder()],["Placeholder7",gill.getUnitDecoder()],["Placeholder8",gill.getUnitDecoder()],["Placeholder9",gill.getUnitDecoder()],["Placeholder10",gill.getUnitDecoder()],["Placeholder11",gill.getUnitDecoder()],["Placeholder12",gill.getUnitDecoder()],["Placeholder13",gill.getUnitDecoder()],["Placeholder14",gill.getUnitDecoder()],["Placeholder15",gill.getUnitDecoder()],["Placeholder16",gill.getUnitDecoder()],["Placeholder17",gill.getUnitDecoder()],["Placeholder18",gill.getUnitDecoder()],["TokenMetadata",gill.getStructDecoder([["fields",gill.getTupleDecoder([Gn()])]])],["Placeholder20",gill.getUnitDecoder()],["Placeholder21",gill.getUnitDecoder()],["Placeholder22",gill.getUnitDecoder()],["Placeholder23",gill.getUnitDecoder()],["Placeholder24",gill.getUnitDecoder()],["Placeholder25",gill.getUnitDecoder()],["Placeholder26",gill.getUnitDecoder()],["PausableAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([wn()])]])],["PermanentDelegateAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Hn()])]])],["TransferFeeAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Kn()])]])],["TransferHookAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Jn()])]])],["CompressedOnly",gill.getStructDecoder([["fields",gill.getTupleDecoder([un()])]])],["Compressible",gill.getStructDecoder([["fields",gill.getTupleDecoder([En()])]])]])}function NR(){return gill.combineCodec(Tn(),Ut())}function wR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function VR(e,n){return n.__kind===e}function qn(){return gill.getStructEncoder([["settingsMutArgs",J()],["transactionManager",gill.getOptionEncoder(Lt())]])}function Yn(){return gill.getStructDecoder([["settingsMutArgs",q()],["transactionManager",gill.getOptionDecoder(Ot())]])}function zR(){return gill.combineCodec(qn(),Yn())}function Rt(){return gill.getStructEncoder([["pubkey",F()],["role",gill.getU8Encoder()],["permissions",we()],["userAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getU8Encoder()]])}function bt(){return gill.getStructDecoder([["pubkey",se()],["role",gill.getU8Decoder()],["permissions",Ve()],["userAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getU8Decoder()]])}function qR(){return gill.combineCodec(Rt(),bt())}function F(){return gill.getStructEncoder([["keyType",gill.getU8Encoder()],["key",gill.fixEncoderSize(gill.getBytesEncoder(),33)]])}function se(){return gill.getStructDecoder([["keyType",gill.getU8Decoder()],["key",gill.fixDecoderSize(gill.getBytesDecoder(),33)]])}function XR(){return gill.combineCodec(F(),se())}function Qn(){return gill.getStructEncoder([["authorityCreationArgs",fe()],["compressedProofArgs",I()]])}function $n(){return gill.getStructDecoder([["authorityCreationArgs",Se()],["compressedProofArgs",C()]])}function tb(){return gill.combineCodec(Qn(),$n())}function Bt(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function Nt(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function sb(){return gill.combineCodec(Bt(),Nt())}function fn(){return gill.getStructEncoder([["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()],["proveByIndex",gill.getBooleanEncoder()]])}function Sn(){return gill.getStructDecoder([["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()],["proveByIndex",gill.getBooleanDecoder()]])}function ab(){return gill.combineCodec(fn(),Sn())}function It(){return gill.getStructEncoder([["rootIndex",gill.getU16Encoder()],["proveByIndex",gill.getBooleanEncoder()],["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()]])}function Ct(){return gill.getStructDecoder([["rootIndex",gill.getU16Decoder()],["proveByIndex",gill.getBooleanDecoder()],["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()]])}function ub(){return gill.combineCodec(It(),Ct())}function Nn(){return gill.getStructEncoder([])}function wn(){return gill.getStructDecoder([])}function pb(){return gill.combineCodec(Nn(),wn())}function Vn(){return gill.getStructEncoder([])}function Hn(){return gill.getStructDecoder([])}function lb(){return gill.combineCodec(Vn(),Hn())}function we(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function Ve(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function Sb(){return gill.combineCodec(we(),Ve())}function I(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(yn())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function C(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(ln())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function Eb(){return gill.combineCodec(I(),C())}function kn(){return gill.getStructEncoder([["memberKey",F()],["userArgs",He()]])}function Ln(){return gill.getStructDecoder([["memberKey",se()],["userArgs",Fe()]])}function hb(){return gill.combineCodec(kn(),Ln())}function Rn(){return gill.getStructEncoder([["baseRent",gill.getU16Encoder()],["compressionCost",gill.getU16Encoder()],["lamportsPerBytePerEpoch",gill.getU8Encoder()],["maxFundedEpochs",gill.getU8Encoder()],["maxTopUp",gill.getU16Encoder()]])}function bn(){return gill.getStructDecoder([["baseRent",gill.getU16Decoder()],["compressionCost",gill.getU16Decoder()],["lamportsPerBytePerEpoch",gill.getU8Decoder()],["maxFundedEpochs",gill.getU8Decoder()],["maxTopUp",gill.getU16Decoder()]])}function _b(){return gill.combineCodec(Rn(),bn())}function rs(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function wt(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function Wb(){return gill.combineCodec(rs(),wt())}function G(){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 z(){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 Ob(){return gill.combineCodec(G(),z())}function Q(){return gill.getStructEncoder([["domainConfigKey",gill.getAddressEncoder()],["verifyArgs",G()]])}function $(){return gill.getStructDecoder([["domainConfigKey",gill.getAddressDecoder()],["verifyArgs",z()]])}function Vb(){return gill.combineCodec(Q(),$())}function Vt(){return gill.getStructEncoder([["addressTreeInfo",Bt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function Ht(){return gill.getStructDecoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function zb(){return gill.combineCodec(Vt(),Ht())}function ns(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function ss(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function Jb(){return gill.combineCodec(ns(),ss())}function os(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getBooleanEncoder()]])}function cs(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getBooleanDecoder()]])}function Zb(){return gill.combineCodec(os(),cs())}function J(){return gill.getStructEncoder([["accountMeta",St()],["data",Pt()]])}function q(){return gill.getStructDecoder([["accountMeta",xt()],["data",j()]])}function e_(){return gill.combineCodec(J(),q())}function Ft(){return gill.getStructEncoder([["accountMeta",Et()],["data",Pt()]])}function Gt(){return gill.getStructDecoder([["accountMeta",Dt()],["data",j()]])}function s_(){return gill.combineCodec(Ft(),Gt())}function zt(){return gill.getStructEncoder([["index",gill.getU8Encoder()],["restricted",gill.getBooleanEncoder()]])}function Kt(){return gill.getStructDecoder([["index",gill.getU8Decoder()],["restricted",gill.getBooleanDecoder()]])}function a_(){return gill.combineCodec(zt(),Kt())}function Fn(){return gill.getStructEncoder([["updateAuthority",gill.getAddressEncoder()],["mint",gill.getAddressEncoder()],["name",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["symbol",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["uri",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["additionalMetadata",gill.getArrayEncoder(rn())]])}function Gn(){return gill.getStructDecoder([["updateAuthority",gill.getAddressDecoder()],["mint",gill.getAddressDecoder()],["name",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["symbol",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["uri",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["additionalMetadata",gill.getArrayDecoder(nn())]])}function A_(){return gill.combineCodec(Fn(),Gn())}function jt(){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(Wt())]])}function Jt(){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(kt())]])}function y_(){return gill.combineCodec(jt(),Jt())}function qt(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(cn())],["addressTableLookups",gill.getArrayEncoder(ps())]])}function Yt(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(an())],["addressTableLookups",gill.getArrayDecoder(ms())]])}function S_(){return gill.combineCodec(qt(),Yt())}function ps(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function ms(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function C_(){return gill.combineCodec(ps(),ms())}function zn(){return gill.getStructEncoder([["withheldAmount",gill.getU64Encoder()]])}function Kn(){return gill.getStructDecoder([["withheldAmount",gill.getU64Decoder()]])}function P_(){return gill.combineCodec(zn(),Kn())}function jn(){return gill.getStructEncoder([["transferring",gill.getU8Encoder()]])}function Jn(){return gill.getStructDecoder([["transferring",gill.getU8Decoder()]])}function R_(){return gill.combineCodec(jn(),Jn())}var ys=(a=>(a[a.Ble=0]="Ble",a[a.Cable=1]="Cable",a[a.Hybrid=2]="Hybrid",a[a.Internal=3]="Internal",a[a.Nfc=4]="Nfc",a[a.SmartCard=5]="SmartCard",a[a.Usb=6]="Usb",a))(ys||{});function Zt(){return gill.getEnumEncoder(ys)}function Xt(){return gill.getEnumDecoder(ys)}function v_(){return gill.combineCodec(Zt(),Xt())}function Xe(){return gill.getStructEncoder([["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["member",F()],["credentialId",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder()))],["transports",gill.getOptionEncoder(gill.getArrayEncoder(Zt()))],["wallets",gill.getArrayEncoder(os())],["role",Ke()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function Y(){return gill.getStructDecoder([["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["member",se()],["credentialId",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder()))],["transports",gill.getOptionDecoder(gill.getArrayDecoder(Xt()))],["wallets",gill.getArrayDecoder(cs())],["role",je()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function L_(){return gill.combineCodec(Xe(),Y())}function fe(){return gill.getStructEncoder([["addressTreeInfo",Bt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function Se(){return gill.getStructDecoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function w_(){return gill.combineCodec(fe(),Se())}function Qe(){return gill.getStructEncoder([["accountMeta",St()],["data",Xe()]])}function $e(){return gill.getStructDecoder([["accountMeta",xt()],["data",Y()]])}function G_(){return gill.combineCodec(Qe(),$e())}function Lt(){return gill.getStructEncoder([["accountMeta",Et()],["data",Xe()]])}function Ot(){return gill.getStructDecoder([["accountMeta",Dt()],["data",Y()]])}function J_(){return gill.combineCodec(Lt(),Ot())}function He(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([Lt()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([Qe()])]])]])}function Fe(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([Ot()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([$e()])]])]])}function X_(){return gill.combineCodec(He(),Fe())}function Q_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function $_(e,n){return n.__kind===e}var Le=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(Le||{});function Ke(){return gill.getEnumEncoder(Le)}function je(){return gill.getEnumDecoder(Le)}function rv(){return gill.combineCodec(Ke(),je())}var Lc=new Uint8Array([223,179,163,190,177,224,67,173]);function oU(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Lc)}function h1(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(Rt())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]]),e=>({...e,discriminator:Lc}))}function Rr(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(bt())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function cU(){return gill.combineCodec(h1(),Rr())}function Oc(e){return gill.decodeAccount(e,Rr())}async function aU(e,n,r){let s=await ls(e,n,r);return gill.assertAccountExists(s),s}async function ls(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Oc(s)}async function iU(e,n,r){let s=await R1(e,n,r);return gill.assertAccountsExist(s),s}async function R1(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Oc(t))}var Hc=new Uint8Array([90,36,35,219,93,225,110,96]);function gU(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Hc)}function j1(){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",F()],["executor",F()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder(F())],["expectedSecp256r1Signers",gill.getArrayEncoder(Wt())],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Hc}))}function Fc(){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",se()],["executor",se()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["voters",gill.getArrayDecoder(se())],["expectedSecp256r1Signers",gill.getArrayDecoder(kt())],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function pU(){return gill.combineCodec(j1(),Fc())}function Gc(e){return gill.decodeAccount(e,Fc())}async function zc(e,n,r){let s=await J1(e,n,r);return gill.assertAccountExists(s),s}async function J1(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Gc(s)}async function mU(e,n,r){let s=await q1(e,n,r);return gill.assertAccountsExist(s),s}async function q1(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Gc(t))}var Jc=new Uint8Array([105,23,173,2,197,255,80,87]);function TU(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Jc)}function pf(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:Jc}))}function qc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function fU(){return gill.combineCodec(pf(),qc())}function Yc(e){return gill.decodeAccount(e,qc())}async function Zc(e,n,r){let s=await mf(e,n,r);return gill.assertAccountExists(s),s}async function mf(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Yc(s)}async function SU(e,n,r){let s=await yf(e,n,r);return gill.assertAccountsExist(s),s}async function yf(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Yc(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 O(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 l(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:O(r.value),role:Xc(r.value)?gill.upgradeRoleToSigner(s):s,...Xc(r.value)?{signer:r.value}:{}})}}function Xc(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var $c=new Uint8Array([8]);function OU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode($c)}function Ds(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:$c}))}function ea(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function BU(){return gill.combineCodec(Ds(),ea())}async function ta(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={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 a=y(i),o=l(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:Ds().encode(c),programAddress:r})}function NU(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:Ds().encode(c),programAddress:r})}function wU(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:ea().decode(e.data)}}var ca=new Uint8Array([9]);function jU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ca)}function aa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(Ge())],["secp256r1VerifyArgs",gill.getArrayEncoder(Q())],["compressedProofArgs",gill.getOptionEncoder(I())]]),e=>({...e,discriminator:ca}))}function ia(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(ze())],["secp256r1VerifyArgs",gill.getArrayDecoder($())],["compressedProofArgs",gill.getOptionDecoder(C())]])}function JU(){return gill.combineCodec(aa(),ia())}function da(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:aa().encode(c),programAddress:r})}function qU(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:ia().decode(e.data)}}var ma=new Uint8Array([19]);function tW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ma)}function ya(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(Ge())],["secp256r1VerifyArgs",gill.getArrayEncoder(Q())],["settingsMutArgs",J()],["compressedProofArgs",I()]]),e=>({...e,discriminator:ma}))}function la(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(ze())],["secp256r1VerifyArgs",gill.getArrayDecoder($())],["settingsMutArgs",q()],["compressedProofArgs",C()]])}function rW(){return gill.combineCodec(ya(),la())}function Ta(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:ya().encode(c),programAddress:r})}function nW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:la().decode(e.data)}}var xa=new Uint8Array([18]);function uW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(xa)}function Ps(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",I()],["settingsCreation",Vt()],["userArgs",He()],["settingsIndex",gill.getU128Encoder()]]),e=>({...e,discriminator:xa}))}function Ia(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",C()],["settingsCreation",Ht()],["userArgs",Fe()],["settingsIndex",gill.getU128Decoder()]])}function AW(){return gill.combineCodec(Ps(),Ia())}async function Ca(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={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 a=y(i),o=l(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:Ps().encode(c),programAddress:r})}function gW(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:Ps().encode(c),programAddress:r})}function pW(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:Ia().decode(e.data)}}var _a=new Uint8Array([0]);function xW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(_a)}function hs(){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",fe()],["compressedProofArgs",I()]]),e=>({...e,discriminator:_a}))}function va(){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",Se()],["compressedProofArgs",C()]])}function IW(){return gill.combineCodec(hs(),va())}async function Ua(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={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 a=y(i),o=l(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:hs().encode(c),programAddress:r})}function CW(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:hs().encode(c),programAddress:r})}function EW(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:va().decode(e.data)}}var La=new Uint8Array([4]);function _W(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(La)}function Rs(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",I()],["member",rs()],["role",Ke()],["credentialId",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["transports",gill.getArrayEncoder(Zt())],["userAccountCreationArgs",fe()],["linkWalletArgs",gill.getOptionEncoder(qn())]]),e=>({...e,discriminator:La}))}function Oa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",C()],["member",wt()],["role",je()],["credentialId",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["transports",gill.getArrayDecoder(Xt())],["userAccountCreationArgs",Se()],["linkWalletArgs",gill.getOptionDecoder(Yn())]])}function vW(){return gill.combineCodec(Rs(),Oa())}async function Ba(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={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 a=y(i),o=l(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:Rs().encode(c),programAddress:r})}function UW(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a=y({args:c}),o=l(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:Rs().encode(c),programAddress:r})}function WW(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:Oa().decode(e.data)}}var wa=new Uint8Array([3]);function wW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(wa)}function _s(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:wa}))}function Va(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function VW(){return gill.combineCodec(_s(),Va())}async function Ha(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(c),a=l(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:_s().encode({}),programAddress:r})}function HW(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=y(c),a=l(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:_s().encode({}),programAddress:r})}function FW(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:Va().decode(e.data)}}var Ga=new Uint8Array([5]);function YW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ga)}function Us(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",I()],["createUserArgs",gill.getArrayEncoder(On())]]),e=>({...e,discriminator:Ga}))}function za(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",C()],["createUserArgs",gill.getArrayDecoder(Bn())]])}function ZW(){return gill.combineCodec(Us(),za())}async function Ka(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={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 a=y(i),o=l(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:Us().encode(c),programAddress:r})}function XW(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:Us().encode(c),programAddress:r})}function QW(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:za().decode(e.data)}}var qa=new Uint8Array([17]);function ok(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(qa)}function Ya(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMutArgs",J()],["compressedProofArgs",I()],["secp256r1VerifyArgs",gill.getArrayEncoder(Q())]]),e=>({...e,discriminator:qa}))}function Za(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMutArgs",q()],["compressedProofArgs",C()],["secp256r1VerifyArgs",gill.getArrayDecoder($())]])}function ck(){return gill.combineCodec(Ya(),Za())}function Xa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Ya().encode(c),programAddress:r})}function ak(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Za().decode(e.data)}}var ei=new Uint8Array([2]);function pk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ei)}function ti(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:ei}))}function ri(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function mk(){return gill.combineCodec(ti(),ri())}function ni(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=y({args:c}),o=l(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...a],data:ti().encode(c),programAddress:r})}function yk(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:ri().decode(e.data)}}var ai=new Uint8Array([1]);function Ck(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ai)}function ks(){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(Qn())]]),e=>({...e,discriminator:ai}))}function ii(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))],["newAuthorityArgs",gill.getOptionDecoder($n())]])}function Ek(){return gill.combineCodec(ks(),ii())}async function Dk(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={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 a=y(i),o=l(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:ks().encode(c),programAddress:r})}function di(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:ks().encode(c),programAddress:r})}function Pk(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:ii().decode(e.data)}}var gi=new Uint8Array([6]);function Uk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(gi)}function pi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Qe()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",I()]]),e=>({...e,discriminator:gi}))}function mi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",$e()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",C()]])}function Wk(){return gill.combineCodec(pi(),mi())}function yi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=y({args:c}),o=l(r);return Object.freeze({accounts:[o(t.authority),...a],data:pi().encode(c),programAddress:r})}function kk(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:mi().decode(e.data)}}var fi=new Uint8Array([7]);function Hk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(fi)}function Si(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Qe()],["secp256r1VerifyArgs",gill.getOptionEncoder(G())],["delegateTo",gill.getOptionEncoder(ns())],["oldSettingsMutArgs",gill.getOptionEncoder(J())],["newSettingsMutArgs",gill.getOptionEncoder(J())],["compressedProofArgs",I()]]),e=>({...e,discriminator:fi}))}function xi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",$e()],["secp256r1VerifyArgs",gill.getOptionDecoder(z())],["delegateTo",gill.getOptionDecoder(ss())],["oldSettingsMutArgs",gill.getOptionDecoder(q())],["newSettingsMutArgs",gill.getOptionDecoder(q())],["compressedProofArgs",C()]])}function Fk(){return gill.combineCodec(Si(),xi())}function Ii(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),o=l(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),...a],data:Si().encode(c),programAddress:r})}function Gk(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:s(),oldSettings:s(),newSettings:s(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s()},data:xi().decode(e.data)}}var Di=new Uint8Array([32]);function Zk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Di)}function Pi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Mt()],["compressedProofArgs",I()],["settingsCreationArgs",Vt()]]),e=>({...e,discriminator:Di}))}function Mi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",ht()],["compressedProofArgs",C()],["settingsCreationArgs",Ht()]])}function Xk(){return gill.combineCodec(Pi(),Mi())}function hi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.authority),...a],data:Pi().encode(c),programAddress:r})}function Qk(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:Mi().decode(e.data)}}var _i=new Uint8Array([31]);function oL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(_i)}function vi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Xe()],["compressedProofArgs",I()],["userCreationArgs",fe()]]),e=>({...e,discriminator:_i}))}function Ui(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Y()],["compressedProofArgs",C()],["userCreationArgs",Se()]])}function cL(){return gill.combineCodec(vi(),Ui())}function Wi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.authority),...a],data:vi().encode(c),programAddress:r})}function aL(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:Ui().decode(e.data)}}var Li=new Uint8Array([29]);function mL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Li)}function Ls(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Q())]]),e=>({...e,discriminator:Li}))}function Oi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder($())]])}function yL(){return gill.combineCodec(Ls(),Oi())}async function lL(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={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(O(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:Ls().encode(c),programAddress:r})}function Bi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:Ls().encode(c),programAddress:r})}function TL(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Oi().decode(e.data)}}var Vi=new Uint8Array([27]);function DL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Vi)}function Hi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Q())],["settingsMutArgs",J()],["compressedProofArgs",I()]]),e=>({...e,discriminator:Vi}))}function Fi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder($())],["settingsMutArgs",q()],["compressedProofArgs",C()]])}function PL(){return gill.combineCodec(Hi(),Fi())}function Gi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:Hi().encode(c),programAddress:r})}function ML(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Fi().decode(e.data)}}var Ji=new Uint8Array([30]);function WL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ji)}function Ns(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["splInterfacePdaArgs",gill.getOptionEncoder(zt())],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccounts",gill.getOptionEncoder(gill.getArrayEncoder(_t()))],["compressedProofArgs",gill.getOptionEncoder(I())],["secp256r1VerifyArgs",gill.getArrayEncoder(Q())]]),e=>({...e,discriminator:Ji}))}function qi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["splInterfacePdaArgs",gill.getOptionDecoder(Kt())],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccounts",gill.getOptionDecoder(gill.getArrayDecoder(vt()))],["compressedProofArgs",gill.getOptionDecoder(C())],["secp256r1VerifyArgs",gill.getArrayDecoder($())]])}function kL(){return gill.combineCodec(Ns(),qi())}async function LL(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={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(O(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(O(t.source.value)),gill.getAddressEncoder().encode(O(t.tokenProgram.value)),gill.getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(O(t.destination.value)),gill.getAddressEncoder().encode(O(t.tokenProgram.value)),gill.getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=y(i),o=l(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),...a],data:Ns().encode(c),programAddress:r})}function Yi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={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 a=y(i),o=l(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),...a],data:Ns().encode(c),programAddress:r})}function OL(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:qi().decode(e.data)}}var td=new Uint8Array([28]);function GL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(td)}function ws(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["splInterfacePdaArgs",gill.getOptionEncoder(zt())],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccounts",gill.getOptionEncoder(gill.getArrayEncoder(_t()))],["secp256r1VerifyArgs",gill.getArrayEncoder(Q())],["settingsMutArgs",J()],["compressedProofArgs",I()]]),e=>({...e,discriminator:td}))}function rd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["splInterfacePdaArgs",gill.getOptionDecoder(Kt())],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccounts",gill.getOptionDecoder(gill.getArrayDecoder(vt()))],["secp256r1VerifyArgs",gill.getArrayDecoder($())],["settingsMutArgs",q()],["compressedProofArgs",C()]])}function zL(){return gill.combineCodec(ws(),rd())}async function KL(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={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(O(t.source.value)),gill.getAddressEncoder().encode(O(t.tokenProgram.value)),gill.getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(O(t.destination.value)),gill.getAddressEncoder().encode(O(t.tokenProgram.value)),gill.getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=y(i),o=l(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),...a],data:ws().encode(c),programAddress:r})}function nd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={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 a=y(i),o=l(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),...a],data:ws().encode(c),programAddress:r})}function jL(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:s(),destinationCtokenTokenAccount:s(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:s(),compressibleConfig:r(),rentSponsor:s(),compressedTokenProgram:r()},data:rd().decode(e.data)}}var cd=new Uint8Array([13]);function $L(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(cd)}function ad(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(G())]]),e=>({...e,discriminator:cd}))}function id(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(z())]])}function eO(){return gill.combineCodec(ad(),id())}function dd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),o=l(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),...a],data:ad().encode(c),programAddress:r})}function tO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:id().decode(e.data)}}var gd=new Uint8Array([23]);function iO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(gd)}function pd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(G())],["settingsMutArgs",J()],["compressedProofArgs",I()]]),e=>({...e,discriminator:gd}))}function md(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(z())],["settingsMutArgs",q()],["compressedProofArgs",C()]])}function dO(){return gill.combineCodec(pd(),md())}function yd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),o=l(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),...a],data:pd().encode(c),programAddress:r})}function uO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:md().decode(e.data)}}var fd=new Uint8Array([10]);function TO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(fd)}function Sd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",jt()],["secp256r1VerifyArgs",gill.getOptionEncoder(G())]]),e=>({...e,discriminator:fd}))}function xd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Jt()],["secp256r1VerifyArgs",gill.getOptionDecoder(z())]])}function fO(){return gill.combineCodec(Sd(),xd())}function Id(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=y(i),o=l(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),...a],data:Sd().encode(c),programAddress:r})}function SO(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:xd().decode(e.data)}}var Dd=new Uint8Array([20]);function MO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Dd)}function Pd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",jt()],["secp256r1VerifyArgs",gill.getOptionEncoder(G())],["settingsReadonlyArgs",Ft()],["compressedProofArgs",I()]]),e=>({...e,discriminator:Dd}))}function Md(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Jt()],["secp256r1VerifyArgs",gill.getOptionDecoder(z())],["settingsReadonlyArgs",Gt()],["compressedProofArgs",C()]])}function hO(){return gill.combineCodec(Pd(),Md())}function hd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=y(i),o=l(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),...a],data:Pd().encode(c),programAddress:r})}function RO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:Md().decode(e.data)}}var _d=new Uint8Array([14]);function LO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(_d)}function vd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(G())]]),e=>({...e,discriminator:_d}))}function Ud(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(z())]])}function OO(){return gill.combineCodec(vd(),Ud())}function Wd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:vd().encode(c),programAddress:r})}function BO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ud().decode(e.data)}}var Od=new Uint8Array([24]);function zO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Od)}function Bd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(G())],["settingsMutArgs",J()],["compressedProofArgs",I()]]),e=>({...e,discriminator:Od}))}function Nd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(z())],["settingsMutArgs",q()],["compressedProofArgs",C()]])}function KO(){return gill.combineCodec(Bd(),Nd())}function wd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Bd().encode(c),programAddress:r})}function jO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Nd().decode(e.data)}}var Fd=new Uint8Array([12]);function QO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Fd)}function Gd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Fd}))}function zd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function $O(){return gill.combineCodec(Gd(),zd())}function Kd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=y({args:c}),o=l(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...a],data:Gd().encode(c),programAddress:r})}function eB(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:zd().decode(e.data)}}var qd=new Uint8Array([22]);function cB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(qd)}function Yd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:qd}))}function Zd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function aB(){return gill.combineCodec(Yd(),Zd())}function Xd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=y({args:c}),o=l(r);return Object.freeze({accounts:[o(t.transactionBuffer),...a],data:Yd().encode(c),programAddress:r})}function iB(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:Zd().decode(e.data)}}var eu=new Uint8Array([11]);function yB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(eu)}function tu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(G())]]),e=>({...e,discriminator:eu}))}function ru(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(z())]])}function lB(){return gill.combineCodec(tu(),ru())}function nu(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),o=l(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),...a],data:tu().encode(c),programAddress:r})}function TB(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ru().decode(e.data)}}var cu=new Uint8Array([21]);function DB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(cu)}function au(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(G())],["settingsReadonlyArgs",Ft()],["compressedProofArgs",I()]]),e=>({...e,discriminator:cu}))}function iu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(z())],["settingsReadonlyArgs",Gt()],["compressedProofArgs",C()]])}function PB(){return gill.combineCodec(au(),iu())}function du(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),o=l(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),...a],data:au().encode(c),programAddress:r})}function MB(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:iu().decode(e.data)}}var gu=new Uint8Array([15]);function UB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(gu)}function pu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:gu}))}function mu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function WB(){return gill.combineCodec(pu(),mu())}function yu(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=y({}),a=l(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:pu().encode({}),programAddress:r})}function kB(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:mu().decode(e.data)}}var fu=new Uint8Array([25]);function VB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(fu)}function Su(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:fu}))}function xu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function HB(){return gill.combineCodec(Su(),xu())}function Iu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=y({args:c}),o=l(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...a],data:Su().encode(c),programAddress:r})}function FB(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:xu().decode(e.data)}}var Du=new Uint8Array([16]);function YB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Du)}function Pu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",qt()],["secp256r1VerifyArgs",gill.getArrayEncoder(Q())]]),e=>({...e,discriminator:Du}))}function Mu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Yt()],["secp256r1VerifyArgs",gill.getArrayDecoder($())]])}function ZB(){return gill.combineCodec(Pu(),Mu())}function hu(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Pu().encode(c),programAddress:r})}function XB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Mu().decode(e.data)}}var _u=new Uint8Array([26]);function sN(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(_u)}function vu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",qt()],["secp256r1VerifyArgs",gill.getArrayEncoder(Q())],["settingsMutArgs",J()],["compressedProofArgs",I()]]),e=>({...e,discriminator:_u}))}function Uu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Yt()],["secp256r1VerifyArgs",gill.getArrayDecoder($())],["settingsMutArgs",q()],["compressedProofArgs",C()]])}function oN(){return gill.combineCodec(vu(),Uu())}function Wu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=y(i),o=l(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:vu().encode(c),programAddress:r})}function cN(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Uu().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",vE=(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))(vE||{});function zN(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 UE=(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))(UE||{});function KN(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 kE=6e3,LE=6001,OE=6002,BE=6003,NE=6004,wE=6005,VE=6006,HE=6007,FE=6008,GE=6009,zE=6010,KE=6011,jE=6012,JE=6013,qE=6014,YE=6015,ZE=6016,XE=6017,QE=6018,$E=6019,eD=6020,tD=6021,rD=6022,nD=6023,sD=6024,oD=6025,cD=6026,aD=6027,iD=6028,dD=6029,uD=6030,AD=6031,gD=6032,pD=6033,mD=6034,yD=6035,lD=6036,TD=6037,fD=6038,SD=6039,xD=6040,ID=6041,CD=6042,ED=6043,DD=6044,PD=6045,MD=6046,hD=6047,RD=6048,bD=6049,_D=6050,vD=6051,UD=6052,WD=6053,kD=6054,LD=6055,OD=6056,BD=6057,ND=6058,wD=6059,VD=6060,HD=6061,FD=6062,GD=6063,zD=6064,KD=6065,jD=6066,JD=6067,qD=6068,YD=6069,ZD=6070,XD=6071,QD=6072,$D=6073,eP=6074,tP=6075,rP=6076,nP=6077,sP=6078,oP=6079,cP=6080,aP=6081,iP=6082,dP=6083,uP=6084,AP=6085,gP=6086,ku;process.env.NODE_ENV!=="production"&&(ku={[AD]:"This member is already delegated to another wallet.",[HE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[nP]:"Clock sysvar access failed. This may indicate a system error.",[vD]:"Missing credential id.",[WD]:"The domain configuration account is disabled. Please contact support or try again later.",[kD]:"Missing domain configuration account.",[tP]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[gP]:"Duplicate address tree detected. This address tree is already in the whitelist.",[zE]:"Duplicate public keys detected among members. Each member must have a unique key.",[GE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[tD]:"No members provided. A multisig wallet must contain at least one member.",[VD]:"Slot numbers list is empty. At least one slot number is required for validation.",[QE]:"Expected a User with Administrator role for this instruction.",[FE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[ZE]:"Expected a User with Transaction Manager role for this instruction.",[xD]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[ID]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[CD]:"Declared buffer size does not match the actual serialized size.",[wD]:"Failed to compute hash. This may indicate a system error.",[mD]:"Not enough members with vote permission to meet the approval threshold.",[gD]:"At least one signer with execute permission is required to proceed.",[pD]:"At least one signer with initiate permission is required to perform this action.",[cD]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[eP]:"Invalid account index in transaction message. The account index is out of bounds.",[BD]:"Address Tree supplied is not part of the whitelisted address trees.",[$E]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[iD]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[SD]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[HD]:"Member key conversion failed. The provided key format is invalid.",[yD]:"Only delegated members are allowed for this transaction.",[oD]:"Unexpected number of accounts provided for this instruction.",[JE]:"User with Permanent Member role must have a delegated wallet.",[LE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[NE]:"The extracted public key has an invalid length or encoding.",[kE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[BE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[_D]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[RD]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[nD]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[XD]:"Invalid source type for token transfer. The source account type is not supported.",[XE]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[YE]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[sD]:"Malformed transaction message: structure or formatting does not match the expected layout.",[cP]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[aD]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[oP]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[ZD]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[wE]:"The extracted WebAuthn signed message payload is malformed.",[MD]:"An input string exceeds the maximum allowed character length.",[LD]:"This member is not registered under the provided domain configuration.",[zD]:"Member not found in settings. Cannot remove a member that does not exist.",[$D]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[dD]:"A required account is missing from the instruction context.",[FD]:"Compressed proof arguments are missing. Required for compressed account operations.",[JD]:"Missing compressed token account. Required for token transfer operations.",[aP]:"Missing destination token account. Required for token transfer operations.",[YD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[GD]:"Light CPI accounts are missing. Required for compressed account operations.",[uD]:"User mutation arguments are required when performing add or remove delegate operations.",[uP]:"Missing new authority account. Required for domain configuration updates.",[dP]:"Missing settings account. Required for delegate operations on compressed wallets.",[ND]:"Compressed settings data is missing. The settings account must be initialized with data.",[iP]:"Missing source token account. Required for token transfer operations.",[qD]:"Missing SPL interface PDA. Required for token transfer operations.",[hD]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[rP]:"User account address is missing. Required for secp256r1 signature verification.",[AP]:"Missing whitelisted address trees account. Required for domain configuration updates.",[TD]:"No valid signer found in this transaction.",[eD]:"Only one administrator is allowed per wallet.",[jE]:"Only one permanent member is allowed per wallet.",[qE]:"Only one transaction manager is allowed per wallet.",[OD]:"The given origin index is not in the whitelisted origins.",[jD]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[KE]:"Permanent members cannot be removed from a wallet.",[PD]:"Writable CPI calls to protected accounts are not permitted.",[VE]:"The rpIdHash extracted from the signed message does not match the expected value.",[KD]:"Settings key mismatch. The provided settings key does not match the expected value.",[OE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[bD]:"The specified slot number was not found in the provided slot history.",[QD]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[rD]:"Too many members: a maximum of 4 members are supported.",[ED]:"This transaction has expired. It must be executed within 3 minutes of approval.",[DD]:"This transaction has not yet reached the required approval threshold.",[UD]:"Missing transports.",[fD]:"Only the transaction creator or rent payer may close this transaction buffer.",[sP]:"Unauthorized: Only the admin account is allowed to perform this action.",[lD]:"Member is not part of the expected signers for this transaction."});function XN(e){return process.env.NODE_ENV!=="production"?ku[e]:"Error message not available in production bundles."}function QN(e,n,r){return gill.isProgramError(e,n,A,r)}async function dw({admin:e,addressTree:n}){return ta({payer:e,addressTree:n,remainingAccounts:[]})}var Fs=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Lu="https://mainnet.block-engine.jito.wtf/api/v1",Ou="https://bundles.jito.wtf/api/v1/bundles/tip_floor",Bu="landed_tips_75th_percentile";var _e=class extends Error{constructor(r,s,t){super(r);this.code=s;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},et=class extends _e{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},re=class extends _e{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},K=class extends _e{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},Ee=class extends _e{constructor(r,s,t){super(r,"NETWORK_ERROR",{statusCode:s,url:t});this.statusCode=s;this.url=t;}};var pe=class extends _e{constructor(r,s,t){super(r,"BUNDLE_ERROR",{bundleId:s,attempt:t});this.bundleId=s;this.attempt=t;}},Nr=class extends _e{constructor(r,s,t){super(`Operation "${r}" failed after ${s} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=s;this.lastError=t;}},wr=class extends _e{constructor(r,s,t){super(r,"PERMISSION_ERROR",{required:s,actual:t});this.required=s;this.actual=t;}};var er={Ed25519:1,Secp256r1:2};var Nu=T__default.default.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),Tw=T__default.default.object({transactionActionType:Nu,transactionAddress:T__default.default.string(),transactionMessageBytes:T__default.default.array(T__default.default.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),pP=T__default.default.object({transactionActionType:Nu,transactionAddress:T__default.default.string(),transactionMessageBytes:T__default.default.base64()}).strict(),wu=T__default.default.object({phase:T__default.default.literal("start"),redirectOrigin:T__default.default.url(),signer:T__default.default.string().optional(),rid:T__default.default.string(),validTill:T__default.default.number(),data:T__default.default.object({type:T__default.default.literal("message"),payload:T__default.default.string()}).strict()}).strict(),Vu=T__default.default.object({phase:T__default.default.literal("start"),redirectOrigin:T__default.default.url(),signer:T__default.default.string().optional(),rid:T__default.default.string(),validTill:T__default.default.number(),data:T__default.default.object({type:T__default.default.literal("transaction"),payload:pP,sendTx:T__default.default.boolean()}).strict()}).strict(),Hu=T__default.default.object({startRequest:T__default.default.union([wu,Vu]),authResponse:T__default.default.custom(),client:T__default.default.object({clientOrigin:T__default.default.url(),jws:T__default.default.string()}).strict(),device:T__default.default.object({jwk:T__default.default.base64(),jws:T__default.default.string()}).strict(),authProvider:T__default.default.object({jwk:T__default.default.base64(),jws:T__default.default.string()}).strict().optional()}).strict(),Fu=T__default.default.object({signer:T__default.default.string(),userAddressTreeIndex:T__default.default.number().optional(),additionalInfo:T__default.default.looseObject({}).optional()}).strict(),mP=T__default.default.object({slotHash:T__default.default.string(),slotNumber:T__default.default.string(),originIndex:T__default.default.number(),crossOrigin:T__default.default.boolean()}).strict(),fw=T__default.default.object({phase:T__default.default.literal("complete"),data:T__default.default.object({type:T__default.default.literal("message"),payload:Fu.extend(Hu.shape).extend({id:T__default.default.string().optional(),client:T__default.default.object({clientOrigin:T__default.default.url()}).strict()})}).strict()}).strict(),Sw=T__default.default.object({phase:T__default.default.literal("complete"),data:T__default.default.object({type:T__default.default.literal("transaction"),payload:Fu.extend(Hu.shape).extend(mP.shape).extend({client:T__default.default.object({clientOrigin:T__default.default.url()}).strict()})}).strict()}).strict(),xw=T__default.default.object({phase:T__default.default.literal("complete"),data:T__default.default.object({type:T__default.default.literal("transaction"),payload:T__default.default.object({startRequest:T__default.default.union([Vu,wu]),txSig:T__default.default.string()})}).strict()}).strict();var ve={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Oe=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(ve).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var Gs=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!==Gs)throw new Error(`Invalid public key length, expected ${Gs} 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===Gs)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()}},P=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 TP(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function fP(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var zu=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(TP())],["addressTableLookups",gill.getArrayCodec(fP())]]);function Ku(e){return zu.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 ju(e){let n=zu.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}var de={};function Ju(){if(!de.solanaRpcEndpoint)throw new et("RPC endpoint");return de.solanaRpcEndpoint}function De(){if(!de.lightProtocolRpc)throw new et("Light Protocol RPC");return de.lightProtocolRpc}function ee(){if(!de.solanaRpc)throw new et("Solana RPC");return de.solanaRpc}function qu(){if(!de.sendAndConfirm)throw new et("Send and confirm transaction function");return de.sendAndConfirm}function Ks(){return de.jitoTipsConfig?de.jitoTipsConfig:{blockEngineUrl:Lu,getJitoTipsUrl:Ou,priority:Bu}}function Gw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){de.solanaRpcEndpoint=e,de.lightProtocolRpc=stateless_js.createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=gill.createSolanaClient({urlOrMoniker:e});de.solanaRpc=t,de.sendAndConfirm=c,de.jitoTipsConfig=s??null;}async function tr(e,n){if(!e.ok)throw new Ee(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function rr(e){try{return await e.json()}catch(n){throw new Ee(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function s2(e){let n=tinyCbor.decodeCBOR(e),r=nist_js.p256.Point.fromAffine({x:BigInt("0x"+Hr(n.get(-2))),y:BigInt("0x"+Hr(n.get(-3)))});return gill.getBase58Decoder().decode(r.toBytes(true))}function o2(e){let r=nist_js.p256.Point.fromBytes(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 c2(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=Ie(n),c=JSON.parse(gill.getUtf8Decoder().decode(Ie(r))),i=Qu(c),a=eA(Ie(s)),o=await ut({rpIdHash:t.subarray(0,32)});return new P(e.signer.toString(),{verifyArgs:{clientDataJson:Ie(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:gill.getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:js(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:o,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function js(e,n,r){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...gill.getBase64Encoder().encode(n),...gill.getBase64Encoder().encode(r)]))}function a2(e){return sha2_js.sha256(gill.getUtf8Encoder().encode(JSON.stringify(e)))}function i2(e){return Js(e.data.payload.authResponse)}function d2(e,n,r,s){let t=js(n,r,s);return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...t]))}async function u2(e,n,r,s,t,c){let i;if(!t||!c){let u=(await ee().getAccountInfo(gill.address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!u)throw new re("Slot sysvar","Unable to fetch slot sysvar data");let g=gill.getBase64Encoder().encode(u[0]);c=gill.getU64Decoder().decode(g.subarray(0,8)).toString(),i=g.subarray(8,40),t=gill.getBase58Decoder().decode(i);}else i=gill.getBase58Encoder().encode(t);let a=sha2_js.sha256(typeof e.transactionMessageBytes=="string"?gill.getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),o=js(n,r,s),d=sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e.transactionActionType),...gill.getBase58Encoder().encode(e.transactionAddress),...a,...i,...o]));return {slotNumber:c,slotHash:t,challenge:d}}function Js(e){let n=Fr(e);return sha2_js.sha256(n)}function A2(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ie(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),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}async function g2(e,n){let{data:r}=await Io(ee(),e),t=$u(r.origins,r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new re("Origin","Origin not found in domain config");return t}function p2(e){return gill.getBase64Decoder().decode(gill.getUtf8Encoder().encode(jsonCanonicalize.canonicalize(e)))}function m2(e){return JSON.parse(gill.getUtf8Decoder().decode(gill.getBase64Encoder().encode(e)))}function Hr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function RP(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 Qu(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 $u(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 i=e[s]|e[s+1]<<8;if(s+=2,s+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(s,s+i),o=t.decode(a);r.push(o),s+=i;}return r}function eA(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 b=n&127;r+=b;}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 i=e[r+1],a=r+2,o=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let p=nist_js.p256.Point.CURVE().n>>1n,f=BigInt("0x"+Hr(u)),E=(f>p?nist_js.p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=RP(E);return new Uint8Array([...g,...x])}function Fr(e){let n=Ie(e.response.clientDataJSON),r=Ie(e.response.authenticatorData),s=sha2_js.sha256(n);return new Uint8Array([...r,...s])}var kP={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true,initialDelayMs:500,maxRetries:3};function LP(e,n,r,s){let t=n*Math.pow(r,e-1);return Math.min(t,s)}function OP(e){return new Promise(n=>setTimeout(n,e))}async function or(e,n){let{maxRetries:r,initialDelayMs:s,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...kP,...n},a;for(let o=1;o<=r;o++)try{return await e()}catch(d){if(a=d,i&&!i(d,o))throw d;if(o>=r)break;let u=LP(o,s,t,c);await OP(u);}throw new Nr(e.name||"retryWithBackoff",r,a)}async function At(e,n){let r=(s,t)=>t>(n?.maxRetries??3)?false:s instanceof Response?s.status===429?n?.retryOnRateLimit??true:s.status>=400&&s.status<500?false:s.status>=500:s instanceof TypeError||s instanceof Error;return or(e,{...n,shouldRetry:n?.shouldRetry??r})}function sA(e,n,r,s){if(e<n||e>r)throw new K(`${s} must be between ${n} and ${r} (inclusive), got ${e}`)}function oA(e,n){if(e<0)throw new K(`${n} must be non-negative, got ${e}`)}function cr(e,n){if(e.length===0)throw new K(`${n} cannot be empty`)}function cA(e,n){if(e.trim().length===0)throw new K(`${n} cannot be empty`)}async function Ys(e,n=false){let r=n?{blockhash:gill.getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await ee().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 i=Math.ceil((s.unitsConsumed??0)*1.1);return i>2e5?gill.prependTransactionMessageInstructions([programs.getSetComputeUnitLimitInstruction({units:i})],c):c},async c=>n?gill.compileTransaction(await c):await gill.signTransactionMessageWithSigners(await c))))}async function gA(e){let n=gill.prependTransactionMessageInstructions([programs.getSetComputeUnitLimitInstruction({units:8e5}),programs.getSetComputeUnitPriceInstruction({microLamports:1e4})],e),r=gill.getBase64EncodedWireTransaction(gill.compileTransaction(n));if(r.length>1644)throw new K(`Transaction exceeds maximum length of ${1644} bytes (actual: ${r.length} bytes)`);let s=await ee().simulateTransaction(r,{encoding:"base64"}).send();if(s.value.err){if(s.value.logs){let c=["Transaction simulation failed:","",...s.value.logs].join(`
|
|
2
|
-
`);throw new Error(c)}let t=["Transaction simulation failed:","",
|
|
3
|
-
`);throw new Error(t)}return s.value.unitsConsumed}async function pA(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,i)=>c-i);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function mA(e,n){cr(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new K(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await At(()=>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:[]}))}]})}));await tr(r,n);let s=await rr(r);if(!s.result||s.error)throw new pe(`Unable to simulate bundle: ${JSON.stringify(s.error??s.result)}`);if(typeof s.result.value.summary!="string"&&s.result.value.summary.failed){let{TransactionFailure:t}=s.result.value.summary.failed.error,[,c]=t;throw new pe(`Simulation failed: ${c}`)}return s.result.value.transactionResults.map(t=>t.unitsConsumed)}function Z(e,n=0){let r=e instanceof P?e:void 0,s=r?.verifyArgs&&n!==-1?gill.some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):gill.none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs.clientDataJson?Fr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:i,publicKey:a}}function Pe(e){if(e instanceof Be)return {keyType:er.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:er.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function iA(e){return e instanceof P?e.toString():e.address.toString()}function le(e){let n=new Set,r=[];for(let t of e)n.has(iA(t))||(r.push(t),n.add(iA(t)));let s=r.filter(t=>t instanceof P);if(s.length>1)throw new K(`More than 1 Secp256r1 signers in an instruction is not supported (found ${s.length})`);return r}function yA({payer:e,tipAmount:n}){let r=Fs[Math.floor(Math.random()*Fs.length)];return programs.getTransferSolInstruction({source:e,destination:gill.address(r),amount:n})}function lA(e){return typeof e=="string"?e:e.toString()}function TA(e){return e.toString()}async function Zs(e,n,r){let s=e?.get(n);if(s)return s;let t=await r();return t&&e&&e.set(n,t),t}var B=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?gill.AccountRole.WRITABLE_SIGNER:gill.AccountRole.READONLY_SIGNER:r?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...stateless_js.getLightSystemAccountMetasV2({selfProgram:new web3_js.PublicKey(A.toString())}).map(n=>({address:gill.address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,gill.AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:gill.address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===stateless_js.TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===stateless_js.TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await De().getStateTreeInfos(),r=stateless_js.selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,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 i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}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 zr(e,n){let r=lA(e);return Zs(n,r,()=>De().getCompressedAccount(e))}async function rt(e,n){let r=TA(e);return Zs(n,r,()=>ee().getAccountInfo(e,{encoding:"base64"}).send())}async function me(e,n){let r=(await Promise.all(e.map(s=>zr(s.address,n)))).filter(s=>s!==null).filter(s=>s.data!==null&&s.address!==null);if(r.length!==e.length)throw new re("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((s,t)=>({...s,type:e[t].type,tree:s.treeInfo.tree,queue:s.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((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:s[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function ae(e,n,r,s,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:s[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let o=e.packTreeInfos(a,[]).stateTrees;if(!o)throw new K("Unable to parse state tree data");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Me(e,n,r,s,t){let c=null,i=null,a=null,o=new B;if(e){await o.addSystemAccounts();let{address:d}=await oe(n,r),u=(await me([{address:d,type:"Settings"}],t))[0];s?a={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:a=await V([u],[]);let g=o.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!g)throw new K("Unable to parse state tree data");c={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0]},data:j().decode(u.data?.data)},i={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:j().decode(u.data?.data)};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:o,settingsMutArgs:i}}async function V(e,n){return or(()=>De().getValidityProofV0(e,n))}async function he(){return (await Kr()).length-1}var Xs;async function Kr(){if(!Xs){let{data:e}=await Zc(ee(),await IA());Xs=e.whitelistedAddressTrees;}return Xs}function xA(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let n=e[7];return n===3?2:3}async function ir(e,n,r){let s=await sM(e,n,r);if(!s)throw new re("User account");return s}async function sM(e,n,r){let{address:s}=await N(e,n),t=await zr(s,r);return t?.data?.data?Y().decode(t.data.data):null}async function i5(e,{member:n,credentialId:r}){let s=[{memcmp:{offset:1,encoding:"base58",bytes:e}}];if(n)s.push({memcmp:{offset:33,encoding:"base58",bytes:gill.getBase58Decoder().decode(F().encode(Pe(n)))}});else if(r)s.push({memcmp:{offset:72,encoding:"base58",bytes:gill.getBase58Decoder().decode(Ie(r))}});else return null;let t=await De().getCompressedAccountsByOwner(new web3_js.PublicKey(A.toString()),{filters:s});return t.items.filter(c=>!!c.data).length?t.items.map(c=>Y().decode(c.data?.data))[0]:null}async function jr(e,n,r){let s=await oM(e,n,r);if(!s)throw new re("Settings account");return s}async function oM(e,n,r){try{let{address:s}=await oe(e,n),t=await zr(s,r);if(!t?.data?.data)throw new re("Compressed settings account");let c=j().decode(t.data.data);if(c.data.__option==="None")throw new re("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let s=await ls(ee(),e);return s.exists?{...s.data,isCompressed:false}:null}}async function d5(e,n,r){let s=await ir(e,n,r);if(s.role===1||s.role===0){let t=[],[c,i]=await Promise.all([De().getCompressedAccountsByOwner(new web3_js.PublicKey(A.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:gill.getBase58Decoder().decode(F().encode(Pe(e)))}}]}),ee().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:gill.getBase64Decoder().decode(F().encode(Pe(e)))}}]}).send()]);return c.items.forEach(a=>{if(a.data?.data){let o=j().decode(a.data.data);o.data.__option==="Some"&&t.push({...o.data.value,isCompressed:true});}}),i.forEach(a=>{let o=Rr().decode(gill.getBase64Encoder().encode(a.account.data[0]));t.push({...o,isCompressed:false});}),t}else return await Promise.all(s.wallets.map(async t=>jr(await Re(t.index),t.settingsAddressTreeIndex,r)))}async function $s(e){oA(e,"index");let n=await Kr();if(e>=n.length)throw new K(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function u5(e){let r=(await Kr()).findIndex(s=>s.toString()===e);if(r===-1)throw new re("Address tree",`Address ${e} not found in whitelist`);return r}async function oe(e,n=0){let r=await $s(n),s=stateless_js.deriveAddressSeedV2([gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e)]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function N(e,n=0){let r=await $s(n),s=stateless_js.deriveAddressSeedV2([gill.getUtf8Encoder().encode("user"),e instanceof Be?e.toTruncatedBuffer():gill.getAddressEncoder().encode(e)]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function ut({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha2_js.sha256(gill.getUtf8Encoder().encode(n));else throw new K("Either rpId or rpIdHash must be provided");let[r]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("domain_config"),e]});return r}async function MA(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function IA(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function hA(e,n,r){sA(r,0,255,"buffer_index");let[s]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),n instanceof Be?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return s}async function Ue(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return n}async function Re(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function C5(e){let n=await Re(e);return await Ue(n)}async function E5(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}async function W5(e){cr(e,"bundle");let n=await Ys(e,true),r=await mA(n.map(gill.getBase64EncodedWireTransaction),Ju()),s=await Ys(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await gM(s.map(gill.getBase64EncodedWireTransaction))}async function gM(e,n=Ks(),r){cr(e,"serializedTransactions");let{blockEngineUrl:s}=n,t=`${s}/bundles`,c=await At(()=>fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})}),r);await tr(c,t);let i=await rr(c);if(i.error)throw new pe(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new pe("No bundle ID returned from Jito");return i.result}async function k5(e,n=30,r=3e3,s=Ks()){cA(e,"bundleId");let{blockEngineUrl:t}=s,c=`${t}/getBundleStatuses`;return or(async()=>{let i=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await tr(i,c);let a=await rr(i);if(a.error)throw new pe(`Error getting bundle status: ${JSON.stringify(a.error,null,2)}`,e);if(!a.result?.value?.length)throw new pe("Bundle not yet confirmed",e);let o=a.result.value[0];if(o.confirmation_status==="confirmed"||o.confirmation_status==="finalized"){let d=o.transactions[o.transactions.length-1];if(!d)throw new pe("No transactions in confirmed bundle",e);return d}throw new pe(`Bundle status: ${o.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:i=>i instanceof pe||i instanceof Ee})}async function H5({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await ee().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[i,a]=await Promise.all([gA(c),pA(ee(),c.instructions.flatMap(d=>d.accounts??[]))]),o=Math.ceil((Number(i)??0)*1.1);return gill.prependTransactionMessageInstructions([...o>2e5?[programs.getSetComputeUnitLimitInstruction({units:o})]:[],...a>0?[programs.getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await gill.signTransactionMessageWithSigners(await c));return await qu()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}function r6(e,n){if(n.threshold>1)throw new K("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(o=>vA(o.pubkey)===e);if(!r)throw new re("Member",`Signer ${e} not found in settings`);let{permissions:s}=r;if(!s)throw new re("Permissions","No permissions found for the current member");let t=Oe.has(s,ve.InitiateTransaction),c=Oe.has(s,ve.VoteTransaction),i=Oe.has(s,ve.ExecuteTransaction);if(t&&c&&i)return {};if(!c||!i)throw new wr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(o=>o.role===0);if(!a)throw new re("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:gill.address(vA(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function n6({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await ir(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new re("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return bM(n,c.transactionManagerUrl.value,e,s)}function bM(e,n,r,s){return {address:e,async signTransactions(t){let c=await At(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:e.toString(),payload:t.map(a=>({transaction:gill.getBase64Decoder().decode(gill.getTransactionEncoder().encode(a)),transactionMessageBytes:s?gill.getBase64Decoder().decode(s):void 0,authResponses:r}))})}));if(!c.ok)throw new Ee(`Transaction manager request failed: ${c.statusText}`,c.status,n);let i=await c.json();if("error"in i)throw new Ee(`Transaction manager error: ${i.error}`,c.status,n);return i.signatures.map(a=>({[e]:gill.getBase58Encoder().encode(a)}))}}}function vA(e){return e.keyType===er.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}function s6(e){let n=e.map(c=>Ge().encode(c)),r=4+n.reduce((c,i)=>c+i.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 o6(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 i=ze().read(e,n);t[c]=i[0],n=i[1];}if(n!==e.length)throw new K(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function I6({payer:e,rpId:n,origins:r,authority:s}){let t=await ut({rpId:n}),c=new B;await c.addSystemAccounts();let i=await he(),{address:a,addressTree:o}=await N(s.address,i),d=[{address:a,tree:o,queue:o,type:"User"}],u=await V([],d),g=(await Ae(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:f}=c.toAccountMetas(),S=v(u,f);return await Ua({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function U6({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let i=[];r.settings&&(i.push({address:(await oe(r.settings,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&i.push({address:(await N(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let a=i.length?await me(i,t):[],o=await he(),{address:d,addressTree:u}=await N(r.member,o),g=[{address:d,type:"User",tree:u,queue:u}],p=await V(a,g),f=null,S=null,E=a.filter(w=>w.type==="Settings"),x=a.filter(w=>w.type==="User");E.length&&(f=ae(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),E,j())[0]),x.length&&(S=ae(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,Y())[0]);let b=await Ae(c,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),g),{remainingAccounts:D,systemOffset:_}=c.toAccountMetas(),U=v(p,_);return await Ba({payer:n,authority:e,compressedProofArgs:U,member:wt().decode(r.member.toBuffer()),credentialId:Ie(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:f?gill.some({settingsMutArgs:f,transactionManager:S?gill.some(S):gill.none()}):gill.none(),userAccountCreationArgs:b[0],domainConfig:s,remainingAccounts:D})}async function O6({payer:e}){let n=await MA();return Ha({payer:e,globalCounter:n})}async function V6({admin:e,rpId:n,disable:r}){let s=await ut({rpId:n});return ni({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function J6({args:e,authority:n,settings:r,settingsAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:i}=await oe(r,s),a=[{address:c,tree:i,queue:i,type:"Settings"}],o=await V([],a),d=(await Ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return hi({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function eV({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:i}=await N(r,s),a=[{address:c,tree:i,queue:i,type:"User"}],o=await V([],a),d=(await Ae(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Wi({compressedProofArgs:p,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}function vM(e,n,r,s){let t=UM(e,n),c=WM(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 UM(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=s-t,a=r-s-c;return n>=r?false:n<i?true:n>=s?n-s<a:false}function WM(e,n){return n<e.header.numSignerAccounts}async function Jr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=ju(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await gill.fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),ee()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:gill.AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,o]of t.staticAccounts.entries())i.push({address:o,role:vM(t,a,o,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let o=c[a.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:gill.AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:gill.AccountRole.READONLY});}}for(let a of s?.filter(o=>o.address!==e)??[]){let o=i.findIndex(d=>d.address===a.address);o===-1?i.push({address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}):i[o].role===gill.AccountRole.READONLY||i[o].role===gill.AccountRole.READONLY_SIGNER?i[o]={address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}:(i[o].role===gill.AccountRole.WRITABLE||i[o].role===gill.AccountRole.WRITABLE_SIGNER)&&(i[o]={address:a.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}var pt=33,mt=64,no=14,VM=2,HM=gill.address("Secp256r1SigVerify1111111111111111111111111");function FM(){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 GM(){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 BA(){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=GM();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=no;let i=[];for(let a=0;a<r;a++){let o=gill.fixDecoderSize(gill.getBytesDecoder(),pt).decode(e,n);n+=pt;let d=gill.fixDecoderSize(gill.getBytesDecoder(),mt).decode(e,n);n+=mt;let u=t[a].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:i},n]}})}function NA(){return gill.createEncoder({getSizeFromValue:e=>{let n=no*e.offsets.length,r=e.payload.reduce((s,t)=>s+pt+mt+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=FM();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=gill.fixEncoderSize(gill.getBytesEncoder(),pt).write(t.publicKey,n,r),r=gill.fixEncoderSize(gill.getBytesEncoder(),mt).write(t.signature,n,r),r=gill.getBytesEncoder().write(t.message,n,r);return r}})}function yV(){return gill.combineCodec(NA(),BA())}function H(e,n){let r=e.length,s=VM+r*no,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,g=u+pt,p=g+mt;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),s+=pt+mt+d.length;}let c=n?.programAddress??HM,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:NA().encode(i)}}function lV(e){return {programAddress:e.programAddress,accounts:{},data:BA().decode(e.data)}}async function wA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:o=false}){let d=await Ue(e),{accountMetas:u,addressLookupTableAccounts:g}=await Jr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(H(c)),p.push(o?Iu({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):yu({transactionBuffer:n,payer:s.address,settings:e})),a&&p.push(yA({payer:s,tipAmount:a})),{instructions:p,addressLookupTableAccounts:g}}async function VA({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:i=[],compressed:a=false,simulateProof:o=false,cachedAccounts:d}){let u=le(s),g=await Ue(e),[{accountMetas:p,addressLookupTableAccounts:f,transactionMessage:S},{settingsMutArgs:E,proof:x,packedAccounts:b}]=await Promise.all([Jr({transactionMessageBytes:r,walletAddress:g,additionalSigners:u.filter(te=>!(te instanceof P)),addressesByLookupTableAddress:c}),Me(a,e,n,o,d)]);b.addPreAccounts(p);let D=u.filter(te=>te instanceof P),{secp256r1VerifyArgs:_}=KM(D,i,b),{remainingAccounts:U,systemOffset:w}=b.toAccountMetas();return {instructions:jM({secp256r1VerifyInput:i,transactionMessage:S,accountMetas:p,compressed:a,payer:t,settingsMutArgs:E,proof:x,systemOffset:w,secp256r1VerifyArgs:_,settings:e,remainingAccounts:U}),addressLookupTableAccounts:f}}function KM(e,n,r){let s=[];for(let t of e){let c=n.length,{domainConfig:i,verifyArgs:a,signature:o,publicKey:d,message:u}=Z(t,c);u&&o&&d&&n.push({message:u,signature:o,publicKey:d}),i&&(r.addPreAccounts([{address:i,role:gill.AccountRole.READONLY}]),a.__option==="Some"&&s.push({domainConfigKey:i,verifyArgs:a.value}));}return {secp256r1VerifyArgs:s}}function jM({secp256r1VerifyInput:e,transactionMessage:n,accountMetas:r,compressed:s,payer:t,settingsMutArgs:c,proof:i,systemOffset:a,secp256r1VerifyArgs:o,settings:d,remainingAccounts:u}){let g=[];e.length>0&&g.push(H(e));let p=JM(n,r);if(s){if(!t||!c)throw new Error("Payer not found or proof args is missing.");let f=v(i,a);g.push(Wu({secp256r1VerifyArgs:o,transactionMessage:p,settingsMutArgs:c,compressedProofArgs:f,payer:t,remainingAccounts:u}));}else g.push(hu({secp256r1VerifyArgs:o,settings:d,transactionMessage:p,remainingAccounts:u}));return g}function JM(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: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 VV({settings:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let o=le(s),d=await Ue(e),[{packedAccounts:u,proof:g,settingsMutArgs:p},{value:f}]=await Promise.all([Me(a,e,n,false,t),rt(d,t)]);if((f?.lamports??0)<BigInt(c))throw new Error("Insufficient balance");let S=[],E=[];for(let _ of o)if(_ instanceof P){let U=S.length,{domainConfig:w,verifyArgs:ce,signature:te,publicKey:ie,message:ye}=Z(_,U);ye&&te&&ie&&S.push({message:ye,signature:te,publicKey:ie}),w&&(u.addPreAccounts([{address:w,role:gill.AccountRole.READONLY}]),ce.__option==="Some"&&E.push({domainConfigKey:w,verifyArgs:ce.value}));}else u.addPreAccounts([{address:_.address,role:gill.AccountRole.READONLY_SIGNER,signer:_}]);let{remainingAccounts:x,systemOffset:b}=u.toAccountMetas(),D=[];if(S.length>0&&D.push(H(S)),a){if(!i||!p)throw new Error("Payer not found or proof args is missing.");let _=v(g,b);D.push(Gi({amount:c,settingsMutArgs:p,compressedProofArgs:_,payer:i,secp256r1VerifyArgs:E,source:d,destination:r,remainingAccounts:x}));}else D.push(Bi({amount:c,secp256r1VerifyArgs:E,source:d,destination:r,settings:e,remainingAccounts:x}));return D}var $M=gill.address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),eh=gill.address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Yr=gill.address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function $V({settings:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:o,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false}){let g=le(t),p=await Ue(e),f=W=>gill.getProgramDerivedAddress({seeds:[gill.getAddressEncoder().encode(W),gill.getAddressEncoder().encode(Yr),gill.getAddressEncoder().encode(s)],programAddress:Yr}),S=()=>{let W=[gill.getUtf8Encoder().encode("pool"),gill.getAddressEncoder().encode(s)];return d.restricted&&W.push(gill.getUtf8Encoder().encode("restricted")),d.index>0&&W.push(gill.getU8Encoder().encode(d.index)),W},[E,[x],b,[D],[_]]=await Promise.all([programs.getAssociatedTokenAccountAddress(s,p,o),f(p),programs.getAssociatedTokenAccountAddress(s,r,o),f(r),gill.getProgramDerivedAddress({seeds:S(),programAddress:Yr})]),[U,w,ce,te]=await Promise.all([rt(b,c),rt(E,c),rt(x,c),nh(u,e,n,c)]),ie=!!U.value,ye=!!w.value,yt=!!ce.value,be=ye?programs.getTokenDecoder().decode(gill.getBase64Encoder().encode(w.value.data[0])).amount:BigInt(0),ue=BigInt(yt?sh(gill.getBase64Encoder().encode(ce.value.data[0]))?.amount??0:0),ct=ie?b:void 0,$r=ie?void 0:D,lt=ye&&(be+ue<BigInt(i)||ue>BigInt(0)||!ie)||!ye&&ie,en=!ie,[m,Ao]=await Promise.all([rh(p,s,be,ue,BigInt(i),u?3:4),th(lt,_,c)]),X=m.reduce((W,ne)=>W+ne.parsed.amount.toNumber(),0);if(be+ue+BigInt(X)<BigInt(i))throw new Error("Insufficient balance");let at=null,We=null,ke=new B;if(Ao&&ke.addPreAccounts([{address:s,role:gill.AccountRole.WRITABLE}]),te||m.length){await ke.addSystemAccounts();let W=[];if(m.length&&W.push(...m.map(ne=>({hash:ne.compressedAccount.hash,tree:ne.compressedAccount.treeInfo.tree,queue:ne.compressedAccount.treeInfo.queue,data:ne.compressedAccount.data,address:ne.compressedAccount.address}))),te&&W.push(te),We=await V(W,[]),te){let ne=m.length;at=ae(ke,We.treeInfos.slice(ne),We.leafIndices.slice(ne),We.rootIndices.slice(ne),We.proveByIndices.slice(ne),W.slice(ne),j())[0];}}let og=m.length&&We?gill.some(m.map((W,ne)=>({isFrozen:W.parsed.state===programs.AccountState.Frozen,hasDelegate:W.parsed.delegate!=null,amount:W.parsed.amount.toNumber(),merkleContext:{leafIndex:W.compressedAccount.leafIndex,merkleTreePubkeyIndex:ke.insertOrGet(W.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:ke.insertOrGet(W.compressedAccount.treeInfo.queue.toString()),proveByIndex:W.compressedAccount.proveByIndex},rootIndex:We.rootIndices[ne],version:xA(W.compressedAccount.data?.discriminator),tlv:W.parsed.tlv?gill.some(gill.getArrayDecoder(Ut()).decode(W.parsed.tlv)):gill.none()}))):gill.none(),ur=[],go=[];for(let W of g)if(W instanceof P){let ne=ur.length,{domainConfig:tn,verifyArgs:mo,signature:yo,publicKey:lo,message:To}=Z(W,ne);To&&yo&&lo&&ur.push({message:To,signature:yo,publicKey:lo}),tn&&(ke.addPreAccounts([{address:tn,role:gill.AccountRole.READONLY}]),mo.__option==="Some"&&go.push({domainConfigKey:tn,verifyArgs:mo.value}));}else ke.addPreAccounts([{address:W.address,role:gill.AccountRole.READONLY_SIGNER,signer:W}]);let{remainingAccounts:cg,systemOffset:ag}=ke.toAccountMetas(),Ar=[];ur.length>0&&Ar.push(H(ur));let ig=v(We,ag),dg=lt?_:void 0,ug=en?eh:void 0,Ag=lt?gill.some(d):gill.none(),po={amount:i,secp256r1VerifyArgs:go,source:p,destination:r,sourceCtokenTokenAccount:x,sourceSplTokenAccount:E,destinationCtokenTokenAccount:$r,destinationSplTokenAccount:ct,mint:s,tokenProgram:o,remainingAccounts:cg,payer:a,sourceCompressedTokenAccounts:og,compressedProofArgs:ig,compressibleConfig:$M,splInterfacePda:dg,rentSponsor:ug,splInterfacePdaArgs:Ag};if(u){if(!at)throw new Error("Payer not found or proof args is missing.");Ar.push(nd({...po,settingsMutArgs:at}));}else Ar.push(Yi({...po,settings:e}));return Ar}async function th(e,n,r){if(!e)return false;let{value:s}=await rt(n,r);return !s}async function rh(e,n,r,s,t,c){let i=t-r-s;if(i<=0)return [];let o=(await De().getCompressedTokenAccountsByOwner(new web3_js.PublicKey(e),{mint:new web3_js.PublicKey(n)})).items.filter(g=>!!g.compressedAccount.data?.data.length&&g.compressedAccount.owner.toString()===Yr.toString()&&!g.parsed.amount.isZero()).sort((g,p)=>p.parsed.amount.cmp(g.parsed.amount));if(o.length===0)return [];let d=BigInt(0),u=[];for(let g of o){if(u.length>=c||d>=i)break;d+=BigInt(g.parsed.amount.toNumber()),u.push(g);}if(d<i)throw u.length>=c?new Error("Transaction size limit exceeded. Consider multiple transfers to transfer full balance."):new Error("Insufficient balance.");return u}async function nh(e,n,r,s){if(!e)return null;let{address:t}=await oe(n,r);return (await me([{address:t,type:"Settings"}],s))[0]}function sh(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 u8({signers:e,payer:n,changeConfigArgs:r}){let{settings:s,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:o}=r,d=le(e),u=d.filter(D=>!(D instanceof P));i.addPreAccounts(u.map(D=>({address:D.address,role:gill.AccountRole.READONLY_SIGNER,signer:D})));let g=d.filter(D=>D instanceof P),p=[],f=[];for(let D of g){let _=f.length,{domainConfig:U,verifyArgs:w,signature:ce,publicKey:te,message:ie}=Z(D,_);ie&&ce&&te&&f.push({message:ie,signature:ce,publicKey:te}),U&&(i.addPreAccounts([{address:U,role:gill.AccountRole.READONLY}]),w.__option==="Some"&&p.push({domainConfigKey:U,verifyArgs:w.value}));}let{remainingAccounts:S,systemOffset:E}=i.toAccountMetas(),x=v(a,E),b=[];if(f.length>0&&b.push(H(f)),c){if(!o)throw new Error("Payer not found or proof args is missing.");b.push(Ta({configActions:t,payer:n,compressedProofArgs:x,settingsMutArgs:o,remainingAccounts:S,secp256r1VerifyArgs:p}));}else b.push(da({settings:s,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:S,secp256r1VerifyArgs:p}));return b}async function T8({createUserArgs:e,payer:n}){let r=new B;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:u.member})));let s=await he(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:p}=await N(u.member.address,s);return {address:g,tree:p,queue:p,type:"User"}})),c=await V([],t),i=await Ae(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:o}=r.toAccountMetas(),d=v(c,o);return await Ka({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:i[g],transactionManagerUrl:u.role===0?u.transactionManagerUrl:null})),remainingAccounts:a})}async function D8({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let i=[],a=[];a.push(...await me([{address:(await N(r.address,s)).address,type:"User"}],t));let o=await he(),{address:d,addressTree:u}=await oe(await Re(e),o);i.push({address:d,queue:u,tree:u,type:"Settings"});let g=a.length,p=await V(a,i),f=ae(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),a.filter(_=>_.type==="User"),Y())[0],E=(await Ae(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),i)).find(_=>_.type==="Settings")??null,{remainingAccounts:x,systemOffset:b}=c.toAccountMetas(),D=v(p,b);if(!E)throw new Error("Settings creation args is missing.");return await Ca({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:D,settingsCreation:E,remainingAccounts:x})}async function U8({settings:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await Me(true,e,n,false,t);if(!a)throw new Error("Proof args is missing");let o=le(s),d=o.filter(x=>x instanceof P),u=[],g=[];for(let x of d){let b=u.length,{domainConfig:D,verifyArgs:_,signature:U,publicKey:w,message:ce}=Z(x,b);ce&&U&&w&&u.push({message:ce,signature:U,publicKey:w}),D&&(c.addPreAccounts([{address:D,role:gill.AccountRole.READONLY}]),_.__option==="Some"&&g.push({domainConfigKey:D,verifyArgs:_.value}));}c.addPreAccounts(o.filter(x=>"address"in x).map(x=>({address:x.address,role:gill.AccountRole.READONLY_SIGNER,signer:x})));let{remainingAccounts:p,systemOffset:f}=c.toAccountMetas(),S=v(i,f),E=[];return u.length>0&&E.push(H(u)),E.push(Xa({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:S,secp256r1VerifyArgs:g,remainingAccounts:p})),E}async function w8({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let i=new B;await i.addSystemAccounts();let a=await he(),{address:o,addressTree:d}=await N(r.address,a),u=[{address:o,tree:d,queue:d,type:"User"}],g=await V([],u),p=(await Ae(i,g.treeInfos,g.roots,g.rootIndices,u))[0],f=i.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:v(g,f.systemOffset),authorityCreationArgs:p};}return di({domainConfig:n,authority:e,newOrigins:s?gill.some(s):gill.none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function K8({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new B;await s.addSystemAccounts();let t=await me([{address:(await N(e.address,n)).address,type:"User"}]),c=await V(t,[]),i=ae(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,Y())[0],{remainingAccounts:a,systemOffset:o}=s.toAccountMetas(),d=v(c,o);return yi({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function tH({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:o,publicKey:d}=Z(n),u=[];a&&o&&d&&u.push({message:a,signature:o,publicKey:d});let g=await ir(n instanceof P?n:n.address,r,t),p=[];p.push({address:(await N(n instanceof P?n:n.address,r)).address,type:"User"});let f,S=null,E,x=null,b=g.wallets.find(ue=>ue.isDelegate);if(b){let ue=await Re(b.index);(await jr(ue,b.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await oe(ue,b.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):f=await Re(b.index);}if(s){let ue=await Re(s.index);(await jr(ue,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await oe(ue,s.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):E=await Re(s.index);}let D=new B;await D.addSystemAccounts();let _=await me(p,t),U=await V(_,[]),w=ae(D,U.treeInfos.slice(0,1),U.leafIndices.slice(0,1),U.rootIndices.slice(0,1),U.proveByIndices.slice(0,1),_.slice(0,1),Y())[0],ce=S?gill.some(ae(D,U.treeInfos.slice(S.start,S.end),U.leafIndices.slice(S.start,S.end),U.rootIndices.slice(S.start,S.end),U.proveByIndices.slice(S.start,S.end),_.slice(S.start,S.end),j())[0]):gill.none(),te=x?gill.some(ae(D,U.treeInfos.slice(x.start,x.end),U.leafIndices.slice(x.start,x.end),U.rootIndices.slice(x.start,x.end),U.proveByIndices.slice(x.start,x.end),_.slice(x.start,x.end),j())[0]):gill.none(),{remainingAccounts:ie,systemOffset:ye}=D.toAccountMetas(),yt=v(U,ye),be=[];return u.length>0&&be.push(H(u)),be.push(Ii({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:s?gill.some(s):gill.none(),feePayer:e,signer:n instanceof P?void 0:n,oldSettings:f,oldSettingsMutArgs:ce,newSettings:E,newSettingsMutArgs:te,compressedProofArgs:yt,userMutArgs:w,remainingAccounts:ie})),be}async function TH({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:s,compressed:t=false,cachedAccounts:c}){let i=await zc(ee(),r),a=i.data.multiWalletSettings,{packedAccounts:o,proof:d,settingsMutArgs:u}=await Me(t,a,e,false,c),{remainingAccounts:g,systemOffset:p}=o.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:E,signature:x,publicKey:b}=Z(n),D=[];if(E&&x&&b&&D.push(H([{message:E,signature:x,publicKey:b}])),t){if(!s||!u)throw new Error("Payer not found or proof args is missing.");let _=v(d,p);D.push(yd({transactionBuffer:r,domainConfig:f,closer:n instanceof P?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:u,payer:s,compressedProofArgs:_,remainingAccounts:g}));}else D.push(dd({transactionBuffer:r,domainConfig:f,closer:n instanceof P?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return D}function YA({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:p,message:f,signature:S,publicKey:E}=Z(n),x=[];if(f&&S&&E&&x.push(H([{message:f,signature:S,publicKey:E}])),d){let{settingsReadonlyArgs:b,compressedProofArgs:D,remainingAccounts:_}=d;x.push(hd({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},settingsReadonlyArgs:b,compressedProofArgs:D,remainingAccounts:_}));}else x.push(Id({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},remainingAccounts:[]}));return x}function ZA({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:o}=Z(e),d=[];return a&&i&&o&&d.push(H([{message:a,signature:i,publicKey:o}])),s?d.push(wd({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof P?void 0:e,settingsMutArgs:s.settingsMutArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Wd({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof P?void 0:e,remainingAccounts:[]})),d}function XA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Xd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Kd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function QA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:o}=Z(n),d=[];return o&&i&&a&&d.push(H([{message:o,signature:i,publicKey:a}])),s?d.push(du({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof P?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(nu({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof P?void 0:n,remainingAccounts:[]})),d}async function cF({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await ih(r),i=new B,a=null,o=null,d=[];if(c.length||t){let g=await dh({packedAccounts:i,userAccounts:c,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:s});a=g.proof,o=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await uh({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:o,packedAccounts:i,compressed:t}}async function ih(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let s=await Promise.all(r.members.map(t=>N(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=>N(t.member,t.userAddressTreeIndex)));for(let t of s)n.push({address:t.address,type:"User"});break}}return n}async function dh({packedAccounts:e,userAccounts:n,compressed:r,settings:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let f=(await oe(s,t)).address;i.push({address:f,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await me(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await V(a,[]),d=[],u=[];for(let f of a)f.type==="Settings"?d.push(f):f.type==="User"&&u.push(f);let g,p=[];if(r&&o&&(g=ae(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),d,j())[0]),u.length&&o){let f=r?1:0;p=ae(e,o.treeInfos.slice(f),o.leafIndices.slice(f),o.rootIndices.slice(f),o.proveByIndices.slice(f),u,Y());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function uh({configActionsArgs:e,userMutArgs:n}){let r=[];for(let s of e)switch(s.type){case "AddMembers":{let t=[];for(let c of s.members){let i=await N(c.member,c.userAddressTreeIndex).then(a=>n.find(o=>utils_js.equalBytes(o.accountMeta.address,gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(a.address)))));if(!i)throw new Error("Unable to find user account");t.push(ph({permissionArgs:c.permissions,userMutArgs:i,pubkey:c.member}));}r.push({__kind:s.type,fields:[t]});break}case "RemoveMembers":{let t=await Promise.all(s.members.map(c=>N(c.member,c.userAddressTreeIndex).then(i=>{let a=n.find(o=>utils_js.equalBytes(o.accountMeta.address,gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(i.address))));if(!a)throw new Error("Unable to find user account");return gh({pubkey:c.member,userMutArgs:a})})));r.push({__kind:s.type,fields:[t]});break}case "EditPermissions":{let t=s.members.map(c=>Ah({permissionArgs:c.permissions,pubkey:c.member}));r.push({__kind:s.type,fields:[t]});break}default:r.push({__kind:s.type,fields:[s.threshold]});}return r}function Ah({pubkey:e,permissionArgs:n}){return {memberKey:Pe(e),permissions:rg(n)}}function gh({pubkey:e,userMutArgs:n}){let r=n.data.role;if(r===2)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:Pe(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function ph({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===2)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===0&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:Pe(e),permissions:rg(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function rg(e){let n=[];return e.initiate&&n.push(ve.InitiateTransaction),e.vote&&n.push(ve.VoteTransaction),e.execute&&n.push(ve.ExecuteTransaction),Oe.fromPermissions(n)}async function mF({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:f}){let S=Math.floor(Math.random()*255),E=await hA(n,t instanceof P?t:t.address,S),x=[],b=[];for(let X=0;X<s.length;X+=p){let at=s.subarray(X,X+p);x.push(at),b.push(sha2_js.sha256(at));}let D=sha2_js.sha256(s),{settingsReadonlyArgs:_,settingsMutArgs:U,proof:w,packedAccounts:ce}=await Me(d,n,r,false,f),{remainingAccounts:te,systemOffset:ie}=ce.toAccountMetas(),ye=w&&_&&U?{settingsReadonlyArgs:_,settingsMutArgs:U,compressedProofArgs:v(w,ie),remainingAccounts:te,payer:e}:null,yt=le([t,...c?[c]:[],...u]).filter(X=>X instanceof P).map(X=>({memberKey:Pe(X),messageHash:Js(X.authResponse)})),be=YA({finalBufferHash:D,finalBufferSize:s.length,bufferIndex:S,payer:e,transactionBufferAddress:E,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:b,compressedArgs:ye,expectedSecp256r1Signers:yt}),ue=x.map(X=>XA({transactionMessageBytes:X,transactionBufferAddress:E,settings:n,compressed:d})),ct=u.map(X=>QA({voter:X,transactionBufferAddress:E,settings:n,compressedArgs:ye})),$r=ZA({compressedArgs:ye,settings:n,executor:c,transactionBufferAddress:E}),{instructions:lt,addressLookupTableAccounts:en}=await wA({compressed:d,settings:n,transactionMessageBytes:s,transactionBufferAddress:E,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o}),m=X=>({payer:e,instructions:X,addressesByLookupTableAddress:en});return [m(be),...ue.map(X=>m([X])),...ct.length?[m(ct.flat())]:[],m($r),m(lt)]}var Xr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=i=>{let a=s.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},s.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let o=t(a.address);o.isSigner||=a.role===gill.AccountRole.READONLY_SIGNER||a.role===gill.AccountRole.WRITABLE_SIGNER,o.isWritable||=a.role===gill.AccountRole.WRITABLE||a.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(([,d])=>d.isSigner&&d.isWritable),s=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),c=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={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[a]=r[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let o=[...r.map(([d])=>d),...s.map(([d])=>d),...t.map(([d])=>d),...c.map(([d])=>d)];return [i,o]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.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,i]of this.keyMetaMap.entries())if(r(i)){let a=c,o=n.findIndex(d=>d===a);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(a),this.keyMetaMap.delete(c);}}return [s,t]}};var Qr=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,i)=>{s.set(c,i);});let t=c=>{let i=s.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function sg({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Xr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(s??{});for(let p of a){let f=t.extractTableLookup(p);if(f!==void 0){let{addressTableLookup:S,drainedKeys:E}=f;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:gill.address(S.lookupTableAddress)}),i.writable.push(...E.writable),i.readonly.push(...E.readonly);}}let[o,d]=t.getMessageComponents(),g=new Qr(d,i).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function hF({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=sg({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(Ku(s))}async function UF({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i,cachedAccounts:a,compressed:o=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await VA({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:i,simulateProof:d,cachedAccounts:a});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=$c;exports.AuthenticationContextSchema=Hu;exports.BaseResponseSchema=Fu;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=ma;exports.CHANGE_CONFIG_DISCRIMINATOR=ca;exports.CREATE_COMPRESSED_WALLET_DISCRIMINATOR=xa;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=_a;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=La;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=wa;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=Ga;exports.CompleteMessageRequestSchema=fw;exports.CompleteSendTransactionRequestSchema=xw;exports.CompleteTransactionRequestSchema=Sw;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=qa;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=ei;exports.DOMAIN_CONFIG_DISCRIMINATOR=fo;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=ai;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=gi;exports.EDIT_USER_DELEGATE_DISCRIMINATOR=fi;exports.GLOBAL_COUNTER_DISCRIMINATOR=Do;exports.KeyType=er;exports.MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR=Di;exports.MIGRATE_COMPRESSED_USERS_DISCRIMINATOR=_i;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=AD;exports.MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH=HE;exports.MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED=nP;exports.MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING=vD;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=WD;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=kD;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH=tP;exports.MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE=gP;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=zE;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=GE;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=tD;exports.MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS=VD;exports.MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH=QE;exports.MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH=FE;exports.MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH=ZE;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=xD;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=ID;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=CD;exports.MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED=wD;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=mD;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=gD;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=pD;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=cD;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX=eP;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=BD;exports.MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG=$E;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=iD;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=SD;exports.MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT=HD;exports.MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS=yD;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=oD;exports.MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG=JE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION=LE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY=NE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=kE;exports.MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS=BE;exports.MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER=_D;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=RD;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=nD;exports.MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE=XD;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG=XE;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION=YE;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=sD;exports.MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG=cP;exports.MULTI_WALLET_ERROR__INVALID_USER_ROLE=aD;exports.MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG=oP;exports.MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR=ZD;exports.MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE=wE;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=MD;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=LD;exports.MULTI_WALLET_ERROR__MEMBER_NOT_FOUND=zD;exports.MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS=$D;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=dD;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS=FD;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT=JD;exports.MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT=aP;exports.MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR=YD;exports.MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS=GD;exports.MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS=uD;exports.MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY=uP;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE=dP;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA=ND;exports.MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT=iP;exports.MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA=qD;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=hD;exports.MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS=rP;exports.MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES=AP;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=TD;exports.MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED=eD;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=jE;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=qE;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=OD;exports.MULTI_WALLET_ERROR__PAYER_MISMATCH=jD;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=KE;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=PD;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=VE;exports.MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH=KD;exports.MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS=OE;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=bD;exports.MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH=QD;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=rD;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=ED;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=DD;exports.MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING=UD;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=fD;exports.MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY=sP;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=lD;exports.MULTI_WALLET_PROGRAM_ADDRESS=A;exports.MultiWalletAccount=vE;exports.MultiWalletInstruction=UE;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=Vi;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=Li;exports.Permission=ve;exports.Permissions=Oe;exports.SETTINGS_DISCRIMINATOR=Lc;exports.Secp256r1Key=Be;exports.SignedSecp256r1Key=P;exports.StartMessageRequestSchema=wu;exports.StartTransactionRequestSchema=Vu;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=td;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=Ji;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=gd;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=cd;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=Dd;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=fd;exports.TRANSACTION_BUFFER_DISCRIMINATOR=Hc;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=Od;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=_d;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=qd;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=Fd;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=cu;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=eu;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=fu;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=gu;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=_u;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=Du;exports.TransactionActionTypeSchema=Nu;exports.TransactionDetailsSchema=mP;exports.TransactionPayloadSchema=Tw;exports.TransactionPayloadWithBase64MessageBytesSchema=pP;exports.Transports=ys;exports.UserRole=Le;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=Jc;exports.addWhitelistedAddressTrees=dw;exports.base64URLStringToBuffer=Ie;exports.bufferToBase64URLString=A2;exports.changeConfig=u8;exports.closeTransactionBuffer=TH;exports.configAction=IR;exports.convertBase64StringToJWK=m2;exports.convertJWKToBase64String=p2;exports.convertMemberKeyToString=vA;exports.convertPubkeyCompressedToCose=o2;exports.convertPubkeyCoseToCompressed=s2;exports.createClientAuthorizationCompleteRequestChallenge=i2;exports.createClientAuthorizationStartRequestChallenge=a2;exports.createDomainConfig=I6;exports.createDomainUserAccounts=U6;exports.createGlobalCounter=O6;exports.createMessageChallenge=d2;exports.createTransactionBuffer=YA;exports.createTransactionChallenge=u2;exports.createTransactionManagerSigner=bM;exports.createUserAccounts=T8;exports.createWallet=D8;exports.decodeDomainConfig=xo;exports.decodeGlobalCounter=Mo;exports.decodeSettings=Oc;exports.decodeTransactionBuffer=Gc;exports.decodeWhitelistedAddressTree=Yc;exports.decompressSettingsAccount=U8;exports.deserializeConfigActions=o6;exports.disableDomainConfig=V6;exports.editDomainConfig=w8;exports.editTransactionManagerUrl=K8;exports.editUserDelegate=tH;exports.executeTransaction=wA;exports.executeTransactionBuffer=ZA;exports.executeTransactionSync=VA;exports.extendTransactionBuffer=XA;exports.extensionStruct=wR;exports.fetchAllDomainConfig=fh;exports.fetchAllGlobalCounter=Ph;exports.fetchAllMaybeDomainConfig=Pg;exports.fetchAllMaybeGlobalCounter=Hg;exports.fetchAllMaybeSettings=R1;exports.fetchAllMaybeTransactionBuffer=q1;exports.fetchAllMaybeWhitelistedAddressTree=yf;exports.fetchAllSettings=iU;exports.fetchAllSettingsAccountByMember=d5;exports.fetchAllTransactionBuffer=mU;exports.fetchAllWhitelistedAddressTree=SU;exports.fetchDomainConfig=Io;exports.fetchGlobalCounter=Dh;exports.fetchMaybeDomainConfig=Dg;exports.fetchMaybeGlobalCounter=Vg;exports.fetchMaybeSettings=ls;exports.fetchMaybeSettingsAccountData=oM;exports.fetchMaybeTransactionBuffer=J1;exports.fetchMaybeUserAccountData=sM;exports.fetchMaybeWhitelistedAddressTree=mf;exports.fetchSettings=aU;exports.fetchSettingsAccountData=jr;exports.fetchTransactionBuffer=zc;exports.fetchUserAccountByFilters=i5;exports.fetchUserAccountData=ir;exports.fetchWhitelistedAddressTree=Zc;exports.getAddMemberArgsCodec=Wh;exports.getAddMemberArgsDecoder=on;exports.getAddMemberArgsEncoder=sn;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=OU;exports.getAddWhitelistedAddressTreesInstruction=NU;exports.getAddWhitelistedAddressTreesInstructionAsync=ta;exports.getAddWhitelistedAddressTreesInstructionDataCodec=BU;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=ea;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=Ds;exports.getAdditionalMetadataCodec=bh;exports.getAdditionalMetadataDecoder=nn;exports.getAdditionalMetadataEncoder=rn;exports.getChangeConfigCompressedDiscriminatorBytes=tW;exports.getChangeConfigCompressedInstruction=Ta;exports.getChangeConfigCompressedInstructionDataCodec=rW;exports.getChangeConfigCompressedInstructionDataDecoder=la;exports.getChangeConfigCompressedInstructionDataEncoder=ya;exports.getChangeConfigDiscriminatorBytes=jU;exports.getChangeConfigInstruction=da;exports.getChangeConfigInstructionDataCodec=JU;exports.getChangeConfigInstructionDataDecoder=ia;exports.getChangeConfigInstructionDataEncoder=aa;exports.getClientAndDeviceHash=js;exports.getCompiledInstructionCodec=Oh;exports.getCompiledInstructionDecoder=an;exports.getCompiledInstructionEncoder=cn;exports.getCompressedAccountMetaCodec=Vh;exports.getCompressedAccountMetaDecoder=xt;exports.getCompressedAccountMetaEncoder=St;exports.getCompressedAccountMetaReadOnlyCodec=zh;exports.getCompressedAccountMetaReadOnlyDecoder=Dt;exports.getCompressedAccountMetaReadOnlyEncoder=Et;exports.getCompressedOnlyExtensionCodec=Jh;exports.getCompressedOnlyExtensionDecoder=un;exports.getCompressedOnlyExtensionEncoder=dn;exports.getCompressedProofCodec=Zh;exports.getCompressedProofDecoder=ln;exports.getCompressedProofEncoder=yn;exports.getCompressedSettingsAddress=oe;exports.getCompressedSettingsCodec=eR;exports.getCompressedSettingsDataCodec=sR;exports.getCompressedSettingsDataDecoder=ht;exports.getCompressedSettingsDataEncoder=Mt;exports.getCompressedSettingsDecoder=j;exports.getCompressedSettingsEncoder=Pt;exports.getCompressedTokenArgsCodec=iR;exports.getCompressedTokenArgsDecoder=vt;exports.getCompressedTokenArgsEncoder=_t;exports.getCompressibleExtensionCodec=gR;exports.getCompressibleExtensionDecoder=En;exports.getCompressibleExtensionEncoder=Cn;exports.getCompressionInfoCodec=lR;exports.getCompressionInfoDecoder=Pn;exports.getCompressionInfoEncoder=Dn;exports.getConfigActionCodec=xR;exports.getConfigActionDecoder=ze;exports.getConfigActionEncoder=Ge;exports.getCreateCompressedWalletDiscriminatorBytes=uW;exports.getCreateCompressedWalletInstruction=gW;exports.getCreateCompressedWalletInstructionAsync=Ca;exports.getCreateCompressedWalletInstructionDataCodec=AW;exports.getCreateCompressedWalletInstructionDataDecoder=Ia;exports.getCreateCompressedWalletInstructionDataEncoder=Ps;exports.getCreateDomainConfigDiscriminatorBytes=xW;exports.getCreateDomainConfigInstruction=CW;exports.getCreateDomainConfigInstructionAsync=Ua;exports.getCreateDomainConfigInstructionDataCodec=IW;exports.getCreateDomainConfigInstructionDataDecoder=va;exports.getCreateDomainConfigInstructionDataEncoder=hs;exports.getCreateDomainUserAccountDiscriminatorBytes=_W;exports.getCreateDomainUserAccountInstruction=UW;exports.getCreateDomainUserAccountInstructionAsync=Ba;exports.getCreateDomainUserAccountInstructionDataCodec=vW;exports.getCreateDomainUserAccountInstructionDataDecoder=Oa;exports.getCreateDomainUserAccountInstructionDataEncoder=Rs;exports.getCreateGlobalCounterDiscriminatorBytes=wW;exports.getCreateGlobalCounterInstruction=HW;exports.getCreateGlobalCounterInstructionAsync=Ha;exports.getCreateGlobalCounterInstructionDataCodec=VW;exports.getCreateGlobalCounterInstructionDataDecoder=Va;exports.getCreateGlobalCounterInstructionDataEncoder=_s;exports.getCreateUserAccountArgsCodec=MR;exports.getCreateUserAccountArgsDecoder=Bn;exports.getCreateUserAccountArgsEncoder=On;exports.getCreateUserAccountsDiscriminatorBytes=YW;exports.getCreateUserAccountsInstruction=XW;exports.getCreateUserAccountsInstructionAsync=Ka;exports.getCreateUserAccountsInstructionDataCodec=ZW;exports.getCreateUserAccountsInstructionDataDecoder=za;exports.getCreateUserAccountsInstructionDataEncoder=Us;exports.getDecompressSettingsAccountDiscriminatorBytes=ok;exports.getDecompressSettingsAccountInstruction=Xa;exports.getDecompressSettingsAccountInstructionDataCodec=ck;exports.getDecompressSettingsAccountInstructionDataDecoder=Za;exports.getDecompressSettingsAccountInstructionDataEncoder=Ya;exports.getDisableDomainConfigDiscriminatorBytes=pk;exports.getDisableDomainConfigInstruction=ni;exports.getDisableDomainConfigInstructionDataCodec=mk;exports.getDisableDomainConfigInstructionDataDecoder=ri;exports.getDisableDomainConfigInstructionDataEncoder=ti;exports.getDomainConfigAddress=ut;exports.getDomainConfigCodec=Th;exports.getDomainConfigDecoder=So;exports.getDomainConfigDiscriminatorBytes=lh;exports.getDomainConfigEncoder=Eg;exports.getDomainConfigSize=Sh;exports.getEditDomainConfigDiscriminatorBytes=Ck;exports.getEditDomainConfigInstruction=di;exports.getEditDomainConfigInstructionAsync=Dk;exports.getEditDomainConfigInstructionDataCodec=Ek;exports.getEditDomainConfigInstructionDataDecoder=ii;exports.getEditDomainConfigInstructionDataEncoder=ks;exports.getEditMemberArgsCodec=_R;exports.getEditMemberArgsDecoder=Wn;exports.getEditMemberArgsEncoder=Un;exports.getEditTransactionManagerUrlDiscriminatorBytes=Uk;exports.getEditTransactionManagerUrlInstruction=yi;exports.getEditTransactionManagerUrlInstructionDataCodec=Wk;exports.getEditTransactionManagerUrlInstructionDataDecoder=mi;exports.getEditTransactionManagerUrlInstructionDataEncoder=pi;exports.getEditUserDelegateDiscriminatorBytes=Hk;exports.getEditUserDelegateInstruction=Ii;exports.getEditUserDelegateInstructionDataCodec=Fk;exports.getEditUserDelegateInstructionDataDecoder=xi;exports.getEditUserDelegateInstructionDataEncoder=Si;exports.getExpectedSecp256r1SignersCodec=kR;exports.getExpectedSecp256r1SignersDecoder=kt;exports.getExpectedSecp256r1SignersEncoder=Wt;exports.getExtensionStructCodec=NR;exports.getExtensionStructDecoder=Ut;exports.getExtensionStructEncoder=Tn;exports.getGlobalCounterAddress=MA;exports.getGlobalCounterCodec=Eh;exports.getGlobalCounterDecoder=Po;exports.getGlobalCounterDiscriminatorBytes=Ch;exports.getGlobalCounterEncoder=wg;exports.getGlobalCounterSize=Mh;exports.getJitoTipsConfig=Ks;exports.getLightCpiSigner=E5;exports.getLightProtocolRpc=De;exports.getLinkWalletArgsCodec=zR;exports.getLinkWalletArgsDecoder=Yn;exports.getLinkWalletArgsEncoder=qn;exports.getMemberCodec=qR;exports.getMemberDecoder=bt;exports.getMemberEncoder=Rt;exports.getMemberKeyCodec=XR;exports.getMemberKeyDecoder=se;exports.getMemberKeyEncoder=F;exports.getMigrateCompressedSettingsDiscriminatorBytes=Zk;exports.getMigrateCompressedSettingsInstruction=hi;exports.getMigrateCompressedSettingsInstructionDataCodec=Xk;exports.getMigrateCompressedSettingsInstructionDataDecoder=Mi;exports.getMigrateCompressedSettingsInstructionDataEncoder=Pi;exports.getMigrateCompressedUsersDiscriminatorBytes=oL;exports.getMigrateCompressedUsersInstruction=Wi;exports.getMigrateCompressedUsersInstructionDataCodec=cL;exports.getMigrateCompressedUsersInstructionDataDecoder=Ui;exports.getMigrateCompressedUsersInstructionDataEncoder=vi;exports.getMultiWalletErrorMessage=XN;exports.getNativeTransferIntentCompressedDiscriminatorBytes=DL;exports.getNativeTransferIntentCompressedInstruction=Gi;exports.getNativeTransferIntentCompressedInstructionDataCodec=PL;exports.getNativeTransferIntentCompressedInstructionDataDecoder=Fi;exports.getNativeTransferIntentCompressedInstructionDataEncoder=Hi;exports.getNativeTransferIntentDiscriminatorBytes=mL;exports.getNativeTransferIntentInstruction=Bi;exports.getNativeTransferIntentInstructionAsync=lL;exports.getNativeTransferIntentInstructionDataCodec=yL;exports.getNativeTransferIntentInstructionDataDecoder=Oi;exports.getNativeTransferIntentInstructionDataEncoder=Ls;exports.getNewAuthorityArgsCodec=tb;exports.getNewAuthorityArgsDecoder=$n;exports.getNewAuthorityArgsEncoder=Qn;exports.getOriginIndex=g2;exports.getPackedAddressTreeInfoCodec=sb;exports.getPackedAddressTreeInfoDecoder=Nt;exports.getPackedAddressTreeInfoEncoder=Bt;exports.getPackedMerkleContextCodec=ab;exports.getPackedMerkleContextDecoder=Sn;exports.getPackedMerkleContextEncoder=fn;exports.getPackedStateTreeInfoCodec=ub;exports.getPackedStateTreeInfoDecoder=Ct;exports.getPackedStateTreeInfoEncoder=It;exports.getPausableAccountExtensionCodec=pb;exports.getPausableAccountExtensionDecoder=wn;exports.getPausableAccountExtensionEncoder=Nn;exports.getPermanentDelegateAccountExtensionCodec=lb;exports.getPermanentDelegateAccountExtensionDecoder=Hn;exports.getPermanentDelegateAccountExtensionEncoder=Vn;exports.getPermissionsCodec=Sb;exports.getPermissionsDecoder=Ve;exports.getPermissionsEncoder=we;exports.getProofArgsCodec=Eb;exports.getProofArgsDecoder=C;exports.getProofArgsEncoder=I;exports.getRemoveMemberArgsCodec=hb;exports.getRemoveMemberArgsDecoder=Ln;exports.getRemoveMemberArgsEncoder=kn;exports.getRentConfigCodec=_b;exports.getRentConfigDecoder=bn;exports.getRentConfigEncoder=Rn;exports.getSecp256r1MessageHash=Js;exports.getSecp256r1PubkeyCodec=Wb;exports.getSecp256r1PubkeyDecoder=wt;exports.getSecp256r1PubkeyEncoder=rs;exports.getSecp256r1SignatureOffsetsDataDecoder=GM;exports.getSecp256r1SignatureOffsetsDataEncoder=FM;exports.getSecp256r1VerifyArgsCodec=Ob;exports.getSecp256r1VerifyArgsDecoder=z;exports.getSecp256r1VerifyArgsEncoder=G;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=Vb;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=$;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=Q;exports.getSecp256r1VerifyInstruction=H;exports.getSecp256r1VerifyInstructionDataCodec=yV;exports.getSecp256r1VerifyInstructionDataDecoder=BA;exports.getSecp256r1VerifyInstructionDataEncoder=NA;exports.getSendAndConfirmTransaction=qu;exports.getSettingsCodec=cU;exports.getSettingsCreationArgsCodec=zb;exports.getSettingsCreationArgsDecoder=Ht;exports.getSettingsCreationArgsEncoder=Vt;exports.getSettingsDecoder=Rr;exports.getSettingsDiscriminatorBytes=oU;exports.getSettingsEncoder=h1;exports.getSettingsFromIndex=Re;exports.getSettingsIndexWithAddressAndDelegateInfoCodec=Zb;exports.getSettingsIndexWithAddressAndDelegateInfoDecoder=cs;exports.getSettingsIndexWithAddressAndDelegateInfoEncoder=os;exports.getSettingsIndexWithAddressCodec=Jb;exports.getSettingsIndexWithAddressDecoder=ss;exports.getSettingsIndexWithAddressEncoder=ns;exports.getSettingsMutArgsCodec=e_;exports.getSettingsMutArgsDecoder=q;exports.getSettingsMutArgsEncoder=J;exports.getSettingsReadonlyArgsCodec=s_;exports.getSettingsReadonlyArgsDecoder=Gt;exports.getSettingsReadonlyArgsEncoder=Ft;exports.getSignedSecp256r1Key=c2;exports.getSignedTransactionManager=n6;exports.getSolanaRpc=ee;exports.getSolanaRpcEndpoint=Ju;exports.getSplInterfacePdaArgsCodec=a_;exports.getSplInterfacePdaArgsDecoder=Kt;exports.getSplInterfacePdaArgsEncoder=zt;exports.getTokenMetadataCodec=A_;exports.getTokenMetadataDecoder=Gn;exports.getTokenMetadataEncoder=Fn;exports.getTokenTransferIntentCompressedDiscriminatorBytes=GL;exports.getTokenTransferIntentCompressedInstruction=nd;exports.getTokenTransferIntentCompressedInstructionAsync=KL;exports.getTokenTransferIntentCompressedInstructionDataCodec=zL;exports.getTokenTransferIntentCompressedInstructionDataDecoder=rd;exports.getTokenTransferIntentCompressedInstructionDataEncoder=ws;exports.getTokenTransferIntentDiscriminatorBytes=WL;exports.getTokenTransferIntentInstruction=Yi;exports.getTokenTransferIntentInstructionAsync=LL;exports.getTokenTransferIntentInstructionDataCodec=kL;exports.getTokenTransferIntentInstructionDataDecoder=qi;exports.getTokenTransferIntentInstructionDataEncoder=Ns;exports.getTransactionBufferAddress=hA;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=iO;exports.getTransactionBufferCloseCompressedInstruction=yd;exports.getTransactionBufferCloseCompressedInstructionDataCodec=dO;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=md;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=pd;exports.getTransactionBufferCloseDiscriminatorBytes=$L;exports.getTransactionBufferCloseInstruction=dd;exports.getTransactionBufferCloseInstructionDataCodec=eO;exports.getTransactionBufferCloseInstructionDataDecoder=id;exports.getTransactionBufferCloseInstructionDataEncoder=ad;exports.getTransactionBufferCodec=pU;exports.getTransactionBufferCreateArgsCodec=y_;exports.getTransactionBufferCreateArgsDecoder=Jt;exports.getTransactionBufferCreateArgsEncoder=jt;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=MO;exports.getTransactionBufferCreateCompressedInstruction=hd;exports.getTransactionBufferCreateCompressedInstructionDataCodec=hO;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=Md;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=Pd;exports.getTransactionBufferCreateDiscriminatorBytes=TO;exports.getTransactionBufferCreateInstruction=Id;exports.getTransactionBufferCreateInstructionDataCodec=fO;exports.getTransactionBufferCreateInstructionDataDecoder=xd;exports.getTransactionBufferCreateInstructionDataEncoder=Sd;exports.getTransactionBufferDecoder=Fc;exports.getTransactionBufferDiscriminatorBytes=gU;exports.getTransactionBufferEncoder=j1;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=zO;exports.getTransactionBufferExecuteCompressedInstruction=wd;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=KO;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=Nd;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=Bd;exports.getTransactionBufferExecuteDiscriminatorBytes=LO;exports.getTransactionBufferExecuteInstruction=Wd;exports.getTransactionBufferExecuteInstructionDataCodec=OO;exports.getTransactionBufferExecuteInstructionDataDecoder=Ud;exports.getTransactionBufferExecuteInstructionDataEncoder=vd;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=cB;exports.getTransactionBufferExtendCompressedInstruction=Xd;exports.getTransactionBufferExtendCompressedInstructionDataCodec=aB;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=Zd;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=Yd;exports.getTransactionBufferExtendDiscriminatorBytes=QO;exports.getTransactionBufferExtendInstruction=Kd;exports.getTransactionBufferExtendInstructionDataCodec=$O;exports.getTransactionBufferExtendInstructionDataDecoder=zd;exports.getTransactionBufferExtendInstructionDataEncoder=Gd;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=DB;exports.getTransactionBufferVoteCompressedInstruction=du;exports.getTransactionBufferVoteCompressedInstructionDataCodec=PB;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=iu;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=au;exports.getTransactionBufferVoteDiscriminatorBytes=yB;exports.getTransactionBufferVoteInstruction=nu;exports.getTransactionBufferVoteInstructionDataCodec=lB;exports.getTransactionBufferVoteInstructionDataDecoder=ru;exports.getTransactionBufferVoteInstructionDataEncoder=tu;exports.getTransactionExecuteCompressedDiscriminatorBytes=VB;exports.getTransactionExecuteCompressedInstruction=Iu;exports.getTransactionExecuteCompressedInstructionDataCodec=HB;exports.getTransactionExecuteCompressedInstructionDataDecoder=xu;exports.getTransactionExecuteCompressedInstructionDataEncoder=Su;exports.getTransactionExecuteDiscriminatorBytes=UB;exports.getTransactionExecuteInstruction=yu;exports.getTransactionExecuteInstructionDataCodec=WB;exports.getTransactionExecuteInstructionDataDecoder=mu;exports.getTransactionExecuteInstructionDataEncoder=pu;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=sN;exports.getTransactionExecuteSyncCompressedInstruction=Wu;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=oN;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=Uu;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=vu;exports.getTransactionExecuteSyncDiscriminatorBytes=YB;exports.getTransactionExecuteSyncInstruction=hu;exports.getTransactionExecuteSyncInstructionDataCodec=ZB;exports.getTransactionExecuteSyncInstructionDataDecoder=Mu;exports.getTransactionExecuteSyncInstructionDataEncoder=Pu;exports.getTransactionMessageAddressTableLookupCodec=C_;exports.getTransactionMessageAddressTableLookupDecoder=ms;exports.getTransactionMessageAddressTableLookupEncoder=ps;exports.getTransactionMessageCodec=S_;exports.getTransactionMessageDecoder=Yt;exports.getTransactionMessageEncoder=qt;exports.getTransferFeeAccountExtensionCodec=P_;exports.getTransferFeeAccountExtensionDecoder=Kn;exports.getTransferFeeAccountExtensionEncoder=zn;exports.getTransferHookAccountExtensionCodec=R_;exports.getTransferHookAccountExtensionDecoder=Jn;exports.getTransferHookAccountExtensionEncoder=jn;exports.getTransportsCodec=v_;exports.getTransportsDecoder=Xt;exports.getTransportsEncoder=Zt;exports.getUserAccountAddress=N;exports.getUserCodec=L_;exports.getUserCreationArgsCodec=w_;exports.getUserCreationArgsDecoder=Se;exports.getUserCreationArgsEncoder=fe;exports.getUserDecoder=Y;exports.getUserEncoder=Xe;exports.getUserMutArgsCodec=G_;exports.getUserMutArgsDecoder=$e;exports.getUserMutArgsEncoder=Qe;exports.getUserReadOnlyArgsCodec=J_;exports.getUserReadOnlyArgsDecoder=Ot;exports.getUserReadOnlyArgsEncoder=Lt;exports.getUserReadOnlyOrMutateArgsCodec=X_;exports.getUserReadOnlyOrMutateArgsDecoder=Fe;exports.getUserReadOnlyOrMutateArgsEncoder=He;exports.getUserRoleCodec=rv;exports.getUserRoleDecoder=je;exports.getUserRoleEncoder=Ke;exports.getWalletAddressFromIndex=C5;exports.getWalletAddressFromSettings=Ue;exports.getWhitelistedAddressTreeCodec=fU;exports.getWhitelistedAddressTreeDecoder=qc;exports.getWhitelistedAddressTreeDiscriminatorBytes=TU;exports.getWhitelistedAddressTreeEncoder=pf;exports.getWhitelistedAddressTreeFromIndex=$s;exports.getWhitelistedAddressTreeIndexFromAddress=u5;exports.getWhitelistedAddressTreesAddress=IA;exports.identifyMultiWalletAccount=zN;exports.identifyMultiWalletInstruction=KN;exports.initialize=Gw;exports.isConfigAction=CR;exports.isExtensionStruct=VR;exports.isMultiWalletError=QN;exports.isUserReadOnlyOrMutateArgs=$_;exports.migrateSettings=J6;exports.migrateUsers=eV;exports.nativeTransferIntent=VV;exports.parseAddWhitelistedAddressTreesInstruction=wU;exports.parseChangeConfigCompressedInstruction=nW;exports.parseChangeConfigInstruction=qU;exports.parseCreateCompressedWalletInstruction=pW;exports.parseCreateDomainConfigInstruction=EW;exports.parseCreateDomainUserAccountInstruction=WW;exports.parseCreateGlobalCounterInstruction=FW;exports.parseCreateUserAccountsInstruction=QW;exports.parseDecompressSettingsAccountInstruction=ak;exports.parseDisableDomainConfigInstruction=yk;exports.parseEditDomainConfigInstruction=Pk;exports.parseEditTransactionManagerUrlInstruction=kk;exports.parseEditUserDelegateInstruction=Gk;exports.parseMigrateCompressedSettingsInstruction=Qk;exports.parseMigrateCompressedUsersInstruction=aL;exports.parseNativeTransferIntentCompressedInstruction=ML;exports.parseNativeTransferIntentInstruction=TL;exports.parseSecp256r1VerifyInstruction=lV;exports.parseTokenTransferIntentCompressedInstruction=jL;exports.parseTokenTransferIntentInstruction=OL;exports.parseTransactionBufferCloseCompressedInstruction=uO;exports.parseTransactionBufferCloseInstruction=tO;exports.parseTransactionBufferCreateCompressedInstruction=RO;exports.parseTransactionBufferCreateInstruction=SO;exports.parseTransactionBufferExecuteCompressedInstruction=jO;exports.parseTransactionBufferExecuteInstruction=BO;exports.parseTransactionBufferExtendCompressedInstruction=iB;exports.parseTransactionBufferExtendInstruction=eB;exports.parseTransactionBufferVoteCompressedInstruction=MB;exports.parseTransactionBufferVoteInstruction=TB;exports.parseTransactionExecuteCompressedInstruction=FB;exports.parseTransactionExecuteInstruction=kB;exports.parseTransactionExecuteSyncCompressedInstruction=cN;exports.parseTransactionExecuteSyncInstruction=XB;exports.pollJitoBundleConfirmation=k5;exports.prepareChangeConfigArgs=cF;exports.prepareTransactionBundle=mF;exports.prepareTransactionMessage=hF;exports.prepareTransactionSync=UF;exports.retrieveTransactionManager=r6;exports.sendJitoBundle=gM;exports.serializeConfigActions=s6;exports.signAndSendBundledTransactions=W5;exports.signAndSendTransaction=H5;exports.tokenTransferIntent=$V;exports.userReadOnlyOrMutateArgs=Q_;exports.vaultTransactionMessageDeserialize=ju;exports.vaultTransactionMessageSerialize=Ku;exports.voteTransactionBuffer=QA;//# 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'),T=require('zod'),programs=require('gill/programs'),nist_js=require('@noble/curves/nist.js'),tinyCbor=require('@levischuck/tiny-cbor'),jsonCanonicalize=require('json-canonicalize'),superstruct=require('superstruct'),utils_js=require('@noble/curves/utils.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var T__default=/*#__PURE__*/_interopDefault(T);var Ss=new Uint8Array([201,232,212,229,59,241,106,197]);function SM(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Ss)}function yg(){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:Ss}))}function xs(){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 xM(){return gill.combineCodec(yg(),xs())}function Is(e){return gill.decodeAccount(e,xs())}async function Cs(e,n,r){let o=await Tg(e,n,r);return gill.assertAccountExists(o),o}async function Tg(e,n,r){let o=await gill.fetchEncodedAccount(e,n,r);return Is(o)}async function IM(e,n,r){let o=await fg(e,n,r);return gill.assertAccountsExist(o),o}async function fg(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Is(t))}function CM(){return 846}var Ps=new Uint8Array([42,206,176,58,175,129,130,233]);function PM(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Ps)}function Ug(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:Ps}))}function hs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function hM(){return gill.combineCodec(Ug(),hs())}function Ms(e){return gill.decodeAccount(e,hs())}async function MM(e,n,r){let o=await kg(e,n,r);return gill.assertAccountExists(o),o}async function kg(e,n,r){let o=await gill.fetchEncodedAccount(e,n,r);return Ms(o)}async function RM(e,n,r){let o=await Wg(e,n,r);return gill.assertAccountsExist(o),o}async function Wg(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Ms(t))}function bM(){return 24}function en(){return gill.getStructEncoder([["key",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["value",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function tn(){return gill.getStructDecoder([["key",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["value",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function UM(){return gill.combineCodec(en(),tn())}function rn(){return gill.getStructEncoder([["memberKey",H()],["permissions",He()],["userArgs",Ge()]])}function nn(){return gill.getStructDecoder([["memberKey",oe()],["permissions",Fe()],["userArgs",ze()]])}function OM(){return gill.combineCodec(rn(),nn())}function on(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function sn(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function wM(){return gill.combineCodec(on(),sn())}function xt(){return gill.getStructEncoder([["treeInfo",Ct()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["outputStateTreeIndex",gill.getU8Encoder()]])}function It(){return gill.getStructDecoder([["treeInfo",Et()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["outputStateTreeIndex",gill.getU8Decoder()]])}function GM(){return gill.combineCodec(xt(),It())}function Dt(){return gill.getStructEncoder([["treeInfo",Ct()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Pt(){return gill.getStructDecoder([["treeInfo",Et()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function qM(){return gill.combineCodec(Dt(),Pt())}function cn(){return gill.getStructEncoder([["delegatedAmount",gill.getU64Encoder()],["withheldTransferFee",gill.getU64Encoder()],["isAta",gill.getU8Encoder()]])}function an(){return gill.getStructDecoder([["delegatedAmount",gill.getU64Decoder()],["withheldTransferFee",gill.getU64Decoder()],["isAta",gill.getU8Decoder()]])}function ZM(){return gill.combineCodec(cn(),an())}function pn(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function mn(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function $M(){return gill.combineCodec(pn(),mn())}function ht(){return gill.getStructEncoder([["data",gill.getOptionEncoder(ln())]])}function K(){return gill.getStructDecoder([["data",gill.getOptionDecoder(yn())]])}function nR(){return gill.combineCodec(ht(),K())}function ln(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(Mt())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]])}function yn(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(Rt())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function aR(){return gill.combineCodec(ln(),yn())}function bt(){return gill.getStructEncoder([["version",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()],["amount",gill.getU64Encoder()],["merkleContext",fn()],["tlv",gill.getOptionEncoder(gill.getArrayEncoder(Tn()))],["hasDelegate",gill.getBooleanEncoder()],["isFrozen",gill.getBooleanEncoder()]])}function _t(){return gill.getStructDecoder([["version",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()],["amount",gill.getU64Decoder()],["merkleContext",Sn()],["tlv",gill.getOptionDecoder(gill.getArrayDecoder(vt()))],["hasDelegate",gill.getBooleanDecoder()],["isFrozen",gill.getBooleanDecoder()]])}function AR(){return gill.combineCodec(bt(),_t())}function Cn(){return gill.getStructEncoder([["decimalsOption",gill.getU8Encoder()],["decimals",gill.getU8Encoder()],["compressionOnly",gill.getBooleanEncoder()],["isAta",gill.getU8Encoder()],["info",Dn()]])}function En(){return gill.getStructDecoder([["decimalsOption",gill.getU8Decoder()],["decimals",gill.getU8Decoder()],["compressionOnly",gill.getBooleanDecoder()],["isAta",gill.getU8Decoder()],["info",Pn()]])}function lR(){return gill.combineCodec(Cn(),En())}function Dn(){return gill.getStructEncoder([["configAccountVersion",gill.getU16Encoder()],["compressToPubkey",gill.getU8Encoder()],["accountVersion",gill.getU8Encoder()],["lamportsPerWrite",gill.getU32Encoder()],["compressionAuthority",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["rentSponsor",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["lastClaimedSlot",gill.getU64Encoder()],["rentExemptionPaid",gill.getU32Encoder()],["reserved",gill.getU32Encoder()],["rentConfig",Rn()]])}function Pn(){return gill.getStructDecoder([["configAccountVersion",gill.getU16Decoder()],["compressToPubkey",gill.getU8Decoder()],["accountVersion",gill.getU8Decoder()],["lamportsPerWrite",gill.getU32Decoder()],["compressionAuthority",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["rentSponsor",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["lastClaimedSlot",gill.getU64Decoder()],["rentExemptionPaid",gill.getU32Decoder()],["reserved",gill.getU32Decoder()],["rentConfig",bn()]])}function SR(){return gill.combineCodec(Dn(),Pn())}function Ke(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Un())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(rn())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Wn())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function je(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(kn())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(nn())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Ln())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function ER(){return gill.combineCodec(Ke(),je())}function DR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function PR(e,n){return n.__kind===e}function On(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",qe()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",be()]])}function Bn(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",Je()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",_e()]])}function bR(){return gill.combineCodec(On(),Bn())}function Un(){return gill.getStructEncoder([["memberKey",H()],["permissions",He()]])}function kn(){return gill.getStructDecoder([["memberKey",oe()],["permissions",Fe()]])}function kR(){return gill.combineCodec(Un(),kn())}function Ut(){return gill.getStructEncoder([["memberKey",H()],["messageHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function kt(){return gill.getStructDecoder([["memberKey",oe()],["messageHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function BR(){return gill.combineCodec(Ut(),kt())}function Tn(){return gill.getDiscriminatedUnionEncoder([["Placeholder0",gill.getUnitEncoder()],["Placeholder1",gill.getUnitEncoder()],["Placeholder2",gill.getUnitEncoder()],["Placeholder3",gill.getUnitEncoder()],["Placeholder4",gill.getUnitEncoder()],["Placeholder5",gill.getUnitEncoder()],["Placeholder6",gill.getUnitEncoder()],["Placeholder7",gill.getUnitEncoder()],["Placeholder8",gill.getUnitEncoder()],["Placeholder9",gill.getUnitEncoder()],["Placeholder10",gill.getUnitEncoder()],["Placeholder11",gill.getUnitEncoder()],["Placeholder12",gill.getUnitEncoder()],["Placeholder13",gill.getUnitEncoder()],["Placeholder14",gill.getUnitEncoder()],["Placeholder15",gill.getUnitEncoder()],["Placeholder16",gill.getUnitEncoder()],["Placeholder17",gill.getUnitEncoder()],["Placeholder18",gill.getUnitEncoder()],["TokenMetadata",gill.getStructEncoder([["fields",gill.getTupleEncoder([Fn()])]])],["Placeholder20",gill.getUnitEncoder()],["Placeholder21",gill.getUnitEncoder()],["Placeholder22",gill.getUnitEncoder()],["Placeholder23",gill.getUnitEncoder()],["Placeholder24",gill.getUnitEncoder()],["Placeholder25",gill.getUnitEncoder()],["Placeholder26",gill.getUnitEncoder()],["PausableAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([Nn()])]])],["PermanentDelegateAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([Vn()])]])],["TransferFeeAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([zn()])]])],["TransferHookAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([jn()])]])],["CompressedOnly",gill.getStructEncoder([["fields",gill.getTupleEncoder([cn()])]])],["Compressible",gill.getStructEncoder([["fields",gill.getTupleEncoder([Cn()])]])]])}function vt(){return gill.getDiscriminatedUnionDecoder([["Placeholder0",gill.getUnitDecoder()],["Placeholder1",gill.getUnitDecoder()],["Placeholder2",gill.getUnitDecoder()],["Placeholder3",gill.getUnitDecoder()],["Placeholder4",gill.getUnitDecoder()],["Placeholder5",gill.getUnitDecoder()],["Placeholder6",gill.getUnitDecoder()],["Placeholder7",gill.getUnitDecoder()],["Placeholder8",gill.getUnitDecoder()],["Placeholder9",gill.getUnitDecoder()],["Placeholder10",gill.getUnitDecoder()],["Placeholder11",gill.getUnitDecoder()],["Placeholder12",gill.getUnitDecoder()],["Placeholder13",gill.getUnitDecoder()],["Placeholder14",gill.getUnitDecoder()],["Placeholder15",gill.getUnitDecoder()],["Placeholder16",gill.getUnitDecoder()],["Placeholder17",gill.getUnitDecoder()],["Placeholder18",gill.getUnitDecoder()],["TokenMetadata",gill.getStructDecoder([["fields",gill.getTupleDecoder([Gn()])]])],["Placeholder20",gill.getUnitDecoder()],["Placeholder21",gill.getUnitDecoder()],["Placeholder22",gill.getUnitDecoder()],["Placeholder23",gill.getUnitDecoder()],["Placeholder24",gill.getUnitDecoder()],["Placeholder25",gill.getUnitDecoder()],["Placeholder26",gill.getUnitDecoder()],["PausableAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([wn()])]])],["PermanentDelegateAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Hn()])]])],["TransferFeeAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Kn()])]])],["TransferHookAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([qn()])]])],["CompressedOnly",gill.getStructDecoder([["fields",gill.getTupleDecoder([an()])]])],["Compressible",gill.getStructDecoder([["fields",gill.getTupleDecoder([En()])]])]])}function HR(){return gill.combineCodec(Tn(),vt())}function FR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function GR(e,n){return n.__kind===e}function Jn(){return gill.getStructEncoder([["settingsMutArgs",j()],["transactionManager",gill.getOptionEncoder(Wt())]])}function Yn(){return gill.getStructDecoder([["settingsMutArgs",q()],["transactionManager",gill.getOptionDecoder(Lt())]])}function qR(){return gill.combineCodec(Jn(),Yn())}function Mt(){return gill.getStructEncoder([["pubkey",H()],["role",gill.getU8Encoder()],["permissions",He()],["userAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getU8Encoder()]])}function Rt(){return gill.getStructDecoder([["pubkey",oe()],["role",gill.getU8Decoder()],["permissions",Fe()],["userAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getU8Decoder()]])}function XR(){return gill.combineCodec(Mt(),Rt())}function H(){return gill.getStructEncoder([["keyType",gill.getU8Encoder()],["key",gill.fixEncoderSize(gill.getBytesEncoder(),33)]])}function oe(){return gill.getStructDecoder([["keyType",gill.getU8Decoder()],["key",gill.fixDecoderSize(gill.getBytesDecoder(),33)]])}function eb(){return gill.combineCodec(H(),oe())}function Qn(){return gill.getStructEncoder([["authorityCreationArgs",be()],["compressedProofArgs",D()]])}function $n(){return gill.getStructDecoder([["authorityCreationArgs",_e()],["compressedProofArgs",P()]])}function ob(){return gill.combineCodec(Qn(),$n())}function Ot(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function Bt(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function ab(){return gill.combineCodec(Ot(),Bt())}function fn(){return gill.getStructEncoder([["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()],["proveByIndex",gill.getBooleanEncoder()]])}function Sn(){return gill.getStructDecoder([["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()],["proveByIndex",gill.getBooleanDecoder()]])}function ub(){return gill.combineCodec(fn(),Sn())}function Ct(){return gill.getStructEncoder([["rootIndex",gill.getU16Encoder()],["proveByIndex",gill.getBooleanEncoder()],["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()]])}function Et(){return gill.getStructDecoder([["rootIndex",gill.getU16Decoder()],["proveByIndex",gill.getBooleanDecoder()],["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()]])}function pb(){return gill.combineCodec(Ct(),Et())}function Nn(){return gill.getStructEncoder([])}function wn(){return gill.getStructDecoder([])}function yb(){return gill.combineCodec(Nn(),wn())}function Vn(){return gill.getStructEncoder([])}function Hn(){return gill.getStructDecoder([])}function Sb(){return gill.combineCodec(Vn(),Hn())}function He(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function Fe(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function Cb(){return gill.combineCodec(He(),Fe())}function D(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(pn())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function P(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(mn())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function hb(){return gill.combineCodec(D(),P())}function Wn(){return gill.getStructEncoder([["memberKey",H()],["userArgs",Ge()]])}function Ln(){return gill.getStructDecoder([["memberKey",oe()],["userArgs",ze()]])}function _b(){return gill.combineCodec(Wn(),Ln())}function Rn(){return gill.getStructEncoder([["baseRent",gill.getU16Encoder()],["compressionCost",gill.getU16Encoder()],["lamportsPerBytePerEpoch",gill.getU8Encoder()],["maxFundedEpochs",gill.getU8Encoder()],["maxTopUp",gill.getU16Encoder()]])}function bn(){return gill.getStructDecoder([["baseRent",gill.getU16Decoder()],["compressionCost",gill.getU16Decoder()],["lamportsPerBytePerEpoch",gill.getU8Decoder()],["maxFundedEpochs",gill.getU8Decoder()],["maxTopUp",gill.getU16Decoder()]])}function kb(){return gill.combineCodec(Rn(),bn())}function ro(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function Nt(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function Ob(){return gill.combineCodec(ro(),Nt())}function F(){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 G(){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 wb(){return gill.combineCodec(F(),G())}function Z(){return gill.getStructEncoder([["domainConfigKey",gill.getAddressEncoder()],["verifyArgs",F()]])}function X(){return gill.getStructDecoder([["domainConfigKey",gill.getAddressDecoder()],["verifyArgs",G()]])}function Gb(){return gill.combineCodec(Z(),X())}function no(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function oo(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function jb(){return gill.combineCodec(no(),oo())}function so(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getBooleanEncoder()]])}function co(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getBooleanDecoder()]])}function Yb(){return gill.combineCodec(so(),co())}function j(){return gill.getStructEncoder([["accountMeta",xt()],["data",ht()]])}function q(){return gill.getStructDecoder([["accountMeta",It()],["data",K()]])}function $b(){return gill.combineCodec(j(),q())}function wt(){return gill.getStructEncoder([["accountMeta",Dt()],["data",ht()]])}function Vt(){return gill.getStructDecoder([["accountMeta",Pt()],["data",K()]])}function n_(){return gill.combineCodec(wt(),Vt())}function Ht(){return gill.getStructEncoder([["index",gill.getU8Encoder()],["restricted",gill.getBooleanEncoder()]])}function Ft(){return gill.getStructDecoder([["index",gill.getU8Decoder()],["restricted",gill.getBooleanDecoder()]])}function c_(){return gill.combineCodec(Ht(),Ft())}function Fn(){return gill.getStructEncoder([["updateAuthority",gill.getAddressEncoder()],["mint",gill.getAddressEncoder()],["name",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["symbol",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["uri",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["additionalMetadata",gill.getArrayEncoder(en())]])}function Gn(){return gill.getStructDecoder([["updateAuthority",gill.getAddressDecoder()],["mint",gill.getAddressDecoder()],["name",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["symbol",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["uri",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["additionalMetadata",gill.getArrayDecoder(tn())]])}function u_(){return gill.combineCodec(Fn(),Gn())}function Gt(){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(Ut())]])}function zt(){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(kt())]])}function m_(){return gill.combineCodec(Gt(),zt())}function Kt(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(on())],["addressTableLookups",gill.getArrayEncoder(mo())]])}function jt(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(sn())],["addressTableLookups",gill.getArrayDecoder(lo())]])}function f_(){return gill.combineCodec(Kt(),jt())}function mo(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function lo(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function I_(){return gill.combineCodec(mo(),lo())}function zn(){return gill.getStructEncoder([["withheldAmount",gill.getU64Encoder()]])}function Kn(){return gill.getStructDecoder([["withheldAmount",gill.getU64Decoder()]])}function D_(){return gill.combineCodec(zn(),Kn())}function jn(){return gill.getStructEncoder([["transferring",gill.getU8Encoder()]])}function qn(){return gill.getStructDecoder([["transferring",gill.getU8Decoder()]])}function M_(){return gill.combineCodec(jn(),qn())}var yo=(a=>(a[a.Ble=0]="Ble",a[a.Cable=1]="Cable",a[a.Hybrid=2]="Hybrid",a[a.Internal=3]="Internal",a[a.Nfc=4]="Nfc",a[a.SmartCard=5]="SmartCard",a[a.Usb=6]="Usb",a))(yo||{});function qt(){return gill.getEnumEncoder(yo)}function Jt(){return gill.getEnumDecoder(yo)}function __(){return gill.combineCodec(qt(),Jt())}function Yt(){return gill.getStructEncoder([["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["member",H()],["credentialId",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder()))],["transports",gill.getOptionEncoder(gill.getArrayEncoder(qt()))],["wallets",gill.getArrayEncoder(so())],["role",qe()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function te(){return gill.getStructDecoder([["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["member",oe()],["credentialId",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder()))],["transports",gill.getOptionDecoder(gill.getArrayDecoder(Jt()))],["wallets",gill.getArrayDecoder(co())],["role",Je()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function W_(){return gill.combineCodec(Yt(),te())}function be(){return gill.getStructEncoder([["addressTreeInfo",Ot()],["outputStateTreeIndex",gill.getU8Encoder()]])}function _e(){return gill.getStructDecoder([["addressTreeInfo",Bt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function N_(){return gill.combineCodec(be(),_e())}function $e(){return gill.getStructEncoder([["accountMeta",xt()],["data",Yt()]])}function et(){return gill.getStructDecoder([["accountMeta",It()],["data",te()]])}function F_(){return gill.combineCodec($e(),et())}function Wt(){return gill.getStructEncoder([["accountMeta",Dt()],["data",Yt()]])}function Lt(){return gill.getStructDecoder([["accountMeta",Pt()],["data",te()]])}function j_(){return gill.combineCodec(Wt(),Lt())}function Ge(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([Wt()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([$e()])]])]])}function ze(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([Lt()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([et()])]])]])}function Z_(){return gill.combineCodec(Ge(),ze())}function X_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Q_(e,n){return n.__kind===e}var Oe=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(Oe||{});function qe(){return gill.getEnumEncoder(Oe)}function Je(){return gill.getEnumDecoder(Oe)}function tv(){return gill.combineCodec(qe(),Je())}var Oc=new Uint8Array([223,179,163,190,177,224,67,173]);function nU(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Oc)}function l1(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(Mt())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]]),e=>({...e,discriminator:Oc}))}function hr(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(Rt())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function oU(){return gill.combineCodec(l1(),hr())}function Bc(e){return gill.decodeAccount(e,hr())}async function sU(e,n,r){let o=await To(e,n,r);return gill.assertAccountExists(o),o}async function To(e,n,r){let o=await gill.fetchEncodedAccount(e,n,r);return Bc(o)}async function cU(e,n,r){let o=await y1(e,n,r);return gill.assertAccountsExist(o),o}async function y1(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Bc(t))}var Fc=new Uint8Array([90,36,35,219,93,225,110,96]);function uU(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Fc)}function W1(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["multiWalletSettings",gill.getAddressEncoder()],["multiWalletBump",gill.getU8Encoder()],["canExecute",gill.getBooleanEncoder()],["preauthorizeExecution",gill.getBooleanEncoder()],["validTill",gill.getU64Encoder()],["payer",gill.getAddressEncoder()],["bump",gill.getU8Encoder()],["bufferIndex",gill.getU8Encoder()],["finalBufferHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["finalBufferSize",gill.getU16Encoder()],["creator",H()],["executor",H()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder(H())],["expectedSecp256r1Signers",gill.getArrayEncoder(Ut())],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Fc}))}function Gc(){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",oe()],["executor",oe()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["voters",gill.getArrayDecoder(oe())],["expectedSecp256r1Signers",gill.getArrayDecoder(kt())],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function AU(){return gill.combineCodec(W1(),Gc())}function zc(e){return gill.decodeAccount(e,Gc())}async function Kc(e,n,r){let o=await L1(e,n,r);return gill.assertAccountExists(o),o}async function L1(e,n,r){let o=await gill.fetchEncodedAccount(e,n,r);return zc(o)}async function gU(e,n,r){let o=await O1(e,n,r);return gill.assertAccountsExist(o),o}async function O1(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>zc(t))}var Jc=new Uint8Array([105,23,173,2,197,255,80,87]);function lU(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Jc)}function ef(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:Jc}))}function Yc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function yU(){return gill.combineCodec(ef(),Yc())}function Zc(e){return gill.decodeAccount(e,Yc())}async function Xc(e,n,r){let o=await tf(e,n,r);return gill.assertAccountExists(o),o}async function tf(e,n,r){let o=await gill.fetchEncodedAccount(e,n,r);return Zc(o)}async function TU(e,n,r){let o=await rf(e,n,r);return gill.assertAccountsExist(o),o}async function rf(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Zc(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 O(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 l(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:gill.AccountRole.READONLY});let o=r.isWritable?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY;return Object.freeze({address:O(r.value),role:Qc(r.value)?gill.upgradeRoleToSigner(o):o,...Qc(r.value)?{signer:r.value}:{}})}}function Qc(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var ea=new Uint8Array([8]);function WU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ea)}function Po(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:ea}))}function ta(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function LU(){return gill.combineCodec(Po(),ta())}async function ra(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Po().encode(c),programAddress:r})}function OU(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Po().encode(c),programAddress:r})}function BU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:ta().decode(e.data)}}var aa=new Uint8Array([9]);function zU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(aa)}function ia(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(Ke())],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())],["compressedProofArgs",gill.getOptionEncoder(D())]]),e=>({...e,discriminator:aa}))}function da(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(je())],["secp256r1VerifyArgs",gill.getArrayDecoder(X())],["compressedProofArgs",gill.getOptionDecoder(P())]])}function KU(){return gill.combineCodec(ia(),da())}function ua(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:ia().encode(c),programAddress:r})}function jU(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:da().decode(e.data)}}var la=new Uint8Array([19]);function $U(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(la)}function ya(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(Ke())],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:la}))}function Ta(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(je())],["secp256r1VerifyArgs",gill.getArrayDecoder(X())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function ek(){return gill.combineCodec(ya(),Ta())}function fa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:ya().encode(c),programAddress:r})}function tk(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Ta().decode(e.data)}}var Ia=new Uint8Array([18]);function ik(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ia)}function ho(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",D()],["addressTreeInfo",Ot()],["outputStateTreeIndex",gill.getU8Encoder()],["userArgs",Ge()],["settingsIndex",gill.getU128Encoder()]]),e=>({...e,discriminator:Ia}))}function Ca(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",P()],["addressTreeInfo",Bt()],["outputStateTreeIndex",gill.getU8Decoder()],["userArgs",ze()],["settingsIndex",gill.getU128Decoder()]])}function dk(){return gill.combineCodec(ho(),Ca())}async function Ea(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:ho().encode(c),programAddress:r})}function uk(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:ho().encode(c),programAddress:r})}function Ak(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:Ca().decode(e.data)}}var va=new Uint8Array([0]);function fk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(va)}function Ro(){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",be()],["compressedProofArgs",D()]]),e=>({...e,discriminator:va}))}function Ua(){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",_e()],["compressedProofArgs",P()]])}function Sk(){return gill.combineCodec(Ro(),Ua())}async function ka(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Ro().encode(c),programAddress:r})}function xk(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Ro().encode(c),programAddress:r})}function Ik(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Ua().decode(e.data)}}var Oa=new Uint8Array([4]);function Rk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Oa)}function bo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",D()],["member",ro()],["role",qe()],["credentialId",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["transports",gill.getArrayEncoder(qt())],["userAccountCreationArgs",be()],["linkWalletArgs",gill.getOptionEncoder(Jn())]]),e=>({...e,discriminator:Oa}))}function Ba(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",P()],["member",Nt()],["role",Je()],["credentialId",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["transports",gill.getArrayDecoder(Jt())],["userAccountCreationArgs",_e()],["linkWalletArgs",gill.getOptionDecoder(Yn())]])}function bk(){return gill.combineCodec(bo(),Ba())}async function Na(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:bo().encode(c),programAddress:r})}function _k(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:bo().encode(c),programAddress:r})}function vk(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:Ba().decode(e.data)}}var Va=new Uint8Array([3]);function Bk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Va)}function vo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Va}))}function Ha(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function Nk(){return gill.combineCodec(vo(),Ha())}async function Fa(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=l(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:vo().encode({}),programAddress:r})}function wk(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=l(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:vo().encode({}),programAddress:r})}function Vk(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:Ha().decode(e.data)}}var za=new Uint8Array([5]);function qk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(za)}function ko(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",D()],["createUserArgs",gill.getArrayEncoder(On())]]),e=>({...e,discriminator:za}))}function Ka(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",P()],["createUserArgs",gill.getArrayDecoder(Bn())]])}function Jk(){return gill.combineCodec(ko(),Ka())}async function ja(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:ko().encode(c),programAddress:r})}function Yk(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:ko().encode(c),programAddress:r})}function Zk(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Ka().decode(e.data)}}var Ya=new Uint8Array([17]);function nW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ya)}function Za(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMutArgs",j()],["compressedProofArgs",D()],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())]]),e=>({...e,discriminator:Ya}))}function Xa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMutArgs",q()],["compressedProofArgs",P()],["secp256r1VerifyArgs",gill.getArrayDecoder(X())]])}function oW(){return gill.combineCodec(Za(),Xa())}function Qa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Za().encode(c),programAddress:r})}function sW(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Xa().decode(e.data)}}var ti=new Uint8Array([2]);function AW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ti)}function ri(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:ti}))}function ni(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function gW(){return gill.combineCodec(ri(),ni())}function oi(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.admin),...a],data:ri().encode(c),programAddress:r})}function pW(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:ni().decode(e.data)}}var ii=new Uint8Array([1]);function xW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ii)}function Lo(){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(Qn())]]),e=>({...e,discriminator:ii}))}function di(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))],["newAuthorityArgs",gill.getOptionDecoder($n())]])}function IW(){return gill.combineCodec(Lo(),di())}async function CW(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Lo().encode(c),programAddress:r})}function ui(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:Lo().encode(c),programAddress:r})}function EW(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:o(),whitelistedAddressTrees:o(),systemProgram:r()},data:di().decode(e.data)}}var pi=new Uint8Array([6]);function _W(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(pi)}function mi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",$e()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",D()]]),e=>({...e,discriminator:pi}))}function li(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",et()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",P()]])}function vW(){return gill.combineCodec(mi(),li())}function yi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.authority),...a],data:mi().encode(c),programAddress:r})}function UW(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{authority:r()},data:li().decode(e.data)}}var Si=new Uint8Array([7]);function wW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Si)}function xi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",$e()],["secp256r1VerifyArgs",gill.getOptionEncoder(F())],["delegateTo",gill.getOptionEncoder(no())],["oldSettingsMutArgs",gill.getOptionEncoder(j())],["newSettingsMutArgs",gill.getOptionEncoder(j())],["compressedProofArgs",D()]]),e=>({...e,discriminator:Si}))}function Ii(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",et()],["secp256r1VerifyArgs",gill.getOptionDecoder(G())],["delegateTo",gill.getOptionDecoder(oo())],["oldSettingsMutArgs",gill.getOptionDecoder(q())],["newSettingsMutArgs",gill.getOptionDecoder(q())],["compressedProofArgs",P()]])}function VW(){return gill.combineCodec(xi(),Ii())}function Ci(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.feePayer),s(t.signer),s(t.oldSettings),s(t.newSettings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.domainConfig),...a],data:xi().encode(c),programAddress:r})}function HW(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:o(),oldSettings:o(),newSettings:o(),slotHashSysvar:o(),instructionsSysvar:o(),domainConfig:o()},data:Ii().decode(e.data)}}var Di=new Uint8Array([29]);function JW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Di)}function Oo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())]]),e=>({...e,discriminator:Di}))}function Pi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(X())]])}function YW(){return gill.combineCodec(Oo(),Pi())}async function ZW(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={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(O(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Oo().encode(c),programAddress:r})}function hi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Oo().encode(c),programAddress:r})}function XW(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Pi().decode(e.data)}}var bi=new Uint8Array([27]);function oL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(bi)}function _i(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:bi}))}function vi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(X())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function sL(){return gill.combineCodec(_i(),vi())}function Ui(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:_i().encode(c),programAddress:r})}function cL(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:vi().decode(e.data)}}var Oi=new Uint8Array([30]);function pL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Oi)}function wo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["splInterfacePdaArgs",gill.getOptionEncoder(Ht())],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccounts",gill.getOptionEncoder(gill.getArrayEncoder(bt()))],["compressedProofArgs",gill.getOptionEncoder(D())],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())]]),e=>({...e,discriminator:Oi}))}function Bi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["splInterfacePdaArgs",gill.getOptionDecoder(Ft())],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccounts",gill.getOptionDecoder(gill.getArrayDecoder(_t()))],["compressedProofArgs",gill.getOptionDecoder(P())],["secp256r1VerifyArgs",gill.getArrayDecoder(X())]])}function mL(){return gill.combineCodec(wo(),Bi())}async function lL(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={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(O(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(O(t.source.value)),gill.getAddressEncoder().encode(O(t.tokenProgram.value)),gill.getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(O(t.destination.value)),gill.getAddressEncoder().encode(O(t.tokenProgram.value)),gill.getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:wo().encode(c),programAddress:r})}function Ni(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:wo().encode(c),programAddress:r})}function yL(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:Bi().decode(e.data)}}var zi=new Uint8Array([28]);function EL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(zi)}function Vo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["splInterfacePdaArgs",gill.getOptionEncoder(Ht())],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccounts",gill.getOptionEncoder(gill.getArrayEncoder(bt()))],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:zi}))}function Ki(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["splInterfacePdaArgs",gill.getOptionDecoder(Ft())],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccounts",gill.getOptionDecoder(gill.getArrayDecoder(_t()))],["secp256r1VerifyArgs",gill.getArrayDecoder(X())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function DL(){return gill.combineCodec(Vo(),Ki())}async function PL(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={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(O(t.source.value)),gill.getAddressEncoder().encode(O(t.tokenProgram.value)),gill.getAddressEncoder().encode(O(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(O(t.destination.value)),gill.getAddressEncoder().encode(O(t.tokenProgram.value)),gill.getAddressEncoder().encode(O(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(O(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(O(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Vo().encode(c),programAddress:r})}function ji(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={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 a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Vo().encode(c),programAddress:r})}function hL(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:Ki().decode(e.data)}}var Yi=new Uint8Array([13]);function kL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Yi)}function Zi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())]]),e=>({...e,discriminator:Yi}))}function Xi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())]])}function WL(){return gill.combineCodec(Zi(),Xi())}function Qi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Zi().encode(c),programAddress:r})}function LL(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:Xi().decode(e.data)}}var td=new Uint8Array([23]);function FL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(td)}function rd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:td}))}function nd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function GL(){return gill.combineCodec(rd(),nd())}function od(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.rentCollector),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:rd().encode(c),programAddress:r})}function zL(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:nd().decode(e.data)}}var ad=new Uint8Array([10]);function XL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ad)}function id(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Gt()],["secp256r1VerifyArgs",gill.getOptionEncoder(F())]]),e=>({...e,discriminator:ad}))}function dd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",zt()],["secp256r1VerifyArgs",gill.getOptionDecoder(G())]])}function QL(){return gill.combineCodec(id(),dd())}function ud(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:id().encode(c),programAddress:r})}function $L(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:dd().decode(e.data)}}var pd=new Uint8Array([20]);function cO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(pd)}function md(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Gt()],["secp256r1VerifyArgs",gill.getOptionEncoder(F())],["settingsReadonlyArgs",wt()],["compressedProofArgs",D()]]),e=>({...e,discriminator:pd}))}function ld(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",zt()],["secp256r1VerifyArgs",gill.getOptionDecoder(G())],["settingsReadonlyArgs",Vt()],["compressedProofArgs",P()]])}function aO(){return gill.combineCodec(md(),ld())}function yd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:md().encode(c),programAddress:r})}function iO(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:ld().decode(e.data)}}var Sd=new Uint8Array([14]);function lO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Sd)}function xd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())]]),e=>({...e,discriminator:Sd}))}function Id(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())]])}function yO(){return gill.combineCodec(xd(),Id())}function Cd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:xd().encode(c),programAddress:r})}function TO(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:Id().decode(e.data)}}var Pd=new Uint8Array([24]);function DO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Pd)}function hd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Pd}))}function Md(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function PO(){return gill.combineCodec(hd(),Md())}function Rd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:hd().encode(c),programAddress:r})}function hO(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:Md().decode(e.data)}}var vd=new Uint8Array([12]);function UO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(vd)}function Ud(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:vd}))}function kd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function kO(){return gill.combineCodec(Ud(),kd())}function Wd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.transactionBuffer),...a],data:Ud().encode(c),programAddress:r})}function WO(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:kd().decode(e.data)}}var Bd=new Uint8Array([22]);function VO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Bd)}function Nd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:Bd}))}function wd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function HO(){return gill.combineCodec(Nd(),wd())}function Vd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.transactionBuffer),...a],data:Nd().encode(c),programAddress:r})}function FO(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:wd().decode(e.data)}}var Gd=new Uint8Array([11]);function YO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Gd)}function zd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())]]),e=>({...e,discriminator:Gd}))}function Kd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())]])}function ZO(){return gill.combineCodec(zd(),Kd())}function jd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:zd().encode(c),programAddress:r})}function XO(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:Kd().decode(e.data)}}var Yd=new Uint8Array([21]);function oB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Yd)}function Zd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())],["settingsReadonlyArgs",wt()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Yd}))}function Xd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())],["settingsReadonlyArgs",Vt()],["compressedProofArgs",P()]])}function sB(){return gill.combineCodec(Zd(),Xd())}function Qd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Zd().encode(c),programAddress:r})}function cB(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:Xd().decode(e.data)}}var tu=new Uint8Array([15]);function gB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(tu)}function ru(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:tu}))}function nu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function pB(){return gill.combineCodec(ru(),nu())}function ou(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=m({}),a=l(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:ru().encode({}),programAddress:r})}function mB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:nu().decode(e.data)}}var au=new Uint8Array([25]);function xB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(au)}function iu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:au}))}function du(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function IB(){return gill.combineCodec(iu(),du())}function uu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.transactionBuffer),...a],data:iu().encode(c),programAddress:r})}function CB(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:du().decode(e.data)}}var pu=new Uint8Array([16]);function bB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(pu)}function mu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Kt()],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())]]),e=>({...e,discriminator:pu}))}function lu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",jt()],["secp256r1VerifyArgs",gill.getArrayDecoder(X())]])}function _B(){return gill.combineCodec(mu(),lu())}function yu(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:mu().encode(c),programAddress:r})}function vB(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:lu().decode(e.data)}}var Su=new Uint8Array([26]);function NB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Su)}function xu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Kt()],["secp256r1VerifyArgs",gill.getArrayEncoder(Z())],["settingsMutArgs",j()],["compressedProofArgs",D()]]),e=>({...e,discriminator:Su}))}function Iu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",jt()],["secp256r1VerifyArgs",gill.getArrayDecoder(X())],["settingsMutArgs",q()],["compressedProofArgs",P()]])}function wB(){return gill.combineCodec(xu(),Iu())}function Cu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),s=l(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:xu().encode(c),programAddress:r})}function VB(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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Iu().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",dE=(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))(dE||{});function CN(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 uE=(y=>(y[y.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",y[y.ChangeConfig=1]="ChangeConfig",y[y.ChangeConfigCompressed=2]="ChangeConfigCompressed",y[y.CreateCompressedWallet=3]="CreateCompressedWallet",y[y.CreateDomainConfig=4]="CreateDomainConfig",y[y.CreateDomainUserAccount=5]="CreateDomainUserAccount",y[y.CreateGlobalCounter=6]="CreateGlobalCounter",y[y.CreateUserAccounts=7]="CreateUserAccounts",y[y.DecompressSettingsAccount=8]="DecompressSettingsAccount",y[y.DisableDomainConfig=9]="DisableDomainConfig",y[y.EditDomainConfig=10]="EditDomainConfig",y[y.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",y[y.EditUserDelegate=12]="EditUserDelegate",y[y.NativeTransferIntent=13]="NativeTransferIntent",y[y.NativeTransferIntentCompressed=14]="NativeTransferIntentCompressed",y[y.TokenTransferIntent=15]="TokenTransferIntent",y[y.TokenTransferIntentCompressed=16]="TokenTransferIntentCompressed",y[y.TransactionBufferClose=17]="TransactionBufferClose",y[y.TransactionBufferCloseCompressed=18]="TransactionBufferCloseCompressed",y[y.TransactionBufferCreate=19]="TransactionBufferCreate",y[y.TransactionBufferCreateCompressed=20]="TransactionBufferCreateCompressed",y[y.TransactionBufferExecute=21]="TransactionBufferExecute",y[y.TransactionBufferExecuteCompressed=22]="TransactionBufferExecuteCompressed",y[y.TransactionBufferExtend=23]="TransactionBufferExtend",y[y.TransactionBufferExtendCompressed=24]="TransactionBufferExtendCompressed",y[y.TransactionBufferVote=25]="TransactionBufferVote",y[y.TransactionBufferVoteCompressed=26]="TransactionBufferVoteCompressed",y[y.TransactionExecute=27]="TransactionExecute",y[y.TransactionExecuteCompressed=28]="TransactionExecuteCompressed",y[y.TransactionExecuteSync=29]="TransactionExecuteSync",y[y.TransactionExecuteSyncCompressed=30]="TransactionExecuteSyncCompressed",y))(uE||{});function EN(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([29])),0))return 13;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 14;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 15;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 16;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 17;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 18;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 19;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 20;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 21;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 22;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 23;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 24;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 25;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 26;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 27;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 28;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 29;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 30;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var gE=6e3,pE=6001,mE=6002,lE=6003,yE=6004,TE=6005,fE=6006,SE=6007,xE=6008,IE=6009,CE=6010,EE=6011,DE=6012,PE=6013,hE=6014,ME=6015,RE=6016,bE=6017,_E=6018,vE=6019,UE=6020,kE=6021,WE=6022,LE=6023,OE=6024,BE=6025,NE=6026,wE=6027,VE=6028,HE=6029,FE=6030,GE=6031,zE=6032,KE=6033,jE=6034,qE=6035,JE=6036,YE=6037,ZE=6038,XE=6039,QE=6040,$E=6041,eD=6042,tD=6043,rD=6044,nD=6045,oD=6046,sD=6047,cD=6048,aD=6049,iD=6050,dD=6051,uD=6052,AD=6053,gD=6054,pD=6055,mD=6056,lD=6057,yD=6058,TD=6059,fD=6060,SD=6061,xD=6062,ID=6063,CD=6064,ED=6065,DD=6066,PD=6067,hD=6068,MD=6069,RD=6070,bD=6071,_D=6072,vD=6073,UD=6074,kD=6075,WD=6076,LD=6077,OD=6078,BD=6079,ND=6080,wD=6081,VD=6082,HD=6083,FD=6084,GD=6085,zD=6086,Eu;process.env.NODE_ENV!=="production"&&(Eu={[GE]:"This member is already delegated to another wallet.",[SE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[LD]:"Clock sysvar access failed. This may indicate a system error.",[dD]:"Missing credential id.",[AD]:"The domain configuration account is disabled. Please contact support or try again later.",[gD]:"Missing domain configuration account.",[kD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[zD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[CE]:"Duplicate public keys detected among members. Each member must have a unique key.",[IE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[kE]:"No members provided. A multisig wallet must contain at least one member.",[fD]:"Slot numbers list is empty. At least one slot number is required for validation.",[_E]:"Expected a User with Administrator role for this instruction.",[xE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[RE]:"Expected a User with Transaction Manager role for this instruction.",[QE]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[$E]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[eD]:"Declared buffer size does not match the actual serialized size.",[TD]:"Failed to compute hash. This may indicate a system error.",[jE]:"Not enough members with vote permission to meet the approval threshold.",[zE]:"At least one signer with execute permission is required to proceed.",[KE]:"At least one signer with initiate permission is required to perform this action.",[NE]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[UD]:"Invalid account index in transaction message. The account index is out of bounds.",[lD]:"Address Tree supplied is not part of the whitelisted address trees.",[vE]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[VE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[XE]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[SD]:"Member key conversion failed. The provided key format is invalid.",[qE]:"Only delegated members are allowed for this transaction.",[BE]:"Unexpected number of accounts provided for this instruction.",[PE]:"User with Permanent Member role must have a delegated wallet.",[pE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[yE]:"The extracted public key has an invalid length or encoding.",[gE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[lE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[iD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[cD]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[LE]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[bD]:"Invalid source type for token transfer. The source account type is not supported.",[bE]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[ME]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[OE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[ND]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[wE]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[BD]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[RD]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[TE]:"The extracted WebAuthn signed message payload is malformed.",[oD]:"An input string exceeds the maximum allowed character length.",[pD]:"This member is not registered under the provided domain configuration.",[CD]:"Member not found in settings. Cannot remove a member that does not exist.",[vD]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[HE]:"A required account is missing from the instruction context.",[xD]:"Compressed proof arguments are missing. Required for compressed account operations.",[PD]:"Missing compressed token account. Required for token transfer operations.",[wD]:"Missing destination token account. Required for token transfer operations.",[MD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[ID]:"Light CPI accounts are missing. Required for compressed account operations.",[FE]:"User mutation arguments are required when performing add or remove delegate operations.",[FD]:"Missing new authority account. Required for domain configuration updates.",[HD]:"Missing settings account. Required for delegate operations on compressed wallets.",[yD]:"Compressed settings data is missing. The settings account must be initialized with data.",[VD]:"Missing source token account. Required for token transfer operations.",[hD]:"Missing SPL interface PDA. Required for token transfer operations.",[sD]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[WD]:"User account address is missing. Required for secp256r1 signature verification.",[GD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[YE]:"No valid signer found in this transaction.",[UE]:"Only one administrator is allowed per wallet.",[DE]:"Only one permanent member is allowed per wallet.",[hE]:"Only one transaction manager is allowed per wallet.",[mD]:"The given origin index is not in the whitelisted origins.",[DD]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[EE]:"Permanent members cannot be removed from a wallet.",[nD]:"Writable CPI calls to protected accounts are not permitted.",[fE]:"The rpIdHash extracted from the signed message does not match the expected value.",[ED]:"Settings key mismatch. The provided settings key does not match the expected value.",[mE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[aD]:"The specified slot number was not found in the provided slot history.",[_D]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[WE]:"Too many members: a maximum of 4 members are supported.",[tD]:"This transaction has expired. It must be executed within 3 minutes of approval.",[rD]:"This transaction has not yet reached the required approval threshold.",[uD]:"Missing transports.",[ZE]:"Only the transaction creator or rent payer may close this transaction buffer.",[OD]:"Unauthorized: Only the admin account is allowed to perform this action.",[JE]:"Member is not part of the expected signers for this transaction."});function bN(e){return process.env.NODE_ENV!=="production"?Eu[e]:"Error message not available in production bundles."}function _N(e,n,r){return gill.isProgramError(e,n,A,r)}async function HN({admin:e,addressTree:n}){return ra({payer:e,addressTree:n,remainingAccounts:[]})}var Go=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Du="https://mainnet.block-engine.jito.wtf/api/v1",Pu="https://bundles.jito.wtf/api/v1/bundles/tip_floor",hu="landed_tips_75th_percentile";var ve=class extends Error{constructor(r,o,t){super(r);this.code=o;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},tt=class extends ve{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},re=class extends ve{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},z=class extends ve{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},Ce=class extends ve{constructor(r,o,t){super(r,"NETWORK_ERROR",{statusCode:o,url:t});this.statusCode=o;this.url=t;}};var me=class extends ve{constructor(r,o,t){super(r,"BUNDLE_ERROR",{bundleId:o,attempt:t});this.bundleId=o;this.attempt=t;}},Or=class extends ve{constructor(r,o,t){super(`Operation "${r}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=o;this.lastError=t;}},Br=class extends ve{constructor(r,o,t){super(r,"PERMISSION_ERROR",{required:o,actual:t});this.required=o;this.actual=t;}};var Qt={Ed25519:1,Secp256r1:2};var Mu=T__default.default.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),YN=T__default.default.object({transactionActionType:Mu,transactionAddress:T__default.default.string(),transactionMessageBytes:T__default.default.array(T__default.default.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),KD=T__default.default.object({transactionActionType:Mu,transactionAddress:T__default.default.string(),transactionMessageBytes:T__default.default.base64()}).strict(),Ru=T__default.default.object({phase:T__default.default.literal("start"),redirectOrigin:T__default.default.url(),signer:T__default.default.string().optional(),rid:T__default.default.string(),validTill:T__default.default.number(),data:T__default.default.object({type:T__default.default.literal("message"),payload:T__default.default.string()}).strict()}).strict(),bu=T__default.default.object({phase:T__default.default.literal("start"),redirectOrigin:T__default.default.url(),signer:T__default.default.string().optional(),rid:T__default.default.string(),validTill:T__default.default.number(),data:T__default.default.object({type:T__default.default.literal("transaction"),payload:KD,sendTx:T__default.default.boolean()}).strict()}).strict(),_u=T__default.default.object({startRequest:T__default.default.union([Ru,bu]),authResponse:T__default.default.custom(),client:T__default.default.object({clientOrigin:T__default.default.url(),jws:T__default.default.string()}).strict(),device:T__default.default.object({jwk:T__default.default.base64(),jws:T__default.default.string()}).strict(),authProvider:T__default.default.object({jwk:T__default.default.base64(),jws:T__default.default.string()}).strict().optional()}).strict(),vu=T__default.default.object({signer:T__default.default.string(),userAddressTreeIndex:T__default.default.number().optional(),additionalInfo:T__default.default.looseObject({}).optional()}).strict(),jD=T__default.default.object({slotHash:T__default.default.string(),slotNumber:T__default.default.string(),originIndex:T__default.default.number(),crossOrigin:T__default.default.boolean()}).strict(),ZN=T__default.default.object({phase:T__default.default.literal("complete"),data:T__default.default.object({type:T__default.default.literal("message"),payload:vu.extend(_u.shape).extend({id:T__default.default.string().optional(),client:T__default.default.object({clientOrigin:T__default.default.url()}).strict()})}).strict()}).strict(),XN=T__default.default.object({phase:T__default.default.literal("complete"),data:T__default.default.object({type:T__default.default.literal("transaction"),payload:vu.extend(_u.shape).extend(jD.shape).extend({client:T__default.default.object({clientOrigin:T__default.default.url()}).strict()})}).strict()}).strict(),QN=T__default.default.object({phase:T__default.default.literal("complete"),data:T__default.default.object({type:T__default.default.literal("transaction"),payload:T__default.default.object({startRequest:T__default.default.union([bu,Ru]),txSig:T__default.default.string()})}).strict()}).strict();var Ue={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Be=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,o)=>r|o,0))}static all(){return new e(Object.values(Ue).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var zo=33,Ne=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!==zo)throw new Error(`Invalid public key length, expected ${zo} 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===zo)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()}},E=class extends Ne{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 YD(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function ZD(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var ku=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(YD())],["addressTableLookups",gill.getArrayCodec(ZD())]]);function Wu(e){return ku.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 Lu(e){let n=ku.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}var de={};function Ou(){if(!de.solanaRpcEndpoint)throw new tt("RPC endpoint");return de.solanaRpcEndpoint}function Ve(){if(!de.lightProtocolRpc)throw new tt("Light Protocol RPC");return de.lightProtocolRpc}function Q(){if(!de.solanaRpc)throw new tt("Solana RPC");return de.solanaRpc}function Bu(){if(!de.sendAndConfirm)throw new tt("Send and confirm transaction function");return de.sendAndConfirm}function jo(){return de.jitoTipsConfig?de.jitoTipsConfig:{blockEngineUrl:Du,getJitoTipsUrl:Pu,priority:hu}}function Iw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:o}){de.solanaRpcEndpoint=e,de.lightProtocolRpc=stateless_js.createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=gill.createSolanaClient({urlOrMoniker:e});de.solanaRpc=t,de.sendAndConfirm=c,de.jitoTipsConfig=o??null;}async function $t(e,n){if(!e.ok)throw new Ce(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function er(e){try{return await e.json()}catch(n){throw new Ce(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function Ow(e){let n=tinyCbor.decodeCBOR(e),r=nist_js.p256.Point.fromAffine({x:BigInt("0x"+wr(n.get(-2))),y:BigInt("0x"+wr(n.get(-3)))});return gill.getBase58Decoder().decode(r.toBytes(true))}function Bw(e){let r=nist_js.p256.Point.fromBytes(gill.getBase58Encoder().encode(e)).toBytes(false),o=new Map;return o.set(1,2),o.set(3,-7),o.set(-1,1),o.set(-2,r.slice(1,33)),o.set(-3,r.slice(33,65)),new Uint8Array(tinyCbor.encodeCBOR(o))}async function Nw(e){let{authenticatorData:n,clientDataJSON:r,signature:o}=e.authResponse.response,t=xe(n),c=JSON.parse(gill.getUtf8Decoder().decode(xe(r))),i=Hu(c),a=Gu(xe(o)),s=await gt({rpIdHash:t.subarray(0,32)});return new E(e.signer.toString(),{verifyArgs:{clientDataJson:xe(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:gill.getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:qo(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:s,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function qo(e,n,r){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...gill.getBase64Encoder().encode(n),...gill.getBase64Encoder().encode(r)]))}function ww(e){return sha2_js.sha256(gill.getUtf8Encoder().encode(JSON.stringify(e)))}function Vw(e){return Jo(e.data.payload.authResponse)}function Hw(e,n,r,o){let t=qo(n,r,o);return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...t]))}async function Fw(e,n,r,o,t,c){let i;if(!t||!c){let u=(await Q().getAccountInfo(gill.address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!u)throw new re("Slot sysvar","Unable to fetch slot sysvar data");let g=gill.getBase64Encoder().encode(u[0]);c=gill.getU64Decoder().decode(g.subarray(0,8)).toString(),i=g.subarray(8,40),t=gill.getBase58Decoder().decode(i);}else i=gill.getBase58Encoder().encode(t);let a=sha2_js.sha256(typeof e.transactionMessageBytes=="string"?gill.getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),s=qo(n,r,o),d=sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e.transactionActionType),...gill.getBase58Encoder().encode(e.transactionAddress),...a,...i,...s]));return {slotNumber:c,slotHash:t,challenge:d}}function Jo(e){let n=Vr(e);return sha2_js.sha256(n)}function Gw(e){let n="";for(let o of e)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function xe(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,o=n.padEnd(n.length+r,"="),t=atob(o),c=new ArrayBuffer(t.length),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}async function zw(e,n){let{data:r}=await Cs(Q(),e),t=Fu(r.origins,r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new re("Origin","Origin not found in domain config");return t}function Kw(e){return gill.getBase64Decoder().decode(gill.getUtf8Encoder().encode(jsonCanonicalize.canonicalize(e)))}function jw(e){return JSON.parse(gill.getUtf8Decoder().decode(gill.getBase64Encoder().encode(e)))}function wr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function cP(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 Hu(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 o=JSON.stringify(r);return new TextEncoder().encode(o.slice(1,-1))}function Fu(e,n){let r=[],o=0,t=new TextDecoder;for(let c=0;c<n;c++){if(o+2>e.length)throw new Error("MaxLengthExceeded");let i=e[o]|e[o+1]<<8;if(o+=2,o+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(o,o+i),s=t.decode(a);r.push(s),o+=i;}return r}function Gu(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 b=n&127;r+=b;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let o=e[r+1],t=r+2,c=e.slice(t,t+o);if(r=t+o,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,s=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=s[0]===0&&s.length>32?s.slice(1):s;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let p=nist_js.p256.Point.CURVE().n>>1n,f=BigInt("0x"+wr(u)),I=(f>p?nist_js.p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=cP(I);return new Uint8Array([...g,...x])}function Vr(e){let n=xe(e.response.clientDataJSON),r=xe(e.response.authenticatorData),o=sha2_js.sha256(n);return new Uint8Array([...r,...o])}var gP={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true,initialDelayMs:500,maxRetries:3};function pP(e,n,r,o){let t=n*Math.pow(r,e-1);return Math.min(t,o)}function mP(e){return new Promise(n=>setTimeout(n,e))}async function nr(e,n){let{maxRetries:r,initialDelayMs:o,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...gP,...n},a;for(let s=1;s<=r;s++)try{return await e()}catch(d){if(a=d,i&&!i(d,s))throw d;if(s>=r)break;let u=pP(s,o,t,c);await mP(u);}throw new Or(e.name||"retryWithBackoff",r,a)}async function pt(e,n){let r=(o,t)=>t>(n?.maxRetries??3)?false:o instanceof Response?o.status===429?n?.retryOnRateLimit??true:o.status>=400&&o.status<500?false:o.status>=500:o instanceof TypeError||o instanceof Error;return nr(e,{...n,shouldRetry:n?.shouldRetry??r})}function qu(e,n,r,o){if(e<n||e>r)throw new z(`${o} must be between ${n} and ${r} (inclusive), got ${e}`)}function Ju(e,n){if(e<0)throw new z(`${n} must be non-negative, got ${e}`)}function or(e,n){if(e.length===0)throw new z(`${n} cannot be empty`)}function Yu(e,n){if(e.trim().length===0)throw new z(`${n} cannot be empty`)}async function Zo(e,n=false){let r=n?{blockhash:gill.getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await Q().getLatestBlockhash().send()).value;return await Promise.all(e.map(async o=>await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(o.instructions,c),c=>gill.setTransactionMessageFeePayerSigner(o.payer,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(r,c),c=>o.addressesByLookupTableAddress?gill.compressTransactionMessageUsingAddressLookupTables(c,o.addressesByLookupTableAddress):c,async c=>{let i=Math.ceil((o.unitsConsumed??0)*1.1);return i>2e5?gill.prependTransactionMessageInstructions([programs.getSetComputeUnitLimitInstruction({units:i})],c):c},async c=>n?gill.compileTransaction(await c):await gill.signTransactionMessageWithSigners(await c))))}async function tA(e){let n=gill.prependTransactionMessageInstructions([programs.getSetComputeUnitLimitInstruction({units:8e5}),programs.getSetComputeUnitPriceInstruction({microLamports:1e4})],e),r=gill.getBase64EncodedWireTransaction(gill.compileTransaction(n));if(r.length>1644)throw new z(`Transaction exceeds maximum length of ${1644} bytes (actual: ${r.length} bytes)`);let o=await Q().simulateTransaction(r,{encoding:"base64"}).send();if(o.value.err){if(o.value.logs){let c=["Transaction simulation failed:","",...o.value.logs].join(`
|
|
2
|
+
`);throw new Error(c)}let t=["Transaction simulation failed:","",o.value.err.toString()].join(`
|
|
3
|
+
`);throw new Error(t)}return o.value.unitsConsumed}async function rA(e,n){let o=(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));o.sort((c,i)=>c-i);let t=Math.floor(o.length/2);return o.length%2===0?Math.round((o[t-1]+o[t])/2):o[t]}async function nA(e,n){or(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new z(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await pt(()=>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:[]}))}]})}));await $t(r,n);let o=await er(r);if(!o.result||o.error)throw new me(`Unable to simulate bundle: ${JSON.stringify(o.error??o.result)}`);if(typeof o.result.value.summary!="string"&&o.result.value.summary.failed){let{TransactionFailure:t}=o.result.value.summary.failed.error,[,c]=t;throw new me(`Simulation failed: ${c}`)}return o.result.value.transactionResults.map(t=>t.unitsConsumed)}function J(e,n=0){let r=e instanceof E?e:void 0,o=r?.verifyArgs&&n!==-1?gill.some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):gill.none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs.clientDataJson?Vr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:o,signature:c,message:i,publicKey:a}}function Ee(e){if(e instanceof Ne)return {keyType:Qt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Qt.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function Xu(e){return e instanceof E?e.toString():e.address.toString()}function Te(e){let n=new Set,r=[];for(let t of e)n.has(Xu(t))||(r.push(t),n.add(Xu(t)));let o=r.filter(t=>t instanceof E);if(o.length>1)throw new z(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return r}function oA({payer:e,tipAmount:n}){let r=Go[Math.floor(Math.random()*Go.length)];return programs.getTransferSolInstruction({source:e,destination:gill.address(r),amount:n})}function sA(e){return typeof e=="string"?e:e.toString()}function cA(e){return e.toString()}async function Xo(e,n,r){let o=e?.get(n);if(o)return o;let t=await r();return t&&e&&e.set(n,t),t}var Qo=[{tree:new web3_js.PublicKey(stateless_js.batchMerkleTree1),queue:new web3_js.PublicKey(stateless_js.batchQueue1),cpiContext:new web3_js.PublicKey(stateless_js.batchCpiContext1),nextTreeInfo:null,treeType:stateless_js.TreeType.StateV2},{tree:new web3_js.PublicKey(stateless_js.batchMerkleTree2),queue:new web3_js.PublicKey(stateless_js.batchQueue2),cpiContext:new web3_js.PublicKey(stateless_js.batchCpiContext2),nextTreeInfo:null,treeType:stateless_js.TreeType.StateV2},{tree:new web3_js.PublicKey(stateless_js.batchMerkleTree3),queue:new web3_js.PublicKey(stateless_js.batchQueue3),cpiContext:new web3_js.PublicKey(stateless_js.batchCpiContext3),nextTreeInfo:null,treeType:stateless_js.TreeType.StateV2},{tree:new web3_js.PublicKey(stateless_js.batchMerkleTree4),queue:new web3_js.PublicKey(stateless_js.batchQueue4),cpiContext:new web3_js.PublicKey(stateless_js.batchCpiContext4),nextTreeInfo:null,treeType:stateless_js.TreeType.StateV2},{tree:new web3_js.PublicKey(stateless_js.batchMerkleTree5),queue:new web3_js.PublicKey(stateless_js.batchQueue5),cpiContext:new web3_js.PublicKey(stateless_js.batchCpiContext5),nextTreeInfo:null,treeType:stateless_js.TreeType.StateV2}],N=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?gill.AccountRole.WRITABLE_SIGNER:gill.AccountRole.READONLY_SIGNER:r?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...stateless_js.getLightSystemAccountMetasV2({selfProgram:new web3_js.PublicKey(A.toString())}).map(n=>({address:gill.address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,gill.AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let o=this.nextIndex++,t={address:gill.address(n),role:r};this.map.set(n,{index:o,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=stateless_js.selectStateTreeInfo(Qo);return this.packOutputTreeIndex(n)}packTreeInfos(n,r){let o=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());o.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let s=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(s);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:o.length>0?{packedTreeInfos:o,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,o)=>r[1].index-o[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,o]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:o}}};async function Fr(e,n){let r=sA(e);return Xo(n,r,()=>oh(e))}async function oh(e,n){if(!e)throw new Error("Either hash or address must be provided");let r=await stateless_js.rpcRequest(Ve().compressionApiEndpoint,stateless_js.versionedEndpoint("getCompressedAccount"),{hash:void 0,address:e?stateless_js.encodeBN254toBase58(e):void 0}),o;if(stateless_js.featureFlags.isV2()?o=superstruct.create(r,stateless_js.jsonRpcResultAndContext(superstruct.nullable(stateless_js.CompressedAccountResultV2))):o=superstruct.create(r,stateless_js.jsonRpcResultAndContext(superstruct.nullable(stateless_js.CompressedAccountResult))),"error"in o)throw new web3_js.SolanaJSONRPCError(o.error,`failed to get info for compressed account ${e?e.toString():""}`);if(o.result.value===null)return null;let t=stateless_js.featureFlags.isV2()?o.result.value.merkleContext.tree:o.result.value.tree,c=stateless_js.getStateTreeInfoByPubkey(Qo,t),i=o.result.value;return stateless_js.createCompressedAccountWithMerkleContextLegacy(stateless_js.createMerkleContextLegacy(c,i.hash,i.leafIndex),i.owner,stateless_js.bn(i.lamports),i.data?stateless_js.parseAccountData(i.data):void 0,i.address||void 0)}async function ot(e,n){let r=cA(e);return Xo(n,r,()=>Q().getAccountInfo(e,{encoding:"base64"}).send())}async function le(e,n){let r=(await Promise.all(e.map(o=>Fr(o.address,n)))).filter(o=>o!==null).filter(o=>o.data!==null&&o.address!==null);if(r.length!==e.length)throw new re("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((o,t)=>({...o,type:e[t].type,tree:o.treeInfo.tree,queue:o.treeInfo.queue}))}function k(e,n){return {proof:e?.compressedProof?gill.some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function De(e,n,r,o,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:o[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function ae(e,n,r,o,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:o[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let s=e.packTreeInfos(a,[]).stateTrees;if(!s)throw new z("Unable to parse state tree data");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:s.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:s.outputTreeIndex}}))}async function Pe(e,n,r,o,t){let c=null,i=null,a=null,s=new N;if(e){await s.addSystemAccounts();let{address:d}=await ue(n,r),u=(await le([{address:d,type:"Settings"}],t))[0];o?a={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:a=await $([u],[]);let g=s.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!g)throw new z("Unable to parse state tree data");c={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0]},data:K().decode(u.data?.data)},i={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:K().decode(u.data?.data)};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:s,settingsMutArgs:i}}async function $(e,n){return nr(()=>Ve().getValidityProofV0(e,n))}async function he(){return (await Gr()).length-1}var $o;async function Gr(){if(!$o){let{data:e}=await Xc(Q(),await mA());$o=e.whitelistedAddressTrees;}return $o}function pA(e){if(!e||e.length<8)return 3;if(e[0]===2)return 1;let n=e[7];return n===3?2:3}async function cr(e,n,r){let o=await ah(e,n,r);if(!o)throw new re("User account");return o}async function ah(e,n,r){let{address:o}=await w(e,n),t=await Fr(o,r);return t?.data?.data?te().decode(t.data.data):null}async function H2(e,{member:n,credentialId:r}){let o=[{memcmp:{offset:1,encoding:"base58",bytes:e}}];if(n)o.push({memcmp:{offset:33,encoding:"base58",bytes:gill.getBase58Decoder().decode(H().encode(Ee(n)))}});else if(r)o.push({memcmp:{offset:72,encoding:"base58",bytes:gill.getBase58Decoder().decode(xe(r))}});else return null;let t=await Ve().getCompressedAccountsByOwner(new web3_js.PublicKey(A.toString()),{filters:o});return t.items.filter(c=>!!c.data).length?t.items.map(c=>te().decode(c.data?.data))[0]:null}async function zr(e,n,r){let o=await ih(e,n,r);if(!o)throw new re("Settings account");return o}async function ih(e,n,r){try{let{address:o}=await ue(e,n),t=await Fr(o,r);if(!t?.data?.data)throw new re("Compressed settings account");let c=K().decode(t.data.data);if(c.data.__option==="None")throw new re("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let o=await To(Q(),e);return o.exists?{...o.data,isCompressed:false}:null}}async function F2(e,n,r){let o=await cr(e,n,r);if(o.role===1||o.role===0){let t=[],[c,i]=await Promise.all([Ve().getCompressedAccountsByOwner(new web3_js.PublicKey(A.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:gill.getBase58Decoder().decode(H().encode(Ee(e)))}}]}),Q().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:gill.getBase64Decoder().decode(H().encode(Ee(e)))}}]}).send()]);return c.items.forEach(a=>{if(a.data?.data){let s=K().decode(a.data.data);s.data.__option==="Some"&&t.push({...s.data.value,isCompressed:true});}}),i.forEach(a=>{let s=hr().decode(gill.getBase64Encoder().encode(a.account.data[0]));t.push({...s,isCompressed:false});}),t}else return await Promise.all(o.wallets.map(async t=>zr(await Me(t.index),t.settingsAddressTreeIndex,r)))}async function ts(e){Ju(e,"index");let n=await Gr();if(e>=n.length)throw new z(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function G2(e){let r=(await Gr()).findIndex(o=>o.toString()===e);if(r===-1)throw new re("Address tree",`Address ${e} not found in whitelist`);return r}async function ue(e,n=0){let r=await ts(n),o=stateless_js.deriveAddressSeedV2([gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e)]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(o,new web3_js.PublicKey(r),new web3_js.PublicKey(A)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function w(e,n=0){let r=await ts(n),o=stateless_js.deriveAddressSeedV2([gill.getUtf8Encoder().encode("user"),e instanceof Ne?e.toTruncatedBuffer():gill.getAddressEncoder().encode(e)]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(o,new web3_js.PublicKey(r),new web3_js.PublicKey(A.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function gt({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha2_js.sha256(gill.getUtf8Encoder().encode(n));else throw new z("Either rpId or rpIdHash must be provided");let[r]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("domain_config"),e]});return r}async function SA(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function mA(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function xA(e,n,r){qu(r,0,255,"buffer_index");let[o]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),n instanceof Ne?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return o}async function ke(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return n}async function Me(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function t6(e){let n=await Me(e);return await ke(n)}async function r6(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}async function g6(e){or(e,"bundle");let n=await Zo(e,true),r=await nA(n.map(gill.getBase64EncodedWireTransaction),Ou()),o=await Zo(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await lh(o.map(gill.getBase64EncodedWireTransaction))}async function lh(e,n=jo(),r){or(e,"serializedTransactions");let{blockEngineUrl:o}=n,t=`${o}/bundles`,c=await pt(()=>fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})}),r);await $t(c,t);let i=await er(c);if(i.error)throw new me(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new me("No bundle ID returned from Jito");return i.result}async function p6(e,n=30,r=3e3,o=jo()){Yu(e,"bundleId");let{blockEngineUrl:t}=o,c=`${t}/getBundleStatuses`;return nr(async()=>{let i=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await $t(i,c);let a=await er(i);if(a.error)throw new me(`Error getting bundle status: ${JSON.stringify(a.error,null,2)}`,e);if(!a.result?.value?.length)throw new me("Bundle not yet confirmed",e);let s=a.result.value[0];if(s.confirmation_status==="confirmed"||s.confirmation_status==="finalized"){let d=s.transactions[s.transactions.length-1];if(!d)throw new me("No transactions in confirmed bundle",e);return d}throw new me(`Bundle status: ${s.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:i=>i instanceof me||i instanceof Ce})}async function x6({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=await Q().getLatestBlockhash().send(),t=await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(e,c),c=>gill.setTransactionMessageFeePayerSigner(n,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(o.value,c),c=>r?gill.compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([tA(c),rA(Q(),c.instructions.flatMap(d=>d.accounts??[]))]),s=Math.ceil((Number(i)??0)*1.1);return gill.prependTransactionMessageInstructions([...s>2e5?[programs.getSetComputeUnitLimitInstruction({units:s})]:[],...a>0?[programs.getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await gill.signTransactionMessageWithSigners(await c));return await Bu()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}function L6(e,n){if(n.threshold>1)throw new z("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(s=>DA(s.pubkey)===e);if(!r)throw new re("Member",`Signer ${e} not found in settings`);let{permissions:o}=r;if(!o)throw new re("Permissions","No permissions found for the current member");let t=Be.has(o,Ue.InitiateTransaction),c=Be.has(o,Ue.VoteTransaction),i=Be.has(o,Ue.ExecuteTransaction);if(t&&c&&i)return {};if(!c||!i)throw new Br("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(s=>s.role===0);if(!a)throw new re("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:gill.address(DA(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}async function O6({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:o,cachedAccounts:t}){if(!n)return null;let c=await cr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new re("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return Uh(n,c.transactionManagerUrl.value,e,o)}function Uh(e,n,r,o){return {address:e,async signTransactions(t){let c=await pt(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:e.toString(),payload:t.map(a=>({transaction:gill.getBase64Decoder().decode(gill.getTransactionEncoder().encode(a)),transactionMessageBytes:o?gill.getBase64Decoder().decode(o):void 0,authResponses:r}))})}));if(!c.ok)throw new Ce(`Transaction manager request failed: ${c.statusText}`,c.status,n);let i=await c.json();if("error"in i)throw new Ce(`Transaction manager error: ${i.error}`,c.status,n);return i.signatures.map(a=>({[e]:gill.getBase58Encoder().encode(a)}))}}}function DA(e){return e.keyType===Qt.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}function B6(e){let n=e.map(c=>Ke().encode(c)),r=4+n.reduce((c,i)=>c+i.length,0),o=new Uint8Array(r),t=0;o.set(gill.getU32Encoder().encode(e.length),t),t+=4;for(let c of n)o.set(c,t),t+=c.length;return o}function N6(e){let n=0,[r,o]=gill.getU32Decoder().read(e,n);n=o;let t=new Array(r);for(let c=0;c<r;c++){let i=je().read(e,n);t[c]=i[0],n=i[1];}if(n!==e.length)throw new z(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function e5({payer:e,rpId:n,origins:r,authority:o}){let t=await gt({rpId:n}),c=new N;await c.addSystemAccounts();let i=await he(),{address:a,addressTree:s}=await w(o.address,i),d=[{address:a,tree:s,queue:s,type:"User"}],u=await $([],d),g=(await De(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:f}=c.toAccountMetas(),S=k(u,f);return await ka({origins:r,authorityCreationArgs:g,authority:o,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function A5({authority:e,payer:n,createUserArgs:r,domainConfig:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[];r.settings&&(i.push({address:(await ue(r.settings,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&i.push({address:(await w(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let a=i.length?await le(i,t):[],s=await he(),{address:d,addressTree:u}=await w(r.member,s),g=[{address:d,type:"User",tree:u,queue:u}],p=await $(a,g),f=null,S=null,I=a.filter(B=>B.type==="Settings"),x=a.filter(B=>B.type==="User");I.length&&(f=ae(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),I,K())[0]),x.length&&(S=ae(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,te())[0]);let b=await De(c,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),g),{remainingAccounts:C,systemOffset:_}=c.toAccountMetas(),v=k(p,_);return await Na({payer:n,authority:e,compressedProofArgs:v,member:Nt().decode(r.member.toBuffer()),credentialId:xe(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:f?gill.some({settingsMutArgs:f,transactionManager:S?gill.some(S):gill.none()}):gill.none(),userAccountCreationArgs:b[0],domainConfig:o,remainingAccounts:C})}async function l5({payer:e}){let n=await SA();return Fa({payer:e,globalCounter:n})}async function S5({admin:e,rpId:n,disable:r}){let o=await gt({rpId:n});return oi({domainConfig:o,admin:e,disable:r,remainingAccounts:[]})}function Wh(e,n,r,o){let t=Lh(e,n),c=Oh(e,n)&&r!==o;return t&&c?gill.AccountRole.WRITABLE_SIGNER:t&&!c?gill.AccountRole.WRITABLE:!t&&c?gill.AccountRole.READONLY_SIGNER:gill.AccountRole.READONLY}function Lh(e,n){let r=e.staticAccounts.length,{numSignerAccounts:o,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=o-t,a=r-o-c;return n>=r?false:n<i?true:n>=o?n-o<a:false}function Oh(e,n){return n<e.header.numSignerAccounts}async function Kr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:o}){let t=Lu(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await gill.fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),Q()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:gill.AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,s]of t.staticAccounts.entries())i.push({address:s,role:Wh(t,a,s,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let s=c[a.lookupTableAddress];if(!s)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:gill.AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:gill.AccountRole.READONLY});}}for(let a of o?.filter(s=>s.address!==e)??[]){let s=i.findIndex(d=>d.address===a.address);s===-1?i.push({address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}):i[s].role===gill.AccountRole.READONLY||i[s].role===gill.AccountRole.READONLY_SIGNER?i[s]={address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}:(i[s].role===gill.AccountRole.WRITABLE||i[s].role===gill.AccountRole.WRITABLE_SIGNER)&&(i[s]={address:a.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}var lt=33,yt=64,ss=14,Gh=2,zh=gill.address("Secp256r1SigVerify1111111111111111111111111");function Kh(){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 jh(){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 _A(){return gill.createDecoder({read:(e,n=0)=>{let r=gill.getU8Decoder().decode(e,n);n+=1;let o=gill.getU8Decoder().decode(e,n);n+=1;let t=[],c=jh();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=ss;let i=[];for(let a=0;a<r;a++){let s=gill.fixDecoderSize(gill.getBytesDecoder(),lt).decode(e,n);n+=lt;let d=gill.fixDecoderSize(gill.getBytesDecoder(),yt).decode(e,n);n+=yt;let u=t[a].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:s,signature:d,message:g});}return [{numSignatures:r,padding:o,offsets:t,payload:i},n]}})}function vA(){return gill.createEncoder({getSizeFromValue:e=>{let n=ss*e.offsets.length,r=e.payload.reduce((o,t)=>o+lt+yt+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 o=Kh();for(let t of e.offsets)r=o.write(t,n,r);for(let t of e.payload)r=gill.fixEncoderSize(gill.getBytesEncoder(),lt).write(t.publicKey,n,r),r=gill.fixEncoderSize(gill.getBytesEncoder(),yt).write(t.signature,n,r),r=gill.getBytesEncoder().write(t.message,n,r);return r}})}function U5(){return gill.combineCodec(vA(),_A())}function V(e,n){let r=e.length,o=Gh+r*ss,t=[];for(let s=0;s<r;s++){let{message:d}=e[s],u=o,g=u+lt,p=g+yt;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),o+=lt+yt+d.length;}let c=n?.programAddress??zh,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:vA().encode(i)}}function k5(e){return {programAddress:e.programAddress,accounts:{},data:_A().decode(e.data)}}async function UA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:o,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:s=false}){let d=await ke(e),{accountMetas:u,addressLookupTableAccounts:g}=await Kr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(V(c)),p.push(s?uu({transactionBuffer:n,payer:o.address,remainingAccounts:u,settingsKey:e}):ou({transactionBuffer:n,payer:o.address,settings:e})),a&&p.push(oA({payer:o,tipAmount:a})),{instructions:p,addressLookupTableAccounts:g}}async function kA({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:o,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:i=[],compressed:a=false,simulateProof:s=false,cachedAccounts:d}){let u=Te(o),g=await ke(e),[{accountMetas:p,addressLookupTableAccounts:f,transactionMessage:S},{settingsMutArgs:I,proof:x,packedAccounts:b}]=await Promise.all([Kr({transactionMessageBytes:r,walletAddress:g,additionalSigners:u.filter(ee=>!(ee instanceof E)),addressesByLookupTableAddress:c}),Pe(a,e,n,s,d)]);b.addPreAccounts(p);let C=u.filter(ee=>ee instanceof E),{secp256r1VerifyArgs:_}=Jh(C,i,b),{remainingAccounts:v,systemOffset:B}=b.toAccountMetas();return {instructions:Yh({secp256r1VerifyInput:i,transactionMessage:S,accountMetas:p,compressed:a,payer:t,settingsMutArgs:I,proof:x,systemOffset:B,secp256r1VerifyArgs:_,settings:e,remainingAccounts:v}),addressLookupTableAccounts:f}}function Jh(e,n,r){let o=[];for(let t of e){let c=n.length,{domainConfig:i,verifyArgs:a,signature:s,publicKey:d,message:u}=J(t,c);u&&s&&d&&n.push({message:u,signature:s,publicKey:d}),i&&(r.addPreAccounts([{address:i,role:gill.AccountRole.READONLY}]),a.__option==="Some"&&o.push({domainConfigKey:i,verifyArgs:a.value}));}return {secp256r1VerifyArgs:o}}function Yh({secp256r1VerifyInput:e,transactionMessage:n,accountMetas:r,compressed:o,payer:t,settingsMutArgs:c,proof:i,systemOffset:a,secp256r1VerifyArgs:s,settings:d,remainingAccounts:u}){let g=[];e.length>0&&g.push(V(e));let p=Zh(n,r);if(o){if(!t||!c)throw new Error("Payer not found or proof args is missing.");let f=k(i,a);g.push(Cu({secp256r1VerifyArgs:s,transactionMessage:p,settingsMutArgs:c,compressedProofArgs:f,payer:t,remainingAccounts:u}));}else g.push(yu({secp256r1VerifyArgs:s,settings:d,transactionMessage:p,remainingAccounts:u}));return g}function Zh(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:r.data??[]})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(o=>o.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function nV({settings:e,settingsAddressTreeIndex:n,destination:r,signers:o,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let s=Te(o),d=await ke(e),[{packedAccounts:u,proof:g,settingsMutArgs:p},{value:f}]=await Promise.all([Pe(a,e,n,false,t),ot(d,t)]);if((f?.lamports??0)<BigInt(c))throw new Error("Insufficient balance");let S=[],I=[];for(let _ of s)if(_ instanceof E){let v=S.length,{domainConfig:B,verifyArgs:se,signature:ee,publicKey:ie,message:ye}=J(_,v);ye&&ee&&ie&&S.push({message:ye,signature:ee,publicKey:ie}),B&&(u.addPreAccounts([{address:B,role:gill.AccountRole.READONLY}]),se.__option==="Some"&&I.push({domainConfigKey:B,verifyArgs:se.value}));}else u.addPreAccounts([{address:_.address,role:gill.AccountRole.READONLY_SIGNER,signer:_}]);let{remainingAccounts:x,systemOffset:b}=u.toAccountMetas(),C=[];if(S.length>0&&C.push(V(S)),a){if(!i||!p)throw new Error("Payer not found or proof args is missing.");let _=k(g,b);C.push(Ui({amount:c,settingsMutArgs:p,compressedProofArgs:_,payer:i,secp256r1VerifyArgs:I,source:d,destination:r,remainingAccounts:x}));}else C.push(hi({amount:c,secp256r1VerifyArgs:I,source:d,destination:r,settings:e,remainingAccounts:x}));return C}var rM=gill.address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),nM=gill.address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),qr=gill.address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function yV({settings:e,settingsAddressTreeIndex:n,destination:r,mint:o,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:s,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false}){let g=Te(t),p=await ke(e),f=U=>gill.getProgramDerivedAddress({seeds:[gill.getAddressEncoder().encode(U),gill.getAddressEncoder().encode(qr),gill.getAddressEncoder().encode(o)],programAddress:qr}),S=()=>{let U=[gill.getUtf8Encoder().encode("pool"),gill.getAddressEncoder().encode(o)];return d.restricted&&U.push(gill.getUtf8Encoder().encode("restricted")),d.index>0&&U.push(gill.getU8Encoder().encode(d.index)),U},[I,[x],b,[C],[_]]=await Promise.all([programs.getAssociatedTokenAccountAddress(o,p,s),f(p),programs.getAssociatedTokenAccountAddress(o,r,s),f(r),gill.getProgramDerivedAddress({seeds:S(),programAddress:qr})]),[v,B,se,ee]=await Promise.all([ot(b,c),ot(I,c),ot(x,c),cM(u,e,n,c)]),ie=!!v.value,ye=!!B.value,Tt=!!se.value,Re=ye?programs.getTokenDecoder().decode(gill.getBase64Encoder().encode(B.value.data[0])).amount:BigInt(0),Ae=BigInt(Tt?aM(gill.getBase64Encoder().encode(se.value.data[0]))?.amount??0:0),it=ie?b:void 0,Xr=ie?void 0:C,y=ye&&(Re+Ae<BigInt(i)||Ae>BigInt(0)||!ie)||!ye&&ie,Qr=!ie,[pe,gs]=await Promise.all([sM(p,o,Re,Ae,BigInt(i),u?3:4),oM(y,_,c)]),Y=pe.reduce((U,ne)=>U+ne.parsed.amount.toNumber(),0);if(Re+Ae+BigInt(Y)<BigInt(i))throw new Error("Insufficient balance");let dt=null,We=null,Le=new N;if(gs&&Le.addPreAccounts([{address:o,role:gill.AccountRole.WRITABLE}]),ee||pe.length){await Le.addSystemAccounts();let U=[];if(pe.length&&U.push(...pe.map(ne=>({hash:ne.compressedAccount.hash,tree:ne.compressedAccount.treeInfo.tree,queue:ne.compressedAccount.treeInfo.queue,data:ne.compressedAccount.data,address:ne.compressedAccount.address}))),ee&&U.push(ee),We=await $(U,[]),ee){let ne=pe.length;dt=ae(Le,We.treeInfos.slice(ne),We.leafIndices.slice(ne),We.rootIndices.slice(ne),We.proveByIndices.slice(ne),U.slice(ne),K())[0];}}let QA=pe.length&&We?gill.some(pe.map((U,ne)=>({isFrozen:U.parsed.state===programs.AccountState.Frozen,hasDelegate:U.parsed.delegate!=null,amount:U.parsed.amount.toNumber(),merkleContext:{leafIndex:U.compressedAccount.leafIndex,merkleTreePubkeyIndex:Le.insertOrGet(U.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:Le.insertOrGet(U.compressedAccount.treeInfo.queue.toString()),proveByIndex:U.compressedAccount.proveByIndex},rootIndex:We.rootIndices[ne],version:pA(U.compressedAccount.data?.discriminator),tlv:U.parsed.tlv?gill.some(gill.getArrayDecoder(vt()).decode(U.parsed.tlv)):gill.none()}))):gill.none(),ir=[],ps=[];for(let U of g)if(U instanceof E){let ne=ir.length,{domainConfig:$r,verifyArgs:ls,signature:ys,publicKey:Ts,message:fs}=J(U,ne);fs&&ys&&Ts&&ir.push({message:fs,signature:ys,publicKey:Ts}),$r&&(Le.addPreAccounts([{address:$r,role:gill.AccountRole.READONLY}]),ls.__option==="Some"&&ps.push({domainConfigKey:$r,verifyArgs:ls.value}));}else Le.addPreAccounts([{address:U.address,role:gill.AccountRole.READONLY_SIGNER,signer:U}]);let{remainingAccounts:$A,systemOffset:eg}=Le.toAccountMetas(),dr=[];ir.length>0&&dr.push(V(ir));let tg=k(We,eg),rg=y?_:void 0,ng=Qr?nM:void 0,og=y?gill.some(d):gill.none(),ms={amount:i,secp256r1VerifyArgs:ps,source:p,destination:r,sourceCtokenTokenAccount:x,sourceSplTokenAccount:I,destinationCtokenTokenAccount:Xr,destinationSplTokenAccount:it,mint:o,tokenProgram:s,remainingAccounts:$A,payer:a,sourceCompressedTokenAccounts:QA,compressedProofArgs:tg,compressibleConfig:rM,splInterfacePda:rg,rentSponsor:ng,splInterfacePdaArgs:og};if(u){if(!dt)throw new Error("Payer not found or proof args is missing.");dr.push(ji({...ms,settingsMutArgs:dt}));}else dr.push(Ni({...ms,settings:e}));return dr}async function oM(e,n,r){if(!e)return false;let{value:o}=await ot(n,r);return !o}async function sM(e,n,r,o,t,c){let i=t-r-o;if(i<=0)return [];let s=(await Ve().getCompressedTokenAccountsByOwner(new web3_js.PublicKey(e),{mint:new web3_js.PublicKey(n)})).items.filter(g=>!!g.compressedAccount.data?.data.length&&g.compressedAccount.owner.toString()===qr.toString()&&!g.parsed.amount.isZero()).sort((g,p)=>p.parsed.amount.cmp(g.parsed.amount));if(s.length===0)return [];let d=BigInt(0),u=[];for(let g of s){if(u.length>=c||d>=i)break;d+=BigInt(g.parsed.amount.toNumber()),u.push(g);}if(d<i)throw u.length>=c?new Error("Transaction size limit exceeded. Consider multiple transfers to transfer full balance."):new Error("Insufficient balance.");return u}async function cM(e,n,r,o){if(!e)return null;let{address:t}=await ue(n,r);return (await le([{address:t,type:"Settings"}],o))[0]}function aM(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 MV({signers:e,payer:n,changeConfigArgs:r}){let{settings:o,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:s}=r,d=Te(e),u=d.filter(C=>!(C instanceof E));i.addPreAccounts(u.map(C=>({address:C.address,role:gill.AccountRole.READONLY_SIGNER,signer:C})));let g=d.filter(C=>C instanceof E),p=[],f=[];for(let C of g){let _=f.length,{domainConfig:v,verifyArgs:B,signature:se,publicKey:ee,message:ie}=J(C,_);ie&&se&&ee&&f.push({message:ie,signature:se,publicKey:ee}),v&&(i.addPreAccounts([{address:v,role:gill.AccountRole.READONLY}]),B.__option==="Some"&&p.push({domainConfigKey:v,verifyArgs:B.value}));}let{remainingAccounts:S,systemOffset:I}=i.toAccountMetas(),x=k(a,I),b=[];if(f.length>0&&b.push(V(f)),c){if(!s)throw new Error("Payer not found or proof args is missing.");b.push(fa({configActions:t,payer:n,compressedProofArgs:x,settingsMutArgs:s,remainingAccounts:S,secp256r1VerifyArgs:p}));}else b.push(ua({settings:o,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:S,secp256r1VerifyArgs:p}));return b}async function WV({createUserArgs:e,payer:n}){let r=new N;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:u.member})));let o=await he(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:p}=await w(u.member.address,o);return {address:g,tree:p,queue:p,type:"User"}})),c=await $([],t),i=await De(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:s}=r.toAccountMetas(),d=k(c,s);return await ja({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:i[g],transactionManagerUrl:u.role===0?u.transactionManagerUrl:null})),remainingAccounts:a})}async function HV({index:e,payer:n,initialMember:r,userAddressTreeIndex:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[],a=[];a.push(...await le([{address:(await w(r.address,o)).address,type:"User"}],t));let s=await he(),{address:d,addressTree:u}=await ue(await Me(e),s);i.push({address:d,queue:u,tree:u,type:"Settings"});let g=a.length,p=await $(a,i),f=ae(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),a.filter(_=>_.type==="User"),te())[0],I=(await De(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),i)).find(_=>_.type==="Settings")??null,{remainingAccounts:x,systemOffset:b}=c.toAccountMetas(),C=k(p,b);if(!I)throw new Error("Settings creation args is missing.");return await Ea({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:C,...I,remainingAccounts:x})}async function YV({settings:e,settingsAddressTreeIndex:n,payer:r,signers:o,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await Pe(true,e,n,false,t);if(!a)throw new Error("Proof args is missing");let s=Te(o),d=s.filter(x=>x instanceof E),u=[],g=[];for(let x of d){let b=u.length,{domainConfig:C,verifyArgs:_,signature:v,publicKey:B,message:se}=J(x,b);se&&v&&B&&u.push({message:se,signature:v,publicKey:B}),C&&(c.addPreAccounts([{address:C,role:gill.AccountRole.READONLY}]),_.__option==="Some"&&g.push({domainConfigKey:C,verifyArgs:_.value}));}c.addPreAccounts(s.filter(x=>"address"in x).map(x=>({address:x.address,role:gill.AccountRole.READONLY_SIGNER,signer:x})));let{remainingAccounts:p,systemOffset:f}=c.toAccountMetas(),S=k(i,f),I=[];return u.length>0&&I.push(V(u)),I.push(Qa({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:S,secp256r1VerifyArgs:g,remainingAccounts:p})),I}async function r8({authority:e,domainConfig:n,newAuthority:r,newOrigins:o}){let t=null,c=[];if(r){let i=new N;await i.addSystemAccounts();let a=await he(),{address:s,addressTree:d}=await w(r.address,a),u=[{address:s,tree:d,queue:d,type:"User"}],g=await $([],u),p=(await De(i,g.treeInfos,g.roots,g.rootIndices,u))[0],f=i.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:k(g,f.systemOffset),authorityCreationArgs:p};}return ui({domainConfig:n,authority:e,newOrigins:o?gill.some(o):gill.none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function i8({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let o=new N;await o.addSystemAccounts();let t=await le([{address:(await w(e.address,n)).address,type:"User"}]),c=await $(t,[]),i=ae(o,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,te())[0],{remainingAccounts:a,systemOffset:s}=o.toAccountMetas(),d=k(c,s);return yi({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function f8({payer:e,user:n,userAddressTreeIndex:r,newDelegate:o,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:s,publicKey:d}=J(n),u=[];a&&s&&d&&u.push({message:a,signature:s,publicKey:d});let g=await cr(n instanceof E?n:n.address,r,t),p=[];p.push({address:(await w(n instanceof E?n:n.address,r)).address,type:"User"});let f,S=null,I,x=null,b=g.wallets.find(Ae=>Ae.isDelegate);if(b){let Ae=await Me(b.index);(await zr(Ae,b.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ue(Ae,b.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):f=await Me(b.index);}if(o){let Ae=await Me(o.index);(await zr(Ae,o.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ue(Ae,o.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):I=await Me(o.index);}let C=new N;await C.addSystemAccounts();let _=await le(p,t),v=await $(_,[]),B=ae(C,v.treeInfos.slice(0,1),v.leafIndices.slice(0,1),v.rootIndices.slice(0,1),v.proveByIndices.slice(0,1),_.slice(0,1),te())[0],se=S?gill.some(ae(C,v.treeInfos.slice(S.start,S.end),v.leafIndices.slice(S.start,S.end),v.rootIndices.slice(S.start,S.end),v.proveByIndices.slice(S.start,S.end),_.slice(S.start,S.end),K())[0]):gill.none(),ee=x?gill.some(ae(C,v.treeInfos.slice(x.start,x.end),v.leafIndices.slice(x.start,x.end),v.rootIndices.slice(x.start,x.end),v.proveByIndices.slice(x.start,x.end),_.slice(x.start,x.end),K())[0]):gill.none(),{remainingAccounts:ie,systemOffset:ye}=C.toAccountMetas(),Tt=k(v,ye),Re=[];return u.length>0&&Re.push(V(u)),Re.push(Ci({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:o?gill.some(o):gill.none(),feePayer:e,signer:n instanceof E?void 0:n,oldSettings:f,oldSettingsMutArgs:se,newSettings:I,newSettingsMutArgs:ee,compressedProofArgs:Tt,userMutArgs:B,remainingAccounts:ie})),Re}async function W8({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:o,compressed:t=false,cachedAccounts:c}){let i=await Kc(Q(),r),a=i.data.multiWalletSettings,{packedAccounts:s,proof:d,settingsMutArgs:u}=await Pe(t,a,e,false,c),{remainingAccounts:g,systemOffset:p}=s.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:I,signature:x,publicKey:b}=J(n),C=[];if(I&&x&&b&&C.push(V([{message:I,signature:x,publicKey:b}])),t){if(!o||!u)throw new Error("Payer not found or proof args is missing.");let _=k(d,p);C.push(od({transactionBuffer:r,domainConfig:f,closer:n instanceof E?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:u,payer:o,compressedProofArgs:_,remainingAccounts:g}));}else C.push(Qi({transactionBuffer:r,domainConfig:f,closer:n instanceof E?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return C}function FA({payer:e,creator:n,bufferIndex:r,settings:o,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:p,message:f,signature:S,publicKey:I}=J(n),x=[];if(f&&S&&I&&x.push(V([{message:f,signature:S,publicKey:I}])),d){let{settingsReadonlyArgs:b,compressedProofArgs:C,remainingAccounts:_}=d;x.push(yd({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof E?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSecp256r1Signers:u},settingsReadonlyArgs:b,compressedProofArgs:C,remainingAccounts:_}));}else x.push(ud({settings:o,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof E?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSecp256r1Signers:u},remainingAccounts:[]}));return x}function GA({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:s}=J(e),d=[];return a&&i&&s&&d.push(V([{message:a,signature:i,publicKey:s}])),o?d.push(Rd({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof E?void 0:e,settingsMutArgs:o.settingsMutArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(Cd({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof E?void 0:e,remainingAccounts:[]})),d}function zA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:o=false}){return o?Vd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Wd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function KA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:s}=J(n),d=[];return s&&i&&a&&d.push(V([{message:s,signature:i,publicKey:a}])),o?d.push(Qd({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof E?void 0:n,settingsReadonlyArgs:o.settingsReadonlyArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(jd({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof E?void 0:n,remainingAccounts:[]})),d}async function EH({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:o,compressed:t=false}){let c=await AM(r),i=new N,a=null,s=null,d=[];if(c.length||t){let g=await gM({packedAccounts:i,userAccounts:c,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:o});a=g.proof,s=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await pM({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:s,packedAccounts:i,compressed:t}}async function AM(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}}return n}async function gM({packedAccounts:e,userAccounts:n,compressed:r,settings:o,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let f=(await ue(o,t)).address;i.push({address:f,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await le(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let s=await $(a,[]),d=[],u=[];for(let f of a)f.type==="Settings"?d.push(f):f.type==="User"&&u.push(f);let g,p=[];if(r&&s&&(g=ae(e,s.treeInfos.slice(0,1),s.leafIndices.slice(0,1),s.rootIndices.slice(0,1),s.proveByIndices.slice(0,1),d,K())[0]),u.length&&s){let f=r?1:0;p=ae(e,s.treeInfos.slice(f),s.leafIndices.slice(f),s.rootIndices.slice(f),s.proveByIndices.slice(f),u,te());}return {proof:s,settingsMutArgs:g,userMutArgs:p}}async function pM({configActionsArgs:e,userMutArgs:n}){let r=[];for(let o of e)switch(o.type){case "AddMembers":{let t=[];for(let c of o.members){let i=await w(c.member,c.userAddressTreeIndex).then(a=>n.find(s=>utils_js.equalBytes(s.accountMeta.address,gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(a.address)))));if(!i)throw new Error("Unable to find user account");t.push(yM({permissionArgs:c.permissions,userMutArgs:i,pubkey:c.member}));}r.push({__kind:o.type,fields:[t]});break}case "RemoveMembers":{let t=await Promise.all(o.members.map(c=>w(c.member,c.userAddressTreeIndex).then(i=>{let a=n.find(s=>utils_js.equalBytes(s.accountMeta.address,gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(i.address))));if(!a)throw new Error("Unable to find user account");return lM({pubkey:c.member,userMutArgs:a})})));r.push({__kind:o.type,fields:[t]});break}case "EditPermissions":{let t=o.members.map(c=>mM({permissionArgs:c.permissions,pubkey:c.member}));r.push({__kind:o.type,fields:[t]});break}default:r.push({__kind:o.type,fields:[o.threshold]});}return r}function mM({pubkey:e,permissionArgs:n}){return {memberKey:Ee(e),permissions:YA(n)}}function lM({pubkey:e,userMutArgs:n}){let r=n.data.role;if(r===2)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:Ee(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function yM({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===2)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===0&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:Ee(e),permissions:YA(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function YA(e){let n=[];return e.initiate&&n.push(Ue.InitiateTransaction),e.vote&&n.push(Ue.VoteTransaction),e.execute&&n.push(Ue.ExecuteTransaction),Be.fromPermissions(n)}async function vH({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:p=Math.ceil(o.length/2),cachedAccounts:f}){let S=Math.floor(Math.random()*255),I=await xA(n,t instanceof E?t:t.address,S),x=[],b=[];for(let Y=0;Y<o.length;Y+=p){let dt=o.subarray(Y,Y+p);x.push(dt),b.push(sha2_js.sha256(dt));}let C=sha2_js.sha256(o),{settingsReadonlyArgs:_,settingsMutArgs:v,proof:B,packedAccounts:se}=await Pe(d,n,r,false,f),{remainingAccounts:ee,systemOffset:ie}=se.toAccountMetas(),ye=B&&_&&v?{settingsReadonlyArgs:_,settingsMutArgs:v,compressedProofArgs:k(B,ie),remainingAccounts:ee,payer:e}:null,Tt=Te([t,...c?[c]:[],...u]).filter(Y=>Y instanceof E).map(Y=>({memberKey:Ee(Y),messageHash:Jo(Y.authResponse)})),Re=FA({finalBufferHash:C,finalBufferSize:o.length,bufferIndex:S,payer:e,transactionBufferAddress:I,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:b,compressedArgs:ye,expectedSecp256r1Signers:Tt}),Ae=x.map(Y=>zA({transactionMessageBytes:Y,transactionBufferAddress:I,settings:n,compressed:d})),it=u.map(Y=>KA({voter:Y,transactionBufferAddress:I,settings:n,compressedArgs:ye})),Xr=GA({compressedArgs:ye,settings:n,executor:c,transactionBufferAddress:I}),{instructions:y,addressLookupTableAccounts:Qr}=await UA({compressed:d,settings:n,transactionMessageBytes:o,transactionBufferAddress:I,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s}),pe=Y=>({payer:e,instructions:Y,addressesByLookupTableAddress:Qr});return [pe(Re),...Ae.map(Y=>pe([Y])),...it.length?[pe(it.flat())]:[],pe(Xr),pe(y)]}var Yr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let o=new Map,t=i=>{let a=o.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},o.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let s=t(a.address);s.isSigner||=a.role===gill.AccountRole.READONLY_SIGNER||a.role===gill.AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===gill.AccountRole.WRITABLE||a.role===gill.AccountRole.WRITABLE_SIGNER;}}return new e(r,o)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),o=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),c=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+o.length,numReadonlySignerAccounts:o.length,numReadonlyNonSignerAccounts:c.length};if(r.length===0)throw new Error("Expected at least one writable signer key");let[a]=r[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let s=[...r.map(([d])=>d),...o.map(([d])=>d),...t.map(([d])=>d),...c.map(([d])=>d)];return [i,s]}extractTableLookup(n){let[r,o]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(n,r){let o=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,s=n.findIndex(d=>d===a);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),t.push(a),this.keyMetaMap.delete(c);}}return [o,t]}};var Zr=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 o=new Map;this.keySegments().flat().forEach((c,i)=>{o.set(c,i);});let t=c=>{let i=o.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function XA({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:o}){let t=Yr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(o??{});for(let p of a){let f=t.extractTableLookup(p);if(f!==void 0){let{addressTableLookup:S,drainedKeys:I}=f;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:gill.address(S.lookupTableAddress)}),i.writable.push(...I.writable),i.readonly.push(...I.readonly);}}let[s,d]=t.getMessageComponents(),g=new Zr(d,i).compileInstructions(r);return {version:0,header:s,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function zH({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=XA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(Wu(o))}async function YH({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i,cachedAccounts:a,compressed:s=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await kA({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:o,secp256r1VerifyInput:c,compressed:s,addressesByLookupTableAddress:i,simulateProof:d,cachedAccounts:a});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=ea;exports.AuthenticationContextSchema=_u;exports.BaseResponseSchema=vu;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=la;exports.CHANGE_CONFIG_DISCRIMINATOR=aa;exports.CREATE_COMPRESSED_WALLET_DISCRIMINATOR=Ia;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=va;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=Oa;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=Va;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=za;exports.CompleteMessageRequestSchema=ZN;exports.CompleteSendTransactionRequestSchema=QN;exports.CompleteTransactionRequestSchema=XN;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=Ya;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=ti;exports.DOMAIN_CONFIG_DISCRIMINATOR=Ss;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=ii;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=pi;exports.EDIT_USER_DELEGATE_DISCRIMINATOR=Si;exports.GLOBAL_COUNTER_DISCRIMINATOR=Ps;exports.KeyType=Qt;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=GE;exports.MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH=SE;exports.MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED=LD;exports.MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING=dD;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=AD;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=gD;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH=kD;exports.MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE=zD;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=CE;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=IE;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=kE;exports.MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS=fD;exports.MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH=_E;exports.MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH=xE;exports.MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH=RE;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=QE;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=$E;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=eD;exports.MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED=TD;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=jE;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=zE;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=KE;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=NE;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX=UD;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=lD;exports.MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG=vE;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=VE;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=XE;exports.MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT=SD;exports.MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS=qE;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=BE;exports.MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG=PE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION=pE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY=yE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=gE;exports.MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS=lE;exports.MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER=iD;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=cD;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=LE;exports.MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE=bD;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG=bE;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION=ME;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=OE;exports.MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG=ND;exports.MULTI_WALLET_ERROR__INVALID_USER_ROLE=wE;exports.MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG=BD;exports.MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR=RD;exports.MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE=TE;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=oD;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=pD;exports.MULTI_WALLET_ERROR__MEMBER_NOT_FOUND=CD;exports.MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS=vD;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=HE;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS=xD;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT=PD;exports.MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT=wD;exports.MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR=MD;exports.MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS=ID;exports.MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS=FE;exports.MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY=FD;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE=HD;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA=yD;exports.MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT=VD;exports.MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA=hD;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=sD;exports.MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS=WD;exports.MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES=GD;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=YE;exports.MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED=UE;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=DE;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=hE;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=mD;exports.MULTI_WALLET_ERROR__PAYER_MISMATCH=DD;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=EE;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=nD;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=fE;exports.MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH=ED;exports.MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS=mE;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=aD;exports.MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH=_D;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=WE;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=tD;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=rD;exports.MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING=uD;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=ZE;exports.MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY=OD;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=JE;exports.MULTI_WALLET_PROGRAM_ADDRESS=A;exports.MultiWalletAccount=dE;exports.MultiWalletInstruction=uE;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=bi;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=Di;exports.Permission=Ue;exports.Permissions=Be;exports.SETTINGS_DISCRIMINATOR=Oc;exports.Secp256r1Key=Ne;exports.SignedSecp256r1Key=E;exports.StartMessageRequestSchema=Ru;exports.StartTransactionRequestSchema=bu;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=zi;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=Oi;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=td;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=Yi;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=pd;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=ad;exports.TRANSACTION_BUFFER_DISCRIMINATOR=Fc;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=Pd;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=Sd;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=Bd;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=vd;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=Yd;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=Gd;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=au;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=tu;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=Su;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=pu;exports.TransactionActionTypeSchema=Mu;exports.TransactionDetailsSchema=jD;exports.TransactionPayloadSchema=YN;exports.TransactionPayloadWithBase64MessageBytesSchema=KD;exports.Transports=yo;exports.UserRole=Oe;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=Jc;exports.addWhitelistedAddressTrees=HN;exports.base64URLStringToBuffer=xe;exports.bufferToBase64URLString=Gw;exports.changeConfig=MV;exports.closeTransactionBuffer=W8;exports.configAction=DR;exports.convertBase64StringToJWK=jw;exports.convertJWKToBase64String=Kw;exports.convertMemberKeyToString=DA;exports.convertPubkeyCompressedToCose=Bw;exports.convertPubkeyCoseToCompressed=Ow;exports.createClientAuthorizationCompleteRequestChallenge=Vw;exports.createClientAuthorizationStartRequestChallenge=ww;exports.createDomainConfig=e5;exports.createDomainUserAccounts=A5;exports.createGlobalCounter=l5;exports.createMessageChallenge=Hw;exports.createTransactionBuffer=FA;exports.createTransactionChallenge=Fw;exports.createTransactionManagerSigner=Uh;exports.createUserAccounts=WV;exports.createWallet=HV;exports.decodeDomainConfig=Is;exports.decodeGlobalCounter=Ms;exports.decodeSettings=Bc;exports.decodeTransactionBuffer=zc;exports.decodeWhitelistedAddressTree=Zc;exports.decompressSettingsAccount=YV;exports.deserializeConfigActions=N6;exports.disableDomainConfig=S5;exports.editDomainConfig=r8;exports.editTransactionManagerUrl=i8;exports.editUserDelegate=f8;exports.executeTransaction=UA;exports.executeTransactionBuffer=GA;exports.executeTransactionSync=kA;exports.extendTransactionBuffer=zA;exports.extensionStruct=FR;exports.fetchAllDomainConfig=IM;exports.fetchAllGlobalCounter=RM;exports.fetchAllMaybeDomainConfig=fg;exports.fetchAllMaybeGlobalCounter=Wg;exports.fetchAllMaybeSettings=y1;exports.fetchAllMaybeTransactionBuffer=O1;exports.fetchAllMaybeWhitelistedAddressTree=rf;exports.fetchAllSettings=cU;exports.fetchAllSettingsAccountByMember=F2;exports.fetchAllTransactionBuffer=gU;exports.fetchAllWhitelistedAddressTree=TU;exports.fetchDomainConfig=Cs;exports.fetchGlobalCounter=MM;exports.fetchMaybeDomainConfig=Tg;exports.fetchMaybeGlobalCounter=kg;exports.fetchMaybeSettings=To;exports.fetchMaybeSettingsAccountData=ih;exports.fetchMaybeTransactionBuffer=L1;exports.fetchMaybeUserAccountData=ah;exports.fetchMaybeWhitelistedAddressTree=tf;exports.fetchSettings=sU;exports.fetchSettingsAccountData=zr;exports.fetchTransactionBuffer=Kc;exports.fetchUserAccountByFilters=H2;exports.fetchUserAccountData=cr;exports.fetchWhitelistedAddressTree=Xc;exports.getAddMemberArgsCodec=OM;exports.getAddMemberArgsDecoder=nn;exports.getAddMemberArgsEncoder=rn;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=WU;exports.getAddWhitelistedAddressTreesInstruction=OU;exports.getAddWhitelistedAddressTreesInstructionAsync=ra;exports.getAddWhitelistedAddressTreesInstructionDataCodec=LU;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=ta;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=Po;exports.getAdditionalMetadataCodec=UM;exports.getAdditionalMetadataDecoder=tn;exports.getAdditionalMetadataEncoder=en;exports.getChangeConfigCompressedDiscriminatorBytes=$U;exports.getChangeConfigCompressedInstruction=fa;exports.getChangeConfigCompressedInstructionDataCodec=ek;exports.getChangeConfigCompressedInstructionDataDecoder=Ta;exports.getChangeConfigCompressedInstructionDataEncoder=ya;exports.getChangeConfigDiscriminatorBytes=zU;exports.getChangeConfigInstruction=ua;exports.getChangeConfigInstructionDataCodec=KU;exports.getChangeConfigInstructionDataDecoder=da;exports.getChangeConfigInstructionDataEncoder=ia;exports.getClientAndDeviceHash=qo;exports.getCompiledInstructionCodec=wM;exports.getCompiledInstructionDecoder=sn;exports.getCompiledInstructionEncoder=on;exports.getCompressedAccountMetaCodec=GM;exports.getCompressedAccountMetaDecoder=It;exports.getCompressedAccountMetaEncoder=xt;exports.getCompressedAccountMetaReadOnlyCodec=qM;exports.getCompressedAccountMetaReadOnlyDecoder=Pt;exports.getCompressedAccountMetaReadOnlyEncoder=Dt;exports.getCompressedOnlyExtensionCodec=ZM;exports.getCompressedOnlyExtensionDecoder=an;exports.getCompressedOnlyExtensionEncoder=cn;exports.getCompressedProofCodec=$M;exports.getCompressedProofDecoder=mn;exports.getCompressedProofEncoder=pn;exports.getCompressedSettingsAddress=ue;exports.getCompressedSettingsCodec=nR;exports.getCompressedSettingsDataCodec=aR;exports.getCompressedSettingsDataDecoder=yn;exports.getCompressedSettingsDataEncoder=ln;exports.getCompressedSettingsDecoder=K;exports.getCompressedSettingsEncoder=ht;exports.getCompressedTokenArgsCodec=AR;exports.getCompressedTokenArgsDecoder=_t;exports.getCompressedTokenArgsEncoder=bt;exports.getCompressibleExtensionCodec=lR;exports.getCompressibleExtensionDecoder=En;exports.getCompressibleExtensionEncoder=Cn;exports.getCompressionInfoCodec=SR;exports.getCompressionInfoDecoder=Pn;exports.getCompressionInfoEncoder=Dn;exports.getConfigActionCodec=ER;exports.getConfigActionDecoder=je;exports.getConfigActionEncoder=Ke;exports.getCreateCompressedWalletDiscriminatorBytes=ik;exports.getCreateCompressedWalletInstruction=uk;exports.getCreateCompressedWalletInstructionAsync=Ea;exports.getCreateCompressedWalletInstructionDataCodec=dk;exports.getCreateCompressedWalletInstructionDataDecoder=Ca;exports.getCreateCompressedWalletInstructionDataEncoder=ho;exports.getCreateDomainConfigDiscriminatorBytes=fk;exports.getCreateDomainConfigInstruction=xk;exports.getCreateDomainConfigInstructionAsync=ka;exports.getCreateDomainConfigInstructionDataCodec=Sk;exports.getCreateDomainConfigInstructionDataDecoder=Ua;exports.getCreateDomainConfigInstructionDataEncoder=Ro;exports.getCreateDomainUserAccountDiscriminatorBytes=Rk;exports.getCreateDomainUserAccountInstruction=_k;exports.getCreateDomainUserAccountInstructionAsync=Na;exports.getCreateDomainUserAccountInstructionDataCodec=bk;exports.getCreateDomainUserAccountInstructionDataDecoder=Ba;exports.getCreateDomainUserAccountInstructionDataEncoder=bo;exports.getCreateGlobalCounterDiscriminatorBytes=Bk;exports.getCreateGlobalCounterInstruction=wk;exports.getCreateGlobalCounterInstructionAsync=Fa;exports.getCreateGlobalCounterInstructionDataCodec=Nk;exports.getCreateGlobalCounterInstructionDataDecoder=Ha;exports.getCreateGlobalCounterInstructionDataEncoder=vo;exports.getCreateUserAccountArgsCodec=bR;exports.getCreateUserAccountArgsDecoder=Bn;exports.getCreateUserAccountArgsEncoder=On;exports.getCreateUserAccountsDiscriminatorBytes=qk;exports.getCreateUserAccountsInstruction=Yk;exports.getCreateUserAccountsInstructionAsync=ja;exports.getCreateUserAccountsInstructionDataCodec=Jk;exports.getCreateUserAccountsInstructionDataDecoder=Ka;exports.getCreateUserAccountsInstructionDataEncoder=ko;exports.getDecompressSettingsAccountDiscriminatorBytes=nW;exports.getDecompressSettingsAccountInstruction=Qa;exports.getDecompressSettingsAccountInstructionDataCodec=oW;exports.getDecompressSettingsAccountInstructionDataDecoder=Xa;exports.getDecompressSettingsAccountInstructionDataEncoder=Za;exports.getDisableDomainConfigDiscriminatorBytes=AW;exports.getDisableDomainConfigInstruction=oi;exports.getDisableDomainConfigInstructionDataCodec=gW;exports.getDisableDomainConfigInstructionDataDecoder=ni;exports.getDisableDomainConfigInstructionDataEncoder=ri;exports.getDomainConfigAddress=gt;exports.getDomainConfigCodec=xM;exports.getDomainConfigDecoder=xs;exports.getDomainConfigDiscriminatorBytes=SM;exports.getDomainConfigEncoder=yg;exports.getDomainConfigSize=CM;exports.getEditDomainConfigDiscriminatorBytes=xW;exports.getEditDomainConfigInstruction=ui;exports.getEditDomainConfigInstructionAsync=CW;exports.getEditDomainConfigInstructionDataCodec=IW;exports.getEditDomainConfigInstructionDataDecoder=di;exports.getEditDomainConfigInstructionDataEncoder=Lo;exports.getEditMemberArgsCodec=kR;exports.getEditMemberArgsDecoder=kn;exports.getEditMemberArgsEncoder=Un;exports.getEditTransactionManagerUrlDiscriminatorBytes=_W;exports.getEditTransactionManagerUrlInstruction=yi;exports.getEditTransactionManagerUrlInstructionDataCodec=vW;exports.getEditTransactionManagerUrlInstructionDataDecoder=li;exports.getEditTransactionManagerUrlInstructionDataEncoder=mi;exports.getEditUserDelegateDiscriminatorBytes=wW;exports.getEditUserDelegateInstruction=Ci;exports.getEditUserDelegateInstructionDataCodec=VW;exports.getEditUserDelegateInstructionDataDecoder=Ii;exports.getEditUserDelegateInstructionDataEncoder=xi;exports.getExpectedSecp256r1SignersCodec=BR;exports.getExpectedSecp256r1SignersDecoder=kt;exports.getExpectedSecp256r1SignersEncoder=Ut;exports.getExtensionStructCodec=HR;exports.getExtensionStructDecoder=vt;exports.getExtensionStructEncoder=Tn;exports.getGlobalCounterAddress=SA;exports.getGlobalCounterCodec=hM;exports.getGlobalCounterDecoder=hs;exports.getGlobalCounterDiscriminatorBytes=PM;exports.getGlobalCounterEncoder=Ug;exports.getGlobalCounterSize=bM;exports.getJitoTipsConfig=jo;exports.getLightCpiSigner=r6;exports.getLightProtocolRpc=Ve;exports.getLinkWalletArgsCodec=qR;exports.getLinkWalletArgsDecoder=Yn;exports.getLinkWalletArgsEncoder=Jn;exports.getMemberCodec=XR;exports.getMemberDecoder=Rt;exports.getMemberEncoder=Mt;exports.getMemberKeyCodec=eb;exports.getMemberKeyDecoder=oe;exports.getMemberKeyEncoder=H;exports.getMultiWalletErrorMessage=bN;exports.getNativeTransferIntentCompressedDiscriminatorBytes=oL;exports.getNativeTransferIntentCompressedInstruction=Ui;exports.getNativeTransferIntentCompressedInstructionDataCodec=sL;exports.getNativeTransferIntentCompressedInstructionDataDecoder=vi;exports.getNativeTransferIntentCompressedInstructionDataEncoder=_i;exports.getNativeTransferIntentDiscriminatorBytes=JW;exports.getNativeTransferIntentInstruction=hi;exports.getNativeTransferIntentInstructionAsync=ZW;exports.getNativeTransferIntentInstructionDataCodec=YW;exports.getNativeTransferIntentInstructionDataDecoder=Pi;exports.getNativeTransferIntentInstructionDataEncoder=Oo;exports.getNewAuthorityArgsCodec=ob;exports.getNewAuthorityArgsDecoder=$n;exports.getNewAuthorityArgsEncoder=Qn;exports.getOriginIndex=zw;exports.getPackedAddressTreeInfoCodec=ab;exports.getPackedAddressTreeInfoDecoder=Bt;exports.getPackedAddressTreeInfoEncoder=Ot;exports.getPackedMerkleContextCodec=ub;exports.getPackedMerkleContextDecoder=Sn;exports.getPackedMerkleContextEncoder=fn;exports.getPackedStateTreeInfoCodec=pb;exports.getPackedStateTreeInfoDecoder=Et;exports.getPackedStateTreeInfoEncoder=Ct;exports.getPausableAccountExtensionCodec=yb;exports.getPausableAccountExtensionDecoder=wn;exports.getPausableAccountExtensionEncoder=Nn;exports.getPermanentDelegateAccountExtensionCodec=Sb;exports.getPermanentDelegateAccountExtensionDecoder=Hn;exports.getPermanentDelegateAccountExtensionEncoder=Vn;exports.getPermissionsCodec=Cb;exports.getPermissionsDecoder=Fe;exports.getPermissionsEncoder=He;exports.getProofArgsCodec=hb;exports.getProofArgsDecoder=P;exports.getProofArgsEncoder=D;exports.getRemoveMemberArgsCodec=_b;exports.getRemoveMemberArgsDecoder=Ln;exports.getRemoveMemberArgsEncoder=Wn;exports.getRentConfigCodec=kb;exports.getRentConfigDecoder=bn;exports.getRentConfigEncoder=Rn;exports.getSecp256r1MessageHash=Jo;exports.getSecp256r1PubkeyCodec=Ob;exports.getSecp256r1PubkeyDecoder=Nt;exports.getSecp256r1PubkeyEncoder=ro;exports.getSecp256r1SignatureOffsetsDataDecoder=jh;exports.getSecp256r1SignatureOffsetsDataEncoder=Kh;exports.getSecp256r1VerifyArgsCodec=wb;exports.getSecp256r1VerifyArgsDecoder=G;exports.getSecp256r1VerifyArgsEncoder=F;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=Gb;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=X;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=Z;exports.getSecp256r1VerifyInstruction=V;exports.getSecp256r1VerifyInstructionDataCodec=U5;exports.getSecp256r1VerifyInstructionDataDecoder=_A;exports.getSecp256r1VerifyInstructionDataEncoder=vA;exports.getSendAndConfirmTransaction=Bu;exports.getSettingsCodec=oU;exports.getSettingsDecoder=hr;exports.getSettingsDiscriminatorBytes=nU;exports.getSettingsEncoder=l1;exports.getSettingsFromIndex=Me;exports.getSettingsIndexWithAddressAndDelegateInfoCodec=Yb;exports.getSettingsIndexWithAddressAndDelegateInfoDecoder=co;exports.getSettingsIndexWithAddressAndDelegateInfoEncoder=so;exports.getSettingsIndexWithAddressCodec=jb;exports.getSettingsIndexWithAddressDecoder=oo;exports.getSettingsIndexWithAddressEncoder=no;exports.getSettingsMutArgsCodec=$b;exports.getSettingsMutArgsDecoder=q;exports.getSettingsMutArgsEncoder=j;exports.getSettingsReadonlyArgsCodec=n_;exports.getSettingsReadonlyArgsDecoder=Vt;exports.getSettingsReadonlyArgsEncoder=wt;exports.getSignedSecp256r1Key=Nw;exports.getSignedTransactionManager=O6;exports.getSolanaRpc=Q;exports.getSolanaRpcEndpoint=Ou;exports.getSplInterfacePdaArgsCodec=c_;exports.getSplInterfacePdaArgsDecoder=Ft;exports.getSplInterfacePdaArgsEncoder=Ht;exports.getTokenMetadataCodec=u_;exports.getTokenMetadataDecoder=Gn;exports.getTokenMetadataEncoder=Fn;exports.getTokenTransferIntentCompressedDiscriminatorBytes=EL;exports.getTokenTransferIntentCompressedInstruction=ji;exports.getTokenTransferIntentCompressedInstructionAsync=PL;exports.getTokenTransferIntentCompressedInstructionDataCodec=DL;exports.getTokenTransferIntentCompressedInstructionDataDecoder=Ki;exports.getTokenTransferIntentCompressedInstructionDataEncoder=Vo;exports.getTokenTransferIntentDiscriminatorBytes=pL;exports.getTokenTransferIntentInstruction=Ni;exports.getTokenTransferIntentInstructionAsync=lL;exports.getTokenTransferIntentInstructionDataCodec=mL;exports.getTokenTransferIntentInstructionDataDecoder=Bi;exports.getTokenTransferIntentInstructionDataEncoder=wo;exports.getTransactionBufferAddress=xA;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=FL;exports.getTransactionBufferCloseCompressedInstruction=od;exports.getTransactionBufferCloseCompressedInstructionDataCodec=GL;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=nd;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=rd;exports.getTransactionBufferCloseDiscriminatorBytes=kL;exports.getTransactionBufferCloseInstruction=Qi;exports.getTransactionBufferCloseInstructionDataCodec=WL;exports.getTransactionBufferCloseInstructionDataDecoder=Xi;exports.getTransactionBufferCloseInstructionDataEncoder=Zi;exports.getTransactionBufferCodec=AU;exports.getTransactionBufferCreateArgsCodec=m_;exports.getTransactionBufferCreateArgsDecoder=zt;exports.getTransactionBufferCreateArgsEncoder=Gt;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=cO;exports.getTransactionBufferCreateCompressedInstruction=yd;exports.getTransactionBufferCreateCompressedInstructionDataCodec=aO;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=ld;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=md;exports.getTransactionBufferCreateDiscriminatorBytes=XL;exports.getTransactionBufferCreateInstruction=ud;exports.getTransactionBufferCreateInstructionDataCodec=QL;exports.getTransactionBufferCreateInstructionDataDecoder=dd;exports.getTransactionBufferCreateInstructionDataEncoder=id;exports.getTransactionBufferDecoder=Gc;exports.getTransactionBufferDiscriminatorBytes=uU;exports.getTransactionBufferEncoder=W1;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=DO;exports.getTransactionBufferExecuteCompressedInstruction=Rd;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=PO;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=Md;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=hd;exports.getTransactionBufferExecuteDiscriminatorBytes=lO;exports.getTransactionBufferExecuteInstruction=Cd;exports.getTransactionBufferExecuteInstructionDataCodec=yO;exports.getTransactionBufferExecuteInstructionDataDecoder=Id;exports.getTransactionBufferExecuteInstructionDataEncoder=xd;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=VO;exports.getTransactionBufferExtendCompressedInstruction=Vd;exports.getTransactionBufferExtendCompressedInstructionDataCodec=HO;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=wd;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=Nd;exports.getTransactionBufferExtendDiscriminatorBytes=UO;exports.getTransactionBufferExtendInstruction=Wd;exports.getTransactionBufferExtendInstructionDataCodec=kO;exports.getTransactionBufferExtendInstructionDataDecoder=kd;exports.getTransactionBufferExtendInstructionDataEncoder=Ud;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=oB;exports.getTransactionBufferVoteCompressedInstruction=Qd;exports.getTransactionBufferVoteCompressedInstructionDataCodec=sB;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=Xd;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=Zd;exports.getTransactionBufferVoteDiscriminatorBytes=YO;exports.getTransactionBufferVoteInstruction=jd;exports.getTransactionBufferVoteInstructionDataCodec=ZO;exports.getTransactionBufferVoteInstructionDataDecoder=Kd;exports.getTransactionBufferVoteInstructionDataEncoder=zd;exports.getTransactionExecuteCompressedDiscriminatorBytes=xB;exports.getTransactionExecuteCompressedInstruction=uu;exports.getTransactionExecuteCompressedInstructionDataCodec=IB;exports.getTransactionExecuteCompressedInstructionDataDecoder=du;exports.getTransactionExecuteCompressedInstructionDataEncoder=iu;exports.getTransactionExecuteDiscriminatorBytes=gB;exports.getTransactionExecuteInstruction=ou;exports.getTransactionExecuteInstructionDataCodec=pB;exports.getTransactionExecuteInstructionDataDecoder=nu;exports.getTransactionExecuteInstructionDataEncoder=ru;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=NB;exports.getTransactionExecuteSyncCompressedInstruction=Cu;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=wB;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=Iu;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=xu;exports.getTransactionExecuteSyncDiscriminatorBytes=bB;exports.getTransactionExecuteSyncInstruction=yu;exports.getTransactionExecuteSyncInstructionDataCodec=_B;exports.getTransactionExecuteSyncInstructionDataDecoder=lu;exports.getTransactionExecuteSyncInstructionDataEncoder=mu;exports.getTransactionMessageAddressTableLookupCodec=I_;exports.getTransactionMessageAddressTableLookupDecoder=lo;exports.getTransactionMessageAddressTableLookupEncoder=mo;exports.getTransactionMessageCodec=f_;exports.getTransactionMessageDecoder=jt;exports.getTransactionMessageEncoder=Kt;exports.getTransferFeeAccountExtensionCodec=D_;exports.getTransferFeeAccountExtensionDecoder=Kn;exports.getTransferFeeAccountExtensionEncoder=zn;exports.getTransferHookAccountExtensionCodec=M_;exports.getTransferHookAccountExtensionDecoder=qn;exports.getTransferHookAccountExtensionEncoder=jn;exports.getTransportsCodec=__;exports.getTransportsDecoder=Jt;exports.getTransportsEncoder=qt;exports.getUserAccountAddress=w;exports.getUserCodec=W_;exports.getUserCreationArgsCodec=N_;exports.getUserCreationArgsDecoder=_e;exports.getUserCreationArgsEncoder=be;exports.getUserDecoder=te;exports.getUserEncoder=Yt;exports.getUserMutArgsCodec=F_;exports.getUserMutArgsDecoder=et;exports.getUserMutArgsEncoder=$e;exports.getUserReadOnlyArgsCodec=j_;exports.getUserReadOnlyArgsDecoder=Lt;exports.getUserReadOnlyArgsEncoder=Wt;exports.getUserReadOnlyOrMutateArgsCodec=Z_;exports.getUserReadOnlyOrMutateArgsDecoder=ze;exports.getUserReadOnlyOrMutateArgsEncoder=Ge;exports.getUserRoleCodec=tv;exports.getUserRoleDecoder=Je;exports.getUserRoleEncoder=qe;exports.getWalletAddressFromIndex=t6;exports.getWalletAddressFromSettings=ke;exports.getWhitelistedAddressTreeCodec=yU;exports.getWhitelistedAddressTreeDecoder=Yc;exports.getWhitelistedAddressTreeDiscriminatorBytes=lU;exports.getWhitelistedAddressTreeEncoder=ef;exports.getWhitelistedAddressTreeFromIndex=ts;exports.getWhitelistedAddressTreeIndexFromAddress=G2;exports.getWhitelistedAddressTreesAddress=mA;exports.identifyMultiWalletAccount=CN;exports.identifyMultiWalletInstruction=EN;exports.initialize=Iw;exports.isConfigAction=PR;exports.isExtensionStruct=GR;exports.isMultiWalletError=_N;exports.isUserReadOnlyOrMutateArgs=Q_;exports.nativeTransferIntent=nV;exports.parseAddWhitelistedAddressTreesInstruction=BU;exports.parseChangeConfigCompressedInstruction=tk;exports.parseChangeConfigInstruction=jU;exports.parseCreateCompressedWalletInstruction=Ak;exports.parseCreateDomainConfigInstruction=Ik;exports.parseCreateDomainUserAccountInstruction=vk;exports.parseCreateGlobalCounterInstruction=Vk;exports.parseCreateUserAccountsInstruction=Zk;exports.parseDecompressSettingsAccountInstruction=sW;exports.parseDisableDomainConfigInstruction=pW;exports.parseEditDomainConfigInstruction=EW;exports.parseEditTransactionManagerUrlInstruction=UW;exports.parseEditUserDelegateInstruction=HW;exports.parseNativeTransferIntentCompressedInstruction=cL;exports.parseNativeTransferIntentInstruction=XW;exports.parseSecp256r1VerifyInstruction=k5;exports.parseTokenTransferIntentCompressedInstruction=hL;exports.parseTokenTransferIntentInstruction=yL;exports.parseTransactionBufferCloseCompressedInstruction=zL;exports.parseTransactionBufferCloseInstruction=LL;exports.parseTransactionBufferCreateCompressedInstruction=iO;exports.parseTransactionBufferCreateInstruction=$L;exports.parseTransactionBufferExecuteCompressedInstruction=hO;exports.parseTransactionBufferExecuteInstruction=TO;exports.parseTransactionBufferExtendCompressedInstruction=FO;exports.parseTransactionBufferExtendInstruction=WO;exports.parseTransactionBufferVoteCompressedInstruction=cB;exports.parseTransactionBufferVoteInstruction=XO;exports.parseTransactionExecuteCompressedInstruction=CB;exports.parseTransactionExecuteInstruction=mB;exports.parseTransactionExecuteSyncCompressedInstruction=VB;exports.parseTransactionExecuteSyncInstruction=vB;exports.pollJitoBundleConfirmation=p6;exports.prepareChangeConfigArgs=EH;exports.prepareTransactionBundle=vH;exports.prepareTransactionMessage=zH;exports.prepareTransactionSync=YH;exports.retrieveTransactionManager=L6;exports.sendJitoBundle=lh;exports.serializeConfigActions=B6;exports.signAndSendBundledTransactions=g6;exports.signAndSendTransaction=x6;exports.tokenTransferIntent=yV;exports.userReadOnlyOrMutateArgs=X_;exports.vaultTransactionMessageDeserialize=Lu;exports.vaultTransactionMessageSerialize=Wu;exports.voteTransactionBuffer=KA;//# sourceMappingURL=index.cjs.map
|
|
4
4
|
//# sourceMappingURL=index.cjs.map
|