@revibase/core 0.3.3 → 0.3.4
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 +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
'use strict';var gill=require('gill'),stateless_js=require('@lightprotocol/stateless.js'),sha2_js=require('@noble/hashes/sha2.js'),web3_js=require('@solana/web3.js'),m=require('zod'),programs=require('gill/programs'),nist_js=require('@noble/curves/nist.js'),tinyCbor=require('@levischuck/tiny-cbor'),jsonCanonicalize=require('json-canonicalize'),compressedToken=require('@lightprotocol/compressed-token'),IM=require('bn.js'),utils_js=require('@noble/curves/utils.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var m__default=/*#__PURE__*/_interopDefault(m);var IM__default=/*#__PURE__*/_interopDefault(IM);var ss=new Uint8Array([201,232,212,229,59,241,106,197]);function XM(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(ss)}function ZA(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["authority",gill.getAddressEncoder()],["rpIdHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["bump",gill.getU8Encoder()],["isDisabled",gill.getU8Encoder()],["rpIdLength",gill.getU8Encoder()],["numOrigins",gill.getU8Encoder()],["rpId",gill.fixEncoderSize(gill.getBytesEncoder(),255)],["origins",gill.fixEncoderSize(gill.getBytesEncoder(),515)]]),e=>({...e,discriminator:ss}))}function cs(){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 QM(){return gill.combineCodec(ZA(),cs())}function as(e){return gill.decodeAccount(e,cs())}async function is(e,n,r){let o=await XA(e,n,r);return gill.assertAccountExists(o),o}async function XA(e,n,r){let o=await gill.fetchEncodedAccount(e,n,r);return as(o)}async function $M(e,n,r){let o=await QA(e,n,r);return gill.assertAccountsExist(o),o}async function QA(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>as(t))}function eh(){return 846}var As=new Uint8Array([42,206,176,58,175,129,130,233]);function nh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(As)}function gg(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:As}))}function gs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function oh(){return gill.combineCodec(gg(),gs())}function ps(e){return gill.decodeAccount(e,gs())}async function sh(e,n,r){let o=await pg(e,n,r);return gill.assertAccountExists(o),o}async function pg(e,n,r){let o=await gill.fetchEncodedAccount(e,n,r);return ps(o)}async function ch(e,n,r){let o=await mg(e,n,r);return gill.assertAccountsExist(o),o}async function mg(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>ps(t))}function ah(){return 24}var Kr=(r=>(r[r.Initialized=0]="Initialized",r[r.Frozen=1]="Frozen",r))(Kr||{});function jr(){return gill.getEnumEncoder(Kr)}function qr(){return gill.getEnumDecoder(Kr)}function uh(){return gill.combineCodec(jr(),qr())}function Jr(){return gill.getStructEncoder([["key",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["value",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Yr(){return gill.getStructDecoder([["key",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["value",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function ph(){return gill.combineCodec(Jr(),Yr())}function Zr(){return gill.getStructEncoder([["memberKey",V()],["permissions",Be()],["userArgs",we()]])}function Xr(){return gill.getStructDecoder([["memberKey",$()],["permissions",Ne()],["userArgs",He()]])}function Th(){return gill.combineCodec(Zr(),Xr())}function Qr(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function $r(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function xh(){return gill.combineCodec(Qr(),$r())}function pt(){return gill.getStructEncoder([["treeInfo",lt()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["outputStateTreeIndex",gill.getU8Encoder()]])}function mt(){return gill.getStructDecoder([["treeInfo",yt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["outputStateTreeIndex",gill.getU8Decoder()]])}function Dh(){return gill.combineCodec(pt(),mt())}function Tt(){return gill.getStructEncoder([["treeInfo",lt()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function ft(){return gill.getStructDecoder([["treeInfo",yt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function Rh(){return gill.combineCodec(Tt(),ft())}function en(){return gill.getStructEncoder([["delegatedAmount",gill.getU64Encoder()],["withheldTransferFee",gill.getU64Encoder()],["isAta",gill.getU8Encoder()]])}function tn(){return gill.getStructDecoder([["delegatedAmount",gill.getU64Decoder()],["withheldTransferFee",gill.getU64Decoder()],["isAta",gill.getU8Decoder()]])}function vh(){return gill.combineCodec(en(),tn())}function cn(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function an(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function Wh(){return gill.combineCodec(cn(),an())}function St(){return gill.getStructEncoder([["data",gill.getOptionEncoder(dn())]])}function q(){return gill.getStructDecoder([["data",gill.getOptionDecoder(un())]])}function Nh(){return gill.combineCodec(St(),q())}function dn(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(xt())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]])}function un(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(It())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function Fh(){return gill.combineCodec(dn(),un())}function Ct(){return gill.getStructEncoder([["version",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()],["amount",gill.getU64Encoder()],["merkleContext",gn()],["tlv",gill.getOptionEncoder(gill.getArrayEncoder(An()))],["state",jr()]])}function Et(){return gill.getStructDecoder([["version",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()],["amount",gill.getU64Decoder()],["merkleContext",pn()],["tlv",gill.getOptionDecoder(gill.getArrayDecoder(Dt()))],["state",qr()]])}function jh(){return gill.combineCodec(Ct(),Et())}function yn(){return gill.getStructEncoder([["decimalsOption",gill.getU8Encoder()],["decimals",gill.getU8Encoder()],["compressionOnly",gill.getBooleanEncoder()],["isAta",gill.getU8Encoder()],["info",fn()]])}function Tn(){return gill.getStructDecoder([["decimalsOption",gill.getU8Decoder()],["decimals",gill.getU8Decoder()],["compressionOnly",gill.getBooleanDecoder()],["isAta",gill.getU8Decoder()],["info",Sn()]])}function Zh(){return gill.combineCodec(yn(),Tn())}function fn(){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",Cn()]])}function Sn(){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",En()]])}function eR(){return gill.combineCodec(fn(),Sn())}function Ve(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Mn())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Zr())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Rn())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function Fe(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(hn())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Xr())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(bn())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function oR(){return gill.combineCodec(Ve(),Fe())}function sR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function cR(e,n){return n.__kind===e}function _n(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",Ge()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",Pe()]])}function vn(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",ze()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",Me()]])}function uR(){return gill.combineCodec(_n(),vn())}function Mn(){return gill.getStructEncoder([["memberKey",V()],["permissions",Be()]])}function hn(){return gill.getStructDecoder([["memberKey",$()],["permissions",Ne()]])}function mR(){return gill.combineCodec(Mn(),hn())}function Pt(){return gill.getStructEncoder([["memberKey",V()],["messageHash",gill.getOptionEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))]])}function Mt(){return gill.getStructDecoder([["memberKey",$()],["messageHash",gill.getOptionDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))]])}function fR(){return gill.combineCodec(Pt(),Mt())}function An(){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([On()])]])],["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([Un()])]])],["PermanentDelegateAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([Wn()])]])],["TransferFeeAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([Nn()])]])],["TransferHookAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([Hn()])]])],["CompressedOnly",gill.getStructEncoder([["fields",gill.getTupleEncoder([en()])]])],["Compressible",gill.getStructEncoder([["fields",gill.getTupleEncoder([yn()])]])]])}function Dt(){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([Bn()])]])],["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([kn()])]])],["PermanentDelegateAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Ln()])]])],["TransferFeeAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([wn()])]])],["TransferHookAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Vn()])]])],["CompressedOnly",gill.getStructDecoder([["fields",gill.getTupleDecoder([tn()])]])],["Compressible",gill.getStructDecoder([["fields",gill.getTupleDecoder([Tn()])]])]])}function CR(){return gill.combineCodec(An(),Dt())}function ER(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function DR(e,n){return n.__kind===e}function Fn(){return gill.getStructEncoder([["settingsMutArgs",z()],["transactionManager",gill.getOptionEncoder(ht())]])}function Gn(){return gill.getStructDecoder([["settingsMutArgs",K()],["transactionManager",gill.getOptionDecoder(Rt())]])}function RR(){return gill.combineCodec(Fn(),Gn())}function xt(){return gill.getStructEncoder([["pubkey",V()],["role",gill.getU8Encoder()],["permissions",Be()],["userAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getU8Encoder()]])}function It(){return gill.getStructDecoder([["pubkey",$()],["role",gill.getU8Decoder()],["permissions",Ne()],["userAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getU8Decoder()]])}function UR(){return gill.combineCodec(xt(),It())}function V(){return gill.getStructEncoder([["keyType",gill.getU8Encoder()],["key",gill.fixEncoderSize(gill.getBytesEncoder(),33)]])}function $(){return gill.getStructDecoder([["keyType",gill.getU8Decoder()],["key",gill.fixDecoderSize(gill.getBytesDecoder(),33)]])}function LR(){return gill.combineCodec(V(),$())}function jn(){return gill.getStructEncoder([["authorityCreationArgs",Pe()],["compressedProofArgs",P()]])}function qn(){return gill.getStructDecoder([["authorityCreationArgs",Me()],["compressedProofArgs",M()]])}function wR(){return gill.combineCodec(jn(),qn())}function bt(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function _t(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function FR(){return gill.combineCodec(bt(),_t())}function gn(){return gill.getStructEncoder([["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()],["proveByIndex",gill.getBooleanEncoder()]])}function pn(){return gill.getStructDecoder([["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()],["proveByIndex",gill.getBooleanDecoder()]])}function KR(){return gill.combineCodec(gn(),pn())}function lt(){return gill.getStructEncoder([["rootIndex",gill.getU16Encoder()],["proveByIndex",gill.getBooleanEncoder()],["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()]])}function yt(){return gill.getStructDecoder([["rootIndex",gill.getU16Decoder()],["proveByIndex",gill.getBooleanDecoder()],["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()]])}function JR(){return gill.combineCodec(lt(),yt())}function Un(){return gill.getStructEncoder([])}function kn(){return gill.getStructDecoder([])}function XR(){return gill.combineCodec(Un(),kn())}function Wn(){return gill.getStructEncoder([])}function Ln(){return gill.getStructDecoder([])}function eb(){return gill.combineCodec(Wn(),Ln())}function Be(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function Ne(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function nb(){return gill.combineCodec(Be(),Ne())}function P(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(cn())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function M(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(an())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function ab(){return gill.combineCodec(P(),M())}function Rn(){return gill.getStructEncoder([["memberKey",V()],["userArgs",we()]])}function bn(){return gill.getStructDecoder([["memberKey",$()],["userArgs",He()]])}function Ab(){return gill.combineCodec(Rn(),bn())}function Cn(){return gill.getStructEncoder([["baseRent",gill.getU16Encoder()],["compressionCost",gill.getU16Encoder()],["lamportsPerBytePerEpoch",gill.getU8Encoder()],["maxFundedEpochs",gill.getU8Encoder()],["maxTopUp",gill.getU16Encoder()]])}function En(){return gill.getStructDecoder([["baseRent",gill.getU16Decoder()],["compressionCost",gill.getU16Decoder()],["lamportsPerBytePerEpoch",gill.getU8Decoder()],["maxFundedEpochs",gill.getU8Decoder()],["maxTopUp",gill.getU16Decoder()]])}function mb(){return gill.combineCodec(Cn(),En())}function Zn(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function vt(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function Tb(){return gill.combineCodec(Zn(),vt())}function F(){return gill.getStructEncoder([["signedMessageIndex",gill.getU8Encoder()],["slotNumber",gill.getU64Encoder()],["originIndex",gill.getU8Encoder()],["crossOrigin",gill.getBooleanEncoder()],["truncatedClientDataJson",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["clientAndDeviceHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function G(){return gill.getStructDecoder([["signedMessageIndex",gill.getU8Decoder()],["slotNumber",gill.getU64Decoder()],["originIndex",gill.getU8Decoder()],["crossOrigin",gill.getBooleanDecoder()],["truncatedClientDataJson",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["clientAndDeviceHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function xb(){return gill.combineCodec(F(),G())}function Xn(){return gill.getStructEncoder([["verifyArgs",F()],["domainConfigIndex",gill.getU8Encoder()]])}function Qn(){return gill.getStructDecoder([["verifyArgs",G()],["domainConfigIndex",gill.getU8Decoder()]])}function Db(){return gill.combineCodec(Xn(),Qn())}function $n(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function eo(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function hb(){return gill.combineCodec($n(),eo())}function to(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getBooleanEncoder()]])}function ro(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getBooleanDecoder()]])}function _b(){return gill.combineCodec(to(),ro())}function z(){return gill.getStructEncoder([["accountMeta",pt()],["data",St()]])}function K(){return gill.getStructDecoder([["accountMeta",mt()],["data",q()]])}function Wb(){return gill.combineCodec(z(),K())}function Ut(){return gill.getStructEncoder([["accountMeta",Tt()],["data",St()]])}function kt(){return gill.getStructDecoder([["accountMeta",ft()],["data",q()]])}function Nb(){return gill.combineCodec(Ut(),kt())}function Wt(){return gill.getStructEncoder([["index",gill.getU8Encoder()],["restricted",gill.getBooleanEncoder()]])}function Lt(){return gill.getStructDecoder([["index",gill.getU8Decoder()],["restricted",gill.getBooleanDecoder()]])}function Vb(){return gill.combineCodec(Wt(),Lt())}function On(){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(Jr())]])}function Bn(){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(Yr())]])}function Kb(){return gill.combineCodec(On(),Bn())}function Ot(){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()],["expectedSigners",gill.getArrayEncoder(Pt())]])}function Bt(){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()],["expectedSigners",gill.getArrayDecoder(Mt())]])}function Yb(){return gill.combineCodec(Ot(),Bt())}function Nt(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(Qr())],["addressTableLookups",gill.getArrayEncoder(uo())]])}function wt(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder($r())],["addressTableLookups",gill.getArrayDecoder(Ao())]])}function $b(){return gill.combineCodec(Nt(),wt())}function uo(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Ao(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function r_(){return gill.combineCodec(uo(),Ao())}function J(){return gill.getDiscriminatedUnionEncoder([["Ed25519",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])],["Secp256r1",gill.getStructEncoder([["fields",gill.getTupleEncoder([Xn()])]])]])}function Y(){return gill.getDiscriminatedUnionDecoder([["Ed25519",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])],["Secp256r1",gill.getStructDecoder([["fields",gill.getTupleDecoder([Qn()])]])]])}function c_(){return gill.combineCodec(J(),Y())}function a_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function i_(e,n){return n.__kind===e}function Nn(){return gill.getStructEncoder([["withheldAmount",gill.getU64Encoder()]])}function wn(){return gill.getStructDecoder([["withheldAmount",gill.getU64Decoder()]])}function A_(){return gill.combineCodec(Nn(),wn())}function Hn(){return gill.getStructEncoder([["transferring",gill.getU8Encoder()]])}function Vn(){return gill.getStructDecoder([["transferring",gill.getU8Decoder()]])}function m_(){return gill.combineCodec(Hn(),Vn())}var go=(a=>(a[a.Ble=0]="Ble",a[a.Cable=1]="Cable",a[a.Hybrid=2]="Hybrid",a[a.Internal=3]="Internal",a[a.Nfc=4]="Nfc",a[a.SmartCard=5]="SmartCard",a[a.Usb=6]="Usb",a))(go||{});function Ht(){return gill.getEnumEncoder(go)}function Vt(){return gill.getEnumDecoder(go)}function T_(){return gill.combineCodec(Ht(),Vt())}function Ft(){return gill.getStructEncoder([["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["member",V()],["credentialId",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder()))],["transports",gill.getOptionEncoder(gill.getArrayEncoder(Ht()))],["wallets",gill.getArrayEncoder(to())],["role",Ge()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function Q(){return gill.getStructDecoder([["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["member",$()],["credentialId",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder()))],["transports",gill.getOptionDecoder(gill.getArrayDecoder(Vt()))],["wallets",gill.getArrayDecoder(ro())],["role",ze()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function I_(){return gill.combineCodec(Ft(),Q())}function Pe(){return gill.getStructEncoder([["addressTreeInfo",bt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function Me(){return gill.getStructDecoder([["addressTreeInfo",_t()],["outputStateTreeIndex",gill.getU8Decoder()]])}function P_(){return gill.combineCodec(Pe(),Me())}function Ye(){return gill.getStructEncoder([["accountMeta",pt()],["data",Ft()]])}function Ze(){return gill.getStructDecoder([["accountMeta",mt()],["data",Q()]])}function b_(){return gill.combineCodec(Ye(),Ze())}function ht(){return gill.getStructEncoder([["accountMeta",Tt()],["data",Ft()]])}function Rt(){return gill.getStructDecoder([["accountMeta",ft()],["data",Q()]])}function k_(){return gill.combineCodec(ht(),Rt())}function we(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([ht()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([Ye()])]])]])}function He(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([Rt()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([Ze()])]])]])}function B_(){return gill.combineCodec(we(),He())}function N_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function w_(e,n){return n.__kind===e}var _e=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(_e||{});function Ge(){return gill.getEnumEncoder(_e)}function ze(){return gill.getEnumDecoder(_e)}function F_(){return gill.combineCodec(Ge(),ze())}var Dc=new Uint8Array([223,179,163,190,177,224,67,173]);function jv(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Dc)}function s1(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(xt())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]]),e=>({...e,discriminator:Dc}))}function Tr(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(It())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function qv(){return gill.combineCodec(s1(),Tr())}function Pc(e){return gill.decodeAccount(e,Tr())}async function Jv(e,n,r){let o=await po(e,n,r);return gill.assertAccountExists(o),o}async function po(e,n,r){let o=await gill.fetchEncodedAccount(e,n,r);return Pc(o)}async function Yv(e,n,r){let o=await c1(e,n,r);return gill.assertAccountsExist(o),o}async function c1(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Pc(t))}var _c=new Uint8Array([90,36,35,219,93,225,110,96]);function $v(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(_c)}function D1(){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",V()],["executor",V()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder(V())],["expectedSigners",gill.getArrayEncoder(Pt())],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:_c}))}function vc(){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",$()],["executor",$()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["voters",gill.getArrayDecoder($())],["expectedSigners",gill.getArrayDecoder(Mt())],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function eU(){return gill.combineCodec(D1(),vc())}function Uc(e){return gill.decodeAccount(e,vc())}async function kc(e,n,r){let o=await P1(e,n,r);return gill.assertAccountExists(o),o}async function P1(e,n,r){let o=await gill.fetchEncodedAccount(e,n,r);return Uc(o)}async function tU(e,n,r){let o=await M1(e,n,r);return gill.assertAccountsExist(o),o}async function M1(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Uc(t))}var Oc=new Uint8Array([105,23,173,2,197,255,80,87]);function oU(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Oc)}function z1(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:Oc}))}function Bc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function sU(){return gill.combineCodec(z1(),Bc())}function Nc(e){return gill.decodeAccount(e,Bc())}async function wc(e,n,r){let o=await K1(e,n,r);return gill.assertAccountExists(o),o}async function K1(e,n,r){let o=await gill.fetchEncodedAccount(e,n,r);return Nc(o)}async function cU(e,n,r){let o=await j1(e,n,r);return gill.assertAccountsExist(o),o}async function j1(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Nc(t))}function l({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 B(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 o=r.isWritable?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY;return Object.freeze({address:B(r.value),role:Hc(r.value)?gill.upgradeRoleToSigner(o):o,...Hc(r.value)?{signer:r.value}:{}})}}function Hc(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var Fc=new Uint8Array([8]);function EU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Fc)}function Io(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:Fc}))}function Gc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function DU(){return gill.combineCodec(Io(),Gc())}async function zc(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Io().encode(c),programAddress:r})}function PU(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Io().encode(c),programAddress:r})}function MU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:Gc().decode(e.data)}}var Yc=new Uint8Array([9]);function kU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Yc)}function Zc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(Ve())],["signers",gill.getArrayEncoder(J())],["compressedProofArgs",gill.getOptionEncoder(P())]]),e=>({...e,discriminator:Yc}))}function Xc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(Fe())],["signers",gill.getArrayDecoder(Y())],["compressedProofArgs",gill.getOptionDecoder(M())]])}function WU(){return gill.combineCodec(Zc(),Xc())}function Qc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Zc().encode(c),programAddress:r})}function LU(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Xc().decode(e.data)}}var na=new Uint8Array([19]);function FU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(na)}function oa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(Ve())],["signers",gill.getArrayEncoder(J())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:na}))}function sa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(Fe())],["signers",gill.getArrayDecoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function GU(){return gill.combineCodec(oa(),sa())}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},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:oa().encode(c),programAddress:r})}function zU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:sa().decode(e.data)}}var da=new Uint8Array([18]);function XU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(da)}function Co(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",P()],["addressTreeInfo",bt()],["outputStateTreeIndex",gill.getU8Encoder()],["userArgs",we()],["settingsIndex",gill.getU128Encoder()]]),e=>({...e,discriminator:da}))}function ua(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",M()],["addressTreeInfo",_t()],["outputStateTreeIndex",gill.getU8Decoder()],["userArgs",He()],["settingsIndex",gill.getU128Decoder()]])}function QU(){return gill.combineCodec(Co(),ua())}async function Aa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:Co().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},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:Co().encode(c),programAddress:r})}function ek(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:ua().decode(e.data)}}var Sa=new Uint8Array([0]);function ak(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Sa)}function Do(){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",Pe()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Sa}))}function xa(){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",Me()],["compressedProofArgs",M()]])}function ik(){return gill.combineCodec(Do(),xa())}async function Ia(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Do().encode(c),programAddress:r})}function dk(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Do().encode(c),programAddress:r})}function uk(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:xa().decode(e.data)}}var Da=new Uint8Array([4]);function Tk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Da)}function Po(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",P()],["member",Zn()],["role",Ge()],["credentialId",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["transports",gill.getArrayEncoder(Ht())],["userAccountCreationArgs",Pe()],["linkWalletArgs",gill.getOptionEncoder(Fn())]]),e=>({...e,discriminator:Da}))}function Pa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",M()],["member",vt()],["role",ze()],["credentialId",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["transports",gill.getArrayDecoder(Vt())],["userAccountCreationArgs",Me()],["linkWalletArgs",gill.getOptionDecoder(Gn())]])}function fk(){return gill.combineCodec(Po(),Pa())}async function Ma(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:Po().encode(c),programAddress:r})}function Sk(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=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:Po().encode(c),programAddress:r})}function xk(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:Pa().decode(e.data)}}var Ra=new Uint8Array([3]);function Mk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ra)}function ho(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Ra}))}function ba(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function hk(){return gill.combineCodec(ho(),ba())}async function _a(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(c),a=y(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:ho().encode({}),programAddress:r})}function Rk(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(c),a=y(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:ho().encode({}),programAddress:r})}function bk(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:ba().decode(e.data)}}var Ua=new Uint8Array([5]);function Ok(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ua)}function bo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",P()],["createUserArgs",gill.getArrayEncoder(_n())]]),e=>({...e,discriminator:Ua}))}function ka(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",M()],["createUserArgs",gill.getArrayDecoder(vn())]])}function Bk(){return gill.combineCodec(bo(),ka())}async function Wa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:bo().encode(c),programAddress:r})}function Nk(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:bo().encode(c),programAddress:r})}function wk(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:ka().decode(e.data)}}var Ba=new Uint8Array([17]);function jk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ba)}function Na(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMutArgs",z()],["compressedProofArgs",P()],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:Ba}))}function wa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMutArgs",K()],["compressedProofArgs",M()],["signers",gill.getArrayDecoder(Y())]])}function qk(){return gill.combineCodec(Na(),wa())}function Ha(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Na().encode(c),programAddress:r})}function Jk(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:wa().decode(e.data)}}var Ga=new Uint8Array([2]);function eW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ga)}function za(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:Ga}))}function Ka(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function tW(){return gill.combineCodec(za(),Ka())}function ja(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.admin),...a],data:za().encode(c),programAddress:r})}function rW(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:Ka().decode(e.data)}}var Za=new Uint8Array([1]);function dW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Za)}function vo(){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(jn())]]),e=>({...e,discriminator:Za}))}function Xa(){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 uW(){return gill.combineCodec(vo(),Xa())}async function AW(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:vo().encode(c),programAddress:r})}function Qa(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:vo().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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:o(),whitelistedAddressTrees:o(),systemProgram:r()},data:Xa().decode(e.data)}}var ti=new Uint8Array([6]);function SW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ti)}function ri(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Ye()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",P()]]),e=>({...e,discriminator:ti}))}function ni(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Ze()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",M()]])}function xW(){return gill.combineCodec(ri(),ni())}function oi(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.authority),...a],data:ri().encode(c),programAddress:r})}function IW(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{authority:r()},data:ni().decode(e.data)}}var ai=new Uint8Array([7]);function RW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ai)}function ii(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Ye()],["secp256r1VerifyArgs",gill.getOptionEncoder(F())],["delegateTo",gill.getOptionEncoder($n())],["oldSettingsMutArgs",gill.getOptionEncoder(z())],["newSettingsMutArgs",gill.getOptionEncoder(z())],["compressedProofArgs",P()]]),e=>({...e,discriminator:ai}))}function di(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Ze()],["secp256r1VerifyArgs",gill.getOptionDecoder(G())],["delegateTo",gill.getOptionDecoder(eo())],["oldSettingsMutArgs",gill.getOptionDecoder(K())],["newSettingsMutArgs",gill.getOptionDecoder(K())],["compressedProofArgs",M()]])}function bW(){return gill.combineCodec(ii(),di())}function ui(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.feePayer),s(t.signer),s(t.oldSettings),s(t.newSettings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.domainConfig),...a],data:ii().encode(c),programAddress:r})}function _W(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:o(),oldSettings:o(),newSettings:o(),slotHashSysvar:o(),instructionsSysvar:o(),domainConfig:o()},data:di().decode(e.data)}}var gi=new Uint8Array([29]);function BW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(gi)}function Uo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:gi}))}function pi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["signers",gill.getArrayDecoder(Y())]])}function NW(){return gill.combineCodec(Uo(),pi())}async function wW(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(B(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Uo().encode(c),programAddress:r})}function mi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Uo().encode(c),programAddress:r})}function HW(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:pi().decode(e.data)}}var Ti=new Uint8Array([27]);function qW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ti)}function fi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["signers",gill.getArrayEncoder(J())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Ti}))}function Si(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["signers",gill.getArrayDecoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function JW(){return gill.combineCodec(fi(),Si())}function xi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:fi().encode(c),programAddress:r})}function YW(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Si().decode(e.data)}}var Mi=new Uint8Array([30]);function rL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Mi)}function ko(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["splInterfacePdaArgs",gill.getOptionEncoder(Wt())],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccounts",gill.getArrayEncoder(Ct())],["compressedProofArgs",gill.getOptionEncoder(P())],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:Mi}))}function hi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["splInterfacePdaArgs",gill.getOptionDecoder(Lt())],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccounts",gill.getArrayDecoder(Et())],["compressedProofArgs",gill.getOptionDecoder(M())],["signers",gill.getArrayDecoder(Y())]])}function nL(){return gill.combineCodec(ko(),hi())}async function oL(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};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(B(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(B(t.source.value)),gill.getAddressEncoder().encode(B(t.tokenProgram.value)),gill.getAddressEncoder().encode(B(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(B(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(B(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(B(t.destination.value)),gill.getAddressEncoder().encode(B(t.tokenProgram.value)),gill.getAddressEncoder().encode(B(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(B(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(B(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:ko().encode(c),programAddress:r})}function Ri(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:ko().encode(c),programAddress:r})}function sL(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:hi().decode(e.data)}}var Ui=new Uint8Array([28]);function gL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ui)}function Wo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["splInterfacePdaArgs",gill.getOptionEncoder(Wt())],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccounts",gill.getArrayEncoder(Ct())],["signers",gill.getArrayEncoder(J())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Ui}))}function ki(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["splInterfacePdaArgs",gill.getOptionDecoder(Lt())],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccounts",gill.getArrayDecoder(Et())],["signers",gill.getArrayDecoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function pL(){return gill.combineCodec(Wo(),ki())}async function mL(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};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(B(t.source.value)),gill.getAddressEncoder().encode(B(t.tokenProgram.value)),gill.getAddressEncoder().encode(B(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(B(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(B(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(B(t.destination.value)),gill.getAddressEncoder().encode(B(t.tokenProgram.value)),gill.getAddressEncoder().encode(B(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(B(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(B(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Wo().encode(c),programAddress:r})}function Wi(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Wo().encode(c),programAddress:r})}function lL(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:ki().decode(e.data)}}var Bi=new Uint8Array([13]);function CL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Bi)}function Ni(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())]]),e=>({...e,discriminator:Bi}))}function wi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())]])}function EL(){return gill.combineCodec(Ni(),wi())}function Hi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Ni().encode(c),programAddress:r})}function DL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:wi().decode(e.data)}}var Gi=new Uint8Array([23]);function vL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Gi)}function zi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Gi}))}function Ki(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function UL(){return gill.combineCodec(zi(),Ki())}function ji(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.rentCollector),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:zi().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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:Ki().decode(e.data)}}var Yi=new Uint8Array([10]);function HL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Yi)}function Zi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Ot()],["secp256r1VerifyArgs",gill.getOptionEncoder(F())]]),e=>({...e,discriminator:Yi}))}function Xi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Bt()],["secp256r1VerifyArgs",gill.getOptionDecoder(G())]])}function VL(){return gill.combineCodec(Zi(),Xi())}function Qi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:Zi().encode(c),programAddress:r})}function FL(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:Xi().decode(e.data)}}var td=new Uint8Array([20]);function YL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(td)}function rd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Ot()],["secp256r1VerifyArgs",gill.getOptionEncoder(F())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",P()]]),e=>({...e,discriminator:td}))}function nd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Bt()],["secp256r1VerifyArgs",gill.getOptionDecoder(G())],["settingsReadonlyArgs",kt()],["compressedProofArgs",M()]])}function ZL(){return gill.combineCodec(rd(),nd())}function od(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:rd().encode(c),programAddress:r})}function XL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:nd().decode(e.data)}}var ad=new Uint8Array([14]);function oO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ad)}function id(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())]]),e=>({...e,discriminator:ad}))}function dd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())]])}function sO(){return gill.combineCodec(id(),dd())}function ud(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:id().encode(c),programAddress:r})}function cO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:dd().decode(e.data)}}var pd=new Uint8Array([24]);function pO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(pd)}function md(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:pd}))}function ld(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function mO(){return gill.combineCodec(md(),ld())}function yd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:md().encode(c),programAddress:r})}function lO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:ld().decode(e.data)}}var Sd=new Uint8Array([12]);function IO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Sd)}function xd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Sd}))}function Id(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function CO(){return gill.combineCodec(xd(),Id())}function Cd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.transactionBuffer),...a],data:xd().encode(c),programAddress:r})}function EO(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:Id().decode(e.data)}}var Pd=new Uint8Array([22]);function bO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Pd)}function Md(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:Pd}))}function hd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function _O(){return gill.combineCodec(Md(),hd())}function Rd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.transactionBuffer),...a],data:Md().encode(c),programAddress:r})}function vO(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:hd().decode(e.data)}}var vd=new Uint8Array([11]);function NO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(vd)}function Ud(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())]]),e=>({...e,discriminator:vd}))}function kd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())]])}function wO(){return gill.combineCodec(Ud(),kd())}function Wd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Ud().encode(c),programAddress:r})}function HO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:kd().decode(e.data)}}var Bd=new Uint8Array([21]);function qO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Bd)}function Nd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Bd}))}function wd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())],["settingsReadonlyArgs",kt()],["compressedProofArgs",M()]])}function JO(){return gill.combineCodec(Nd(),wd())}function Hd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Nd().encode(c),programAddress:r})}function YO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:wd().decode(e.data)}}var Gd=new Uint8Array([15]);function tB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Gd)}function zd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Gd}))}function Kd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function rB(){return gill.combineCodec(zd(),Kd())}function jd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=l({}),a=y(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:zd().encode({}),programAddress:r})}function nB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:Kd().decode(e.data)}}var Yd=new Uint8Array([25]);function dB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Yd)}function Zd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:Yd}))}function Xd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function uB(){return gill.combineCodec(Zd(),Xd())}function Qd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.transactionBuffer),...a],data:Zd().encode(c),programAddress:r})}function AB(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:Xd().decode(e.data)}}var tu=new Uint8Array([16]);function fB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(tu)}function ru(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Nt()],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:tu}))}function nu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",wt()],["signers",gill.getArrayDecoder(Y())]])}function SB(){return gill.combineCodec(ru(),nu())}function ou(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:ru().encode(c),programAddress:r})}function xB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:nu().decode(e.data)}}var au=new Uint8Array([26]);function hB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(au)}function iu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Nt()],["signers",gill.getArrayEncoder(J())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:au}))}function du(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",wt()],["signers",gill.getArrayDecoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function RB(){return gill.combineCodec(iu(),du())}function uu(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:iu().encode(c),programAddress:r})}function bB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:du().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",tE=(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))(tE||{});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 rE=(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.NativeTransferIntent=13]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=14]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=15]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=16]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=17]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=18]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=19]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=20]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=21]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=22]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=23]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=24]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=25]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=26]="TransactionBufferVoteCompressed",T[T.TransactionExecute=27]="TransactionExecute",T[T.TransactionExecuteCompressed=28]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=29]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=30]="TransactionExecuteSyncCompressed",T))(rE||{});function gN(e){let n="data"in e?e.data:e;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 1;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 2;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 3;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 4;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 5;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 6;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 7;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 8;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 9;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 10;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 11;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 12;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 13;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 14;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 15;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 16;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 17;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 18;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 19;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 20;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 21;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 22;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 23;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 24;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 25;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 26;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 27;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 28;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 29;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 30;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var oE=6e3,sE=6001,cE=6002,aE=6003,iE=6004,dE=6005,uE=6006,AE=6007,gE=6008,pE=6009,mE=6010,lE=6011,yE=6012,TE=6013,fE=6014,SE=6015,xE=6016,IE=6017,CE=6018,EE=6019,DE=6020,PE=6021,ME=6022,hE=6023,RE=6024,bE=6025,_E=6026,vE=6027,UE=6028,kE=6029,WE=6030,LE=6031,OE=6032,BE=6033,NE=6034,wE=6035,HE=6036,VE=6037,FE=6038,GE=6039,zE=6040,KE=6041,jE=6042,qE=6043,JE=6044,YE=6045,ZE=6046,XE=6047,QE=6048,$E=6049,eD=6050,tD=6051,rD=6052,nD=6053,oD=6054,sD=6055,cD=6056,aD=6057,iD=6058,dD=6059,uD=6060,AD=6061,gD=6062,pD=6063,mD=6064,lD=6065,yD=6066,TD=6067,fD=6068,SD=6069,xD=6070,ID=6071,CD=6072,ED=6073,DD=6074,PD=6075,MD=6076,hD=6077,RD=6078,bD=6079,_D=6080,vD=6081,UD=6082,kD=6083,WD=6084,LD=6085,OD=6086,Au;process.env.NODE_ENV!=="production"&&(Au={[LE]:"This member is already delegated to another wallet.",[AE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[hD]:"Clock sysvar access failed. This may indicate a system error.",[tD]:"Missing credential id.",[nD]:"The domain configuration account is disabled. Please contact support or try again later.",[oD]:"Missing domain configuration account.",[PD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[OD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[mE]:"Duplicate public keys detected among members. Each member must have a unique key.",[pE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[PE]:"No members provided. A multisig wallet must contain at least one member.",[uD]:"Slot numbers list is empty. At least one slot number is required for validation.",[CE]:"Expected a User with Administrator role for this instruction.",[gE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[xE]:"Expected a User with Transaction Manager role for this instruction.",[zE]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[KE]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[jE]:"Declared buffer size does not match the actual serialized size.",[dD]:"Failed to compute hash. This may indicate a system error.",[NE]:"Not enough members with vote permission to meet the approval threshold.",[OE]:"At least one signer with execute permission is required to proceed.",[BE]:"At least one signer with initiate permission is required to perform this action.",[_E]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[DD]:"Invalid account index in transaction message. The account index is out of bounds.",[aD]:"Address Tree supplied is not part of the whitelisted address trees.",[EE]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[UE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[GE]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[AD]:"Member key conversion failed. The provided key format is invalid.",[wE]:"Only delegated members are allowed for this transaction.",[bE]:"Unexpected number of accounts provided for this instruction.",[TE]:"User with Permanent Member role must have a delegated wallet.",[sE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[iE]:"The extracted public key has an invalid length or encoding.",[oE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[aE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[eD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[QE]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[hE]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[ID]:"Invalid source type for token transfer. The source account type is not supported.",[IE]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[SE]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[RE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[_D]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[vE]:"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.",[xD]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[dE]:"The extracted WebAuthn signed message payload is malformed.",[ZE]:"An input string exceeds the maximum allowed character length.",[sD]:"This member is not registered under the provided domain configuration.",[mD]:"Member not found in settings. Cannot remove a member that does not exist.",[ED]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[kE]:"A required account is missing from the instruction context.",[gD]:"Compressed proof arguments are missing. Required for compressed account operations.",[TD]:"Missing compressed token account. Required for token transfer operations.",[vD]:"Missing destination token account. Required for token transfer operations.",[SD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[pD]:"Light CPI accounts are missing. Required for compressed account operations.",[WE]:"User mutation arguments are required when performing add or remove delegate operations.",[WD]:"Missing new authority account. Required for domain configuration updates.",[kD]:"Missing settings account. Required for delegate operations on compressed wallets.",[iD]:"Compressed settings data is missing. The settings account must be initialized with data.",[UD]:"Missing source token account. Required for token transfer operations.",[fD]:"Missing SPL interface PDA. Required for token transfer operations.",[XE]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[MD]:"User account address is missing. Required for secp256r1 signature verification.",[LD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[VE]:"No valid signer found in this transaction.",[DE]:"Only one administrator is allowed per wallet.",[yE]:"Only one permanent member is allowed per wallet.",[fE]:"Only one transaction manager is allowed per wallet.",[cD]:"The given origin index is not in the whitelisted origins.",[yD]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[lE]:"Permanent members cannot be removed from a wallet.",[YE]:"Writable CPI calls to protected accounts are not permitted.",[uE]:"The rpIdHash extracted from the signed message does not match the expected value.",[lD]:"Settings key mismatch. The provided settings key does not match the expected value.",[cE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[$E]:"The specified slot number was not found in the provided slot history.",[CD]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[ME]:"Too many members: a maximum of 4 members are supported.",[qE]:"This transaction has expired. It must be executed within 3 minutes of approval.",[JE]:"This transaction has not yet reached the required approval threshold.",[rD]:"Missing transports.",[FE]:"Only the transaction creator or rent payer may close this transaction buffer.",[RD]:"Unauthorized: Only the admin account is allowed to perform this action.",[HE]:"Member is not part of the expected signers for this transaction."});function fN(e){return process.env.NODE_ENV!=="production"?Au[e]:"Error message not available in production bundles."}function SN(e,n,r){return gill.isProgramError(e,n,A,r)}async function _N({admin:e,addressTree:n}){return zc({payer:e,addressTree:n,remainingAccounts:[]})}var he=class extends Error{constructor(r,o,t){super(r);this.code=o;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},Xe=class extends he{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},ee=class extends he{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},_=class extends he{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},me=class extends he{constructor(r,o,t){super(r,"NETWORK_ERROR",{statusCode:o,url:t});this.statusCode=o;this.url=t;}};var ae=class extends he{constructor(r,o,t){super(r,"BUNDLE_ERROR",{bundleId:o,attempt:t});this.bundleId=o;this.attempt=t;}},hr=class extends he{constructor(r,o,t){super(`Operation "${r}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=o;this.lastError=t;}},Rr=class extends he{constructor(r,o,t){super(r,"PERMISSION_ERROR",{required:o,actual:t});this.required=o;this.actual=t;}};var Kt={Ed25519:1,Secp256r1:2};var BD=m__default.default.looseObject({publicKey:m__default.default.string(),walletAddress:m__default.default.string(),settingsIndexWithAddress:m__default.default.object({index:m__default.default.union([m__default.default.number(),m__default.default.bigint()]),settingsAddressTreeIndex:m__default.default.number()}),username:m__default.default.string().optional(),profilePictureUrl:m__default.default.string().optional()}),gu=m__default.default.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),BN=m__default.default.object({transactionActionType:gu,transactionAddress:m__default.default.string(),transactionMessageBytes:m__default.default.array(m__default.default.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),ND=m__default.default.object({transactionActionType:gu,transactionAddress:m__default.default.string(),transactionMessageBytes:m__default.default.base64()}).strict(),wD=m__default.default.union([m__default.default.object({type:m__default.default.literal("Ephemeral"),secretKey:m__default.default.string()}),m__default.default.object({type:m__default.default.literal("Default"),publickey:m__default.default.string(),endpoint:m__default.default.string()})]).array().optional(),pu=m__default.default.object({phase:m__default.default.literal("start"),redirectOrigin:m__default.default.url(),signer:m__default.default.string().optional(),rid:m__default.default.string(),validTill:m__default.default.number(),data:m__default.default.object({type:m__default.default.literal("message"),payload:m__default.default.string(),trustedDeviceCheck:m__default.default.boolean()}).strict()}).strict(),mu=m__default.default.object({phase:m__default.default.literal("start"),redirectOrigin:m__default.default.url(),signer:m__default.default.string().optional(),rid:m__default.default.string(),validTill:m__default.default.number(),data:m__default.default.object({type:m__default.default.literal("transaction"),payload:ND,sendTx:m__default.default.boolean(),additionalSigners:wD}).strict()}).strict(),lu=m__default.default.object({startRequest:m__default.default.union([pu,mu]),authResponse:m__default.default.custom(),client:m__default.default.object({clientOrigin:m__default.default.url(),jws:m__default.default.string()}).strict(),device:m__default.default.object({jwk:m__default.default.base64(),jws:m__default.default.string()}).strict()}).strict(),yu=m__default.default.object({signer:m__default.default.string(),userAddressTreeIndex:m__default.default.number().optional(),additionalInfo:m__default.default.looseObject({}).optional()}).strict(),HD=m__default.default.object({slotHash:m__default.default.string(),slotNumber:m__default.default.string(),originIndex:m__default.default.number(),crossOrigin:m__default.default.boolean()}).strict(),NN=m__default.default.object({phase:m__default.default.literal("complete"),data:m__default.default.object({type:m__default.default.literal("message"),payload:yu.extend(lu.shape).extend({id:m__default.default.string().optional(),client:m__default.default.object({clientOrigin:m__default.default.url()}).strict()})}).strict()}).strict(),wN=m__default.default.object({phase:m__default.default.literal("complete"),data:m__default.default.object({type:m__default.default.literal("transaction"),payload:yu.extend(lu.shape).extend(HD.shape).extend({client:m__default.default.object({clientOrigin:m__default.default.url()}).strict()})}).strict()}).strict(),HN=m__default.default.object({phase:m__default.default.literal("complete"),data:m__default.default.object({type:m__default.default.literal("transaction"),payload:m__default.default.object({startRequest:m__default.default.union([mu,pu]),txSig:m__default.default.string(),user:BD})}).strict()}).strict();var Re={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},ve=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,o)=>r|o,0))}static all(){return new e(Object.values(Re).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var Bo=33,Ue=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!==Bo)throw new Error(`Invalid public key length, expected ${Bo} 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===Bo)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()}},U=class extends Ue{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 GD(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function zD(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var fu=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(GD())],["addressTableLookups",gill.getArrayCodec(zD())]]);function Su(e){return fu.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 xu(e){let n=fu.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}var wo=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Iu="https://mainnet.block-engine.jito.wtf/api/v1",Cu="https://bundles.jito.wtf/api/v1/bundles/tip_floor",Eu="landed_tips_75th_percentile";var ne={};function Du(){if(!ne.solanaRpcEndpoint)throw new Xe("RPC endpoint");return ne.solanaRpcEndpoint}function Te(){if(!ne.lightProtocolRpc)throw new Xe("Light Protocol RPC");return ne.lightProtocolRpc}function Z(){if(!ne.solanaRpc)throw new Xe("Solana RPC");return ne.solanaRpc}function Pu(){if(!ne.sendAndConfirm)throw new Xe("Send and confirm transaction function");return ne.sendAndConfirm}function Ho(){return ne.jitoTipsConfig?ne.jitoTipsConfig:{blockEngineUrl:Iu,getJitoTipsUrl:Cu,priority:Eu}}function uw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:o}){ne.solanaRpcEndpoint=e,ne.lightProtocolRpc=stateless_js.createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=gill.createSolanaClient({urlOrMoniker:e});ne.solanaRpc=t,ne.sendAndConfirm=c,ne.jitoTipsConfig=o??null;}async function jt(e,n){if(!e.ok)throw new me(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function qt(e){try{return await e.json()}catch(n){throw new me(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function Pw(e){let n=tinyCbor.decodeCBOR(e),r=nist_js.p256.Point.fromAffine({x:BigInt("0x"+_r(n.get(-2))),y:BigInt("0x"+_r(n.get(-3)))});return gill.getBase58Decoder().decode(r.toBytes(true))}function Mw(e){let r=nist_js.p256.Point.fromBytes(gill.getBase58Encoder().encode(e)).toBytes(false),o=new Map;return o.set(1,2),o.set(3,-7),o.set(-1,1),o.set(-2,r.slice(1,33)),o.set(-3,r.slice(33,65)),new Uint8Array(tinyCbor.encodeCBOR(o))}async function hw(e){let{authenticatorData:n,clientDataJSON:r,signature:o}=e.authResponse.response,t=le(n),c=JSON.parse(gill.getUtf8Decoder().decode(le(r))),i=_u(c),a=Uu(le(o)),s=await at({rpIdHash:t.subarray(0,32)});return new U(e.signer.toString(),{verifyArgs:{clientDataJson:le(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:gill.getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:Vo(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:s,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function Vo(e,n,r){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...gill.getBase64Encoder().encode(n),...gill.getBase64Encoder().encode(r)]))}function Rw(e){return sha2_js.sha256(gill.getUtf8Encoder().encode(jsonCanonicalize.canonicalize(e)))}function bw(e){return Fo(e.data.payload.authResponse)}function _w(e,n,r,o){let t=Vo(n,r,o);return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...t]))}async function vw(e,n,r,o,t,c){let i;if(!t||!c){let u=(await Z().getAccountInfo(gill.address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!u)throw new ee("Slot sysvar","Unable to fetch slot sysvar data");let g=gill.getBase64Encoder().encode(u[0]);c=gill.getU64Decoder().decode(g.subarray(0,8)).toString(),i=g.subarray(8,40),t=gill.getBase58Decoder().decode(i);}else i=gill.getBase58Encoder().encode(t);let a=sha2_js.sha256(typeof e.transactionMessageBytes=="string"?gill.getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),s=Vo(n,r,o),d=sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e.transactionActionType),...gill.getBase58Encoder().encode(e.transactionAddress),...a,...i,...s]));return {slotNumber:c,slotHash:t,challenge:d}}function Fo(e){let n=vr(e);return sha2_js.sha256(n)}function Uw(e){let n="";for(let o of e)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function le(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,o=n.padEnd(n.length+r,"="),t=atob(o),c=new ArrayBuffer(t.length),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}async function kw(e,n){let{data:r}=await is(Z(),e),t=vu(r.origins,r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new ee("Origin","Origin not found in domain config");return t}function Ww(e){return gill.getBase64Decoder().decode(gill.getUtf8Encoder().encode(jsonCanonicalize.canonicalize(e)))}function Lw(e){return JSON.parse(gill.getUtf8Decoder().decode(gill.getBase64Encoder().encode(e)))}function _r(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function $D(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 _u(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let o=JSON.stringify(r);return new TextEncoder().encode(o.slice(1,-1))}function vu(e,n){let r=[],o=0,t=new TextDecoder;for(let c=0;c<n;c++){if(o+2>e.length)throw new Error("MaxLengthExceeded");let i=e[o]|e[o+1]<<8;if(o+=2,o+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(o,o+i),s=t.decode(a);r.push(s),o+=i;}return r}function Uu(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 D=n&127;r+=D;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let o=e[r+1],t=r+2,c=e.slice(t,t+o);if(r=t+o,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,s=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=s[0]===0&&s.length>32?s.slice(1):s;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let p=nist_js.p256.Point.CURVE().n>>1n,f=BigInt("0x"+_r(u)),C=(f>p?nist_js.p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=$D(C);return new Uint8Array([...g,...x])}function vr(e){let n=le(e.response.clientDataJSON),r=le(e.response.authenticatorData),o=sha2_js.sha256(n);return new Uint8Array([...r,...o])}var eP=400,tP=429,Wu=500,rP=3,nP=500,oP=2,sP=3e4,Lu={backoffBase:oP,maxDelayMs:sP,retryOnRateLimit:true,initialDelayMs:nP,maxRetries:rP};function Ou(e){return e===tP}function Bu(e){return e>=Wu}function cP(e){return e>=eP&&e<Wu}function aP(e){return Ou(e)||Bu(e)}function iP(e,n,r){return e instanceof Response?Ou(e.status)?r.retryOnRateLimit??true:cP(e.status)?false:Bu(e.status):e instanceof TypeError||e instanceof Error}function dP(e,n,r,o){let t=n*Math.pow(r,e-1);return Math.min(t,o)}function uP(e){return new Promise(n=>setTimeout(n,e))}async function Zt(e,n){let{maxRetries:r,initialDelayMs:o,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...Lu,...n},a;for(let s=1;s<=r;s++)try{return await e()}catch(d){if(a=d,i&&!i(d,s))throw d;if(s>=r)break;let u=dP(s,o,t,c);await uP(u);}throw new hr(e.name||"retryWithBackoff",r,a)}async function Ur(e,n){let r={...Lu,...n},o=(c,i)=>iP(c,i,r);return Zt(async()=>{let c=await e();if(!c.ok&&aP(c.status))throw c;return c},{...r,shouldRetry:n?.shouldRetry??o})}function Nu(...e){return n=>e.some(r=>n instanceof r)}function wu(e,n,r,o){if(e<n||e>r)throw new _(`${o} must be between ${n} and ${r} (inclusive), got ${e}`)}function Hu(e,n){if(e<0)throw new _(`${n} must be non-negative, got ${e}`)}function Xt(e,n){if(e.length===0)throw new _(`${n} cannot be empty`)}function Vu(e,n){if(e.trim().length===0)throw new _(`${n} cannot be empty`)}async function zo(e,n=false){let r=n?{blockhash:gill.getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await Z().getLatestBlockhash().send()).value;return await Promise.all(e.map(async o=>await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(o.instructions,c),c=>gill.setTransactionMessageFeePayerSigner(o.payer,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(r,c),c=>o.addressesByLookupTableAddress?gill.compressTransactionMessageUsingAddressLookupTables(c,o.addressesByLookupTableAddress):c,async c=>{let i=Math.ceil((o.unitsConsumed??0)*1.1);return i>2e5?gill.prependTransactionMessageInstructions([programs.getSetComputeUnitLimitInstruction({units:i})],c):c},async c=>n?gill.compileTransaction(await c):await gill.signTransactionMessageWithSigners(await c))))}async function ju(e){let n=gill.prependTransactionMessageInstructions([programs.getSetComputeUnitLimitInstruction({units:8e5}),programs.getSetComputeUnitPriceInstruction({microLamports:1e4})],e),r=gill.getBase64EncodedWireTransaction(gill.compileTransaction(n));if(r.length>1644)throw new _(`Transaction exceeds maximum length of ${1644} bytes (actual: ${r.length} bytes)`);let o=await Z().simulateTransaction(r,{encoding:"base64"}).send();if(o.value.err){if(o.value.logs){let c=["Transaction simulation failed:","",...o.value.logs].join(`
|
|
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'),m=require('zod'),programs=require('gill/programs'),nist_js=require('@noble/curves/nist.js'),tinyCbor=require('@levischuck/tiny-cbor'),jsonCanonicalize=require('json-canonicalize'),compressedToken=require('@lightprotocol/compressed-token'),CM=require('bn.js'),utils_js=require('@noble/curves/utils.js');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var m__default=/*#__PURE__*/_interopDefault(m);var CM__default=/*#__PURE__*/_interopDefault(CM);var cs=new Uint8Array([201,232,212,229,59,241,106,197]);function QM(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(cs)}function XA(){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:cs}))}function as(){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 $M(){return gill.combineCodec(XA(),as())}function is(e){return gill.decodeAccount(e,as())}async function ds(e,n,r){let o=await QA(e,n,r);return gill.assertAccountExists(o),o}async function QA(e,n,r){let o=await gill.fetchEncodedAccount(e,n,r);return is(o)}async function eh(e,n,r){let o=await $A(e,n,r);return gill.assertAccountsExist(o),o}async function $A(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>is(t))}function th(){return 846}var gs=new Uint8Array([42,206,176,58,175,129,130,233]);function oh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(gs)}function pg(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:gs}))}function ps(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function sh(){return gill.combineCodec(pg(),ps())}function ms(e){return gill.decodeAccount(e,ps())}async function ch(e,n,r){let o=await mg(e,n,r);return gill.assertAccountExists(o),o}async function mg(e,n,r){let o=await gill.fetchEncodedAccount(e,n,r);return ms(o)}async function ah(e,n,r){let o=await lg(e,n,r);return gill.assertAccountsExist(o),o}async function lg(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>ms(t))}function ih(){return 24}var Kr=(r=>(r[r.Initialized=0]="Initialized",r[r.Frozen=1]="Frozen",r))(Kr||{});function jr(){return gill.getEnumEncoder(Kr)}function qr(){return gill.getEnumDecoder(Kr)}function Ah(){return gill.combineCodec(jr(),qr())}function Jr(){return gill.getStructEncoder([["key",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["value",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Yr(){return gill.getStructDecoder([["key",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["value",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function mh(){return gill.combineCodec(Jr(),Yr())}function Zr(){return gill.getStructEncoder([["memberKey",V()],["permissions",Be()],["userArgs",we()]])}function Xr(){return gill.getStructDecoder([["memberKey",$()],["permissions",Ne()],["userArgs",He()]])}function fh(){return gill.combineCodec(Zr(),Xr())}function Qr(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function $r(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function Ih(){return gill.combineCodec(Qr(),$r())}function pt(){return gill.getStructEncoder([["treeInfo",lt()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["outputStateTreeIndex",gill.getU8Encoder()]])}function mt(){return gill.getStructDecoder([["treeInfo",yt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["outputStateTreeIndex",gill.getU8Decoder()]])}function Ph(){return gill.combineCodec(pt(),mt())}function Tt(){return gill.getStructEncoder([["treeInfo",lt()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function ft(){return gill.getStructDecoder([["treeInfo",yt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function bh(){return gill.combineCodec(Tt(),ft())}function en(){return gill.getStructEncoder([["delegatedAmount",gill.getU64Encoder()],["withheldTransferFee",gill.getU64Encoder()],["isAta",gill.getU8Encoder()]])}function tn(){return gill.getStructDecoder([["delegatedAmount",gill.getU64Decoder()],["withheldTransferFee",gill.getU64Decoder()],["isAta",gill.getU8Decoder()]])}function Uh(){return gill.combineCodec(en(),tn())}function cn(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function an(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function Lh(){return gill.combineCodec(cn(),an())}function St(){return gill.getStructEncoder([["data",gill.getOptionEncoder(dn())]])}function q(){return gill.getStructDecoder([["data",gill.getOptionDecoder(un())]])}function wh(){return gill.combineCodec(St(),q())}function dn(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(xt())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]])}function un(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(It())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function Gh(){return gill.combineCodec(dn(),un())}function Ct(){return gill.getStructEncoder([["version",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()],["amount",gill.getU64Encoder()],["merkleContext",gn()],["tlv",gill.getOptionEncoder(gill.getArrayEncoder(An()))],["state",jr()]])}function Et(){return gill.getStructDecoder([["version",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()],["amount",gill.getU64Decoder()],["merkleContext",pn()],["tlv",gill.getOptionDecoder(gill.getArrayDecoder(Dt()))],["state",qr()]])}function qh(){return gill.combineCodec(Ct(),Et())}function yn(){return gill.getStructEncoder([["decimalsOption",gill.getU8Encoder()],["decimals",gill.getU8Encoder()],["compressionOnly",gill.getBooleanEncoder()],["isAta",gill.getU8Encoder()],["info",fn()]])}function Tn(){return gill.getStructDecoder([["decimalsOption",gill.getU8Decoder()],["decimals",gill.getU8Decoder()],["compressionOnly",gill.getBooleanDecoder()],["isAta",gill.getU8Decoder()],["info",Sn()]])}function Xh(){return gill.combineCodec(yn(),Tn())}function fn(){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",Cn()]])}function Sn(){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",En()]])}function tR(){return gill.combineCodec(fn(),Sn())}function Ve(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Mn())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Zr())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Rn())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function Fe(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(hn())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Xr())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(bn())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function sR(){return gill.combineCodec(Ve(),Fe())}function cR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function aR(e,n){return n.__kind===e}function _n(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",Ge()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",Pe()]])}function vn(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",ze()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",Me()]])}function AR(){return gill.combineCodec(_n(),vn())}function Mn(){return gill.getStructEncoder([["memberKey",V()],["permissions",Be()]])}function hn(){return gill.getStructDecoder([["memberKey",$()],["permissions",Ne()]])}function lR(){return gill.combineCodec(Mn(),hn())}function Pt(){return gill.getStructEncoder([["memberKey",V()],["messageHash",gill.getOptionEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))]])}function Mt(){return gill.getStructDecoder([["memberKey",$()],["messageHash",gill.getOptionDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))]])}function SR(){return gill.combineCodec(Pt(),Mt())}function An(){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([On()])]])],["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([Un()])]])],["PermanentDelegateAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([Wn()])]])],["TransferFeeAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([Nn()])]])],["TransferHookAccount",gill.getStructEncoder([["fields",gill.getTupleEncoder([Hn()])]])],["CompressedOnly",gill.getStructEncoder([["fields",gill.getTupleEncoder([en()])]])],["Compressible",gill.getStructEncoder([["fields",gill.getTupleEncoder([yn()])]])]])}function Dt(){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([Bn()])]])],["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([kn()])]])],["PermanentDelegateAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Ln()])]])],["TransferFeeAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([wn()])]])],["TransferHookAccount",gill.getStructDecoder([["fields",gill.getTupleDecoder([Vn()])]])],["CompressedOnly",gill.getStructDecoder([["fields",gill.getTupleDecoder([tn()])]])],["Compressible",gill.getStructDecoder([["fields",gill.getTupleDecoder([Tn()])]])]])}function ER(){return gill.combineCodec(An(),Dt())}function DR(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function PR(e,n){return n.__kind===e}function Fn(){return gill.getStructEncoder([["settingsMutArgs",z()],["transactionManager",gill.getOptionEncoder(ht())]])}function Gn(){return gill.getStructDecoder([["settingsMutArgs",K()],["transactionManager",gill.getOptionDecoder(Rt())]])}function bR(){return gill.combineCodec(Fn(),Gn())}function xt(){return gill.getStructEncoder([["pubkey",V()],["role",gill.getU8Encoder()],["permissions",Be()],["userAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getU8Encoder()]])}function It(){return gill.getStructDecoder([["pubkey",$()],["role",gill.getU8Decoder()],["permissions",Ne()],["userAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getU8Decoder()]])}function kR(){return gill.combineCodec(xt(),It())}function V(){return gill.getStructEncoder([["keyType",gill.getU8Encoder()],["key",gill.fixEncoderSize(gill.getBytesEncoder(),33)]])}function $(){return gill.getStructDecoder([["keyType",gill.getU8Decoder()],["key",gill.fixDecoderSize(gill.getBytesDecoder(),33)]])}function OR(){return gill.combineCodec(V(),$())}function jn(){return gill.getStructEncoder([["authorityCreationArgs",Pe()],["compressedProofArgs",P()]])}function qn(){return gill.getStructDecoder([["authorityCreationArgs",Me()],["compressedProofArgs",M()]])}function HR(){return gill.combineCodec(jn(),qn())}function bt(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function _t(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function GR(){return gill.combineCodec(bt(),_t())}function gn(){return gill.getStructEncoder([["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()],["proveByIndex",gill.getBooleanEncoder()]])}function pn(){return gill.getStructDecoder([["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()],["proveByIndex",gill.getBooleanDecoder()]])}function jR(){return gill.combineCodec(gn(),pn())}function lt(){return gill.getStructEncoder([["rootIndex",gill.getU16Encoder()],["proveByIndex",gill.getBooleanEncoder()],["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()]])}function yt(){return gill.getStructDecoder([["rootIndex",gill.getU16Decoder()],["proveByIndex",gill.getBooleanDecoder()],["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()]])}function YR(){return gill.combineCodec(lt(),yt())}function Un(){return gill.getStructEncoder([])}function kn(){return gill.getStructDecoder([])}function QR(){return gill.combineCodec(Un(),kn())}function Wn(){return gill.getStructEncoder([])}function Ln(){return gill.getStructDecoder([])}function tb(){return gill.combineCodec(Wn(),Ln())}function Be(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function Ne(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function ob(){return gill.combineCodec(Be(),Ne())}function P(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(cn())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function M(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(an())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function ib(){return gill.combineCodec(P(),M())}function Rn(){return gill.getStructEncoder([["memberKey",V()],["userArgs",we()]])}function bn(){return gill.getStructDecoder([["memberKey",$()],["userArgs",He()]])}function gb(){return gill.combineCodec(Rn(),bn())}function Cn(){return gill.getStructEncoder([["baseRent",gill.getU16Encoder()],["compressionCost",gill.getU16Encoder()],["lamportsPerBytePerEpoch",gill.getU8Encoder()],["maxFundedEpochs",gill.getU8Encoder()],["maxTopUp",gill.getU16Encoder()]])}function En(){return gill.getStructDecoder([["baseRent",gill.getU16Decoder()],["compressionCost",gill.getU16Decoder()],["lamportsPerBytePerEpoch",gill.getU8Decoder()],["maxFundedEpochs",gill.getU8Decoder()],["maxTopUp",gill.getU16Decoder()]])}function lb(){return gill.combineCodec(Cn(),En())}function Zn(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function vt(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function fb(){return gill.combineCodec(Zn(),vt())}function F(){return gill.getStructEncoder([["signedMessageIndex",gill.getU8Encoder()],["slotNumber",gill.getU64Encoder()],["originIndex",gill.getU8Encoder()],["crossOrigin",gill.getBooleanEncoder()],["truncatedClientDataJson",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["clientAndDeviceHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function G(){return gill.getStructDecoder([["signedMessageIndex",gill.getU8Decoder()],["slotNumber",gill.getU64Decoder()],["originIndex",gill.getU8Decoder()],["crossOrigin",gill.getBooleanDecoder()],["truncatedClientDataJson",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["clientAndDeviceHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function Ib(){return gill.combineCodec(F(),G())}function Xn(){return gill.getStructEncoder([["verifyArgs",F()],["domainConfigIndex",gill.getU8Encoder()]])}function Qn(){return gill.getStructDecoder([["verifyArgs",G()],["domainConfigIndex",gill.getU8Decoder()]])}function Pb(){return gill.combineCodec(Xn(),Qn())}function $n(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function eo(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function Rb(){return gill.combineCodec($n(),eo())}function to(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["isDelegate",gill.getBooleanEncoder()]])}function ro(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["isDelegate",gill.getBooleanDecoder()]])}function vb(){return gill.combineCodec(to(),ro())}function z(){return gill.getStructEncoder([["accountMeta",pt()],["data",St()]])}function K(){return gill.getStructDecoder([["accountMeta",mt()],["data",q()]])}function Lb(){return gill.combineCodec(z(),K())}function Ut(){return gill.getStructEncoder([["accountMeta",Tt()],["data",St()]])}function kt(){return gill.getStructDecoder([["accountMeta",ft()],["data",q()]])}function wb(){return gill.combineCodec(Ut(),kt())}function Wt(){return gill.getStructEncoder([["index",gill.getU8Encoder()],["restricted",gill.getBooleanEncoder()]])}function Lt(){return gill.getStructDecoder([["index",gill.getU8Decoder()],["restricted",gill.getBooleanDecoder()]])}function Fb(){return gill.combineCodec(Wt(),Lt())}function On(){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(Jr())]])}function Bn(){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(Yr())]])}function jb(){return gill.combineCodec(On(),Bn())}function Ot(){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()],["expectedSigners",gill.getArrayEncoder(Pt())]])}function Bt(){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()],["expectedSigners",gill.getArrayDecoder(Mt())]])}function Zb(){return gill.combineCodec(Ot(),Bt())}function Nt(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(Qr())],["addressTableLookups",gill.getArrayEncoder(uo())]])}function wt(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder($r())],["addressTableLookups",gill.getArrayDecoder(Ao())]])}function e_(){return gill.combineCodec(Nt(),wt())}function uo(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Ao(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function n_(){return gill.combineCodec(uo(),Ao())}function J(){return gill.getDiscriminatedUnionEncoder([["Ed25519",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])],["Secp256r1",gill.getStructEncoder([["fields",gill.getTupleEncoder([Xn()])]])]])}function Y(){return gill.getDiscriminatedUnionDecoder([["Ed25519",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])],["Secp256r1",gill.getStructDecoder([["fields",gill.getTupleDecoder([Qn()])]])]])}function a_(){return gill.combineCodec(J(),Y())}function i_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function d_(e,n){return n.__kind===e}function Nn(){return gill.getStructEncoder([["withheldAmount",gill.getU64Encoder()]])}function wn(){return gill.getStructDecoder([["withheldAmount",gill.getU64Decoder()]])}function g_(){return gill.combineCodec(Nn(),wn())}function Hn(){return gill.getStructEncoder([["transferring",gill.getU8Encoder()]])}function Vn(){return gill.getStructDecoder([["transferring",gill.getU8Decoder()]])}function l_(){return gill.combineCodec(Hn(),Vn())}var go=(a=>(a[a.Ble=0]="Ble",a[a.Cable=1]="Cable",a[a.Hybrid=2]="Hybrid",a[a.Internal=3]="Internal",a[a.Nfc=4]="Nfc",a[a.SmartCard=5]="SmartCard",a[a.Usb=6]="Usb",a))(go||{});function Ht(){return gill.getEnumEncoder(go)}function Vt(){return gill.getEnumDecoder(go)}function f_(){return gill.combineCodec(Ht(),Vt())}function Ft(){return gill.getStructEncoder([["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["member",V()],["credentialId",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder()))],["transports",gill.getOptionEncoder(gill.getArrayEncoder(Ht()))],["wallets",gill.getArrayEncoder(to())],["role",Ge()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function Q(){return gill.getStructDecoder([["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["member",$()],["credentialId",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder()))],["transports",gill.getOptionDecoder(gill.getArrayDecoder(Vt()))],["wallets",gill.getArrayDecoder(ro())],["role",ze()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function C_(){return gill.combineCodec(Ft(),Q())}function Pe(){return gill.getStructEncoder([["addressTreeInfo",bt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function Me(){return gill.getStructDecoder([["addressTreeInfo",_t()],["outputStateTreeIndex",gill.getU8Decoder()]])}function M_(){return gill.combineCodec(Pe(),Me())}function Ye(){return gill.getStructEncoder([["accountMeta",pt()],["data",Ft()]])}function Ze(){return gill.getStructDecoder([["accountMeta",mt()],["data",Q()]])}function __(){return gill.combineCodec(Ye(),Ze())}function ht(){return gill.getStructEncoder([["accountMeta",Tt()],["data",Ft()]])}function Rt(){return gill.getStructDecoder([["accountMeta",ft()],["data",Q()]])}function W_(){return gill.combineCodec(ht(),Rt())}function we(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([ht()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([Ye()])]])]])}function He(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([Rt()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([Ze()])]])]])}function N_(){return gill.combineCodec(we(),He())}function w_(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function H_(e,n){return n.__kind===e}var _e=(t=>(t[t.TransactionManager=0]="TransactionManager",t[t.Administrator=1]="Administrator",t[t.PermanentMember=2]="PermanentMember",t[t.Member=3]="Member",t))(_e||{});function Ge(){return gill.getEnumEncoder(_e)}function ze(){return gill.getEnumDecoder(_e)}function G_(){return gill.combineCodec(Ge(),ze())}var Pc=new Uint8Array([223,179,163,190,177,224,67,173]);function qv(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Pc)}function c1(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(xt())],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["latestSlotNumber",gill.getU64Encoder()]]),e=>({...e,discriminator:Pc}))}function Tr(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(It())],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["latestSlotNumber",gill.getU64Decoder()]])}function Jv(){return gill.combineCodec(c1(),Tr())}function Mc(e){return gill.decodeAccount(e,Tr())}async function Yv(e,n,r){let o=await po(e,n,r);return gill.assertAccountExists(o),o}async function po(e,n,r){let o=await gill.fetchEncodedAccount(e,n,r);return Mc(o)}async function Zv(e,n,r){let o=await a1(e,n,r);return gill.assertAccountsExist(o),o}async function a1(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Mc(t))}var vc=new Uint8Array([90,36,35,219,93,225,110,96]);function eU(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(vc)}function P1(){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",V()],["executor",V()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder(V())],["expectedSigners",gill.getArrayEncoder(Pt())],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:vc}))}function Uc(){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",$()],["executor",$()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["voters",gill.getArrayDecoder($())],["expectedSigners",gill.getArrayDecoder(Mt())],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function tU(){return gill.combineCodec(P1(),Uc())}function kc(e){return gill.decodeAccount(e,Uc())}async function Wc(e,n,r){let o=await M1(e,n,r);return gill.assertAccountExists(o),o}async function M1(e,n,r){let o=await gill.fetchEncodedAccount(e,n,r);return kc(o)}async function rU(e,n,r){let o=await h1(e,n,r);return gill.assertAccountsExist(o),o}async function h1(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>kc(t))}var Bc=new Uint8Array([105,23,173,2,197,255,80,87]);function sU(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Bc)}function K1(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:Bc}))}function Nc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function cU(){return gill.combineCodec(K1(),Nc())}function wc(e){return gill.decodeAccount(e,Nc())}async function Hc(e,n,r){let o=await j1(e,n,r);return gill.assertAccountExists(o),o}async function j1(e,n,r){let o=await gill.fetchEncodedAccount(e,n,r);return wc(o)}async function aU(e,n,r){let o=await q1(e,n,r);return gill.assertAccountsExist(o),o}async function q1(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>wc(t))}function l({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 B(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 o=r.isWritable?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY;return Object.freeze({address:B(r.value),role:Vc(r.value)?gill.upgradeRoleToSigner(o):o,...Vc(r.value)?{signer:r.value}:{}})}}function Vc(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var Gc=new Uint8Array([8]);function DU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Gc)}function Io(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:Gc}))}function zc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function PU(){return gill.combineCodec(Io(),zc())}async function Kc(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Io().encode(c),programAddress:r})}function MU(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.whitelistedAddressTrees),s(t.payer),s(t.systemProgram),...a],data:Io().encode(c),programAddress:r})}function hU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:zc().decode(e.data)}}var Zc=new Uint8Array([9]);function WU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Zc)}function Xc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(Ve())],["signers",gill.getArrayEncoder(J())],["compressedProofArgs",gill.getOptionEncoder(P())]]),e=>({...e,discriminator:Zc}))}function Qc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(Fe())],["signers",gill.getArrayDecoder(Y())],["compressedProofArgs",gill.getOptionDecoder(M())]])}function LU(){return gill.combineCodec(Xc(),Qc())}function $c(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Xc().encode(c),programAddress:r})}function OU(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Qc().decode(e.data)}}var oa=new Uint8Array([19]);function GU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(oa)}function sa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(Ve())],["signers",gill.getArrayEncoder(J())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:oa}))}function ca(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(Fe())],["signers",gill.getArrayDecoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function zU(){return gill.combineCodec(sa(),ca())}function aa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:sa().encode(c),programAddress:r})}function KU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:ca().decode(e.data)}}var ua=new Uint8Array([18]);function QU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ua)}function Co(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",P()],["addressTreeInfo",bt()],["outputStateTreeIndex",gill.getU8Encoder()],["userArgs",we()],["settingsIndex",gill.getU128Encoder()]]),e=>({...e,discriminator:ua}))}function Aa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",M()],["addressTreeInfo",_t()],["outputStateTreeIndex",gill.getU8Decoder()],["userArgs",He()],["settingsIndex",gill.getU128Decoder()]])}function $U(){return gill.combineCodec(Co(),Aa())}async function ga(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:Co().encode(c),programAddress:r})}function ek(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},initialMember:{value:e.initialMember??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.initialMember),s(t.systemProgram),s(t.globalCounter),s(t.whitelistedAddressTrees),...a],data:Co().encode(c),programAddress:r})}function tk(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:r(),systemProgram:r(),globalCounter:r(),whitelistedAddressTrees:r()},data:Aa().decode(e.data)}}var xa=new Uint8Array([0]);function ik(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(xa)}function Do(){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",Pe()],["compressedProofArgs",P()]]),e=>({...e,discriminator:xa}))}function Ia(){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",Me()],["compressedProofArgs",M()]])}function dk(){return gill.combineCodec(Do(),Ia())}async function Ca(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Do().encode(c),programAddress:r})}function uk(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.payer),s(t.authority),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:Do().encode(c),programAddress:r})}function Ak(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Ia().decode(e.data)}}var Pa=new Uint8Array([4]);function fk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Pa)}function Po(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",P()],["member",Zn()],["role",Ge()],["credentialId",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["transports",gill.getArrayEncoder(Ht())],["userAccountCreationArgs",Pe()],["linkWalletArgs",gill.getOptionEncoder(Fn())]]),e=>({...e,discriminator:Pa}))}function Ma(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",M()],["member",vt()],["role",ze()],["credentialId",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["transports",gill.getArrayDecoder(Vt())],["userAccountCreationArgs",Me()],["linkWalletArgs",gill.getOptionDecoder(Gn())]])}function Sk(){return gill.combineCodec(Po(),Ma())}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},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:Po().encode(c),programAddress:r})}function xk(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=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.authority),s(t.whitelistedAddressTrees),...a],data:Po().encode(c),programAddress:r})}function Ik(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:Ma().decode(e.data)}}var ba=new Uint8Array([3]);function hk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ba)}function ho(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:ba}))}function _a(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function Rk(){return gill.combineCodec(ho(),_a())}async function va(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(c),a=y(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:ho().encode({}),programAddress:r})}function bk(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=l(c),a=y(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:ho().encode({}),programAddress:r})}function _k(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:_a().decode(e.data)}}var ka=new Uint8Array([5]);function Bk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ka)}function bo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",P()],["createUserArgs",gill.getArrayEncoder(_n())]]),e=>({...e,discriminator:ka}))}function Wa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",M()],["createUserArgs",gill.getArrayDecoder(vn())]])}function Nk(){return gill.combineCodec(bo(),Wa())}async function La(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:bo().encode(c),programAddress:r})}function wk(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.systemProgram),s(t.whitelistedAddressTrees),...a],data:bo().encode(c),programAddress:r})}function Hk(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Wa().decode(e.data)}}var Na=new Uint8Array([17]);function qk(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Na)}function wa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMutArgs",z()],["compressedProofArgs",P()],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:Na}))}function Ha(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMutArgs",K()],["compressedProofArgs",M()],["signers",gill.getArrayDecoder(Y())]])}function Jk(){return gill.combineCodec(wa(),Ha())}function Va(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:wa().encode(c),programAddress:r})}function Yk(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:Ha().decode(e.data)}}var za=new Uint8Array([2]);function tW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(za)}function Ka(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:za}))}function ja(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function rW(){return gill.combineCodec(Ka(),ja())}function qa(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.admin),...a],data:Ka().encode(c),programAddress:r})}function nW(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:ja().decode(e.data)}}var Xa=new Uint8Array([1]);function uW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Xa)}function vo(){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(jn())]]),e=>({...e,discriminator:Xa}))}function Qa(){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 AW(){return gill.combineCodec(vo(),Qa())}async function gW(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:vo().encode(c),programAddress:r})}function $a(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.domainConfig),s(t.authority),s(t.newAuthority),s(t.whitelistedAddressTrees),s(t.systemProgram),...a],data:vo().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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:o(),whitelistedAddressTrees:o(),systemProgram:r()},data:Qa().decode(e.data)}}var ri=new Uint8Array([6]);function xW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ri)}function ni(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Ye()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",P()]]),e=>({...e,discriminator:ri}))}function oi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Ze()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",M()]])}function IW(){return gill.combineCodec(ni(),oi())}function si(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.authority),...a],data:ni().encode(c),programAddress:r})}function CW(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{authority:r()},data:oi().decode(e.data)}}var ii=new Uint8Array([7]);function bW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ii)}function di(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",Ye()],["secp256r1VerifyArgs",gill.getOptionEncoder(F())],["delegateTo",gill.getOptionEncoder($n())],["oldSettingsMutArgs",gill.getOptionEncoder(z())],["newSettingsMutArgs",gill.getOptionEncoder(z())],["compressedProofArgs",P()]]),e=>({...e,discriminator:ii}))}function ui(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",Ze()],["secp256r1VerifyArgs",gill.getOptionDecoder(G())],["delegateTo",gill.getOptionDecoder(eo())],["oldSettingsMutArgs",gill.getOptionDecoder(K())],["newSettingsMutArgs",gill.getOptionDecoder(K())],["compressedProofArgs",M()]])}function _W(){return gill.combineCodec(di(),ui())}function Ai(e,n){let r=n?.programAddress??A,t={feePayer:{value:e.feePayer??null,isWritable:true},signer:{value:e.signer??null,isWritable:false},oldSettings:{value:e.oldSettings??null,isWritable:true},newSettings:{value:e.newSettings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.feePayer),s(t.signer),s(t.oldSettings),s(t.newSettings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.domainConfig),...a],data:di().encode(c),programAddress:r})}function vW(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{feePayer:r(),signer:o(),oldSettings:o(),newSettings:o(),slotHashSysvar:o(),instructionsSysvar:o(),domainConfig:o()},data:ui().decode(e.data)}}var pi=new Uint8Array([29]);function NW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(pi)}function Uo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:pi}))}function mi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["signers",gill.getArrayDecoder(Y())]])}function wW(){return gill.combineCodec(Uo(),mi())}async function HW(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(B(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Uo().encode(c),programAddress:r})}function li(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Uo().encode(c),programAddress:r})}function VW(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:mi().decode(e.data)}}var fi=new Uint8Array([27]);function JW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(fi)}function Si(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["signers",gill.getArrayEncoder(J())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:fi}))}function xi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["signers",gill.getArrayDecoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function YW(){return gill.combineCodec(Si(),xi())}function Ii(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.destination),s(t.systemProgram),...a],data:Si().encode(c),programAddress:r})}function ZW(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:xi().decode(e.data)}}var hi=new Uint8Array([30]);function nL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(hi)}function ko(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["splInterfacePdaArgs",gill.getOptionEncoder(Wt())],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccounts",gill.getArrayEncoder(Ct())],["compressedProofArgs",gill.getOptionEncoder(P())],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:hi}))}function Ri(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["splInterfacePdaArgs",gill.getOptionDecoder(Lt())],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccounts",gill.getArrayDecoder(Et())],["compressedProofArgs",gill.getOptionDecoder(M())],["signers",gill.getArrayDecoder(Y())]])}function oL(){return gill.combineCodec(ko(),Ri())}async function sL(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};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(B(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(B(t.source.value)),gill.getAddressEncoder().encode(B(t.tokenProgram.value)),gill.getAddressEncoder().encode(B(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(B(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(B(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(B(t.destination.value)),gill.getAddressEncoder().encode(B(t.tokenProgram.value)),gill.getAddressEncoder().encode(B(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(B(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(B(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:ko().encode(c),programAddress:r})}function bi(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:ko().encode(c),programAddress:r})}function cL(e){if(e.accounts.length<18)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:Ri().decode(e.data)}}var ki=new Uint8Array([28]);function pL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ki)}function Wo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["splInterfacePdaArgs",gill.getOptionEncoder(Wt())],["amount",gill.getU64Encoder()],["sourceCompressedTokenAccounts",gill.getArrayEncoder(Ct())],["signers",gill.getArrayEncoder(J())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:ki}))}function Wi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["splInterfacePdaArgs",gill.getOptionDecoder(Lt())],["amount",gill.getU64Decoder()],["sourceCompressedTokenAccounts",gill.getArrayDecoder(Et())],["signers",gill.getArrayDecoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function mL(){return gill.combineCodec(Wo(),Wi())}async function lL(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};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(B(t.source.value)),gill.getAddressEncoder().encode(B(t.tokenProgram.value)),gill.getAddressEncoder().encode(B(t.mint.value))]})),t.sourceCtokenTokenAccount.value||(t.sourceCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(B(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(B(t.mint.value))]})),t.destinationSplTokenAccount.value||(t.destinationSplTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(B(t.destination.value)),gill.getAddressEncoder().encode(B(t.tokenProgram.value)),gill.getAddressEncoder().encode(B(t.mint.value))]})),t.destinationCtokenTokenAccount.value||(t.destinationCtokenTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m",seeds:[gill.getAddressEncoder().encode(B(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(B(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Wo().encode(c),programAddress:r})}function Li(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:true},systemProgram:{value:e.systemProgram??null,isWritable:false},compressedTokenProgramAuthority:{value:e.compressedTokenProgramAuthority??null,isWritable:false},splInterfacePda:{value:e.splInterfacePda??null,isWritable:true},compressibleConfig:{value:e.compressibleConfig??null,isWritable:false},rentSponsor:{value:e.rentSponsor??null,isWritable:true},compressedTokenProgram:{value:e.compressedTokenProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.compressedTokenProgramAuthority.value||(t.compressedTokenProgramAuthority.value="GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy"),t.compressedTokenProgram.value||(t.compressedTokenProgram.value="cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),s(t.source),s(t.sourceSplTokenAccount),s(t.sourceCtokenTokenAccount),s(t.destination),s(t.destinationSplTokenAccount),s(t.destinationCtokenTokenAccount),s(t.tokenProgram),s(t.mint),s(t.systemProgram),s(t.compressedTokenProgramAuthority),s(t.splInterfacePda),s(t.compressibleConfig),s(t.rentSponsor),s(t.compressedTokenProgram),...a],data:Wo().encode(c),programAddress:r})}function yL(e){if(e.accounts.length<17)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r(),source:r(),sourceSplTokenAccount:r(),sourceCtokenTokenAccount:r(),destination:r(),destinationSplTokenAccount:o(),destinationCtokenTokenAccount:o(),tokenProgram:r(),mint:r(),systemProgram:r(),compressedTokenProgramAuthority:r(),splInterfacePda:o(),compressibleConfig:r(),rentSponsor:o(),compressedTokenProgram:r()},data:Wi().decode(e.data)}}var Ni=new Uint8Array([13]);function EL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ni)}function wi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())]]),e=>({...e,discriminator:Ni}))}function Hi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())]])}function DL(){return gill.combineCodec(wi(),Hi())}function Vi(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:wi().encode(c),programAddress:r})}function PL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:Hi().decode(e.data)}}var zi=new Uint8Array([23]);function UL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(zi)}function Ki(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:zi}))}function ji(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function kL(){return gill.combineCodec(Ki(),ji())}function qi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.rentCollector),s(t.domainConfig),s(t.transactionBuffer),s(t.closer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:Ki().encode(c),programAddress:r})}function WL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:o(),transactionBuffer:r(),closer:o(),slotHashSysvar:o(),instructionsSysvar:o()},data:ji().decode(e.data)}}var Zi=new Uint8Array([10]);function VL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Zi)}function Xi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Ot()],["secp256r1VerifyArgs",gill.getOptionEncoder(F())]]),e=>({...e,discriminator:Zi}))}function Qi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Bt()],["secp256r1VerifyArgs",gill.getOptionDecoder(G())]])}function FL(){return gill.combineCodec(Xi(),Qi())}function $i(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:Xi().encode(c),programAddress:r})}function GL(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:Qi().decode(e.data)}}var rd=new Uint8Array([20]);function ZL(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(rd)}function nd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Ot()],["secp256r1VerifyArgs",gill.getOptionEncoder(F())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",P()]]),e=>({...e,discriminator:rd}))}function od(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Bt()],["secp256r1VerifyArgs",gill.getOptionDecoder(G())],["settingsReadonlyArgs",kt()],["compressedProofArgs",M()]])}function XL(){return gill.combineCodec(nd(),od())}function sd(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.creator),s(t.systemProgram),s(t.instructionsSysvar),s(t.slotHashSysvar),...a],data:nd().encode(c),programAddress:r})}function QL(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),creator:o(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:o()},data:od().decode(e.data)}}var id=new Uint8Array([14]);function sO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(id)}function dd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())]]),e=>({...e,discriminator:id}))}function ud(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())]])}function cO(){return gill.combineCodec(dd(),ud())}function Ad(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:dd().encode(c),programAddress:r})}function aO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:ud().decode(e.data)}}var md=new Uint8Array([24]);function mO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(md)}function ld(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:md}))}function yd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function lO(){return gill.combineCodec(ld(),yd())}function Td(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.executor),s(t.transactionBuffer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:ld().encode(c),programAddress:r})}function yO(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),executor:o(),transactionBuffer:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:yd().decode(e.data)}}var xd=new Uint8Array([12]);function CO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(xd)}function Id(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:xd}))}function Cd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function EO(){return gill.combineCodec(Id(),Cd())}function Ed(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.transactionBuffer),...a],data:Id().encode(c),programAddress:r})}function DO(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:Cd().decode(e.data)}}var Md=new Uint8Array([22]);function _O(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Md)}function hd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:Md}))}function Rd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function vO(){return gill.combineCodec(hd(),Rd())}function bd(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.transactionBuffer),...a],data:hd().encode(c),programAddress:r})}function UO(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:Rd().decode(e.data)}}var Ud=new Uint8Array([11]);function wO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ud)}function kd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())]]),e=>({...e,discriminator:Ud}))}function Wd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())]])}function HO(){return gill.combineCodec(kd(),Wd())}function Ld(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:kd().encode(c),programAddress:r})}function VO(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:Wd().decode(e.data)}}var Nd=new Uint8Array([21]);function JO(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Nd)}function wd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(F())],["settingsReadonlyArgs",Ut()],["compressedProofArgs",P()]]),e=>({...e,discriminator:Nd}))}function Hd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(G())],["settingsReadonlyArgs",kt()],["compressedProofArgs",M()]])}function YO(){return gill.combineCodec(wd(),Hd())}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},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.domainConfig),s(t.transactionBuffer),s(t.voter),s(t.systemProgram),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:wd().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},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:o(),transactionBuffer:r(),voter:o(),systemProgram:r(),slotHashSysvar:o(),instructionsSysvar:o()},data:Hd().decode(e.data)}}var zd=new Uint8Array([15]);function rB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(zd)}function Kd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:zd}))}function jd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function nB(){return gill.combineCodec(Kd(),jd())}function qd(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=l({}),a=y(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:Kd().encode({}),programAddress:r})}function oB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:jd().decode(e.data)}}var Zd=new Uint8Array([25]);function uB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Zd)}function Xd(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:Zd}))}function Qd(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function AB(){return gill.combineCodec(Xd(),Qd())}function $d(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=l({args:c}),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.transactionBuffer),...a],data:Xd().encode(c),programAddress:r})}function gB(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let o=e.accounts[n];return n+=1,o};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:Qd().decode(e.data)}}var ru=new Uint8Array([16]);function SB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ru)}function nu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Nt()],["signers",gill.getArrayEncoder(J())]]),e=>({...e,discriminator:ru}))}function ou(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",wt()],["signers",gill.getArrayDecoder(Y())]])}function xB(){return gill.combineCodec(nu(),ou())}function su(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.settings),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:nu().encode(c),programAddress:r})}function IB(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:ou().decode(e.data)}}var iu=new Uint8Array([26]);function RB(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(iu)}function du(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Nt()],["signers",gill.getArrayEncoder(J())],["settingsMutArgs",z()],["compressedProofArgs",P()]]),e=>({...e,discriminator:iu}))}function uu(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",wt()],["signers",gill.getArrayDecoder(Y())],["settingsMutArgs",K()],["compressedProofArgs",M()]])}function bB(){return gill.combineCodec(du(),uu())}function Au(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=l(i),s=y(r);return Object.freeze({accounts:[s(t.payer),s(t.slotHashSysvar),s(t.instructionsSysvar),...a],data:du().encode(c),programAddress:r})}function _B(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},o=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:o(),instructionsSysvar:r()},data:uu().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",rE=(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))(rE||{});function gN(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 nE=(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.NativeTransferIntent=13]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=14]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=15]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=16]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=17]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=18]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=19]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=20]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=21]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=22]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=23]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=24]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=25]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=26]="TransactionBufferVoteCompressed",T[T.TransactionExecute=27]="TransactionExecute",T[T.TransactionExecuteCompressed=28]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=29]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=30]="TransactionExecuteSyncCompressed",T))(nE||{});function pN(e){let n="data"in e?e.data:e;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([8])),0))return 0;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 1;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([19])),0))return 2;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([18])),0))return 3;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([0])),0))return 4;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([4])),0))return 5;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([3])),0))return 6;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 7;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 8;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 9;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 10;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 11;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 12;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 13;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 14;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 15;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 16;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 17;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 18;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 19;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 20;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 21;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 22;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 23;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 24;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 25;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 26;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 27;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 28;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([16])),0))return 29;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 30;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var sE=6e3,cE=6001,aE=6002,iE=6003,dE=6004,uE=6005,AE=6006,gE=6007,pE=6008,mE=6009,lE=6010,yE=6011,TE=6012,fE=6013,SE=6014,xE=6015,IE=6016,CE=6017,EE=6018,DE=6019,PE=6020,ME=6021,hE=6022,RE=6023,bE=6024,_E=6025,vE=6026,UE=6027,kE=6028,WE=6029,LE=6030,OE=6031,BE=6032,NE=6033,wE=6034,HE=6035,VE=6036,FE=6037,GE=6038,zE=6039,KE=6040,jE=6041,qE=6042,JE=6043,YE=6044,ZE=6045,XE=6046,QE=6047,$E=6048,eD=6049,tD=6050,rD=6051,nD=6052,oD=6053,sD=6054,cD=6055,aD=6056,iD=6057,dD=6058,uD=6059,AD=6060,gD=6061,pD=6062,mD=6063,lD=6064,yD=6065,TD=6066,fD=6067,SD=6068,xD=6069,ID=6070,CD=6071,ED=6072,DD=6073,PD=6074,MD=6075,hD=6076,RD=6077,bD=6078,_D=6079,vD=6080,UD=6081,kD=6082,WD=6083,LD=6084,OD=6085,BD=6086,gu;process.env.NODE_ENV!=="production"&&(gu={[OE]:"This member is already delegated to another wallet.",[gE]:"The clientDataJSON hash extracted from the signature does not match the generated hash.",[RD]:"Clock sysvar access failed. This may indicate a system error.",[rD]:"Missing credential id.",[oD]:"The domain configuration account is disabled. Please contact support or try again later.",[sD]:"Missing domain configuration account.",[MD]:"Domain configuration account key mismatch. The provided domain config does not match the expected value.",[BD]:"Duplicate address tree detected. This address tree is already in the whitelist.",[lE]:"Duplicate public keys detected among members. Each member must have a unique key.",[mE]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[ME]:"No members provided. A multisig wallet must contain at least one member.",[AD]:"Slot numbers list is empty. At least one slot number is required for validation.",[EE]:"Expected a User with Administrator role for this instruction.",[pE]:"The message hash associated with the signer does not match the pre-declared expected message hash.",[IE]:"Expected a User with Transaction Manager role for this instruction.",[KE]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[jE]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[qE]:"Declared buffer size does not match the actual serialized size.",[uD]:"Failed to compute hash. This may indicate a system error.",[wE]:"Not enough members with vote permission to meet the approval threshold.",[BE]:"At least one signer with execute permission is required to proceed.",[NE]:"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.",[PD]:"Invalid account index in transaction message. The account index is out of bounds.",[iD]:"Address Tree supplied is not part of the whitelisted address trees.",[DE]:"User with Administrator role requires a valid domain config, be a ed25519 Signer and have no delegated wallet.",[kE]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[zE]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[gD]:"Member key conversion failed. The provided key format is invalid.",[HE]:"Only delegated members are allowed for this transaction.",[_E]:"Unexpected number of accounts provided for this instruction.",[fE]:"User with Permanent Member role must have a delegated wallet.",[cE]:"The instruction preceding this program invocation is not a secp256r1 verification instruction.",[dE]:"The extracted public key has an invalid length or encoding.",[sE]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[iE]:"Failed to deserialize secp256r1 signature offsets from the instruction data.",[tD]:"The specified slot number is not recent enough. Slot must be within the recent slot history window.",[$E]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[RE]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[CD]:"Invalid source type for token transfer. The source account type is not supported.",[CE]:"User with Transaction Manager role requires a valid transaction manager url, be a ed25519 Signer and have no delegated wallet.",[xE]:"Invalid Transaction Manager permissions. Only initiate is allowed.",[bE]:"Malformed transaction message: structure or formatting does not match the expected layout.",[vD]:"Invalid user configuration. Credential ID and transports must be none for ed25519 members.",[UE]:"One or more provided user accounts failed validation. Verify that only users with appropriate roles are allowed to perform this action.",[_D]:"Invalid user configuration. Transaction manager URL must be empty for non-transaction-manager users.",[ID]:"Light CPI account operation failed. The account may be invalid or uninitialized.",[uE]:"The extracted WebAuthn signed message payload is malformed.",[XE]:"An input string exceeds the maximum allowed character length.",[cD]:"This member is not registered under the provided domain configuration.",[lD]:"Member not found in settings. Cannot remove a member that does not exist.",[DD]:"Member not found in settings members list. Cannot update delegate flag for a non-existent member.",[WE]:"A required account is missing from the instruction context.",[pD]:"Compressed proof arguments are missing. Required for compressed account operations.",[fD]:"Missing compressed token account. Required for token transfer operations.",[UD]:"Missing destination token account. Required for token transfer operations.",[xD]:"Missing instructions sysvar account. Required for secp256r1 signature verification.",[mD]:"Light CPI accounts are missing. Required for compressed account operations.",[LE]:"User mutation arguments are required when performing add or remove delegate operations.",[LD]:"Missing new authority account. Required for domain configuration updates.",[WD]:"Missing settings account. Required for delegate operations on compressed wallets.",[dD]:"Compressed settings data is missing. The settings account must be initialized with data.",[kD]:"Missing source token account. Required for token transfer operations.",[SD]:"Missing SPL interface PDA. Required for token transfer operations.",[QE]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[hD]:"User account address is missing. Required for secp256r1 signature verification.",[OD]:"Missing whitelisted address trees account. Required for domain configuration updates.",[FE]:"No valid signer found in this transaction.",[PE]:"Only one administrator is allowed per wallet.",[TE]:"Only one permanent member is allowed per wallet.",[SE]:"Only one transaction manager is allowed per wallet.",[aD]:"The given origin index is not in the whitelisted origins.",[TD]:"Payer account mismatch. The provided payer does not match the transaction buffer payer.",[yE]:"Permanent members cannot be removed from a wallet.",[ZE]:"Writable CPI calls to protected accounts are not permitted.",[AE]:"The rpIdHash extracted from the signed message does not match the expected value.",[yD]:"Settings key mismatch. The provided settings key does not match the expected value.",[aE]:"The signature index provided is out of bounds for the secp256r1 instruction.",[eD]:"The specified slot number was not found in the provided slot history.",[ED]:"Source account mismatch. The provided source account does not match the expected wallet vault address.",[hE]:"Too many members: a maximum of 4 members are supported.",[JE]:"This transaction has expired. It must be executed within 3 minutes of approval.",[YE]:"This transaction has not yet reached the required approval threshold.",[nD]:"Missing transports.",[GE]:"Only the transaction creator or rent payer may close this transaction buffer.",[bD]:"Unauthorized: Only the admin account is allowed to perform this action.",[VE]:"Member is not part of the expected signers for this transaction."});function SN(e){return process.env.NODE_ENV!=="production"?gu[e]:"Error message not available in production bundles."}function xN(e,n,r){return gill.isProgramError(e,n,A,r)}async function vN({admin:e,addressTree:n}){return Kc({payer:e,addressTree:n,remainingAccounts:[]})}var he=class extends Error{constructor(r,o,t){super(r);this.code=o;this.cause=t;this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor);}},Xe=class extends he{constructor(n){super(`${n} is not initialized. Please call initialize() first.`,"NOT_INITIALIZED");}},ee=class extends he{constructor(n,r){super(`${n} not found.${r?` ${r}`:""}`,"NOT_FOUND");}},_=class extends he{constructor(n,r){super(n,"VALIDATION_ERROR",{field:r});}},me=class extends he{constructor(r,o,t){super(r,"NETWORK_ERROR",{statusCode:o,url:t});this.statusCode=o;this.url=t;}};var ae=class extends he{constructor(r,o,t){super(r,"BUNDLE_ERROR",{bundleId:o,attempt:t});this.bundleId=o;this.attempt=t;}},hr=class extends he{constructor(r,o,t){super(`Operation "${r}" failed after ${o} attempts.`,"RETRY_EXHAUSTED",{lastError:t});this.attempts=o;this.lastError=t;}},Rr=class extends he{constructor(r,o,t){super(r,"PERMISSION_ERROR",{required:o,actual:t});this.required=o;this.actual=t;}};var Kt={Ed25519:1,Secp256r1:2};var ND=m__default.default.looseObject({publicKey:m__default.default.string(),walletAddress:m__default.default.string(),settingsIndexWithAddress:m__default.default.object({index:m__default.default.union([m__default.default.number(),m__default.default.bigint()]),settingsAddressTreeIndex:m__default.default.number()}),username:m__default.default.string().optional(),profilePictureUrl:m__default.default.string().optional()}),pu=m__default.default.enum(["create","create_with_preauthorized_execution","execute","vote","sync","close","decompress","transfer_intent","change_delegate","change_config"]),NN=m__default.default.object({transactionActionType:pu,transactionAddress:m__default.default.string(),transactionMessageBytes:m__default.default.array(m__default.default.number().int().min(0).max(255)).transform(e=>new Uint8Array(e))}).strict(),wD=m__default.default.object({transactionActionType:pu,transactionAddress:m__default.default.string(),transactionMessageBytes:m__default.default.base64()}).strict(),HD=m__default.default.union([m__default.default.object({type:m__default.default.literal("Ephemeral"),secretKey:m__default.default.string()}),m__default.default.object({type:m__default.default.literal("Default"),publickey:m__default.default.string(),endpoint:m__default.default.string()})]).array().optional(),mu=m__default.default.object({phase:m__default.default.literal("start"),redirectOrigin:m__default.default.url(),signer:m__default.default.string().optional(),rid:m__default.default.string(),validTill:m__default.default.number(),data:m__default.default.object({type:m__default.default.literal("message"),payload:m__default.default.string(),trustedDeviceCheck:m__default.default.boolean()}).strict()}).strict(),lu=m__default.default.object({phase:m__default.default.literal("start"),redirectOrigin:m__default.default.url(),signer:m__default.default.string().optional(),rid:m__default.default.string(),validTill:m__default.default.number(),data:m__default.default.object({type:m__default.default.literal("transaction"),payload:wD,sendTx:m__default.default.boolean(),additionalSigners:HD}).strict()}).strict(),yu=m__default.default.object({startRequest:m__default.default.union([mu,lu]),authResponse:m__default.default.custom(),client:m__default.default.object({clientOrigin:m__default.default.url(),jws:m__default.default.string()}).strict(),device:m__default.default.object({jwk:m__default.default.base64(),jws:m__default.default.string()}).strict()}).strict(),Tu=m__default.default.object({signer:m__default.default.string(),userAddressTreeIndex:m__default.default.number().optional(),additionalInfo:m__default.default.looseObject({}).optional()}).strict(),VD=m__default.default.object({slotHash:m__default.default.string(),slotNumber:m__default.default.string(),originIndex:m__default.default.number(),crossOrigin:m__default.default.boolean()}).strict(),wN=m__default.default.object({phase:m__default.default.literal("complete"),data:m__default.default.object({type:m__default.default.literal("message"),payload:Tu.extend(yu.shape).extend({id:m__default.default.string().optional(),client:m__default.default.object({clientOrigin:m__default.default.url()}).strict()})}).strict()}).strict(),HN=m__default.default.object({phase:m__default.default.literal("complete"),data:m__default.default.object({type:m__default.default.literal("transaction"),payload:Tu.extend(yu.shape).extend(VD.shape).extend({client:m__default.default.object({clientOrigin:m__default.default.url()}).strict()})}).strict()}).strict(),VN=m__default.default.object({phase:m__default.default.literal("complete"),data:m__default.default.object({type:m__default.default.literal("transaction"),payload:m__default.default.object({startRequest:m__default.default.union([lu,mu]),txSig:m__default.default.string(),user:ND})}).strict()}).strict();var Re={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},ve=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,o)=>r|o,0))}static all(){return new e(Object.values(Re).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var Bo=33,Ue=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!==Bo)throw new Error(`Invalid public key length, expected ${Bo} 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===Bo)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()}},U=class extends Ue{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 zD(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function KD(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var Su=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(zD())],["addressTableLookups",gill.getArrayCodec(KD())]]);function xu(e){return Su.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 Iu(e){let n=Su.decode(e);return {header:{numSignerAccounts:n.numSigners,numReadonlySignerAccounts:n.numSigners-n.numWritableSigners,numReadonlyNonSignerAccounts:n.accountKeys.length-n.numSigners-n.numWritableNonSigners},addressTableLookups:n.addressTableLookups.map(r=>({lookupTableAddress:r.lookupTableAddress,readonlyIndexes:r.readonlyIndexes.map(Number),writableIndexes:r.writableIndexes.map(Number),readableIndices:r.readonlyIndexes.map(Number),writableIndices:r.writableIndexes.map(Number)})),instructions:n.instructions.map(r=>({accountIndices:r.accountIndices.map(Number),data:new Uint8Array(r.data),programAddressIndex:r.programAddressIndex})),lifetimeToken:A,staticAccounts:n.accountKeys,version:0}}var wo=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],Cu="https://mainnet.block-engine.jito.wtf/api/v1",Eu="https://bundles.jito.wtf/api/v1/bundles/tip_floor",Du="landed_tips_75th_percentile";var ne={};function Pu(){if(!ne.solanaRpcEndpoint)throw new Xe("RPC endpoint");return ne.solanaRpcEndpoint}function Te(){if(!ne.lightProtocolRpc)throw new Xe("Light Protocol RPC");return ne.lightProtocolRpc}function Z(){if(!ne.solanaRpc)throw new Xe("Solana RPC");return ne.solanaRpc}function Mu(){if(!ne.sendAndConfirm)throw new Xe("Send and confirm transaction function");return ne.sendAndConfirm}function Ho(){return ne.jitoTipsConfig?ne.jitoTipsConfig:{blockEngineUrl:Cu,getJitoTipsUrl:Eu,priority:Du}}function Aw({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:o}){ne.solanaRpcEndpoint=e,ne.lightProtocolRpc=stateless_js.createRpc(e,r,n);let{rpc:t,sendAndConfirmTransaction:c}=gill.createSolanaClient({urlOrMoniker:e});ne.solanaRpc=t,ne.sendAndConfirm=c,ne.jitoTipsConfig=o??null;}async function jt(e,n){if(!e.ok)throw new me(`Request failed: ${e.statusText} (${e.status})`,e.status,n);return e}async function qt(e){try{return await e.json()}catch(n){throw new me(`Failed to parse JSON response: ${n instanceof Error?n.message:String(n)}`,e.status,e.url)}}function Mw(e){let n=tinyCbor.decodeCBOR(e),r=nist_js.p256.Point.fromAffine({x:BigInt("0x"+_r(n.get(-2))),y:BigInt("0x"+_r(n.get(-3)))});return gill.getBase58Decoder().decode(r.toBytes(true))}function hw(e){let r=nist_js.p256.Point.fromBytes(gill.getBase58Encoder().encode(e)).toBytes(false),o=new Map;return o.set(1,2),o.set(3,-7),o.set(-1,1),o.set(-2,r.slice(1,33)),o.set(-3,r.slice(33,65)),new Uint8Array(tinyCbor.encodeCBOR(o))}async function Rw(e){let{authenticatorData:n,clientDataJSON:r,signature:o}=e.authResponse.response,t=le(n),c=JSON.parse(gill.getUtf8Decoder().decode(le(r))),i=vu(c),a=ku(le(o)),s=await at({rpIdHash:t.subarray(0,32)});return new U(e.signer.toString(),{verifyArgs:{clientDataJson:le(r),truncatedClientDataJson:i,slotNumber:BigInt(e.slotNumber),slotHash:gill.getBase58Encoder().encode(e.slotHash)},clientAndDeviceHash:Vo(e.client.clientOrigin,e.device.jwk,e.startRequest.rid),domainConfig:s,authData:t,signature:a,originIndex:e.originIndex,crossOrigin:e.crossOrigin,authResponse:e.authResponse})}function Vo(e,n,r){return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...gill.getBase64Encoder().encode(n),...gill.getBase64Encoder().encode(r)]))}function bw(e){return sha2_js.sha256(gill.getUtf8Encoder().encode(jsonCanonicalize.canonicalize(e)))}function _w(e){return Fo(e.data.payload.authResponse)}function vw(e,n,r,o){let t=Vo(n,r,o);return sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e),...t]))}async function Uw(e,n,r,o,t,c){let i;if(!t||!c){let u=(await Z().getAccountInfo(gill.address("SysvarS1otHashes111111111111111111111111111"),{encoding:"base64",commitment:"confirmed",dataSlice:{offset:8,length:40}}).send()).value?.data;if(!u)throw new ee("Slot sysvar","Unable to fetch slot sysvar data");let g=gill.getBase64Encoder().encode(u[0]);c=gill.getU64Decoder().decode(g.subarray(0,8)).toString(),i=g.subarray(8,40),t=gill.getBase58Decoder().decode(i);}else i=gill.getBase58Encoder().encode(t);let a=sha2_js.sha256(typeof e.transactionMessageBytes=="string"?gill.getBase64Encoder().encode(e.transactionMessageBytes):e.transactionMessageBytes),s=Vo(n,r,o),d=sha2_js.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e.transactionActionType),...gill.getBase58Encoder().encode(e.transactionAddress),...a,...i,...s]));return {slotNumber:c,slotHash:t,challenge:d}}function Fo(e){let n=vr(e);return sha2_js.sha256(n)}function kw(e){let n="";for(let o of e)n+=String.fromCharCode(o);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function le(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,o=n.padEnd(n.length+r,"="),t=atob(o),c=new ArrayBuffer(t.length),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return i}async function Ww(e,n){let{data:r}=await ds(Z(),e),t=Uu(r.origins,r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new ee("Origin","Origin not found in domain config");return t}function Lw(e){return gill.getBase64Decoder().decode(gill.getUtf8Encoder().encode(jsonCanonicalize.canonicalize(e)))}function Ow(e){return JSON.parse(gill.getUtf8Decoder().decode(gill.getBase64Encoder().encode(e)))}function _r(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function eP(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 vu(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let o=JSON.stringify(r);return new TextEncoder().encode(o.slice(1,-1))}function Uu(e,n){let r=[],o=0,t=new TextDecoder;for(let c=0;c<n;c++){if(o+2>e.length)throw new Error("MaxLengthExceeded");let i=e[o]|e[o+1]<<8;if(o+=2,o+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(o,o+i),s=t.decode(a);r.push(s),o+=i;}return r}function ku(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 D=n&127;r+=D;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let o=e[r+1],t=r+2,c=e.slice(t,t+o);if(r=t+o,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,s=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=s[0]===0&&s.length>32?s.slice(1):s;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let p=nist_js.p256.Point.CURVE().n>>1n,f=BigInt("0x"+_r(u)),C=(f>p?nist_js.p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),x=eP(C);return new Uint8Array([...g,...x])}function vr(e){let n=le(e.response.clientDataJSON),r=le(e.response.authenticatorData),o=sha2_js.sha256(n);return new Uint8Array([...r,...o])}var tP=400,rP=429,Lu=500,nP=3,oP=500,sP=2,cP=3e4,Ou={backoffBase:sP,maxDelayMs:cP,retryOnRateLimit:true,initialDelayMs:oP,maxRetries:nP};function Bu(e){return e===rP}function Nu(e){return e>=Lu}function aP(e){return e>=tP&&e<Lu}function iP(e){return Bu(e)||Nu(e)}function dP(e,n,r){return e instanceof Response?Bu(e.status)?r.retryOnRateLimit??true:aP(e.status)?false:Nu(e.status):e instanceof TypeError||e instanceof Error}function uP(e,n,r,o){let t=n*Math.pow(r,e-1);return Math.min(t,o)}function AP(e){return new Promise(n=>setTimeout(n,e))}async function Zt(e,n){let{maxRetries:r,initialDelayMs:o,backoffBase:t,maxDelayMs:c,shouldRetry:i}={...Ou,...n},a;for(let s=1;s<=r;s++)try{return await e()}catch(d){if(a=d,i&&!i(d,s))throw d;if(s>=r)break;let u=uP(s,o,t,c);await AP(u);}throw new hr(e.name||"retryWithBackoff",r,a)}async function Ur(e,n){let r={...Ou,...n},o=(c,i)=>dP(c,i,r);return Zt(async()=>{let c=await e();if(!c.ok&&iP(c.status))throw c;return c},{...r,shouldRetry:n?.shouldRetry??o})}function wu(...e){return n=>e.some(r=>n instanceof r)}function Hu(e,n,r,o){if(e<n||e>r)throw new _(`${o} must be between ${n} and ${r} (inclusive), got ${e}`)}function Vu(e,n){if(e<0)throw new _(`${n} must be non-negative, got ${e}`)}function Xt(e,n){if(e.length===0)throw new _(`${n} cannot be empty`)}function Fu(e,n){if(e.trim().length===0)throw new _(`${n} cannot be empty`)}async function zo(e,n=false){let r=n?{blockhash:gill.getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await Z().getLatestBlockhash().send()).value;return await Promise.all(e.map(async o=>await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(o.instructions,c),c=>gill.setTransactionMessageFeePayerSigner(o.payer,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(r,c),c=>o.addressesByLookupTableAddress?gill.compressTransactionMessageUsingAddressLookupTables(c,o.addressesByLookupTableAddress):c,async c=>{let i=Math.ceil((o.unitsConsumed??0)*1.1);return i>2e5?gill.prependTransactionMessageInstructions([programs.getSetComputeUnitLimitInstruction({units:i})],c):c},async c=>n?gill.compileTransaction(await c):await gill.signTransactionMessageWithSigners(await c))))}async function qu(e){let n=gill.prependTransactionMessageInstructions([programs.getSetComputeUnitLimitInstruction({units:8e5}),programs.getSetComputeUnitPriceInstruction({microLamports:1e4})],e),r=gill.getBase64EncodedWireTransaction(gill.compileTransaction(n));if(r.length>1644)throw new _(`Transaction exceeds maximum length of ${1644} bytes (actual: ${r.length} bytes)`);let o=await Z().simulateTransaction(r,{encoding:"base64"}).send();if(o.value.err){if(o.value.logs){let c=["Transaction simulation failed:","",...o.value.logs].join(`
|
|
2
2
|
`);throw new Error(c)}let t=["Transaction simulation failed:","",o.value.err.toString()].join(`
|
|
3
|
-
`);throw new Error(t)}return o.value.unitsConsumed}async function qu(e,n){let o=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===gill.AccountRole.WRITABLE||c.role===gill.AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));o.sort((c,i)=>c-i);let t=Math.floor(o.length/2);return o.length%2===0?Math.round((o[t-1]+o[t])/2):o[t]}async function Ju(e,n){Xt(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new _(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await Ur(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})}));await jt(r,n);let o=await qt(r);if(!o.result||o.error)throw new ae(`Unable to simulate bundle: ${JSON.stringify(o.error??o.result)}`);if(typeof o.result.value.summary!="string"&&o.result.value.summary.failed){let{TransactionFailure:t}=o.result.value.summary.failed.error,[,c]=t;throw new ae(`Simulation failed: ${c}`)}return o.result.value.transactionResults.map(t=>t.unitsConsumed)}function ie(e,n=0){let r=e instanceof U?e:void 0,o=r?.verifyArgs&&n!==-1?gill.some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):gill.none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs.clientDataJson?vr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:o,signature:c,message:i,publicKey:a}}function We(e,n,r=[]){let o=[];for(let t of e)if(t instanceof U){let c=r.length,{domainConfig:i,verifyArgs:a,signature:s,publicKey:d,message:u}=ie(t,c);if(u&&s&&d&&r.push({message:u,signature:s,publicKey:d}),i){let g=n.addPreAccounts([{address:i,role:gill.AccountRole.READONLY}]).get(i)?.index;a.__option==="Some"&&g!==void 0&&o.push({__kind:"Secp256r1",fields:[{domainConfigIndex:g,verifyArgs:a.value}]});}}else {let c=n.addPreAccounts([{address:t.address,role:gill.AccountRole.READONLY_SIGNER,signer:t}]).get(t.address)?.index;c!==void 0&&o.push({__kind:"Ed25519",fields:[c]});}return {secp256r1VerifyInput:r,transactionSyncSigners:o}}function fe(e){if(e instanceof Ue)return {keyType:Kt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Kt.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function Fu(e){return e instanceof U?e.toString():e.address.toString()}function ue(e){let n=new Set,r=[];for(let t of e)n.has(Fu(t))||(r.push(t),n.add(Fu(t)));let o=r.filter(t=>t instanceof U);if(o.length>1)throw new _(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return r}function Yu({payer:e,tipAmount:n}){let r=wo[Math.floor(Math.random()*wo.length)];return programs.getTransferSolInstruction({source:e,destination:gill.address(r),amount:n})}function Zu(e){return typeof e=="string"?e:e.toString()}function Xu(e){return e.toString()}async function Ko(e,n,r){let o=e?.get(n);if(o)return o;let t=await r();return t&&e&&e.set(n,t),t}var N=class{systemAccounts;nextPreIndex;preMap;nextPackedIndex;packedMap;outputTreeIndex;constructor(){this.systemAccounts=[],this.nextPreIndex=0,this.preMap=new Map,this.nextPackedIndex=0,this.packedMap=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){for(let r of n)this.insertOrGet(r.address.toString(),r,false);return this.preMap}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,r={address:gill.address(n),role:gill.AccountRole.WRITABLE},o=true){let t=o?this.packedMap:this.preMap;if(!t.has(n)){let c=o?this.nextPackedIndex++:this.nextPreIndex++;t.set(n,{index:c,accountMeta:r});}return t.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 Te().getStateTreeInfos(),r=stateless_js.selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let o=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());o.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let s=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(s);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:o.length>0?{packedTreeInfos:o,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(n){return Array.from(n.entries()).sort((o,t)=>o[1].index-t[1].index).map(([,{accountMeta:o}])=>({...o}))}getOffsets(n){let r=n,o=r+this.systemAccounts.length;return [r,o]}toAccountMetas(){let n=this.hashSetAccountsToMetas(this.preMap),r=this.hashSetAccountsToMetas(this.packedMap),[o,t]=this.getOffsets(n.length);return {remainingAccounts:[...n,...this.systemAccounts,...r],systemOffset:o,packedOffset:t}}};async function Lr(e,n){let r=Zu(e);return Ko(n,r,()=>Te().getCompressedAccount(e))}async function $e(e,n){let r=Xu(e);return Ko(n,r,()=>Z().getAccountInfo(e,{encoding:"base64"}).send())}async function de(e,n){let r=(await Promise.all(e.map(o=>Lr(o.address,n)))).filter(o=>o!==null).filter(o=>o.data!==null&&o.address!==null);if(r.length!==e.length)throw new ee("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((o,t)=>({...o,type:e[t].type,tree:o.treeInfo.tree,queue:o.treeInfo.queue}))}function W(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 Se(e,n,r,o,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:o[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function re(e,n,r,o,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:o[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let s=e.packTreeInfos(a,[]).stateTrees;if(!s)throw new _("Unable to parse state tree data");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:s.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:s.outputTreeIndex}}))}async function xe(e,n,r,o,t){let c=null,i=null,a=null,s=new N;if(e){await s.addSystemAccounts();let{address:d}=await oe(n,r),u=(await de([{address:d,type:"Settings"}],t))[0];o?a={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:a=await X([u],[]);let g=s.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!g)throw new _("Unable to parse state tree data");let p=q().decode(u.data?.data);c={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0]},data:p},i={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:p};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:s,settingsMutArgs:i}}async function X(e,n){return Zt(()=>Te().getValidityProofV0(e,n))}async function Ie(){return (await Or()).length-1}var jo;async function Or(){if(!jo){let{data:e}=await wc(Z(),await tA());jo=e.whitelistedAddressTrees;}return jo}function eA(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 Jo(e,n,r){let o=await UP(e,n,r);if(!o)throw new ee("User account");return o}async function UP(e,n,r){let{address:o}=await w(e,n),t=await Lr(o,r);return t?.data?.data?Q().decode(t.data.data):null}async function b2(e,{member:n,credentialId:r}){let o=[{memcmp:{offset:1,encoding:"base58",bytes:e}}];if(n)o.push({memcmp:{offset:33,encoding:"base58",bytes:gill.getBase58Decoder().decode(V().encode(fe(n)))}});else if(r)o.push({memcmp:{offset:72,encoding:"base58",bytes:gill.getBase58Decoder().decode(le(r))}});else return null;let t=await Te().getCompressedAccountsByOwner(new web3_js.PublicKey(A.toString()),{filters:o});return t.items.filter(c=>!!c.data).length?t.items.map(c=>Q().decode(c.data?.data))[0]:null}async function Br(e,n,r){let o=await kP(e,n,r);if(!o)throw new ee("Settings account");return o}async function kP(e,n,r){try{let{address:o}=await oe(e,n),t=await Lr(o,r);if(!t?.data?.data)throw new ee("Compressed settings account");let c=q().decode(t.data.data);if(c.data.__option==="None")throw new ee("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let o=await po(Z(),e);return o.exists?{...o.data,isCompressed:false}:null}}async function _2(e,n,r){let o=await Jo(e,n,r);if(o.role===1||o.role===0){let t=[],[c,i]=await Promise.all([Te().getCompressedAccountsByOwner(new web3_js.PublicKey(A.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:gill.getBase58Decoder().decode(V().encode(fe(e)))}}]}),Z().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:gill.getBase64Decoder().decode(V().encode(fe(e)))}}]}).send()]);return c.items.forEach(a=>{if(a.data?.data){let s=q().decode(a.data.data);s.data.__option==="Some"&&t.push({...s.data.value,isCompressed:true});}}),i.forEach(a=>{let s=Tr().decode(gill.getBase64Encoder().encode(a.account.data[0]));t.push({...s,isCompressed:false});}),t}else return await Promise.all(o.wallets.map(async t=>Br(await Ce(t.index),t.settingsAddressTreeIndex,r)))}async function Yo(e){Hu(e,"index");let n=await Or();if(e>=n.length)throw new _(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function v2(e){let r=(await Or()).findIndex(o=>o.toString()===e);if(r===-1)throw new ee("Address tree",`Address ${e} not found in whitelist`);return r}async function oe(e,n=0){let r=await Yo(n),o=stateless_js.deriveAddressSeedV2([gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e)]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(o,new web3_js.PublicKey(r),new web3_js.PublicKey(A)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function w(e,n=0){let r=await Yo(n),o=stateless_js.deriveAddressSeedV2([gill.getUtf8Encoder().encode("user"),e instanceof Ue?e.toTruncatedBuffer():gill.getAddressEncoder().encode(e)]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(o,new web3_js.PublicKey(r),new web3_js.PublicKey(A.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function at({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha2_js.sha256(gill.getUtf8Encoder().encode(n));else throw new _("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 cA(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function tA(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function aA(e,n,r){wu(r,0,255,"buffer_index");let[o]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),n instanceof Ue?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return o}async function be(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return n}async function Ce(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function F2(e){let n=await Ce(e);return await be(n)}async function G2(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}async function Q2(e){Xt(e,"bundle");let n=await zo(e,true),r=await Ju(n.map(gill.getBase64EncodedWireTransaction),Du()),o=await zo(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await BP(o.map(gill.getBase64EncodedWireTransaction))}async function BP(e,n=Ho(),r){Xt(e,"serializedTransactions");let{blockEngineUrl:o}=n,t=`${o}/bundles`,c=await Ur(()=>fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})}),r);await jt(c,t);let i=await qt(c);if(i.error)throw new ae(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new ae("No bundle ID returned from Jito");return i.result}async function $2(e,n=30,r=3e3,o=Ho()){Vu(e,"bundleId");let{blockEngineUrl:t}=o,c=`${t}/getBundleStatuses`;return Zt(async()=>{let i=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await jt(i,c);let a=await qt(i);if(a.error)throw new ae(`Error getting bundle status: ${JSON.stringify(a.error,null,2)}`,e);if(!a.result?.value?.length)throw new ae("Bundle not yet confirmed",e);let s=a.result.value[0];if(s.confirmation_status==="confirmed"||s.confirmation_status==="finalized"){let d=s.transactions[s.transactions.length-1];if(!d)throw new ae("No transactions in confirmed bundle",e);return d}throw new ae(`Bundle status: ${s.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:Nu(ae,me)})}async function c8({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=await Z().getLatestBlockhash().send(),t=await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(e,c),c=>gill.setTransactionMessageFeePayerSigner(n,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(o.value,c),c=>r?gill.compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([ju(c),qu(Z(),c.instructions.flatMap(d=>d.accounts??[]))]),s=Math.ceil((Number(i)??0)*1.1);return gill.prependTransactionMessageInstructions([...s>2e5?[programs.getSetComputeUnitLimitInstruction({units:s})]:[],...a>0?[programs.getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await gill.signTransactionMessageWithSigners(await c));return await Pu()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}function S8(e,n){if(n.threshold>1)throw new _("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(s=>AA(s.pubkey)===e);if(!r)throw new ee("Member",`Signer ${e} not found in settings`);let{permissions:o}=r;if(!o)throw new ee("Permissions","No permissions found for the current member");let t=ve.has(o,Re.InitiateTransaction),c=ve.has(o,Re.VoteTransaction),i=ve.has(o,Re.ExecuteTransaction);if(t&&c&&i)return null;if(!c||!i)throw new Rr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(s=>s.role===0);if(!a)throw new ee("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:gill.address(AA(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}function eM(e){let n=new URL(e);return n.protocol==="https:"?n.protocol="wss:":n.protocol==="http:"&&(n.protocol="ws:"),n.toString()}function tM(e,n){return new Promise((r,o)=>{let t=new WebSocket(e),c=()=>{try{t.close();}catch{}};n.addEventListener("abort",c,{once:true}),t.onopen=()=>{n.removeEventListener("abort",c),r(t);},t.onerror=()=>{n.removeEventListener("abort",c),o(new Error("WebSocket connection failed"));};})}async function rM(e,n,r){return new Promise((o,t)=>{let c=false,i=()=>{n.removeEventListener("abort",s),e.removeEventListener("message",d),e.removeEventListener("error",u),e.removeEventListener("close",g);},a=p=>{c||(c=true,i(),p());},s=()=>{try{e.close();}catch{}};n.addEventListener("abort",s);let d=p=>{if(typeof p.data!="string")return;let f;try{f=JSON.parse(p.data);}catch{return}let S=typeof f.event=="string"?f.event:"message",C=f.data;try{r(S,C)&&a(()=>o());}catch(x){a(()=>t(x));}},u=()=>{a(()=>t(new me("Transaction manager request failed",0,e.url)));},g=()=>{a(()=>o());};e.addEventListener("message",d),e.addEventListener("error",u),e.addEventListener("close",g);})}var nM=(e,n)=>new Promise((r,o)=>{if(n.aborted)return o(new DOMException("Aborted","AbortError"));let t=setTimeout(r,e);n.addEventListener("abort",()=>{clearTimeout(t),o(new DOMException("Aborted","AbortError"));},{once:true});});function x8(e){let{address:n,url:r,authResponses:o,transactionMessageBytes:t,onPendingApprovalsCallback:c,onPendingApprovalsSuccess:i,abortController:a,opts:s}=e,d=a??new AbortController,u=s?.maxAttempts??10,g=s?.retryDelayMs??400;return {address:n,async signTransactions(p){let{signal:f}=d,S=eM(r),C=JSON.stringify({publicKey:n.toString(),payload:p.map(x=>({transaction:gill.getBase64Decoder().decode(gill.getTransactionEncoder().encode(x)),transactionMessageBytes:t?gill.getBase64Decoder().decode(t):void 0,authResponses:o}))});for(let x=0;x<u;x++){if(f.aborted)throw new DOMException("Aborted","AbortError");let D,E;try{E=await tM(S,f),E.send(C),await rM(E,f,(I,v)=>{if(I==="error"){let k=v&&typeof v=="object"&&typeof v.error=="string"?v.error:"Unknown error",j=new Error(k);throw j.noRetry=!0,j}return I==="signatures"?(D=v.signatures,!0):(I==="pending_transaction_approval"?c?.(v.validTill):I==="transaction_approved"&&i?.(),!1)});}catch(I){if(I&&typeof I=="object"&&I.noRetry)throw new me(`Transaction manager error: ${I.message}`);if(I instanceof DOMException&&I.name==="AbortError")throw I}finally{try{E?.close();}catch{}}if(D?.length)return D.map(I=>({[n]:gill.getBase58Encoder().encode(I)}));x<u-1&&await nM(g,f);}throw new me("Transaction manager: missing signatures")}}}function AA(e){return e.keyType===Kt.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}function I8(e){let n=e.map(c=>Ve().encode(c)),r=4+n.reduce((c,i)=>c+i.length,0),o=new Uint8Array(r),t=0;o.set(gill.getU32Encoder().encode(e.length),t),t+=4;for(let c of n)o.set(c,t),t+=c.length;return o}function C8(e){let n=0,[r,o]=gill.getU32Decoder().read(e,n);n=o;let t=new Array(r);for(let c=0;c<r;c++){let i=Fe().read(e,n);t[c]=i[0],n=i[1];}if(n!==e.length)throw new _(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function N8({payer:e,rpId:n,origins:r,authority:o}){let t=await at({rpId:n}),c=new N;await c.addSystemAccounts();let i=await Ie(),{address:a,addressTree:s}=await w(o.address,i),d=[{address:a,tree:s,queue:s,type:"User"}],u=await X([],d),g=(await Se(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:f}=c.toAccountMetas(),S=W(u,f);return await Ia({origins:r,authorityCreationArgs:g,authority:o,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function Y8({authority:e,payer:n,createUserArgs:r,domainConfig:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[];r.settings&&(r.transactionManager&&i.push({address:(await w(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}),i.push({address:(await oe(r.settings,r.settingsAddressTreeIndex)).address,type:"Settings"}));let a=i.length?await de(i,t):[],s=await Ie(),{address:d,addressTree:u}=await w(r.member,s),g=[{address:d,type:"User",tree:u,queue:u}],p=await X(a,g),f=null,S=null,C=a.filter(k=>k.type==="Settings"),x=a.filter(k=>k.type==="User");if(x.length&&(S=re(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),x,Q())[0]),C.length){let k=x.length,j=k+1;f=re(c,p.treeInfos.slice(k,j),p.leafIndices.slice(k,j),p.rootIndices.slice(k,j),p.proveByIndices.slice(k,j),C,q())[0];}let D=(await Se(c,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),g))[0],{remainingAccounts:E,systemOffset:I}=c.toAccountMetas(),v=W(p,I);return await Ma({payer:n,authority:e,compressedProofArgs:v,member:vt().decode(r.member.toBuffer()),credentialId:le(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:f?gill.some({settingsMutArgs:f,transactionManager:S?gill.some(S):gill.none()}):gill.none(),userAccountCreationArgs:D,domainConfig:o,remainingAccounts:E})}async function $8({payer:e}){let n=await cA();return _a({payer:e,globalCounter:n})}async function nH({admin:e,rpId:n,disable:r}){let o=await at({rpId:n});return ja({domainConfig:o,admin:e,disable:r,remainingAccounts:[]})}function sM(e,n,r,o){let t=cM(e,n),c=aM(e,n)&&r!==o;return t&&c?gill.AccountRole.WRITABLE_SIGNER:t&&!c?gill.AccountRole.WRITABLE:!t&&c?gill.AccountRole.READONLY_SIGNER:gill.AccountRole.READONLY}function cM(e,n){let r=e.staticAccounts.length,{numSignerAccounts:o,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=o-t,a=r-o-c;return n>=r?false:n<i?true:n>=o?n-o<a:false}function aM(e,n){return n<e.header.numSignerAccounts}async function Nr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:o}){let t=xu(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await gill.fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),Z()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:gill.AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,s]of t.staticAccounts.entries())i.push({address:s,role:sM(t,a,s,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let s=c[a.lookupTableAddress];if(!s)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:gill.AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:gill.AccountRole.READONLY});}}for(let a of o?.filter(s=>s.address!==e)??[]){let s=i.findIndex(d=>d.address===a.address);s===-1?i.push({address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}):i[s].role===gill.AccountRole.READONLY||i[s].role===gill.AccountRole.READONLY_SIGNER?i[s]={address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}:(i[s].role===gill.AccountRole.WRITABLE||i[s].role===gill.AccountRole.WRITABLE_SIGNER)&&(i[s]={address:a.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}var dt=33,ut=64,$o=14,mM=2,lM=gill.address("Secp256r1SigVerify1111111111111111111111111");function yM(){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 TM(){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 TA(){return gill.createDecoder({read:(e,n=0)=>{let r=gill.getU8Decoder().decode(e,n);n+=1;let o=gill.getU8Decoder().decode(e,n);n+=1;let t=[],c=TM();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=$o;let i=[];for(let a=0;a<r;a++){let s=gill.fixDecoderSize(gill.getBytesDecoder(),dt).decode(e,n);n+=dt;let d=gill.fixDecoderSize(gill.getBytesDecoder(),ut).decode(e,n);n+=ut;let u=t[a].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:s,signature:d,message:g});}return [{numSignatures:r,padding:o,offsets:t,payload:i},n]}})}function fA(){return gill.createEncoder({getSizeFromValue:e=>{let n=$o*e.offsets.length,r=e.payload.reduce((o,t)=>o+dt+ut+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=gill.getU8Encoder().write(e.numSignatures,n,r),r=gill.getU8Encoder().write(e.padding,n,r);let o=yM();for(let t of e.offsets)r=o.write(t,n,r);for(let t of e.payload)r=gill.fixEncoderSize(gill.getBytesEncoder(),dt).write(t.publicKey,n,r),r=gill.fixEncoderSize(gill.getBytesEncoder(),ut).write(t.signature,n,r),r=gill.getBytesEncoder().write(t.message,n,r);return r}})}function yH(){return gill.combineCodec(fA(),TA())}function H(e,n){let r=e.length,o=mM+r*$o,t=[];for(let s=0;s<r;s++){let{message:d}=e[s],u=o,g=u+dt,p=g+ut;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),o+=dt+ut+d.length;}let c=n?.programAddress??lM,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:fA().encode(i)}}function TH(e){return {programAddress:e.programAddress,accounts:{},data:TA().decode(e.data)}}async function SA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:o,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:s=false}){let d=await be(e),{accountMetas:u,addressLookupTableAccounts:g}=await Nr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(H(c)),p.push(s?Qd({transactionBuffer:n,payer:o.address,remainingAccounts:u,settingsKey:e}):jd({transactionBuffer:n,payer:o.address,settings:e})),a&&p.push(Yu({payer:o,tipAmount:a})),{instructions:p,addressLookupTableAccounts:g}}async function xA({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,additionalSigners:o,signers:t,payer:c,addressesByLookupTableAddress:i,secp256r1VerifyInput:a=[],compressed:s=false,simulateProof:d=false,cachedAccounts:u}){let g=ue(t),p=await be(e),[{accountMetas:f,addressLookupTableAccounts:S,transactionMessage:C},{settingsMutArgs:x,proof:D,packedAccounts:E}]=await Promise.all([Nr({transactionMessageBytes:r,walletAddress:p,additionalSigners:o,addressesByLookupTableAddress:i}),xe(s,e,n,d,u)]);E.addPreAccounts(f);let{secp256r1VerifyInput:I,transactionSyncSigners:v}=We(g,E,a),{remainingAccounts:k,systemOffset:j}=E.toAccountMetas(),se=[];I.length>0&&se.push(H(I));let Ee=fM(C,f);if(s){if(!c||!x)throw new _("Payer not found or proof args are missing for executeTransactionSync.");let De=W(D,j);se.push(uu({signers:v,transactionMessage:Ee,settingsMutArgs:x,compressedProofArgs:De,payer:c,remainingAccounts:k}));}else se.push(ou({signers:v,settings:e,transactionMessage:Ee,remainingAccounts:k}));return {instructions:se,addressLookupTableAccounts:S}}function fM(e,n){if(e.version==="legacy")throw new _("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:r.data??[]})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(o=>o.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function jH({settings:e,settingsAddressTreeIndex:n,destination:r,signers:o,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let s=ue(o),d=await be(e),[{packedAccounts:u,proof:g,settingsMutArgs:p},{value:f}]=await Promise.all([xe(a,e,n,false,t),$e(d,t)]);if((f?.lamports??0)<BigInt(c))throw new _("Insufficient balance for native transfer.");let{secp256r1VerifyInput:S,transactionSyncSigners:C}=We(s,u),{remainingAccounts:x,systemOffset:D}=u.toAccountMetas(),E=[];if(S.length>0&&E.push(H(S)),a){if(!i||!p)throw new Error("Payer not found or proof args is missing.");let I=W(g,D);E.push(xi({amount:c,settingsMutArgs:p,compressedProofArgs:I,payer:i,signers:C,source:d,destination:r,remainingAccounts:x}));}else E.push(mi({amount:c,signers:C,source:d,destination:r,settings:e,remainingAccounts:x}));return E}var hM=gill.address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),RM=gill.address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Hr=gill.address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function d5({settings:e,settingsAddressTreeIndex:n,destination:r,mint:o,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:s,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false,useDestinationSplAccount:g=false}){let p=ue(t),f=await be(e),S=await bM(o,r,f,s,d),[C,x]=await Promise.all([_M(S,c),NM(u,e,n,c)]),D=vM(C,S,i,g),[E,I]=await Promise.all([BM(f,o,D.splBalance,D.cTokenBalance,BigInt(i),u),OM(D.requireSplInterface,S.splInterfacePda,c)]),v=BigInt(E.reduce((Oe,ns)=>Oe+(ns.parsed.amount.toNumber()??0),0));if(D.splBalance+D.cTokenBalance+v<BigInt(i))throw new _("Insufficient balance for token transfer.");let k=new N;I&&k.addPreAccounts([{address:o,role:gill.AccountRole.WRITABLE}]);let j=UM(E,x),{proof:se,settingsMutArgs:Ee}=await kM(k,j,x),De=WM(E,se,k),{secp256r1VerifyInput:nt,transactionSyncSigners:Le}=We(p,k),{remainingAccounts:ge,systemOffset:ot}=k.toAccountMetas(),zr=W(se,ot),T=[];nt.length>0&&T.push(H(nt));let er=LM({amount:i,transactionSyncSigners:Le,walletAddress:f,destination:r,addresses:S,balances:D,mint:o,tokenProgram:s,remainingAccounts:ge,payer:a,sourceCompressedTokenAccounts:De,compressedProofArgs:zr,splInterfacePdaArgs:d});if(u){if(!Ee)throw new Error("Payer not found or proof args is missing.");T.push(Wi({...er,settingsMutArgs:Ee}));}else T.push(Ri({...er,settings:e}));return T}async function bM(e,n,r,o,t){let c=p=>gill.getProgramDerivedAddress({seeds:[gill.getAddressEncoder().encode(p),gill.getAddressEncoder().encode(Hr),gill.getAddressEncoder().encode(e)],programAddress:Hr}),i=[gill.getUtf8Encoder().encode("pool"),gill.getAddressEncoder().encode(e)];t.restricted&&i.push(gill.getUtf8Encoder().encode("restricted")),t.index>0&&i.push(gill.getU8Encoder().encode(t.index));let[a,[s],d,[u],[g]]=await Promise.all([programs.getAssociatedTokenAccountAddress(e,r,o),c(r),programs.getAssociatedTokenAccountAddress(e,n,o),c(n),gill.getProgramDerivedAddress({seeds:i,programAddress:Hr})]);return {sourceSplAta:a,sourceCtokenAta:s,destinationSplAta:d,destinationCTokenAta:u,splInterfacePda:g}}async function _M(e,n){let[r,o,t]=await Promise.all([$e(e.destinationSplAta,n),$e(e.sourceSplAta,n),$e(e.sourceCtokenAta,n)]);return {destinationSplAtaInfo:r,sourceSplAtaInfo:o,sourceCTokenAtaInfo:t}}function vM(e,n,r,o){let t=!!e.destinationSplAtaInfo.value,c=!!e.sourceSplAtaInfo.value,i=!!e.sourceCTokenAtaInfo.value,a=c?programs.getTokenDecoder().decode(gill.getBase64Encoder().encode(e.sourceSplAtaInfo.value.data[0])).amount:BigInt(0),s=BigInt(i?wM(gill.getBase64Encoder().encode(e.sourceCTokenAtaInfo.value.data[0]))?.amount??0:0),d=t||o?n.destinationSplAta:void 0,u=t||o?void 0:n.destinationCTokenAta,g=c&&(a+s<BigInt(r)||s>BigInt(0)||!t)||!c&&t;return {splBalance:a,cTokenBalance:s,destinationSplTokenAccount:d,destinationCtokenTokenAccount:u,requireSplInterface:g,requireRentSponsor:a+s<BigInt(r)||!t}}function UM(e,n){let r=[];return e.forEach(o=>r.push({hash:o.compressedAccount.hash,tree:o.compressedAccount.treeInfo.tree,queue:o.compressedAccount.treeInfo.queue,data:o.compressedAccount.data,address:o.compressedAccount.address})),n&&r.push(n),r}async function kM(e,n,r){let o=null,t=null;return n.length===0?{proof:t,settingsMutArgs:o}:(await e.addSystemAccounts(),t=await X(n,[]),r&&(o=re(e,t.treeInfos.slice(-1),t.leafIndices.slice(-1),t.rootIndices.slice(-1),t.proveByIndices.slice(-1),n.slice(-1),q())[0]),{proof:t,settingsMutArgs:o})}function WM(e,n,r){return !n||!e.length?[]:e.map(o=>({amount:o.parsed.amount.toNumber(),merkleContext:{leafIndex:o.compressedAccount.leafIndex,merkleTreePubkeyIndex:r.insertOrGet(o.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:r.insertOrGet(o.compressedAccount.treeInfo.queue.toString()),proveByIndex:o.compressedAccount.proveByIndex},rootIndex:n.rootIndices[0],version:eA(o.compressedAccount.data?.discriminator),tlv:o.parsed.tlv?gill.some(gill.getArrayDecoder(Dt()).decode(o.parsed.tlv)):gill.none(),state:o.parsed.state}))}function LM({amount:e,transactionSyncSigners:n,walletAddress:r,destination:o,addresses:t,balances:c,mint:i,tokenProgram:a,remainingAccounts:s,payer:d,sourceCompressedTokenAccounts:u,compressedProofArgs:g,splInterfacePdaArgs:p}){return {amount:e,signers:n,source:r,destination:o,sourceCtokenTokenAccount:t.sourceCtokenAta,sourceSplTokenAccount:t.sourceSplAta,destinationCtokenTokenAccount:c.destinationCtokenTokenAccount,destinationSplTokenAccount:c.destinationSplTokenAccount,mint:i,tokenProgram:a,remainingAccounts:s,payer:d,sourceCompressedTokenAccounts:u,compressedProofArgs:g,compressibleConfig:hM,splInterfacePda:c.requireSplInterface?t.splInterfacePda:void 0,rentSponsor:c.requireRentSponsor?RM:void 0,splInterfacePdaArgs:c.requireSplInterface?gill.some(p):gill.none()}}async function OM(e,n,r){if(!e)return false;let{value:o}=await $e(n,r);return !o}async function BM(e,n,r,o,t,c){let i=t-r-o;if(i<=0)return [];let s=(await Te().getCompressedTokenAccountsByOwner(new web3_js.PublicKey(e),{mint:new web3_js.PublicKey(n)})).items.filter(u=>!!u.compressedAccount.data?.data.length&&u.compressedAccount.owner.toString()===Hr.toString()&&!u.parsed.amount.isZero());return s.length===0?[]:compressedToken.selectMinCompressedTokenAccountsForDecompression(s,new IM__default.default(i),c?3:4,{treeType:stateless_js.TreeType.StateV2}).selectedAccounts}async function NM(e,n,r,o){if(!e)return null;let{address:t}=await oe(n,r);return (await de([{address:t,type:"Settings"}],o))[0]??null}function wM(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 I5({signers:e,payer:n,changeConfigArgs:r}){let{settings:o,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:s}=r,d=ue(e),u=[],g=[];for(let x of d)if(x instanceof U){let D=g.length,{domainConfig:E,verifyArgs:I,signature:v,publicKey:k,message:j}=ie(x,D);if(j&&v&&k&&g.push({message:j,signature:v,publicKey:k}),E){let se=i.addPreAccounts([{address:E,role:gill.AccountRole.READONLY}]).get(E)?.index;I.__option==="Some"&&se!==void 0&&u.push({__kind:"Secp256r1",fields:[{domainConfigIndex:se,verifyArgs:I.value}]});}}else {let D=i.addPreAccounts([{address:x.address,role:gill.AccountRole.READONLY_SIGNER,signer:x}]).get(x.address)?.index;D!==void 0&&u.push({__kind:"Ed25519",fields:[D]});}let{remainingAccounts:p,systemOffset:f}=i.toAccountMetas(),S=W(a,f),C=[];if(g.length>0&&C.push(H(g)),c){if(!s)throw new _("Proof args are missing for compressed changeConfig.");C.push(ca({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:s,remainingAccounts:p,signers:u}));}else C.push(Qc({settings:o,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:p,signers:u}));return C}async function R5({createUserArgs:e,payer:n}){let r=new N;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:u.member})));let o=await Ie(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:p}=await w(u.member.address,o);return {address:g,tree:p,queue:p,type:"User"}})),c=await X([],t),i=await Se(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:s}=r.toAccountMetas(),d=W(c,s);return await Wa({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:i[g],transactionManagerUrl:u.role===0?u.transactionManagerUrl:null})),remainingAccounts:a})}async function L5({index:e,payer:n,initialMember:r,userAddressTreeIndex:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[],a=[];a.push(...await de([{address:(await w(r.address,o)).address,type:"User"}],t));let s=await Ie(),{address:d,addressTree:u}=await oe(await Ce(e),s);i.push({address:d,queue:u,tree:u,type:"Settings"});let g=a.length,p=await X(a,i),f=re(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),a.filter(I=>I.type==="User"),Q())[0],C=(await Se(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),i)).find(I=>I.type==="Settings")??null,{remainingAccounts:x,systemOffset:D}=c.toAccountMetas(),E=W(p,D);if(!C)throw new Error("Settings creation args is missing.");return await Aa({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:E,...C,remainingAccounts:x})}async function K5({settings:e,settingsAddressTreeIndex:n,payer:r,signers:o,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await xe(true,e,n,false,t);if(!a)throw new _("Proof args are missing for settings account.");let s=ue(o),{secp256r1VerifyInput:d,transactionSyncSigners:u}=We(s,c),{remainingAccounts:g,systemOffset:p}=c.toAccountMetas(),f=W(i,p),S=[];return d.length>0&&S.push(H(d)),S.push(Ha({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:f,signers:u,remainingAccounts:g})),S}async function Q5({authority:e,domainConfig:n,newAuthority:r,newOrigins:o}){let t=null,c=[];if(r){let i=new N;await i.addSystemAccounts();let a=await Ie(),{address:s,addressTree:d}=await w(r.address,a),u=[{address:s,tree:d,queue:d,type:"User"}],g=await X([],u),p=(await Se(i,g.treeInfos,g.roots,g.rootIndices,u))[0],f=i.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:W(g,f.systemOffset),authorityCreationArgs:p};}return Qa({domainConfig:n,authority:e,newOrigins:o?gill.some(o):gill.none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function o6({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let o=new N;await o.addSystemAccounts();let t=await de([{address:(await w(e.address,n)).address,type:"User"}]),c=await X(t,[]),i=re(o,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,Q())[0],{remainingAccounts:a,systemOffset:s}=o.toAccountMetas(),d=W(c,s);return oi({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function m6({payer:e,user:n,userAddressTreeIndex:r,newDelegate:o,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:s,publicKey:d}=ie(n),u=[];a&&s&&d&&u.push({message:a,signature:s,publicKey:d});let g=await Jo(n instanceof U?n:n.address,r,t),p=[];p.push({address:(await w(n instanceof U?n:n.address,r)).address,type:"User"});let f,S=null,C,x=null,D=g.wallets.find(ge=>ge.isDelegate);if(D){let ge=await Ce(D.index);(await Br(ge,D.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await oe(ge,D.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):f=await Ce(D.index);}if(o){let ge=await Ce(o.index);(await Br(ge,o.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await oe(ge,o.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):C=await Ce(o.index);}let E=new N;await E.addSystemAccounts();let I=await de(p,t),v=await X(I,[]),k=re(E,v.treeInfos.slice(0,1),v.leafIndices.slice(0,1),v.rootIndices.slice(0,1),v.proveByIndices.slice(0,1),I.slice(0,1),Q())[0],j=S?gill.some(re(E,v.treeInfos.slice(S.start,S.end),v.leafIndices.slice(S.start,S.end),v.rootIndices.slice(S.start,S.end),v.proveByIndices.slice(S.start,S.end),I.slice(S.start,S.end),q())[0]):gill.none(),se=x?gill.some(re(E,v.treeInfos.slice(x.start,x.end),v.leafIndices.slice(x.start,x.end),v.rootIndices.slice(x.start,x.end),v.proveByIndices.slice(x.start,x.end),I.slice(x.start,x.end),q())[0]):gill.none(),{remainingAccounts:Ee,systemOffset:De}=E.toAccountMetas(),nt=W(v,De),Le=[];return u.length>0&&Le.push(H(u)),Le.push(ui({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:o?gill.some(o):gill.none(),feePayer:e,signer:n instanceof U?void 0:n,oldSettings:f,oldSettingsMutArgs:j,newSettings:C,newSettingsMutArgs:se,compressedProofArgs:nt,userMutArgs:k,remainingAccounts:Ee})),Le}async function v6({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:o,compressed:t=false,cachedAccounts:c}){let i=await kc(Z(),r),a=i.data.multiWalletSettings,{packedAccounts:s,proof:d,settingsMutArgs:u}=await xe(t,a,e,false,c),{remainingAccounts:g,systemOffset:p}=s.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:C,signature:x,publicKey:D}=ie(n),E=[];if(C&&x&&D&&E.push(H([{message:C,signature:x,publicKey:D}])),t){if(!o||!u)throw new _("Payer not found or proof args are missing for closing buffer.");let I=W(d,p);E.push(ji({transactionBuffer:r,domainConfig:f,closer:n instanceof U?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:u,payer:o,compressedProofArgs:I,remainingAccounts:g}));}else E.push(Hi({transactionBuffer:r,domainConfig:f,closer:n instanceof U?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return E}function bA({payer:e,creator:n,bufferIndex:r,settings:o,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,compressedArgs:d,expectedSigners:u}){let{domainConfig:g,verifyArgs:p,message:f,signature:S,publicKey:C}=ie(n),x=[];if(f&&S&&C&&x.push(H([{message:f,signature:S,publicKey:C}])),d){let{settingsReadonlyArgs:D,compressedProofArgs:E,remainingAccounts:I}=d;x.push(od({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof U?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},settingsReadonlyArgs:D,compressedProofArgs:E,remainingAccounts:I}));}else x.push(Qi({settings:o,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof U?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},remainingAccounts:[]}));return x}function _A({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:s}=ie(e),d=[];return a&&i&&s&&d.push(H([{message:a,signature:i,publicKey:s}])),o?d.push(yd({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof U?void 0:e,settingsMutArgs:o.settingsMutArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(ud({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof U?void 0:e,remainingAccounts:[]})),d}function vA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:o=false}){return o?Rd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Cd({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function UA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:s}=ie(n),d=[];return s&&i&&a&&d.push(H([{message:s,signature:i,publicKey:a}])),o?d.push(Hd({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof U?void 0:n,settingsReadonlyArgs:o.settingsReadonlyArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(Wd({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof U?void 0:n,remainingAccounts:[]})),d}async function xV({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:o,compressed:t=false}){let c=await GM(r),i=new N,a=null,s=null,d=[];if(c.length||t){let g=await zM({packedAccounts:i,userAccounts:c,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:o});a=g.proof,s=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await KM({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:s,packedAccounts:i,compressed:t}}async function GM(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}}return n}async function zM({packedAccounts:e,userAccounts:n,compressed:r,settings:o,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let f=(await oe(o,t)).address;i.push({address:f,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await de(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let s=await X(a,[]),d=[],u=[];for(let f of a)f.type==="Settings"?d.push(f):f.type==="User"&&u.push(f);let g,p=[];if(r&&s&&(g=re(e,s.treeInfos.slice(0,1),s.leafIndices.slice(0,1),s.rootIndices.slice(0,1),s.proveByIndices.slice(0,1),d,q())[0]),u.length&&s){let f=r?1:0;p=re(e,s.treeInfos.slice(f),s.leafIndices.slice(f),s.rootIndices.slice(f),s.proveByIndices.slice(f),u,Q());}return {proof:s,settingsMutArgs:g,userMutArgs:p}}async function KM({configActionsArgs:e,userMutArgs:n}){let r=[];for(let o of e)switch(o.type){case "AddMembers":{let t=[];for(let c of o.members){let i=await w(c.member,c.userAddressTreeIndex).then(a=>n.find(s=>utils_js.equalBytes(s.accountMeta.address,gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(a.address)))));if(!i)throw new Error("Unable to find user account");t.push(JM({permissionArgs:c.permissions,userMutArgs:i,pubkey:c.member}));}r.push({__kind:o.type,fields:[t]});break}case "RemoveMembers":{let t=await Promise.all(o.members.map(c=>w(c.member,c.userAddressTreeIndex).then(i=>{let a=n.find(s=>utils_js.equalBytes(s.accountMeta.address,gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(i.address))));if(!a)throw new Error("Unable to find user account");return qM({pubkey:c.member,userMutArgs:a})})));r.push({__kind:o.type,fields:[t]});break}case "EditPermissions":{let t=o.members.map(c=>jM({permissionArgs:c.permissions,pubkey:c.member}));r.push({__kind:o.type,fields:[t]});break}default:r.push({__kind:o.type,fields:[o.threshold]});}return r}function jM({pubkey:e,permissionArgs:n}){return {memberKey:fe(e),permissions:OA(n)}}function qM({pubkey:e,userMutArgs:n}){let r=n.data.role;if(r===2)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:fe(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function JM({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===2)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===0&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:fe(e),permissions:OA(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function OA(e){let n=[];return e.initiate&&n.push(Re.InitiateTransaction),e.vote&&n.push(Re.VoteTransaction),e.execute&&n.push(Re.ExecuteTransaction),ve.fromPermissions(n)}async function RV({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:p=Math.ceil(o.length/2),cachedAccounts:f}){let S=Math.floor(Math.random()*255),C=await aA(n,t instanceof U?t:t.address,S),x=[],D=[];for(let te=0;te<o.length;te+=p){let os=o.subarray(te,te+p);x.push(os),D.push(sha2_js.sha256(os));}let E=sha2_js.sha256(o),{settingsReadonlyArgs:I,settingsMutArgs:v,proof:k,packedAccounts:j}=await xe(d,n,r,false,f),{remainingAccounts:se,systemOffset:Ee}=j.toAccountMetas(),De=k&&I&&v?{settingsReadonlyArgs:I,settingsMutArgs:v,compressedProofArgs:W(k,Ee),remainingAccounts:se,payer:e}:null,nt=ue([t,...c?[c]:[],...u]).map(te=>({memberKey:fe(te),messageHash:te instanceof U?Fo(te.authResponse):null})),Le=bA({finalBufferHash:E,finalBufferSize:o.length,bufferIndex:S,payer:e,transactionBufferAddress:C,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:D,compressedArgs:De,expectedSigners:nt}),ge=x.map(te=>vA({transactionMessageBytes:te,transactionBufferAddress:C,settings:n,compressed:d})),ot=u.map(te=>UA({voter:te,transactionBufferAddress:C,settings:n,compressedArgs:De})),zr=_A({compressedArgs:De,settings:n,executor:c,transactionBufferAddress:C}),{instructions:T,addressLookupTableAccounts:er}=await SA({compressed:d,settings:n,transactionMessageBytes:o,transactionBufferAddress:C,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s}),Oe=te=>({payer:e,instructions:te,addressesByLookupTableAddress:er});return [Oe(Le),...ge.map(te=>Oe([te])),...ot.length?[Oe(ot.flat())]:[],Oe(zr),Oe(T)]}var Fr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let o=new Map,t=i=>{let a=o.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},o.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let s=t(a.address);s.isSigner||=a.role===gill.AccountRole.READONLY_SIGNER||a.role===gill.AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===gill.AccountRole.WRITABLE||a.role===gill.AccountRole.WRITABLE_SIGNER;}}return new e(r,o)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),o=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),c=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+o.length,numReadonlySignerAccounts:o.length,numReadonlyNonSignerAccounts:c.length};if(r.length===0)throw new Error("Expected at least one writable signer key");let[a]=r[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let s=[...r.map(([d])=>d),...o.map(([d])=>d),...t.map(([d])=>d),...c.map(([d])=>d)];return [i,s]}extractTableLookup(n){let[r,o]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(n,r){let o=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,s=n.findIndex(d=>d===a);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),t.push(a),this.keyMetaMap.delete(c);}}return [o,t]}};var Gr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let o=new Map;this.keySegments().flat().forEach((c,i)=>{o.set(c,i);});let t=c=>{let i=o.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function NA({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:o}){let t=Fr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(o??{});for(let p of a){let f=t.extractTableLookup(p);if(f!==void 0){let{addressTableLookup:S,drainedKeys:C}=f;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:gill.address(S.lookupTableAddress)}),i.writable.push(...C.writable),i.readonly.push(...C.readonly);}}let[s,d]=t.getMessageComponents(),g=new Gr(d,i).compileInstructions(r);return {version:0,header:s,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function VV({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=NA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(Su(o))}async function jV({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,signers:t,additionalSigners:c,secp256r1VerifyInput:i,addressesByLookupTableAddress:a,cachedAccounts:s,compressed:d=false,simulateProof:u=false}){let{instructions:g,addressLookupTableAccounts:p}=await xA({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,additionalSigners:c,transactionMessageBytes:o,secp256r1VerifyInput:i,compressed:d,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:s});return {payer:e,instructions:g,addressesByLookupTableAddress:p}}exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=Fc;exports.AccountState=Kr;exports.AdditionalSignersSchema=wD;exports.AuthenticationContextSchema=lu;exports.BaseResponseSchema=yu;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=na;exports.CHANGE_CONFIG_DISCRIMINATOR=Yc;exports.CREATE_COMPRESSED_WALLET_DISCRIMINATOR=da;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=Sa;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=Da;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=Ra;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=Ua;exports.CompleteMessageRequestSchema=NN;exports.CompleteSendTransactionRequestSchema=HN;exports.CompleteTransactionRequestSchema=wN;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=Ba;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=Ga;exports.DOMAIN_CONFIG_DISCRIMINATOR=ss;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=Za;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=ti;exports.EDIT_USER_DELEGATE_DISCRIMINATOR=ai;exports.GLOBAL_COUNTER_DISCRIMINATOR=As;exports.KeyType=Kt;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=LE;exports.MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH=AE;exports.MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED=hD;exports.MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING=tD;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=nD;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=oD;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH=PD;exports.MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE=OD;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=mE;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=pE;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=PE;exports.MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS=uD;exports.MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH=CE;exports.MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH=gE;exports.MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH=xE;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=zE;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=KE;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=jE;exports.MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED=dD;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=NE;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=OE;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=BE;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=_E;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX=DD;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=aD;exports.MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG=EE;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=UE;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=GE;exports.MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT=AD;exports.MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS=wE;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=bE;exports.MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG=TE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION=sE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY=iE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=oE;exports.MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS=aE;exports.MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER=eD;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=QE;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=hE;exports.MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE=ID;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG=IE;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION=SE;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=RE;exports.MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG=_D;exports.MULTI_WALLET_ERROR__INVALID_USER_ROLE=vE;exports.MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG=bD;exports.MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR=xD;exports.MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE=dE;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=ZE;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=sD;exports.MULTI_WALLET_ERROR__MEMBER_NOT_FOUND=mD;exports.MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS=ED;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=kE;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS=gD;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT=TD;exports.MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT=vD;exports.MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR=SD;exports.MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS=pD;exports.MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS=WE;exports.MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY=WD;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE=kD;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA=iD;exports.MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT=UD;exports.MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA=fD;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=XE;exports.MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS=MD;exports.MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES=LD;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=VE;exports.MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED=DE;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=yE;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=fE;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=cD;exports.MULTI_WALLET_ERROR__PAYER_MISMATCH=yD;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=lE;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=YE;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=uE;exports.MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH=lD;exports.MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS=cE;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=$E;exports.MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH=CD;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=ME;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=qE;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=JE;exports.MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING=rD;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=FE;exports.MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY=RD;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=HE;exports.MULTI_WALLET_PROGRAM_ADDRESS=A;exports.MultiWalletAccount=tE;exports.MultiWalletInstruction=rE;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=Ti;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=gi;exports.Permission=Re;exports.Permissions=ve;exports.SETTINGS_DISCRIMINATOR=Dc;exports.Secp256r1Key=Ue;exports.SignedSecp256r1Key=U;exports.StartMessageRequestSchema=pu;exports.StartTransactionRequestSchema=mu;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=Ui;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=Mi;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=Gi;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=Bi;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=td;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=Yi;exports.TRANSACTION_BUFFER_DISCRIMINATOR=_c;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=pd;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=ad;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=Pd;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=Sd;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=Bd;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=vd;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=Yd;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=Gd;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=au;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=tu;exports.TransactionActionTypeSchema=gu;exports.TransactionDetailsSchema=HD;exports.TransactionPayloadSchema=BN;exports.TransactionPayloadWithBase64MessageBytesSchema=ND;exports.Transports=go;exports.UserInfoSchema=BD;exports.UserRole=_e;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=Oc;exports.addWhitelistedAddressTrees=_N;exports.base64URLStringToBuffer=le;exports.bufferToBase64URLString=Uw;exports.changeConfig=I5;exports.closeTransactionBuffer=v6;exports.configAction=sR;exports.convertBase64StringToJWK=Lw;exports.convertJWKToBase64String=Ww;exports.convertMemberKeyToString=AA;exports.convertPubkeyCompressedToCose=Mw;exports.convertPubkeyCoseToCompressed=Pw;exports.createClientAuthorizationCompleteRequestChallenge=bw;exports.createClientAuthorizationStartRequestChallenge=Rw;exports.createDomainConfig=N8;exports.createDomainUserAccounts=Y8;exports.createGlobalCounter=$8;exports.createMessageChallenge=_w;exports.createTransactionBuffer=bA;exports.createTransactionChallenge=vw;exports.createTransactionManagerSigner=x8;exports.createUserAccounts=R5;exports.createWallet=L5;exports.decodeDomainConfig=as;exports.decodeGlobalCounter=ps;exports.decodeSettings=Pc;exports.decodeTransactionBuffer=Uc;exports.decodeWhitelistedAddressTree=Nc;exports.decompressSettingsAccount=K5;exports.deserializeConfigActions=C8;exports.disableDomainConfig=nH;exports.editDomainConfig=Q5;exports.editTransactionManagerUrl=o6;exports.editUserDelegate=m6;exports.executeTransaction=SA;exports.executeTransactionBuffer=_A;exports.executeTransactionSync=xA;exports.extendTransactionBuffer=vA;exports.extensionStruct=ER;exports.fetchAllDomainConfig=$M;exports.fetchAllGlobalCounter=ch;exports.fetchAllMaybeDomainConfig=QA;exports.fetchAllMaybeGlobalCounter=mg;exports.fetchAllMaybeSettings=c1;exports.fetchAllMaybeTransactionBuffer=M1;exports.fetchAllMaybeWhitelistedAddressTree=j1;exports.fetchAllSettings=Yv;exports.fetchAllSettingsAccountByMember=_2;exports.fetchAllTransactionBuffer=tU;exports.fetchAllWhitelistedAddressTree=cU;exports.fetchDomainConfig=is;exports.fetchGlobalCounter=sh;exports.fetchMaybeDomainConfig=XA;exports.fetchMaybeGlobalCounter=pg;exports.fetchMaybeSettings=po;exports.fetchMaybeSettingsAccountData=kP;exports.fetchMaybeTransactionBuffer=P1;exports.fetchMaybeUserAccountData=UP;exports.fetchMaybeWhitelistedAddressTree=K1;exports.fetchSettings=Jv;exports.fetchSettingsAccountData=Br;exports.fetchTransactionBuffer=kc;exports.fetchUserAccountByFilters=b2;exports.fetchUserAccountData=Jo;exports.fetchWhitelistedAddressTree=wc;exports.getAccountStateCodec=uh;exports.getAccountStateDecoder=qr;exports.getAccountStateEncoder=jr;exports.getAddMemberArgsCodec=Th;exports.getAddMemberArgsDecoder=Xr;exports.getAddMemberArgsEncoder=Zr;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=EU;exports.getAddWhitelistedAddressTreesInstruction=PU;exports.getAddWhitelistedAddressTreesInstructionAsync=zc;exports.getAddWhitelistedAddressTreesInstructionDataCodec=DU;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=Gc;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=Io;exports.getAdditionalMetadataCodec=ph;exports.getAdditionalMetadataDecoder=Yr;exports.getAdditionalMetadataEncoder=Jr;exports.getChangeConfigCompressedDiscriminatorBytes=FU;exports.getChangeConfigCompressedInstruction=ca;exports.getChangeConfigCompressedInstructionDataCodec=GU;exports.getChangeConfigCompressedInstructionDataDecoder=sa;exports.getChangeConfigCompressedInstructionDataEncoder=oa;exports.getChangeConfigDiscriminatorBytes=kU;exports.getChangeConfigInstruction=Qc;exports.getChangeConfigInstructionDataCodec=WU;exports.getChangeConfigInstructionDataDecoder=Xc;exports.getChangeConfigInstructionDataEncoder=Zc;exports.getClientAndDeviceHash=Vo;exports.getCompiledInstructionCodec=xh;exports.getCompiledInstructionDecoder=$r;exports.getCompiledInstructionEncoder=Qr;exports.getCompressedAccountMetaCodec=Dh;exports.getCompressedAccountMetaDecoder=mt;exports.getCompressedAccountMetaEncoder=pt;exports.getCompressedAccountMetaReadOnlyCodec=Rh;exports.getCompressedAccountMetaReadOnlyDecoder=ft;exports.getCompressedAccountMetaReadOnlyEncoder=Tt;exports.getCompressedOnlyExtensionCodec=vh;exports.getCompressedOnlyExtensionDecoder=tn;exports.getCompressedOnlyExtensionEncoder=en;exports.getCompressedProofCodec=Wh;exports.getCompressedProofDecoder=an;exports.getCompressedProofEncoder=cn;exports.getCompressedSettingsAddress=oe;exports.getCompressedSettingsCodec=Nh;exports.getCompressedSettingsDataCodec=Fh;exports.getCompressedSettingsDataDecoder=un;exports.getCompressedSettingsDataEncoder=dn;exports.getCompressedSettingsDecoder=q;exports.getCompressedSettingsEncoder=St;exports.getCompressedTokenArgsCodec=jh;exports.getCompressedTokenArgsDecoder=Et;exports.getCompressedTokenArgsEncoder=Ct;exports.getCompressibleExtensionCodec=Zh;exports.getCompressibleExtensionDecoder=Tn;exports.getCompressibleExtensionEncoder=yn;exports.getCompressionInfoCodec=eR;exports.getCompressionInfoDecoder=Sn;exports.getCompressionInfoEncoder=fn;exports.getConfigActionCodec=oR;exports.getConfigActionDecoder=Fe;exports.getConfigActionEncoder=Ve;exports.getCreateCompressedWalletDiscriminatorBytes=XU;exports.getCreateCompressedWalletInstruction=$U;exports.getCreateCompressedWalletInstructionAsync=Aa;exports.getCreateCompressedWalletInstructionDataCodec=QU;exports.getCreateCompressedWalletInstructionDataDecoder=ua;exports.getCreateCompressedWalletInstructionDataEncoder=Co;exports.getCreateDomainConfigDiscriminatorBytes=ak;exports.getCreateDomainConfigInstruction=dk;exports.getCreateDomainConfigInstructionAsync=Ia;exports.getCreateDomainConfigInstructionDataCodec=ik;exports.getCreateDomainConfigInstructionDataDecoder=xa;exports.getCreateDomainConfigInstructionDataEncoder=Do;exports.getCreateDomainUserAccountDiscriminatorBytes=Tk;exports.getCreateDomainUserAccountInstruction=Sk;exports.getCreateDomainUserAccountInstructionAsync=Ma;exports.getCreateDomainUserAccountInstructionDataCodec=fk;exports.getCreateDomainUserAccountInstructionDataDecoder=Pa;exports.getCreateDomainUserAccountInstructionDataEncoder=Po;exports.getCreateGlobalCounterDiscriminatorBytes=Mk;exports.getCreateGlobalCounterInstruction=Rk;exports.getCreateGlobalCounterInstructionAsync=_a;exports.getCreateGlobalCounterInstructionDataCodec=hk;exports.getCreateGlobalCounterInstructionDataDecoder=ba;exports.getCreateGlobalCounterInstructionDataEncoder=ho;exports.getCreateUserAccountArgsCodec=uR;exports.getCreateUserAccountArgsDecoder=vn;exports.getCreateUserAccountArgsEncoder=_n;exports.getCreateUserAccountsDiscriminatorBytes=Ok;exports.getCreateUserAccountsInstruction=Nk;exports.getCreateUserAccountsInstructionAsync=Wa;exports.getCreateUserAccountsInstructionDataCodec=Bk;exports.getCreateUserAccountsInstructionDataDecoder=ka;exports.getCreateUserAccountsInstructionDataEncoder=bo;exports.getDecompressSettingsAccountDiscriminatorBytes=jk;exports.getDecompressSettingsAccountInstruction=Ha;exports.getDecompressSettingsAccountInstructionDataCodec=qk;exports.getDecompressSettingsAccountInstructionDataDecoder=wa;exports.getDecompressSettingsAccountInstructionDataEncoder=Na;exports.getDisableDomainConfigDiscriminatorBytes=eW;exports.getDisableDomainConfigInstruction=ja;exports.getDisableDomainConfigInstructionDataCodec=tW;exports.getDisableDomainConfigInstructionDataDecoder=Ka;exports.getDisableDomainConfigInstructionDataEncoder=za;exports.getDomainConfigAddress=at;exports.getDomainConfigCodec=QM;exports.getDomainConfigDecoder=cs;exports.getDomainConfigDiscriminatorBytes=XM;exports.getDomainConfigEncoder=ZA;exports.getDomainConfigSize=eh;exports.getEditDomainConfigDiscriminatorBytes=dW;exports.getEditDomainConfigInstruction=Qa;exports.getEditDomainConfigInstructionAsync=AW;exports.getEditDomainConfigInstructionDataCodec=uW;exports.getEditDomainConfigInstructionDataDecoder=Xa;exports.getEditDomainConfigInstructionDataEncoder=vo;exports.getEditMemberArgsCodec=mR;exports.getEditMemberArgsDecoder=hn;exports.getEditMemberArgsEncoder=Mn;exports.getEditTransactionManagerUrlDiscriminatorBytes=SW;exports.getEditTransactionManagerUrlInstruction=oi;exports.getEditTransactionManagerUrlInstructionDataCodec=xW;exports.getEditTransactionManagerUrlInstructionDataDecoder=ni;exports.getEditTransactionManagerUrlInstructionDataEncoder=ri;exports.getEditUserDelegateDiscriminatorBytes=RW;exports.getEditUserDelegateInstruction=ui;exports.getEditUserDelegateInstructionDataCodec=bW;exports.getEditUserDelegateInstructionDataDecoder=di;exports.getEditUserDelegateInstructionDataEncoder=ii;exports.getExpectedSignerCodec=fR;exports.getExpectedSignerDecoder=Mt;exports.getExpectedSignerEncoder=Pt;exports.getExtensionStructCodec=CR;exports.getExtensionStructDecoder=Dt;exports.getExtensionStructEncoder=An;exports.getGlobalCounterAddress=cA;exports.getGlobalCounterCodec=oh;exports.getGlobalCounterDecoder=gs;exports.getGlobalCounterDiscriminatorBytes=nh;exports.getGlobalCounterEncoder=gg;exports.getGlobalCounterSize=ah;exports.getJitoTipsConfig=Ho;exports.getLightCpiSigner=G2;exports.getLightProtocolRpc=Te;exports.getLinkWalletArgsCodec=RR;exports.getLinkWalletArgsDecoder=Gn;exports.getLinkWalletArgsEncoder=Fn;exports.getMemberCodec=UR;exports.getMemberDecoder=It;exports.getMemberEncoder=xt;exports.getMemberKeyCodec=LR;exports.getMemberKeyDecoder=$;exports.getMemberKeyEncoder=V;exports.getMultiWalletErrorMessage=fN;exports.getNativeTransferIntentCompressedDiscriminatorBytes=qW;exports.getNativeTransferIntentCompressedInstruction=xi;exports.getNativeTransferIntentCompressedInstructionDataCodec=JW;exports.getNativeTransferIntentCompressedInstructionDataDecoder=Si;exports.getNativeTransferIntentCompressedInstructionDataEncoder=fi;exports.getNativeTransferIntentDiscriminatorBytes=BW;exports.getNativeTransferIntentInstruction=mi;exports.getNativeTransferIntentInstructionAsync=wW;exports.getNativeTransferIntentInstructionDataCodec=NW;exports.getNativeTransferIntentInstructionDataDecoder=pi;exports.getNativeTransferIntentInstructionDataEncoder=Uo;exports.getNewAuthorityArgsCodec=wR;exports.getNewAuthorityArgsDecoder=qn;exports.getNewAuthorityArgsEncoder=jn;exports.getOriginIndex=kw;exports.getPackedAddressTreeInfoCodec=FR;exports.getPackedAddressTreeInfoDecoder=_t;exports.getPackedAddressTreeInfoEncoder=bt;exports.getPackedMerkleContextCodec=KR;exports.getPackedMerkleContextDecoder=pn;exports.getPackedMerkleContextEncoder=gn;exports.getPackedStateTreeInfoCodec=JR;exports.getPackedStateTreeInfoDecoder=yt;exports.getPackedStateTreeInfoEncoder=lt;exports.getPausableAccountExtensionCodec=XR;exports.getPausableAccountExtensionDecoder=kn;exports.getPausableAccountExtensionEncoder=Un;exports.getPermanentDelegateAccountExtensionCodec=eb;exports.getPermanentDelegateAccountExtensionDecoder=Ln;exports.getPermanentDelegateAccountExtensionEncoder=Wn;exports.getPermissionsCodec=nb;exports.getPermissionsDecoder=Ne;exports.getPermissionsEncoder=Be;exports.getProofArgsCodec=ab;exports.getProofArgsDecoder=M;exports.getProofArgsEncoder=P;exports.getRemoveMemberArgsCodec=Ab;exports.getRemoveMemberArgsDecoder=bn;exports.getRemoveMemberArgsEncoder=Rn;exports.getRentConfigCodec=mb;exports.getRentConfigDecoder=En;exports.getRentConfigEncoder=Cn;exports.getSecp256r1MessageHash=Fo;exports.getSecp256r1PubkeyCodec=Tb;exports.getSecp256r1PubkeyDecoder=vt;exports.getSecp256r1PubkeyEncoder=Zn;exports.getSecp256r1SignatureOffsetsDataDecoder=TM;exports.getSecp256r1SignatureOffsetsDataEncoder=yM;exports.getSecp256r1VerifyArgsCodec=xb;exports.getSecp256r1VerifyArgsDecoder=G;exports.getSecp256r1VerifyArgsEncoder=F;exports.getSecp256r1VerifyArgsWithDomainConfigIndexCodec=Db;exports.getSecp256r1VerifyArgsWithDomainConfigIndexDecoder=Qn;exports.getSecp256r1VerifyArgsWithDomainConfigIndexEncoder=Xn;exports.getSecp256r1VerifyInstruction=H;exports.getSecp256r1VerifyInstructionDataCodec=yH;exports.getSecp256r1VerifyInstructionDataDecoder=TA;exports.getSecp256r1VerifyInstructionDataEncoder=fA;exports.getSendAndConfirmTransaction=Pu;exports.getSettingsCodec=qv;exports.getSettingsDecoder=Tr;exports.getSettingsDiscriminatorBytes=jv;exports.getSettingsEncoder=s1;exports.getSettingsFromIndex=Ce;exports.getSettingsIndexWithAddressAndDelegateInfoCodec=_b;exports.getSettingsIndexWithAddressAndDelegateInfoDecoder=ro;exports.getSettingsIndexWithAddressAndDelegateInfoEncoder=to;exports.getSettingsIndexWithAddressCodec=hb;exports.getSettingsIndexWithAddressDecoder=eo;exports.getSettingsIndexWithAddressEncoder=$n;exports.getSettingsMutArgsCodec=Wb;exports.getSettingsMutArgsDecoder=K;exports.getSettingsMutArgsEncoder=z;exports.getSettingsReadonlyArgsCodec=Nb;exports.getSettingsReadonlyArgsDecoder=kt;exports.getSettingsReadonlyArgsEncoder=Ut;exports.getSignedSecp256r1Key=hw;exports.getSolanaRpc=Z;exports.getSolanaRpcEndpoint=Du;exports.getSplInterfacePdaArgsCodec=Vb;exports.getSplInterfacePdaArgsDecoder=Lt;exports.getSplInterfacePdaArgsEncoder=Wt;exports.getTokenMetadataCodec=Kb;exports.getTokenMetadataDecoder=Bn;exports.getTokenMetadataEncoder=On;exports.getTokenTransferIntentCompressedDiscriminatorBytes=gL;exports.getTokenTransferIntentCompressedInstruction=Wi;exports.getTokenTransferIntentCompressedInstructionAsync=mL;exports.getTokenTransferIntentCompressedInstructionDataCodec=pL;exports.getTokenTransferIntentCompressedInstructionDataDecoder=ki;exports.getTokenTransferIntentCompressedInstructionDataEncoder=Wo;exports.getTokenTransferIntentDiscriminatorBytes=rL;exports.getTokenTransferIntentInstruction=Ri;exports.getTokenTransferIntentInstructionAsync=oL;exports.getTokenTransferIntentInstructionDataCodec=nL;exports.getTokenTransferIntentInstructionDataDecoder=hi;exports.getTokenTransferIntentInstructionDataEncoder=ko;exports.getTransactionBufferAddress=aA;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=vL;exports.getTransactionBufferCloseCompressedInstruction=ji;exports.getTransactionBufferCloseCompressedInstructionDataCodec=UL;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=Ki;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=zi;exports.getTransactionBufferCloseDiscriminatorBytes=CL;exports.getTransactionBufferCloseInstruction=Hi;exports.getTransactionBufferCloseInstructionDataCodec=EL;exports.getTransactionBufferCloseInstructionDataDecoder=wi;exports.getTransactionBufferCloseInstructionDataEncoder=Ni;exports.getTransactionBufferCodec=eU;exports.getTransactionBufferCreateArgsCodec=Yb;exports.getTransactionBufferCreateArgsDecoder=Bt;exports.getTransactionBufferCreateArgsEncoder=Ot;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=YL;exports.getTransactionBufferCreateCompressedInstruction=od;exports.getTransactionBufferCreateCompressedInstructionDataCodec=ZL;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=nd;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=rd;exports.getTransactionBufferCreateDiscriminatorBytes=HL;exports.getTransactionBufferCreateInstruction=Qi;exports.getTransactionBufferCreateInstructionDataCodec=VL;exports.getTransactionBufferCreateInstructionDataDecoder=Xi;exports.getTransactionBufferCreateInstructionDataEncoder=Zi;exports.getTransactionBufferDecoder=vc;exports.getTransactionBufferDiscriminatorBytes=$v;exports.getTransactionBufferEncoder=D1;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=pO;exports.getTransactionBufferExecuteCompressedInstruction=yd;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=mO;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=ld;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=md;exports.getTransactionBufferExecuteDiscriminatorBytes=oO;exports.getTransactionBufferExecuteInstruction=ud;exports.getTransactionBufferExecuteInstructionDataCodec=sO;exports.getTransactionBufferExecuteInstructionDataDecoder=dd;exports.getTransactionBufferExecuteInstructionDataEncoder=id;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=bO;exports.getTransactionBufferExtendCompressedInstruction=Rd;exports.getTransactionBufferExtendCompressedInstructionDataCodec=_O;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=hd;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=Md;exports.getTransactionBufferExtendDiscriminatorBytes=IO;exports.getTransactionBufferExtendInstruction=Cd;exports.getTransactionBufferExtendInstructionDataCodec=CO;exports.getTransactionBufferExtendInstructionDataDecoder=Id;exports.getTransactionBufferExtendInstructionDataEncoder=xd;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=qO;exports.getTransactionBufferVoteCompressedInstruction=Hd;exports.getTransactionBufferVoteCompressedInstructionDataCodec=JO;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=wd;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=Nd;exports.getTransactionBufferVoteDiscriminatorBytes=NO;exports.getTransactionBufferVoteInstruction=Wd;exports.getTransactionBufferVoteInstructionDataCodec=wO;exports.getTransactionBufferVoteInstructionDataDecoder=kd;exports.getTransactionBufferVoteInstructionDataEncoder=Ud;exports.getTransactionExecuteCompressedDiscriminatorBytes=dB;exports.getTransactionExecuteCompressedInstruction=Qd;exports.getTransactionExecuteCompressedInstructionDataCodec=uB;exports.getTransactionExecuteCompressedInstructionDataDecoder=Xd;exports.getTransactionExecuteCompressedInstructionDataEncoder=Zd;exports.getTransactionExecuteDiscriminatorBytes=tB;exports.getTransactionExecuteInstruction=jd;exports.getTransactionExecuteInstructionDataCodec=rB;exports.getTransactionExecuteInstructionDataDecoder=Kd;exports.getTransactionExecuteInstructionDataEncoder=zd;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=hB;exports.getTransactionExecuteSyncCompressedInstruction=uu;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=RB;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=du;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=iu;exports.getTransactionExecuteSyncDiscriminatorBytes=fB;exports.getTransactionExecuteSyncInstruction=ou;exports.getTransactionExecuteSyncInstructionDataCodec=SB;exports.getTransactionExecuteSyncInstructionDataDecoder=nu;exports.getTransactionExecuteSyncInstructionDataEncoder=ru;exports.getTransactionMessageAddressTableLookupCodec=r_;exports.getTransactionMessageAddressTableLookupDecoder=Ao;exports.getTransactionMessageAddressTableLookupEncoder=uo;exports.getTransactionMessageCodec=$b;exports.getTransactionMessageDecoder=wt;exports.getTransactionMessageEncoder=Nt;exports.getTransactionSyncSignersCodec=c_;exports.getTransactionSyncSignersDecoder=Y;exports.getTransactionSyncSignersEncoder=J;exports.getTransferFeeAccountExtensionCodec=A_;exports.getTransferFeeAccountExtensionDecoder=wn;exports.getTransferFeeAccountExtensionEncoder=Nn;exports.getTransferHookAccountExtensionCodec=m_;exports.getTransferHookAccountExtensionDecoder=Vn;exports.getTransferHookAccountExtensionEncoder=Hn;exports.getTransportsCodec=T_;exports.getTransportsDecoder=Vt;exports.getTransportsEncoder=Ht;exports.getUserAccountAddress=w;exports.getUserCodec=I_;exports.getUserCreationArgsCodec=P_;exports.getUserCreationArgsDecoder=Me;exports.getUserCreationArgsEncoder=Pe;exports.getUserDecoder=Q;exports.getUserEncoder=Ft;exports.getUserMutArgsCodec=b_;exports.getUserMutArgsDecoder=Ze;exports.getUserMutArgsEncoder=Ye;exports.getUserReadOnlyArgsCodec=k_;exports.getUserReadOnlyArgsDecoder=Rt;exports.getUserReadOnlyArgsEncoder=ht;exports.getUserReadOnlyOrMutateArgsCodec=B_;exports.getUserReadOnlyOrMutateArgsDecoder=He;exports.getUserReadOnlyOrMutateArgsEncoder=we;exports.getUserRoleCodec=F_;exports.getUserRoleDecoder=ze;exports.getUserRoleEncoder=Ge;exports.getWalletAddressFromIndex=F2;exports.getWalletAddressFromSettings=be;exports.getWhitelistedAddressTreeCodec=sU;exports.getWhitelistedAddressTreeDecoder=Bc;exports.getWhitelistedAddressTreeDiscriminatorBytes=oU;exports.getWhitelistedAddressTreeEncoder=z1;exports.getWhitelistedAddressTreeFromIndex=Yo;exports.getWhitelistedAddressTreeIndexFromAddress=v2;exports.getWhitelistedAddressTreesAddress=tA;exports.identifyMultiWalletAccount=AN;exports.identifyMultiWalletInstruction=gN;exports.initialize=uw;exports.isConfigAction=cR;exports.isExtensionStruct=DR;exports.isMultiWalletError=SN;exports.isTransactionSyncSigners=i_;exports.isUserReadOnlyOrMutateArgs=w_;exports.nativeTransferIntent=jH;exports.parseAddWhitelistedAddressTreesInstruction=MU;exports.parseChangeConfigCompressedInstruction=zU;exports.parseChangeConfigInstruction=LU;exports.parseCreateCompressedWalletInstruction=ek;exports.parseCreateDomainConfigInstruction=uk;exports.parseCreateDomainUserAccountInstruction=xk;exports.parseCreateGlobalCounterInstruction=bk;exports.parseCreateUserAccountsInstruction=wk;exports.parseDecompressSettingsAccountInstruction=Jk;exports.parseDisableDomainConfigInstruction=rW;exports.parseEditDomainConfigInstruction=gW;exports.parseEditTransactionManagerUrlInstruction=IW;exports.parseEditUserDelegateInstruction=_W;exports.parseNativeTransferIntentCompressedInstruction=YW;exports.parseNativeTransferIntentInstruction=HW;exports.parseSecp256r1VerifyInstruction=TH;exports.parseTokenTransferIntentCompressedInstruction=lL;exports.parseTokenTransferIntentInstruction=sL;exports.parseTransactionBufferCloseCompressedInstruction=kL;exports.parseTransactionBufferCloseInstruction=DL;exports.parseTransactionBufferCreateCompressedInstruction=XL;exports.parseTransactionBufferCreateInstruction=FL;exports.parseTransactionBufferExecuteCompressedInstruction=lO;exports.parseTransactionBufferExecuteInstruction=cO;exports.parseTransactionBufferExtendCompressedInstruction=vO;exports.parseTransactionBufferExtendInstruction=EO;exports.parseTransactionBufferVoteCompressedInstruction=YO;exports.parseTransactionBufferVoteInstruction=HO;exports.parseTransactionExecuteCompressedInstruction=AB;exports.parseTransactionExecuteInstruction=nB;exports.parseTransactionExecuteSyncCompressedInstruction=bB;exports.parseTransactionExecuteSyncInstruction=xB;exports.pollJitoBundleConfirmation=$2;exports.prepareChangeConfigArgs=xV;exports.prepareTransactionBundle=RV;exports.prepareTransactionMessage=VV;exports.prepareTransactionSync=jV;exports.retrieveTransactionManager=S8;exports.sendJitoBundle=BP;exports.serializeConfigActions=I8;exports.signAndSendBundledTransactions=Q2;exports.signAndSendTransaction=c8;exports.tokenTransferIntent=d5;exports.transactionSyncSigners=a_;exports.userReadOnlyOrMutateArgs=N_;exports.vaultTransactionMessageDeserialize=xu;exports.vaultTransactionMessageSerialize=Su;exports.voteTransactionBuffer=UA;//# sourceMappingURL=index.cjs.map
|
|
3
|
+
`);throw new Error(t)}return o.value.unitsConsumed}async function Ju(e,n){let o=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===gill.AccountRole.WRITABLE||c.role===gill.AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));o.sort((c,i)=>c-i);let t=Math.floor(o.length/2);return o.length%2===0?Math.round((o[t-1]+o[t])/2):o[t]}async function Yu(e,n){Xt(e,"bundle");for(let t=0;t<e.length;t++)if(e[t].length>1644)throw new _(`Transaction ${t} exceeds maximum length of ${1644} bytes (actual: ${e[t].length} bytes)`);let r=await Ur(()=>fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})}));await jt(r,n);let o=await qt(r);if(!o.result||o.error)throw new ae(`Unable to simulate bundle: ${JSON.stringify(o.error??o.result)}`);if(typeof o.result.value.summary!="string"&&o.result.value.summary.failed){let{TransactionFailure:t}=o.result.value.summary.failed.error,[,c]=t;throw new ae(`Simulation failed: ${c}`)}return o.result.value.transactionResults.map(t=>t.unitsConsumed)}function ie(e,n=0){let r=e instanceof U?e:void 0,o=r?.verifyArgs&&n!==-1?gill.some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,clientAndDeviceHash:r.clientAndDeviceHash}):gill.none(),t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs.clientDataJson?vr(r.authResponse):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:o,signature:c,message:i,publicKey:a}}function We(e,n,r=[]){let o=[];for(let t of e)if(t instanceof U){let c=r.length,{domainConfig:i,verifyArgs:a,signature:s,publicKey:d,message:u}=ie(t,c);if(u&&s&&d&&r.push({message:u,signature:s,publicKey:d}),i){let g=n.addPreAccounts([{address:i,role:gill.AccountRole.READONLY}]).get(i)?.index;a.__option==="Some"&&g!==void 0&&o.push({__kind:"Secp256r1",fields:[{domainConfigIndex:g,verifyArgs:a.value}]});}}else {let c=n.addPreAccounts([{address:t.address,role:gill.AccountRole.READONLY_SIGNER,signer:t}]).get(t.address)?.index;c!==void 0&&o.push({__kind:"Ed25519",fields:[c]});}return {secp256r1VerifyInput:r,transactionSyncSigners:o}}function fe(e){if(e instanceof Ue)return {keyType:Kt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Kt.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function Gu(e){return e instanceof U?e.toString():e.address.toString()}function ue(e){let n=new Set,r=[];for(let t of e)n.has(Gu(t))||(r.push(t),n.add(Gu(t)));let o=r.filter(t=>t instanceof U);if(o.length>1)throw new _(`More than 1 Secp256r1 signers in an instruction is not supported (found ${o.length})`);return r}function Zu({payer:e,tipAmount:n}){let r=wo[Math.floor(Math.random()*wo.length)];return programs.getTransferSolInstruction({source:e,destination:gill.address(r),amount:n})}function Xu(e){return typeof e=="string"?e:e.toString()}function Qu(e){return e.toString()}async function Ko(e,n,r){let o=e?.get(n);if(o)return o;let t=await r();return t&&e&&e.set(n,t),t}var N=class{systemAccounts;nextPreIndex;preMap;nextPackedIndex;packedMap;outputTreeIndex;constructor(){this.systemAccounts=[],this.nextPreIndex=0,this.preMap=new Map,this.nextPackedIndex=0,this.packedMap=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){for(let r of n)this.insertOrGet(r.address.toString(),r,false);return this.preMap}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,r={address:gill.address(n),role:gill.AccountRole.WRITABLE},o=true){let t=o?this.packedMap:this.preMap;if(!t.has(n)){let c=o?this.nextPackedIndex++:this.nextPreIndex++;t.set(n,{index:c,accountMeta:r});}return t.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 Te().getStateTreeInfos(),r=stateless_js.selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let o=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());o.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let s=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(s);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:o.length>0?{packedTreeInfos:o,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(n){return Array.from(n.entries()).sort((o,t)=>o[1].index-t[1].index).map(([,{accountMeta:o}])=>({...o}))}getOffsets(n){let r=n,o=r+this.systemAccounts.length;return [r,o]}toAccountMetas(){let n=this.hashSetAccountsToMetas(this.preMap),r=this.hashSetAccountsToMetas(this.packedMap),[o,t]=this.getOffsets(n.length);return {remainingAccounts:[...n,...this.systemAccounts,...r],systemOffset:o,packedOffset:t}}};async function Lr(e,n){let r=Xu(e);return Ko(n,r,()=>Te().getCompressedAccount(e))}async function $e(e,n){let r=Qu(e);return Ko(n,r,()=>Z().getAccountInfo(e,{encoding:"base64"}).send())}async function de(e,n){let r=(await Promise.all(e.map(o=>Lr(o.address,n)))).filter(o=>o!==null).filter(o=>o.data!==null&&o.address!==null);if(r.length!==e.length)throw new ee("Compressed account",`Expected ${e.length} accounts but found ${r.length}`);return r.map((o,t)=>({...o,type:e[t].type,tree:o.treeInfo.tree,queue:o.treeInfo.queue}))}function W(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 Se(e,n,r,o,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:o[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function re(e,n,r,o,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:o[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let s=e.packTreeInfos(a,[]).stateTrees;if(!s)throw new _("Unable to parse state tree data");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:s.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:s.outputTreeIndex}}))}async function xe(e,n,r,o,t){let c=null,i=null,a=null,s=new N;if(e){await s.addSystemAccounts();let{address:d}=await oe(n,r),u=(await de([{address:d,type:"Settings"}],t))[0];o?a={rootIndices:[0],roots:[],leafIndices:[u.leafIndex],leaves:[],treeInfos:[u.treeInfo],proveByIndices:[u.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:a=await X([u],[]);let g=s.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:u.hash}],[]).stateTrees;if(!g)throw new _("Unable to parse state tree data");let p=q().decode(u.data?.data);c={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0]},data:p},i={accountMeta:{address:new Uint8Array(u.address),treeInfo:g.packedTreeInfos[0],outputStateTreeIndex:g.outputTreeIndex},data:p};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:s,settingsMutArgs:i}}async function X(e,n){return Zt(()=>Te().getValidityProofV0(e,n))}async function Ie(){return (await Or()).length-1}var jo;async function Or(){if(!jo){let{data:e}=await Hc(Z(),await rA());jo=e.whitelistedAddressTrees;}return jo}function tA(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 Jo(e,n,r){let o=await kP(e,n,r);if(!o)throw new ee("User account");return o}async function kP(e,n,r){let{address:o}=await w(e,n),t=await Lr(o,r);return t?.data?.data?Q().decode(t.data.data):null}async function _2(e,{member:n,credentialId:r}){let o=[{memcmp:{offset:1,encoding:"base58",bytes:e}}];if(n)o.push({memcmp:{offset:33,encoding:"base58",bytes:gill.getBase58Decoder().decode(V().encode(fe(n)))}});else if(r)o.push({memcmp:{offset:72,encoding:"base58",bytes:gill.getBase58Decoder().decode(le(r))}});else return null;let t=await Te().getCompressedAccountsByOwner(new web3_js.PublicKey(A.toString()),{filters:o});return t.items.filter(c=>!!c.data).length?t.items.map(c=>Q().decode(c.data?.data))[0]:null}async function Br(e,n,r){let o=await WP(e,n,r);if(!o)throw new ee("Settings account");return o}async function WP(e,n,r){try{let{address:o}=await oe(e,n),t=await Lr(o,r);if(!t?.data?.data)throw new ee("Compressed settings account");let c=q().decode(t.data.data);if(c.data.__option==="None")throw new ee("Compressed settings account");return {...c.data.value,isCompressed:!0}}catch{let o=await po(Z(),e);return o.exists?{...o.data,isCompressed:false}:null}}async function v2(e,n,r){let o=await Jo(e,n,r);if(o.role===1||o.role===0){let t=[],[c,i]=await Promise.all([Te().getCompressedAccountsByOwner(new web3_js.PublicKey(A.toString()),{filters:[{memcmp:{offset:20,encoding:"base58",bytes:gill.getBase58Decoder().decode(V().encode(fe(e)))}}]}),Z().getProgramAccounts(A,{encoding:"base64",filters:[{memcmp:{offset:BigInt(20),encoding:"base64",bytes:gill.getBase64Decoder().decode(V().encode(fe(e)))}}]}).send()]);return c.items.forEach(a=>{if(a.data?.data){let s=q().decode(a.data.data);s.data.__option==="Some"&&t.push({...s.data.value,isCompressed:true});}}),i.forEach(a=>{let s=Tr().decode(gill.getBase64Encoder().encode(a.account.data[0]));t.push({...s,isCompressed:false});}),t}else return await Promise.all(o.wallets.map(async t=>Br(await Ce(t.index),t.settingsAddressTreeIndex,r)))}async function Yo(e){Vu(e,"index");let n=await Or();if(e>=n.length)throw new _(`Address tree index ${e} is out of bounds (max: ${n.length-1})`);return n[e]}async function U2(e){let r=(await Or()).findIndex(o=>o.toString()===e);if(r===-1)throw new ee("Address tree",`Address ${e} not found in whitelist`);return r}async function oe(e,n=0){let r=await Yo(n),o=stateless_js.deriveAddressSeedV2([gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e)]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(o,new web3_js.PublicKey(r),new web3_js.PublicKey(A)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function w(e,n=0){let r=await Yo(n),o=stateless_js.deriveAddressSeedV2([gill.getUtf8Encoder().encode("user"),e instanceof Ue?e.toTruncatedBuffer():gill.getAddressEncoder().encode(e)]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(o,new web3_js.PublicKey(r),new web3_js.PublicKey(A.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function at({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha2_js.sha256(gill.getUtf8Encoder().encode(n));else throw new _("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 aA(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function rA(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function iA(e,n,r){Hu(r,0,255,"buffer_index");let[o]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),n instanceof Ue?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return o}async function be(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return n}async function Ce(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function G2(e){let n=await Ce(e);return await be(n)}async function z2(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}async function $2(e){Xt(e,"bundle");let n=await zo(e,true),r=await Yu(n.map(gill.getBase64EncodedWireTransaction),Pu()),o=await zo(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await NP(o.map(gill.getBase64EncodedWireTransaction))}async function NP(e,n=Ho(),r){Xt(e,"serializedTransactions");let{blockEngineUrl:o}=n,t=`${o}/bundles`,c=await Ur(()=>fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})}),r);await jt(c,t);let i=await qt(c);if(i.error)throw new ae(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);if(!i.result)throw new ae("No bundle ID returned from Jito");return i.result}async function e8(e,n=30,r=3e3,o=Ho()){Fu(e,"bundleId");let{blockEngineUrl:t}=o,c=`${t}/getBundleStatuses`;return Zt(async()=>{let i=await fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});await jt(i,c);let a=await qt(i);if(a.error)throw new ae(`Error getting bundle status: ${JSON.stringify(a.error,null,2)}`,e);if(!a.result?.value?.length)throw new ae("Bundle not yet confirmed",e);let s=a.result.value[0];if(s.confirmation_status==="confirmed"||s.confirmation_status==="finalized"){let d=s.transactions[s.transactions.length-1];if(!d)throw new ae("No transactions in confirmed bundle",e);return d}throw new ae(`Bundle status: ${s.confirmation_status}`,e)},{maxRetries:n,initialDelayMs:r,shouldRetry:wu(ae,me)})}async function a8({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=await Z().getLatestBlockhash().send(),t=await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(e,c),c=>gill.setTransactionMessageFeePayerSigner(n,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(o.value,c),c=>r?gill.compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([qu(c),Ju(Z(),c.instructions.flatMap(d=>d.accounts??[]))]),s=Math.ceil((Number(i)??0)*1.1);return gill.prependTransactionMessageInstructions([...s>2e5?[programs.getSetComputeUnitLimitInstruction({units:s})]:[],...a>0?[programs.getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await gill.signTransactionMessageWithSigners(await c));return await Mu()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}function x8(e,n){if(n.threshold>1)throw new _("Multi-signature transactions with threshold > 1 are not supported yet.");let r=n.members.find(s=>gA(s.pubkey)===e);if(!r)throw new ee("Member",`Signer ${e} not found in settings`);let{permissions:o}=r;if(!o)throw new ee("Permissions","No permissions found for the current member");let t=ve.has(o,Re.InitiateTransaction),c=ve.has(o,Re.VoteTransaction),i=ve.has(o,Re.ExecuteTransaction);if(t&&c&&i)return null;if(!c||!i)throw new Rr("Signer lacks the required Vote/Execute permissions.",["VoteTransaction","ExecuteTransaction"],[c?"VoteTransaction":void 0,i?"ExecuteTransaction":void 0].filter(Boolean));let a=n.members.find(s=>s.role===0);if(!a)throw new ee("Transaction manager","No transaction manager available in wallet");return {transactionManagerAddress:gill.address(gA(a.pubkey)),userAddressTreeIndex:a.userAddressTreeIndex}}function tM(e){let n=new URL(e);return n.protocol==="https:"?n.protocol="wss:":n.protocol==="http:"&&(n.protocol="ws:"),n.toString()}function rM(e,n){return new Promise((r,o)=>{let t=new WebSocket(e),c=()=>{try{t.close();}catch{}};n.addEventListener("abort",c,{once:true}),t.onopen=()=>{n.removeEventListener("abort",c),r(t);},t.onerror=()=>{n.removeEventListener("abort",c),o(new Error("WebSocket connection failed"));};})}async function nM(e,n,r){return new Promise((o,t)=>{let c=false,i=()=>{n.removeEventListener("abort",s),e.removeEventListener("message",d),e.removeEventListener("error",u),e.removeEventListener("close",g);},a=p=>{c||(c=true,i(),p());},s=()=>{try{e.close();}catch{}};n.addEventListener("abort",s);let d=p=>{if(typeof p.data!="string")return;let f;try{f=JSON.parse(p.data);}catch{return}let S=typeof f.event=="string"?f.event:"message",C=f.data;try{r(S,C)&&a(()=>o());}catch(x){a(()=>t(x));}},u=()=>{a(()=>t(new me("Transaction manager request failed",0,e.url)));},g=()=>{a(()=>o());};e.addEventListener("message",d),e.addEventListener("error",u),e.addEventListener("close",g);})}function Zo(e="Aborted"){let n=new Error(e);return n.name="AbortError",n}var oM=(e,n)=>new Promise((r,o)=>{if(n.aborted)return o(Zo());let t=setTimeout(r,e);n.addEventListener("abort",()=>{clearTimeout(t),o(Zo());},{once:true});});function I8(e){let{address:n,url:r,authResponses:o,transactionMessageBytes:t,onPendingApprovalsCallback:c,onPendingApprovalsSuccess:i,abortController:a,opts:s}=e,d=a??new AbortController,u=s?.maxAttempts??10,g=s?.retryDelayMs??400;return {address:n,async signTransactions(p){let{signal:f}=d,S=tM(r),C=JSON.stringify({publicKey:n.toString(),payload:p.map(x=>({transaction:gill.getBase64Decoder().decode(gill.getTransactionEncoder().encode(x)),transactionMessageBytes:t?gill.getBase64Decoder().decode(t):void 0,authResponses:o}))});for(let x=0;x<u;x++){if(f.aborted)throw Zo();let D,E;try{E=await rM(S,f),E.send(C),await nM(E,f,(I,v)=>{if(I==="error"){let k=v&&typeof v=="object"&&typeof v.error=="string"?v.error:"Unknown error",j=new Error(k);throw j.noRetry=!0,j}return I==="signatures"?(D=v.signatures,!0):(I==="pending_transaction_approval"?c?.(v.validTill):I==="transaction_approved"&&i?.(),!1)});}catch(I){if(I&&typeof I=="object"&&I.noRetry)throw new me(`${I.message}`);if(I&&typeof I=="object"&&I.name==="AbortError")throw I}finally{try{E?.close();}catch{}}if(D?.length)return D.map(I=>({[n]:gill.getBase58Encoder().encode(I)}));x<u-1&&await oM(g,f);}throw new me("Transaction manager: missing signatures")}}}function gA(e){return e.keyType===Kt.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}function C8(e){let n=e.map(c=>Ve().encode(c)),r=4+n.reduce((c,i)=>c+i.length,0),o=new Uint8Array(r),t=0;o.set(gill.getU32Encoder().encode(e.length),t),t+=4;for(let c of n)o.set(c,t),t+=c.length;return o}function E8(e){let n=0,[r,o]=gill.getU32Decoder().read(e,n);n=o;let t=new Array(r);for(let c=0;c<r;c++){let i=Fe().read(e,n);t[c]=i[0],n=i[1];}if(n!==e.length)throw new _(`Trailing bytes detected: expected ${e.length} bytes but consumed ${n}`);return t}async function w8({payer:e,rpId:n,origins:r,authority:o}){let t=await at({rpId:n}),c=new N;await c.addSystemAccounts();let i=await Ie(),{address:a,addressTree:s}=await w(o.address,i),d=[{address:a,tree:s,queue:s,type:"User"}],u=await X([],d),g=(await Se(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:p,systemOffset:f}=c.toAccountMetas(),S=W(u,f);return await Ca({origins:r,authorityCreationArgs:g,authority:o,compressedProofArgs:S,payer:e,domainConfig:t,rpId:n,remainingAccounts:p})}async function Z8({authority:e,payer:n,createUserArgs:r,domainConfig:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[];r.settings&&(r.transactionManager&&i.push({address:(await w(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}),i.push({address:(await oe(r.settings,r.settingsAddressTreeIndex)).address,type:"Settings"}));let a=i.length?await de(i,t):[],s=await Ie(),{address:d,addressTree:u}=await w(r.member,s),g=[{address:d,type:"User",tree:u,queue:u}],p=await X(a,g),f=null,S=null,C=a.filter(k=>k.type==="Settings"),x=a.filter(k=>k.type==="User");if(x.length&&(S=re(c,p.treeInfos.slice(0,1),p.leafIndices.slice(0,1),p.rootIndices.slice(0,1),p.proveByIndices.slice(0,1),x,Q())[0]),C.length){let k=x.length,j=k+1;f=re(c,p.treeInfos.slice(k,j),p.leafIndices.slice(k,j),p.rootIndices.slice(k,j),p.proveByIndices.slice(k,j),C,q())[0];}let D=(await Se(c,p.treeInfos.slice(a.length),p.roots.slice(a.length),p.rootIndices.slice(a.length),g))[0],{remainingAccounts:E,systemOffset:I}=c.toAccountMetas(),v=W(p,I);return await ha({payer:n,authority:e,compressedProofArgs:v,member:vt().decode(r.member.toBuffer()),credentialId:le(r.credentialId),transports:r.transports,role:r.role,linkWalletArgs:f?gill.some({settingsMutArgs:f,transactionManager:S?gill.some(S):gill.none()}):gill.none(),userAccountCreationArgs:D,domainConfig:o,remainingAccounts:E})}async function eH({payer:e}){let n=await aA();return va({payer:e,globalCounter:n})}async function oH({admin:e,rpId:n,disable:r}){let o=await at({rpId:n});return qa({domainConfig:o,admin:e,disable:r,remainingAccounts:[]})}function cM(e,n,r,o){let t=aM(e,n),c=iM(e,n)&&r!==o;return t&&c?gill.AccountRole.WRITABLE_SIGNER:t&&!c?gill.AccountRole.WRITABLE:!t&&c?gill.AccountRole.READONLY_SIGNER:gill.AccountRole.READONLY}function aM(e,n){let r=e.staticAccounts.length,{numSignerAccounts:o,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=o-t,a=r-o-c;return n>=r?false:n<i?true:n>=o?n-o<a:false}function iM(e,n){return n<e.header.numSignerAccounts}async function Nr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:o}){let t=Iu(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await gill.fetchAddressesForLookupTables(t.addressTableLookups.map(a=>a.lookupTableAddress),Z()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:gill.AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,s]of t.staticAccounts.entries())i.push({address:s,role:cM(t,a,s,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let s=c[a.lookupTableAddress];if(!s)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:gill.AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=s[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:gill.AccountRole.READONLY});}}for(let a of o?.filter(s=>s.address!==e)??[]){let s=i.findIndex(d=>d.address===a.address);s===-1?i.push({address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}):i[s].role===gill.AccountRole.READONLY||i[s].role===gill.AccountRole.READONLY_SIGNER?i[s]={address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}:(i[s].role===gill.AccountRole.WRITABLE||i[s].role===gill.AccountRole.WRITABLE_SIGNER)&&(i[s]={address:a.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}var dt=33,ut=64,es=14,lM=2,yM=gill.address("Secp256r1SigVerify1111111111111111111111111");function TM(){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 fM(){return gill.getStructDecoder([["signatureOffset",gill.getU16Decoder()],["signatureInstructionIndex",gill.getU16Decoder()],["publicKeyOffset",gill.getU16Decoder()],["publicKeyInstructionIndex",gill.getU16Decoder()],["messageDataOffset",gill.getU16Decoder()],["messageDataSize",gill.getU16Decoder()],["messageInstructionIndex",gill.getU16Decoder()]])}function fA(){return gill.createDecoder({read:(e,n=0)=>{let r=gill.getU8Decoder().decode(e,n);n+=1;let o=gill.getU8Decoder().decode(e,n);n+=1;let t=[],c=fM();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=es;let i=[];for(let a=0;a<r;a++){let s=gill.fixDecoderSize(gill.getBytesDecoder(),dt).decode(e,n);n+=dt;let d=gill.fixDecoderSize(gill.getBytesDecoder(),ut).decode(e,n);n+=ut;let u=t[a].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:s,signature:d,message:g});}return [{numSignatures:r,padding:o,offsets:t,payload:i},n]}})}function SA(){return gill.createEncoder({getSizeFromValue:e=>{let n=es*e.offsets.length,r=e.payload.reduce((o,t)=>o+dt+ut+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=gill.getU8Encoder().write(e.numSignatures,n,r),r=gill.getU8Encoder().write(e.padding,n,r);let o=TM();for(let t of e.offsets)r=o.write(t,n,r);for(let t of e.payload)r=gill.fixEncoderSize(gill.getBytesEncoder(),dt).write(t.publicKey,n,r),r=gill.fixEncoderSize(gill.getBytesEncoder(),ut).write(t.signature,n,r),r=gill.getBytesEncoder().write(t.message,n,r);return r}})}function TH(){return gill.combineCodec(SA(),fA())}function H(e,n){let r=e.length,o=lM+r*es,t=[];for(let s=0;s<r;s++){let{message:d}=e[s],u=o,g=u+dt,p=g+ut;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:p,messageDataSize:d.length,messageInstructionIndex:65535}),o+=dt+ut+d.length;}let c=n?.programAddress??yM,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:SA().encode(i)}}function fH(e){return {programAddress:e.programAddress,accounts:{},data:fA().decode(e.data)}}async function xA({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:o,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:s=false}){let d=await be(e),{accountMetas:u,addressLookupTableAccounts:g}=await Nr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),p=[];return c.length>0&&p.push(H(c)),p.push(s?$d({transactionBuffer:n,payer:o.address,remainingAccounts:u,settingsKey:e}):qd({transactionBuffer:n,payer:o.address,settings:e})),a&&p.push(Zu({payer:o,tipAmount:a})),{instructions:p,addressLookupTableAccounts:g}}async function IA({settings:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,additionalSigners:o,signers:t,payer:c,addressesByLookupTableAddress:i,secp256r1VerifyInput:a=[],compressed:s=false,simulateProof:d=false,cachedAccounts:u}){let g=ue(t),p=await be(e),[{accountMetas:f,addressLookupTableAccounts:S,transactionMessage:C},{settingsMutArgs:x,proof:D,packedAccounts:E}]=await Promise.all([Nr({transactionMessageBytes:r,walletAddress:p,additionalSigners:o,addressesByLookupTableAddress:i}),xe(s,e,n,d,u)]);E.addPreAccounts(f);let{secp256r1VerifyInput:I,transactionSyncSigners:v}=We(g,E,a),{remainingAccounts:k,systemOffset:j}=E.toAccountMetas(),se=[];I.length>0&&se.push(H(I));let Ee=SM(C,f);if(s){if(!c||!x)throw new _("Payer not found or proof args are missing for executeTransactionSync.");let De=W(D,j);se.push(Au({signers:v,transactionMessage:Ee,settingsMutArgs:x,compressedProofArgs:De,payer:c,remainingAccounts:k}));}else se.push(su({signers:v,settings:e,transactionMessage:Ee,remainingAccounts:k}));return {instructions:se,addressLookupTableAccounts:S}}function SM(e,n){if(e.version==="legacy")throw new _("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:r.data??[]})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(o=>o.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function qH({settings:e,settingsAddressTreeIndex:n,destination:r,signers:o,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let s=ue(o),d=await be(e),[{packedAccounts:u,proof:g,settingsMutArgs:p},{value:f}]=await Promise.all([xe(a,e,n,false,t),$e(d,t)]);if((f?.lamports??0)<BigInt(c))throw new _("Insufficient balance for native transfer.");let{secp256r1VerifyInput:S,transactionSyncSigners:C}=We(s,u),{remainingAccounts:x,systemOffset:D}=u.toAccountMetas(),E=[];if(S.length>0&&E.push(H(S)),a){if(!i||!p)throw new Error("Payer not found or proof args is missing.");let I=W(g,D);E.push(Ii({amount:c,settingsMutArgs:p,compressedProofArgs:I,payer:i,signers:C,source:d,destination:r,remainingAccounts:x}));}else E.push(li({amount:c,signers:C,source:d,destination:r,settings:e,remainingAccounts:x}));return E}var RM=gill.address("ACXg8a7VaqecBWrSbdu73W4Pg9gsqXJ3EXAqkHyhvVXg"),bM=gill.address("r18WwUxfG8kQ69bQPAB2jV6zGNKy3GosFGctjQoV4ti"),Hr=gill.address("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");async function u5({settings:e,settingsAddressTreeIndex:n,destination:r,mint:o,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:s,splInterfacePdaArgs:d={index:0,restricted:false},compressed:u=false,useDestinationSplAccount:g=false}){let p=ue(t),f=await be(e),S=await _M(o,r,f,s,d),[C,x]=await Promise.all([vM(S,c),wM(u,e,n,c)]),D=UM(C,S,i,g),[E,I]=await Promise.all([NM(f,o,D.splBalance,D.cTokenBalance,BigInt(i),u),BM(D.requireSplInterface,S.splInterfacePda,c)]),v=BigInt(E.reduce((Oe,os)=>Oe+(os.parsed.amount.toNumber()??0),0));if(D.splBalance+D.cTokenBalance+v<BigInt(i))throw new _("Insufficient balance for token transfer.");let k=new N;I&&k.addPreAccounts([{address:o,role:gill.AccountRole.WRITABLE}]);let j=kM(E,x),{proof:se,settingsMutArgs:Ee}=await WM(k,j,x),De=LM(E,se,k),{secp256r1VerifyInput:nt,transactionSyncSigners:Le}=We(p,k),{remainingAccounts:ge,systemOffset:ot}=k.toAccountMetas(),zr=W(se,ot),T=[];nt.length>0&&T.push(H(nt));let er=OM({amount:i,transactionSyncSigners:Le,walletAddress:f,destination:r,addresses:S,balances:D,mint:o,tokenProgram:s,remainingAccounts:ge,payer:a,sourceCompressedTokenAccounts:De,compressedProofArgs:zr,splInterfacePdaArgs:d});if(u){if(!Ee)throw new Error("Payer not found or proof args is missing.");T.push(Li({...er,settingsMutArgs:Ee}));}else T.push(bi({...er,settings:e}));return T}async function _M(e,n,r,o,t){let c=p=>gill.getProgramDerivedAddress({seeds:[gill.getAddressEncoder().encode(p),gill.getAddressEncoder().encode(Hr),gill.getAddressEncoder().encode(e)],programAddress:Hr}),i=[gill.getUtf8Encoder().encode("pool"),gill.getAddressEncoder().encode(e)];t.restricted&&i.push(gill.getUtf8Encoder().encode("restricted")),t.index>0&&i.push(gill.getU8Encoder().encode(t.index));let[a,[s],d,[u],[g]]=await Promise.all([programs.getAssociatedTokenAccountAddress(e,r,o),c(r),programs.getAssociatedTokenAccountAddress(e,n,o),c(n),gill.getProgramDerivedAddress({seeds:i,programAddress:Hr})]);return {sourceSplAta:a,sourceCtokenAta:s,destinationSplAta:d,destinationCTokenAta:u,splInterfacePda:g}}async function vM(e,n){let[r,o,t]=await Promise.all([$e(e.destinationSplAta,n),$e(e.sourceSplAta,n),$e(e.sourceCtokenAta,n)]);return {destinationSplAtaInfo:r,sourceSplAtaInfo:o,sourceCTokenAtaInfo:t}}function UM(e,n,r,o){let t=!!e.destinationSplAtaInfo.value,c=!!e.sourceSplAtaInfo.value,i=!!e.sourceCTokenAtaInfo.value,a=c?programs.getTokenDecoder().decode(gill.getBase64Encoder().encode(e.sourceSplAtaInfo.value.data[0])).amount:BigInt(0),s=BigInt(i?HM(gill.getBase64Encoder().encode(e.sourceCTokenAtaInfo.value.data[0]))?.amount??0:0),d=t||o?n.destinationSplAta:void 0,u=t||o?void 0:n.destinationCTokenAta,g=c&&(a+s<BigInt(r)||s>BigInt(0)||!t)||!c&&t;return {splBalance:a,cTokenBalance:s,destinationSplTokenAccount:d,destinationCtokenTokenAccount:u,requireSplInterface:g,requireRentSponsor:a+s<BigInt(r)||!t}}function kM(e,n){let r=[];return e.forEach(o=>r.push({hash:o.compressedAccount.hash,tree:o.compressedAccount.treeInfo.tree,queue:o.compressedAccount.treeInfo.queue,data:o.compressedAccount.data,address:o.compressedAccount.address})),n&&r.push(n),r}async function WM(e,n,r){let o=null,t=null;return n.length===0?{proof:t,settingsMutArgs:o}:(await e.addSystemAccounts(),t=await X(n,[]),r&&(o=re(e,t.treeInfos.slice(-1),t.leafIndices.slice(-1),t.rootIndices.slice(-1),t.proveByIndices.slice(-1),n.slice(-1),q())[0]),{proof:t,settingsMutArgs:o})}function LM(e,n,r){return !n||!e.length?[]:e.map(o=>({amount:o.parsed.amount.toNumber(),merkleContext:{leafIndex:o.compressedAccount.leafIndex,merkleTreePubkeyIndex:r.insertOrGet(o.compressedAccount.treeInfo.tree.toString()),queuePubkeyIndex:r.insertOrGet(o.compressedAccount.treeInfo.queue.toString()),proveByIndex:o.compressedAccount.proveByIndex},rootIndex:n.rootIndices[0],version:tA(o.compressedAccount.data?.discriminator),tlv:o.parsed.tlv?gill.some(gill.getArrayDecoder(Dt()).decode(o.parsed.tlv)):gill.none(),state:o.parsed.state}))}function OM({amount:e,transactionSyncSigners:n,walletAddress:r,destination:o,addresses:t,balances:c,mint:i,tokenProgram:a,remainingAccounts:s,payer:d,sourceCompressedTokenAccounts:u,compressedProofArgs:g,splInterfacePdaArgs:p}){return {amount:e,signers:n,source:r,destination:o,sourceCtokenTokenAccount:t.sourceCtokenAta,sourceSplTokenAccount:t.sourceSplAta,destinationCtokenTokenAccount:c.destinationCtokenTokenAccount,destinationSplTokenAccount:c.destinationSplTokenAccount,mint:i,tokenProgram:a,remainingAccounts:s,payer:d,sourceCompressedTokenAccounts:u,compressedProofArgs:g,compressibleConfig:RM,splInterfacePda:c.requireSplInterface?t.splInterfacePda:void 0,rentSponsor:c.requireRentSponsor?bM:void 0,splInterfacePdaArgs:c.requireSplInterface?gill.some(p):gill.none()}}async function BM(e,n,r){if(!e)return false;let{value:o}=await $e(n,r);return !o}async function NM(e,n,r,o,t,c){let i=t-r-o;if(i<=0)return [];let s=(await Te().getCompressedTokenAccountsByOwner(new web3_js.PublicKey(e),{mint:new web3_js.PublicKey(n)})).items.filter(u=>!!u.compressedAccount.data?.data.length&&u.compressedAccount.owner.toString()===Hr.toString()&&!u.parsed.amount.isZero());return s.length===0?[]:compressedToken.selectMinCompressedTokenAccountsForDecompression(s,new CM__default.default(i),c?3:4,{treeType:stateless_js.TreeType.StateV2}).selectedAccounts}async function wM(e,n,r,o){if(!e)return null;let{address:t}=await oe(n,r);return (await de([{address:t,type:"Settings"}],o))[0]??null}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 C5({signers:e,payer:n,changeConfigArgs:r}){let{settings:o,configActions:t,compressed:c,packedAccounts:i,proof:a,settingsMutArgs:s}=r,d=ue(e),u=[],g=[];for(let x of d)if(x instanceof U){let D=g.length,{domainConfig:E,verifyArgs:I,signature:v,publicKey:k,message:j}=ie(x,D);if(j&&v&&k&&g.push({message:j,signature:v,publicKey:k}),E){let se=i.addPreAccounts([{address:E,role:gill.AccountRole.READONLY}]).get(E)?.index;I.__option==="Some"&&se!==void 0&&u.push({__kind:"Secp256r1",fields:[{domainConfigIndex:se,verifyArgs:I.value}]});}}else {let D=i.addPreAccounts([{address:x.address,role:gill.AccountRole.READONLY_SIGNER,signer:x}]).get(x.address)?.index;D!==void 0&&u.push({__kind:"Ed25519",fields:[D]});}let{remainingAccounts:p,systemOffset:f}=i.toAccountMetas(),S=W(a,f),C=[];if(g.length>0&&C.push(H(g)),c){if(!s)throw new _("Proof args are missing for compressed changeConfig.");C.push(aa({configActions:t,payer:n,compressedProofArgs:S,settingsMutArgs:s,remainingAccounts:p,signers:u}));}else C.push($c({settings:o,configActions:t,payer:n,compressedProofArgs:S,remainingAccounts:p,signers:u}));return C}async function b5({createUserArgs:e,payer:n}){let r=new N;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:u.member})));let o=await Ie(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:p}=await w(u.member.address,o);return {address:g,tree:p,queue:p,type:"User"}})),c=await X([],t),i=await Se(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:s}=r.toAccountMetas(),d=W(c,s);return await La({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:i[g],transactionManagerUrl:u.role===0?u.transactionManagerUrl:null})),remainingAccounts:a})}async function O5({index:e,payer:n,initialMember:r,userAddressTreeIndex:o,cachedAccounts:t}){let c=new N;await c.addSystemAccounts();let i=[],a=[];a.push(...await de([{address:(await w(r.address,o)).address,type:"User"}],t));let s=await Ie(),{address:d,addressTree:u}=await oe(await Ce(e),s);i.push({address:d,queue:u,tree:u,type:"Settings"});let g=a.length,p=await X(a,i),f=re(c,p.treeInfos.slice(0,g),p.leafIndices.slice(0,g),p.rootIndices.slice(0,g),p.proveByIndices.slice(0,g),a.filter(I=>I.type==="User"),Q())[0],C=(await Se(c,p.treeInfos.slice(g),p.roots.slice(g),p.rootIndices.slice(g),i)).find(I=>I.type==="Settings")??null,{remainingAccounts:x,systemOffset:D}=c.toAccountMetas(),E=W(p,D);if(!C)throw new Error("Settings creation args is missing.");return await ga({settingsIndex:e,payer:n,initialMember:r,userArgs:f.data.role===3?{__kind:"Mutate",fields:[f]}:{__kind:"Read",fields:[f]},compressedProofArgs:E,...C,remainingAccounts:x})}async function j5({settings:e,settingsAddressTreeIndex:n,payer:r,signers:o,cachedAccounts:t}){let{packedAccounts:c,proof:i,settingsMutArgs:a}=await xe(true,e,n,false,t);if(!a)throw new _("Proof args are missing for settings account.");let s=ue(o),{secp256r1VerifyInput:d,transactionSyncSigners:u}=We(s,c),{remainingAccounts:g,systemOffset:p}=c.toAccountMetas(),f=W(i,p),S=[];return d.length>0&&S.push(H(d)),S.push(Va({settings:e,payer:r,settingsMutArgs:a,compressedProofArgs:f,signers:u,remainingAccounts:g})),S}async function $5({authority:e,domainConfig:n,newAuthority:r,newOrigins:o}){let t=null,c=[];if(r){let i=new N;await i.addSystemAccounts();let a=await Ie(),{address:s,addressTree:d}=await w(r.address,a),u=[{address:s,tree:d,queue:d,type:"User"}],g=await X([],u),p=(await Se(i,g.treeInfos,g.roots,g.rootIndices,u))[0],f=i.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:W(g,f.systemOffset),authorityCreationArgs:p};}return $a({domainConfig:n,authority:e,newOrigins:o?gill.some(o):gill.none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function s6({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let o=new N;await o.addSystemAccounts();let t=await de([{address:(await w(e.address,n)).address,type:"User"}]),c=await X(t,[]),i=re(o,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,Q())[0],{remainingAccounts:a,systemOffset:s}=o.toAccountMetas(),d=W(c,s);return si({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function l6({payer:e,user:n,userAddressTreeIndex:r,newDelegate:o,cachedAccounts:t=new Map}){let{domainConfig:c,verifyArgs:i,message:a,signature:s,publicKey:d}=ie(n),u=[];a&&s&&d&&u.push({message:a,signature:s,publicKey:d});let g=await Jo(n instanceof U?n:n.address,r,t),p=[];p.push({address:(await w(n instanceof U?n:n.address,r)).address,type:"User"});let f,S=null,C,x=null,D=g.wallets.find(ge=>ge.isDelegate);if(D){let ge=await Ce(D.index);(await Br(ge,D.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await oe(ge,D.settingsAddressTreeIndex)).address,type:"Settings"}),S={start:p.length-1,end:p.length}):f=await Ce(D.index);}if(o){let ge=await Ce(o.index);(await Br(ge,o.settingsAddressTreeIndex,t)).isCompressed?(p.push({address:(await oe(ge,o.settingsAddressTreeIndex)).address,type:"Settings"}),x={start:p.length-1,end:p.length}):C=await Ce(o.index);}let E=new N;await E.addSystemAccounts();let I=await de(p,t),v=await X(I,[]),k=re(E,v.treeInfos.slice(0,1),v.leafIndices.slice(0,1),v.rootIndices.slice(0,1),v.proveByIndices.slice(0,1),I.slice(0,1),Q())[0],j=S?gill.some(re(E,v.treeInfos.slice(S.start,S.end),v.leafIndices.slice(S.start,S.end),v.rootIndices.slice(S.start,S.end),v.proveByIndices.slice(S.start,S.end),I.slice(S.start,S.end),q())[0]):gill.none(),se=x?gill.some(re(E,v.treeInfos.slice(x.start,x.end),v.leafIndices.slice(x.start,x.end),v.rootIndices.slice(x.start,x.end),v.proveByIndices.slice(x.start,x.end),I.slice(x.start,x.end),q())[0]):gill.none(),{remainingAccounts:Ee,systemOffset:De}=E.toAccountMetas(),nt=W(v,De),Le=[];return u.length>0&&Le.push(H(u)),Le.push(Ai({secp256r1VerifyArgs:i,domainConfig:c,delegateTo:o?gill.some(o):gill.none(),feePayer:e,signer:n instanceof U?void 0:n,oldSettings:f,oldSettingsMutArgs:j,newSettings:C,newSettingsMutArgs:se,compressedProofArgs:nt,userMutArgs:k,remainingAccounts:Ee})),Le}async function U6({settingsAddressTreeIndex:e,closer:n,transactionBufferAddress:r,payer:o,compressed:t=false,cachedAccounts:c}){let i=await Wc(Z(),r),a=i.data.multiWalletSettings,{packedAccounts:s,proof:d,settingsMutArgs:u}=await xe(t,a,e,false,c),{remainingAccounts:g,systemOffset:p}=s.toAccountMetas(),{domainConfig:f,verifyArgs:S,message:C,signature:x,publicKey:D}=ie(n),E=[];if(C&&x&&D&&E.push(H([{message:C,signature:x,publicKey:D}])),t){if(!o||!u)throw new _("Payer not found or proof args are missing for closing buffer.");let I=W(d,p);E.push(qi({transactionBuffer:r,domainConfig:f,closer:n instanceof U?void 0:n,rentCollector:i.data.payer,secp256r1VerifyArgs:S,settingsMutArgs:u,payer:o,compressedProofArgs:I,remainingAccounts:g}));}else E.push(Vi({transactionBuffer:r,domainConfig:f,closer:n instanceof U?void 0:n,settings:a,payer:i.data.payer,secp256r1VerifyArgs:S,remainingAccounts:[]}));return E}function _A({payer:e,creator:n,bufferIndex:r,settings:o,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:s,compressedArgs:d,expectedSigners:u}){let{domainConfig:g,verifyArgs:p,message:f,signature:S,publicKey:C}=ie(n),x=[];if(f&&S&&C&&x.push(H([{message:f,signature:S,publicKey:C}])),d){let{settingsReadonlyArgs:D,compressedProofArgs:E,remainingAccounts:I}=d;x.push(sd({transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof U?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},settingsReadonlyArgs:D,compressedProofArgs:E,remainingAccounts:I}));}else x.push($i({settings:o,transactionBuffer:t,payer:e,secp256r1VerifyArgs:p,creator:n instanceof U?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:s,preauthorizeExecution:a,expectedSigners:u},remainingAccounts:[]}));return x}function vA({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:s}=ie(e),d=[];return a&&i&&s&&d.push(H([{message:a,signature:i,publicKey:s}])),o?d.push(Td({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof U?void 0:e,settingsMutArgs:o.settingsMutArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(Ad({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof U?void 0:e,remainingAccounts:[]})),d}function UA({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:o=false}){return o?bd({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Ed({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function kA({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:o}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:s}=ie(n),d=[];return s&&i&&a&&d.push(H([{message:s,signature:i,publicKey:a}])),o?d.push(Vd({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof U?void 0:n,settingsReadonlyArgs:o.settingsReadonlyArgs,payer:o.payer,compressedProofArgs:o.compressedProofArgs,remainingAccounts:o.remainingAccounts})):d.push(Ld({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof U?void 0:n,remainingAccounts:[]})),d}async function IV({settings:e,settingsAddressTreeIndex:n,configActionsArgs:r,cachedAccounts:o,compressed:t=false}){let c=await zM(r),i=new N,a=null,s=null,d=[];if(c.length||t){let g=await KM({packedAccounts:i,userAccounts:c,compressed:t,settings:e,settingsAddressTreeIndex:n,cachedAccounts:o});a=g.proof,s=g.settingsMutArgs??null,d=g.userMutArgs??[];}return {configActions:await jM({configActionsArgs:r,userMutArgs:d}),settings:e,proof:a,settingsMutArgs:s,packedAccounts:i,compressed:t}}async function zM(e){let n=[];for(let r of e)switch(r.type){case "AddMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}case "RemoveMembers":{let o=await Promise.all(r.members.map(t=>w(t.member,t.userAddressTreeIndex)));for(let t of o)n.push({address:t.address,type:"User"});break}}return n}async function KM({packedAccounts:e,userAccounts:n,compressed:r,settings:o,settingsAddressTreeIndex:t,cachedAccounts:c}){await e.addSystemAccounts();let i=[];if(r){let f=(await oe(o,t)).address;i.push({address:f,type:"Settings"});}n.length&&i.push(...n);let a=i.length?await de(i,c):[];if(!a.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let s=await X(a,[]),d=[],u=[];for(let f of a)f.type==="Settings"?d.push(f):f.type==="User"&&u.push(f);let g,p=[];if(r&&s&&(g=re(e,s.treeInfos.slice(0,1),s.leafIndices.slice(0,1),s.rootIndices.slice(0,1),s.proveByIndices.slice(0,1),d,q())[0]),u.length&&s){let f=r?1:0;p=re(e,s.treeInfos.slice(f),s.leafIndices.slice(f),s.rootIndices.slice(f),s.proveByIndices.slice(f),u,Q());}return {proof:s,settingsMutArgs:g,userMutArgs:p}}async function jM({configActionsArgs:e,userMutArgs:n}){let r=[];for(let o of e)switch(o.type){case "AddMembers":{let t=[];for(let c of o.members){let i=await w(c.member,c.userAddressTreeIndex).then(a=>n.find(s=>utils_js.equalBytes(s.accountMeta.address,gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(a.address)))));if(!i)throw new Error("Unable to find user account");t.push(YM({permissionArgs:c.permissions,userMutArgs:i,pubkey:c.member}));}r.push({__kind:o.type,fields:[t]});break}case "RemoveMembers":{let t=await Promise.all(o.members.map(c=>w(c.member,c.userAddressTreeIndex).then(i=>{let a=n.find(s=>utils_js.equalBytes(s.accountMeta.address,gill.getBase58Encoder().encode(stateless_js.encodeBN254toBase58(i.address))));if(!a)throw new Error("Unable to find user account");return JM({pubkey:c.member,userMutArgs:a})})));r.push({__kind:o.type,fields:[t]});break}case "EditPermissions":{let t=o.members.map(c=>qM({permissionArgs:c.permissions,pubkey:c.member}));r.push({__kind:o.type,fields:[t]});break}default:r.push({__kind:o.type,fields:[o.threshold]});}return r}function qM({pubkey:e,permissionArgs:n}){return {memberKey:fe(e),permissions:BA(n)}}function JM({pubkey:e,userMutArgs:n}){let r=n.data.role;if(r===2)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:fe(e),userArgs:r===3?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function YM({pubkey:e,permissionArgs:n,userMutArgs:r}){if(r.data.role===2)throw new Error("A permanent member can only belong to one wallet.");if(r.data.role===0&&(n.execute||n.vote))throw new Error("Transaction Manager can only have initiate permission");return {memberKey:fe(e),permissions:BA(n),userArgs:r.data.role===3?{__kind:"Mutate",fields:[r]}:{__kind:"Read",fields:[r]}}}function BA(e){let n=[];return e.initiate&&n.push(Re.InitiateTransaction),e.vote&&n.push(Re.VoteTransaction),e.execute&&n.push(Re.ExecuteTransaction),ve.fromPermissions(n)}async function bV({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s,compressed:d=false,additionalVoters:u=[],additionalSigners:g=[],chunkSize:p=Math.ceil(o.length/2),cachedAccounts:f}){let S=Math.floor(Math.random()*255),C=await iA(n,t instanceof U?t:t.address,S),x=[],D=[];for(let te=0;te<o.length;te+=p){let ss=o.subarray(te,te+p);x.push(ss),D.push(sha2_js.sha256(ss));}let E=sha2_js.sha256(o),{settingsReadonlyArgs:I,settingsMutArgs:v,proof:k,packedAccounts:j}=await xe(d,n,r,false,f),{remainingAccounts:se,systemOffset:Ee}=j.toAccountMetas(),De=k&&I&&v?{settingsReadonlyArgs:I,settingsMutArgs:v,compressedProofArgs:W(k,Ee),remainingAccounts:se,payer:e}:null,nt=ue([t,...c?[c]:[],...u]).map(te=>({memberKey:fe(te),messageHash:te instanceof U?Fo(te.authResponse):null})),Le=_A({finalBufferHash:E,finalBufferSize:o.length,bufferIndex:S,payer:e,transactionBufferAddress:C,settings:n,creator:t,preauthorizeExecution:!c,bufferExtendHashes:D,compressedArgs:De,expectedSigners:nt}),ge=x.map(te=>UA({transactionMessageBytes:te,transactionBufferAddress:C,settings:n,compressed:d})),ot=u.map(te=>kA({voter:te,transactionBufferAddress:C,settings:n,compressedArgs:De})),zr=vA({compressedArgs:De,settings:n,executor:c,transactionBufferAddress:C}),{instructions:T,addressLookupTableAccounts:er}=await xA({compressed:d,settings:n,transactionMessageBytes:o,transactionBufferAddress:C,payer:e,additionalSigners:g,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:s}),Oe=te=>({payer:e,instructions:te,addressesByLookupTableAddress:er});return [Oe(Le),...ge.map(te=>Oe([te])),...ot.length?[Oe(ot.flat())]:[],Oe(zr),Oe(T)]}var Fr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let o=new Map,t=i=>{let a=o.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},o.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let s=t(a.address);s.isSigner||=a.role===gill.AccountRole.READONLY_SIGNER||a.role===gill.AccountRole.WRITABLE_SIGNER,s.isWritable||=a.role===gill.AccountRole.WRITABLE||a.role===gill.AccountRole.WRITABLE_SIGNER;}}return new e(r,o)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,d])=>d.isSigner&&d.isWritable),o=n.filter(([,d])=>d.isSigner&&!d.isWritable),t=n.filter(([,d])=>!d.isSigner&&d.isWritable),c=n.filter(([,d])=>!d.isSigner&&!d.isWritable),i={numSignerAccounts:r.length+o.length,numReadonlySignerAccounts:o.length,numReadonlyNonSignerAccounts:c.length};if(r.length===0)throw new Error("Expected at least one writable signer key");let[a]=r[0];if(a!==this.payer)throw new Error("Expected first writable signer key to be the fee payer");let s=[...r.map(([d])=>d),...o.map(([d])=>d),...t.map(([d])=>d),...c.map(([d])=>d)];return [i,s]}extractTableLookup(n){let[r,o]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:o,readonly:c}}}drainKeysFoundInLookupTable(n,r){let o=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,s=n.findIndex(d=>d===a);if(s>=0){if(s>=256)throw new Error("Max lookup table index exceeded");o.push(s),t.push(a),this.keyMetaMap.delete(c);}}return [o,t]}};var Gr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let o=new Map;this.keySegments().flat().forEach((c,i)=>{o.set(c,i);});let t=c=>{let i=o.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function wA({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:o}){let t=Fr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(o??{});for(let p of a){let f=t.extractTableLookup(p);if(f!==void 0){let{addressTableLookup:S,drainedKeys:C}=f;c.push({readonlyIndexes:S.readonlyIndexes,readableIndices:S.readonlyIndexes,writableIndexes:S.writableIndexes,writableIndices:S.writableIndexes,lookupTableAddress:gill.address(S.lookupTableAddress)}),i.writable.push(...C.writable),i.readonly.push(...C.readonly);}}let[s,d]=t.getMessageComponents(),g=new Gr(d,i).compileInstructions(r);return {version:0,header:s,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function FV({instructions:e,payer:n,addressesByLookupTableAddress:r}){let o=wA({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return new Uint8Array(xu(o))}async function qV({payer:e,settings:n,settingsAddressTreeIndex:r,transactionMessageBytes:o,signers:t,additionalSigners:c,secp256r1VerifyInput:i,addressesByLookupTableAddress:a,cachedAccounts:s,compressed:d=false,simulateProof:u=false}){let{instructions:g,addressLookupTableAccounts:p}=await IA({settings:n,settingsAddressTreeIndex:r,payer:e,signers:t,additionalSigners:c,transactionMessageBytes:o,secp256r1VerifyInput:i,compressed:d,addressesByLookupTableAddress:a,simulateProof:u,cachedAccounts:s});return {payer:e,instructions:g,addressesByLookupTableAddress:p}}exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=Gc;exports.AccountState=Kr;exports.AdditionalSignersSchema=HD;exports.AuthenticationContextSchema=yu;exports.BaseResponseSchema=Tu;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=oa;exports.CHANGE_CONFIG_DISCRIMINATOR=Zc;exports.CREATE_COMPRESSED_WALLET_DISCRIMINATOR=ua;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=xa;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=Pa;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=ba;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=ka;exports.CompleteMessageRequestSchema=wN;exports.CompleteSendTransactionRequestSchema=VN;exports.CompleteTransactionRequestSchema=HN;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=Na;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=za;exports.DOMAIN_CONFIG_DISCRIMINATOR=cs;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=Xa;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=ri;exports.EDIT_USER_DELEGATE_DISCRIMINATOR=ii;exports.GLOBAL_COUNTER_DISCRIMINATOR=gs;exports.KeyType=Kt;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=OE;exports.MULTI_WALLET_ERROR__CLIENT_DATA_HASH_MISMATCH=gE;exports.MULTI_WALLET_ERROR__CLOCK_SYSVAR_ACCESS_FAILED=RD;exports.MULTI_WALLET_ERROR__CREDENTIAL_ID_IS_MISSING=rD;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=oD;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=sD;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_KEY_MISMATCH=MD;exports.MULTI_WALLET_ERROR__DUPLICATE_ADDRESS_TREE=BD;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=lE;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=mE;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=ME;exports.MULTI_WALLET_ERROR__EMPTY_SLOT_NUMBERS=AD;exports.MULTI_WALLET_ERROR__EXPECTED_ADMINISTRATOR_ROLE_MISMATCH=EE;exports.MULTI_WALLET_ERROR__EXPECTED_MESSAGE_HASH_MISMATCH=pE;exports.MULTI_WALLET_ERROR__EXPECTED_TRANSACTION_MANAGER_ROLE_MISMATCH=IE;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=KE;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=jE;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=qE;exports.MULTI_WALLET_ERROR__HASH_COMPUTATION_FAILED=uD;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=wE;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=BE;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=NE;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=vE;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT_INDEX=PD;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=iD;exports.MULTI_WALLET_ERROR__INVALID_ADMINISTRATOR_CONFIG=DE;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=kE;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=zE;exports.MULTI_WALLET_ERROR__INVALID_MEMBER_KEY_FORMAT=gD;exports.MULTI_WALLET_ERROR__INVALID_NON_DELEGATED_SIGNERS=HE;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=_E;exports.MULTI_WALLET_ERROR__INVALID_PERMANENT_MEMBER_CONFIG=fE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_INSTRUCTION=cE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_PUBLIC_KEY=dE;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=sE;exports.MULTI_WALLET_ERROR__INVALID_SIGNATURE_OFFSETS=iE;exports.MULTI_WALLET_ERROR__INVALID_SLOT_NUMBER=tD;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=$E;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=RE;exports.MULTI_WALLET_ERROR__INVALID_TOKEN_SOURCE_TYPE=CD;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_CONFIG=CE;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MANAGER_PERMISSION=xE;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=bE;exports.MULTI_WALLET_ERROR__INVALID_USER_ED25519_CONFIG=vD;exports.MULTI_WALLET_ERROR__INVALID_USER_ROLE=UE;exports.MULTI_WALLET_ERROR__INVALID_USER_TRANSACTION_MANAGER_CONFIG=_D;exports.MULTI_WALLET_ERROR__LIGHT_CPI_ACCOUNT_ERROR=ID;exports.MULTI_WALLET_ERROR__MALFORMED_SIGNED_MESSAGE=uE;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=XE;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=cD;exports.MULTI_WALLET_ERROR__MEMBER_NOT_FOUND=lD;exports.MULTI_WALLET_ERROR__MEMBER_NOT_FOUND_IN_SETTINGS=DD;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=WE;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_PROOF_ARGS=pD;exports.MULTI_WALLET_ERROR__MISSING_COMPRESSED_TOKEN_ACCOUNT=fD;exports.MULTI_WALLET_ERROR__MISSING_DESTINATION_TOKEN_ACCOUNT=UD;exports.MULTI_WALLET_ERROR__MISSING_INSTRUCTIONS_SYSVAR=xD;exports.MULTI_WALLET_ERROR__MISSING_LIGHT_CPI_ACCOUNTS=mD;exports.MULTI_WALLET_ERROR__MISSING_MUTATION_USER_ARGS=LE;exports.MULTI_WALLET_ERROR__MISSING_NEW_AUTHORITY=LD;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_ACCOUNT_FOR_DELEGATE=WD;exports.MULTI_WALLET_ERROR__MISSING_SETTINGS_DATA=dD;exports.MULTI_WALLET_ERROR__MISSING_SOURCE_TOKEN_ACCOUNT=kD;exports.MULTI_WALLET_ERROR__MISSING_SPL_INTERFACE_PDA=SD;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=QE;exports.MULTI_WALLET_ERROR__MISSING_USER_ACCOUNT_ADDRESS=hD;exports.MULTI_WALLET_ERROR__MISSING_WHITELISTED_ADDRESS_TREES=OD;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=FE;exports.MULTI_WALLET_ERROR__ONLY_ONE_ADMINISTRATOR_ALLOWED=PE;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=TE;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=SE;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=aD;exports.MULTI_WALLET_ERROR__PAYER_MISMATCH=TD;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=yE;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=ZE;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=AE;exports.MULTI_WALLET_ERROR__SETTINGS_KEY_MISMATCH=yD;exports.MULTI_WALLET_ERROR__SIGNATURE_INDEX_OUT_OF_BOUNDS=aE;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=eD;exports.MULTI_WALLET_ERROR__SOURCE_ACCOUNT_MISMATCH=ED;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=hE;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=JE;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=YE;exports.MULTI_WALLET_ERROR__TRANSPORTS_IS_MISSING=nD;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=GE;exports.MULTI_WALLET_ERROR__UNAUTHORIZED_ADMIN_ONLY=bD;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=VE;exports.MULTI_WALLET_PROGRAM_ADDRESS=A;exports.MultiWalletAccount=rE;exports.MultiWalletInstruction=nE;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=fi;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=pi;exports.Permission=Re;exports.Permissions=ve;exports.SETTINGS_DISCRIMINATOR=Pc;exports.Secp256r1Key=Ue;exports.SignedSecp256r1Key=U;exports.StartMessageRequestSchema=mu;exports.StartTransactionRequestSchema=lu;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=ki;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=hi;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=zi;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=Ni;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=rd;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=Zi;exports.TRANSACTION_BUFFER_DISCRIMINATOR=vc;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=md;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=id;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=Md;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=xd;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=Nd;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=Ud;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=Zd;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=zd;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=iu;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=ru;exports.TransactionActionTypeSchema=pu;exports.TransactionDetailsSchema=VD;exports.TransactionPayloadSchema=NN;exports.TransactionPayloadWithBase64MessageBytesSchema=wD;exports.Transports=go;exports.UserInfoSchema=ND;exports.UserRole=_e;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=Bc;exports.addWhitelistedAddressTrees=vN;exports.base64URLStringToBuffer=le;exports.bufferToBase64URLString=kw;exports.changeConfig=C5;exports.closeTransactionBuffer=U6;exports.configAction=cR;exports.convertBase64StringToJWK=Ow;exports.convertJWKToBase64String=Lw;exports.convertMemberKeyToString=gA;exports.convertPubkeyCompressedToCose=hw;exports.convertPubkeyCoseToCompressed=Mw;exports.createClientAuthorizationCompleteRequestChallenge=_w;exports.createClientAuthorizationStartRequestChallenge=bw;exports.createDomainConfig=w8;exports.createDomainUserAccounts=Z8;exports.createGlobalCounter=eH;exports.createMessageChallenge=vw;exports.createTransactionBuffer=_A;exports.createTransactionChallenge=Uw;exports.createTransactionManagerSigner=I8;exports.createUserAccounts=b5;exports.createWallet=O5;exports.decodeDomainConfig=is;exports.decodeGlobalCounter=ms;exports.decodeSettings=Mc;exports.decodeTransactionBuffer=kc;exports.decodeWhitelistedAddressTree=wc;exports.decompressSettingsAccount=j5;exports.deserializeConfigActions=E8;exports.disableDomainConfig=oH;exports.editDomainConfig=$5;exports.editTransactionManagerUrl=s6;exports.editUserDelegate=l6;exports.executeTransaction=xA;exports.executeTransactionBuffer=vA;exports.executeTransactionSync=IA;exports.extendTransactionBuffer=UA;exports.extensionStruct=DR;exports.fetchAllDomainConfig=eh;exports.fetchAllGlobalCounter=ah;exports.fetchAllMaybeDomainConfig=$A;exports.fetchAllMaybeGlobalCounter=lg;exports.fetchAllMaybeSettings=a1;exports.fetchAllMaybeTransactionBuffer=h1;exports.fetchAllMaybeWhitelistedAddressTree=q1;exports.fetchAllSettings=Zv;exports.fetchAllSettingsAccountByMember=v2;exports.fetchAllTransactionBuffer=rU;exports.fetchAllWhitelistedAddressTree=aU;exports.fetchDomainConfig=ds;exports.fetchGlobalCounter=ch;exports.fetchMaybeDomainConfig=QA;exports.fetchMaybeGlobalCounter=mg;exports.fetchMaybeSettings=po;exports.fetchMaybeSettingsAccountData=WP;exports.fetchMaybeTransactionBuffer=M1;exports.fetchMaybeUserAccountData=kP;exports.fetchMaybeWhitelistedAddressTree=j1;exports.fetchSettings=Yv;exports.fetchSettingsAccountData=Br;exports.fetchTransactionBuffer=Wc;exports.fetchUserAccountByFilters=_2;exports.fetchUserAccountData=Jo;exports.fetchWhitelistedAddressTree=Hc;exports.getAccountStateCodec=Ah;exports.getAccountStateDecoder=qr;exports.getAccountStateEncoder=jr;exports.getAddMemberArgsCodec=fh;exports.getAddMemberArgsDecoder=Xr;exports.getAddMemberArgsEncoder=Zr;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=DU;exports.getAddWhitelistedAddressTreesInstruction=MU;exports.getAddWhitelistedAddressTreesInstructionAsync=Kc;exports.getAddWhitelistedAddressTreesInstructionDataCodec=PU;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=zc;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=Io;exports.getAdditionalMetadataCodec=mh;exports.getAdditionalMetadataDecoder=Yr;exports.getAdditionalMetadataEncoder=Jr;exports.getChangeConfigCompressedDiscriminatorBytes=GU;exports.getChangeConfigCompressedInstruction=aa;exports.getChangeConfigCompressedInstructionDataCodec=zU;exports.getChangeConfigCompressedInstructionDataDecoder=ca;exports.getChangeConfigCompressedInstructionDataEncoder=sa;exports.getChangeConfigDiscriminatorBytes=WU;exports.getChangeConfigInstruction=$c;exports.getChangeConfigInstructionDataCodec=LU;exports.getChangeConfigInstructionDataDecoder=Qc;exports.getChangeConfigInstructionDataEncoder=Xc;exports.getClientAndDeviceHash=Vo;exports.getCompiledInstructionCodec=Ih;exports.getCompiledInstructionDecoder=$r;exports.getCompiledInstructionEncoder=Qr;exports.getCompressedAccountMetaCodec=Ph;exports.getCompressedAccountMetaDecoder=mt;exports.getCompressedAccountMetaEncoder=pt;exports.getCompressedAccountMetaReadOnlyCodec=bh;exports.getCompressedAccountMetaReadOnlyDecoder=ft;exports.getCompressedAccountMetaReadOnlyEncoder=Tt;exports.getCompressedOnlyExtensionCodec=Uh;exports.getCompressedOnlyExtensionDecoder=tn;exports.getCompressedOnlyExtensionEncoder=en;exports.getCompressedProofCodec=Lh;exports.getCompressedProofDecoder=an;exports.getCompressedProofEncoder=cn;exports.getCompressedSettingsAddress=oe;exports.getCompressedSettingsCodec=wh;exports.getCompressedSettingsDataCodec=Gh;exports.getCompressedSettingsDataDecoder=un;exports.getCompressedSettingsDataEncoder=dn;exports.getCompressedSettingsDecoder=q;exports.getCompressedSettingsEncoder=St;exports.getCompressedTokenArgsCodec=qh;exports.getCompressedTokenArgsDecoder=Et;exports.getCompressedTokenArgsEncoder=Ct;exports.getCompressibleExtensionCodec=Xh;exports.getCompressibleExtensionDecoder=Tn;exports.getCompressibleExtensionEncoder=yn;exports.getCompressionInfoCodec=tR;exports.getCompressionInfoDecoder=Sn;exports.getCompressionInfoEncoder=fn;exports.getConfigActionCodec=sR;exports.getConfigActionDecoder=Fe;exports.getConfigActionEncoder=Ve;exports.getCreateCompressedWalletDiscriminatorBytes=QU;exports.getCreateCompressedWalletInstruction=ek;exports.getCreateCompressedWalletInstructionAsync=ga;exports.getCreateCompressedWalletInstructionDataCodec=$U;exports.getCreateCompressedWalletInstructionDataDecoder=Aa;exports.getCreateCompressedWalletInstructionDataEncoder=Co;exports.getCreateDomainConfigDiscriminatorBytes=ik;exports.getCreateDomainConfigInstruction=uk;exports.getCreateDomainConfigInstructionAsync=Ca;exports.getCreateDomainConfigInstructionDataCodec=dk;exports.getCreateDomainConfigInstructionDataDecoder=Ia;exports.getCreateDomainConfigInstructionDataEncoder=Do;exports.getCreateDomainUserAccountDiscriminatorBytes=fk;exports.getCreateDomainUserAccountInstruction=xk;exports.getCreateDomainUserAccountInstructionAsync=ha;exports.getCreateDomainUserAccountInstructionDataCodec=Sk;exports.getCreateDomainUserAccountInstructionDataDecoder=Ma;exports.getCreateDomainUserAccountInstructionDataEncoder=Po;exports.getCreateGlobalCounterDiscriminatorBytes=hk;exports.getCreateGlobalCounterInstruction=bk;exports.getCreateGlobalCounterInstructionAsync=va;exports.getCreateGlobalCounterInstructionDataCodec=Rk;exports.getCreateGlobalCounterInstructionDataDecoder=_a;exports.getCreateGlobalCounterInstructionDataEncoder=ho;exports.getCreateUserAccountArgsCodec=AR;exports.getCreateUserAccountArgsDecoder=vn;exports.getCreateUserAccountArgsEncoder=_n;exports.getCreateUserAccountsDiscriminatorBytes=Bk;exports.getCreateUserAccountsInstruction=wk;exports.getCreateUserAccountsInstructionAsync=La;exports.getCreateUserAccountsInstructionDataCodec=Nk;exports.getCreateUserAccountsInstructionDataDecoder=Wa;exports.getCreateUserAccountsInstructionDataEncoder=bo;exports.getDecompressSettingsAccountDiscriminatorBytes=qk;exports.getDecompressSettingsAccountInstruction=Va;exports.getDecompressSettingsAccountInstructionDataCodec=Jk;exports.getDecompressSettingsAccountInstructionDataDecoder=Ha;exports.getDecompressSettingsAccountInstructionDataEncoder=wa;exports.getDisableDomainConfigDiscriminatorBytes=tW;exports.getDisableDomainConfigInstruction=qa;exports.getDisableDomainConfigInstructionDataCodec=rW;exports.getDisableDomainConfigInstructionDataDecoder=ja;exports.getDisableDomainConfigInstructionDataEncoder=Ka;exports.getDomainConfigAddress=at;exports.getDomainConfigCodec=$M;exports.getDomainConfigDecoder=as;exports.getDomainConfigDiscriminatorBytes=QM;exports.getDomainConfigEncoder=XA;exports.getDomainConfigSize=th;exports.getEditDomainConfigDiscriminatorBytes=uW;exports.getEditDomainConfigInstruction=$a;exports.getEditDomainConfigInstructionAsync=gW;exports.getEditDomainConfigInstructionDataCodec=AW;exports.getEditDomainConfigInstructionDataDecoder=Qa;exports.getEditDomainConfigInstructionDataEncoder=vo;exports.getEditMemberArgsCodec=lR;exports.getEditMemberArgsDecoder=hn;exports.getEditMemberArgsEncoder=Mn;exports.getEditTransactionManagerUrlDiscriminatorBytes=xW;exports.getEditTransactionManagerUrlInstruction=si;exports.getEditTransactionManagerUrlInstructionDataCodec=IW;exports.getEditTransactionManagerUrlInstructionDataDecoder=oi;exports.getEditTransactionManagerUrlInstructionDataEncoder=ni;exports.getEditUserDelegateDiscriminatorBytes=bW;exports.getEditUserDelegateInstruction=Ai;exports.getEditUserDelegateInstructionDataCodec=_W;exports.getEditUserDelegateInstructionDataDecoder=ui;exports.getEditUserDelegateInstructionDataEncoder=di;exports.getExpectedSignerCodec=SR;exports.getExpectedSignerDecoder=Mt;exports.getExpectedSignerEncoder=Pt;exports.getExtensionStructCodec=ER;exports.getExtensionStructDecoder=Dt;exports.getExtensionStructEncoder=An;exports.getGlobalCounterAddress=aA;exports.getGlobalCounterCodec=sh;exports.getGlobalCounterDecoder=ps;exports.getGlobalCounterDiscriminatorBytes=oh;exports.getGlobalCounterEncoder=pg;exports.getGlobalCounterSize=ih;exports.getJitoTipsConfig=Ho;exports.getLightCpiSigner=z2;exports.getLightProtocolRpc=Te;exports.getLinkWalletArgsCodec=bR;exports.getLinkWalletArgsDecoder=Gn;exports.getLinkWalletArgsEncoder=Fn;exports.getMemberCodec=kR;exports.getMemberDecoder=It;exports.getMemberEncoder=xt;exports.getMemberKeyCodec=OR;exports.getMemberKeyDecoder=$;exports.getMemberKeyEncoder=V;exports.getMultiWalletErrorMessage=SN;exports.getNativeTransferIntentCompressedDiscriminatorBytes=JW;exports.getNativeTransferIntentCompressedInstruction=Ii;exports.getNativeTransferIntentCompressedInstructionDataCodec=YW;exports.getNativeTransferIntentCompressedInstructionDataDecoder=xi;exports.getNativeTransferIntentCompressedInstructionDataEncoder=Si;exports.getNativeTransferIntentDiscriminatorBytes=NW;exports.getNativeTransferIntentInstruction=li;exports.getNativeTransferIntentInstructionAsync=HW;exports.getNativeTransferIntentInstructionDataCodec=wW;exports.getNativeTransferIntentInstructionDataDecoder=mi;exports.getNativeTransferIntentInstructionDataEncoder=Uo;exports.getNewAuthorityArgsCodec=HR;exports.getNewAuthorityArgsDecoder=qn;exports.getNewAuthorityArgsEncoder=jn;exports.getOriginIndex=Ww;exports.getPackedAddressTreeInfoCodec=GR;exports.getPackedAddressTreeInfoDecoder=_t;exports.getPackedAddressTreeInfoEncoder=bt;exports.getPackedMerkleContextCodec=jR;exports.getPackedMerkleContextDecoder=pn;exports.getPackedMerkleContextEncoder=gn;exports.getPackedStateTreeInfoCodec=YR;exports.getPackedStateTreeInfoDecoder=yt;exports.getPackedStateTreeInfoEncoder=lt;exports.getPausableAccountExtensionCodec=QR;exports.getPausableAccountExtensionDecoder=kn;exports.getPausableAccountExtensionEncoder=Un;exports.getPermanentDelegateAccountExtensionCodec=tb;exports.getPermanentDelegateAccountExtensionDecoder=Ln;exports.getPermanentDelegateAccountExtensionEncoder=Wn;exports.getPermissionsCodec=ob;exports.getPermissionsDecoder=Ne;exports.getPermissionsEncoder=Be;exports.getProofArgsCodec=ib;exports.getProofArgsDecoder=M;exports.getProofArgsEncoder=P;exports.getRemoveMemberArgsCodec=gb;exports.getRemoveMemberArgsDecoder=bn;exports.getRemoveMemberArgsEncoder=Rn;exports.getRentConfigCodec=lb;exports.getRentConfigDecoder=En;exports.getRentConfigEncoder=Cn;exports.getSecp256r1MessageHash=Fo;exports.getSecp256r1PubkeyCodec=fb;exports.getSecp256r1PubkeyDecoder=vt;exports.getSecp256r1PubkeyEncoder=Zn;exports.getSecp256r1SignatureOffsetsDataDecoder=fM;exports.getSecp256r1SignatureOffsetsDataEncoder=TM;exports.getSecp256r1VerifyArgsCodec=Ib;exports.getSecp256r1VerifyArgsDecoder=G;exports.getSecp256r1VerifyArgsEncoder=F;exports.getSecp256r1VerifyArgsWithDomainConfigIndexCodec=Pb;exports.getSecp256r1VerifyArgsWithDomainConfigIndexDecoder=Qn;exports.getSecp256r1VerifyArgsWithDomainConfigIndexEncoder=Xn;exports.getSecp256r1VerifyInstruction=H;exports.getSecp256r1VerifyInstructionDataCodec=TH;exports.getSecp256r1VerifyInstructionDataDecoder=fA;exports.getSecp256r1VerifyInstructionDataEncoder=SA;exports.getSendAndConfirmTransaction=Mu;exports.getSettingsCodec=Jv;exports.getSettingsDecoder=Tr;exports.getSettingsDiscriminatorBytes=qv;exports.getSettingsEncoder=c1;exports.getSettingsFromIndex=Ce;exports.getSettingsIndexWithAddressAndDelegateInfoCodec=vb;exports.getSettingsIndexWithAddressAndDelegateInfoDecoder=ro;exports.getSettingsIndexWithAddressAndDelegateInfoEncoder=to;exports.getSettingsIndexWithAddressCodec=Rb;exports.getSettingsIndexWithAddressDecoder=eo;exports.getSettingsIndexWithAddressEncoder=$n;exports.getSettingsMutArgsCodec=Lb;exports.getSettingsMutArgsDecoder=K;exports.getSettingsMutArgsEncoder=z;exports.getSettingsReadonlyArgsCodec=wb;exports.getSettingsReadonlyArgsDecoder=kt;exports.getSettingsReadonlyArgsEncoder=Ut;exports.getSignedSecp256r1Key=Rw;exports.getSolanaRpc=Z;exports.getSolanaRpcEndpoint=Pu;exports.getSplInterfacePdaArgsCodec=Fb;exports.getSplInterfacePdaArgsDecoder=Lt;exports.getSplInterfacePdaArgsEncoder=Wt;exports.getTokenMetadataCodec=jb;exports.getTokenMetadataDecoder=Bn;exports.getTokenMetadataEncoder=On;exports.getTokenTransferIntentCompressedDiscriminatorBytes=pL;exports.getTokenTransferIntentCompressedInstruction=Li;exports.getTokenTransferIntentCompressedInstructionAsync=lL;exports.getTokenTransferIntentCompressedInstructionDataCodec=mL;exports.getTokenTransferIntentCompressedInstructionDataDecoder=Wi;exports.getTokenTransferIntentCompressedInstructionDataEncoder=Wo;exports.getTokenTransferIntentDiscriminatorBytes=nL;exports.getTokenTransferIntentInstruction=bi;exports.getTokenTransferIntentInstructionAsync=sL;exports.getTokenTransferIntentInstructionDataCodec=oL;exports.getTokenTransferIntentInstructionDataDecoder=Ri;exports.getTokenTransferIntentInstructionDataEncoder=ko;exports.getTransactionBufferAddress=iA;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=UL;exports.getTransactionBufferCloseCompressedInstruction=qi;exports.getTransactionBufferCloseCompressedInstructionDataCodec=kL;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=ji;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=Ki;exports.getTransactionBufferCloseDiscriminatorBytes=EL;exports.getTransactionBufferCloseInstruction=Vi;exports.getTransactionBufferCloseInstructionDataCodec=DL;exports.getTransactionBufferCloseInstructionDataDecoder=Hi;exports.getTransactionBufferCloseInstructionDataEncoder=wi;exports.getTransactionBufferCodec=tU;exports.getTransactionBufferCreateArgsCodec=Zb;exports.getTransactionBufferCreateArgsDecoder=Bt;exports.getTransactionBufferCreateArgsEncoder=Ot;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=ZL;exports.getTransactionBufferCreateCompressedInstruction=sd;exports.getTransactionBufferCreateCompressedInstructionDataCodec=XL;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=od;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=nd;exports.getTransactionBufferCreateDiscriminatorBytes=VL;exports.getTransactionBufferCreateInstruction=$i;exports.getTransactionBufferCreateInstructionDataCodec=FL;exports.getTransactionBufferCreateInstructionDataDecoder=Qi;exports.getTransactionBufferCreateInstructionDataEncoder=Xi;exports.getTransactionBufferDecoder=Uc;exports.getTransactionBufferDiscriminatorBytes=eU;exports.getTransactionBufferEncoder=P1;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=mO;exports.getTransactionBufferExecuteCompressedInstruction=Td;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=lO;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=yd;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=ld;exports.getTransactionBufferExecuteDiscriminatorBytes=sO;exports.getTransactionBufferExecuteInstruction=Ad;exports.getTransactionBufferExecuteInstructionDataCodec=cO;exports.getTransactionBufferExecuteInstructionDataDecoder=ud;exports.getTransactionBufferExecuteInstructionDataEncoder=dd;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=_O;exports.getTransactionBufferExtendCompressedInstruction=bd;exports.getTransactionBufferExtendCompressedInstructionDataCodec=vO;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=Rd;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=hd;exports.getTransactionBufferExtendDiscriminatorBytes=CO;exports.getTransactionBufferExtendInstruction=Ed;exports.getTransactionBufferExtendInstructionDataCodec=EO;exports.getTransactionBufferExtendInstructionDataDecoder=Cd;exports.getTransactionBufferExtendInstructionDataEncoder=Id;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=JO;exports.getTransactionBufferVoteCompressedInstruction=Vd;exports.getTransactionBufferVoteCompressedInstructionDataCodec=YO;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=Hd;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=wd;exports.getTransactionBufferVoteDiscriminatorBytes=wO;exports.getTransactionBufferVoteInstruction=Ld;exports.getTransactionBufferVoteInstructionDataCodec=HO;exports.getTransactionBufferVoteInstructionDataDecoder=Wd;exports.getTransactionBufferVoteInstructionDataEncoder=kd;exports.getTransactionExecuteCompressedDiscriminatorBytes=uB;exports.getTransactionExecuteCompressedInstruction=$d;exports.getTransactionExecuteCompressedInstructionDataCodec=AB;exports.getTransactionExecuteCompressedInstructionDataDecoder=Qd;exports.getTransactionExecuteCompressedInstructionDataEncoder=Xd;exports.getTransactionExecuteDiscriminatorBytes=rB;exports.getTransactionExecuteInstruction=qd;exports.getTransactionExecuteInstructionDataCodec=nB;exports.getTransactionExecuteInstructionDataDecoder=jd;exports.getTransactionExecuteInstructionDataEncoder=Kd;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=RB;exports.getTransactionExecuteSyncCompressedInstruction=Au;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=bB;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=uu;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=du;exports.getTransactionExecuteSyncDiscriminatorBytes=SB;exports.getTransactionExecuteSyncInstruction=su;exports.getTransactionExecuteSyncInstructionDataCodec=xB;exports.getTransactionExecuteSyncInstructionDataDecoder=ou;exports.getTransactionExecuteSyncInstructionDataEncoder=nu;exports.getTransactionMessageAddressTableLookupCodec=n_;exports.getTransactionMessageAddressTableLookupDecoder=Ao;exports.getTransactionMessageAddressTableLookupEncoder=uo;exports.getTransactionMessageCodec=e_;exports.getTransactionMessageDecoder=wt;exports.getTransactionMessageEncoder=Nt;exports.getTransactionSyncSignersCodec=a_;exports.getTransactionSyncSignersDecoder=Y;exports.getTransactionSyncSignersEncoder=J;exports.getTransferFeeAccountExtensionCodec=g_;exports.getTransferFeeAccountExtensionDecoder=wn;exports.getTransferFeeAccountExtensionEncoder=Nn;exports.getTransferHookAccountExtensionCodec=l_;exports.getTransferHookAccountExtensionDecoder=Vn;exports.getTransferHookAccountExtensionEncoder=Hn;exports.getTransportsCodec=f_;exports.getTransportsDecoder=Vt;exports.getTransportsEncoder=Ht;exports.getUserAccountAddress=w;exports.getUserCodec=C_;exports.getUserCreationArgsCodec=M_;exports.getUserCreationArgsDecoder=Me;exports.getUserCreationArgsEncoder=Pe;exports.getUserDecoder=Q;exports.getUserEncoder=Ft;exports.getUserMutArgsCodec=__;exports.getUserMutArgsDecoder=Ze;exports.getUserMutArgsEncoder=Ye;exports.getUserReadOnlyArgsCodec=W_;exports.getUserReadOnlyArgsDecoder=Rt;exports.getUserReadOnlyArgsEncoder=ht;exports.getUserReadOnlyOrMutateArgsCodec=N_;exports.getUserReadOnlyOrMutateArgsDecoder=He;exports.getUserReadOnlyOrMutateArgsEncoder=we;exports.getUserRoleCodec=G_;exports.getUserRoleDecoder=ze;exports.getUserRoleEncoder=Ge;exports.getWalletAddressFromIndex=G2;exports.getWalletAddressFromSettings=be;exports.getWhitelistedAddressTreeCodec=cU;exports.getWhitelistedAddressTreeDecoder=Nc;exports.getWhitelistedAddressTreeDiscriminatorBytes=sU;exports.getWhitelistedAddressTreeEncoder=K1;exports.getWhitelistedAddressTreeFromIndex=Yo;exports.getWhitelistedAddressTreeIndexFromAddress=U2;exports.getWhitelistedAddressTreesAddress=rA;exports.identifyMultiWalletAccount=gN;exports.identifyMultiWalletInstruction=pN;exports.initialize=Aw;exports.isConfigAction=aR;exports.isExtensionStruct=PR;exports.isMultiWalletError=xN;exports.isTransactionSyncSigners=d_;exports.isUserReadOnlyOrMutateArgs=H_;exports.nativeTransferIntent=qH;exports.parseAddWhitelistedAddressTreesInstruction=hU;exports.parseChangeConfigCompressedInstruction=KU;exports.parseChangeConfigInstruction=OU;exports.parseCreateCompressedWalletInstruction=tk;exports.parseCreateDomainConfigInstruction=Ak;exports.parseCreateDomainUserAccountInstruction=Ik;exports.parseCreateGlobalCounterInstruction=_k;exports.parseCreateUserAccountsInstruction=Hk;exports.parseDecompressSettingsAccountInstruction=Yk;exports.parseDisableDomainConfigInstruction=nW;exports.parseEditDomainConfigInstruction=pW;exports.parseEditTransactionManagerUrlInstruction=CW;exports.parseEditUserDelegateInstruction=vW;exports.parseNativeTransferIntentCompressedInstruction=ZW;exports.parseNativeTransferIntentInstruction=VW;exports.parseSecp256r1VerifyInstruction=fH;exports.parseTokenTransferIntentCompressedInstruction=yL;exports.parseTokenTransferIntentInstruction=cL;exports.parseTransactionBufferCloseCompressedInstruction=WL;exports.parseTransactionBufferCloseInstruction=PL;exports.parseTransactionBufferCreateCompressedInstruction=QL;exports.parseTransactionBufferCreateInstruction=GL;exports.parseTransactionBufferExecuteCompressedInstruction=yO;exports.parseTransactionBufferExecuteInstruction=aO;exports.parseTransactionBufferExtendCompressedInstruction=UO;exports.parseTransactionBufferExtendInstruction=DO;exports.parseTransactionBufferVoteCompressedInstruction=ZO;exports.parseTransactionBufferVoteInstruction=VO;exports.parseTransactionExecuteCompressedInstruction=gB;exports.parseTransactionExecuteInstruction=oB;exports.parseTransactionExecuteSyncCompressedInstruction=_B;exports.parseTransactionExecuteSyncInstruction=IB;exports.pollJitoBundleConfirmation=e8;exports.prepareChangeConfigArgs=IV;exports.prepareTransactionBundle=bV;exports.prepareTransactionMessage=FV;exports.prepareTransactionSync=qV;exports.retrieveTransactionManager=x8;exports.sendJitoBundle=NP;exports.serializeConfigActions=C8;exports.signAndSendBundledTransactions=$2;exports.signAndSendTransaction=a8;exports.tokenTransferIntent=u5;exports.transactionSyncSigners=i_;exports.userReadOnlyOrMutateArgs=w_;exports.vaultTransactionMessageDeserialize=Iu;exports.vaultTransactionMessageSerialize=xu;exports.voteTransactionBuffer=kA;//# sourceMappingURL=index.cjs.map
|
|
4
4
|
//# sourceMappingURL=index.cjs.map
|