@revibase/core 0.0.43 → 0.0.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,3 +1,3 @@
1
- 'use strict';var gill=require('gill'),stateless_js=require('@lightprotocol/stateless.js'),sha2_js=require('@noble/hashes/sha2.js'),web3_js=require('@solana/web3.js'),f=require('zod'),programs=require('gill/programs'),nist_js=require('@noble/curves/nist.js'),tinyCbor=require('@levischuck/tiny-cbor'),utils_js=require('@noble/curves/utils.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var f__default=/*#__PURE__*/_interopDefault(f);var Qr=1644,Ar=2e5,fo=1.1,So=30,xo=3e3,ke=3,Le=500,gr=2,pr=3e4,$r=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Io="https://mainnet.block-engine.jito.wtf/api/v1",Co="https://bundles.jito.wtf/api/v1/bundles/tip_floor",Eo="landed_tips_75th_percentile",Do=255,Po=400,Mo=429,en=500;var Ee=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);}},Oe=class extends Ee{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},ne=class extends Ee{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},z=class extends Ee{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},De=class extends Ee{constructor(r,s,t){super(r,"NETWORK_ERROR",{statusCode:s,url:t});this.statusCode=s;this.url=t;}},ho=class extends Ee{constructor(r,s,t){super(r,"TRANSACTION_ERROR",{signature:s,logs:t});this.signature=s;this.logs=t;}},ye=class extends Ee{constructor(r,s,t){super(r,"BUNDLE_ERROR",{bundleId:s,attempt:t});this.bundleId=s;this.attempt=t;}},mr=class extends Ee{constructor(r,s,t){super(`Operation "${r}" failed after ${s} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=s;this.lastError=t;}},yr=class extends Ee{constructor(r,s,t){super(r,"PERMISSION_ERROR",{required:s,actual:t});this.required=s;this.actual=t;}};var Ro=new Uint8Array([201,232,212,229,59,241,106,197]);function HM(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Ro)}function lg(){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:Ro}))}function bo(){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 FM(){return gill.combineCodec(lg(),bo())}function _o(e){return gill.decodeAccount(e,bo())}async function vo(e,n,r){let s=await fg(e,n,r);return gill.assertAccountExists(s),s}async function fg(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return _o(s)}async function GM(e,n,r){let s=await Sg(e,n,r);return gill.assertAccountsExist(s),s}async function Sg(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>_o(t))}function zM(){return 846}var ko=new Uint8Array([42,206,176,58,175,129,130,233]);function JM(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(ko)}function Wg(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:ko}))}function Lo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function qM(){return gill.combineCodec(Wg(),Lo())}function Oo(e){return gill.decodeAccount(e,Lo())}async function YM(e,n,r){let s=await kg(e,n,r);return gill.assertAccountExists(s),s}async function kg(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Oo(s)}async function ZM(e,n,r){let s=await Lg(e,n,r);return gill.assertAccountsExist(s),s}async function Lg(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Oo(t))}function XM(){return 24}function tn(){return gill.getStructEncoder([["key",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["value",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function rn(){return gill.getStructDecoder([["key",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["value",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function eh(){return gill.combineCodec(tn(),rn())}function nn(){return gill.getStructEncoder([["memberKey",se()],["permissions",He()],["userReadonlyArgs",Re()]])}function sn(){return gill.getStructDecoder([["memberKey",oe()],["permissions",Fe()],["userReadonlyArgs",be()]])}function sh(){return gill.combineCodec(nn(),sn())}function on(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function cn(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function ah(){return gill.combineCodec(on(),cn())}function Ct(){return gill.getStructEncoder([["treeInfo",Dt()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["outputStateTreeIndex",gill.getU8Encoder()]])}function Et(){return gill.getStructDecoder([["treeInfo",Pt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["outputStateTreeIndex",gill.getU8Decoder()]])}function Ah(){return gill.combineCodec(Ct(),Et())}function Mt(){return gill.getStructEncoder([["treeInfo",Dt()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function ht(){return gill.getStructDecoder([["treeInfo",Pt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function yh(){return gill.combineCodec(Mt(),ht())}function an(){return gill.getStructEncoder([["delegatedAmount",gill.getU64Encoder()],["withheldTransferFee",gill.getU64Encoder()],["isAta",gill.getU8Encoder()]])}function dn(){return gill.getStructDecoder([["delegatedAmount",gill.getU64Decoder()],["withheldTransferFee",gill.getU64Decoder()],["isAta",gill.getU8Decoder()]])}function fh(){return gill.combineCodec(an(),dn())}function mn(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function yn(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function Ih(){return gill.combineCodec(mn(),yn())}function Rt(){return gill.getStructEncoder([["data",gill.getOptionEncoder(bt())]])}function Z(){return gill.getStructDecoder([["data",gill.getOptionDecoder(_t())]])}function Ph(){return gill.combineCodec(Rt(),Z())}function bt(){return gill.getStructEncoder([["threshold",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["index",gill.getU128Encoder()],["multiWalletBump",gill.getU8Encoder()],["members",gill.getArrayEncoder(vt())],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]])}function _t(){return gill.getStructDecoder([["threshold",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["index",gill.getU128Decoder()],["multiWalletBump",gill.getU8Decoder()],["members",gill.getArrayDecoder(Ut())],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function bh(){return gill.combineCodec(bt(),_t())}function Wt(){return gill.getStructEncoder([["version",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()],["amount",gill.getU64Encoder()],["merkleContext",ln()],["tlv",gill.getOptionEncoder(gill.getArrayEncoder(Tn()))],["hasDelegate",gill.getBooleanEncoder()],["isFrozen",gill.getBooleanEncoder()]])}function kt(){return gill.getStructDecoder([["version",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()],["amount",gill.getU64Decoder()],["merkleContext",fn()],["tlv",gill.getOptionDecoder(gill.getArrayDecoder(Lt()))],["hasDelegate",gill.getBooleanDecoder()],["isFrozen",gill.getBooleanDecoder()]])}function Wh(){return gill.combineCodec(Wt(),kt())}function In(){return gill.getStructEncoder([["decimalsOption",gill.getU8Encoder()],["decimals",gill.getU8Encoder()],["compressionOnly",gill.getBooleanEncoder()],["isAta",gill.getU8Encoder()],["info",En()]])}function Cn(){return gill.getStructDecoder([["decimalsOption",gill.getU8Decoder()],["decimals",gill.getU8Decoder()],["compressionOnly",gill.getBooleanDecoder()],["isAta",gill.getU8Decoder()],["info",Dn()]])}function Bh(){return gill.combineCodec(In(),Cn())}function En(){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",hn()]])}function Dn(){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",Rn()]])}function Hh(){return gill.combineCodec(En(),Dn())}function Ge(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(vn())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(nn())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Wn())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function ze(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Un())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(sn())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(kn())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function Kh(){return gill.combineCodec(Ge(),ze())}function jh(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Jh(e,n){return n.__kind===e}function Ln(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",Ke()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",xe()]])}function On(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",je()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",Ie()]])}function Xh(){return gill.combineCodec(Ln(),On())}function vn(){return gill.getStructEncoder([["memberKey",se()],["permissions",He()]])}function Un(){return gill.getStructDecoder([["memberKey",oe()],["permissions",Fe()]])}function tR(){return gill.combineCodec(vn(),Un())}function Ot(){return gill.getStructEncoder([["memberKey",se()],["messageHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Bt(){return gill.getStructDecoder([["memberKey",oe()],["messageHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function oR(){return gill.combineCodec(Ot(),Bt())}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([Hn()])]])],["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([Bn()])]])],["PermanentDelegateAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([wn()])]])],["TransferFeeAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([Gn()])]])],["TransferHookAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([Kn()])]])],["CompressedOnly",gill.getStructEncoder([["fields",gill.getTupleEncoder([an()])]])],["Compressible",gill.getStructEncoder([["fields",gill.getTupleEncoder([In()])]])]])}function Lt(){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([Fn()])]])],["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([Nn()])]])],["PermanentDelegateAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Vn()])]])],["TransferFeeAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([zn()])]])],["TransferHookAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([jn()])]])],["CompressedOnly",gill.getStructDecoder([["fields",gill.getTupleDecoder([dn()])]])],["Compressible",gill.getStructDecoder([["fields",gill.getTupleDecoder([Cn()])]])]])}function dR(){return gill.combineCodec(Tn(),Lt())}function uR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function AR(e,n){return n.__kind===e}function Jn(){return gill.getStructEncoder([["settingsMutArgs",K()],["transactionManager",gill.getOptionEncoder(Re())]])}function qn(){return gill.getStructDecoder([["settingsMutArgs",j()],["transactionManager",gill.getOptionDecoder(be())]])}function yR(){return gill.combineCodec(Jn(),qn())}function vt(){return gill.getStructEncoder([["pubkey",se()],["permissions",He()],["role",gill.getU8Encoder()],["userAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getU8Encoder()]])}function Ut(){return gill.getStructDecoder([["pubkey",oe()],["permissions",Fe()],["role",gill.getU8Decoder()],["userAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getU8Decoder()]])}function SR(){return gill.combineCodec(vt(),Ut())}function se(){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 CR(){return gill.combineCodec(se(),oe())}function Xn(){return gill.getStructEncoder([["authorityCreationArgs",xe()],["compressedProofArgs",E()]])}function Qn(){return gill.getStructDecoder([["authorityCreationArgs",Ie()],["compressedProofArgs",D()]])}function MR(){return gill.combineCodec(Xn(),Qn())}function Nt(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function wt(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function bR(){return gill.combineCodec(Nt(),wt())}function ln(){return gill.getStructEncoder([["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()],["proveByIndex",gill.getBooleanEncoder()]])}function fn(){return gill.getStructDecoder([["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()],["proveByIndex",gill.getBooleanDecoder()]])}function UR(){return gill.combineCodec(ln(),fn())}function Dt(){return gill.getStructEncoder([["rootIndex",gill.getU16Encoder()],["proveByIndex",gill.getBooleanEncoder()],["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()]])}function Pt(){return gill.getStructDecoder([["rootIndex",gill.getU16Decoder()],["proveByIndex",gill.getBooleanDecoder()],["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()]])}function LR(){return gill.combineCodec(Dt(),Pt())}function Bn(){return gill.getStructEncoder([])}function Nn(){return gill.getStructDecoder([])}function NR(){return gill.combineCodec(Bn(),Nn())}function wn(){return gill.getStructEncoder([])}function Vn(){return gill.getStructDecoder([])}function HR(){return gill.combineCodec(wn(),Vn())}function He(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function Fe(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function zR(){return gill.combineCodec(He(),Fe())}function E(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(mn())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function D(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(yn())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function qR(){return gill.combineCodec(E(),D())}function Wn(){return gill.getStructEncoder([["memberKey",se()],["userArgs",$n()]])}function kn(){return gill.getStructDecoder([["memberKey",oe()],["userArgs",es()]])}function QR(){return gill.combineCodec(Wn(),kn())}function hn(){return gill.getStructEncoder([["baseRent",gill.getU16Encoder()],["compressionCost",gill.getU16Encoder()],["lamportsPerBytePerEpoch",gill.getU8Encoder()],["maxFundedEpochs",gill.getU8Encoder()],["maxTopUp",gill.getU16Encoder()]])}function Rn(){return gill.getStructDecoder([["baseRent",gill.getU16Decoder()],["compressionCost",gill.getU16Decoder()],["lamportsPerBytePerEpoch",gill.getU8Decoder()],["maxFundedEpochs",gill.getU8Decoder()],["maxTopUp",gill.getU16Decoder()]])}function tb(){return gill.combineCodec(hn(),Rn())}function ns(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function Vt(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function sb(){return gill.combineCodec(ns(),Vt())}function H(){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 F(){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 ab(){return gill.combineCodec(H(),F())}function X(){return gill.getStructEncoder([["domainConfigKey",gill.getAddressEncoder()],["verifyArgs",H()]])}function Q(){return gill.getStructDecoder([["domainConfigKey",gill.getAddressDecoder()],["verifyArgs",F()]])}function Ab(){return gill.combineCodec(X(),Q())}function Ht(){return gill.getStructEncoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function Ft(){return gill.getStructDecoder([["addressTreeInfo",wt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function yb(){return gill.combineCodec(Ht(),Ft())}function Gt(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function zt(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function fb(){return gill.combineCodec(Gt(),zt())}function K(){return gill.getStructEncoder([["accountMeta",Ct()],["data",Rt()]])}function j(){return gill.getStructDecoder([["accountMeta",Et()],["data",Z()]])}function Cb(){return gill.combineCodec(K(),j())}function Kt(){return gill.getStructEncoder([["accountMeta",Mt()],["data",Rt()]])}function jt(){return gill.getStructDecoder([["accountMeta",ht()],["data",Z()]])}function Mb(){return gill.combineCodec(Kt(),jt())}function Jt(){return gill.getStructEncoder([["index",gill.getU8Encoder()],["restricted",gill.getBooleanEncoder()]])}function qt(){return gill.getStructDecoder([["index",gill.getU8Decoder()],["restricted",gill.getBooleanDecoder()]])}function bb(){return gill.combineCodec(Jt(),qt())}function Hn(){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(tn())]])}function Fn(){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(rn())]])}function Wb(){return gill.combineCodec(Hn(),Fn())}function Yt(){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(Ot())]])}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(Bt())]])}function Bb(){return gill.combineCodec(Yt(),Zt())}function Xt(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(on())],["addressTableLookups",gill.getArrayEncoder(us())]])}function Qt(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(cn())],["addressTableLookups",gill.getArrayDecoder(As())]])}function Hb(){return gill.combineCodec(Xt(),Qt())}function us(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function As(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function zb(){return gill.combineCodec(us(),As())}function Gn(){return gill.getStructEncoder([["withheldAmount",gill.getU64Encoder()]])}function zn(){return gill.getStructDecoder([["withheldAmount",gill.getU64Decoder()]])}function Jb(){return gill.combineCodec(Gn(),zn())}function Kn(){return gill.getStructEncoder([["transferring",gill.getU8Encoder()]])}function jn(){return gill.getStructDecoder([["transferring",gill.getU8Decoder()]])}function Zb(){return gill.combineCodec(Kn(),jn())}function Xe(){return gill.getStructEncoder([["member",se()],["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["role",Ke()],["delegatedTo",gill.getOptionEncoder(Gt())],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function $(){return gill.getStructDecoder([["member",oe()],["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["role",je()],["delegatedTo",gill.getOptionDecoder(zt())],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function e_(){return gill.combineCodec(Xe(),$())}function xe(){return gill.getStructEncoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function Ie(){return gill.getStructDecoder([["addressTreeInfo",wt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function s_(){return gill.combineCodec(xe(),Ie())}function Qe(){return gill.getStructEncoder([["accountMeta",Ct()],["data",Xe()]])}function $e(){return gill.getStructDecoder([["accountMeta",Et()],["data",$()]])}function i_(){return gill.combineCodec(Qe(),$e())}function Re(){return gill.getStructEncoder([["accountMeta",Mt()],["data",Xe()]])}function be(){return gill.getStructDecoder([["accountMeta",ht()],["data",$()]])}function g_(){return gill.combineCodec(Re(),be())}function $n(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([Re()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([Qe()])]])]])}function es(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([be()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([$e()])]])]])}function T_(){return gill.combineCodec($n(),es())}function l_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function f_(e,n){return n.__kind===e}var it=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(it||{});function Ke(){return gill.getEnumEncoder(it)}function je(){return gill.getEnumDecoder(it)}function I_(){return gill.combineCodec(Ke(),je())}var wc=new Uint8Array([223,179,163,190,177,224,67,173]);function Cv(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(wc)}function Al(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(vt())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]]),e=>({...e,discriminator:wc}))}function Vc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(Ut())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function Ev(){return gill.combineCodec(Al(),Vc())}function Hc(e){return gill.decodeAccount(e,Vc())}async function Dv(e,n,r){let s=await ms(e,n,r);return gill.assertAccountExists(s),s}async function ms(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Hc(s)}async function Pv(e,n,r){let s=await gl(e,n,r);return gill.assertAccountsExist(s),s}async function gl(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Hc(t))}var jc=new Uint8Array([90,36,35,219,93,225,110,96]);function bv(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(jc)}function _l(){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",se()],["executor",se()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder(se())],["expectedSecp256r1Signers",gill.getArrayEncoder(Ot())],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:jc}))}function Jc(){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(Bt())],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function _v(){return gill.combineCodec(_l(),Jc())}function qc(e){return gill.decodeAccount(e,Jc())}async function Yc(e,n,r){let s=await vl(e,n,r);return gill.assertAccountExists(s),s}async function vl(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return qc(s)}async function vv(e,n,r){let s=await Ul(e,n,r);return gill.assertAccountsExist(s),s}async function Ul(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>qc(t))}var Qc=new Uint8Array([105,23,173,2,197,255,80,87]);function kv(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Qc)}function Zl(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:Qc}))}function $c(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function Lv(){return gill.combineCodec(Zl(),$c())}function ea(e){return gill.decodeAccount(e,$c())}async function ta(e,n,r){let s=await Xl(e,n,r);return gill.assertAccountExists(s),s}async function Xl(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return ea(s)}async function Ov(e,n,r){let s=await Ql(e,n,r);return gill.assertAccountsExist(s),s}async function Ql(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>ea(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 na(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}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 y(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:gill.AccountRole.READONLY});let s=r.isWritable?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY;return Object.freeze({address:O(r.value),role:ra(r.value)?gill.upgradeRoleToSigner(s):s,...ra(r.value)?{signer:r.value}:{}})}}function ra(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var oa=new Uint8Array([8]);function $v(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(oa)}function Cs(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:oa}))}function ca(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function eU(){return gill.combineCodec(Cs(),ca())}async function aa(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:Cs().encode(c),programAddress:r})}function tU(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:Cs().encode(c),programAddress:r})}function rU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:ca().decode(e.data)}}var ga=new Uint8Array([9]);function dU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ga)}function Ds(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsIndex",gill.getU128Encoder()],["configActions",gill.getArrayEncoder(Ge())],["secp256r1VerifyArgs",gill.getArrayEncoder(X())],["compressedProofArgs",gill.getOptionEncoder(E())]]),e=>({...e,discriminator:ga}))}function pa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsIndex",gill.getU128Decoder()],["configActions",gill.getArrayDecoder(ze())],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())],["compressedProofArgs",gill.getOptionDecoder(D())]])}function uU(){return gill.combineCodec(Ds(),pa())}async function ma(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.settings.value||(t.settings.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getU128Encoder().encode(na(c.settingsIndex))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ds().encode(c),programAddress:r})}function AU(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ds().encode(c),programAddress:r})}function gU(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:pa().decode(e.data)}}var Sa=new Uint8Array([19]);function SU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Sa)}function xa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(Ge())],["secp256r1VerifyArgs",gill.getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Sa}))}function Ia(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(ze())],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function xU(){return gill.combineCodec(xa(),Ia())}function Ca(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:xa().encode(c),programAddress:r})}function IU(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:Ia().decode(e.data)}}var Pa=new Uint8Array([18]);function RU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Pa)}function Ps(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",E()],["settingsCreation",Ht()],["userReadonlyArgs",Re()],["settingsIndex",gill.getU128Encoder()]]),e=>({...e,discriminator:Pa}))}function Ma(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",D()],["settingsCreation",Ft()],["userReadonlyArgs",be()],["settingsIndex",gill.getU128Decoder()]])}function bU(){return gill.combineCodec(Ps(),Ma())}async function ha(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Ps().encode(c),programAddress:r})}function _U(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Ps().encode(c),programAddress:r})}function vU(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:Ma().decode(e.data)}}var La=new Uint8Array([0]);function NU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(La)}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",xe()],["compressedProofArgs",E()]]),e=>({...e,discriminator:La}))}function Oa(){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",Ie()],["compressedProofArgs",D()]])}function wU(){return gill.combineCodec(hs(),Oa())}async function Ba(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:hs().encode(c),programAddress:r})}function VU(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:hs().encode(c),programAddress:r})}function HU(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:Oa().decode(e.data)}}var wa=new Uint8Array([4]);function qU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(wa)}function bs(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",E()],["member",ns()],["role",Ke()],["userAccountCreationArgs",xe()],["linkWalletArgs",gill.getOptionEncoder(Jn())]]),e=>({...e,discriminator:wa}))}function Va(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",D()],["member",Vt()],["role",je()],["userAccountCreationArgs",Ie()],["linkWalletArgs",gill.getOptionDecoder(qn())]])}function YU(){return gill.combineCodec(bs(),Va())}async function Ha(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:bs().encode(c),programAddress:r})}function ZU(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:bs().encode(c),programAddress:r})}function XU(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:Va().decode(e.data)}}var Ga=new Uint8Array([3]);function nW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ga)}function vs(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Ga}))}function za(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function sW(){return gill.combineCodec(vs(),za())}async function Ka(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=y(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:vs().encode({}),programAddress:r})}function oW(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=y(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:vs().encode({}),programAddress:r})}function cW(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:za().decode(e.data)}}var Ja=new Uint8Array([5]);function pW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ja)}function Ws(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",E()],["createUserArgs",gill.getArrayEncoder(Ln())]]),e=>({...e,discriminator:Ja}))}function qa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",D()],["createUserArgs",gill.getArrayDecoder(On())]])}function mW(){return gill.combineCodec(Ws(),qa())}async function Ya(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Ws().encode(c),programAddress:r})}function yW(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Ws().encode(c),programAddress:r})}function TW(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:qa().decode(e.data)}}var Qa=new Uint8Array([17]);function EW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Qa)}function $a(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMutArgs",K()],["compressedProofArgs",E()],["secp256r1VerifyArgs",gill.getArrayEncoder(X())]]),e=>({...e,discriminator:Qa}))}function ei(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMutArgs",j()],["compressedProofArgs",D()],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())]])}function DW(){return gill.combineCodec($a(),ei())}function ti(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:$a().encode(c),programAddress:r})}function PW(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:ei().decode(e.data)}}var si=new Uint8Array([2]);function vW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(si)}function oi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:si}))}function ci(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function UW(){return gill.combineCodec(oi(),ci())}function ai(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:oi().encode(c),programAddress:r})}function WW(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:ci().decode(e.data)}}var Ai=new Uint8Array([1]);function VW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ai)}function Ls(){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(Xn())]]),e=>({...e,discriminator:Ai}))}function gi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))],["newAuthorityArgs",gill.getOptionDecoder(Qn())]])}function HW(){return gill.combineCodec(Ls(),gi())}async function FW(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Ls().encode(c),programAddress:r})}function pi(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Ls().encode(c),programAddress:r})}function GW(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:gi().decode(e.data)}}var Ti=new Uint8Array([6]);function ZW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ti)}function li(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Qe()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ti}))}function fi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",$e()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",D()]])}function XW(){return gill.combineCodec(li(),fi())}function Si(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:li().encode(c),programAddress:r})}function QW(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:fi().decode(e.data)}}var Ci=new Uint8Array([7]);function ok(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ci)}function Ei(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Qe()],["secp256r1VerifyArgs",gill.getOptionEncoder(H())],["delegateTo",gill.getOptionEncoder(Gt())],["oldSettingsMutArgs",gill.getOptionEncoder(K())],["newSettingsMutArgs",gill.getOptionEncoder(K())],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ci}))}function Di(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",$e()],["secp256r1VerifyArgs",gill.getOptionDecoder(F())],["delegateTo",gill.getOptionDecoder(zt())],["oldSettingsMutArgs",gill.getOptionDecoder(j())],["newSettingsMutArgs",gill.getOptionDecoder(j())],["compressedProofArgs",D()]])}function ck(){return gill.combineCodec(Ei(),Di())}function Pi(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...i],data:Ei().encode(c),programAddress:r})}function ak(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:Di().decode(e.data)}}var Ri=new Uint8Array([32]);function mk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ri)}function bi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",bt()],["compressedProofArgs",E()],["settingsCreationArgs",Ht()]]),e=>({...e,discriminator:Ri}))}function _i(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",_t()],["compressedProofArgs",D()],["settingsCreationArgs",Ft()]])}function yk(){return gill.combineCodec(bi(),_i())}function vi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:bi().encode(c),programAddress:r})}function Tk(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:_i().decode(e.data)}}var ki=new Uint8Array([31]);function Ek(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ki)}function Li(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Xe()],["compressedProofArgs",E()],["userCreationArgs",xe()]]),e=>({...e,discriminator:ki}))}function Oi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",$()],["compressedProofArgs",D()],["userCreationArgs",Ie()]])}function Dk(){return gill.combineCodec(Li(),Oi())}function Bi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:Li().encode(c),programAddress:r})}function Pk(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:Oi().decode(e.data)}}var wi=new Uint8Array([29]);function Uk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(wi)}function Os(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(X())]]),e=>({...e,discriminator:wi}))}function Vi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())]])}function Wk(){return gill.combineCodec(Os(),Vi())}async function kk(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(O(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Os().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},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Os().encode(c),programAddress:r})}function Lk(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:Vi().decode(e.data)}}var zi=new Uint8Array([27]);function Fk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(zi)}function Ki(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:zi}))}function ji(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function Gk(){return gill.combineCodec(Ki(),ji())}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:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Ki().encode(c),programAddress:r})}function zk(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:ji().decode(e.data)}}var Xi=new Uint8Array([30]);function Xk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Xi)}function ws(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["splInterfacePdaArgs",gill.getOptionEncoder(Jt())],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccounts",gill.getOptionEncoder(gill.getArrayEncoder(Wt()))],["compressedProofArgs",gill.getOptionEncoder(E())],["secp256r1VerifyArgs",gill.getArrayEncoder(X())]]),e=>({...e,discriminator:Xi}))}function Qi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["splInterfacePdaArgs",gill.getOptionDecoder(qt())],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccounts",gill.getOptionDecoder(gill.getArrayDecoder(kt()))],["compressedProofArgs",gill.getOptionDecoder(D())],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())]])}function Qk(){return gill.combineCodec(ws(),Qi())}async function $k(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(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 i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:ws().encode(c),programAddress:r})}function $i(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:ws().encode(c),programAddress:r})}function eL(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 od=new Uint8Array([28]);function aL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(od)}function Vs(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["splInterfacePdaArgs",gill.getOptionEncoder(Jt())],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccounts",gill.getOptionEncoder(gill.getArrayEncoder(Wt()))],["secp256r1VerifyArgs",gill.getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:od}))}function cd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["splInterfacePdaArgs",gill.getOptionDecoder(qt())],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccounts",gill.getOptionDecoder(gill.getArrayDecoder(kt()))],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function iL(){return gill.combineCodec(Vs(),cd())}async function dL(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(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 i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Vs().encode(c),programAddress:r})}function ad(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Vs().encode(c),programAddress:r})}function uL(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:cd().decode(e.data)}}var ud=new Uint8Array([13]);function lL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ud)}function Ad(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(H())]]),e=>({...e,discriminator:ud}))}function gd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(F())]])}function fL(){return gill.combineCodec(Ad(),gd())}function pd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ad().encode(c),programAddress:r})}function SL(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:gd().decode(e.data)}}var Td=new Uint8Array([23]);function ML(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Td)}function ld(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(H())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Td}))}function fd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(F())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function hL(){return gill.combineCodec(ld(),fd())}function Sd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ld().encode(c),programAddress:r})}function RL(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:fd().decode(e.data)}}var Cd=new Uint8Array([10]);function LL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Cd)}function Ed(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Yt()],["secp256r1VerifyArgs",gill.getOptionEncoder(H())]]),e=>({...e,discriminator:Cd}))}function Dd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Zt()],["secp256r1VerifyArgs",gill.getOptionDecoder(F())]])}function OL(){return gill.combineCodec(Ed(),Dd())}function Pd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:Ed().encode(c),programAddress:r})}function BL(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:Dd().decode(e.data)}}var Rd=new Uint8Array([20]);function zL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Rd)}function bd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Yt()],["secp256r1VerifyArgs",gill.getOptionEncoder(H())],["settingsReadonlyArgs",Kt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Rd}))}function _d(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Zt()],["secp256r1VerifyArgs",gill.getOptionDecoder(F())],["settingsReadonlyArgs",jt()],["compressedProofArgs",D()]])}function KL(){return gill.combineCodec(bd(),_d())}function vd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:bd().encode(c),programAddress:r})}function jL(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:_d().decode(e.data)}}var kd=new Uint8Array([14]);function $L(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(kd)}function Ld(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(H())]]),e=>({...e,discriminator:kd}))}function Od(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(F())]])}function eO(){return gill.combineCodec(Ld(),Od())}function Bd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ld().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},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:Od().decode(e.data)}}var Vd=new Uint8Array([24]);function iO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Vd)}function Hd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(H())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Vd}))}function Fd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(F())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function dO(){return gill.combineCodec(Hd(),Fd())}function Gd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Hd().encode(c),programAddress:r})}function uO(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:Fd().decode(e.data)}}var jd=new Uint8Array([12]);function TO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(jd)}function Jd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:jd}))}function qd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function lO(){return gill.combineCodec(Jd(),qd())}function Yd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:Jd().encode(c),programAddress:r})}function fO(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:qd().decode(e.data)}}var Qd=new Uint8Array([22]);function DO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Qd)}function $d(){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 eu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function PO(){return gill.combineCodec($d(),eu())}function tu(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:$d().encode(c),programAddress:r})}function MO(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:eu().decode(e.data)}}var su=new Uint8Array([11]);function WO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(su)}function ou(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(H())]]),e=>({...e,discriminator:su}))}function cu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(F())]])}function kO(){return gill.combineCodec(ou(),cu())}function au(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ou().encode(c),programAddress:r})}function LO(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:cu().decode(e.data)}}var uu=new Uint8Array([21]);function FO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(uu)}function Au(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(H())],["settingsReadonlyArgs",Kt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:uu}))}function gu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(F())],["settingsReadonlyArgs",jt()],["compressedProofArgs",D()]])}function GO(){return gill.combineCodec(Au(),gu())}function pu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Au().encode(c),programAddress:r})}function zO(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:gu().decode(e.data)}}var Tu=new Uint8Array([15]);function ZO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Tu)}function lu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Tu}))}function fu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function XO(){return gill.combineCodec(lu(),fu())}function Su(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=m({}),i=y(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:lu().encode({}),programAddress:r})}function QO(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:fu().decode(e.data)}}var Cu=new Uint8Array([25]);function sB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Cu)}function Eu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:Cu}))}function Du(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function oB(){return gill.combineCodec(Eu(),Du())}function Pu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:Eu().encode(c),programAddress:r})}function cB(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:Du().decode(e.data)}}var Ru=new Uint8Array([16]);function pB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ru)}function bu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Xt()],["secp256r1VerifyArgs",gill.getArrayEncoder(X())]]),e=>({...e,discriminator:Ru}))}function _u(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Qt()],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())]])}function mB(){return gill.combineCodec(bu(),_u())}function vu(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:bu().encode(c),programAddress:r})}function yB(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:_u().decode(e.data)}}var ku=new Uint8Array([26]);function CB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ku)}function Lu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Xt()],["secp256r1VerifyArgs",gill.getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:ku}))}function Ou(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Qt()],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function EB(){return gill.combineCodec(Lu(),Ou())}function Bu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Lu().encode(c),programAddress:r})}function DB(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:Ou().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",gE=(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))(gE||{});function iN(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 pE=(T=>(T[T.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",T[T.ChangeConfig=1]="ChangeConfig",T[T.ChangeConfigCompressed=2]="ChangeConfigCompressed",T[T.CreateCompressedWallet=3]="CreateCompressedWallet",T[T.CreateDomainConfig=4]="CreateDomainConfig",T[T.CreateDomainUserAccount=5]="CreateDomainUserAccount",T[T.CreateGlobalCounter=6]="CreateGlobalCounter",T[T.CreateUserAccounts=7]="CreateUserAccounts",T[T.DecompressSettingsAccount=8]="DecompressSettingsAccount",T[T.DisableDomainConfig=9]="DisableDomainConfig",T[T.EditDomainConfig=10]="EditDomainConfig",T[T.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",T[T.EditUserDelegate=12]="EditUserDelegate",T[T.MigrateCompressedSettings=13]="MigrateCompressedSettings",T[T.MigrateCompressedUsers=14]="MigrateCompressedUsers",T[T.NativeTransferIntent=15]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=17]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=19]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=21]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=23]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=25]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=27]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",T[T.TransactionExecute=29]="TransactionExecute",T[T.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=31]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",T))(pE||{});function dN(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 yE=6e3,TE=6001,lE=6002,fE=6003,SE=6004,xE=6005,IE=6006,CE=6007,EE=6008,DE=6009,PE=6010,ME=6011,hE=6012,RE=6013,bE=6014,_E=6015,vE=6016,UE=6017,WE=6018,kE=6019,LE=6020,OE=6021,BE=6022,NE=6023,wE=6024,VE=6025,HE=6026,FE=6027,GE=6028,zE=6029,KE=6030,jE=6031,JE=6032,qE=6033,YE=6034,ZE=6035,XE=6036,QE=6037,$E=6038,eD=6039,tD=6040,rD=6041,nD=6042,sD=6043,oD=6044,cD=6045,aD=6046,iD=6047,dD=6048,uD=6049,AD=6050,gD=6051,pD=6052,mD=6053,yD=6054,TD=6055,lD=6056,fD=6057,SD=6058,xD=6059,ID=6060,CD=6061,ED=6062,DD=6063,PD=6064,MD=6065,hD=6066,RD=6067,bD=6068,_D=6069,vD=6070,UD=6071,WD=6072,kD=6073,LD=6074,OD=6075,BD=6076,ND=6077,wD=6078,VD=6079,HD=6080,FD=6081,GD=6082,Nu;process.env.NODE_ENV!=="production"&&(Nu={[KE]:"This member is already delegated to another wallet.",[CE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[LD]:"Clock sysvar access failed. This may indicate a system error.",[AD]:"The domain configuration account is disabled. Please contact support or try again later.",[gD]:"Missing domain configuration account.",[WD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[GD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[PE]:"Duplicate public keys detected among members. Each member must have a unique key.",[DE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[LE]:"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.",[WE]:"Expected a User with Administrator role for this instruction.",[EE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[vE]:"Expected a User with Transaction Manager role for this instruction.",[eD]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[tD]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[rD]:"Declared buffer size does not match the actual serialized size.",[lD]:"Failed to compute hash. This may indicate a system error.",[qE]:"Not enough members with vote permission to meet the approval threshold.",[jE]:"At least one signer with execute permission is required to proceed.",[JE]:"At least one signer with initiate permission is required to perform this action.",[VE]:"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.",[yD]:"Address Tree supplied is not part of the whitelisted address trees.",[kE]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[FE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[$E]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[SD]:"Member key conversion failed. The provided key format is invalid.",[YE]:"Only delegated members are allowed for this transaction.",[wE]:"Unexpected number of accounts provided for this instruction.",[RE]:"User with Permanent Member role must have a delegated wallet.",[TE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[SE]:"The extracted public key has an invalid length or encoding.",[yE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[fE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[uD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[iD]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[BE]:"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.",[UE]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[_E]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[NE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[HE]:"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.",[xE]:"The extracted WebAuthn signed message payload is malformed.",[cD]:"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.",[GE]:"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.",[ND]:"Missing destination token account. Required for token transfer operations.",[hD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[ID]:"Light CPI accounts are missing. Required for compressed account operations.",[zE]:"User mutation arguments are required when performing add or remove delegate operations.",[HD]:"Missing new authority account. Required for domain configuration updates.",[VD]:"Missing settings account. Required for delegate operations on compressed wallets.",[TD]:"Compressed settings data is missing. The settings account must be initialized with data.",[wD]:"Missing source token account. Required for token transfer operations.",[MD]:"Missing SPL interface PDA. Required for token transfer operations.",[aD]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[kD]:"User account address is missing. Required for secp256r1 signature verification.",[FD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[XE]:"No valid signer found in this transaction.",[hE]:"Only one permanent member is allowed per wallet.",[bE]:"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.",[ME]:"Permanent members cannot be removed from a wallet.",[oD]:"Writable CPI calls to protected accounts are not permitted.",[IE]:"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.",[lE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[dD]:"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.",[OE]:"Too many members: a maximum of 4 members are supported.",[nD]:"This transaction has expired. It must be executed within 3 minutes of approval.",[sD]:"This transaction has not yet reached the required approval threshold.",[QE]:"Only the transaction creator or rent payer may close this transaction buffer.",[OD]:"Unauthorized: Only the admin account is allowed to perform this action.",[ZE]:"Member is not part of the expected signers for this transaction."});function yN(e){return process.env.NODE_ENV!=="production"?Nu[e]:"Error message not available in production bundles."}function TN(e,n,r){return gill.isProgramError(e,n,A,r)}async function hN({admin:e,addressTree:n}){return aa({payer:e,addressTree:n,remainingAccounts:[]})}var tr={Ed25519:1,Secp256r1:2};var wu=f__default.default.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),WN=f__default.default.object({transactionActionType:wu,transactionAddress:f__default.default.string(),transactionMessageBytes:f__default.default.array(f__default.default.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),Vu=f__default.default.object({transactionActionType:wu,transactionAddress:f__default.default.string(),transactionMessageBytes:f__default.default.string()}).strict(),Hu=f__default.default.object({authResponse:f__default.default.custom(),nonce:f__default.default.string(),clientSignature:f__default.default.object({clientOrigin:f__default.default.string(),signature:f__default.default.string()}).strict(),deviceSignature:f__default.default.object({publicKey:f__default.default.string(),signature:f__default.default.string()}).strict(),authProviderSignature:f__default.default.object({publicKey:f__default.default.string(),signature:f__default.default.string()}).strict().optional()}).strict(),Fu=f__default.default.object({signer:f__default.default.string(),userAddressTreeIndex:f__default.default.number().optional(),additionalInfo:f__default.default.looseObject({}).optional()}).strict(),zD=f__default.default.object({transactionPayload:Vu,slotHash:f__default.default.string(),slotNumber:f__default.default.string(),originIndex:f__default.default.number(),crossOrigin:f__default.default.boolean()}).strict(),kN=f__default.default.object({phase:f__default.default.literal("start"),redirectOrigin:f__default.default.url(),signer:f__default.default.string().optional(),data:f__default.default.object({type:f__default.default.literal("message"),payload:f__default.default.string().optional()}).strict()}).strict(),LN=f__default.default.object({phase:f__default.default.literal("start"),redirectOrigin:f__default.default.url(),signer:f__default.default.string().optional(),data:f__default.default.object({type:f__default.default.literal("transaction"),payload:Vu}).strict()}).strict(),ON=f__default.default.object({phase:f__default.default.literal("complete"),data:f__default.default.object({type:f__default.default.literal("message"),payload:Fu.extend(Hu.shape).extend({id:f__default.default.string().optional(),message:f__default.default.string(),clientSignature:f__default.default.object({clientOrigin:f__default.default.string()}).strict()})}).strict()}).strict(),BN=f__default.default.object({phase:f__default.default.literal("complete"),data:f__default.default.object({type:f__default.default.literal("transaction"),payload:Fu.extend(Hu.shape).extend(zD.shape).extend({clientSignature:f__default.default.object({clientOrigin:f__default.default.string()}).strict()})}).strict()}).strict();var _e={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Be=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(_e).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var Gs=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!==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 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 JD(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function qD(){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(JD())],["addressTableLookups",gill.getArrayCodec(qD())]]);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}}function Ju(e,n,r,s){if(e<n||e>r)throw new z(`${s} must be between ${n} and ${r} (inclusive), got ${e}`)}function qu(e,n){if(e<0)throw new z(`${n} must be non-negative, got ${e}`)}function rr(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`)}stateless_js.featureFlags.version=stateless_js.VERSION.V2;var te={};function Zu(){if(!te.solanaRpcEndpoint)throw new Oe("RPC endpoint");return te.solanaRpcEndpoint}function tt(){if(!te.lightProtocolRpc)throw new Oe("Light Protocol RPC");return te.lightProtocolRpc}function ce(){if(!te.solanaRpc)throw new Oe("Solana RPC");return te.solanaRpc}function Xu(){if(!te.sendAndConfirm)throw new Oe("Send and confirm transaction function");return te.sendAndConfirm}function Qu(){if(!te.computeEstimate)throw new Oe("Compute budget estimate function");return te.computeEstimate}function Ks(){return te.jitoTipsConfig?te.jitoTipsConfig:{blockEngineUrl:Io,getJitoTipsUrl:Co,priority:Eo}}function dw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){te.solanaRpcEndpoint=e,te.lightProtocolRpc=stateless_js.createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=gill.createSolanaClient({urlOrMoniker:e});te.solanaRpc=t,te.sendAndConfirm=c,te.computeEstimate=programs.estimateComputeUnitLimitFactory({rpc:t}),te.jitoTipsConfig=s??null;}function $u(e){return typeof e=="string"?e:e.toString()}function eA(e){return e.toString()}async function js(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 eP={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true};function tP(e,n,r=2,s=3e4){let t=n*Math.pow(r,e-1);return Math.min(t,s)}function rP(e){return new Promise(n=>setTimeout(n,e))}async function nr(e,n){let{maxRetries:r,initialDelayMs:s,backoffBase:t=2,maxDelayMs:c=3e4,shouldRetry:a}={...eP,...n},i;for(let o=1;o<=r;o++)try{return await e()}catch(u){if(i=u,a&&!a(u,o))throw u;if(o>=r)break;let d=tP(o,s,t,c);await rP(d);}throw new mr(e.name||"retryWithBackoff",r,i)}async function ut(e,n){let r=(s,t)=>s instanceof Response?s.status===429?n.retryOnRateLimit??true:s.status>=400&&s.status<500?false:s.status>=500:s instanceof TypeError||s instanceof Error;return nr(e,{...n,shouldRetry:n.shouldRetry??r})}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 tt().getStateTreeInfos(),r=stateless_js.selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:a,queuePubkeyIndex:i,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,u=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=u);}for(let c of r){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:a,addressQueuePubkeyIndex:i});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function Nr(e,n){let r=$u(e);return js(n,r,()=>tt().getCompressedAccount(e))}async function rt(e,n){let r=eA(e);return js(n,r,()=>ce().getAccountInfo(e,{encoding:"base64"}).send())}async function Te(e,n){let s=(await Promise.all(e.map(async t=>Nr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new ne("Compressed account",`Expected ${e.length} accounts but found ${s.length}`);return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function v(e,n){return {proof:e?.compressedProof?gill.some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function ge(e,n,r,s,t){if(t.length===0)return [];let c=t.map((u,d)=>({treeInfo:n[d],root:r[d],rootIndex:s[d],address:u.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((u,d)=>({addressTreeInfo:a[d],outputStateTreeIndex:i,address:u.address,type:u.type}))}function de(e,n,r,s,t,c,a){let i=[];for(let d=0;d<n.length;d++)i.push({treeInfo:n[d],rootIndex:s[d],leafIndex:r[d],proveByIndex:t[d],hash:c[d].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new z("Unable to parse state tree data");return c.map((d,g)=>({data:a.decode(d.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(d.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Me(e,n,r,s,t){let c=null,a=null,i=null,o=new B;if(e){await o.addSystemAccounts();let{address:u}=await ae(n,r),d=(await Te([{address:u,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[d.leafIndex],leaves:[],treeInfos:[d.treeInfo],proveByIndices:[d.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:i=await w([d],[]);let g=o.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!g)throw new z("Unable to parse state tree data");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:g.packedTreeInfos[0]},data:Z().decode(d.data?.data)},a={accountMeta:{address:new Uint8Array(d.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:Z().decode(d.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:o,settingsMutArgs:a}}async function w(e,n,r=3,s=500){return nr(()=>tt().getValidityProofV0(e,n),{maxRetries:r,initialDelayMs:s})}async function he(){return (await wr()).length-1}var Js;async function wr(){if(!Js){let{data:e}=await ta(ce(),await sA());Js=e.whitelistedAddressTrees;}return Js}function nA(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 Vr(e,n,r){let s=await aP(e,n,r);if(!s)throw new ne("User account");return s}async function aP(e,n,r){let{address:s}=await N(e,n),t=await Nr(s,r);return t?.data?.data?$().decode(t.data.data):null}async function qs(e,n,r){let s=await iP(e,n,r);if(!s)throw new ne("Settings account");return s}async function iP(e,n,r){try{let{address:s}=await ae(e,n),t=await Nr(s,r);if(!t?.data?.data)throw new ne("Compressed settings account");let c=Z().decode(t.data.data);if(c.data.__option==="None")throw new ne("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let s=await ms(ce(),await ue(e));return s.exists?{...s.data,isCompressed:false}:null}}async function Ys(e){qu(e,"index");let n=await wr();if(e>=n.length)throw new z(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function Vw(e){let r=(await wr()).findIndex(s=>s.toString()===e);if(r===-1)throw new ne("Address tree",`Address ${e} not found in whitelist`);return r}async function ae(e,n=0){let r=await Ys(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("multi_wallet")),new Uint8Array(gill.getU128Encoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function N(e,n=0){let r=await Ys(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("user")),e instanceof Ne?e.toTruncatedBuffer():new Uint8Array(gill.getAddressEncoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function gt({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha2_js.sha256(new Uint8Array(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 dA(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function sA(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function uA(e,n,r){Ju(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 Ne?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return s}async function ve(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 ue(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function Qw(e){let n=await ue(e);return await ve(n)}async function $w(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}async function or(e,n){if(!e.ok){await e.text().catch(()=>e.statusText);throw new De(`Request failed: ${e.statusText} (${e.status})`,e.status,n)}return e}async function cr(e){try{return await e.json()}catch(n){throw new De(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function A2(e){let n=tinyCbor.decodeCBOR(e),r=nist_js.p256.Point.fromAffine({x:BigInt("0x"+Fr(n.get(-2))),y:BigInt("0x"+Fr(n.get(-3)))});return gill.getBase58Decoder().decode(r.toBytes(true))}function g2(e){let r=nist_js.p256.Point.fromBytes(new Uint8Array(gill.getBase58Encoder().encode(e))).toBytes(false),s=new Map;return s.set(1,2),s.set(3,-7),s.set(-1,1),s.set(-2,r.slice(1,33)),s.set(-3,r.slice(33,65)),new Uint8Array(tinyCbor.encodeCBOR(s))}async function p2(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Ve(n)),c=JSON.parse(new TextDecoder().decode(Ve(r))),a=pA(c),i=yA(new Uint8Array(Ve(s))),o=await gt({rpIdHash:t.subarray(0,32)});return new P(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Ve(r)),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(gill.getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:Zs(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function Zs(e,n,r){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...gill.getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function T2(e){return sha2_js.sha256(new Uint8Array(gill.getUtf8Encoder().encode(JSON.stringify(e))))}function l2(e){return Xs(e.data.payload.authResponse)}function f2(e,n,r,s){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...Zs(n,r,s)]))}async function S2(e,n,r,s,t,c){let a;if(!t||!c){let o=(await ce().getAccountInfo(gill.address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!o)throw new ne("Slot sysvar","Unable to fetch slot sysvar data");let u=gill.getBase64Encoder().encode(o[0]);c=gill.getU64Decoder().decode(u.subarray(0,8)).toString(),a=u.subarray(8,40),t=gill.getBase58Decoder().decode(a);}else a=new Uint8Array(gill.getBase58Encoder().encode(t));let i=sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e.transactionActionType),...gill.getBase58Encoder().encode(e.transactionAddress),...sha2_js.sha256(typeof e.transactionMessageBytes=="string"?new Uint8Array(Ve(e.transactionMessageBytes)):e.transactionMessageBytes),...a,...Zs(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:i}}function Xs(e){return sha2_js.sha256(zr(e))}function x2(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ve(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),a=new Uint8Array(c);for(let i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return c}async function I2(e,n){let{data:r}=await vo(ce(),e),t=mA(new Uint8Array(r.origins),r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Error("Origin not found in domain config");return t}function Fr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function lP(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 pA(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 mA(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let a=e[s]|e[s+1]<<8;if(s+=2,s+a>e.length)throw new Error("MaxLengthExceeded");let i=e.slice(s,s+a),o=t.decode(i);r.push(o),s+=a;}return r}function yA(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let C=n&127;r+=C;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let a=e[r+1],i=r+2,o=e.slice(i,i+a),u=c[0]===0&&c.length>32?c.slice(1):c,d=o[0]===0&&o.length>32?o.slice(1):o;if(u.length>32||d.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(u,32-u.length);let p=nist_js.p256.Point.CURVE().n>>1n,l=BigInt("0x"+Fr(d)),b=(l>p?nist_js.p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),x=lP(b);return new Uint8Array([...g,...x])}function zr(e){return new Uint8Array([...new Uint8Array(Ve(e.response.authenticatorData)),...sha2_js.sha256(new Uint8Array(Ve(e.response.clientDataJSON)))])}async function Qs(e,n=false){let r=n?{blockhash:gill.getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await ce().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(s.instructions,c),c=>gill.setTransactionMessageFeePayerSigner(s.payer,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?gill.compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let a=Math.ceil((s.unitsConsumed??0)*1.1);return a>2e5?gill.prependTransactionMessageInstructions([programs.getSetComputeUnitLimitInstruction({units:a})],c):c},async c=>n?gill.compileTransaction(await c):await gill.signTransactionMessageWithSigners(await c))))}async function SA(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===gill.AccountRole.WRITABLE||c.role===gill.AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,a)=>c-a);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function xA(e,n){rr(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 ut(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})}),{maxRetries:3,initialDelayMs:500});await or(r,n);let s=await cr(r);if(!s.result||s.error)throw new ye(`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 ye(`Simulation failed: ${c}`)}return s.result.value.transactionResults.map(t=>t.unitsConsumed)}function J(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,a=r?.authData&&r.verifyArgs.clientDataJson?zr(r.authResponse):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function mt(e){if(e instanceof Ne)return {keyType:tr.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:tr.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function fA(e){return e instanceof P?e.toString():e.address.toString()}function Se(e){let n=new Set,r=[];for(let t of e)n.has(fA(t))||(r.push(t),n.add(fA(t)));let s=r.filter(t=>t instanceof P);if(s.length>1)throw new z(`More than 1 Secp256r1 signers in an instruction is not supported (found ${s.length})`);return r}function IA({payer:e,tipAmount:n}){let r=$r[Math.floor(Math.random()*$r.length)];return programs.getTransferSolInstruction({source:e,destination:gill.address(r),amount:n})}async function J2(e){rr(e,"bundle");let n=await Qs(e,true),r=await xA(n.map(gill.getBase64EncodedWireTransaction),Zu()),s=await Qs(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await kP(s.map(gill.getBase64EncodedWireTransaction))}async function kP(e,n=3,r=500,s=Ks()){rr(e,"serializedTransactions");let{blockEngineUrl:t}=s,c=`${t}/bundles`,a=await ut(()=>fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})}),{maxRetries:n,initialDelayMs:r});await or(a,c);let i=await cr(a);if(i.error)throw new ye(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new ye("No bundle ID returned from Jito");return i.result}async function q2(e,n=30,r=3e3,s=Ks()){Yu(e,"bundleId");let{blockEngineUrl:t}=s,c=`${t}/getBundleStatuses`;return nr(async()=>{let a=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await or(a,c);let i=await cr(a);if(i.error)throw new ye(`Error getting bundle status: ${JSON.stringify(i.error,null,2)}`,e);if(!i.result?.value?.length)throw new ye("Bundle not yet confirmed",e);let o=i.result.value[0];if(o.confirmation_status==="confirmed"||o.confirmation_status==="finalized"){let u=o.transactions[o.transactions.length-1];if(!u)throw new ye("No transactions in confirmed bundle",e);return u}throw new ye(`Bundle status: ${o.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:a=>a instanceof ye||a instanceof De})}async function t5({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await ce().getLatestBlockhash().send(),t=await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(e,c),c=>gill.setTransactionMessageFeePayerSigner(n,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?gill.compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([Qu()(c),SA(ce(),c.instructions.flatMap(u=>u.accounts??[]))]),o=Math.ceil(a*1.1);return gill.prependTransactionMessageInstructions([...o>2e5?[programs.getSetComputeUnitLimitInstruction({units:o})]:[],...i>0?[programs.getSetComputeUnitPriceInstruction({microLamports:i})]:[]],c)},async c=>await gill.signTransactionMessageWithSigners(await c));return await Xu()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}function l5(e,n){if(n.threshold>1)throw new z("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(o=>DA(o.pubkey)===e);if(!r)throw new ne("Member",`Signer ${e} not found in settings`);let{permissions:s}=r;if(!s)throw new ne("Permissions","No permissions found for the current member");let t=Be.has(s,_e.InitiateTransaction),c=Be.has(s,_e.VoteTransaction),a=Be.has(s,_e.ExecuteTransaction);if(t&&c&&a)return {};if(!c||!a)throw new yr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,a?"ExecuteTransaction":void 0].filter(Boolean));let i=n.members.find(o=>o.role===2);if(!i)throw new ne("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:gill.address(DA(i.pubkey)),userAddressTreeIndex:i.userAddressTreeIndex}}async function f5({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await Vr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new ne("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return QP(n,c.transactionManagerUrl.value,e,s)}function QP(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(gill.getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=gill.getBase64Decoder().decode(s)),r&&(c.authResponses=r);let a=await ut(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)}),{maxRetries:3,initialDelayMs:500});if(!a.ok)throw new De(`Transaction manager request failed: ${a.statusText}`,a.status,n);let i=await a.json();if("error"in i)throw new De(`Transaction manager error: ${i.error}`,a.status,n);return i.signatures.map(o=>({[e]:gill.getBase58Encoder().encode(o)}))}}}function DA(e){return e.keyType===tr.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}function S5(e){let n=e.map(c=>Ge().encode(c)),r=4+n.reduce((c,a)=>c+a.length,0),s=new Uint8Array(r),t=0;s.set(gill.getU32Encoder().encode(e.length),t),t+=4;for(let c of n)s.set(c,t),t+=c.length;return s}function x5(e){let n=0,[r,s]=gill.getU32Decoder().read(e,n);n=s;let t=new Array(r);for(let c=0;c<r;c++){let a=ze().read(e,n);t[c]=a[0],n=a[1];}if(n!==e.length)throw new z(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function O5({payer:e,rpId:n,origins:r,authority:s}){let t=await gt({rpId:n}),c=new B;await c.addSystemAccounts();let a=await he(),{address:i,addressTree:o}=await N(s.address,a),u=[{address:i,tree:o,queue:o,type:"User"}],d=await w([],u),g=(await ge(c,d.treeInfos,d.roots,d.rootIndices,u))[0],{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),S=v(d,l);return await Ba({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function j5({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await ae(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await N(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await Te(a,t):[],o=await he(),{address:u,addressTree:d}=await N(r.member,o),g=[{address:u,type:"User",tree:d,queue:d}],p=await w(i,g),l=null,S=null,b=i.filter(G=>G.type==="Settings"),x=i.filter(G=>G.type==="User");b.length&&(l=de(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),b,Z())[0]),x.length&&(S=de(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,$())[0]);let C=await ge(c,p.treeInfos.slice(i.length),p.roots.slice(i.length),p.rootIndices.slice(i.length),g),{remainingAccounts:_,systemOffset:I}=c.toAccountMetas(),W=v(p,I);return await Ha({payer:n,authority:e,compressedProofArgs:W,member:Vt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:l?gill.some({settingsMutArgs:l,transactionManager:S?gill.some(S):gill.none()}):gill.none(),userAccountCreationArgs:C[0],domainConfig:s,remainingAccounts:_})}async function Z5({payer:e}){let n=await dA();return Ka({payer:e,globalCounter:n})}async function e6({admin:e,rpId:n,disable:r}){let s=await gt({rpId:n});return ai({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function a6({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:a}=await ae(r,s),i=[{address:c,tree:a,queue:a,type:"Settings"}],o=await w([],i),u=(await ge(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:d,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return vi({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:u,remainingAccounts:d})}async function m6({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:a}=await N(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await w([],i),u=(await ge(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:d,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Bi({compressedProofArgs:p,args:e,authority:n,userCreationArgs:u,remainingAccounts:d})}function eM(e,n,r,s){let t=tM(e,n),c=rM(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 tM(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,a=s-t,i=r-s-c;return n>=r?false:n<a?true:n>=s?n-s<i:false}function rM(e,n){return n<e.header.numSignerAccounts}async function Kr({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(i=>i.lookupTableAddress),ce()):{}),a=[];a.push(...t.addressTableLookups?.map(i=>({role:gill.AccountRole.READONLY,address:i.lookupTableAddress}))??[]);for(let[i,o]of t.staticAccounts.entries())a.push({address:o,role:eM(t,i,o,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let o=c[i.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let u of i.writableIndexes){let d=o[u];if(!d)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:d,role:gill.AccountRole.WRITABLE});}for(let u of i.readonlyIndexes){let d=o[u];if(!d)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:d,role:gill.AccountRole.READONLY});}}for(let i of s?.filter(o=>o.address!==e)??[]){let o=a.findIndex(u=>u.address===i.address);o===-1?a.push({address:i.address,role:gill.AccountRole.READONLY_SIGNER,signer:i}):a[o].role===gill.AccountRole.READONLY||a[o].role===gill.AccountRole.READONLY_SIGNER?a[o]={address:i.address,role:gill.AccountRole.READONLY_SIGNER,signer:i}:(a[o].role===gill.AccountRole.WRITABLE||a[o].role===gill.AccountRole.WRITABLE_SIGNER)&&(a[o]={address:i.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:i});}return {accountMetas:a,addressLookupTableAccounts:c,transactionMessage:t}}var yt=33,Tt=64,ro=14,dM=2,uM=gill.address("Secp256r1SigVerify1111111111111111111111111");function AM(){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 _A(){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 i=0;i<r;i++)t.push(c.decode(e,n)),n+=ro;let a=[];for(let i=0;i<r;i++){let o=gill.fixDecoderSize(gill.getBytesDecoder(),yt).decode(e,n);n+=yt;let u=gill.fixDecoderSize(gill.getBytesDecoder(),Tt).decode(e,n);n+=Tt;let d=t[i].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),d).decode(e,n);n+=d,a.push({publicKey:o,signature:u,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function vA(){return gill.createEncoder({getSizeFromValue:e=>{let n=ro*e.offsets.length,r=e.payload.reduce((s,t)=>s+yt+Tt+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=AM();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=gill.fixEncoderSize(gill.getBytesEncoder(),yt).write(t.publicKey,n,r),r=gill.fixEncoderSize(gill.getBytesEncoder(),Tt).write(t.signature,n,r),r=gill.getBytesEncoder().write(t.message,n,r);return r}})}function b6(){return gill.combineCodec(vA(),_A())}function V(e,n){let r=e.length,s=dM+r*ro,t=[];for(let o=0;o<r;o++){let{message:u}=e[o],d=s,g=d+yt,p=g+Tt;t.push({publicKeyOffset:d,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:u.length,messageInstructionIndex:65535}),s+=yt+Tt+u.length;}let c=n?.programAddress??uM,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:vA().encode(a)}}function _6(e){return {programAddress:e.programAddress,accounts:{},data:_A().decode(e.data)}}async function UA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let u=await ve(e),{accountMetas:d,addressLookupTableAccounts:g}=await Kr({transactionMessageBytes:r,walletAddress:u,additionalSigners:a,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(V(c)),p.push(o?Pu({transactionBuffer:n,payer:s.address,remainingAccounts:d,settingsKey:e}):Su({transactionBuffer:n,payer:s.address,settings:e})),i&&p.push(IA({payer:s,tipAmount:i})),{instructions:p,addressLookupTableAccounts:g}}async function WA({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:u}){let d=Se(s),g=await ue(e),p=await ve(g),[{accountMetas:l,addressLookupTableAccounts:S,transactionMessage:b},{settingsMutArgs:x,proof:C,packedAccounts:_}]=await Promise.all([Kr({transactionMessageBytes:r,walletAddress:p,additionalSigners:d.filter(ee=>!(ee instanceof P)),addressesByLookupTableAddress:c}),Me(i,e,n,o,u)]);_.addPreAccounts(l);let I=d.filter(ee=>ee instanceof P),{secp256r1VerifyArgs:W}=mM(I,a,_),{remainingAccounts:G,systemOffset:q}=_.toAccountMetas();return {instructions:yM({secp256r1VerifyInput:a,transactionMessage:b,accountMetas:l,compressed:i,payer:t,settingsMutArgs:x,proof:C,systemOffset:q,secp256r1VerifyArgs:W,settings:g,remainingAccounts:G}),addressLookupTableAccounts:S}}function mM(e,n,r){let s=[];for(let t of e){let c=n.length,{domainConfig:a,verifyArgs:i,signature:o,publicKey:u,message:d}=J(t,c);d&&o&&u&&n.push({message:d,signature:o,publicKey:u}),a&&(r.addPreAccounts([{address:a,role:gill.AccountRole.READONLY}]),i.__option==="Some"&&s.push({domainConfigKey:a,verifyArgs:i.value}));}return {secp256r1VerifyArgs:s}}function yM({secp256r1VerifyInput:e,transactionMessage:n,accountMetas:r,compressed:s,payer:t,settingsMutArgs:c,proof:a,systemOffset:i,secp256r1VerifyArgs:o,settings:u,remainingAccounts:d}){let g=[];e.length>0&&g.push(V(e));let p=TM(n,r);if(s){if(!t||!c)throw new Error("Payer not found or proof args is missing.");let l=v(a,i);g.push(Bu({secp256r1VerifyArgs:o,transactionMessage:p,settingsMutArgs:c,compressedProofArgs:l,payer:t,remainingAccounts:d}));}else g.push(vu({secp256r1VerifyArgs:o,settings:u,transactionMessage:p,remainingAccounts:d}));return g}function TM(e,n){if(e.version==="legacy")throw new Error("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:new Uint8Array(r.data??[])})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(s=>s.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function eV({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=Se(s),u=await ue(e),d=await ve(u),[{packedAccounts:g,proof:p,settingsMutArgs:l},{value:S}]=await Promise.all([Me(i,e,n,false,t),rt(d,t)]);if((S?.lamports??0)<BigInt(c))throw new Error("Insufficient balance");let b=[],x=[];for(let W of o)if(W instanceof P){let G=b.length,{domainConfig:q,verifyArgs:ie,signature:ee,publicKey:le,message:Ae}=J(W,G);Ae&&ee&&le&&b.push({message:Ae,signature:ee,publicKey:le}),q&&(g.addPreAccounts([{address:q,role:gill.AccountRole.READONLY}]),ie.__option==="Some"&&x.push({domainConfigKey:q,verifyArgs:ie.value}));}else g.addPreAccounts([{address:W.address,role:gill.AccountRole.READONLY_SIGNER,signer:W}]);let{remainingAccounts:C,systemOffset:_}=g.toAccountMetas(),I=[];if(b.length>0&&I.push(V(b)),i){if(!a||!l)throw new Error("Payer not found or proof args is missing.");let W=v(p,_);I.push(Ji({amount:c,settingsMutArgs:l,compressedProofArgs:W,payer:a,secp256r1VerifyArgs:x,source:d,destination:r,remainingAccounts:C}));}else I.push(Hi({amount:c,secp256r1VerifyArgs:x,source:d,destination:r,settings:u,remainingAccounts:C}));return I}var CM=gill.address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),EM=gill.address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),co=gill.address(stateless_js.CTOKEN_PROGRAM_ID.toString());async function pV({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,splInterfacePdaArgs:u={index:0,restricted:false},compressed:d=false}){let g=Se(t),p=await ue(e),l=await ve(p),S=U=>gill.getProgramDerivedAddress({seeds:[gill.getAddressEncoder().encode(U),gill.getAddressEncoder().encode(co),gill.getAddressEncoder().encode(s)],programAddress:co}),b=()=>{let U=[gill.getUtf8Encoder().encode("pool"),gill.getAddressEncoder().encode(s)];return u.restricted&&U.push(gill.getUtf8Encoder().encode("restricted")),u.index>0&&U.push(gill.getU8Encoder().encode(u.index)),U},[x,[C],_,[I],[W]]=await Promise.all([programs.getAssociatedTokenAccountAddress(s,l,o),S(l),programs.getAssociatedTokenAccountAddress(s,r,o),S(r),gill.getProgramDerivedAddress({seeds:b(),programAddress:co})]),[G,q,ie,ee]=await Promise.all([rt(_,c),rt(x,c),rt(C,c),MM(d,e,n,c)]),le=!!G.value,Ae=!!q.value,lt=!!ie.value,ft=Ae?programs.getTokenDecoder().decode(gill.getBase64Encoder().encode(q.value.data[0])).amount:BigInt(0),ct=BigInt(lt?hM(new Uint8Array(gill.getBase64Encoder().encode(ie.value.data[0])))?.amount??0:0),ir=le?_:void 0,Zr=le?void 0:I,St=Ae&&(ft+ct<BigInt(a)||ct>BigInt(0)||!le)||!Ae&&le,T=!le,[me,Ao]=await Promise.all([PM(l,s,ft,ct,BigInt(a),d?3:4),DM(St,W,c)]),Y=me.reduce((U,re)=>U+re.parsed.amount.toNumber(),0);if(ft+ct+BigInt(Y)<BigInt(a))throw new Error("Insufficient balance");let at=null,Ue=null,We=new B;if(Ao&&We.addPreAccounts([{address:s,role:gill.AccountRole.WRITABLE}]),ee||me.length){await We.addSystemAccounts();let U=[];if(me.length&&U.push(...me.map(re=>({hash:re.compressedAccount.hash,tree:re.compressedAccount.treeInfo.tree,queue:re.compressedAccount.treeInfo.queue,data:re.compressedAccount.data,address:re.compressedAccount.address}))),ee&&U.push(ee),Ue=await w(U,[]),ee){let re=me.length;at=de(We,Ue.treeInfos.slice(re),Ue.leafIndices.slice(re),Ue.rootIndices.slice(re),Ue.proveByIndices.slice(re),U.slice(re),Z())[0];}}let $A=me.length&&Ue?gill.some(me.map((U,re)=>({isFrozen:U.parsed.state===programs.AccountState.Frozen,hasDelegate:U.parsed.delegate!=null,amount:U.parsed.amount.toNumber(),merkleContext:{leafIndex:U.compressedAccount.leafIndex,merkleTreePubkeyIndex:We.insertOrGet(U.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:We.insertOrGet(U.compressedAccount.treeInfo.queue.toString()),proveByIndex:U.compressedAccount.proveByIndex},rootIndex:Ue.rootIndices[re],version:nA(U.compressedAccount.data?.discriminator),tlv:U.parsed.tlv?gill.some(gill.getArrayDecoder(Lt()).decode(U.parsed.tlv)):gill.none()}))):gill.none(),dr=[],go=[];for(let U of g)if(U instanceof P){let re=dr.length,{domainConfig:Xr,verifyArgs:mo,signature:yo,publicKey:To,message:lo}=J(U,re);lo&&yo&&To&&dr.push({message:lo,signature:yo,publicKey:To}),Xr&&(We.addPreAccounts([{address:Xr,role:gill.AccountRole.READONLY}]),mo.__option==="Some"&&go.push({domainConfigKey:Xr,verifyArgs:mo.value}));}else We.addPreAccounts([{address:U.address,role:gill.AccountRole.READONLY_SIGNER,signer:U}]);let{remainingAccounts:eg,systemOffset:tg}=We.toAccountMetas(),ur=[];dr.length>0&&ur.push(V(dr));let rg=v(Ue,tg),ng=St?W:void 0,sg=T?EM:void 0,og=St?gill.some(u):gill.none(),po={amount:a,secp256r1VerifyArgs:go,source:l,destination:r,sourceCtokenTokenAccount:C,sourceSplTokenAccount:x,destinationCtokenTokenAccount:Zr,destinationSplTokenAccount:ir,mint:s,tokenProgram:o,remainingAccounts:eg,payer:i,sourceCompressedTokenAccounts:$A,compressedProofArgs:rg,compressibleConfig:CM,splInterfacePda:ng,rentSponsor:sg,splInterfacePdaArgs:og};if(d){if(!at)throw new Error("Payer not found or proof args is missing.");ur.push(ad({...po,settingsMutArgs:at}));}else ur.push($i({...po,settings:p}));return ur}async function DM(e,n,r){if(!e)return false;let{value:s}=await rt(n,r);return !s}async function PM(e,n,r,s,t,c){let a=t-r-s;if(a<=0)return [];let o=(await tt().getCompressedTokenAccountsByOwner(new web3_js.PublicKey(e),{mint:new web3_js.PublicKey(n)})).items.filter(g=>!!g.compressedAccount.data?.data.length&&g.compressedAccount.owner.equals(stateless_js.CTOKEN_PROGRAM_ID)&&!g.parsed.amount.isZero()).sort((g,p)=>p.parsed.amount.cmp(g.parsed.amount));if(o.length===0)return [];let u=BigInt(0),d=[];for(let g of o){if(d.length>=c||u>=a)break;u+=BigInt(g.parsed.amount.toNumber()),d.push(g);}if(u<a)throw d.length>=c?new Error("Transaction size limit exceeded. Consider multiple transfers to transfer full balance."):new Error("Insufficient balance.");return d}async function MM(e,n,r,s){if(!e)return null;let{address:t}=await ae(n,r);return (await Te([{address:t,type:"Settings"}],s))[0]}function hM(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 DV({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:a,proof:i,settingsMutArgs:o}=r,u=Se(e),d=u.filter(_=>!(_ instanceof P));a.addPreAccounts(d.map(_=>({address:_.address,role:gill.AccountRole.READONLY_SIGNER,signer:_})));let g=u.filter(_=>_ instanceof P),p=[],l=[];for(let _ of g){let I=l.length,{domainConfig:W,verifyArgs:G,signature:q,publicKey:ie,message:ee}=J(_,I);ee&&q&&ie&&l.push({message:ee,signature:q,publicKey:ie}),W&&(a.addPreAccounts([{address:W,role:gill.AccountRole.READONLY}]),G.__option==="Some"&&p.push({domainConfigKey:W,verifyArgs:G.value}));}let{remainingAccounts:S,systemOffset:b}=a.toAccountMetas(),x=v(i,b),C=[];if(l.length>0&&C.push(V(l)),c){if(!o)throw new Error("Payer not found or proof args is missing.");C.push(Ca({configActions:t,payer:n,compressedProofArgs:x,settingsMutArgs:o,remainingAccounts:S,secp256r1VerifyArgs:p}));}else C.push(await ma({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:S,secp256r1VerifyArgs:p}));return C}async function vV({createUserArgs:e,payer:n}){let r=new B;await r.addSystemAccounts(),r.addPreAccounts(e.map(d=>({address:d.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:d.member})));let s=await he(),t=await Promise.all(e.map(async d=>{let{address:g,addressTree:p}=await N(d.member.address,s);return {address:g,tree:p,queue:p,type:"User"}})),c=await w([],t),a=await ge(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),u=v(c,o);return await Ya({compressedProofArgs:u,payer:n,createUserArgs:e.map((d,g)=>({member:d.member.address,role:d.role,userCreationArgs:a[g],transactionManagerUrl:d.role===2?d.transactionManagerUrl:null})),remainingAccounts:i})}async function NV({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let a=[],i=[];i.push(...await Te([{address:(await N(r.address,s)).address,type:"User"}],t));let o=await he(),{address:u,addressTree:d}=await ae(e,o);a.push({address:u,queue:d,tree:d,type:"Settings"});let g=i.length,p=await w(i,a),l=de(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),i.filter(I=>I.type==="User"),$())[0],b=(await ge(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),a)).find(I=>I.type==="Settings")??null,{remainingAccounts:x,systemOffset:C}=c.toAccountMetas(),_=v(p,C);if(!b)throw new Error("Settings creation args is missing.");return await ha({settingsIndex:e,payer:n,initialMember:r,userReadonlyArgs:l,compressedProofArgs:_,settingsCreation:b,remainingAccounts:x})}async function JV({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:a,settingsMutArgs:i}=await Me(true,e,n,false,t);if(!i)throw new Error("Proof args is missing");let o=Se(s),u=o.filter(C=>C instanceof P),d=[],g=[];for(let C of u){let _=d.length,{domainConfig:I,verifyArgs:W,signature:G,publicKey:q,message:ie}=J(C,_);ie&&G&&q&&d.push({message:ie,signature:G,publicKey:q}),I&&(c.addPreAccounts([{address:I,role:gill.AccountRole.READONLY}]),W.__option==="Some"&&g.push({domainConfigKey:I,verifyArgs:W.value}));}c.addPreAccounts(o.filter(C=>"address"in C).map(C=>({address:C.address,role:gill.AccountRole.READONLY_SIGNER,signer:C})));let{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),S=v(a,l),b=[];d.length>0&&b.push(V(d));let x=await ue(e);return b.push(ti({settings:x,payer:r,settingsMutArgs:i,compressedProofArgs:S,secp256r1VerifyArgs:g,remainingAccounts:p})),b}async function e8({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new B;await a.addSystemAccounts();let i=await he(),{address:o,addressTree:u}=await N(r.address,i),d=[{address:o,tree:u,queue:u,type:"User"}],g=await w([],d),p=(await ge(a,g.treeInfos,g.roots,g.rootIndices,d))[0],l=a.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:v(g,l.systemOffset),authorityCreationArgs:p};}return pi({domainConfig:n,authority:e,newOrigins:s?gill.some(s):gill.none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function c8({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new B;await s.addSystemAccounts();let t=await Te([{address:(await N(e.address,n)).address,type:"User"}]),c=await w(t,[]),a=de(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,$())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),u=v(c,o);return Si({authority:e,transactionManagerUrl:r,compressedProofArgs:u,userMutArgs:a,remainingAccounts:i})}async function T8({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:a,message:i,signature:o,publicKey:u}=J(n),d=[];i&&o&&u&&d.push({message:i,signature:o,publicKey:u});let g=await Vr(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 l,S=null,b,x=null;g.delegatedTo.__option==="Some"&&((await qs(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):l=await ue(g.delegatedTo.value.index)),s&&((await qs(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):b=await ue(s.index));let C=new B;await C.addSystemAccounts();let _=await Te(p,t),I=await w(_,[]),W=de(C,I.treeInfos.slice(0,1),I.leafIndices.slice(0,1),I.rootIndices.slice(0,1),I.proveByIndices.slice(0,1),_.slice(0,1),$())[0],G=S?gill.some(de(C,I.treeInfos.slice(S.start,S.end),I.leafIndices.slice(S.start,S.end),I.rootIndices.slice(S.start,S.end),I.proveByIndices.slice(S.start,S.end),_.slice(S.start,S.end),Z())[0]):gill.none(),q=x?gill.some(de(C,I.treeInfos.slice(x.start,x.end),I.leafIndices.slice(x.start,x.end),I.rootIndices.slice(x.start,x.end),I.proveByIndices.slice(x.start,x.end),_.slice(x.start,x.end),Z())[0]):gill.none(),{remainingAccounts:ie,systemOffset:ee}=C.toAccountMetas(),le=v(I,ee),Ae=[];return d.length>0&&Ae.push(V(d)),Ae.push(Pi({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:s?gill.some(s):gill.none(),feePayer:e,signer:n instanceof P?void 0:n,oldSettings:l,oldSettingsMutArgs:G,newSettings:b,newSettingsMutArgs:q,compressedProofArgs:le,userMutArgs:W,remainingAccounts:ie})),Ae}async function U8({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await Yc(ce(),s),o=i.data.multiWalletSettings,{packedAccounts:u,proof:d,settingsMutArgs:g}=await Me(c,e,n,false,a),{remainingAccounts:p,systemOffset:l}=u.toAccountMetas(),{domainConfig:S,verifyArgs:b,message:x,signature:C,publicKey:_}=J(r),I=[];if(x&&C&&_&&I.push(V([{message:x,signature:C,publicKey:_}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let W=v(d,l);I.push(Sd({transactionBuffer:s,domainConfig:S,closer:r instanceof P?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:b,settingsMutArgs:g,payer:t,compressedProofArgs:W,remainingAccounts:p}));}else I.push(pd({transactionBuffer:s,domainConfig:S,closer:r instanceof P?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:b,remainingAccounts:[]}));return I}function GA({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:u,expectedSecp256r1Signers:d}){let{domainConfig:g,verifyArgs:p,message:l,signature:S,publicKey:b}=J(n),x=[];if(l&&S&&b&&x.push(V([{message:l,signature:S,publicKey:b}])),u){let{settingsReadonlyArgs:C,compressedProofArgs:_,remainingAccounts:I}=u;x.push(vd({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:d},settingsReadonlyArgs:C,compressedProofArgs:_,remainingAccounts:I}));}else x.push(Pd({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:d},remainingAccounts:[]}));return x}function zA({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=J(e),u=[];return i&&a&&o&&u.push(V([{message:i,signature:a,publicKey:o}])),s?u.push(Gd({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})):u.push(Bd({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof P?void 0:e,remainingAccounts:[]})),u}function KA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?tu({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Yd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function jA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=J(n),u=[];return o&&a&&i&&u.push(V([{message:o,signature:a,publicKey:i}])),s?u.push(pu({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})):u.push(au({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof P?void 0:n,remainingAccounts:[]})),u}async function IH({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await vM(r),a=new B,i=null,o=null,u=[];if(c.length||t){let g=await UM({packedAccounts:a,userAccounts:c,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:s});i=g.proof,o=g.settingsMutArgs??null,u=g.userMutArgs??[];}return {configActions:await WM({configActionsArgs:r,userMutArgs:u,index:e}),index:e,proof:i,settingsMutArgs:o,packedAccounts:a,compressed:t}}async function vM(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 UM({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let a=[];if(r){let l=(await ae(s,t)).address;a.push({address:l,type:"Settings"});}n.length&&a.push(...n);let i=a.length?await Te(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await w(i,[]),u=[],d=[];for(let l of i)l.type==="Settings"?u.push(l):l.type==="User"&&d.push(l);let g,p=[];if(r&&o&&(g=de(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),u,Z())[0]),d.length&&o){let l=r?1:0;p=de(e,o.treeInfos.slice(l),o.leafIndices.slice(l),o.rootIndices.slice(l),o.proveByIndices.slice(l),d,$());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function WM({index:e,configActionsArgs:n,userMutArgs:r}){let s=[];for(let t of n)switch(t.type){case "AddMembers":{let c=[];for(let a of t.members){let i=await N(a.member,a.userAddressTreeIndex).then(o=>r.find(u=>utils_js.equalBytes(new Uint8Array(u.accountMeta.address),new Uint8Array(gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(o.address))))));if(!i)throw new Error("Unable to find user account");c.push(OM({permissionArgs:a.permissions,userMutArgs:i,pubkey:a.member}));}s.push({__kind:t.type,fields:[c]});break}case "RemoveMembers":{let c=await Promise.all(t.members.map(a=>N(a.member,a.userAddressTreeIndex).then(i=>{let o=r.find(u=>utils_js.equalBytes(new Uint8Array(u.accountMeta.address),new Uint8Array(gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(i.address)))));if(!o)throw new Error("Unable to find user account");return LM({pubkey:a.member,userMutArgs:o,index:e})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(a=>kM({permissionArgs:a.permissions,pubkey:a.member}));s.push({__kind:t.type,fields:[c]});break}default:s.push({__kind:t.type,fields:[t.threshold]});}return s}function kM({pubkey:e,permissionArgs:n}){return {memberKey:mt(e),permissions:ZA(n)}}function LM({pubkey:e,userMutArgs:n,index:r}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");let s=n.data.delegatedTo.__option==="Some"?Number(n.data.delegatedTo.value.index.toString())===r:false;return {memberKey:mt(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function OM({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===1)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===2&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:mt(e),permissions:ZA(n),userReadonlyArgs:r}}function ZA(e){let n=[];return e.initiate&&n.push(_e.InitiateTransaction),e.vote&&n.push(_e.VoteTransaction),e.execute&&n.push(_e.ExecuteTransaction),Be.fromPermissions(n)}async function bH({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:u=false,additionalVoters:d=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:l}){let S=await ue(n),b=Math.floor(Math.random()*255),x=await uA(S,t instanceof P?t:t.address,b),C=[],_=[];for(let Y=0;Y<s.length;Y+=p){let at=s.subarray(Y,Y+p);C.push(at),_.push(sha2_js.sha256(at));}let I=sha2_js.sha256(new Uint8Array(s)),{settingsReadonlyArgs:W,settingsMutArgs:G,proof:q,packedAccounts:ie}=await Me(u,n,r,false,l),{remainingAccounts:ee,systemOffset:le}=ie.toAccountMetas(),Ae=q&&W&&G?{settingsReadonlyArgs:W,settingsMutArgs:G,compressedProofArgs:v(q,le),remainingAccounts:ee,payer:e}:null,lt=Se([t,...c?[c]:[],...d]).filter(Y=>Y instanceof P).map(Y=>({memberKey:mt(Y),messageHash:Xs(Y.authResponse)})),ft=GA({finalBufferHash:I,finalBufferSize:s.length,bufferIndex:b,payer:e,transactionBufferAddress:x,settings:S,creator:t,preauthorizeExecution:!c,bufferExtendHashes:_,compressedArgs:Ae,expectedSecp256r1Signers:lt}),ct=C.map(Y=>KA({transactionMessageBytes:Y,transactionBufferAddress:x,settings:S,compressed:u})),ir=d.map(Y=>jA({voter:Y,transactionBufferAddress:x,settings:S,compressedArgs:Ae})),Zr=zA({compressedArgs:Ae,settings:S,executor:c,transactionBufferAddress:x}),{instructions:St,addressLookupTableAccounts:T}=await UA({compressed:u,settings:S,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),me=Y=>({payer:e,instructions:Y,addressesByLookupTableAddress:T});return [me(ft),...ct.map(Y=>me([Y])),...ir.length?[me(ir.flat())]:[],me(Zr),me(St)]}var qr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=a=>{let i=s.get(a);return i===void 0&&(i={isSigner:false,isWritable:false,isInvoked:false},s.set(a,i)),i},c=t(r);c.isSigner=true,c.isWritable=true;for(let a of n){t(a.programAddress).isInvoked=false;for(let i of a.accounts??[]){let o=t(i.address);o.isSigner||=i.role===gill.AccountRole.READONLY_SIGNER||i.role===gill.AccountRole.WRITABLE_SIGNER,o.isWritable||=i.role===gill.AccountRole.WRITABLE||i.role===gill.AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),a={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let i=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [a,i]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&a.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&!a.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,a]of this.keyMetaMap.entries())if(r(a)){let i=c,o=n.findIndex(u=>u===i);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(i),this.keyMetaMap.delete(c);}}return [s,t]}};var Yr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,a)=>{s.set(c,a);});let t=c=>{let a=s.get(c);if(a===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return a};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(a=>t(a.address))??[],data:c.data}))}};function QA({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=qr.compile(r,e),c=new Array,a={writable:[],readonly:[]},i=Object.entries(s??{});for(let p of i){let l=t.extractTableLookup(p);if(l!==void 0){let{addressTableLookup:S,drainedKeys:b}=l;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:gill.address(S.lookupTableAddress)}),a.writable.push(...b.writable),a.readonly.push(...b.readonly);}}let[o,u]=t.getMessageComponents(),g=new Yr(u,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:u,addressTableLookups:c}}function FH({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=QA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return Ku(s)}async function JH({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:u=false}){let{instructions:d,addressLookupTableAccounts:g}=await WA({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:i});return {payer:e,instructions:d,addressesByLookupTableAddress:g}}
2
- exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=oa;exports.AuthenticationContextSchema=Hu;exports.BACKOFF_MAX_DELAY_MS=pr;exports.BUNDLE_POLL_DELAY_MS=xo;exports.BUNDLE_POLL_MAX_RETRIES=So;exports.BaseResponseSchema=Fu;exports.BundleError=ye;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=Sa;exports.CHANGE_CONFIG_DISCRIMINATOR=ga;exports.COMPUTE_UNIT_MULTIPLIER=fo;exports.CREATE_COMPRESSED_WALLET_DISCRIMINATOR=Pa;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=La;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=wa;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=Ga;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=Ja;exports.CompleteMessageRequestSchema=ON;exports.CompleteTransactionRequestSchema=BN;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=Qa;exports.DEFAULT_JITO_BLOCK_ENGINE_URL=Io;exports.DEFAULT_JITO_TIPS_URL=Co;exports.DEFAULT_JITO_TIP_PRIORITY=Eo;exports.DEFAULT_NETWORK_RETRY_DELAY_MS=Le;exports.DEFAULT_NETWORK_RETRY_MAX_RETRIES=ke;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=si;exports.DOMAIN_CONFIG_DISCRIMINATOR=Ro;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=Ai;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=Ti;exports.EDIT_USER_DELEGATE_DISCRIMINATOR=Ci;exports.EXPONENTIAL_BACKOFF_BASE=gr;exports.GLOBAL_COUNTER_DISCRIMINATOR=ko;exports.HTTP_STATUS_BAD_REQUEST=Po;exports.HTTP_STATUS_INTERNAL_SERVER_ERROR=en;exports.HTTP_STATUS_TOO_MANY_REQUESTS=Mo;exports.JITO_TIP_ACCOUNTS=$r;exports.KeyType=tr;exports.MAX_TRANSACTION_BUFFER_INDEX=Do;exports.MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR=Ri;exports.MIGRATE_COMPRESSED_USERS_DISCRIMINATOR=ki;exports.MIN_COMPUTE_UNITS=Ar;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=KE;exports.MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH=CE;exports.MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED=LD;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=WD;exports.MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE=GD;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=PE;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=DE;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=LE;exports.MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS=fD;exports.MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH=WE;exports.MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH=EE;exports.MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH=vE;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=eD;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=tD;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=rD;exports.MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED=lD;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=qE;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=jE;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=JE;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=VE;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX=UD;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=yD;exports.MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG=kE;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=FE;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=$E;exports.MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT=SD;exports.MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS=YE;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=wE;exports.MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG=RE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION=TE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY=SE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=yE;exports.MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS=fE;exports.MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER=uD;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=iD;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=BE;exports.MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE=bD;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG=UE;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION=_E;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=NE;exports.MULTI_WALLET_ERROR__INVALID_USER_ROLE=HE;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=xE;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=cD;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=GE;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=ND;exports.MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR=hD;exports.MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS=ID;exports.MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS=zE;exports.MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY=HD;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE=VD;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA=TD;exports.MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT=wD;exports.MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA=MD;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=aD;exports.MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS=kD;exports.MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES=FD;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=XE;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=hE;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=bE;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=mD;exports.MULTI_WALLET_ERROR__PAYER_MISMATCH=DD;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=ME;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=oD;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=IE;exports.MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH=ED;exports.MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS=lE;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=dD;exports.MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH=_D;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=OE;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=nD;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=sD;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=QE;exports.MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY=OD;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=ZE;exports.MULTI_WALLET_PROGRAM_ADDRESS=A;exports.MultiWalletAccount=gE;exports.MultiWalletInstruction=pE;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=zi;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=wi;exports.NetworkError=De;exports.NotFoundError=ne;exports.NotInitializedError=Oe;exports.Permission=_e;exports.PermissionError=yr;exports.Permissions=Be;exports.RetryExhaustedError=mr;exports.RevibaseError=Ee;exports.SETTINGS_DISCRIMINATOR=wc;exports.Secp256r1Key=Ne;exports.SignedSecp256r1Key=P;exports.StartMessageRequestSchema=kN;exports.StartTransactionRequestSchema=LN;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=od;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=Xi;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=Td;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=ud;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=Rd;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=Cd;exports.TRANSACTION_BUFFER_DISCRIMINATOR=jc;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=Vd;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=kd;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=Qd;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=jd;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=uu;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=su;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=Cu;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=Tu;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=ku;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=Ru;exports.TRANSACTION_SIZE_LIMIT=Qr;exports.TransactionActionTypeSchema=wu;exports.TransactionDetailsSchema=zD;exports.TransactionError=ho;exports.TransactionPayloadSchema=WN;exports.TransactionPayloadWithBase64MessageBytesSchema=Vu;exports.UserRole=it;exports.ValidationError=z;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=Qc;exports.addWhitelistedAddressTrees=hN;exports.base64URLStringToBuffer=Ve;exports.bufferToBase64URLString=x2;exports.changeConfig=DV;exports.closeTransactionBuffer=U8;exports.configAction=jh;exports.convertMemberKeyToString=DA;exports.convertPubkeyCompressedToCose=g2;exports.convertPubkeyCoseToCompressed=A2;exports.createClientAuthorizationCompleteRequestChallenge=l2;exports.createClientAuthorizationStartRequestChallenge=T2;exports.createDomainConfig=O5;exports.createDomainUserAccounts=j5;exports.createGlobalCounter=Z5;exports.createMessageChallenge=f2;exports.createTransactionBuffer=GA;exports.createTransactionChallenge=S2;exports.createTransactionManagerSigner=QP;exports.createUserAccounts=vV;exports.createWallet=NV;exports.decodeDomainConfig=_o;exports.decodeGlobalCounter=Oo;exports.decodeSettings=Hc;exports.decodeTransactionBuffer=qc;exports.decodeWhitelistedAddressTree=ea;exports.decompressSettingsAccount=JV;exports.deserializeConfigActions=x5;exports.disableDomainConfig=e6;exports.editDomainConfig=e8;exports.editTransactionManagerUrl=c8;exports.editUserDelegate=T8;exports.executeTransaction=UA;exports.executeTransactionBuffer=zA;exports.executeTransactionSync=WA;exports.extendTransactionBuffer=KA;exports.extensionStruct=uR;exports.fetchAllDomainConfig=GM;exports.fetchAllGlobalCounter=ZM;exports.fetchAllMaybeDomainConfig=Sg;exports.fetchAllMaybeGlobalCounter=Lg;exports.fetchAllMaybeSettings=gl;exports.fetchAllMaybeTransactionBuffer=Ul;exports.fetchAllMaybeWhitelistedAddressTree=Ql;exports.fetchAllSettings=Pv;exports.fetchAllTransactionBuffer=vv;exports.fetchAllWhitelistedAddressTree=Ov;exports.fetchDomainConfig=vo;exports.fetchGlobalCounter=YM;exports.fetchMaybeDomainConfig=fg;exports.fetchMaybeGlobalCounter=kg;exports.fetchMaybeSettings=ms;exports.fetchMaybeSettingsAccountData=iP;exports.fetchMaybeTransactionBuffer=vl;exports.fetchMaybeUserAccountData=aP;exports.fetchMaybeWhitelistedAddressTree=Xl;exports.fetchSettings=Dv;exports.fetchSettingsAccountData=qs;exports.fetchTransactionBuffer=Yc;exports.fetchUserAccountData=Vr;exports.fetchWhitelistedAddressTree=ta;exports.getAddMemberArgsCodec=sh;exports.getAddMemberArgsDecoder=sn;exports.getAddMemberArgsEncoder=nn;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=$v;exports.getAddWhitelistedAddressTreesInstruction=tU;exports.getAddWhitelistedAddressTreesInstructionAsync=aa;exports.getAddWhitelistedAddressTreesInstructionDataCodec=eU;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=ca;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=Cs;exports.getAdditionalMetadataCodec=eh;exports.getAdditionalMetadataDecoder=rn;exports.getAdditionalMetadataEncoder=tn;exports.getChangeConfigCompressedDiscriminatorBytes=SU;exports.getChangeConfigCompressedInstruction=Ca;exports.getChangeConfigCompressedInstructionDataCodec=xU;exports.getChangeConfigCompressedInstructionDataDecoder=Ia;exports.getChangeConfigCompressedInstructionDataEncoder=xa;exports.getChangeConfigDiscriminatorBytes=dU;exports.getChangeConfigInstruction=AU;exports.getChangeConfigInstructionAsync=ma;exports.getChangeConfigInstructionDataCodec=uU;exports.getChangeConfigInstructionDataDecoder=pa;exports.getChangeConfigInstructionDataEncoder=Ds;exports.getClientAndDeviceHash=Zs;exports.getCompiledInstructionCodec=ah;exports.getCompiledInstructionDecoder=cn;exports.getCompiledInstructionEncoder=on;exports.getCompressedAccountMetaCodec=Ah;exports.getCompressedAccountMetaDecoder=Et;exports.getCompressedAccountMetaEncoder=Ct;exports.getCompressedAccountMetaReadOnlyCodec=yh;exports.getCompressedAccountMetaReadOnlyDecoder=ht;exports.getCompressedAccountMetaReadOnlyEncoder=Mt;exports.getCompressedOnlyExtensionCodec=fh;exports.getCompressedOnlyExtensionDecoder=dn;exports.getCompressedOnlyExtensionEncoder=an;exports.getCompressedProofCodec=Ih;exports.getCompressedProofDecoder=yn;exports.getCompressedProofEncoder=mn;exports.getCompressedSettingsAddressFromIndex=ae;exports.getCompressedSettingsCodec=Ph;exports.getCompressedSettingsDataCodec=bh;exports.getCompressedSettingsDataDecoder=_t;exports.getCompressedSettingsDataEncoder=bt;exports.getCompressedSettingsDecoder=Z;exports.getCompressedSettingsEncoder=Rt;exports.getCompressedTokenArgsCodec=Wh;exports.getCompressedTokenArgsDecoder=kt;exports.getCompressedTokenArgsEncoder=Wt;exports.getCompressibleExtensionCodec=Bh;exports.getCompressibleExtensionDecoder=Cn;exports.getCompressibleExtensionEncoder=In;exports.getCompressionInfoCodec=Hh;exports.getCompressionInfoDecoder=Dn;exports.getCompressionInfoEncoder=En;exports.getComputeBudgetEstimate=Qu;exports.getConfigActionCodec=Kh;exports.getConfigActionDecoder=ze;exports.getConfigActionEncoder=Ge;exports.getCreateCompressedWalletDiscriminatorBytes=RU;exports.getCreateCompressedWalletInstruction=_U;exports.getCreateCompressedWalletInstructionAsync=ha;exports.getCreateCompressedWalletInstructionDataCodec=bU;exports.getCreateCompressedWalletInstructionDataDecoder=Ma;exports.getCreateCompressedWalletInstructionDataEncoder=Ps;exports.getCreateDomainConfigDiscriminatorBytes=NU;exports.getCreateDomainConfigInstruction=VU;exports.getCreateDomainConfigInstructionAsync=Ba;exports.getCreateDomainConfigInstructionDataCodec=wU;exports.getCreateDomainConfigInstructionDataDecoder=Oa;exports.getCreateDomainConfigInstructionDataEncoder=hs;exports.getCreateDomainUserAccountDiscriminatorBytes=qU;exports.getCreateDomainUserAccountInstruction=ZU;exports.getCreateDomainUserAccountInstructionAsync=Ha;exports.getCreateDomainUserAccountInstructionDataCodec=YU;exports.getCreateDomainUserAccountInstructionDataDecoder=Va;exports.getCreateDomainUserAccountInstructionDataEncoder=bs;exports.getCreateGlobalCounterDiscriminatorBytes=nW;exports.getCreateGlobalCounterInstruction=oW;exports.getCreateGlobalCounterInstructionAsync=Ka;exports.getCreateGlobalCounterInstructionDataCodec=sW;exports.getCreateGlobalCounterInstructionDataDecoder=za;exports.getCreateGlobalCounterInstructionDataEncoder=vs;exports.getCreateUserAccountArgsCodec=Xh;exports.getCreateUserAccountArgsDecoder=On;exports.getCreateUserAccountArgsEncoder=Ln;exports.getCreateUserAccountsDiscriminatorBytes=pW;exports.getCreateUserAccountsInstruction=yW;exports.getCreateUserAccountsInstructionAsync=Ya;exports.getCreateUserAccountsInstructionDataCodec=mW;exports.getCreateUserAccountsInstructionDataDecoder=qa;exports.getCreateUserAccountsInstructionDataEncoder=Ws;exports.getDecompressSettingsAccountDiscriminatorBytes=EW;exports.getDecompressSettingsAccountInstruction=ti;exports.getDecompressSettingsAccountInstructionDataCodec=DW;exports.getDecompressSettingsAccountInstructionDataDecoder=ei;exports.getDecompressSettingsAccountInstructionDataEncoder=$a;exports.getDisableDomainConfigDiscriminatorBytes=vW;exports.getDisableDomainConfigInstruction=ai;exports.getDisableDomainConfigInstructionDataCodec=UW;exports.getDisableDomainConfigInstructionDataDecoder=ci;exports.getDisableDomainConfigInstructionDataEncoder=oi;exports.getDomainConfigAddress=gt;exports.getDomainConfigCodec=FM;exports.getDomainConfigDecoder=bo;exports.getDomainConfigDiscriminatorBytes=HM;exports.getDomainConfigEncoder=lg;exports.getDomainConfigSize=zM;exports.getEditDomainConfigDiscriminatorBytes=VW;exports.getEditDomainConfigInstruction=pi;exports.getEditDomainConfigInstructionAsync=FW;exports.getEditDomainConfigInstructionDataCodec=HW;exports.getEditDomainConfigInstructionDataDecoder=gi;exports.getEditDomainConfigInstructionDataEncoder=Ls;exports.getEditMemberArgsCodec=tR;exports.getEditMemberArgsDecoder=Un;exports.getEditMemberArgsEncoder=vn;exports.getEditTransactionManagerUrlDiscriminatorBytes=ZW;exports.getEditTransactionManagerUrlInstruction=Si;exports.getEditTransactionManagerUrlInstructionDataCodec=XW;exports.getEditTransactionManagerUrlInstructionDataDecoder=fi;exports.getEditTransactionManagerUrlInstructionDataEncoder=li;exports.getEditUserDelegateDiscriminatorBytes=ok;exports.getEditUserDelegateInstruction=Pi;exports.getEditUserDelegateInstructionDataCodec=ck;exports.getEditUserDelegateInstructionDataDecoder=Di;exports.getEditUserDelegateInstructionDataEncoder=Ei;exports.getExpectedSecp256r1SignersCodec=oR;exports.getExpectedSecp256r1SignersDecoder=Bt;exports.getExpectedSecp256r1SignersEncoder=Ot;exports.getExtensionStructCodec=dR;exports.getExtensionStructDecoder=Lt;exports.getExtensionStructEncoder=Tn;exports.getGlobalCounterAddress=dA;exports.getGlobalCounterCodec=qM;exports.getGlobalCounterDecoder=Lo;exports.getGlobalCounterDiscriminatorBytes=JM;exports.getGlobalCounterEncoder=Wg;exports.getGlobalCounterSize=XM;exports.getJitoTipsConfig=Ks;exports.getLightCpiSigner=$w;exports.getLightProtocolRpc=tt;exports.getLinkWalletArgsCodec=yR;exports.getLinkWalletArgsDecoder=qn;exports.getLinkWalletArgsEncoder=Jn;exports.getMemberCodec=SR;exports.getMemberDecoder=Ut;exports.getMemberEncoder=vt;exports.getMemberKeyCodec=CR;exports.getMemberKeyDecoder=oe;exports.getMemberKeyEncoder=se;exports.getMigrateCompressedSettingsDiscriminatorBytes=mk;exports.getMigrateCompressedSettingsInstruction=vi;exports.getMigrateCompressedSettingsInstructionDataCodec=yk;exports.getMigrateCompressedSettingsInstructionDataDecoder=_i;exports.getMigrateCompressedSettingsInstructionDataEncoder=bi;exports.getMigrateCompressedUsersDiscriminatorBytes=Ek;exports.getMigrateCompressedUsersInstruction=Bi;exports.getMigrateCompressedUsersInstructionDataCodec=Dk;exports.getMigrateCompressedUsersInstructionDataDecoder=Oi;exports.getMigrateCompressedUsersInstructionDataEncoder=Li;exports.getMultiWalletErrorMessage=yN;exports.getNativeTransferIntentCompressedDiscriminatorBytes=Fk;exports.getNativeTransferIntentCompressedInstruction=Ji;exports.getNativeTransferIntentCompressedInstructionDataCodec=Gk;exports.getNativeTransferIntentCompressedInstructionDataDecoder=ji;exports.getNativeTransferIntentCompressedInstructionDataEncoder=Ki;exports.getNativeTransferIntentDiscriminatorBytes=Uk;exports.getNativeTransferIntentInstruction=Hi;exports.getNativeTransferIntentInstructionAsync=kk;exports.getNativeTransferIntentInstructionDataCodec=Wk;exports.getNativeTransferIntentInstructionDataDecoder=Vi;exports.getNativeTransferIntentInstructionDataEncoder=Os;exports.getNewAuthorityArgsCodec=MR;exports.getNewAuthorityArgsDecoder=Qn;exports.getNewAuthorityArgsEncoder=Xn;exports.getOriginIndex=I2;exports.getPackedAddressTreeInfoCodec=bR;exports.getPackedAddressTreeInfoDecoder=wt;exports.getPackedAddressTreeInfoEncoder=Nt;exports.getPackedMerkleContextCodec=UR;exports.getPackedMerkleContextDecoder=fn;exports.getPackedMerkleContextEncoder=ln;exports.getPackedStateTreeInfoCodec=LR;exports.getPackedStateTreeInfoDecoder=Pt;exports.getPackedStateTreeInfoEncoder=Dt;exports.getPausableAccountExtensionCodec=NR;exports.getPausableAccountExtensionDecoder=Nn;exports.getPausableAccountExtensionEncoder=Bn;exports.getPermanentDelegateAccountExtensionCodec=HR;exports.getPermanentDelegateAccountExtensionDecoder=Vn;exports.getPermanentDelegateAccountExtensionEncoder=wn;exports.getPermissionsCodec=zR;exports.getPermissionsDecoder=Fe;exports.getPermissionsEncoder=He;exports.getProofArgsCodec=qR;exports.getProofArgsDecoder=D;exports.getProofArgsEncoder=E;exports.getRemoveMemberArgsCodec=QR;exports.getRemoveMemberArgsDecoder=kn;exports.getRemoveMemberArgsEncoder=Wn;exports.getRentConfigCodec=tb;exports.getRentConfigDecoder=Rn;exports.getRentConfigEncoder=hn;exports.getSecp256r1MessageHash=Xs;exports.getSecp256r1PubkeyCodec=sb;exports.getSecp256r1PubkeyDecoder=Vt;exports.getSecp256r1PubkeyEncoder=ns;exports.getSecp256r1SignatureOffsetsDataDecoder=gM;exports.getSecp256r1SignatureOffsetsDataEncoder=AM;exports.getSecp256r1VerifyArgsCodec=ab;exports.getSecp256r1VerifyArgsDecoder=F;exports.getSecp256r1VerifyArgsEncoder=H;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=Ab;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=Q;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=X;exports.getSecp256r1VerifyInstruction=V;exports.getSecp256r1VerifyInstructionDataCodec=b6;exports.getSecp256r1VerifyInstructionDataDecoder=_A;exports.getSecp256r1VerifyInstructionDataEncoder=vA;exports.getSendAndConfirmTransaction=Xu;exports.getSettingsCodec=Ev;exports.getSettingsCreationArgsCodec=yb;exports.getSettingsCreationArgsDecoder=Ft;exports.getSettingsCreationArgsEncoder=Ht;exports.getSettingsDecoder=Vc;exports.getSettingsDiscriminatorBytes=Cv;exports.getSettingsEncoder=Al;exports.getSettingsFromIndex=ue;exports.getSettingsIndexWithAddressCodec=fb;exports.getSettingsIndexWithAddressDecoder=zt;exports.getSettingsIndexWithAddressEncoder=Gt;exports.getSettingsMutArgsCodec=Cb;exports.getSettingsMutArgsDecoder=j;exports.getSettingsMutArgsEncoder=K;exports.getSettingsReadonlyArgsCodec=Mb;exports.getSettingsReadonlyArgsDecoder=jt;exports.getSettingsReadonlyArgsEncoder=Kt;exports.getSignedSecp256r1Key=p2;exports.getSignedTransactionManager=f5;exports.getSolanaRpc=ce;exports.getSolanaRpcEndpoint=Zu;exports.getSplInterfacePdaArgsCodec=bb;exports.getSplInterfacePdaArgsDecoder=qt;exports.getSplInterfacePdaArgsEncoder=Jt;exports.getTokenMetadataCodec=Wb;exports.getTokenMetadataDecoder=Fn;exports.getTokenMetadataEncoder=Hn;exports.getTokenTransferIntentCompressedDiscriminatorBytes=aL;exports.getTokenTransferIntentCompressedInstruction=ad;exports.getTokenTransferIntentCompressedInstructionAsync=dL;exports.getTokenTransferIntentCompressedInstructionDataCodec=iL;exports.getTokenTransferIntentCompressedInstructionDataDecoder=cd;exports.getTokenTransferIntentCompressedInstructionDataEncoder=Vs;exports.getTokenTransferIntentDiscriminatorBytes=Xk;exports.getTokenTransferIntentInstruction=$i;exports.getTokenTransferIntentInstructionAsync=$k;exports.getTokenTransferIntentInstructionDataCodec=Qk;exports.getTokenTransferIntentInstructionDataDecoder=Qi;exports.getTokenTransferIntentInstructionDataEncoder=ws;exports.getTransactionBufferAddress=uA;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=ML;exports.getTransactionBufferCloseCompressedInstruction=Sd;exports.getTransactionBufferCloseCompressedInstructionDataCodec=hL;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=fd;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=ld;exports.getTransactionBufferCloseDiscriminatorBytes=lL;exports.getTransactionBufferCloseInstruction=pd;exports.getTransactionBufferCloseInstructionDataCodec=fL;exports.getTransactionBufferCloseInstructionDataDecoder=gd;exports.getTransactionBufferCloseInstructionDataEncoder=Ad;exports.getTransactionBufferCodec=_v;exports.getTransactionBufferCreateArgsCodec=Bb;exports.getTransactionBufferCreateArgsDecoder=Zt;exports.getTransactionBufferCreateArgsEncoder=Yt;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=zL;exports.getTransactionBufferCreateCompressedInstruction=vd;exports.getTransactionBufferCreateCompressedInstructionDataCodec=KL;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=_d;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=bd;exports.getTransactionBufferCreateDiscriminatorBytes=LL;exports.getTransactionBufferCreateInstruction=Pd;exports.getTransactionBufferCreateInstructionDataCodec=OL;exports.getTransactionBufferCreateInstructionDataDecoder=Dd;exports.getTransactionBufferCreateInstructionDataEncoder=Ed;exports.getTransactionBufferDecoder=Jc;exports.getTransactionBufferDiscriminatorBytes=bv;exports.getTransactionBufferEncoder=_l;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=iO;exports.getTransactionBufferExecuteCompressedInstruction=Gd;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=dO;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=Fd;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=Hd;exports.getTransactionBufferExecuteDiscriminatorBytes=$L;exports.getTransactionBufferExecuteInstruction=Bd;exports.getTransactionBufferExecuteInstructionDataCodec=eO;exports.getTransactionBufferExecuteInstructionDataDecoder=Od;exports.getTransactionBufferExecuteInstructionDataEncoder=Ld;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=DO;exports.getTransactionBufferExtendCompressedInstruction=tu;exports.getTransactionBufferExtendCompressedInstructionDataCodec=PO;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=eu;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=$d;exports.getTransactionBufferExtendDiscriminatorBytes=TO;exports.getTransactionBufferExtendInstruction=Yd;exports.getTransactionBufferExtendInstructionDataCodec=lO;exports.getTransactionBufferExtendInstructionDataDecoder=qd;exports.getTransactionBufferExtendInstructionDataEncoder=Jd;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=FO;exports.getTransactionBufferVoteCompressedInstruction=pu;exports.getTransactionBufferVoteCompressedInstructionDataCodec=GO;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=gu;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=Au;exports.getTransactionBufferVoteDiscriminatorBytes=WO;exports.getTransactionBufferVoteInstruction=au;exports.getTransactionBufferVoteInstructionDataCodec=kO;exports.getTransactionBufferVoteInstructionDataDecoder=cu;exports.getTransactionBufferVoteInstructionDataEncoder=ou;exports.getTransactionExecuteCompressedDiscriminatorBytes=sB;exports.getTransactionExecuteCompressedInstruction=Pu;exports.getTransactionExecuteCompressedInstructionDataCodec=oB;exports.getTransactionExecuteCompressedInstructionDataDecoder=Du;exports.getTransactionExecuteCompressedInstructionDataEncoder=Eu;exports.getTransactionExecuteDiscriminatorBytes=ZO;exports.getTransactionExecuteInstruction=Su;exports.getTransactionExecuteInstructionDataCodec=XO;exports.getTransactionExecuteInstructionDataDecoder=fu;exports.getTransactionExecuteInstructionDataEncoder=lu;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=CB;exports.getTransactionExecuteSyncCompressedInstruction=Bu;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=EB;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=Ou;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=Lu;exports.getTransactionExecuteSyncDiscriminatorBytes=pB;exports.getTransactionExecuteSyncInstruction=vu;exports.getTransactionExecuteSyncInstructionDataCodec=mB;exports.getTransactionExecuteSyncInstructionDataDecoder=_u;exports.getTransactionExecuteSyncInstructionDataEncoder=bu;exports.getTransactionMessageAddressTableLookupCodec=zb;exports.getTransactionMessageAddressTableLookupDecoder=As;exports.getTransactionMessageAddressTableLookupEncoder=us;exports.getTransactionMessageCodec=Hb;exports.getTransactionMessageDecoder=Qt;exports.getTransactionMessageEncoder=Xt;exports.getTransferFeeAccountExtensionCodec=Jb;exports.getTransferFeeAccountExtensionDecoder=zn;exports.getTransferFeeAccountExtensionEncoder=Gn;exports.getTransferHookAccountExtensionCodec=Zb;exports.getTransferHookAccountExtensionDecoder=jn;exports.getTransferHookAccountExtensionEncoder=Kn;exports.getUserAccountAddress=N;exports.getUserCodec=e_;exports.getUserCreationArgsCodec=s_;exports.getUserCreationArgsDecoder=Ie;exports.getUserCreationArgsEncoder=xe;exports.getUserDecoder=$;exports.getUserEncoder=Xe;exports.getUserMutArgsCodec=i_;exports.getUserMutArgsDecoder=$e;exports.getUserMutArgsEncoder=Qe;exports.getUserReadOnlyArgsCodec=g_;exports.getUserReadOnlyArgsDecoder=be;exports.getUserReadOnlyArgsEncoder=Re;exports.getUserReadOnlyOrMutateArgsCodec=T_;exports.getUserReadOnlyOrMutateArgsDecoder=es;exports.getUserReadOnlyOrMutateArgsEncoder=$n;exports.getUserRoleCodec=I_;exports.getUserRoleDecoder=je;exports.getUserRoleEncoder=Ke;exports.getWalletAddressFromIndex=Qw;exports.getWalletAddressFromSettings=ve;exports.getWhitelistedAddressTreeCodec=Lv;exports.getWhitelistedAddressTreeDecoder=$c;exports.getWhitelistedAddressTreeDiscriminatorBytes=kv;exports.getWhitelistedAddressTreeEncoder=Zl;exports.getWhitelistedAddressTreeFromIndex=Ys;exports.getWhitelistedAddressTreeIndexFromAddress=Vw;exports.getWhitelistedAddressTreesAddress=sA;exports.identifyMultiWalletAccount=iN;exports.identifyMultiWalletInstruction=dN;exports.initialize=dw;exports.isConfigAction=Jh;exports.isExtensionStruct=AR;exports.isMultiWalletError=TN;exports.isUserReadOnlyOrMutateArgs=f_;exports.migrateSettings=a6;exports.migrateUsers=m6;exports.nativeTransferIntent=eV;exports.parseAddWhitelistedAddressTreesInstruction=rU;exports.parseChangeConfigCompressedInstruction=IU;exports.parseChangeConfigInstruction=gU;exports.parseCreateCompressedWalletInstruction=vU;exports.parseCreateDomainConfigInstruction=HU;exports.parseCreateDomainUserAccountInstruction=XU;exports.parseCreateGlobalCounterInstruction=cW;exports.parseCreateUserAccountsInstruction=TW;exports.parseDecompressSettingsAccountInstruction=PW;exports.parseDisableDomainConfigInstruction=WW;exports.parseEditDomainConfigInstruction=GW;exports.parseEditTransactionManagerUrlInstruction=QW;exports.parseEditUserDelegateInstruction=ak;exports.parseMigrateCompressedSettingsInstruction=Tk;exports.parseMigrateCompressedUsersInstruction=Pk;exports.parseNativeTransferIntentCompressedInstruction=zk;exports.parseNativeTransferIntentInstruction=Lk;exports.parseSecp256r1VerifyInstruction=_6;exports.parseTokenTransferIntentCompressedInstruction=uL;exports.parseTokenTransferIntentInstruction=eL;exports.parseTransactionBufferCloseCompressedInstruction=RL;exports.parseTransactionBufferCloseInstruction=SL;exports.parseTransactionBufferCreateCompressedInstruction=jL;exports.parseTransactionBufferCreateInstruction=BL;exports.parseTransactionBufferExecuteCompressedInstruction=uO;exports.parseTransactionBufferExecuteInstruction=tO;exports.parseTransactionBufferExtendCompressedInstruction=MO;exports.parseTransactionBufferExtendInstruction=fO;exports.parseTransactionBufferVoteCompressedInstruction=zO;exports.parseTransactionBufferVoteInstruction=LO;exports.parseTransactionExecuteCompressedInstruction=cB;exports.parseTransactionExecuteInstruction=QO;exports.parseTransactionExecuteSyncCompressedInstruction=DB;exports.parseTransactionExecuteSyncInstruction=yB;exports.pollJitoBundleConfirmation=q2;exports.prepareChangeConfigArgs=IH;exports.prepareTransactionBundle=bH;exports.prepareTransactionMessage=FH;exports.prepareTransactionSync=JH;exports.retrieveTransactionManager=l5;exports.sendJitoBundle=kP;exports.serializeConfigActions=S5;exports.signAndSendBundledTransactions=J2;exports.signAndSendTransaction=t5;exports.tokenTransferIntent=pV;exports.userReadOnlyOrMutateArgs=l_;exports.vaultTransactionMessageDeserialize=ju;exports.vaultTransactionMessageSerialize=Ku;exports.voteTransactionBuffer=jA;//# 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'),f=require('zod'),programs=require('gill/programs'),nist_js=require('@noble/curves/nist.js'),tinyCbor=require('@levischuck/tiny-cbor'),utils_js=require('@noble/curves/utils.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var f__default=/*#__PURE__*/_interopDefault(f);var $r=1644,Ar=2e5,fo=1.1,So=30,xo=3e3,ke=3,Le=500,gr=2,pr=3e4,en=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Io="https://mainnet.block-engine.jito.wtf/api/v1",Co="https://bundles.jito.wtf/api/v1/bundles/tip_floor",Eo="landed_tips_75th_percentile",Do=255,Po=400,Mo=429,tn=500;var Ee=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);}},Oe=class extends Ee{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},ne=class extends Ee{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},z=class extends Ee{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},De=class extends Ee{constructor(r,s,t){super(r,"NETWORK_ERROR",{statusCode:s,url:t});this.statusCode=s;this.url=t;}},ho=class extends Ee{constructor(r,s,t){super(r,"TRANSACTION_ERROR",{signature:s,logs:t});this.signature=s;this.logs=t;}},ye=class extends Ee{constructor(r,s,t){super(r,"BUNDLE_ERROR",{bundleId:s,attempt:t});this.bundleId=s;this.attempt=t;}},mr=class extends Ee{constructor(r,s,t){super(`Operation "${r}" failed after ${s} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=s;this.lastError=t;}},yr=class extends Ee{constructor(r,s,t){super(r,"PERMISSION_ERROR",{required:s,actual:t});this.required=s;this.actual=t;}};var Ro=new Uint8Array([201,232,212,229,59,241,106,197]);function VM(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Ro)}function Tg(){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:Ro}))}function bo(){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 HM(){return gill.combineCodec(Tg(),bo())}function _o(e){return gill.decodeAccount(e,bo())}async function vo(e,n,r){let s=await lg(e,n,r);return gill.assertAccountExists(s),s}async function lg(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return _o(s)}async function FM(e,n,r){let s=await fg(e,n,r);return gill.assertAccountsExist(s),s}async function fg(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>_o(t))}function GM(){return 846}var ko=new Uint8Array([42,206,176,58,175,129,130,233]);function jM(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(ko)}function Ug(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:ko}))}function Lo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function JM(){return gill.combineCodec(Ug(),Lo())}function Oo(e){return gill.decodeAccount(e,Lo())}async function qM(e,n,r){let s=await Wg(e,n,r);return gill.assertAccountExists(s),s}async function Wg(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Oo(s)}async function YM(e,n,r){let s=await kg(e,n,r);return gill.assertAccountsExist(s),s}async function kg(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Oo(t))}function ZM(){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 $M(){return gill.combineCodec(rn(),nn())}function sn(){return gill.getStructEncoder([["memberKey",se()],["permissions",He()],["userReadonlyArgs",Re()]])}function on(){return gill.getStructDecoder([["memberKey",oe()],["permissions",Fe()],["userReadonlyArgs",be()]])}function nh(){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 ch(){return gill.combineCodec(cn(),an())}function Ct(){return gill.getStructEncoder([["treeInfo",Dt()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["outputStateTreeIndex",gill.getU8Encoder()]])}function Et(){return gill.getStructDecoder([["treeInfo",Pt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["outputStateTreeIndex",gill.getU8Decoder()]])}function uh(){return gill.combineCodec(Ct(),Et())}function Mt(){return gill.getStructEncoder([["treeInfo",Dt()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function ht(){return gill.getStructDecoder([["treeInfo",Pt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function mh(){return gill.combineCodec(Mt(),ht())}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 lh(){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 Tn(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function xh(){return gill.combineCodec(yn(),Tn())}function Rt(){return gill.getStructEncoder([["data",gill.getOptionEncoder(bt())]])}function Z(){return gill.getStructDecoder([["data",gill.getOptionDecoder(_t())]])}function Dh(){return gill.combineCodec(Rt(),Z())}function bt(){return gill.getStructEncoder([["threshold",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["index",gill.getU128Encoder()],["multiWalletBump",gill.getU8Encoder()],["members",gill.getArrayEncoder(vt())],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]])}function _t(){return gill.getStructDecoder([["threshold",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["index",gill.getU128Decoder()],["multiWalletBump",gill.getU8Decoder()],["members",gill.getArrayDecoder(Ut())],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function Rh(){return gill.combineCodec(bt(),_t())}function Wt(){return gill.getStructEncoder([["version",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()],["amount",gill.getU64Encoder()],["merkleContext",fn()],["tlv",gill.getOptionEncoder(gill.getArrayEncoder(ln()))],["hasDelegate",gill.getBooleanEncoder()],["isFrozen",gill.getBooleanEncoder()]])}function kt(){return gill.getStructDecoder([["version",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()],["amount",gill.getU64Decoder()],["merkleContext",Sn()],["tlv",gill.getOptionDecoder(gill.getArrayDecoder(Lt()))],["hasDelegate",gill.getBooleanDecoder()],["isFrozen",gill.getBooleanDecoder()]])}function Uh(){return gill.combineCodec(Wt(),kt())}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 Oh(){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 Vh(){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 zh(){return gill.combineCodec(Ge(),ze())}function Kh(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function jh(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",xe()]])}function Bn(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",je()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",Ie()]])}function Zh(){return gill.combineCodec(On(),Bn())}function Un(){return gill.getStructEncoder([["memberKey",se()],["permissions",He()]])}function Wn(){return gill.getStructDecoder([["memberKey",oe()],["permissions",Fe()]])}function eR(){return gill.combineCodec(Un(),Wn())}function Ot(){return gill.getStructEncoder([["memberKey",se()],["messageHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Bt(){return gill.getStructDecoder([["memberKey",oe()],["messageHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function sR(){return gill.combineCodec(Ot(),Bt())}function ln(){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 Lt(){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 iR(){return gill.combineCodec(ln(),Lt())}function dR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function uR(e,n){return n.__kind===e}function qn(){return gill.getStructEncoder([["settingsMutArgs",K()],["transactionManager",gill.getOptionEncoder(Re())]])}function Yn(){return gill.getStructDecoder([["settingsMutArgs",j()],["transactionManager",gill.getOptionDecoder(be())]])}function mR(){return gill.combineCodec(qn(),Yn())}function vt(){return gill.getStructEncoder([["pubkey",se()],["permissions",He()],["role",gill.getU8Encoder()],["userAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getU8Encoder()]])}function Ut(){return gill.getStructDecoder([["pubkey",oe()],["permissions",Fe()],["role",gill.getU8Decoder()],["userAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getU8Decoder()]])}function fR(){return gill.combineCodec(vt(),Ut())}function se(){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 IR(){return gill.combineCodec(se(),oe())}function Qn(){return gill.getStructEncoder([["authorityCreationArgs",xe()],["compressedProofArgs",E()]])}function $n(){return gill.getStructDecoder([["authorityCreationArgs",Ie()],["compressedProofArgs",D()]])}function PR(){return gill.combineCodec(Qn(),$n())}function Nt(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function wt(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function RR(){return gill.combineCodec(Nt(),wt())}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 vR(){return gill.combineCodec(fn(),Sn())}function Dt(){return gill.getStructEncoder([["rootIndex",gill.getU16Encoder()],["proveByIndex",gill.getBooleanEncoder()],["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()]])}function Pt(){return gill.getStructDecoder([["rootIndex",gill.getU16Decoder()],["proveByIndex",gill.getBooleanDecoder()],["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()]])}function kR(){return gill.combineCodec(Dt(),Pt())}function Nn(){return gill.getStructEncoder([])}function wn(){return gill.getStructDecoder([])}function BR(){return gill.combineCodec(Nn(),wn())}function Vn(){return gill.getStructEncoder([])}function Hn(){return gill.getStructDecoder([])}function VR(){return gill.combineCodec(Vn(),Hn())}function He(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function Fe(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function GR(){return gill.combineCodec(He(),Fe())}function E(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(yn())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function D(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(Tn())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function JR(){return gill.combineCodec(E(),D())}function kn(){return gill.getStructEncoder([["memberKey",se()],["userArgs",es()]])}function Ln(){return gill.getStructDecoder([["memberKey",oe()],["userArgs",ts()]])}function XR(){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 eb(){return gill.combineCodec(Rn(),bn())}function ss(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function Vt(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function nb(){return gill.combineCodec(ss(),Vt())}function H(){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 F(){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 cb(){return gill.combineCodec(H(),F())}function X(){return gill.getStructEncoder([["domainConfigKey",gill.getAddressEncoder()],["verifyArgs",H()]])}function Q(){return gill.getStructDecoder([["domainConfigKey",gill.getAddressDecoder()],["verifyArgs",F()]])}function ub(){return gill.combineCodec(X(),Q())}function Ht(){return gill.getStructEncoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function Ft(){return gill.getStructDecoder([["addressTreeInfo",wt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function mb(){return gill.combineCodec(Ht(),Ft())}function Gt(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function zt(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function lb(){return gill.combineCodec(Gt(),zt())}function K(){return gill.getStructEncoder([["accountMeta",Ct()],["data",Rt()]])}function j(){return gill.getStructDecoder([["accountMeta",Et()],["data",Z()]])}function Ib(){return gill.combineCodec(K(),j())}function Kt(){return gill.getStructEncoder([["accountMeta",Mt()],["data",Rt()]])}function jt(){return gill.getStructDecoder([["accountMeta",ht()],["data",Z()]])}function Pb(){return gill.combineCodec(Kt(),jt())}function Jt(){return gill.getStructEncoder([["index",gill.getU8Encoder()],["restricted",gill.getBooleanEncoder()]])}function qt(){return gill.getStructDecoder([["index",gill.getU8Decoder()],["restricted",gill.getBooleanDecoder()]])}function Rb(){return gill.combineCodec(Jt(),qt())}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 Ub(){return gill.combineCodec(Fn(),Gn())}function Yt(){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(Ot())]])}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(Bt())]])}function Ob(){return gill.combineCodec(Yt(),Zt())}function Xt(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(cn())],["addressTableLookups",gill.getArrayEncoder(As())]])}function Qt(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(an())],["addressTableLookups",gill.getArrayDecoder(gs())]])}function Vb(){return gill.combineCodec(Xt(),Qt())}function As(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function gs(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function Gb(){return gill.combineCodec(As(),gs())}function zn(){return gill.getStructEncoder([["withheldAmount",gill.getU64Encoder()]])}function Kn(){return gill.getStructDecoder([["withheldAmount",gill.getU64Decoder()]])}function jb(){return gill.combineCodec(zn(),Kn())}function jn(){return gill.getStructEncoder([["transferring",gill.getU8Encoder()]])}function Jn(){return gill.getStructDecoder([["transferring",gill.getU8Decoder()]])}function Yb(){return gill.combineCodec(jn(),Jn())}function Xe(){return gill.getStructEncoder([["member",se()],["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["role",Ke()],["delegatedTo",gill.getOptionEncoder(Gt())],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function $(){return gill.getStructDecoder([["member",oe()],["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["role",je()],["delegatedTo",gill.getOptionDecoder(zt())],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function $b(){return gill.combineCodec(Xe(),$())}function xe(){return gill.getStructEncoder([["addressTreeInfo",Nt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function Ie(){return gill.getStructDecoder([["addressTreeInfo",wt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function n_(){return gill.combineCodec(xe(),Ie())}function Qe(){return gill.getStructEncoder([["accountMeta",Ct()],["data",Xe()]])}function $e(){return gill.getStructDecoder([["accountMeta",Et()],["data",$()]])}function a_(){return gill.combineCodec(Qe(),$e())}function Re(){return gill.getStructEncoder([["accountMeta",Mt()],["data",Xe()]])}function be(){return gill.getStructDecoder([["accountMeta",ht()],["data",$()]])}function A_(){return gill.combineCodec(Re(),be())}function es(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([Re()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([Qe()])]])]])}function ts(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([be()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([$e()])]])]])}function y_(){return gill.combineCodec(es(),ts())}function T_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function l_(e,n){return n.__kind===e}var it=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(it||{});function Ke(){return gill.getEnumEncoder(it)}function je(){return gill.getEnumDecoder(it)}function x_(){return gill.combineCodec(Ke(),je())}var wc=new Uint8Array([223,179,163,190,177,224,67,173]);function Iv(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(wc)}function ul(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(vt())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]]),e=>({...e,discriminator:wc}))}function Vc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(Ut())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function Cv(){return gill.combineCodec(ul(),Vc())}function Hc(e){return gill.decodeAccount(e,Vc())}async function Ev(e,n,r){let s=await ys(e,n,r);return gill.assertAccountExists(s),s}async function ys(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Hc(s)}async function Dv(e,n,r){let s=await Al(e,n,r);return gill.assertAccountsExist(s),s}async function Al(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Hc(t))}var jc=new Uint8Array([90,36,35,219,93,225,110,96]);function Rv(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(jc)}function bl(){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",se()],["executor",se()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder(se())],["expectedSecp256r1Signers",gill.getArrayEncoder(Ot())],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:jc}))}function Jc(){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(Bt())],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function bv(){return gill.combineCodec(bl(),Jc())}function qc(e){return gill.decodeAccount(e,Jc())}async function Yc(e,n,r){let s=await _l(e,n,r);return gill.assertAccountExists(s),s}async function _l(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return qc(s)}async function _v(e,n,r){let s=await vl(e,n,r);return gill.assertAccountsExist(s),s}async function vl(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>qc(t))}var Qc=new Uint8Array([105,23,173,2,197,255,80,87]);function Wv(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Qc)}function Yl(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:Qc}))}function $c(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function kv(){return gill.combineCodec(Yl(),$c())}function ea(e){return gill.decodeAccount(e,$c())}async function ta(e,n,r){let s=await Zl(e,n,r);return gill.assertAccountExists(s),s}async function Zl(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return ea(s)}async function Lv(e,n,r){let s=await Xl(e,n,r);return gill.assertAccountsExist(s),s}async function Xl(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>ea(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 na(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}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 y(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:gill.AccountRole.READONLY});let s=r.isWritable?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY;return Object.freeze({address:O(r.value),role:ra(r.value)?gill.upgradeRoleToSigner(s):s,...ra(r.value)?{signer:r.value}:{}})}}function ra(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var oa=new Uint8Array([8]);function Qv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(oa)}function Es(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:oa}))}function ca(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function $v(){return gill.combineCodec(Es(),ca())}async function aa(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:Es().encode(c),programAddress:r})}function eU(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:Es().encode(c),programAddress:r})}function tU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:ca().decode(e.data)}}var ga=new Uint8Array([9]);function iU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ga)}function Ps(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsIndex",gill.getU128Encoder()],["configActions",gill.getArrayEncoder(Ge())],["secp256r1VerifyArgs",gill.getArrayEncoder(X())],["compressedProofArgs",gill.getOptionEncoder(E())]]),e=>({...e,discriminator:ga}))}function pa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsIndex",gill.getU128Decoder()],["configActions",gill.getArrayDecoder(ze())],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())],["compressedProofArgs",gill.getOptionDecoder(D())]])}function dU(){return gill.combineCodec(Ps(),pa())}async function ma(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.settings.value||(t.settings.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getU128Encoder().encode(na(c.settingsIndex))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ps().encode(c),programAddress:r})}function uU(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ps().encode(c),programAddress:r})}function AU(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:pa().decode(e.data)}}var Sa=new Uint8Array([19]);function fU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Sa)}function xa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(Ge())],["secp256r1VerifyArgs",gill.getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Sa}))}function Ia(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(ze())],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function SU(){return gill.combineCodec(xa(),Ia())}function Ca(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:xa().encode(c),programAddress:r})}function xU(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:Ia().decode(e.data)}}var Pa=new Uint8Array([18]);function hU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Pa)}function Ms(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",E()],["settingsCreation",Ht()],["userReadonlyArgs",Re()],["settingsIndex",gill.getU128Encoder()]]),e=>({...e,discriminator:Pa}))}function Ma(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",D()],["settingsCreation",Ft()],["userReadonlyArgs",be()],["settingsIndex",gill.getU128Decoder()]])}function RU(){return gill.combineCodec(Ms(),Ma())}async function ha(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Ms().encode(c),programAddress:r})}function bU(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:Ms().encode(c),programAddress:r})}function _U(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:Ma().decode(e.data)}}var La=new Uint8Array([0]);function BU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(La)}function Rs(){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",xe()],["compressedProofArgs",E()]]),e=>({...e,discriminator:La}))}function Oa(){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",Ie()],["compressedProofArgs",D()]])}function NU(){return gill.combineCodec(Rs(),Oa())}async function Ba(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Rs().encode(c),programAddress:r})}function wU(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:Rs().encode(c),programAddress:r})}function VU(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:Oa().decode(e.data)}}var wa=new Uint8Array([4]);function JU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(wa)}function _s(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",E()],["member",ss()],["role",Ke()],["userAccountCreationArgs",xe()],["linkWalletArgs",gill.getOptionEncoder(qn())]]),e=>({...e,discriminator:wa}))}function Va(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",D()],["member",Vt()],["role",je()],["userAccountCreationArgs",Ie()],["linkWalletArgs",gill.getOptionDecoder(Yn())]])}function qU(){return gill.combineCodec(_s(),Va())}async function Ha(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:_s().encode(c),programAddress:r})}function YU(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:_s().encode(c),programAddress:r})}function ZU(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:Va().decode(e.data)}}var Ga=new Uint8Array([3]);function rW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ga)}function Us(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Ga}))}function za(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function nW(){return gill.combineCodec(Us(),za())}async function Ka(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=y(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Us().encode({}),programAddress:r})}function sW(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=y(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:Us().encode({}),programAddress:r})}function oW(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:za().decode(e.data)}}var Ja=new Uint8Array([5]);function gW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ja)}function ks(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",E()],["createUserArgs",gill.getArrayEncoder(On())]]),e=>({...e,discriminator:Ja}))}function qa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",D()],["createUserArgs",gill.getArrayDecoder(Bn())]])}function pW(){return gill.combineCodec(ks(),qa())}async function Ya(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:ks().encode(c),programAddress:r})}function mW(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:ks().encode(c),programAddress:r})}function yW(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:qa().decode(e.data)}}var Qa=new Uint8Array([17]);function CW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Qa)}function $a(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMutArgs",K()],["compressedProofArgs",E()],["secp256r1VerifyArgs",gill.getArrayEncoder(X())]]),e=>({...e,discriminator:Qa}))}function ei(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMutArgs",j()],["compressedProofArgs",D()],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())]])}function EW(){return gill.combineCodec($a(),ei())}function ti(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:$a().encode(c),programAddress:r})}function DW(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:ei().decode(e.data)}}var si=new Uint8Array([2]);function _W(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(si)}function oi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:si}))}function ci(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function vW(){return gill.combineCodec(oi(),ci())}function ai(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:oi().encode(c),programAddress:r})}function UW(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:ci().decode(e.data)}}var Ai=new Uint8Array([1]);function wW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ai)}function Os(){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 gi(){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 VW(){return gill.combineCodec(Os(),gi())}async function HW(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Os().encode(c),programAddress:r})}function pi(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Os().encode(c),programAddress:r})}function FW(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:gi().decode(e.data)}}var Ti=new Uint8Array([6]);function YW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ti)}function li(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Qe()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ti}))}function fi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",$e()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",D()]])}function ZW(){return gill.combineCodec(li(),fi())}function Si(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:li().encode(c),programAddress:r})}function XW(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:fi().decode(e.data)}}var Ci=new Uint8Array([7]);function sk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ci)}function Ei(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Qe()],["secp256r1VerifyArgs",gill.getOptionEncoder(H())],["delegateTo",gill.getOptionEncoder(Gt())],["oldSettingsMutArgs",gill.getOptionEncoder(K())],["newSettingsMutArgs",gill.getOptionEncoder(K())],["compressedProofArgs",E()]]),e=>({...e,discriminator:Ci}))}function Di(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",$e()],["secp256r1VerifyArgs",gill.getOptionDecoder(F())],["delegateTo",gill.getOptionDecoder(zt())],["oldSettingsMutArgs",gill.getOptionDecoder(j())],["newSettingsMutArgs",gill.getOptionDecoder(j())],["compressedProofArgs",D()]])}function ok(){return gill.combineCodec(Ei(),Di())}function Pi(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.feePayer),o(t.signer),o(t.oldSettings),o(t.newSettings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),...i],data:Ei().encode(c),programAddress:r})}function ck(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:Di().decode(e.data)}}var Ri=new Uint8Array([32]);function pk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ri)}function bi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",bt()],["compressedProofArgs",E()],["settingsCreationArgs",Ht()]]),e=>({...e,discriminator:Ri}))}function _i(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",_t()],["compressedProofArgs",D()],["settingsCreationArgs",Ft()]])}function mk(){return gill.combineCodec(bi(),_i())}function vi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:bi().encode(c),programAddress:r})}function yk(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:_i().decode(e.data)}}var ki=new Uint8Array([31]);function Ck(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ki)}function Li(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Xe()],["compressedProofArgs",E()],["userCreationArgs",xe()]]),e=>({...e,discriminator:ki}))}function Oi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",$()],["compressedProofArgs",D()],["userCreationArgs",Ie()]])}function Ek(){return gill.combineCodec(Li(),Oi())}function Bi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.authority),...i],data:Li().encode(c),programAddress:r})}function Dk(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:Oi().decode(e.data)}}var wi=new Uint8Array([29]);function vk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(wi)}function Bs(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(X())]]),e=>({...e,discriminator:wi}))}function Vi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())]])}function Uk(){return gill.combineCodec(Bs(),Vi())}async function Wk(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(O(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Bs().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},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Bs().encode(c),programAddress:r})}function kk(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:Vi().decode(e.data)}}var zi=new Uint8Array([27]);function Hk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(zi)}function Ki(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:zi}))}function ji(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function Fk(){return gill.combineCodec(Ki(),ji())}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:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Ki().encode(c),programAddress:r})}function Gk(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:ji().decode(e.data)}}var Xi=new Uint8Array([30]);function Zk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Xi)}function Vs(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["splInterfacePdaArgs",gill.getOptionEncoder(Jt())],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccounts",gill.getOptionEncoder(gill.getArrayEncoder(Wt()))],["compressedProofArgs",gill.getOptionEncoder(E())],["secp256r1VerifyArgs",gill.getArrayEncoder(X())]]),e=>({...e,discriminator:Xi}))}function Qi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["splInterfacePdaArgs",gill.getOptionDecoder(qt())],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccounts",gill.getOptionDecoder(gill.getArrayDecoder(kt()))],["compressedProofArgs",gill.getOptionDecoder(D())],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())]])}function Xk(){return gill.combineCodec(Vs(),Qi())}async function Qk(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(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 i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Vs().encode(c),programAddress:r})}function $i(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Vs().encode(c),programAddress:r})}function $k(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 od=new Uint8Array([28]);function cL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(od)}function Hs(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["splInterfacePdaArgs",gill.getOptionEncoder(Jt())],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccounts",gill.getOptionEncoder(gill.getArrayEncoder(Wt()))],["secp256r1VerifyArgs",gill.getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:od}))}function cd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["splInterfacePdaArgs",gill.getOptionDecoder(qt())],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccounts",gill.getOptionDecoder(gill.getArrayDecoder(kt()))],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function aL(){return gill.combineCodec(Hs(),cd())}async function iL(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceSplTokenAccount.value||(t.sourceSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(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 i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Hs().encode(c),programAddress:r})}function ad(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:false},sourceSplTokenAccount:{value:e.sourceSplTokenAccount??null,isWritable:true},sourceCtokenTokenAccount:{value:e.sourceCtokenTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationSplTokenAccount:{value:e.destinationSplTokenAccount??null,isWritable:true},destinationCtokenTokenAccount:{value:e.destinationCtokenTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceSplTokenAccount),o(t.sourceCtokenTokenAccount),o(t.destination),o(t.destinationSplTokenAccount),o(t.destinationCtokenTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.compressedTokenProgramAuthority),o(t.splInterfacePda),o(t.compressibleConfig),o(t.rentSponsor),o(t.compressedTokenProgram),...i],data:Hs().encode(c),programAddress:r})}function dL(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:cd().decode(e.data)}}var ud=new Uint8Array([13]);function TL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ud)}function Ad(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(H())]]),e=>({...e,discriminator:ud}))}function gd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(F())]])}function lL(){return gill.combineCodec(Ad(),gd())}function pd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ad().encode(c),programAddress:r})}function fL(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:gd().decode(e.data)}}var Td=new Uint8Array([23]);function PL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Td)}function ld(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(H())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Td}))}function fd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(F())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function ML(){return gill.combineCodec(ld(),fd())}function Sd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ld().encode(c),programAddress:r})}function hL(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:fd().decode(e.data)}}var Cd=new Uint8Array([10]);function kL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Cd)}function Ed(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Yt()],["secp256r1VerifyArgs",gill.getOptionEncoder(H())]]),e=>({...e,discriminator:Cd}))}function Dd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Zt()],["secp256r1VerifyArgs",gill.getOptionDecoder(F())]])}function LL(){return gill.combineCodec(Ed(),Dd())}function Pd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:Ed().encode(c),programAddress:r})}function OL(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:Dd().decode(e.data)}}var Rd=new Uint8Array([20]);function GL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Rd)}function bd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Yt()],["secp256r1VerifyArgs",gill.getOptionEncoder(H())],["settingsReadonlyArgs",Kt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Rd}))}function _d(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Zt()],["secp256r1VerifyArgs",gill.getOptionDecoder(F())],["settingsReadonlyArgs",jt()],["compressedProofArgs",D()]])}function zL(){return gill.combineCodec(bd(),_d())}function vd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:bd().encode(c),programAddress:r})}function KL(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:_d().decode(e.data)}}var kd=new Uint8Array([14]);function QL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(kd)}function Ld(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(H())]]),e=>({...e,discriminator:kd}))}function Od(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(F())]])}function $L(){return gill.combineCodec(Ld(),Od())}function Bd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ld().encode(c),programAddress:r})}function eO(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:Od().decode(e.data)}}var Vd=new Uint8Array([24]);function aO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Vd)}function Hd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(H())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:Vd}))}function Fd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(F())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function iO(){return gill.combineCodec(Hd(),Fd())}function Gd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Hd().encode(c),programAddress:r})}function dO(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:Fd().decode(e.data)}}var jd=new Uint8Array([12]);function yO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(jd)}function Jd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:jd}))}function qd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function TO(){return gill.combineCodec(Jd(),qd())}function Yd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:Jd().encode(c),programAddress:r})}function lO(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:qd().decode(e.data)}}var Qd=new Uint8Array([22]);function EO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Qd)}function $d(){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 eu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function DO(){return gill.combineCodec($d(),eu())}function tu(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:$d().encode(c),programAddress:r})}function PO(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:eu().decode(e.data)}}var su=new Uint8Array([11]);function UO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(su)}function ou(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(H())]]),e=>({...e,discriminator:su}))}function cu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(F())]])}function WO(){return gill.combineCodec(ou(),cu())}function au(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ou().encode(c),programAddress:r})}function kO(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:cu().decode(e.data)}}var uu=new Uint8Array([21]);function HO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(uu)}function Au(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(H())],["settingsReadonlyArgs",Kt()],["compressedProofArgs",E()]]),e=>({...e,discriminator:uu}))}function gu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(F())],["settingsReadonlyArgs",jt()],["compressedProofArgs",D()]])}function FO(){return gill.combineCodec(Au(),gu())}function pu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Au().encode(c),programAddress:r})}function GO(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:gu().decode(e.data)}}var Tu=new Uint8Array([15]);function YO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Tu)}function lu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Tu}))}function fu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function ZO(){return gill.combineCodec(lu(),fu())}function Su(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=m({}),i=y(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:lu().encode({}),programAddress:r})}function XO(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:fu().decode(e.data)}}var Cu=new Uint8Array([25]);function nB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Cu)}function Eu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:Cu}))}function Du(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function sB(){return gill.combineCodec(Eu(),Du())}function Pu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:Eu().encode(c),programAddress:r})}function oB(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:Du().decode(e.data)}}var Ru=new Uint8Array([16]);function gB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ru)}function bu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Xt()],["secp256r1VerifyArgs",gill.getArrayEncoder(X())]]),e=>({...e,discriminator:Ru}))}function _u(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Qt()],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())]])}function pB(){return gill.combineCodec(bu(),_u())}function vu(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:bu().encode(c),programAddress:r})}function mB(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:_u().decode(e.data)}}var ku=new Uint8Array([26]);function IB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ku)}function Lu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Xt()],["secp256r1VerifyArgs",gill.getArrayEncoder(X())],["settingsMutArgs",K()],["compressedProofArgs",E()]]),e=>({...e,discriminator:ku}))}function Ou(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Qt()],["secp256r1VerifyArgs",gill.getArrayDecoder(Q())],["settingsMutArgs",j()],["compressedProofArgs",D()]])}function CB(){return gill.combineCodec(Lu(),Ou())}function Bu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=y(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Lu().encode(c),programAddress:r})}function EB(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:Ou().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",AE=(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))(AE||{});function aN(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 gE=(T=>(T[T.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",T[T.ChangeConfig=1]="ChangeConfig",T[T.ChangeConfigCompressed=2]="ChangeConfigCompressed",T[T.CreateCompressedWallet=3]="CreateCompressedWallet",T[T.CreateDomainConfig=4]="CreateDomainConfig",T[T.CreateDomainUserAccount=5]="CreateDomainUserAccount",T[T.CreateGlobalCounter=6]="CreateGlobalCounter",T[T.CreateUserAccounts=7]="CreateUserAccounts",T[T.DecompressSettingsAccount=8]="DecompressSettingsAccount",T[T.DisableDomainConfig=9]="DisableDomainConfig",T[T.EditDomainConfig=10]="EditDomainConfig",T[T.EditTransactionManagerUrl=11]="EditTransactionManagerUrl",T[T.EditUserDelegate=12]="EditUserDelegate",T[T.MigrateCompressedSettings=13]="MigrateCompressedSettings",T[T.MigrateCompressedUsers=14]="MigrateCompressedUsers",T[T.NativeTransferIntent=15]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=17]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=19]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=21]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=23]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=25]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=27]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",T[T.TransactionExecute=29]="TransactionExecute",T[T.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=31]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",T))(gE||{});function iN(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 mE=6e3,yE=6001,TE=6002,lE=6003,fE=6004,SE=6005,xE=6006,IE=6007,CE=6008,EE=6009,DE=6010,PE=6011,ME=6012,hE=6013,RE=6014,bE=6015,_E=6016,vE=6017,UE=6018,WE=6019,kE=6020,LE=6021,OE=6022,BE=6023,NE=6024,wE=6025,VE=6026,HE=6027,FE=6028,GE=6029,zE=6030,KE=6031,jE=6032,JE=6033,qE=6034,YE=6035,ZE=6036,XE=6037,QE=6038,$E=6039,eD=6040,tD=6041,rD=6042,nD=6043,sD=6044,oD=6045,cD=6046,aD=6047,iD=6048,dD=6049,uD=6050,AD=6051,gD=6052,pD=6053,mD=6054,yD=6055,TD=6056,lD=6057,fD=6058,SD=6059,xD=6060,ID=6061,CD=6062,ED=6063,DD=6064,PD=6065,MD=6066,hD=6067,RD=6068,bD=6069,_D=6070,vD=6071,UD=6072,WD=6073,kD=6074,LD=6075,OD=6076,BD=6077,ND=6078,wD=6079,VD=6080,HD=6081,FD=6082,Nu;process.env.NODE_ENV!=="production"&&(Nu={[zE]:"This member is already delegated to another wallet.",[IE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[kD]:"Clock sysvar access failed. This may indicate a system error.",[uD]:"The domain configuration account is disabled. Please contact support or try again later.",[AD]:"Missing domain configuration account.",[UD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[FD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[DE]:"Duplicate public keys detected among members. Each member must have a unique key.",[EE]:"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.",[lD]:"Slot numbers list is empty. At least one slot number is required for validation.",[UE]:"Expected a User with Administrator role for this instruction.",[CE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[_E]:"Expected a User with Transaction Manager role for this instruction.",[$E]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[eD]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[tD]:"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.",[KE]:"At least one signer with execute permission is required to proceed.",[jE]:"At least one signer with initiate permission is required to perform this action.",[wE]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[vD]:"Invalid account index in transaction message. The account index is out of bounds.",[mD]:"Address Tree supplied is not part of the whitelisted address trees.",[WE]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[HE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[QE]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[fD]:"Member key conversion failed. The provided key format is invalid.",[qE]:"Only delegated members are allowed for this transaction.",[NE]:"Unexpected number of accounts provided for this instruction.",[hE]:"User with Permanent Member role must have a delegated wallet.",[yE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[fE]:"The extracted public key has an invalid length or encoding.",[mE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[lE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[dD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[aD]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[OE]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[RD]:"Invalid source type for token transfer. The source account type is not supported.",[vE]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[bE]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[BE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[VE]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[OD]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[hD]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[SE]:"The extracted WebAuthn signed message payload is malformed.",[oD]:"An input string exceeds the maximum allowed character length.",[gD]:"This member is not registered under the provided domain configuration.",[ID]:"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.",[FE]:"A required account is missing from the instruction context.",[SD]:"Compressed proof arguments are missing. Required for compressed account operations.",[DD]:"Missing compressed token account. Required for token transfer operations.",[BD]:"Missing destination token account. Required for token transfer operations.",[MD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[xD]:"Light CPI accounts are missing. Required for compressed account operations.",[GE]:"User mutation arguments are required when performing add or remove delegate operations.",[VD]:"Missing new authority account. Required for domain configuration updates.",[wD]:"Missing settings account. Required for delegate operations on compressed wallets.",[yD]:"Compressed settings data is missing. The settings account must be initialized with data.",[ND]:"Missing source token account. Required for token transfer operations.",[PD]:"Missing SPL interface PDA. Required for token transfer operations.",[cD]:"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.",[HD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[ZE]:"No valid signer found in this transaction.",[ME]:"Only one permanent member is allowed per wallet.",[RE]:"Only one transaction manager is allowed per wallet.",[pD]:"The given origin index is not in the whitelisted origins.",[ED]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[PE]:"Permanent members cannot be removed from a wallet.",[sD]:"Writable CPI calls to protected accounts are not permitted.",[xE]:"The rpIdHash extracted from the signed message does not match the expected value.",[CD]:"Settings key mismatch. The provided settings key does not match the expected value.",[TE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[iD]:"The specified slot number was not found in the provided slot history.",[bD]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[LE]:"Too many members: a maximum of 4 members are supported.",[rD]:"This transaction has expired. It must be executed within 3 minutes of approval.",[nD]:"This transaction has not yet reached the required approval threshold.",[XE]:"Only the transaction creator or rent payer may close this transaction buffer.",[LD]:"Unauthorized: Only the admin account is allowed to perform this action.",[YE]:"Member is not part of the expected signers for this transaction."});function mN(e){return process.env.NODE_ENV!=="production"?Nu[e]:"Error message not available in production bundles."}function yN(e,n,r){return gill.isProgramError(e,n,A,r)}async function MN({admin:e,addressTree:n}){return aa({payer:e,addressTree:n,remainingAccounts:[]})}var tr={Ed25519:1,Secp256r1:2};var wu=f__default.default.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),UN=f__default.default.object({transactionActionType:wu,transactionAddress:f__default.default.string(),transactionMessageBytes:f__default.default.array(f__default.default.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),Vu=f__default.default.object({transactionActionType:wu,transactionAddress:f__default.default.string(),transactionMessageBytes:f__default.default.string()}).strict(),Hu=f__default.default.object({authResponse:f__default.default.custom(),nonce:f__default.default.string(),clientSignature:f__default.default.object({clientOrigin:f__default.default.string(),signature:f__default.default.string()}).strict(),deviceSignature:f__default.default.object({publicKey:f__default.default.string(),signature:f__default.default.string()}).strict(),authProviderSignature:f__default.default.object({publicKey:f__default.default.string(),signature:f__default.default.string()}).strict().optional()}).strict(),Fu=f__default.default.object({signer:f__default.default.string(),userAddressTreeIndex:f__default.default.number().optional(),additionalInfo:f__default.default.looseObject({}).optional()}).strict(),GD=f__default.default.object({transactionPayload:Vu,slotHash:f__default.default.string(),slotNumber:f__default.default.string(),originIndex:f__default.default.number(),crossOrigin:f__default.default.boolean()}).strict(),WN=f__default.default.object({phase:f__default.default.literal("start"),redirectOrigin:f__default.default.url(),signer:f__default.default.string().optional(),data:f__default.default.object({type:f__default.default.literal("message"),payload:f__default.default.string().optional()}).strict()}).strict(),kN=f__default.default.object({phase:f__default.default.literal("start"),redirectOrigin:f__default.default.url(),signer:f__default.default.string().optional(),data:f__default.default.object({type:f__default.default.literal("transaction"),payload:Vu}).strict()}).strict(),LN=f__default.default.object({phase:f__default.default.literal("complete"),data:f__default.default.object({type:f__default.default.literal("message"),payload:Fu.extend(Hu.shape).extend({id:f__default.default.string().optional(),message:f__default.default.string(),clientSignature:f__default.default.object({clientOrigin:f__default.default.string()}).strict()})}).strict()}).strict(),ON=f__default.default.object({phase:f__default.default.literal("complete"),data:f__default.default.object({type:f__default.default.literal("transaction"),payload:Fu.extend(Hu.shape).extend(GD.shape).extend({clientSignature:f__default.default.object({clientOrigin:f__default.default.string()}).strict()})}).strict()}).strict();var _e={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Be=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(_e).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var zs=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!==zs)throw new Error(`Invalid public key length, expected ${zs} 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===zs)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 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 jD(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function JD(){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(jD())],["addressTableLookups",gill.getArrayCodec(JD())]]);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}}function Ju(e,n,r,s){if(e<n||e>r)throw new z(`${s} must be between ${n} and ${r} (inclusive), got ${e}`)}function qu(e,n){if(e<0)throw new z(`${n} must be non-negative, got ${e}`)}function rr(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`)}stateless_js.featureFlags.version=stateless_js.VERSION.V2;var te={};function Zu(){if(!te.solanaRpcEndpoint)throw new Oe("RPC endpoint");return te.solanaRpcEndpoint}function tt(){if(!te.lightProtocolRpc)throw new Oe("Light Protocol RPC");return te.lightProtocolRpc}function ce(){if(!te.solanaRpc)throw new Oe("Solana RPC");return te.solanaRpc}function Xu(){if(!te.sendAndConfirm)throw new Oe("Send and confirm transaction function");return te.sendAndConfirm}function Qu(){if(!te.computeEstimate)throw new Oe("Compute budget estimate function");return te.computeEstimate}function js(){return te.jitoTipsConfig?te.jitoTipsConfig:{blockEngineUrl:Io,getJitoTipsUrl:Co,priority:Eo}}function iw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s}){te.solanaRpcEndpoint=e,te.lightProtocolRpc=stateless_js.createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=gill.createSolanaClient({urlOrMoniker:e});te.solanaRpc=t,te.sendAndConfirm=c,te.computeEstimate=programs.estimateComputeUnitLimitFactory({rpc:t}),te.jitoTipsConfig=s??null;}function $u(e){return typeof e=="string"?e:e.toString()}function eA(e){return e.toString()}async function Js(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 $D={backoffBase:2,maxDelayMs:3e4,retryOnRateLimit:true};function eP(e,n,r=2,s=3e4){let t=n*Math.pow(r,e-1);return Math.min(t,s)}function tP(e){return new Promise(n=>setTimeout(n,e))}async function nr(e,n){let{maxRetries:r,initialDelayMs:s,backoffBase:t=2,maxDelayMs:c=3e4,shouldRetry:a}={...$D,...n},i;for(let o=1;o<=r;o++)try{return await e()}catch(u){if(i=u,a&&!a(u,o))throw u;if(o>=r)break;let d=eP(o,s,t,c);await tP(d);}throw new mr(e.name||"retryWithBackoff",r,i)}async function ut(e,n){let r=(s,t)=>s instanceof Response?s.status===429?n.retryOnRateLimit??true:s.status>=400&&s.status<500?false:s.status>=500:s instanceof TypeError||s instanceof Error;return nr(e,{...n,shouldRetry:n.shouldRetry??r})}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 tt().getStateTreeInfos(),r=stateless_js.selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:a,queuePubkeyIndex:i,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,u=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=u);}for(let c of r){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:a,addressQueuePubkeyIndex:i});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function Nr(e,n){let r=$u(e);return Js(n,r,()=>tt().getCompressedAccount(e))}async function rt(e,n){let r=eA(e);return Js(n,r,()=>ce().getAccountInfo(e,{encoding:"base64"}).send())}async function Te(e,n){let s=(await Promise.all(e.map(async t=>Nr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new ne("Compressed account",`Expected ${e.length} accounts but found ${s.length}`);return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function v(e,n){return {proof:e?.compressedProof?gill.some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function ge(e,n,r,s,t){if(t.length===0)return [];let c=t.map((u,d)=>({treeInfo:n[d],root:r[d],rootIndex:s[d],address:u.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((u,d)=>({addressTreeInfo:a[d],outputStateTreeIndex:i,address:u.address,type:u.type}))}function de(e,n,r,s,t,c,a){let i=[];for(let d=0;d<n.length;d++)i.push({treeInfo:n[d],rootIndex:s[d],leafIndex:r[d],proveByIndex:t[d],hash:c[d].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new z("Unable to parse state tree data");return c.map((d,g)=>({data:a.decode(d.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(d.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function Me(e,n,r,s,t){let c=null,a=null,i=null,o=new B;if(e){await o.addSystemAccounts();let{address:u}=await ae(n,r),d=(await Te([{address:u,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[d.leafIndex],leaves:[],treeInfos:[d.treeInfo],proveByIndices:[d.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:i=await w([d],[]);let g=o.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!g)throw new z("Unable to parse state tree data");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:g.packedTreeInfos[0]},data:Z().decode(d.data?.data)},a={accountMeta:{address:new Uint8Array(d.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:Z().decode(d.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:o,settingsMutArgs:a}}async function w(e,n,r=3,s=500){return nr(()=>tt().getValidityProofV0(e,n),{maxRetries:r,initialDelayMs:s})}async function he(){return (await wr()).length-1}var qs;async function wr(){if(!qs){let{data:e}=await ta(ce(),await sA());qs=e.whitelistedAddressTrees;}return qs}function nA(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 Vr(e,n,r){let s=await cP(e,n,r);if(!s)throw new ne("User account");return s}async function cP(e,n,r){let{address:s}=await N(e,n),t=await Nr(s,r);return t?.data?.data?$().decode(t.data.data):null}async function Ys(e,n,r){let s=await aP(e,n,r);if(!s)throw new ne("Settings account");return s}async function aP(e,n,r){try{let{address:s}=await ae(e,n),t=await Nr(s,r);if(!t?.data?.data)throw new ne("Compressed settings account");let c=Z().decode(t.data.data);if(c.data.__option==="None")throw new ne("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let s=await ys(ce(),await ue(e));return s.exists?{...s.data,isCompressed:false}:null}}async function Zs(e){qu(e,"index");let n=await wr();if(e>=n.length)throw new z(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function ww(e){let r=(await wr()).findIndex(s=>s.toString()===e);if(r===-1)throw new ne("Address tree",`Address ${e} not found in whitelist`);return r}async function ae(e,n=0){let r=await Zs(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("multi_wallet")),new Uint8Array(gill.getU128Encoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function N(e,n=0){let r=await Zs(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("user")),e instanceof Ne?e.toTruncatedBuffer():new Uint8Array(gill.getAddressEncoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function gt({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha2_js.sha256(new Uint8Array(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 dA(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function sA(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function uA(e,n,r){Ju(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 Ne?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return s}async function ve(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 ue(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function Xw(e){let n=await ue(e);return await ve(n)}async function Qw(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}async function or(e,n){if(!e.ok){await e.text().catch(()=>e.statusText);throw new De(`Request failed: ${e.statusText} (${e.status})`,e.status,n)}return e}async function cr(e){try{return await e.json()}catch(n){throw new De(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function u2(e){let n=tinyCbor.decodeCBOR(e),r=nist_js.p256.Point.fromAffine({x:BigInt("0x"+Fr(n.get(-2))),y:BigInt("0x"+Fr(n.get(-3)))});return gill.getBase58Decoder().decode(r.toBytes(true))}function A2(e){let r=nist_js.p256.Point.fromBytes(new Uint8Array(gill.getBase58Encoder().encode(e))).toBytes(false),s=new Map;return s.set(1,2),s.set(3,-7),s.set(-1,1),s.set(-2,r.slice(1,33)),s.set(-3,r.slice(33,65)),new Uint8Array(tinyCbor.encodeCBOR(s))}async function g2(e){let{authenticatorData:n,clientDataJSON:r,signature:s}=e.authResponse.response,t=new Uint8Array(Ve(n)),c=JSON.parse(new TextDecoder().decode(Ve(r))),a=pA(c),i=yA(new Uint8Array(Ve(s))),o=await gt({rpIdHash:t.subarray(0,32)});return new P(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Ve(r)),truncatedClientDataJson:a,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(gill.getBase58Encoder().encode(e.slotHash))},clientAndDeviceHash:Xs(e.clientSignature.clientOrigin,e.deviceSignature.publicKey,e.nonce),domainConfig:o,authData:t,signature:i,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function Xs(e,n,r){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...gill.getBase58Encoder().encode(n),...new TextEncoder().encode(r)]))}function y2(e){return sha2_js.sha256(new Uint8Array(gill.getUtf8Encoder().encode(JSON.stringify(e))))}function T2(e){return Qs(e.data.payload.authResponse)}function l2(e,n,r,s){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...Xs(n,r,s)]))}async function f2(e,n,r,s,t,c){let a;if(!t||!c){let o=(await ce().getAccountInfo(gill.address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!o)throw new ne("Slot sysvar","Unable to fetch slot sysvar data");let u=gill.getBase64Encoder().encode(o[0]);c=gill.getU64Decoder().decode(u.subarray(0,8)).toString(),a=u.subarray(8,40),t=gill.getBase58Decoder().decode(a);}else a=new Uint8Array(gill.getBase58Encoder().encode(t));let i=sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e.transactionActionType),...gill.getBase58Encoder().encode(e.transactionAddress),...sha2_js.sha256(typeof e.transactionMessageBytes=="string"?new Uint8Array(Ve(e.transactionMessageBytes)):e.transactionMessageBytes),...a,...Xs(n,r,s)]));return {slotNumber:c,slotHash:t,challenge:i}}function Qs(e){return sha2_js.sha256(zr(e))}function S2(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ve(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),a=new Uint8Array(c);for(let i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return c}async function x2(e,n){let{data:r}=await vo(ce(),e),t=mA(new Uint8Array(r.origins),r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Error("Origin not found in domain config");return t}function Fr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function TP(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 pA(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 mA(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let a=e[s]|e[s+1]<<8;if(s+=2,s+a>e.length)throw new Error("MaxLengthExceeded");let i=e.slice(s,s+a),o=t.decode(i);r.push(o),s+=a;}return r}function yA(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let C=n&127;r+=C;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let a=e[r+1],i=r+2,o=e.slice(i,i+a),u=c[0]===0&&c.length>32?c.slice(1):c,d=o[0]===0&&o.length>32?o.slice(1):o;if(u.length>32||d.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(u,32-u.length);let p=nist_js.p256.Point.CURVE().n>>1n,l=BigInt("0x"+Fr(d)),b=(l>p?nist_js.p256.Point.CURVE().n-l:l).toString(16).padStart(64,"0"),x=TP(b);return new Uint8Array([...g,...x])}function zr(e){return new Uint8Array([...new Uint8Array(Ve(e.response.authenticatorData)),...sha2_js.sha256(new Uint8Array(Ve(e.response.clientDataJSON)))])}async function $s(e,n=false){let r=n?{blockhash:gill.getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await ce().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(s.instructions,c),c=>gill.setTransactionMessageFeePayerSigner(s.payer,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?gill.compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let a=Math.ceil((s.unitsConsumed??0)*1.1);return a>2e5?gill.prependTransactionMessageInstructions([programs.getSetComputeUnitLimitInstruction({units:a})],c):c},async c=>n?gill.compileTransaction(await c):await gill.signTransactionMessageWithSigners(await c))))}async function SA(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===gill.AccountRole.WRITABLE||c.role===gill.AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,a)=>c-a);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function xA(e,n){rr(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 ut(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})}),{maxRetries:3,initialDelayMs:500});await or(r,n);let s=await cr(r);if(!s.result||s.error)throw new ye(`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 ye(`Simulation failed: ${c}`)}return s.result.value.transactionResults.map(t=>t.unitsConsumed)}function J(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,a=r?.authData&&r.verifyArgs.clientDataJson?zr(r.authResponse):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function mt(e){if(e instanceof Ne)return {keyType:tr.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:tr.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function fA(e){return e instanceof P?e.toString():e.address.toString()}function Se(e){let n=new Set,r=[];for(let t of e)n.has(fA(t))||(r.push(t),n.add(fA(t)));let s=r.filter(t=>t instanceof P);if(s.length>1)throw new z(`More than 1 Secp256r1 signers in an instruction is not supported (found ${s.length})`);return r}function IA({payer:e,tipAmount:n}){let r=en[Math.floor(Math.random()*en.length)];return programs.getTransferSolInstruction({source:e,destination:gill.address(r),amount:n})}async function j2(e){rr(e,"bundle");let n=await $s(e,true),r=await xA(n.map(gill.getBase64EncodedWireTransaction),Zu()),s=await $s(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await WP(s.map(gill.getBase64EncodedWireTransaction))}async function WP(e,n=3,r=500,s=js()){rr(e,"serializedTransactions");let{blockEngineUrl:t}=s,c=`${t}/bundles`,a=await ut(()=>fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})}),{maxRetries:n,initialDelayMs:r});await or(a,c);let i=await cr(a);if(i.error)throw new ye(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new ye("No bundle ID returned from Jito");return i.result}async function J2(e,n=30,r=3e3,s=js()){Yu(e,"bundleId");let{blockEngineUrl:t}=s,c=`${t}/getBundleStatuses`;return nr(async()=>{let a=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await or(a,c);let i=await cr(a);if(i.error)throw new ye(`Error getting bundle status: ${JSON.stringify(i.error,null,2)}`,e);if(!i.result?.value?.length)throw new ye("Bundle not yet confirmed",e);let o=i.result.value[0];if(o.confirmation_status==="confirmed"||o.confirmation_status==="finalized"){let u=o.transactions[o.transactions.length-1];if(!u)throw new ye("No transactions in confirmed bundle",e);return u}throw new ye(`Bundle status: ${o.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:a=>a instanceof ye||a instanceof De})}async function e5({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await ce().getLatestBlockhash().send(),t=await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(e,c),c=>gill.setTransactionMessageFeePayerSigner(n,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?gill.compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([Qu()(c),SA(ce(),c.instructions.flatMap(u=>u.accounts??[]))]),o=Math.ceil(a*1.1);return gill.prependTransactionMessageInstructions([...o>2e5?[programs.getSetComputeUnitLimitInstruction({units:o})]:[],...i>0?[programs.getSetComputeUnitPriceInstruction({microLamports:i})]:[]],c)},async c=>await gill.signTransactionMessageWithSigners(await c));return await Xu()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}function T5(e,n){if(n.threshold>1)throw new z("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(o=>DA(o.pubkey)===e);if(!r)throw new ne("Member",`Signer ${e} not found in settings`);let{permissions:s}=r;if(!s)throw new ne("Permissions","No permissions found for the current member");let t=Be.has(s,_e.InitiateTransaction),c=Be.has(s,_e.VoteTransaction),a=Be.has(s,_e.ExecuteTransaction);if(t&&c&&a)return {};if(!c||!a)throw new yr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,a?"ExecuteTransaction":void 0].filter(Boolean));let i=n.members.find(o=>o.role===2);if(!i)throw new ne("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:gill.address(DA(i.pubkey)),userAddressTreeIndex:i.userAddressTreeIndex}}async function l5({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await Vr(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new ne("Transaction manager endpoint","Transaction manager endpoint is missing for this account");return XP(n,c.transactionManagerUrl.value,e,s)}function XP(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(gill.getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=gill.getBase64Decoder().decode(s)),r&&(c.authResponses=r);let a=await ut(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)}),{maxRetries:3,initialDelayMs:500});if(!a.ok)throw new De(`Transaction manager request failed: ${a.statusText}`,a.status,n);let i=await a.json();if("error"in i)throw new De(`Transaction manager error: ${i.error}`,a.status,n);return i.signatures.map(o=>({[e]:gill.getBase58Encoder().encode(o)}))}}}function DA(e){return e.keyType===tr.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}function f5(e){let n=e.map(c=>Ge().encode(c)),r=4+n.reduce((c,a)=>c+a.length,0),s=new Uint8Array(r),t=0;s.set(gill.getU32Encoder().encode(e.length),t),t+=4;for(let c of n)s.set(c,t),t+=c.length;return s}function S5(e){let n=0,[r,s]=gill.getU32Decoder().read(e,n);n=s;let t=new Array(r);for(let c=0;c<r;c++){let a=ze().read(e,n);t[c]=a[0],n=a[1];}if(n!==e.length)throw new z(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function L5({payer:e,rpId:n,origins:r,authority:s}){let t=await gt({rpId:n}),c=new B;await c.addSystemAccounts();let a=await he(),{address:i,addressTree:o}=await N(s.address,a),u=[{address:i,tree:o,queue:o,type:"User"}],d=await w([],u),g=(await ge(c,d.treeInfos,d.roots,d.rootIndices,u))[0],{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),S=v(d,l);return await Ba({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function K5({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await ae(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await N(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await Te(a,t):[],o=await he(),{address:u,addressTree:d}=await N(r.member,o),g=[{address:u,type:"User",tree:d,queue:d}],p=await w(i,g),l=null,S=null,b=i.filter(G=>G.type==="Settings"),x=i.filter(G=>G.type==="User");b.length&&(l=de(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),b,Z())[0]),x.length&&(S=de(c,p.treeInfos.slice(1,2),p.leafIndices.slice(1,2),p.rootIndices.slice(1,2),p.proveByIndices.slice(1,2),x,$())[0]);let C=await ge(c,p.treeInfos.slice(i.length),p.roots.slice(i.length),p.rootIndices.slice(i.length),g),{remainingAccounts:_,systemOffset:I}=c.toAccountMetas(),W=v(p,I);return await Ha({payer:n,authority:e,compressedProofArgs:W,member:Vt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:l?gill.some({settingsMutArgs:l,transactionManager:S?gill.some(S):gill.none()}):gill.none(),userAccountCreationArgs:C[0],domainConfig:s,remainingAccounts:_})}async function Y5({payer:e}){let n=await dA();return Ka({payer:e,globalCounter:n})}async function $5({admin:e,rpId:n,disable:r}){let s=await gt({rpId:n});return ai({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function c6({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:a}=await ae(r,s),i=[{address:c,tree:a,queue:a,type:"Settings"}],o=await w([],i),u=(await ge(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:d,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return vi({compressedProofArgs:p,args:e,authority:n,settingsCreationArgs:u,remainingAccounts:d})}async function p6({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new B;await t.addSystemAccounts();let{address:c,addressTree:a}=await N(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await w([],i),u=(await ge(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:d,systemOffset:g}=t.toAccountMetas(),p=v(o,g);return Bi({compressedProofArgs:p,args:e,authority:n,userCreationArgs:u,remainingAccounts:d})}function $P(e,n,r,s){let t=eM(e,n),c=tM(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 eM(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,a=s-t,i=r-s-c;return n>=r?false:n<a?true:n>=s?n-s<i:false}function tM(e,n){return n<e.header.numSignerAccounts}async function Kr({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(i=>i.lookupTableAddress),ce()):{}),a=[];a.push(...t.addressTableLookups?.map(i=>({role:gill.AccountRole.READONLY,address:i.lookupTableAddress}))??[]);for(let[i,o]of t.staticAccounts.entries())a.push({address:o,role:$P(t,i,o,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let o=c[i.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let u of i.writableIndexes){let d=o[u];if(!d)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:d,role:gill.AccountRole.WRITABLE});}for(let u of i.readonlyIndexes){let d=o[u];if(!d)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${u}`);a.push({address:d,role:gill.AccountRole.READONLY});}}for(let i of s?.filter(o=>o.address!==e)??[]){let o=a.findIndex(u=>u.address===i.address);o===-1?a.push({address:i.address,role:gill.AccountRole.READONLY_SIGNER,signer:i}):a[o].role===gill.AccountRole.READONLY||a[o].role===gill.AccountRole.READONLY_SIGNER?a[o]={address:i.address,role:gill.AccountRole.READONLY_SIGNER,signer:i}:(a[o].role===gill.AccountRole.WRITABLE||a[o].role===gill.AccountRole.WRITABLE_SIGNER)&&(a[o]={address:i.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:i});}return {accountMetas:a,addressLookupTableAccounts:c,transactionMessage:t}}var yt=33,Tt=64,no=14,iM=2,dM=gill.address("Secp256r1SigVerify1111111111111111111111111");function uM(){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 AM(){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 s=gill.getU8Decoder().decode(e,n);n+=1;let t=[],c=AM();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=no;let a=[];for(let i=0;i<r;i++){let o=gill.fixDecoderSize(gill.getBytesDecoder(),yt).decode(e,n);n+=yt;let u=gill.fixDecoderSize(gill.getBytesDecoder(),Tt).decode(e,n);n+=Tt;let d=t[i].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),d).decode(e,n);n+=d,a.push({publicKey:o,signature:u,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function vA(){return gill.createEncoder({getSizeFromValue:e=>{let n=no*e.offsets.length,r=e.payload.reduce((s,t)=>s+yt+Tt+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=uM();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=gill.fixEncoderSize(gill.getBytesEncoder(),yt).write(t.publicKey,n,r),r=gill.fixEncoderSize(gill.getBytesEncoder(),Tt).write(t.signature,n,r),r=gill.getBytesEncoder().write(t.message,n,r);return r}})}function R6(){return gill.combineCodec(vA(),_A())}function V(e,n){let r=e.length,s=iM+r*no,t=[];for(let o=0;o<r;o++){let{message:u}=e[o],d=s,g=d+yt,p=g+Tt;t.push({publicKeyOffset:d,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:u.length,messageInstructionIndex:65535}),s+=yt+Tt+u.length;}let c=n?.programAddress??dM,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:vA().encode(a)}}function b6(e){return {programAddress:e.programAddress,accounts:{},data:_A().decode(e.data)}}async function UA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let u=await ve(e),{accountMetas:d,addressLookupTableAccounts:g}=await Kr({transactionMessageBytes:r,walletAddress:u,additionalSigners:a,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(V(c)),p.push(o?Pu({transactionBuffer:n,payer:s.address,remainingAccounts:d,settingsKey:e}):Su({transactionBuffer:n,payer:s.address,settings:e})),i&&p.push(IA({payer:s,tipAmount:i})),{instructions:p,addressLookupTableAccounts:g}}async function WA({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:u}){let d=Se(s),g=await ue(e),p=await ve(g),[{accountMetas:l,addressLookupTableAccounts:S,transactionMessage:b},{settingsMutArgs:x,proof:C,packedAccounts:_}]=await Promise.all([Kr({transactionMessageBytes:r,walletAddress:p,additionalSigners:d.filter(ee=>!(ee instanceof P)),addressesByLookupTableAddress:c}),Me(i,e,n,o,u)]);_.addPreAccounts(l);let I=d.filter(ee=>ee instanceof P),{secp256r1VerifyArgs:W}=pM(I,a,_),{remainingAccounts:G,systemOffset:q}=_.toAccountMetas();return {instructions:mM({secp256r1VerifyInput:a,transactionMessage:b,accountMetas:l,compressed:i,payer:t,settingsMutArgs:x,proof:C,systemOffset:q,secp256r1VerifyArgs:W,settings:g,remainingAccounts:G}),addressLookupTableAccounts:S}}function pM(e,n,r){let s=[];for(let t of e){let c=n.length,{domainConfig:a,verifyArgs:i,signature:o,publicKey:u,message:d}=J(t,c);d&&o&&u&&n.push({message:d,signature:o,publicKey:u}),a&&(r.addPreAccounts([{address:a,role:gill.AccountRole.READONLY}]),i.__option==="Some"&&s.push({domainConfigKey:a,verifyArgs:i.value}));}return {secp256r1VerifyArgs:s}}function mM({secp256r1VerifyInput:e,transactionMessage:n,accountMetas:r,compressed:s,payer:t,settingsMutArgs:c,proof:a,systemOffset:i,secp256r1VerifyArgs:o,settings:u,remainingAccounts:d}){let g=[];e.length>0&&g.push(V(e));let p=yM(n,r);if(s){if(!t||!c)throw new Error("Payer not found or proof args is missing.");let l=v(a,i);g.push(Bu({secp256r1VerifyArgs:o,transactionMessage:p,settingsMutArgs:c,compressedProofArgs:l,payer:t,remainingAccounts:d}));}else g.push(vu({secp256r1VerifyArgs:o,settings:u,transactionMessage:p,remainingAccounts:d}));return g}function yM(e,n){if(e.version==="legacy")throw new Error("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:new Uint8Array(r.data??[])})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(s=>s.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function $6({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=Se(s),u=await ue(e),d=await ve(u),[{packedAccounts:g,proof:p,settingsMutArgs:l},{value:S}]=await Promise.all([Me(i,e,n,false,t),rt(d,t)]);if((S?.lamports??0)<BigInt(c))throw new Error("Insufficient balance");let b=[],x=[];for(let W of o)if(W instanceof P){let G=b.length,{domainConfig:q,verifyArgs:ie,signature:ee,publicKey:le,message:Ae}=J(W,G);Ae&&ee&&le&&b.push({message:Ae,signature:ee,publicKey:le}),q&&(g.addPreAccounts([{address:q,role:gill.AccountRole.READONLY}]),ie.__option==="Some"&&x.push({domainConfigKey:q,verifyArgs:ie.value}));}else g.addPreAccounts([{address:W.address,role:gill.AccountRole.READONLY_SIGNER,signer:W}]);let{remainingAccounts:C,systemOffset:_}=g.toAccountMetas(),I=[];if(b.length>0&&I.push(V(b)),i){if(!a||!l)throw new Error("Payer not found or proof args is missing.");let W=v(p,_);I.push(Ji({amount:c,settingsMutArgs:l,compressedProofArgs:W,payer:a,secp256r1VerifyArgs:x,source:d,destination:r,remainingAccounts:C}));}else I.push(Hi({amount:c,secp256r1VerifyArgs:x,source:d,destination:r,settings:u,remainingAccounts:C}));return I}var IM=gill.address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),CM=gill.address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Jr=gill.address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function gV({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,splInterfacePdaArgs:u={index:0,restricted:false},compressed:d=false}){let g=Se(t),p=await ue(e),l=await ve(p),S=U=>gill.getProgramDerivedAddress({seeds:[gill.getAddressEncoder().encode(U),gill.getAddressEncoder().encode(Jr),gill.getAddressEncoder().encode(s)],programAddress:Jr}),b=()=>{let U=[gill.getUtf8Encoder().encode("pool"),gill.getAddressEncoder().encode(s)];return u.restricted&&U.push(gill.getUtf8Encoder().encode("restricted")),u.index>0&&U.push(gill.getU8Encoder().encode(u.index)),U},[x,[C],_,[I],[W]]=await Promise.all([programs.getAssociatedTokenAccountAddress(s,l,o),S(l),programs.getAssociatedTokenAccountAddress(s,r,o),S(r),gill.getProgramDerivedAddress({seeds:b(),programAddress:Jr})]),[G,q,ie,ee]=await Promise.all([rt(_,c),rt(x,c),rt(C,c),PM(d,e,n,c)]),le=!!G.value,Ae=!!q.value,lt=!!ie.value,ft=Ae?programs.getTokenDecoder().decode(gill.getBase64Encoder().encode(q.value.data[0])).amount:BigInt(0),ct=BigInt(lt?MM(new Uint8Array(gill.getBase64Encoder().encode(ie.value.data[0])))?.amount??0:0),ir=le?_:void 0,Xr=le?void 0:I,St=Ae&&(ft+ct<BigInt(a)||ct>BigInt(0)||!le)||!Ae&&le,T=!le,[me,Ao]=await Promise.all([DM(l,s,ft,ct,BigInt(a),d?3:4),EM(St,W,c)]),Y=me.reduce((U,re)=>U+re.parsed.amount.toNumber(),0);if(ft+ct+BigInt(Y)<BigInt(a))throw new Error("Insufficient balance");let at=null,Ue=null,We=new B;if(Ao&&We.addPreAccounts([{address:s,role:gill.AccountRole.WRITABLE}]),ee||me.length){await We.addSystemAccounts();let U=[];if(me.length&&U.push(...me.map(re=>({hash:re.compressedAccount.hash,tree:re.compressedAccount.treeInfo.tree,queue:re.compressedAccount.treeInfo.queue,data:re.compressedAccount.data,address:re.compressedAccount.address}))),ee&&U.push(ee),Ue=await w(U,[]),ee){let re=me.length;at=de(We,Ue.treeInfos.slice(re),Ue.leafIndices.slice(re),Ue.rootIndices.slice(re),Ue.proveByIndices.slice(re),U.slice(re),Z())[0];}}let QA=me.length&&Ue?gill.some(me.map((U,re)=>({isFrozen:U.parsed.state===programs.AccountState.Frozen,hasDelegate:U.parsed.delegate!=null,amount:U.parsed.amount.toNumber(),merkleContext:{leafIndex:U.compressedAccount.leafIndex,merkleTreePubkeyIndex:We.insertOrGet(U.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:We.insertOrGet(U.compressedAccount.treeInfo.queue.toString()),proveByIndex:U.compressedAccount.proveByIndex},rootIndex:Ue.rootIndices[re],version:nA(U.compressedAccount.data?.discriminator),tlv:U.parsed.tlv?gill.some(gill.getArrayDecoder(Lt()).decode(U.parsed.tlv)):gill.none()}))):gill.none(),dr=[],go=[];for(let U of g)if(U instanceof P){let re=dr.length,{domainConfig:Qr,verifyArgs:mo,signature:yo,publicKey:To,message:lo}=J(U,re);lo&&yo&&To&&dr.push({message:lo,signature:yo,publicKey:To}),Qr&&(We.addPreAccounts([{address:Qr,role:gill.AccountRole.READONLY}]),mo.__option==="Some"&&go.push({domainConfigKey:Qr,verifyArgs:mo.value}));}else We.addPreAccounts([{address:U.address,role:gill.AccountRole.READONLY_SIGNER,signer:U}]);let{remainingAccounts:$A,systemOffset:eg}=We.toAccountMetas(),ur=[];dr.length>0&&ur.push(V(dr));let tg=v(Ue,eg),rg=St?W:void 0,ng=T?CM:void 0,sg=St?gill.some(u):gill.none(),po={amount:a,secp256r1VerifyArgs:go,source:l,destination:r,sourceCtokenTokenAccount:C,sourceSplTokenAccount:x,destinationCtokenTokenAccount:Xr,destinationSplTokenAccount:ir,mint:s,tokenProgram:o,remainingAccounts:$A,payer:i,sourceCompressedTokenAccounts:QA,compressedProofArgs:tg,compressibleConfig:IM,splInterfacePda:rg,rentSponsor:ng,splInterfacePdaArgs:sg};if(d){if(!at)throw new Error("Payer not found or proof args is missing.");ur.push(ad({...po,settingsMutArgs:at}));}else ur.push($i({...po,settings:p}));return ur}async function EM(e,n,r){if(!e)return false;let{value:s}=await rt(n,r);return !s}async function DM(e,n,r,s,t,c){let a=t-r-s;if(a<=0)return [];let o=(await tt().getCompressedTokenAccountsByOwner(new web3_js.PublicKey(e),{mint:new web3_js.PublicKey(n)})).items.filter(g=>!!g.compressedAccount.data?.data.length&&g.compressedAccount.owner.toString()===Jr.toString()&&!g.parsed.amount.isZero()).sort((g,p)=>p.parsed.amount.cmp(g.parsed.amount));if(o.length===0)return [];let u=BigInt(0),d=[];for(let g of o){if(d.length>=c||u>=a)break;u+=BigInt(g.parsed.amount.toNumber()),d.push(g);}if(u<a)throw d.length>=c?new Error("Transaction size limit exceeded. Consider multiple transfers to transfer full balance."):new Error("Insufficient balance.");return d}async function PM(e,n,r,s){if(!e)return null;let{address:t}=await ae(n,r);return (await Te([{address:t,type:"Settings"}],s))[0]}function MM(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 EV({signers:e,payer:n,changeConfigArgs:r}){let{index:s,configActions:t,compressed:c,packedAccounts:a,proof:i,settingsMutArgs:o}=r,u=Se(e),d=u.filter(_=>!(_ instanceof P));a.addPreAccounts(d.map(_=>({address:_.address,role:gill.AccountRole.READONLY_SIGNER,signer:_})));let g=u.filter(_=>_ instanceof P),p=[],l=[];for(let _ of g){let I=l.length,{domainConfig:W,verifyArgs:G,signature:q,publicKey:ie,message:ee}=J(_,I);ee&&q&&ie&&l.push({message:ee,signature:q,publicKey:ie}),W&&(a.addPreAccounts([{address:W,role:gill.AccountRole.READONLY}]),G.__option==="Some"&&p.push({domainConfigKey:W,verifyArgs:G.value}));}let{remainingAccounts:S,systemOffset:b}=a.toAccountMetas(),x=v(i,b),C=[];if(l.length>0&&C.push(V(l)),c){if(!o)throw new Error("Payer not found or proof args is missing.");C.push(Ca({configActions:t,payer:n,compressedProofArgs:x,settingsMutArgs:o,remainingAccounts:S,secp256r1VerifyArgs:p}));}else C.push(await ma({settingsIndex:s,configActions:t,payer:n,compressedProofArgs:x,remainingAccounts:S,secp256r1VerifyArgs:p}));return C}async function _V({createUserArgs:e,payer:n}){let r=new B;await r.addSystemAccounts(),r.addPreAccounts(e.map(d=>({address:d.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:d.member})));let s=await he(),t=await Promise.all(e.map(async d=>{let{address:g,addressTree:p}=await N(d.member.address,s);return {address:g,tree:p,queue:p,type:"User"}})),c=await w([],t),a=await ge(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),u=v(c,o);return await Ya({compressedProofArgs:u,payer:n,createUserArgs:e.map((d,g)=>({member:d.member.address,role:d.role,userCreationArgs:a[g],transactionManagerUrl:d.role===2?d.transactionManagerUrl:null})),remainingAccounts:i})}async function BV({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,cachedAccounts:t}){let c=new B;await c.addSystemAccounts();let a=[],i=[];i.push(...await Te([{address:(await N(r.address,s)).address,type:"User"}],t));let o=await he(),{address:u,addressTree:d}=await ae(e,o);a.push({address:u,queue:d,tree:d,type:"Settings"});let g=i.length,p=await w(i,a),l=de(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),i.filter(I=>I.type==="User"),$())[0],b=(await ge(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),a)).find(I=>I.type==="Settings")??null,{remainingAccounts:x,systemOffset:C}=c.toAccountMetas(),_=v(p,C);if(!b)throw new Error("Settings creation args is missing.");return await ha({settingsIndex:e,payer:n,initialMember:r,userReadonlyArgs:l,compressedProofArgs:_,settingsCreation:b,remainingAccounts:x})}async function jV({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let{packedAccounts:c,proof:a,settingsMutArgs:i}=await Me(true,e,n,false,t);if(!i)throw new Error("Proof args is missing");let o=Se(s),u=o.filter(C=>C instanceof P),d=[],g=[];for(let C of u){let _=d.length,{domainConfig:I,verifyArgs:W,signature:G,publicKey:q,message:ie}=J(C,_);ie&&G&&q&&d.push({message:ie,signature:G,publicKey:q}),I&&(c.addPreAccounts([{address:I,role:gill.AccountRole.READONLY}]),W.__option==="Some"&&g.push({domainConfigKey:I,verifyArgs:W.value}));}c.addPreAccounts(o.filter(C=>"address"in C).map(C=>({address:C.address,role:gill.AccountRole.READONLY_SIGNER,signer:C})));let{remainingAccounts:p,systemOffset:l}=c.toAccountMetas(),S=v(a,l),b=[];d.length>0&&b.push(V(d));let x=await ue(e);return b.push(ti({settings:x,payer:r,settingsMutArgs:i,compressedProofArgs:S,secp256r1VerifyArgs:g,remainingAccounts:p})),b}async function $V({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let a=new B;await a.addSystemAccounts();let i=await he(),{address:o,addressTree:u}=await N(r.address,i),d=[{address:o,tree:u,queue:u,type:"User"}],g=await w([],d),p=(await ge(a,g.treeInfos,g.roots,g.rootIndices,d))[0],l=a.toAccountMetas();c=l.remainingAccounts,t={compressedProofArgs:v(g,l.systemOffset),authorityCreationArgs:p};}return pi({domainConfig:n,authority:e,newOrigins:s?gill.some(s):gill.none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function o8({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new B;await s.addSystemAccounts();let t=await Te([{address:(await N(e.address,n)).address,type:"User"}]),c=await w(t,[]),a=de(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,$())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),u=v(c,o);return Si({authority:e,transactionManagerUrl:r,compressedProofArgs:u,userMutArgs:a,remainingAccounts:i})}async function y8({payer:e,user:n,userAddressTreeIndex:r,newDelegate:s,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:a,message:i,signature:o,publicKey:u}=J(n),d=[];i&&o&&u&&d.push({message:i,signature:o,publicKey:u});let g=await Vr(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 l,S=null,b,x=null;g.delegatedTo.__option==="Some"&&((await Ys(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(g.delegatedTo.value.index,g.delegatedTo.value.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):l=await ue(g.delegatedTo.value.index)),s&&((await Ys(s.index,s.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await ae(s.index,s.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):b=await ue(s.index));let C=new B;await C.addSystemAccounts();let _=await Te(p,t),I=await w(_,[]),W=de(C,I.treeInfos.slice(0,1),I.leafIndices.slice(0,1),I.rootIndices.slice(0,1),I.proveByIndices.slice(0,1),_.slice(0,1),$())[0],G=S?gill.some(de(C,I.treeInfos.slice(S.start,S.end),I.leafIndices.slice(S.start,S.end),I.rootIndices.slice(S.start,S.end),I.proveByIndices.slice(S.start,S.end),_.slice(S.start,S.end),Z())[0]):gill.none(),q=x?gill.some(de(C,I.treeInfos.slice(x.start,x.end),I.leafIndices.slice(x.start,x.end),I.rootIndices.slice(x.start,x.end),I.proveByIndices.slice(x.start,x.end),_.slice(x.start,x.end),Z())[0]):gill.none(),{remainingAccounts:ie,systemOffset:ee}=C.toAccountMetas(),le=v(I,ee),Ae=[];return d.length>0&&Ae.push(V(d)),Ae.push(Pi({secp256r1VerifyArgs:a,domainConfig:c,delegateTo:s?gill.some(s):gill.none(),feePayer:e,signer:n instanceof P?void 0:n,oldSettings:l,oldSettingsMutArgs:G,newSettings:b,newSettingsMutArgs:q,compressedProofArgs:le,userMutArgs:W,remainingAccounts:ie})),Ae}async function v8({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await Yc(ce(),s),o=i.data.multiWalletSettings,{packedAccounts:u,proof:d,settingsMutArgs:g}=await Me(c,e,n,false,a),{remainingAccounts:p,systemOffset:l}=u.toAccountMetas(),{domainConfig:S,verifyArgs:b,message:x,signature:C,publicKey:_}=J(r),I=[];if(x&&C&&_&&I.push(V([{message:x,signature:C,publicKey:_}])),c){if(!t||!g)throw new Error("Payer not found or proof args is missing.");let W=v(d,l);I.push(Sd({transactionBuffer:s,domainConfig:S,closer:r instanceof P?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:b,settingsMutArgs:g,payer:t,compressedProofArgs:W,remainingAccounts:p}));}else I.push(pd({transactionBuffer:s,domainConfig:S,closer:r instanceof P?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:b,remainingAccounts:[]}));return I}function FA({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:u,expectedSecp256r1Signers:d}){let{domainConfig:g,verifyArgs:p,message:l,signature:S,publicKey:b}=J(n),x=[];if(l&&S&&b&&x.push(V([{message:l,signature:S,publicKey:b}])),u){let{settingsReadonlyArgs:C,compressedProofArgs:_,remainingAccounts:I}=u;x.push(vd({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:d},settingsReadonlyArgs:C,compressedProofArgs:_,remainingAccounts:I}));}else x.push(Pd({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof P?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:d},remainingAccounts:[]}));return x}function GA({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=J(e),u=[];return i&&a&&o&&u.push(V([{message:i,signature:a,publicKey:o}])),s?u.push(Gd({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})):u.push(Bd({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof P?void 0:e,remainingAccounts:[]})),u}function zA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?tu({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Yd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function KA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=J(n),u=[];return o&&a&&i&&u.push(V([{message:o,signature:a,publicKey:i}])),s?u.push(pu({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})):u.push(au({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof P?void 0:n,remainingAccounts:[]})),u}async function xH({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:s,compressed:t=false}){let c=await _M(r),a=new B,i=null,o=null,u=[];if(c.length||t){let g=await vM({packedAccounts:a,userAccounts:c,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:s});i=g.proof,o=g.settingsMutArgs??null,u=g.userMutArgs??[];}return {configActions:await UM({configActionsArgs:r,userMutArgs:u,index:e}),index:e,proof:i,settingsMutArgs:o,packedAccounts:a,compressed:t}}async function _M(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 vM({packedAccounts:e,userAccounts:n,compressed:r,index:s,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let a=[];if(r){let l=(await ae(s,t)).address;a.push({address:l,type:"Settings"});}n.length&&a.push(...n);let i=a.length?await Te(a,c):[];if(!i.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let o=await w(i,[]),u=[],d=[];for(let l of i)l.type==="Settings"?u.push(l):l.type==="User"&&d.push(l);let g,p=[];if(r&&o&&(g=de(e,o.treeInfos.slice(0,1),o.leafIndices.slice(0,1),o.rootIndices.slice(0,1),o.proveByIndices.slice(0,1),u,Z())[0]),d.length&&o){let l=r?1:0;p=de(e,o.treeInfos.slice(l),o.leafIndices.slice(l),o.rootIndices.slice(l),o.proveByIndices.slice(l),d,$());}return {proof:o,settingsMutArgs:g,userMutArgs:p}}async function UM({index:e,configActionsArgs:n,userMutArgs:r}){let s=[];for(let t of n)switch(t.type){case "AddMembers":{let c=[];for(let a of t.members){let i=await N(a.member,a.userAddressTreeIndex).then(o=>r.find(u=>utils_js.equalBytes(new Uint8Array(u.accountMeta.address),new Uint8Array(gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(o.address))))));if(!i)throw new Error("Unable to find user account");c.push(LM({permissionArgs:a.permissions,userMutArgs:i,pubkey:a.member}));}s.push({__kind:t.type,fields:[c]});break}case "RemoveMembers":{let c=await Promise.all(t.members.map(a=>N(a.member,a.userAddressTreeIndex).then(i=>{let o=r.find(u=>utils_js.equalBytes(new Uint8Array(u.accountMeta.address),new Uint8Array(gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(i.address)))));if(!o)throw new Error("Unable to find user account");return kM({pubkey:a.member,userMutArgs:o,index:e})})));s.push({__kind:t.type,fields:[c]});break}case "EditPermissions":{let c=t.members.map(a=>WM({permissionArgs:a.permissions,pubkey:a.member}));s.push({__kind:t.type,fields:[c]});break}default:s.push({__kind:t.type,fields:[t.threshold]});}return s}function WM({pubkey:e,permissionArgs:n}){return {memberKey:mt(e),permissions:YA(n)}}function kM({pubkey:e,userMutArgs:n,index:r}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");let s=n.data.delegatedTo.__option==="Some"?Number(n.data.delegatedTo.value.index.toString())===r:false;return {memberKey:mt(e),userArgs:s?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function LM({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===1)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===2&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:mt(e),permissions:YA(n),userReadonlyArgs:r}}function YA(e){let n=[];return e.initiate&&n.push(_e.InitiateTransaction),e.vote&&n.push(_e.VoteTransaction),e.execute&&n.push(_e.ExecuteTransaction),Be.fromPermissions(n)}async function RH({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:u=false,additionalVoters:d=[],additionalSigners:g=[],chunkSize:p=Math.ceil(s.length/2),cachedAccounts:l}){let S=await ue(n),b=Math.floor(Math.random()*255),x=await uA(S,t instanceof P?t:t.address,b),C=[],_=[];for(let Y=0;Y<s.length;Y+=p){let at=s.subarray(Y,Y+p);C.push(at),_.push(sha2_js.sha256(at));}let I=sha2_js.sha256(new Uint8Array(s)),{settingsReadonlyArgs:W,settingsMutArgs:G,proof:q,packedAccounts:ie}=await Me(u,n,r,false,l),{remainingAccounts:ee,systemOffset:le}=ie.toAccountMetas(),Ae=q&&W&&G?{settingsReadonlyArgs:W,settingsMutArgs:G,compressedProofArgs:v(q,le),remainingAccounts:ee,payer:e}:null,lt=Se([t,...c?[c]:[],...d]).filter(Y=>Y instanceof P).map(Y=>({memberKey:mt(Y),messageHash:Qs(Y.authResponse)})),ft=FA({finalBufferHash:I,finalBufferSize:s.length,bufferIndex:b,payer:e,transactionBufferAddress:x,settings:S,creator:t,preauthorizeExecution:!c,bufferExtendHashes:_,compressedArgs:Ae,expectedSecp256r1Signers:lt}),ct=C.map(Y=>zA({transactionMessageBytes:Y,transactionBufferAddress:x,settings:S,compressed:u})),ir=d.map(Y=>KA({voter:Y,transactionBufferAddress:x,settings:S,compressedArgs:Ae})),Xr=GA({compressedArgs:Ae,settings:S,executor:c,transactionBufferAddress:x}),{instructions:St,addressLookupTableAccounts:T}=await UA({compressed:u,settings:S,transactionMessageBytes:s,transactionBufferAddress:x,payer:e,additionalSigners:g,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),me=Y=>({payer:e,instructions:Y,addressesByLookupTableAddress:T});return [me(ft),...ct.map(Y=>me([Y])),...ir.length?[me(ir.flat())]:[],me(Xr),me(St)]}var Yr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=a=>{let i=s.get(a);return i===void 0&&(i={isSigner:false,isWritable:false,isInvoked:false},s.set(a,i)),i},c=t(r);c.isSigner=true,c.isWritable=true;for(let a of n){t(a.programAddress).isInvoked=false;for(let i of a.accounts??[]){let o=t(i.address);o.isSigner||=i.role===gill.AccountRole.READONLY_SIGNER||i.role===gill.AccountRole.WRITABLE_SIGNER,o.isWritable||=i.role===gill.AccountRole.WRITABLE||i.role===gill.AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),a={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let i=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [a,i]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&a.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&!a.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,a]of this.keyMetaMap.entries())if(r(a)){let i=c,o=n.findIndex(u=>u===i);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(i),this.keyMetaMap.delete(c);}}return [s,t]}};var 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 s=new Map;this.keySegments().flat().forEach((c,a)=>{s.set(c,a);});let t=c=>{let a=s.get(c);if(a===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return a};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(a=>t(a.address))??[],data:c.data}))}};function XA({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=Yr.compile(r,e),c=new Array,a={writable:[],readonly:[]},i=Object.entries(s??{});for(let p of i){let l=t.extractTableLookup(p);if(l!==void 0){let{addressTableLookup:S,drainedKeys:b}=l;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:gill.address(S.lookupTableAddress)}),a.writable.push(...b.writable),a.readonly.push(...b.readonly);}}let[o,u]=t.getMessageComponents(),g=new Zr(u,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:u,addressTableLookups:c}}function HH({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=XA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return Ku(s)}async function jH({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:u=false}){let{instructions:d,addressLookupTableAccounts:g}=await WA({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:i});return {payer:e,instructions:d,addressesByLookupTableAddress:g}}
2
+ exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=oa;exports.AuthenticationContextSchema=Hu;exports.BACKOFF_MAX_DELAY_MS=pr;exports.BUNDLE_POLL_DELAY_MS=xo;exports.BUNDLE_POLL_MAX_RETRIES=So;exports.BaseResponseSchema=Fu;exports.BundleError=ye;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=Sa;exports.CHANGE_CONFIG_DISCRIMINATOR=ga;exports.COMPUTE_UNIT_MULTIPLIER=fo;exports.CREATE_COMPRESSED_WALLET_DISCRIMINATOR=Pa;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=La;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=wa;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=Ga;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=Ja;exports.CompleteMessageRequestSchema=LN;exports.CompleteTransactionRequestSchema=ON;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=Qa;exports.DEFAULT_JITO_BLOCK_ENGINE_URL=Io;exports.DEFAULT_JITO_TIPS_URL=Co;exports.DEFAULT_JITO_TIP_PRIORITY=Eo;exports.DEFAULT_NETWORK_RETRY_DELAY_MS=Le;exports.DEFAULT_NETWORK_RETRY_MAX_RETRIES=ke;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=si;exports.DOMAIN_CONFIG_DISCRIMINATOR=Ro;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=Ai;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=Ti;exports.EDIT_USER_DELEGATE_DISCRIMINATOR=Ci;exports.EXPONENTIAL_BACKOFF_BASE=gr;exports.GLOBAL_COUNTER_DISCRIMINATOR=ko;exports.HTTP_STATUS_BAD_REQUEST=Po;exports.HTTP_STATUS_INTERNAL_SERVER_ERROR=tn;exports.HTTP_STATUS_TOO_MANY_REQUESTS=Mo;exports.JITO_TIP_ACCOUNTS=en;exports.KeyType=tr;exports.MAX_TRANSACTION_BUFFER_INDEX=Do;exports.MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR=Ri;exports.MIGRATE_COMPRESSED_USERS_DISCRIMINATOR=ki;exports.MIN_COMPUTE_UNITS=Ar;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=zE;exports.MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH=IE;exports.MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED=kD;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=uD;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=AD;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH=UD;exports.MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE=FD;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=DE;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=EE;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=kE;exports.MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS=lD;exports.MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH=UE;exports.MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH=CE;exports.MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH=_E;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=$E;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=eD;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=tD;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=KE;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=jE;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=wE;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX=vD;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=mD;exports.MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG=WE;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=HE;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=QE;exports.MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT=fD;exports.MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS=qE;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=NE;exports.MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG=hE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION=yE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY=fE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=mE;exports.MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS=lE;exports.MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER=dD;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=aD;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=OE;exports.MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE=RD;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG=vE;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION=bE;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=BE;exports.MULTI_WALLET_ERROR__INVALID_USER_ROLE=VE;exports.MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG=OD;exports.MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR=hD;exports.MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE=SE;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=oD;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=gD;exports.MULTI_WALLET_ERROR__MEMBER_NOT_FOUND=ID;exports.MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS=_D;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=FE;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS=SD;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT=DD;exports.MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT=BD;exports.MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR=MD;exports.MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS=xD;exports.MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS=GE;exports.MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY=VD;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE=wD;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA=yD;exports.MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT=ND;exports.MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA=PD;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=cD;exports.MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS=WD;exports.MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES=HD;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=ZE;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=ME;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=RE;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=pD;exports.MULTI_WALLET_ERROR__PAYER_MISMATCH=ED;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=PE;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=sD;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=xE;exports.MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH=CD;exports.MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS=TE;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=iD;exports.MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH=bD;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=LE;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=rD;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=nD;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=XE;exports.MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY=LD;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=YE;exports.MULTI_WALLET_PROGRAM_ADDRESS=A;exports.MultiWalletAccount=AE;exports.MultiWalletInstruction=gE;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=zi;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=wi;exports.NetworkError=De;exports.NotFoundError=ne;exports.NotInitializedError=Oe;exports.Permission=_e;exports.PermissionError=yr;exports.Permissions=Be;exports.RetryExhaustedError=mr;exports.RevibaseError=Ee;exports.SETTINGS_DISCRIMINATOR=wc;exports.Secp256r1Key=Ne;exports.SignedSecp256r1Key=P;exports.StartMessageRequestSchema=WN;exports.StartTransactionRequestSchema=kN;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=od;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=Xi;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=Td;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=ud;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=Rd;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=Cd;exports.TRANSACTION_BUFFER_DISCRIMINATOR=jc;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=Vd;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=kd;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=Qd;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=jd;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=uu;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=su;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=Cu;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=Tu;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=ku;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=Ru;exports.TRANSACTION_SIZE_LIMIT=$r;exports.TransactionActionTypeSchema=wu;exports.TransactionDetailsSchema=GD;exports.TransactionError=ho;exports.TransactionPayloadSchema=UN;exports.TransactionPayloadWithBase64MessageBytesSchema=Vu;exports.UserRole=it;exports.ValidationError=z;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=Qc;exports.addWhitelistedAddressTrees=MN;exports.base64URLStringToBuffer=Ve;exports.bufferToBase64URLString=S2;exports.changeConfig=EV;exports.closeTransactionBuffer=v8;exports.configAction=Kh;exports.convertMemberKeyToString=DA;exports.convertPubkeyCompressedToCose=A2;exports.convertPubkeyCoseToCompressed=u2;exports.createClientAuthorizationCompleteRequestChallenge=T2;exports.createClientAuthorizationStartRequestChallenge=y2;exports.createDomainConfig=L5;exports.createDomainUserAccounts=K5;exports.createGlobalCounter=Y5;exports.createMessageChallenge=l2;exports.createTransactionBuffer=FA;exports.createTransactionChallenge=f2;exports.createTransactionManagerSigner=XP;exports.createUserAccounts=_V;exports.createWallet=BV;exports.decodeDomainConfig=_o;exports.decodeGlobalCounter=Oo;exports.decodeSettings=Hc;exports.decodeTransactionBuffer=qc;exports.decodeWhitelistedAddressTree=ea;exports.decompressSettingsAccount=jV;exports.deserializeConfigActions=S5;exports.disableDomainConfig=$5;exports.editDomainConfig=$V;exports.editTransactionManagerUrl=o8;exports.editUserDelegate=y8;exports.executeTransaction=UA;exports.executeTransactionBuffer=GA;exports.executeTransactionSync=WA;exports.extendTransactionBuffer=zA;exports.extensionStruct=dR;exports.fetchAllDomainConfig=FM;exports.fetchAllGlobalCounter=YM;exports.fetchAllMaybeDomainConfig=fg;exports.fetchAllMaybeGlobalCounter=kg;exports.fetchAllMaybeSettings=Al;exports.fetchAllMaybeTransactionBuffer=vl;exports.fetchAllMaybeWhitelistedAddressTree=Xl;exports.fetchAllSettings=Dv;exports.fetchAllTransactionBuffer=_v;exports.fetchAllWhitelistedAddressTree=Lv;exports.fetchDomainConfig=vo;exports.fetchGlobalCounter=qM;exports.fetchMaybeDomainConfig=lg;exports.fetchMaybeGlobalCounter=Wg;exports.fetchMaybeSettings=ys;exports.fetchMaybeSettingsAccountData=aP;exports.fetchMaybeTransactionBuffer=_l;exports.fetchMaybeUserAccountData=cP;exports.fetchMaybeWhitelistedAddressTree=Zl;exports.fetchSettings=Ev;exports.fetchSettingsAccountData=Ys;exports.fetchTransactionBuffer=Yc;exports.fetchUserAccountData=Vr;exports.fetchWhitelistedAddressTree=ta;exports.getAddMemberArgsCodec=nh;exports.getAddMemberArgsDecoder=on;exports.getAddMemberArgsEncoder=sn;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=Qv;exports.getAddWhitelistedAddressTreesInstruction=eU;exports.getAddWhitelistedAddressTreesInstructionAsync=aa;exports.getAddWhitelistedAddressTreesInstructionDataCodec=$v;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=ca;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=Es;exports.getAdditionalMetadataCodec=$M;exports.getAdditionalMetadataDecoder=nn;exports.getAdditionalMetadataEncoder=rn;exports.getChangeConfigCompressedDiscriminatorBytes=fU;exports.getChangeConfigCompressedInstruction=Ca;exports.getChangeConfigCompressedInstructionDataCodec=SU;exports.getChangeConfigCompressedInstructionDataDecoder=Ia;exports.getChangeConfigCompressedInstructionDataEncoder=xa;exports.getChangeConfigDiscriminatorBytes=iU;exports.getChangeConfigInstruction=uU;exports.getChangeConfigInstructionAsync=ma;exports.getChangeConfigInstructionDataCodec=dU;exports.getChangeConfigInstructionDataDecoder=pa;exports.getChangeConfigInstructionDataEncoder=Ps;exports.getClientAndDeviceHash=Xs;exports.getCompiledInstructionCodec=ch;exports.getCompiledInstructionDecoder=an;exports.getCompiledInstructionEncoder=cn;exports.getCompressedAccountMetaCodec=uh;exports.getCompressedAccountMetaDecoder=Et;exports.getCompressedAccountMetaEncoder=Ct;exports.getCompressedAccountMetaReadOnlyCodec=mh;exports.getCompressedAccountMetaReadOnlyDecoder=ht;exports.getCompressedAccountMetaReadOnlyEncoder=Mt;exports.getCompressedOnlyExtensionCodec=lh;exports.getCompressedOnlyExtensionDecoder=un;exports.getCompressedOnlyExtensionEncoder=dn;exports.getCompressedProofCodec=xh;exports.getCompressedProofDecoder=Tn;exports.getCompressedProofEncoder=yn;exports.getCompressedSettingsAddressFromIndex=ae;exports.getCompressedSettingsCodec=Dh;exports.getCompressedSettingsDataCodec=Rh;exports.getCompressedSettingsDataDecoder=_t;exports.getCompressedSettingsDataEncoder=bt;exports.getCompressedSettingsDecoder=Z;exports.getCompressedSettingsEncoder=Rt;exports.getCompressedTokenArgsCodec=Uh;exports.getCompressedTokenArgsDecoder=kt;exports.getCompressedTokenArgsEncoder=Wt;exports.getCompressibleExtensionCodec=Oh;exports.getCompressibleExtensionDecoder=En;exports.getCompressibleExtensionEncoder=Cn;exports.getCompressionInfoCodec=Vh;exports.getCompressionInfoDecoder=Pn;exports.getCompressionInfoEncoder=Dn;exports.getComputeBudgetEstimate=Qu;exports.getConfigActionCodec=zh;exports.getConfigActionDecoder=ze;exports.getConfigActionEncoder=Ge;exports.getCreateCompressedWalletDiscriminatorBytes=hU;exports.getCreateCompressedWalletInstruction=bU;exports.getCreateCompressedWalletInstructionAsync=ha;exports.getCreateCompressedWalletInstructionDataCodec=RU;exports.getCreateCompressedWalletInstructionDataDecoder=Ma;exports.getCreateCompressedWalletInstructionDataEncoder=Ms;exports.getCreateDomainConfigDiscriminatorBytes=BU;exports.getCreateDomainConfigInstruction=wU;exports.getCreateDomainConfigInstructionAsync=Ba;exports.getCreateDomainConfigInstructionDataCodec=NU;exports.getCreateDomainConfigInstructionDataDecoder=Oa;exports.getCreateDomainConfigInstructionDataEncoder=Rs;exports.getCreateDomainUserAccountDiscriminatorBytes=JU;exports.getCreateDomainUserAccountInstruction=YU;exports.getCreateDomainUserAccountInstructionAsync=Ha;exports.getCreateDomainUserAccountInstructionDataCodec=qU;exports.getCreateDomainUserAccountInstructionDataDecoder=Va;exports.getCreateDomainUserAccountInstructionDataEncoder=_s;exports.getCreateGlobalCounterDiscriminatorBytes=rW;exports.getCreateGlobalCounterInstruction=sW;exports.getCreateGlobalCounterInstructionAsync=Ka;exports.getCreateGlobalCounterInstructionDataCodec=nW;exports.getCreateGlobalCounterInstructionDataDecoder=za;exports.getCreateGlobalCounterInstructionDataEncoder=Us;exports.getCreateUserAccountArgsCodec=Zh;exports.getCreateUserAccountArgsDecoder=Bn;exports.getCreateUserAccountArgsEncoder=On;exports.getCreateUserAccountsDiscriminatorBytes=gW;exports.getCreateUserAccountsInstruction=mW;exports.getCreateUserAccountsInstructionAsync=Ya;exports.getCreateUserAccountsInstructionDataCodec=pW;exports.getCreateUserAccountsInstructionDataDecoder=qa;exports.getCreateUserAccountsInstructionDataEncoder=ks;exports.getDecompressSettingsAccountDiscriminatorBytes=CW;exports.getDecompressSettingsAccountInstruction=ti;exports.getDecompressSettingsAccountInstructionDataCodec=EW;exports.getDecompressSettingsAccountInstructionDataDecoder=ei;exports.getDecompressSettingsAccountInstructionDataEncoder=$a;exports.getDisableDomainConfigDiscriminatorBytes=_W;exports.getDisableDomainConfigInstruction=ai;exports.getDisableDomainConfigInstructionDataCodec=vW;exports.getDisableDomainConfigInstructionDataDecoder=ci;exports.getDisableDomainConfigInstructionDataEncoder=oi;exports.getDomainConfigAddress=gt;exports.getDomainConfigCodec=HM;exports.getDomainConfigDecoder=bo;exports.getDomainConfigDiscriminatorBytes=VM;exports.getDomainConfigEncoder=Tg;exports.getDomainConfigSize=GM;exports.getEditDomainConfigDiscriminatorBytes=wW;exports.getEditDomainConfigInstruction=pi;exports.getEditDomainConfigInstructionAsync=HW;exports.getEditDomainConfigInstructionDataCodec=VW;exports.getEditDomainConfigInstructionDataDecoder=gi;exports.getEditDomainConfigInstructionDataEncoder=Os;exports.getEditMemberArgsCodec=eR;exports.getEditMemberArgsDecoder=Wn;exports.getEditMemberArgsEncoder=Un;exports.getEditTransactionManagerUrlDiscriminatorBytes=YW;exports.getEditTransactionManagerUrlInstruction=Si;exports.getEditTransactionManagerUrlInstructionDataCodec=ZW;exports.getEditTransactionManagerUrlInstructionDataDecoder=fi;exports.getEditTransactionManagerUrlInstructionDataEncoder=li;exports.getEditUserDelegateDiscriminatorBytes=sk;exports.getEditUserDelegateInstruction=Pi;exports.getEditUserDelegateInstructionDataCodec=ok;exports.getEditUserDelegateInstructionDataDecoder=Di;exports.getEditUserDelegateInstructionDataEncoder=Ei;exports.getExpectedSecp256r1SignersCodec=sR;exports.getExpectedSecp256r1SignersDecoder=Bt;exports.getExpectedSecp256r1SignersEncoder=Ot;exports.getExtensionStructCodec=iR;exports.getExtensionStructDecoder=Lt;exports.getExtensionStructEncoder=ln;exports.getGlobalCounterAddress=dA;exports.getGlobalCounterCodec=JM;exports.getGlobalCounterDecoder=Lo;exports.getGlobalCounterDiscriminatorBytes=jM;exports.getGlobalCounterEncoder=Ug;exports.getGlobalCounterSize=ZM;exports.getJitoTipsConfig=js;exports.getLightCpiSigner=Qw;exports.getLightProtocolRpc=tt;exports.getLinkWalletArgsCodec=mR;exports.getLinkWalletArgsDecoder=Yn;exports.getLinkWalletArgsEncoder=qn;exports.getMemberCodec=fR;exports.getMemberDecoder=Ut;exports.getMemberEncoder=vt;exports.getMemberKeyCodec=IR;exports.getMemberKeyDecoder=oe;exports.getMemberKeyEncoder=se;exports.getMigrateCompressedSettingsDiscriminatorBytes=pk;exports.getMigrateCompressedSettingsInstruction=vi;exports.getMigrateCompressedSettingsInstructionDataCodec=mk;exports.getMigrateCompressedSettingsInstructionDataDecoder=_i;exports.getMigrateCompressedSettingsInstructionDataEncoder=bi;exports.getMigrateCompressedUsersDiscriminatorBytes=Ck;exports.getMigrateCompressedUsersInstruction=Bi;exports.getMigrateCompressedUsersInstructionDataCodec=Ek;exports.getMigrateCompressedUsersInstructionDataDecoder=Oi;exports.getMigrateCompressedUsersInstructionDataEncoder=Li;exports.getMultiWalletErrorMessage=mN;exports.getNativeTransferIntentCompressedDiscriminatorBytes=Hk;exports.getNativeTransferIntentCompressedInstruction=Ji;exports.getNativeTransferIntentCompressedInstructionDataCodec=Fk;exports.getNativeTransferIntentCompressedInstructionDataDecoder=ji;exports.getNativeTransferIntentCompressedInstructionDataEncoder=Ki;exports.getNativeTransferIntentDiscriminatorBytes=vk;exports.getNativeTransferIntentInstruction=Hi;exports.getNativeTransferIntentInstructionAsync=Wk;exports.getNativeTransferIntentInstructionDataCodec=Uk;exports.getNativeTransferIntentInstructionDataDecoder=Vi;exports.getNativeTransferIntentInstructionDataEncoder=Bs;exports.getNewAuthorityArgsCodec=PR;exports.getNewAuthorityArgsDecoder=$n;exports.getNewAuthorityArgsEncoder=Qn;exports.getOriginIndex=x2;exports.getPackedAddressTreeInfoCodec=RR;exports.getPackedAddressTreeInfoDecoder=wt;exports.getPackedAddressTreeInfoEncoder=Nt;exports.getPackedMerkleContextCodec=vR;exports.getPackedMerkleContextDecoder=Sn;exports.getPackedMerkleContextEncoder=fn;exports.getPackedStateTreeInfoCodec=kR;exports.getPackedStateTreeInfoDecoder=Pt;exports.getPackedStateTreeInfoEncoder=Dt;exports.getPausableAccountExtensionCodec=BR;exports.getPausableAccountExtensionDecoder=wn;exports.getPausableAccountExtensionEncoder=Nn;exports.getPermanentDelegateAccountExtensionCodec=VR;exports.getPermanentDelegateAccountExtensionDecoder=Hn;exports.getPermanentDelegateAccountExtensionEncoder=Vn;exports.getPermissionsCodec=GR;exports.getPermissionsDecoder=Fe;exports.getPermissionsEncoder=He;exports.getProofArgsCodec=JR;exports.getProofArgsDecoder=D;exports.getProofArgsEncoder=E;exports.getRemoveMemberArgsCodec=XR;exports.getRemoveMemberArgsDecoder=Ln;exports.getRemoveMemberArgsEncoder=kn;exports.getRentConfigCodec=eb;exports.getRentConfigDecoder=bn;exports.getRentConfigEncoder=Rn;exports.getSecp256r1MessageHash=Qs;exports.getSecp256r1PubkeyCodec=nb;exports.getSecp256r1PubkeyDecoder=Vt;exports.getSecp256r1PubkeyEncoder=ss;exports.getSecp256r1SignatureOffsetsDataDecoder=AM;exports.getSecp256r1SignatureOffsetsDataEncoder=uM;exports.getSecp256r1VerifyArgsCodec=cb;exports.getSecp256r1VerifyArgsDecoder=F;exports.getSecp256r1VerifyArgsEncoder=H;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=ub;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=Q;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=X;exports.getSecp256r1VerifyInstruction=V;exports.getSecp256r1VerifyInstructionDataCodec=R6;exports.getSecp256r1VerifyInstructionDataDecoder=_A;exports.getSecp256r1VerifyInstructionDataEncoder=vA;exports.getSendAndConfirmTransaction=Xu;exports.getSettingsCodec=Cv;exports.getSettingsCreationArgsCodec=mb;exports.getSettingsCreationArgsDecoder=Ft;exports.getSettingsCreationArgsEncoder=Ht;exports.getSettingsDecoder=Vc;exports.getSettingsDiscriminatorBytes=Iv;exports.getSettingsEncoder=ul;exports.getSettingsFromIndex=ue;exports.getSettingsIndexWithAddressCodec=lb;exports.getSettingsIndexWithAddressDecoder=zt;exports.getSettingsIndexWithAddressEncoder=Gt;exports.getSettingsMutArgsCodec=Ib;exports.getSettingsMutArgsDecoder=j;exports.getSettingsMutArgsEncoder=K;exports.getSettingsReadonlyArgsCodec=Pb;exports.getSettingsReadonlyArgsDecoder=jt;exports.getSettingsReadonlyArgsEncoder=Kt;exports.getSignedSecp256r1Key=g2;exports.getSignedTransactionManager=l5;exports.getSolanaRpc=ce;exports.getSolanaRpcEndpoint=Zu;exports.getSplInterfacePdaArgsCodec=Rb;exports.getSplInterfacePdaArgsDecoder=qt;exports.getSplInterfacePdaArgsEncoder=Jt;exports.getTokenMetadataCodec=Ub;exports.getTokenMetadataDecoder=Gn;exports.getTokenMetadataEncoder=Fn;exports.getTokenTransferIntentCompressedDiscriminatorBytes=cL;exports.getTokenTransferIntentCompressedInstruction=ad;exports.getTokenTransferIntentCompressedInstructionAsync=iL;exports.getTokenTransferIntentCompressedInstructionDataCodec=aL;exports.getTokenTransferIntentCompressedInstructionDataDecoder=cd;exports.getTokenTransferIntentCompressedInstructionDataEncoder=Hs;exports.getTokenTransferIntentDiscriminatorBytes=Zk;exports.getTokenTransferIntentInstruction=$i;exports.getTokenTransferIntentInstructionAsync=Qk;exports.getTokenTransferIntentInstructionDataCodec=Xk;exports.getTokenTransferIntentInstructionDataDecoder=Qi;exports.getTokenTransferIntentInstructionDataEncoder=Vs;exports.getTransactionBufferAddress=uA;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=PL;exports.getTransactionBufferCloseCompressedInstruction=Sd;exports.getTransactionBufferCloseCompressedInstructionDataCodec=ML;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=fd;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=ld;exports.getTransactionBufferCloseDiscriminatorBytes=TL;exports.getTransactionBufferCloseInstruction=pd;exports.getTransactionBufferCloseInstructionDataCodec=lL;exports.getTransactionBufferCloseInstructionDataDecoder=gd;exports.getTransactionBufferCloseInstructionDataEncoder=Ad;exports.getTransactionBufferCodec=bv;exports.getTransactionBufferCreateArgsCodec=Ob;exports.getTransactionBufferCreateArgsDecoder=Zt;exports.getTransactionBufferCreateArgsEncoder=Yt;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=GL;exports.getTransactionBufferCreateCompressedInstruction=vd;exports.getTransactionBufferCreateCompressedInstructionDataCodec=zL;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=_d;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=bd;exports.getTransactionBufferCreateDiscriminatorBytes=kL;exports.getTransactionBufferCreateInstruction=Pd;exports.getTransactionBufferCreateInstructionDataCodec=LL;exports.getTransactionBufferCreateInstructionDataDecoder=Dd;exports.getTransactionBufferCreateInstructionDataEncoder=Ed;exports.getTransactionBufferDecoder=Jc;exports.getTransactionBufferDiscriminatorBytes=Rv;exports.getTransactionBufferEncoder=bl;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=aO;exports.getTransactionBufferExecuteCompressedInstruction=Gd;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=iO;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=Fd;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=Hd;exports.getTransactionBufferExecuteDiscriminatorBytes=QL;exports.getTransactionBufferExecuteInstruction=Bd;exports.getTransactionBufferExecuteInstructionDataCodec=$L;exports.getTransactionBufferExecuteInstructionDataDecoder=Od;exports.getTransactionBufferExecuteInstructionDataEncoder=Ld;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=EO;exports.getTransactionBufferExtendCompressedInstruction=tu;exports.getTransactionBufferExtendCompressedInstructionDataCodec=DO;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=eu;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=$d;exports.getTransactionBufferExtendDiscriminatorBytes=yO;exports.getTransactionBufferExtendInstruction=Yd;exports.getTransactionBufferExtendInstructionDataCodec=TO;exports.getTransactionBufferExtendInstructionDataDecoder=qd;exports.getTransactionBufferExtendInstructionDataEncoder=Jd;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=HO;exports.getTransactionBufferVoteCompressedInstruction=pu;exports.getTransactionBufferVoteCompressedInstructionDataCodec=FO;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=gu;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=Au;exports.getTransactionBufferVoteDiscriminatorBytes=UO;exports.getTransactionBufferVoteInstruction=au;exports.getTransactionBufferVoteInstructionDataCodec=WO;exports.getTransactionBufferVoteInstructionDataDecoder=cu;exports.getTransactionBufferVoteInstructionDataEncoder=ou;exports.getTransactionExecuteCompressedDiscriminatorBytes=nB;exports.getTransactionExecuteCompressedInstruction=Pu;exports.getTransactionExecuteCompressedInstructionDataCodec=sB;exports.getTransactionExecuteCompressedInstructionDataDecoder=Du;exports.getTransactionExecuteCompressedInstructionDataEncoder=Eu;exports.getTransactionExecuteDiscriminatorBytes=YO;exports.getTransactionExecuteInstruction=Su;exports.getTransactionExecuteInstructionDataCodec=ZO;exports.getTransactionExecuteInstructionDataDecoder=fu;exports.getTransactionExecuteInstructionDataEncoder=lu;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=IB;exports.getTransactionExecuteSyncCompressedInstruction=Bu;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=CB;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=Ou;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=Lu;exports.getTransactionExecuteSyncDiscriminatorBytes=gB;exports.getTransactionExecuteSyncInstruction=vu;exports.getTransactionExecuteSyncInstructionDataCodec=pB;exports.getTransactionExecuteSyncInstructionDataDecoder=_u;exports.getTransactionExecuteSyncInstructionDataEncoder=bu;exports.getTransactionMessageAddressTableLookupCodec=Gb;exports.getTransactionMessageAddressTableLookupDecoder=gs;exports.getTransactionMessageAddressTableLookupEncoder=As;exports.getTransactionMessageCodec=Vb;exports.getTransactionMessageDecoder=Qt;exports.getTransactionMessageEncoder=Xt;exports.getTransferFeeAccountExtensionCodec=jb;exports.getTransferFeeAccountExtensionDecoder=Kn;exports.getTransferFeeAccountExtensionEncoder=zn;exports.getTransferHookAccountExtensionCodec=Yb;exports.getTransferHookAccountExtensionDecoder=Jn;exports.getTransferHookAccountExtensionEncoder=jn;exports.getUserAccountAddress=N;exports.getUserCodec=$b;exports.getUserCreationArgsCodec=n_;exports.getUserCreationArgsDecoder=Ie;exports.getUserCreationArgsEncoder=xe;exports.getUserDecoder=$;exports.getUserEncoder=Xe;exports.getUserMutArgsCodec=a_;exports.getUserMutArgsDecoder=$e;exports.getUserMutArgsEncoder=Qe;exports.getUserReadOnlyArgsCodec=A_;exports.getUserReadOnlyArgsDecoder=be;exports.getUserReadOnlyArgsEncoder=Re;exports.getUserReadOnlyOrMutateArgsCodec=y_;exports.getUserReadOnlyOrMutateArgsDecoder=ts;exports.getUserReadOnlyOrMutateArgsEncoder=es;exports.getUserRoleCodec=x_;exports.getUserRoleDecoder=je;exports.getUserRoleEncoder=Ke;exports.getWalletAddressFromIndex=Xw;exports.getWalletAddressFromSettings=ve;exports.getWhitelistedAddressTreeCodec=kv;exports.getWhitelistedAddressTreeDecoder=$c;exports.getWhitelistedAddressTreeDiscriminatorBytes=Wv;exports.getWhitelistedAddressTreeEncoder=Yl;exports.getWhitelistedAddressTreeFromIndex=Zs;exports.getWhitelistedAddressTreeIndexFromAddress=ww;exports.getWhitelistedAddressTreesAddress=sA;exports.identifyMultiWalletAccount=aN;exports.identifyMultiWalletInstruction=iN;exports.initialize=iw;exports.isConfigAction=jh;exports.isExtensionStruct=uR;exports.isMultiWalletError=yN;exports.isUserReadOnlyOrMutateArgs=l_;exports.migrateSettings=c6;exports.migrateUsers=p6;exports.nativeTransferIntent=$6;exports.parseAddWhitelistedAddressTreesInstruction=tU;exports.parseChangeConfigCompressedInstruction=xU;exports.parseChangeConfigInstruction=AU;exports.parseCreateCompressedWalletInstruction=_U;exports.parseCreateDomainConfigInstruction=VU;exports.parseCreateDomainUserAccountInstruction=ZU;exports.parseCreateGlobalCounterInstruction=oW;exports.parseCreateUserAccountsInstruction=yW;exports.parseDecompressSettingsAccountInstruction=DW;exports.parseDisableDomainConfigInstruction=UW;exports.parseEditDomainConfigInstruction=FW;exports.parseEditTransactionManagerUrlInstruction=XW;exports.parseEditUserDelegateInstruction=ck;exports.parseMigrateCompressedSettingsInstruction=yk;exports.parseMigrateCompressedUsersInstruction=Dk;exports.parseNativeTransferIntentCompressedInstruction=Gk;exports.parseNativeTransferIntentInstruction=kk;exports.parseSecp256r1VerifyInstruction=b6;exports.parseTokenTransferIntentCompressedInstruction=dL;exports.parseTokenTransferIntentInstruction=$k;exports.parseTransactionBufferCloseCompressedInstruction=hL;exports.parseTransactionBufferCloseInstruction=fL;exports.parseTransactionBufferCreateCompressedInstruction=KL;exports.parseTransactionBufferCreateInstruction=OL;exports.parseTransactionBufferExecuteCompressedInstruction=dO;exports.parseTransactionBufferExecuteInstruction=eO;exports.parseTransactionBufferExtendCompressedInstruction=PO;exports.parseTransactionBufferExtendInstruction=lO;exports.parseTransactionBufferVoteCompressedInstruction=GO;exports.parseTransactionBufferVoteInstruction=kO;exports.parseTransactionExecuteCompressedInstruction=oB;exports.parseTransactionExecuteInstruction=XO;exports.parseTransactionExecuteSyncCompressedInstruction=EB;exports.parseTransactionExecuteSyncInstruction=mB;exports.pollJitoBundleConfirmation=J2;exports.prepareChangeConfigArgs=xH;exports.prepareTransactionBundle=RH;exports.prepareTransactionMessage=HH;exports.prepareTransactionSync=jH;exports.retrieveTransactionManager=T5;exports.sendJitoBundle=WP;exports.serializeConfigActions=f5;exports.signAndSendBundledTransactions=j2;exports.signAndSendTransaction=e5;exports.tokenTransferIntent=gV;exports.userReadOnlyOrMutateArgs=T_;exports.vaultTransactionMessageDeserialize=ju;exports.vaultTransactionMessageSerialize=Ku;exports.voteTransactionBuffer=KA;//# sourceMappingURL=index.cjs.map
3
3
  //# sourceMappingURL=index.cjs.map