@revibase/core 0.0.7 → 0.0.9-alpha-1
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.d.cts +21 -42
- package/dist/index.d.ts +21 -42
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
'use strict';var gill=require('gill'),ur=require('bn.js'),stateless_js=require('@lightprotocol/stateless.js'),sha256=require('@noble/hashes/sha256'),web3_js=require('@solana/web3.js'),programs=require('gill/programs'),tinyCbor=require('@levischuck/tiny-cbor'),p256=require('@noble/curves/p256'),sha2=require('@noble/hashes/sha2'),server=require('@simplewebauthn/server');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var ur__default=/*#__PURE__*/_interopDefault(ur);var qn=new Uint8Array([201,232,212,229,59,241,106,197]);function iC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(qn)}function cu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["numOrigins",gill.getU16Encoder()],["authority",gill.getAddressEncoder()],["rpIdHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["bump",gill.getU8Encoder()],["isDisabled",gill.getU8Encoder()],["rpIdLength",gill.getU8Encoder()],["rpId",gill.fixEncoderSize(gill.getBytesEncoder(),255)],["origins",gill.fixEncoderSize(gill.getBytesEncoder(),413)],["metadataUrlLength",gill.getU8Encoder()],["metadataUrl",gill.fixEncoderSize(gill.getBytesEncoder(),100)]]),e=>({...e,discriminator:qn}))}function Yn(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["numOrigins",gill.getU16Decoder()],["authority",gill.getAddressDecoder()],["rpIdHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["bump",gill.getU8Decoder()],["isDisabled",gill.getU8Decoder()],["rpIdLength",gill.getU8Decoder()],["rpId",gill.fixDecoderSize(gill.getBytesDecoder(),255)],["origins",gill.fixDecoderSize(gill.getBytesDecoder(),413)],["metadataUrlLength",gill.getU8Decoder()],["metadataUrl",gill.fixDecoderSize(gill.getBytesDecoder(),100)]])}function dC(){return gill.combineCodec(cu(),Yn())}function Zn(e){return gill.decodeAccount(e,Yn())}async function Xn(e,n,r){let s=await au(e,n,r);return gill.assertAccountExists(s),s}async function au(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Zn(s)}async function uC(e,n,r){let s=await iu(e,n,r);return gill.assertAccountsExist(s),s}async function iu(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Zn(t))}function AC(){return 846}var es=new Uint8Array([42,206,176,58,175,129,130,233]);function mC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(es)}function Cu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:es}))}function ts(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function pC(){return gill.combineCodec(Cu(),ts())}function rs(e){return gill.decodeAccount(e,ts())}async function TC(e,n,r){let s=await Du(e,n,r);return gill.assertAccountExists(s),s}async function Du(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return rs(s)}async function lC(e,n,r){let s=await Mu(e,n,r);return gill.assertAccountsExist(s),s}async function Mu(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>rs(t))}function fC(){return 24}function Tr(){return gill.getStructEncoder([["memberKey",J()],["permissions",be()],["verifyArgs",gill.getOptionEncoder(B())],["userArgs",Qe()],["delegateOperation",Pe()]])}function lr(){return gill.getStructDecoder([["memberKey",j()],["permissions",ve()],["verifyArgs",gill.getOptionDecoder(w())],["userArgs",et()],["delegateOperation",Re()]])}function CC(){return gill.combineCodec(Tr(),lr())}function fr(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Sr(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function hC(){return gill.combineCodec(fr(),Sr())}function tt(){return gill.getStructEncoder([["treeInfo",nt()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["outputStateTreeIndex",gill.getU8Encoder()]])}function rt(){return gill.getStructDecoder([["treeInfo",st()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["outputStateTreeIndex",gill.getU8Decoder()]])}function bC(){return gill.combineCodec(tt(),rt())}function ot(){return gill.getStructEncoder([["treeInfo",nt()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function ct(){return gill.getStructDecoder([["treeInfo",st()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function _C(){return gill.combineCodec(ot(),ct())}function Mr(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function hr(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function BC(){return gill.combineCodec(Mr(),hr())}function at(){return gill.getStructEncoder([["data",gill.getOptionEncoder(it())]])}function q(){return gill.getStructDecoder([["data",gill.getOptionDecoder(dt())]])}function HC(){return gill.combineCodec(at(),q())}function it(){return gill.getStructEncoder([["threshold",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["index",gill.getU128Encoder()],["multiWalletBump",gill.getU8Encoder()],["members",gill.getArrayEncoder(ut())],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function dt(){return gill.getStructDecoder([["threshold",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["index",gill.getU128Decoder()],["multiWalletBump",gill.getU8Decoder()],["members",gill.getArrayDecoder(At())],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function zC(){return gill.combineCodec(it(),dt())}function gt(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Rr())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Tr())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(vr())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function yt(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(br())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(lr())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Ur())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function qC(){return gill.combineCodec(gt(),yt())}function YC(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function ZC(e,n){return n.__kind===e}function Wr(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",Ue()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",Ae()]])}function _r(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",We()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",ge()]])}function eD(){return gill.combineCodec(Wr(),_r())}var Gt=(s=>(s[s.Add=0]="Add",s[s.Remove=1]="Remove",s[s.Ignore=2]="Ignore",s))(Gt||{});function Pe(){return gill.getEnumEncoder(Gt)}function Re(){return gill.getEnumDecoder(Gt)}function nD(){return gill.combineCodec(Pe(),Re())}function Rr(){return gill.getStructEncoder([["memberKey",J()],["permissions",be()],["userArgs",gill.getOptionEncoder(ye())],["delegateOperation",Pe()]])}function br(){return gill.getStructDecoder([["memberKey",j()],["permissions",ve()],["userArgs",gill.getOptionDecoder(me())],["delegateOperation",Re()]])}function aD(){return gill.combineCodec(Rr(),br())}function mt(){return gill.getStructEncoder([["memberKey",J()],["messageHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function pt(){return gill.getStructDecoder([["memberKey",j()],["messageHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function AD(){return gill.combineCodec(mt(),pt())}function Or(){return gill.getStructEncoder([["settingsMutArgs",fe()],["transactionManager",gill.getOptionEncoder(ye())]])}function Lr(){return gill.getStructDecoder([["settingsMutArgs",Se()],["transactionManager",gill.getOptionDecoder(me())]])}function pD(){return gill.combineCodec(Or(),Lr())}function ut(){return gill.getStructEncoder([["pubkey",J()],["permissions",be()],["role",gill.getU8Encoder()],["userAddressTreeIndex",gill.getU8Encoder()]])}function At(){return gill.getStructDecoder([["pubkey",j()],["permissions",ve()],["role",gill.getU8Decoder()],["userAddressTreeIndex",gill.getU8Decoder()]])}function SD(){return gill.combineCodec(ut(),At())}function J(){return gill.getStructEncoder([["keyType",gill.getU8Encoder()],["key",gill.fixEncoderSize(gill.getBytesEncoder(),33)]])}function j(){return gill.getStructDecoder([["keyType",gill.getU8Decoder()],["key",gill.fixDecoderSize(gill.getBytesDecoder(),33)]])}function CD(){return gill.combineCodec(J(),j())}function Br(){return gill.getStructEncoder([["authorityCreationArgs",Ae()],["compressedProofArgs",M()]])}function wr(){return gill.getStructDecoder([["authorityCreationArgs",ge()],["compressedProofArgs",h()]])}function ED(){return gill.combineCodec(Br(),wr())}function Tt(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function lt(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function bD(){return gill.combineCodec(Tt(),lt())}function nt(){return gill.getStructEncoder([["rootIndex",gill.getU16Encoder()],["proveByIndex",gill.getBooleanEncoder()],["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()]])}function st(){return gill.getStructDecoder([["rootIndex",gill.getU16Decoder()],["proveByIndex",gill.getBooleanDecoder()],["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()]])}function WD(){return gill.combineCodec(nt(),st())}function be(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function ve(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function LD(){return gill.combineCodec(be(),ve())}function M(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(Mr())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function h(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(hr())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function ND(){return gill.combineCodec(M(),h())}function vr(){return gill.getStructEncoder([["memberKey",J()],["userArgs",Qe()]])}function Ur(){return gill.getStructDecoder([["memberKey",j()],["userArgs",et()]])}function FD(){return gill.combineCodec(vr(),Ur())}function kr(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function ft(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function JD(){return gill.combineCodec(kr(),ft())}function B(){return gill.getStructEncoder([["signedMessageIndex",gill.getU8Encoder()],["slotNumber",gill.getU64Encoder()],["originIndex",gill.getU8Encoder()],["crossOrigin",gill.getBooleanEncoder()],["truncatedClientDataJson",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function w(){return gill.getStructDecoder([["signedMessageIndex",gill.getU8Decoder()],["slotNumber",gill.getU64Decoder()],["originIndex",gill.getU8Decoder()],["crossOrigin",gill.getBooleanDecoder()],["truncatedClientDataJson",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function YD(){return gill.combineCodec(B(),w())}function Y(){return gill.getStructEncoder([["domainConfigKey",gill.getAddressEncoder()],["verifyArgs",B()]])}function Z(){return gill.getStructDecoder([["domainConfigKey",gill.getAddressDecoder()],["verifyArgs",w()]])}function QD(){return gill.combineCodec(Y(),Z())}function St(){return gill.getStructEncoder([["addressTreeInfo",Tt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function xt(){return gill.getStructDecoder([["addressTreeInfo",lt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function nM(){return gill.combineCodec(St(),xt())}function Nr(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function Hr(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function cM(){return gill.combineCodec(Nr(),Hr())}function fe(){return gill.getStructEncoder([["accountMeta",tt()],["data",at()]])}function Se(){return gill.getStructDecoder([["accountMeta",rt()],["data",q()]])}function uM(){return gill.combineCodec(fe(),Se())}function Q(){return gill.getStructEncoder([["accountMeta",ot()],["data",at()]])}function ee(){return gill.getStructDecoder([["accountMeta",ct()],["data",q()]])}function mM(){return gill.combineCodec(Q(),ee())}function It(){return gill.getStructEncoder([["bufferIndex",gill.getU8Encoder()],["preauthorizeExecution",gill.getBooleanEncoder()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["finalBufferHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["finalBufferSize",gill.getU16Encoder()],["expectedSecp256r1Signers",gill.getArrayEncoder(mt())]])}function Ct(){return gill.getStructDecoder([["bufferIndex",gill.getU8Decoder()],["preauthorizeExecution",gill.getBooleanDecoder()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["finalBufferHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["finalBufferSize",gill.getU16Decoder()],["expectedSecp256r1Signers",gill.getArrayDecoder(pt())]])}function fM(){return gill.combineCodec(It(),Ct())}function Dt(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(fr())],["addressTableLookups",gill.getArrayEncoder(Vr())]])}function Mt(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(Sr())],["addressTableLookups",gill.getArrayDecoder(Gr())]])}function CM(){return gill.combineCodec(Dt(),Mt())}function Vr(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Gr(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function hM(){return gill.combineCodec(Vr(),Gr())}function _e(){return gill.getStructEncoder([["member",J()],["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["role",Ue()],["delegatedTo",gill.getOptionEncoder(Nr())],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function X(){return gill.getStructDecoder([["member",j()],["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["role",We()],["delegatedTo",gill.getOptionDecoder(Hr())],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function bM(){return gill.combineCodec(_e(),X())}function Ae(){return gill.getStructEncoder([["addressTreeInfo",Tt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function ge(){return gill.getStructDecoder([["addressTreeInfo",lt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function _M(){return gill.combineCodec(Ae(),ge())}function ye(){return gill.getStructEncoder([["accountMeta",tt()],["data",_e()]])}function me(){return gill.getStructDecoder([["accountMeta",rt()],["data",X()]])}function wM(){return gill.combineCodec(ye(),me())}function Kr(){return gill.getStructEncoder([["accountMeta",ot()],["data",_e()]])}function Jr(){return gill.getStructDecoder([["accountMeta",ct()],["data",X()]])}function VM(){return gill.combineCodec(Kr(),Jr())}function Qe(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([Kr()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([ye()])]])]])}function et(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([Jr()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([me()])]])]])}function KM(){return gill.combineCodec(Qe(),et())}function JM(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function jM(e,n){return n.__kind===e}var Ge=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(Ge||{});function Ue(){return gill.getEnumEncoder(Ge)}function We(){return gill.getEnumDecoder(Ge)}function ZM(){return gill.combineCodec(Ue(),We())}var ws=new Uint8Array([223,179,163,190,177,224,67,173]);function kh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(ws)}function Ly(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(ut(),{size:4})],["membersLen",gill.getU8Encoder()],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["padding",gill.fixEncoderSize(gill.getBytesEncoder(),7)]]),e=>({...e,discriminator:ws}))}function ks(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(At(),{size:4})],["membersLen",gill.getU8Decoder()],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["padding",gill.fixDecoderSize(gill.getBytesDecoder(),7)]])}function Nh(){return gill.combineCodec(Ly(),ks())}function Ns(e){return gill.decodeAccount(e,ks())}async function Hh(e,n,r){let s=await Yr(e,n,r);return gill.assertAccountExists(s),s}async function Yr(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Ns(s)}async function Vh(e,n,r){let s=await By(e,n,r);return gill.assertAccountsExist(s),s}async function By(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Ns(t))}function Gh(){return 184}var zs=new Uint8Array([90,36,35,219,93,225,110,96]);function Jh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(zs)}function em(){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",J()],["executor",J()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder(J())],["expectedSecp256r1Signers",gill.getArrayEncoder(mt())],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:zs}))}function Ks(){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",j()],["executor",j()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["voters",gill.getArrayDecoder(j())],["expectedSecp256r1Signers",gill.getArrayDecoder(pt())],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function jh(){return gill.combineCodec(em(),Ks())}function Js(e){return gill.decodeAccount(e,Ks())}async function js(e,n,r){let s=await tm(e,n,r);return gill.assertAccountExists(s),s}async function tm(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Js(s)}async function qh(e,n,r){let s=await rm(e,n,r);return gill.assertAccountsExist(s),s}async function rm(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Js(t))}var Zs=new Uint8Array([105,23,173,2,197,255,80,87]);function Xh(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Zs)}function xm(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:Zs}))}function Xs(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function $h(){return gill.combineCodec(xm(),Xs())}function $s(e){return gill.decodeAccount(e,Xs())}async function Qs(e,n,r){let s=await Im(e,n,r);return gill.assertAccountExists(s),s}async function Im(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return $s(s)}async function Qh(e,n,r){let s=await Cm(e,n,r);return gill.assertAccountsExist(s),s}async function Cm(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>$s(t))}function m({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function to(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function G(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 p(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:gill.AccountRole.READONLY});let s=r.isWritable?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY;return Object.freeze({address:G(r.value),role:eo(r.value)?gill.upgradeRoleToSigner(s):s,...eo(r.value)?{signer:r.value}:{}})}}function eo(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var no=new Uint8Array([7]);function TE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(no)}function nn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:no}))}function so(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function lE(){return gill.combineCodec(nn(),so())}async function oo(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:nn().encode(c),programAddress:r})}function fE(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...i],data:nn().encode(c),programAddress:r})}function SE(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:so().decode(e.data)}}var uo=new Uint8Array([8]);function EE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(uo)}function sn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsIndex",gill.getU128Encoder()],["configActions",gill.getArrayEncoder(gt())],["compressedProofArgs",gill.getOptionEncoder(M())]]),e=>({...e,discriminator:uo}))}function Ao(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsIndex",gill.getU128Decoder()],["configActions",gill.getArrayDecoder(yt())],["compressedProofArgs",gill.getOptionDecoder(h())]])}function PE(){return gill.combineCodec(sn(),Ao())}async function go(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.settings.value||(t.settings.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getU128Encoder().encode(to(c.settingsIndex))]})),t.authority.value||(t.authority.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(G(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:sn().encode(c),programAddress:r})}function RE(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:sn().encode(c),programAddress:r})}function bE(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ao().decode(e.data)}}var po=new Uint8Array([19]);function BE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(po)}function To(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(gt())],["settingsMut",fe()],["compressedProofArgs",M()]]),e=>({...e,discriminator:po}))}function lo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(yt())],["settingsMut",Se()],["compressedProofArgs",h()]])}function wE(){return gill.combineCodec(To(),lo())}function fo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.authority),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:To().encode(c),programAddress:r})}function kE(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),authority:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:lo().decode(e.data)}}var Io=new Uint8Array([16]);function KE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Io)}function Co(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",fe()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:Io}))}function Do(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",h()],["settingsMutArgs",Se()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function JE(){return gill.combineCodec(Co(),Do())}function Mo(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}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Co().encode(c),programAddress:r})}function jE(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Do().decode(e.data)}}var Eo=new Uint8Array([0]);function eP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Eo)}function yn(){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()))],["metadataUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["authorityCreationArgs",Ae()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Eo}))}function Po(){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()))],["metadataUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["authorityCreationArgs",ge()],["compressedProofArgs",h()]])}function tP(){return gill.combineCodec(yn(),Po())}async function Ro(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:yn().encode(c),programAddress:r})}function rP(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:yn().encode(c),programAddress:r})}function nP(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Po().decode(e.data)}}var vo=new Uint8Array([4]);function uP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(vo)}function pn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",M()],["member",kr()],["role",Ue()],["userAccountCreationArgs",Ae()],["linkWalletArgs",gill.getOptionEncoder(Or())]]),e=>({...e,discriminator:vo}))}function Uo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",h()],["member",ft()],["role",We()],["userAccountCreationArgs",ge()],["linkWalletArgs",gill.getOptionDecoder(Lr())]])}function AP(){return gill.combineCodec(pn(),Uo())}async function Wo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:pn().encode(c),programAddress:r})}function gP(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...i],data:pn().encode(c),programAddress:r})}function yP(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:Uo().decode(e.data)}}var Oo=new Uint8Array([3]);function SP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Oo)}function ln(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Oo}))}function Lo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function xP(){return gill.combineCodec(ln(),Lo())}async function Bo(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=p(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:ln().encode({}),programAddress:r})}function IP(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(c),i=p(r);return Object.freeze({accounts:[i(t.globalCounter),i(t.payer),i(t.systemProgram),...a],data:ln().encode({}),programAddress:r})}function CP(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:Lo().decode(e.data)}}var No=new Uint8Array([18]);function bP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(No)}function fn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["compressedProofArgs",M()],["settingsCreation",St()],["userMutArgs",ye()],["settingsIndex",gill.getU128Encoder()],["delegateOperation",Pe()]]),e=>({...e,discriminator:No}))}function Ho(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["compressedProofArgs",h()],["settingsCreation",xt()],["userMutArgs",me()],["settingsIndex",gill.getU128Decoder()],["delegateOperation",Re()]])}function vP(){return gill.combineCodec(fn(),Ho())}async function Vo(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},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:fn().encode(c),programAddress:r})}function UP(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},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},globalCounter:{value:e.globalCounter??null,isWritable:true},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...i],data:fn().encode(c),programAddress:r})}function WP(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s(),globalCounter:r(),whitelistedAddressTrees:r()},data:Ho().decode(e.data)}}var Fo=new Uint8Array([5]);function NP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Fo)}function xn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",M()],["createUserArgs",gill.getArrayEncoder(Wr())]]),e=>({...e,discriminator:Fo}))}function zo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",h()],["createUserArgs",gill.getArrayDecoder(_r())]])}function HP(){return gill.combineCodec(xn(),zo())}async function Ko(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:xn().encode(c),programAddress:r})}function VP(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...i],data:xn().encode(c),programAddress:r})}function GP(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:zo().decode(e.data)}}var qo=new Uint8Array([17]);function YP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(qo)}function Yo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMut",fe()],["compressedProofArgs",M()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:qo}))}function Zo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMut",Se()],["compressedProofArgs",h()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function ZP(){return gill.combineCodec(Yo(),Zo())}function Xo(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Yo().encode(c),programAddress:r})}function XP(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Zo().decode(e.data)}}var ec=new Uint8Array([2]);function nR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ec)}function tc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:ec}))}function rc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function sR(){return gill.combineCodec(tc(),rc())}function nc(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...i],data:tc().encode(c),programAddress:r})}function oR(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:rc().decode(e.data)}}var Ac=new Uint8Array([1]);function gR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ac)}function Mn(){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(Br())],["newMetadataUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))]]),e=>({...e,discriminator:Ac}))}function gc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))],["newAuthorityArgs",gill.getOptionDecoder(wr())],["newMetadataUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))]])}function yR(){return gill.combineCodec(Mn(),gc())}async function mR(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Mn().encode(c),programAddress:r})}function yc(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...i],data:Mn().encode(c),programAddress:r})}function pR(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:gc().decode(e.data)}}var Tc=new Uint8Array([6]);function CR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Tc)}function lc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",ye()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",M()]]),e=>({...e,discriminator:Tc}))}function fc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",me()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",h()]])}function DR(){return gill.combineCodec(lc(),fc())}function Sc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:false}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.authority),...i],data:lc().encode(c),programAddress:r})}function MR(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:fc().decode(e.data)}}var Cc=new Uint8Array([32]);function UR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Cc)}function Dc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",it()],["compressedProofArgs",M()],["settingsCreationArgs",St()]]),e=>({...e,discriminator:Cc}))}function Mc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",dt()],["compressedProofArgs",h()],["settingsCreationArgs",xt()]])}function WR(){return gill.combineCodec(Dc(),Mc())}function hc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.authority),...i],data:Dc().encode(c),programAddress:r})}function _R(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Mc().decode(e.data)}}var Rc=new Uint8Array([31]);function HR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Rc)}function bc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",_e()],["compressedProofArgs",M()],["userCreationArgs",Ae()]]),e=>({...e,discriminator:Rc}))}function vc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",X()],["compressedProofArgs",h()],["userCreationArgs",ge()]])}function VR(){return gill.combineCodec(bc(),vc())}function Uc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},a={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.authority),...i],data:bc().encode(c),programAddress:r})}function GR(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:vc().decode(e.data)}}var _c=new Uint8Array([29]);function YR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(_c)}function hn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:_c}))}function Oc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function ZR(){return gill.combineCodec(hn(),Oc())}async function XR(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(G(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:hn().encode(c),programAddress:r})}function Lc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:hn().encode(c),programAddress:r})}function $R(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Oc().decode(e.data)}}var kc=new Uint8Array([27]);function ob(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(kc)}function Nc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:kc}))}function Hc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function cb(){return gill.combineCodec(Nc(),Hc())}function Vc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...i],data:Nc().encode(c),programAddress:r})}function ab(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Hc().decode(e.data)}}var Fc=new Uint8Array([30]);function mb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Fc)}function Pn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:Fc}))}function zc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function pb(){return gill.combineCodec(Pn(),zc())}async function Tb(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.source.value||(t.source.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(G(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceTokenAccount.value||(t.sourceTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(G(t.source.value)),gill.getAddressEncoder().encode(G(t.tokenProgram.value)),gill.getAddressEncoder().encode(G(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(G(t.destination.value)),gill.getAddressEncoder().encode(G(t.tokenProgram.value)),gill.getAddressEncoder().encode(G(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:Pn().encode(c),programAddress:r})}function Kc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:Pn().encode(c),programAddress:r})}function lb(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:zc().decode(e.data)}}var Yc=new Uint8Array([28]);function Mb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Yc)}function Rn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Yc}))}function Zc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function hb(){return gill.combineCodec(Rn(),Zc())}async function Eb(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},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceTokenAccount.value||(t.sourceTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(G(t.source.value)),gill.getAddressEncoder().encode(G(t.tokenProgram.value)),gill.getAddressEncoder().encode(G(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(G(t.destination.value)),gill.getAddressEncoder().encode(G(t.tokenProgram.value)),gill.getAddressEncoder().encode(G(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:Rn().encode(c),programAddress:r})}function Xc(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},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...i],data:Rn().encode(c),programAddress:r})}function Pb(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:Zc().decode(e.data)}}var ea=new Uint8Array([12]);function Ob(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ea)}function ta(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:ea}))}function ra(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Lb(){return gill.combineCodec(ta(),ra())}function na(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},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ta().encode(c),programAddress:r})}function Bb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ra().decode(e.data)}}var ca=new Uint8Array([23]);function Fb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ca)}function aa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ca}))}function ia(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function zb(){return gill.combineCodec(aa(),ia())}function da(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:aa().encode(c),programAddress:r})}function Kb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ia().decode(e.data)}}var ga=new Uint8Array([9]);function $b(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ga)}function ya(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",It()],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:ga}))}function ma(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Ct()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Qb(){return gill.combineCodec(ya(),ma())}function pa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:ya().encode(c),programAddress:r})}function ev(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:ma().decode(e.data)}}var fa=new Uint8Array([20]);function av(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(fa)}function Sa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",It()],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:fa}))}function xa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",Ct()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function iv(){return gill.combineCodec(Sa(),xa())}function Ia(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...i],data:Sa().encode(c),programAddress:r})}function dv(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:xa().decode(e.data)}}var Ma=new Uint8Array([13]);function Tv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ma)}function ha(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:Ma}))}function Ea(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function lv(){return gill.combineCodec(ha(),Ea())}function Pa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ha().encode(c),programAddress:r})}function fv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ea().decode(e.data)}}var va=new Uint8Array([24]);function hv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(va)}function Ua(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:va}))}function Wa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function Ev(){return gill.combineCodec(Ua(),Wa())}function _a(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ua().encode(c),programAddress:r})}function Pv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Wa().decode(e.data)}}var Ba=new Uint8Array([11]);function _v(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ba)}function wa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Ba}))}function ka(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function Ov(){return gill.combineCodec(wa(),ka())}function Na(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...i],data:wa().encode(c),programAddress:r})}function Lv(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:ka().decode(e.data)}}var Ga=new Uint8Array([22]);function Vv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ga)}function Fa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:Ga}))}function za(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function Gv(){return gill.combineCodec(Fa(),za())}function Ka(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.transactionBuffer),...i],data:Fa().encode(c),programAddress:r})}function Fv(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:za().decode(e.data)}}var qa=new Uint8Array([10]);function Zv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(qa)}function Ya(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:qa}))}function Za(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Xv(){return gill.combineCodec(Ya(),Za())}function Xa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Ya().encode(c),programAddress:r})}function $v(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Za().decode(e.data)}}var ei=new Uint8Array([21]);function oU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ei)}function ti(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:ei}))}function ri(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function cU(){return gill.combineCodec(ti(),ri())}function ni(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:ti().encode(c),programAddress:r})}function aU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ri().decode(e.data)}}var ci=new Uint8Array([14]);function yU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ci)}function ai(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:ci}))}function ii(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function mU(){return gill.combineCodec(ai(),ii())}function di(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},a=m({}),i=p(r);return Object.freeze({accounts:[i(t.settings),i(t.payer),i(t.transactionBuffer),...a],data:ai().encode({}),programAddress:r})}function pU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:ii().decode(e.data)}}var gi=new Uint8Array([25]);function IU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(gi)}function yi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:gi}))}function mi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function CU(){return gill.combineCodec(yi(),mi())}function pi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},i=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...i],data:yi().encode(c),programAddress:r})}function DU(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:mi().decode(e.data)}}var fi=new Uint8Array([15]);function vU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(fi)}function Si(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Dt()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:fi}))}function xi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Mt()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function UU(){return gill.combineCodec(Si(),xi())}function Ii(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:Si().encode(c),programAddress:r})}function WU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:xi().decode(e.data)}}var Mi=new Uint8Array([26]);function NU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Mi)}function hi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Dt()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Mi}))}function Ei(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Mt()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function HU(){return gill.combineCodec(hi(),Ei())}function Pi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},a={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let i=m(a),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...i],data:hi().encode(c),programAddress:r})}function VU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Ei().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",GS=(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))(GS||{});function hW(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 FS=(l=>(l[l.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",l[l.ChangeConfig=1]="ChangeConfig",l[l.ChangeConfigCompressed=2]="ChangeConfigCompressed",l[l.CompressSettingsAccount=3]="CompressSettingsAccount",l[l.CreateDomainConfig=4]="CreateDomainConfig",l[l.CreateDomainUserAccount=5]="CreateDomainUserAccount",l[l.CreateGlobalCounter=6]="CreateGlobalCounter",l[l.CreateMultiWalletCompressed=7]="CreateMultiWalletCompressed",l[l.CreateUserAccounts=8]="CreateUserAccounts",l[l.DecompressSettingsAccount=9]="DecompressSettingsAccount",l[l.DisableDomainConfig=10]="DisableDomainConfig",l[l.EditDomainConfig=11]="EditDomainConfig",l[l.EditTransactionManagerUrl=12]="EditTransactionManagerUrl",l[l.MigrateCompressedSettings=13]="MigrateCompressedSettings",l[l.MigrateCompressedUsers=14]="MigrateCompressedUsers",l[l.NativeTransferIntent=15]="NativeTransferIntent",l[l.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",l[l.TokenTransferIntent=17]="TokenTransferIntent",l[l.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",l[l.TransactionBufferClose=19]="TransactionBufferClose",l[l.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",l[l.TransactionBufferCreate=21]="TransactionBufferCreate",l[l.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",l[l.TransactionBufferExecute=23]="TransactionBufferExecute",l[l.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",l[l.TransactionBufferExtend=25]="TransactionBufferExtend",l[l.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",l[l.TransactionBufferVote=27]="TransactionBufferVote",l[l.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",l[l.TransactionExecute=29]="TransactionExecute",l[l.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",l[l.TransactionExecuteSync=31]="TransactionExecuteSync",l[l.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",l))(FS||{});function EW(e){let n="data"in e?e.data:e;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 0;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([8])),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([16])),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([18])),0))return 7;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 8;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 9;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 10;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 11;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 12;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([32])),0))return 13;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([31])),0))return 14;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 15;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 16;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 17;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 18;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 19;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 20;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 21;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 22;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 23;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 24;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 25;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 26;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 27;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 28;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 29;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 30;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 31;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 32;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var KS=6e3,JS=6001,jS=6002,qS=6003,YS=6004,ZS=6005,XS=6006,$S=6007,QS=6008,ex=6009,tx=6010,rx=6011,nx=6012,sx=6013,ox=6014,cx=6015,ax=6016,ix=6017,dx=6018,ux=6019,Ax=6020,gx=6021,yx=6022,mx=6023,px=6024,Tx=6025,lx=6026,fx=6027,Sx=6028,xx=6029,Ix=6030,Cx=6031,Dx=6032,Mx=6033,hx=6034,Ex=6035,Px=6036,Rx=6037,bx=6038,vx=6039,Ux=6040,Wx=6041,Ri;process.env.NODE_ENV!=="production"&&(Ri={[dx]:"This member is already delegated to another wallet.",[Px]:"The domain configuration account is disabled. Please contact support or try again later.",[Rx]:"Missing domain configuration account.",[qS]:"Duplicate public keys detected among members. Each member must have a unique key.",[jS]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[ex]:"No members provided. A multisig wallet must contain at least one member.",[lx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[fx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[Sx]:"Declared buffer size does not match the actual serialized size.",[gx]:"Not enough members with vote permission to meet the approval threshold.",[ux]:"At least one signer with execute permission is required to proceed.",[Ax]:"At least one signer with initiate permission is required to perform this action.",[ox]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[Wx]:"Address Tree supplied is not part of the whitelisted address trees",[cx]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Tx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[sx]:"Unexpected number of accounts provided for this instruction.",[JS]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[KS]:"Invalid signature: the provided signature does not match the expected message payload.",[hx]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[rx]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[nx]:"Malformed transaction message: structure or formatting does not match the expected layout.",[Dx]:"An input string exceeds the maximum allowed character length.",[bx]:"This member is not registered under the provided domain configuration.",[ax]:"A required account is missing from the instruction context.",[Mx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[ix]:"User mutation arguments are required when performing add or remove delegate operations.",[mx]:"No valid signer found in this transaction.",[XS]:"Only one permanent member is allowed per wallet.",[$S]:"Only one transaction manager is allowed per wallet.",[Ux]:"The given origin index is not in the whitelisted origins.",[YS]:"Permanent members cannot be removed from a wallet.",[ZS]:"This operation cannot assign a permanent member.",[Cx]:"Writable CPI calls to protected accounts are not permitted.",[vx]:"The relying party ID hash does not match the one defined in the domain configuration.",[Ex]:"The specified slot number was not found in the provided slot history.",[tx]:"Too many members: a maximum of 4 members are supported.",[xx]:"This transaction has expired. It must be executed within 3 minutes of approval.",[QS]:"Unable to assign a transaction manager.",[Ix]:"This transaction has not yet reached the required approval threshold.",[px]:"Only the transaction creator or rent payer may close this transaction buffer.",[yx]:"Member is not part of the expected signers for this transaction."});function WW(e){return process.env.NODE_ENV!=="production"?Ri[e]:"Error message not available in production bundles."}function _W(e,n,r){return gill.isProgramError(e,n,A,r)}var bt={Ed25519:1,Secp256r1:2};var xe={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},De=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(xe).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var Un=33,ie=class{_bn;constructor(n){typeof n=="string"?this._bn=new Uint8Array(gill.getBase58Encoder().encode(n)):this._bn=new Uint8Array(n),this.validateKeyLength(this._bn);}validateKeyLength(n){if(n.length!==Un)throw new Error(`Invalid public key length, expected ${Un} bytes but got ${n.length}`)}toBase58(){return gill.getBase58Decoder().decode(this.toBytes())}toTruncatedBuffer(){let n=this.toBuffer();return n.subarray(1,n.length)}toBuffer(){if(!this._bn)throw new Error("Invalid public key input");let n=this._bn;if(n.byteLength===Un)return n;throw new Error("Invalid public key input")}toBytes(){let n=this.toBuffer();return new Uint8Array(n.buffer,n.byteOffset,n.byteLength)}toString(){return this.toBase58()}toJSON(){return this.toBase58()}},C=class extends ie{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;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;}};function Lx(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function Bx(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var vi=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(Lx())],["addressTableLookups",gill.getArrayCodec(Bx())]]);function Ui(e){return vi.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 Wi(e){let n=vi.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}}stateless_js.featureFlags.version=stateless_js.VERSION.V2;var _i="revibase.com",Oi="https://auth.revibase.com",Li="https://api.revibase.com";async function On(e,n=false){let r=n?{blockhash:gill.getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await te().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(s.instructions,c),c=>gill.setTransactionMessageFeePayerSigner(s.payer,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?gill.compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let a=Math.ceil((s.unitsConsumed??0)*1.1)||8e5;return a>2e5?gill.prependTransactionMessageInstructions([programs.getSetComputeUnitLimitInstruction({units:a})],c):c},async c=>n?gill.compileTransaction(await c):await gill.signTransactionMessageWithSigners(await c))))}async function ki(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===gill.AccountRole.WRITABLE||c.role===gill.AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,a)=>c-a);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function Ni(e,n){if(e.length===0)throw new Error("Bundle is empty.");for(let c=0;c<e.length;c++){if(e[c].length>1644)throw new Error(`Transaction ${c} exceeds maximum length, ${e[c].length}. Retry again.`);console.log(`Transaction ${c} length: ${e[c].length}`);}let r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})});if(!r.ok)throw console.error(await r.json()),new Error("Failed to simulate bundle");let{result:s,error:t}=await r.json();if(!s||t)throw console.error(t??s),new Error(`Unable to simulate bundle: ${JSON.stringify(t??s)}`);if(typeof s.value.summary!="string"&&s.value.summary.failed){let{TransactionFailure:c}=s.value.summary.failed.error,[,a]=c;throw console.error(t??s),new Error(`Simulation failed: ${a}`)}return s.value.transactionResults.map(c=>c.unitsConsumed)}function H(e,n=0){let r=e instanceof C?e:void 0,s=r?.verifyArgs&&n!==-1?gill.some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin}):null,t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,a=r?.authData&&r.verifyArgs?.clientDataJson?new Uint8Array([...r.authData,...sha256.sha256(r.verifyArgs.clientDataJson)]):void 0,i=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:a,publicKey:i}}function ze(e){if(e instanceof ie)return {keyType:bt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:bt.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function wi(e){return e instanceof C?e.toString():e.address.toString()}function de(e){let n=new Set,r=[];for(let s of e)n.has(wi(s))||(r.push(s),n.add(wi(s)));if(r.filter(s=>s instanceof C).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function Hi({payer:e,tipAmount:n}){let r=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],s=r[Math.floor(Math.random()*r.length)];return programs.getTransferSolInstruction({source:e,destination:gill.address(s),amount:n})}async function Vi(e){let n=await fetch(`${e}/getRandomPayer`),{randomPayer:r}=await n.json();return {address:gill.address(r),async signTransactions(s){let t={publicKey:r,transactions:s.map(i=>gill.getBase64Decoder().decode(gill.getTransactionEncoder().encode(i)))},a=await(await fetch(`${e}/sign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json();if("error"in a)throw new Error(a.error);return a.signatures.map(i=>({[gill.address(r)]:gill.getBase58Encoder().encode(i)}))}}}var Ke=null,Xt=null,$t=null,Qt=null,er,Zt=null,Ln=null,tr=null,Bn=null,wn=null,kn=null,Gi=null;function Fi(){if(!Ke)throw new Error("Rpc is not initialized yet.");return Ke}function vt(){if(!Xt)throw new Error("Rpc is not initialized yet");return Xt}function te(){if(!$t)throw new Error("Rpc is not initialized yet");return $t}function zi(){if(!Qt)throw new Error("Rpc is not initialized yet.");return Qt}function Ki(){if(!er)throw new Error("Rpc is not initialized yet");return er}async function C_(){return Zt||(Zt=await Vi(Ln??Li)),Zt}function Nn(){if(!tr)throw new Error("Jito Bundle Config is not set.");return tr}function he(){return Bn??Oi}function Ji(){return wn??_i}function ji(){return kn}function rr(){return Gi}function D_(){Xt=null,$t=null,Ke=null,Zt=null,Ln=null,tr=null,Bn=null,wn=null,Qt=null,er=null,kn=null;}function M_({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,rpId:a,authorizedClient:i,additionalInfo:o}){Ke=e,Xt=stateless_js.createRpc(Ke,r,n);let{rpc:d,sendAndConfirmTransaction:u}=gill.createSolanaClient({urlOrMoniker:Ke});Qt=u,er=programs.estimateComputeUnitLimitFactory({rpc:d}),$t=d,Ln=t??null,tr=s??null,Bn=c??null,wn=a??null,kn=i??null,Gi=o??null;}var U=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?gill.AccountRole.WRITABLE_SIGNER:gill.AccountRole.READONLY_SIGNER:r?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...stateless_js.getLightSystemAccountMetasV2({selfProgram:new web3_js.PublicKey(A.toString())}).map(n=>({address:gill.address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,gill.AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:gill.address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===stateless_js.TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===stateless_js.TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=await vt().getStateTreeInfos();return this.packOutputTreeIndex(stateless_js.selectStateTreeInfo(n))}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:a,queuePubkeyIndex:i,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let a=this.insertOrGet(c.treeInfo.tree.toString()),i=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:a,addressQueuePubkeyIndex:i});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function nr(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await vt().getCompressedAccount(e);return s&&n?.set(e.toString(),s),s}}async function ce(e,n){let s=(await Promise.all(e.map(async t=>nr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new Error("Unable to find compressed account.");return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function b(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 ne(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:s[u],address:d.address.toArray()})),{addressTrees:a}=e.packTreeInfos([],c),i=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:a[u],outputStateTreeIndex:i,address:d.address,type:d.type}))}function se(e,n,r,s,t,c,a){let i=[];for(let u=0;u<n.length;u++)i.push({treeInfo:n[u],rootIndex:s[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let o=e.packTreeInfos(i,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((u,g)=>({data:a.decode(u.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function pe(e,n,r,s,t){let c=null,a=null,i=new U;if(e){await i.addSystemAccounts();let{address:o}=await $(n,r),d=(await ce([{address:o,type:"Settings"}],t))[0];s?a={rootIndices:[0],roots:[],leafIndices:[d.leafIndex],leaves:[],treeInfos:[d.treeInfo],proveByIndices:[d.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:a=await k([d],[]);let u=i.packTreeInfos([{treeInfo:a.treeInfos[0],rootIndex:a.rootIndices[0],leafIndex:a.leafIndices[0],proveByIndex:a.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!u)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:u.packedTreeInfos[0]},data:q().decode(d.data?.data)};}return {settingsReadonlyArgs:c,proof:a,packedAccounts:i}}async function k(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await vt().getValidityProofV0(e,n)}catch(c){if(console.error(`Attempt ${t}, Get Validity Proof failed. ${c}`),t++,t>=r)throw new Error(`Failed to get validity proof after ${r} attempts: ${c}`);await new Promise(a=>setTimeout(a,s));}throw new Error(`Failed to get validity proof after ${r} attempts`)}async function Te(){return (await sr()).length-1}var Hn;async function sr(){if(!Hn){let{data:e}=await Qs(te(),await Zi());Hn=e.whitelistedAddressTrees;}return Hn}async function Xi(e,n,r){let s=await uI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function uI(e,n,r){let{address:s}=await W(e,n),t=await nr(s,r);return t?.data?.data?X().decode(t.data.data):null}async function $i(e,n,r){let s=await AI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function AI(e,n,r){try{let{address:s}=await $(e,n),t=await nr(s,r);if(!t?.data?.data)return null;let c=q().decode(t.data.data);return c.data.__option==="None"?null:{...c.data.value,isCompressed:!0}}catch{let s=await Yr(te(),await re(e));return s.exists?{...s.data,members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function Vn(e){let n=await sr();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function or(e){let r=(await sr()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function $(e,n=0){let r=await Vn(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("multi_wallet")),new Uint8Array(gill.getU128Encoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function W(e,n=0){let r=await Vn(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("user")),e instanceof ie?e.toTruncatedBuffer():new Uint8Array(gill.getAddressEncoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function je({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256.sha256(new Uint8Array(gill.getUtf8Encoder().encode(n)));else throw new Error("RpId not found.");if(!e)throw new Error("RpIdHash not found.");let[r]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("domain_config"),e]});return r}async function nd(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function Zi(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function sd(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),n instanceof ie?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return s}async function Ie(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return n}async function re(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function od(e){let n=await re(e);return await Ie(n)}async function eO(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}var qe=null,ad=2e3,id=3e3,mI=300*1e3;async function ar({authUrl:e,additionalInfo:n,signer:r,popUp:s=null,data:t}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");return new Promise((c,a)=>{let i=new URL(e).origin,o=null,d=setInterval(()=>{s&&s.closed&&(g(),a(new Error("User closed the authentication window")));},500),u=setTimeout(()=>{y("Authentication timeout."),g(),a(new Error("Authentication timed out"));},mI);function g(){clearInterval(d),clearTimeout(u),o&&clearTimeout(o),qe&&window.removeEventListener("message",qe),s&&s.close();}if(s?s.location.replace(e):s=gd(e),!s){a(new Error("Disable your popup blocker to continue."));return}function y(...T){n?.debug&&console.debug("[Popup]",...T);}let f=T=>{let I=T.origin===i,D=T.source===s;if(!I||!D||!T.isTrusted||!s){y("Ignored message from unknown source",T);return}switch(T.data.type){case "popup-ready":y("Popup is ready, sending auth data"),s.postMessage({type:"popup-init",payload:{signer:r?.toString(),data:t,additionalInfo:n}},i),o=setTimeout(()=>{g(),a(new Error("User closed the authentication window"));},ad+id);break;case "popup-complete":y("Received completion message");try{let v=JSON.parse(T.data.payload);g(),c(v);}catch{a(new Error("Failed to parse response payload"));}break;case "popup-heartbeat":y("Received heartbeat"),o&&(clearTimeout(o),o=setTimeout(()=>{g(),a(new Error("User closed the authentication window"));},ad+id));break;case "popup-closed":y("Popup explicitly closed"),g(),a(new Error("User closed the authentication window"));break;default:y("Unknown message type",T.data.type);}};qe&&window.removeEventListener("message",qe),qe=f,window.addEventListener("message",qe);})}function ir(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function we(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),a=new Uint8Array(c);for(let i=0;i<t.length;i++)a[i]=t.charCodeAt(i);return c}function dr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function pI(e){let n=new Uint8Array(e.length/2);for(let r=0;r<n.length;r++)n[r]=parseInt(e.slice(r*2,r*2+2),16);return n}function dd(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let s=JSON.stringify(r);return new TextEncoder().encode(s.slice(1,-1))}function ud(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let a=e[s]|e[s+1]<<8;if(s+=2,s+a>e.length)throw new Error("MaxLengthExceeded");let i=e.slice(s,s+a),o=t.decode(i);r.push(o),s+=a;}return r}function Ad(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let v=n&127;r+=v;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let a=e[r+1],i=r+2,o=e.slice(i,i+a),d=c[0]===0&&c.length>32?c.slice(1):c,u=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let y=p256.p256.Point.CURVE().n>>1n,f=BigInt("0x"+dr(u)),I=(f>y?p256.p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),D=pI(I);return new Uint8Array([...g,...D])}function gd(e=`${he()}/loading`){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let n=window.innerWidth||screen.availWidth,r=window.innerHeight||screen.availHeight,s=n<=768,t,c,a,i;if(s)t=n,c=r,a=0,i=0;else {let u=window.screenLeft??window.screenX,g=window.screenTop??window.screenY,y=window.innerWidth??document.documentElement.clientWidth??screen.width,f=window.innerHeight??document.documentElement.clientHeight??screen.height;t=500,c=600,i=u+(y-t)/2,a=g+(f-c)/2;}let o=[`width=${t}`,`height=${c}`,`top=${a}`,`left=${i}`,"toolbar=no","location=no","status=no","menubar=no","scrollbars=yes","resizable=yes"].join(","),d=window.open(e,"_blank",o);return d&&d.focus(),d}function lO(e){let n=tinyCbor.decodeCBOR(e),r=p256.p256.Point.fromAffine({x:BigInt("0x"+dr(n.get(-2))),y:BigInt("0x"+dr(n.get(-3)))});return gill.getBase58Decoder().decode(r.toBytes(true))}function pd(e){let r=p256.p256.Point.fromBytes(new Uint8Array(gill.getBase58Encoder().encode(e))).toBytes(false),s=new Map;return s.set(1,2),s.set(3,-7),s.set(-1,1),s.set(-2,r.slice(1,33)),s.set(-3,r.slice(33,65)),new Uint8Array(tinyCbor.encodeCBOR(s))}async function fO(e,n=0,r=false){let{authenticatorData:s,clientDataJSON:t,signature:c}=e.authResponse.response,a=new Uint8Array(we(s)),i=JSON.parse(new TextDecoder().decode(we(t))),o=dd(i),d=Ad(new Uint8Array(we(c))),u=await je({rpIdHash:a.subarray(0,32)});return new C(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(we(t)),truncatedClientDataJson:o,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(gill.getBase58Encoder().encode(e.slotHash))},domainConfig:u,authData:a,signature:d,originIndex:n,crossOrigin:r})}async function SO(e,n){let{data:r}=await Xn(te(),e),t=ud(new Uint8Array(r.origins),r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Error("Origin not found in domain config");return t}async function _O(e){let n=await On(e,true),r=await Ni(n.map(gill.getBase64EncodedWireTransaction),Fi()),s=await On(e.map((c,a)=>({...c,unitsConsumed:r[a]})));return await _I(s.map(gill.getBase64EncodedWireTransaction))}async function OO({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await te().getLatestBlockhash().send(),t=await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions([...e],c),c=>gill.setTransactionMessageFeePayerSigner(n,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?gill.compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[a,i]=await Promise.all([Ki()(c),ki(te(),c.instructions.flatMap(d=>d.accounts??[]))]),o=Math.ceil(a*1.1);return gill.prependTransactionMessageInstructions([...o>2e5?[programs.getSetComputeUnitLimitInstruction({units:o})]:[],...i>0?[programs.getSetComputeUnitPriceInstruction({microLamports:i})]:[]],c)},async c=>await gill.signTransactionMessageWithSigners(await c));return await zi()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}async function _I(e,n=10,r=1e3,s=Nn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/bundles`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})});if(a.status===429&&c<n){await new Promise(o=>setTimeout(o,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);return i.result}throw new Error("Failed to send bundle after retries.")}async function LO(e,n=30,r=3e3,s=Nn()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let a=await fetch(`${t}/getBundleStatuses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});if(a.status===429&&c<n){await new Promise(d=>setTimeout(d,r));continue}let i=await a.json();if(i.error)throw new Error(`Error sending bundles: ${JSON.stringify(i.error,null,2)}`);let o=i.result;if(o.value.length){let d=o.value[0];if(d.confirmation_status==="confirmed"||d.confirmation_status==="finalized")return d.transactions[d.transactions.length-1]}if(c<n){await new Promise(d=>setTimeout(d,r));continue}}throw new Error("Failed to get bundle status after retries.")}async function BO(e,n,r,s){let t=await $i(n,r,s);if(t.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:c}=t.members.find(u=>fd(u.pubkey)===e.toString())??{};if(!c)throw new Error("No permissions found for the current member.");let a=De.has(c,xe.InitiateTransaction),i=De.has(c,xe.VoteTransaction),o=De.has(c,xe.ExecuteTransaction);if(a&&i&&o)return {};if(!i||!o)throw new Error("Signer lacks the required Vote/Execute permissions.");let d=t.members.find(u=>u.role===2);if(!d)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:gill.address(fd(d.pubkey)),userAddressTreeIndex:d.userAddressTreeIndex}}async function wO({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await Xi(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");let a=[],i=[];for(let o of e){let{authResponse:{response:d},deviceSignature:u}=o;a.push(sha2.sha256(new Uint8Array([...new Uint8Array(we(d.authenticatorData)),...sha2.sha256(d.clientDataJSON)]))),i.push(u);}return OI(n,c.transactionManagerUrl.value,a,i,s)}function OI(e,n,r,s,t){return {address:e,async signTransactions(c){let a={publicKey:e.toString(),transactions:c.map(gill.getBase64EncodedWireTransaction),deviceSignatures:s};t&&(a.transactionMessageBytes=gill.getBase64Decoder().decode(t));let i=ji();if(i){let{url:u,publicKey:g}=i,f=await(await fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messageHashes:r,publicKey:g})})).json();if("error"in f)throw new Error(f.error);a.clientSignatures=f.signatures.map(T=>({publicKey:g,signature:T}));}let d=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)})).json();if("error"in d)throw new Error(d.error);return d.signatures.map(u=>({[e]:gill.getBase58Encoder().encode(u)}))}}}function fd(e){return e.keyType===bt.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}async function rL({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let{addDelegates:a,removeDelegates:i}=await BI(r),o=new U,d=null,u=null,g=[];if(a.length||i.length||t){let S=await wI({packedAccounts:o,addDelegates:a,removeDelegates:i,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:c});d=S.proof,u=S.settingsMutArgs??null,g=S.userMutArgs??[];}let{configActions:y,secp256r1VerifyInput:f}=await kI({configActionsArgs:r,packedAccounts:o,userMutArgs:g}),{remainingAccounts:T,systemOffset:I}=o.toAccountMetas(),D=b(d,I);return {instructions:t?[fo({configActions:y,payer:s,authority:gill.createNoopSigner(await od(e)),compressedProofArgs:D,settingsMut:u,remainingAccounts:T})]:[await go({settingsIndex:e,configActions:y,payer:s,compressedProofArgs:D,remainingAccounts:T})],secp256r1VerifyInput:f}}async function BI(e){let n=[],r=[];for(let s of e)switch(s.type){case "AddMembers":{let t=s.members.map(a=>W(a.member instanceof C?a.member:a.delegateOperation===0?a.member.address:a.member,a.userAddressTreeIndex)),c=await Promise.all(t);for(let a of c)n.push({address:a.address,type:"User"});break}case "RemoveMembers":{let t=s.members.map(a=>W(a.member,a.userAddressTreeIndex)),c=await Promise.all(t);for(let a of c)r.push({address:a.address,type:"User"});break}case "EditPermissions":{let t=s.members.map(a=>a.delegateOperation===2?Promise.resolve(void 0):W(a.member,a.userAddressTreeIndex)),c=await Promise.all(t);for(let a=0;a<c.length;a++){let i=c[a],o=s.members[a];i&&(o.delegateOperation===0?n.push({address:i.address,type:"User"}):r.push({address:i.address,type:"User"}));}break}}return {addDelegates:n,removeDelegates:r}}async function wI({packedAccounts:e,addDelegates:n,removeDelegates:r,compressed:s,index:t,settingsAddressTreeIndex:c,cachedAccounts:a}){await e.addSystemAccounts();let i=[];if(s){let T=(await $(t,c)).address;i.push({address:T,type:"Settings"});}r.length&&i.push(...r),n.length&&i.push(...n);let o=i.length?await ce(i,a):[];if(!o.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let d=await k(o,[]),u=[],g=[];for(let T of o)T.type==="Settings"?u.push(T):T.type==="User"&&g.push(T);let y,f=[];if(s&&d&&(y=se(e,d.treeInfos.slice(0,1),d.leafIndices.slice(0,1),d.rootIndices.slice(0,1),d.proveByIndices.slice(0,1),u,q())[0]),g.length&&d){let T=s?1:0;f=se(e,d.treeInfos.slice(T),d.leafIndices.slice(T),d.rootIndices.slice(T),d.proveByIndices.slice(T),g,X());}return {proof:d,settingsMutArgs:y,userMutArgs:f}}async function kI({configActionsArgs:e,packedAccounts:n,userMutArgs:r}){let s=[],t=[];for(let c of e)switch(c.type){case "AddMembers":{let a=[];for(let i of c.members)if(i.member instanceof C){let o=s.length,{message:d,signature:u,publicKey:g,domainConfig:y}=H(i.member,o);d&&u&&g&&s.push({message:d,signature:u,publicKey:g}),y&&n.addPreAccounts([{address:y,role:gill.AccountRole.READONLY}]);let f=await W(i.member,i.userAddressTreeIndex).then(T=>r.find(I=>new ur__default.default(new Uint8Array(I.accountMeta.address)).eq(T.address)));if(!f)throw new Error("Unable to find user account");a.push(xd({permissionArgs:i.permissions,index:o,userMutArgs:f,pubkey:i.member,delegateOperation:i.delegateOperation}));}else {i.delegateOperation===0&&n.addPreAccounts([{address:i.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:i.member}]);let o=i.delegateOperation===0?i.member.address:i.member,d=await W(o,i.userAddressTreeIndex).then(u=>r.find(g=>new ur__default.default(new Uint8Array(g.accountMeta.address)).eq(u.address)));if(!d)throw new Error("Unable to find user account");a.push(xd({permissionArgs:i.permissions,index:-1,userMutArgs:d,pubkey:i.member,delegateOperation:i.delegateOperation}));}t.push({__kind:c.type,fields:[a]});break}case "RemoveMembers":{let a=c.members.map(o=>W(o.member,o.userAddressTreeIndex).then(d=>{let u=r.find(g=>new ur__default.default(new Uint8Array(g.accountMeta.address)).eq(d.address));if(!u)throw new Error("Unable to find user account");return HI({pubkey:o.member,userMutArgs:u})})),i=await Promise.all(a);t.push({__kind:c.type,fields:[i]});break}case "EditPermissions":{let a=c.members.map(o=>(o.delegateOperation!==2?W(o.member,o.userAddressTreeIndex).then(d=>r.find(u=>new ur__default.default(new Uint8Array(u.accountMeta.address)).eq(d.address))):Promise.resolve(void 0)).then(d=>NI({permissionArgs:o.permissions,userMutArgs:d,pubkey:o.member,delegateOperation:o.delegateOperation}))),i=await Promise.all(a);t.push({__kind:c.type,fields:[i]});break}default:t.push({__kind:c.type,fields:[c.threshold]});}return {configActions:t,secp256r1VerifyInput:s}}function NI({pubkey:e,permissionArgs:n,userMutArgs:r,delegateOperation:s}){if(s!==2){if(!r)throw new Error("User args is missing");if(r.data.role!==0)throw new Error("Only user with member role is allowed to change delegate.")}return {memberKey:ze(e),permissions:Dd(n),userArgs:r?gill.some(r):gill.none(),delegateOperation:s}}function HI({pubkey:e,userMutArgs:n}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:ze(e),userArgs:n.data.delegatedTo.__option==="Some"?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function xd({pubkey:e,permissionArgs:n,index:r,userMutArgs:s,delegateOperation:t}){if(s.data.role===1){if(t!==0)throw new Error("Permanent members must also be delegates");if(s.data.delegatedTo.__option==="Some")throw new Error("This user is already registered as a permanent member in another wallet. A permanent member can only belong to one wallet.")}else if(s.data.role===2){if(n.execute||n.vote)throw new Error("Transaction Manager can only have initiate permission");if(t!==2)throw new Error("Transaction Manager cannot be a delegate.")}else if(s.data.role===3&&t!==2)throw new Error("Administrator cannot be a delegate.");return {memberKey:ze(e),permissions:Dd(n),verifyArgs:e instanceof C&&e.verifyArgs&&r!==-1?gill.some({truncatedClientDataJson:e.verifyArgs.truncatedClientDataJson,slotNumber:e.verifyArgs.slotNumber,signedMessageIndex:r,originIndex:e.originIndex,crossOrigin:e.crossOrigin}):gill.none(),userArgs:t===0?{__kind:"Mutate",fields:[s]}:{__kind:"Read",fields:[s]},delegateOperation:t}}function Dd(e){let n=[];return e.initiate&&n.push(xe.InitiateTransaction),e.vote&&n.push(xe.VoteTransaction),e.execute&&n.push(xe.ExecuteTransaction),De.fromPermissions(n)}var Ye=33,Ze=64,Jn=14,jI=2,qI=gill.address("Secp256r1SigVerify1111111111111111111111111");function YI(){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 ZI(){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 Pd(){return gill.createDecoder({read:(e,n=0)=>{let r=gill.getU8Decoder().decode(e,n);n+=1;let s=gill.getU8Decoder().decode(e,n);n+=1;let t=[],c=ZI();for(let i=0;i<r;i++)t.push(c.decode(e,n)),n+=Jn;let a=[];for(let i=0;i<r;i++){let o=gill.fixDecoderSize(gill.getBytesDecoder(),Ye).decode(e,n);n+=Ye;let d=gill.fixDecoderSize(gill.getBytesDecoder(),Ze).decode(e,n);n+=Ze;let u=t[i].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),u).decode(e,n);n+=u,a.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:a},n]}})}function Rd(){return gill.createEncoder({getSizeFromValue:e=>{let n=Jn*e.offsets.length,r=e.payload.reduce((s,t)=>s+Ye+Ze+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=gill.getU8Encoder().write(e.numSignatures,n,r),r=gill.getU8Encoder().write(e.padding,n,r);let s=YI();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=gill.fixEncoderSize(gill.getBytesEncoder(),Ye).write(t.publicKey,n,r),r=gill.fixEncoderSize(gill.getBytesEncoder(),Ze).write(t.signature,n,r),r=gill.getBytesEncoder().write(t.message,n,r);return r}})}function oL(){return gill.combineCodec(Rd(),Pd())}function F(e,n){let r=e.length,s=jI+r*Jn,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,g=u+Ye,y=g+Ze;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:y,messageDataSize:d.length,messageInstructionIndex:65535}),s+=Ye+Ze+d.length;}let c=n?.programAddress??qI,a={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:Rd().encode(a)}}function cL(e){return {programAddress:e.programAddress,accounts:{},data:Pd().decode(e.data)}}async function TL({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let a=await re(e),{address:i}=await $(e,n),o=await ce([{address:i,type:"Settings"}],t),d=await k(o,[]),u=se(c,d.treeInfos,d.leafIndices,d.rootIndices,d.proveByIndices,o.filter(x=>x.type==="Settings"),q())[0],g=de(s),y=g.filter(x=>x instanceof C),f=[],T=[];for(let x of y){let O=f.length,{domainConfig:N,verifyArgs:V,signature:_,publicKey:K,message:L}=H(x,O);L&&_&&K&&f.push({message:L,signature:_,publicKey:K}),N&&(c.addPreAccounts([{address:N,role:gill.AccountRole.READONLY}]),V?.__option==="Some"&&T.push({domainConfigKey:N,verifyArgs:V.value}));}c.addPreAccounts(g.filter(x=>"address"in x).map(x=>({address:x.address,role:gill.AccountRole.READONLY_SIGNER,signer:x})));let{remainingAccounts:I,systemOffset:D}=c.toAccountMetas(),v=b(d,D),S=[];return f.length>0&&S.push(F(f)),S.push(Mo({settings:a,settingsMutArgs:u,compressedProofArgs:v,payer:r,secp256r1VerifyArgs:T,remainingAccounts:I})),S}async function SL({admin:e,addressTree:n}){return oo({payer:e,addressTree:n,remainingAccounts:[]})}async function EL({payer:e,rpId:n,origins:r,authority:s,metadataUrl:t}){let c=await je({rpId:n}),a=new U;await a.addSystemAccounts();let i=await Te(),{address:o,addressTree:d}=await W(s.address,i),u=[{address:o,tree:d,queue:d,type:"User"}],g=await k([],u),y=(await ne(a,g.treeInfos,g.roots,g.rootIndices,u))[0],{remainingAccounts:f,systemOffset:T}=a.toAccountMetas(),I=b(g,T);return await Ro({origins:r,authorityCreationArgs:y,authority:s,compressedProofArgs:I,payer:e,domainConfig:c,rpId:n,metadataUrl:t,remainingAccounts:f})}async function BL({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let a=[];r.index&&(a.push({address:(await $(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&a.push({address:(await W(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let i=a.length?await ce(a,t):[],o=await Te(),{address:d,addressTree:u}=await W(r.member,o),g=[{address:d,type:"User",tree:u,queue:u}],y=await k(i,g),f=null,T=null,I=i.filter(N=>N.type==="Settings"),D=i.filter(N=>N.type==="User");I.length&&(f=se(c,y.treeInfos.slice(0,1),y.leafIndices.slice(0,1),y.rootIndices.slice(0,1),y.proveByIndices.slice(0,1),I,q())[0]),D.length&&(T=se(c,y.treeInfos.slice(1,2),y.leafIndices.slice(1,2),y.rootIndices.slice(1,2),y.proveByIndices.slice(1,2),D,X())[0]);let v=await ne(c,y.treeInfos.slice(i.length),y.roots.slice(i.length),y.rootIndices.slice(i.length),g),{remainingAccounts:S,systemOffset:x}=c.toAccountMetas(),O=b(y,x);return await Wo({payer:n,authority:e,compressedProofArgs:O,member:ft().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:f?gill.some({settingsMutArgs:f,transactionManager:T?gill.some(T):gill.none()}):gill.none(),userAccountCreationArgs:v[0],domainConfig:s,remainingAccounts:S})}async function HL({payer:e}){let n=await nd();return Bo({payer:e,globalCounter:n})}async function jL({createUserArgs:e,payer:n}){let r=new U;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:u.member})));let s=await Te(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:y}=await W(u.member.address,s);return {address:g,tree:y,queue:y,type:"User"}})),c=await k([],t),a=await ne(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:i,systemOffset:o}=r.toAccountMetas(),d=b(c,o);return await Ko({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:a[g],transactionManagerUrl:u.role===2?u.transactionManagerUrl:null})),remainingAccounts:i})}async function XL({admin:e,rpId:n,disable:r}){let s=await je({rpId:n});return nc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function sB({authority:e,domainConfig:n,newAuthority:r,newOrigins:s,newMetadataUrl:t}){let c=null,a=[];if(r){let i=new U;await i.addSystemAccounts();let o=await Te(),{address:d,addressTree:u}=await W(r.address,o),g=[{address:d,tree:u,queue:u,type:"User"}],y=await k([],g),f=(await ne(i,y.treeInfos,y.roots,y.rootIndices,g))[0],T=i.toAccountMetas();a=T.remainingAccounts,c={compressedProofArgs:b(y,T.systemOffset),authorityCreationArgs:f};}return yc({domainConfig:n,authority:e,newOrigins:s?gill.some(s):gill.none(),newAuthorityArgs:c,newAuthority:r,newMetadataUrl:t?gill.some(t):gill.none(),remainingAccounts:a})}async function uB({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new U;await s.addSystemAccounts();let t=await ce([{address:(await W(e.address,n)).address,type:"User"}]),c=await k(t,[]),a=se(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:i,systemOffset:o}=s.toAccountMetas(),d=b(c,o);return Sc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:a,remainingAccounts:i})}async function lB({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new U;await t.addSystemAccounts();let{address:c,addressTree:a}=await $(r,s),i=[{address:c,tree:a,queue:a,type:"Settings"}],o=await k([],i),d=(await ne(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),y=b(o,g);return hc({compressedProofArgs:y,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function MB({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new U;await t.addSystemAccounts();let{address:c,addressTree:a}=await W(r,s),i=[{address:c,tree:a,queue:a,type:"User"}],o=await k([],i),d=(await ne(t,o.treeInfos,o.roots,o.rootIndices,i))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),y=b(o,g);return Uc({compressedProofArgs:y,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}async function KB({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,delegateOperation:t,cachedAccounts:c}){let{domainConfig:a,verifyArgs:i,message:o,signature:d,publicKey:u}=H(r),g=[];o&&d&&u&&g.push({message:o,signature:d,publicKey:u});let y=new U;await y.addSystemAccounts();let f=[],T=[];T.push(...await ce([{address:(await W("address"in r?r.address:r,s)).address,type:"User"}],c));let I=await Te(),{address:D,addressTree:v}=await $(e,I);f.push({address:D,queue:v,tree:v,type:"Settings"});let S=T.length,x=await k(T,f),O=se(y,x.treeInfos.slice(0,S),x.leafIndices.slice(0,S),x.rootIndices.slice(0,S),x.proveByIndices.slice(0,S),T.filter(ae=>ae.type==="User"),X())[0],V=(await ne(y,x.treeInfos.slice(S),x.roots.slice(S),x.rootIndices.slice(S),f)).find(ae=>ae.type==="Settings")??null;a?y.addPreAccounts([{address:a,role:gill.AccountRole.READONLY}]):"address"in r&&y.addPreAccounts([{address:r.address,role:gill.AccountRole.READONLY_SIGNER,signer:r}]);let{remainingAccounts:_,systemOffset:K}=y.toAccountMetas(),L=b(x,K),le=[];if(!V)throw new Error("Settings creation args is missing.");return le.push(await Vo({settingsIndex:e,payer:n,initialMember:r instanceof C?void 0:r,secp256r1VerifyArgs:i,domainConfig:a,userMutArgs:O,compressedProofArgs:L,settingsCreation:V,delegateOperation:t,remainingAccounts:_})),{instructions:le,secp256r1VerifyInput:g}}async function tw({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let a=await ce([{address:(await $(e,n)).address,type:"Settings"}],t),i=await k(a,[]),o=se(c,i.treeInfos,i.leafIndices,i.rootIndices,i.proveByIndices,a.filter(S=>S.type==="Settings"),q())[0],d=de(s),u=d.filter(S=>S instanceof C),g=[],y=[];for(let S of u){let x=g.length,{domainConfig:O,verifyArgs:N,signature:V,publicKey:_,message:K}=H(S,x);K&&V&&_&&g.push({message:K,signature:V,publicKey:_}),O&&(c.addPreAccounts([{address:O,role:gill.AccountRole.READONLY}]),N?.__option==="Some"&&y.push({domainConfigKey:O,verifyArgs:N.value}));}c.addPreAccounts(d.filter(S=>"address"in S).map(S=>({address:S.address,role:gill.AccountRole.READONLY_SIGNER,signer:S})));let{remainingAccounts:f,systemOffset:T}=c.toAccountMetas(),I=b(i,T),D=[];g.length>0&&D.push(F(g));let v=await re(e);return D.push(Xo({settings:v,payer:r,settingsMut:o,compressedProofArgs:I,secp256r1VerifyArgs:y,remainingAccounts:f})),D}function QI(e,n,r,s){let t=eC(e,n),c=tC(e,n)&&r!==s;return t&&c?gill.AccountRole.WRITABLE_SIGNER:t&&!c?gill.AccountRole.WRITABLE:!t&&c?gill.AccountRole.READONLY_SIGNER:gill.AccountRole.READONLY}function eC(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,a=s-t,i=r-s-c;return n>=r?false:n<a?true:n>=s?n-s<i:false}function tC(e,n){return n<e.header.numSignerAccounts}async function Ar({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=Wi(n);if(t.version==="legacy")throw new Error("Only versioned transaction is allowed.");let c=r??(t.addressTableLookups?await gill.fetchAddressesForLookupTables(t.addressTableLookups.map(i=>i.lookupTableAddress),te()):{}),a=[];a.push(...t.addressTableLookups?.map(i=>({role:gill.AccountRole.READONLY,address:i.lookupTableAddress}))??[]);for(let[i,o]of t.staticAccounts.entries())a.push({address:o,role:QI(t,i,o,e)});if(t.addressTableLookups)for(let i of t.addressTableLookups){let o=c[i.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${i.lookupTableAddress} not found`);for(let d of i.writableIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:u,role:gill.AccountRole.WRITABLE});}for(let d of i.readonlyIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${i.lookupTableAddress} does not contain address at index ${d}`);a.push({address:u,role:gill.AccountRole.READONLY});}}for(let i of s?.filter(o=>o.address!==e)??[]){let o=a.findIndex(d=>d.address===i.address);o===-1?a.push({address:i.address,role:gill.AccountRole.READONLY_SIGNER,signer:i}):a[o].role===gill.AccountRole.READONLY||a[o].role===gill.AccountRole.READONLY_SIGNER?a[o]={address:i.address,role:gill.AccountRole.READONLY_SIGNER,signer:i}:(a[o].role===gill.AccountRole.WRITABLE||a[o].role===gill.AccountRole.WRITABLE_SIGNER)&&(a[o]={address:i.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:i});}return {accountMetas:a,addressLookupTableAccounts:c,transactionMessage:t}}async function Bd({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:a=[],jitoBundlesTipAmount:i,compressed:o=false}){let d=await Ie(e),{accountMetas:u,addressLookupTableAccounts:g}=await Ar({transactionMessageBytes:r,walletAddress:d,additionalSigners:a,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(F(c)),y.push(o?pi({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):di({transactionBuffer:n,payer:s.address,settings:e})),i&&y.push(Hi({payer:s,tipAmount:i})),{instructions:y,addressLookupTableAccounts:g}}async function wd({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:a=[],compressed:i=false,simulateProof:o=false,cachedAccounts:d}){let u=de(s),g=await re(e),y=await Ie(g),[{accountMetas:f,addressLookupTableAccounts:T,transactionMessage:I},{settingsReadonlyArgs:D,proof:v,packedAccounts:S}]=await Promise.all([Ar({transactionMessageBytes:r,walletAddress:y,additionalSigners:u.filter(L=>!(L instanceof C)),addressesByLookupTableAddress:c}),pe(i,e,n,o,d)]);S.addPreAccounts(f);let x=u.filter(L=>L instanceof C),O=[];for(let L of x){let le=a.length,{domainConfig:ae,verifyArgs:Ee,signature:Ce,publicKey:Wt,message:_t}=H(L,le);_t&&Ce&&Wt&&a.push({message:_t,signature:Ce,publicKey:Wt}),ae&&(S.addPreAccounts([{address:ae,role:gill.AccountRole.READONLY}]),Ee?.__option==="Some"&&O.push({domainConfigKey:ae,verifyArgs:Ee.value}));}let{remainingAccounts:N,systemOffset:V}=S.toAccountMetas(),_=[];a.length>0&&_.push(F(a));let K=nC(I,f);if(i){if(!t||!D)throw new Error("Payer not found or proof args is missing.");let L=b(v,V);_.push(Pi({secp256r1VerifyArgs:O,transactionMessage:K,settingsReadonlyArgs:D,compressedProofArgs:L,payer:t,remainingAccounts:N}));}else _.push(Ii({secp256r1VerifyArgs:O,settings:g,transactionMessage:K,remainingAccounts:N}));return {instructions:_,addressLookupTableAccounts:T}}function nC(e,n){if(e.version==="legacy")throw new Error("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:new Uint8Array(r.data??[])})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(s=>s.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function bw({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:a,compressed:i=false}){let o=de(s),d=await re(e),u=await Ie(d),{settingsReadonlyArgs:g,proof:y,packedAccounts:f}=await pe(i,e,n,false,t),T=[],I=[];for(let x of o)if(x instanceof C){let O=T.length,{domainConfig:N,verifyArgs:V,signature:_,publicKey:K,message:L}=H(x,O);L&&_&&K&&T.push({message:L,signature:_,publicKey:K}),N&&(f.addPreAccounts([{address:N,role:gill.AccountRole.READONLY}]),V?.__option==="Some"&&I.push({domainConfigKey:N,verifyArgs:V.value}));}else f.addPreAccounts([{address:x.address,role:gill.AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:D,systemOffset:v}=f.toAccountMetas(),S=[];if(T.length>0&&S.push(F(T)),i){if(!a||!g)throw new Error("Payer not found or proof args is missing.");let x=b(y,v);S.push(Vc({amount:c,settingsReadonlyArgs:g,compressedProofArgs:x,payer:a,secp256r1VerifyArgs:I,source:u,destination:r,remainingAccounts:D}));}else S.push(Lc({amount:c,secp256r1VerifyArgs:I,source:u,destination:r,settings:d,remainingAccounts:D}));return S}async function Nw({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:a,payer:i,tokenProgram:o,compressed:d=false}){let u=de(t),g=await re(e),y=await Ie(g),[f,T]=await Promise.all([programs.getAssociatedTokenAccountAddress(s,y,o),programs.getAssociatedTokenAccountAddress(s,r,o)]),{settingsReadonlyArgs:I,proof:D,packedAccounts:v}=await pe(d,e,n,false,c),S=[],x=[];for(let _ of u)if(_ instanceof C){let K=S.length,{domainConfig:L,verifyArgs:le,signature:ae,publicKey:Ee,message:Ce}=H(_,K);Ce&&ae&&Ee&&S.push({message:Ce,signature:ae,publicKey:Ee}),L&&(v.addPreAccounts([{address:L,role:gill.AccountRole.READONLY}]),le?.__option==="Some"&&x.push({domainConfigKey:L,verifyArgs:le.value}));}else v.addPreAccounts([{address:_.address,role:gill.AccountRole.READONLY_SIGNER,signer:_}]);let{remainingAccounts:O,systemOffset:N}=v.toAccountMetas(),V=[];if(S.length>0&&V.push(F(S)),d){if(!i||!I)throw new Error("Payer not found or proof args is missing.");let _=b(D,N);V.push(Xc({amount:a,settingsReadonlyArgs:I,compressedProofArgs:_,payer:i,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:f,destination:r,destinationTokenAccount:T,mint:s,tokenProgram:o,remainingAccounts:O}));}else V.push(Kc({amount:a,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:f,destination:r,destinationTokenAccount:T,settings:g,mint:s,tokenProgram:o,remainingAccounts:O}));return V}async function Zw({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:a}){let i=await js(te(),s),o=i.data.multiWalletSettings,{settingsReadonlyArgs:d,proof:u,packedAccounts:g}=await pe(c,e,n,false,a),{remainingAccounts:y,systemOffset:f}=g.toAccountMetas(),{domainConfig:T,verifyArgs:I,message:D,signature:v,publicKey:S}=H(r),x=[];if(D&&v&&S&&x.push(F([{message:D,signature:v,publicKey:S}])),c){if(!t||!d)throw new Error("Payer not found or proof args is missing.");let O=b(u,f);x.push(da({transactionBuffer:s,domainConfig:T,closer:r instanceof C?void 0:r,rentCollector:i.data.payer,secp256r1VerifyArgs:I,settingsReadonlyArgs:d,payer:t,compressedProofArgs:O,remainingAccounts:y}));}else x.push(na({transactionBuffer:s,domainConfig:T,closer:r instanceof C?void 0:r,settings:o,payer:i.data.payer,secp256r1VerifyArgs:I,remainingAccounts:[]}));return x}function Vd({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:a,preauthorizeExecution:i,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:y,message:f,signature:T,publicKey:I}=H(n),D=[];if(f&&T&&I&&D.push(F([{message:f,signature:T,publicKey:I}])),d){let{settingsReadonlyArgs:v,compressedProofArgs:S,remainingAccounts:x}=d;D.push(Ia({transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof C?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:u},settingsReadonlyArgs:v,compressedProofArgs:S,remainingAccounts:x}));}else D.push(pa({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof C?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:a,bufferExtendHashes:o,preauthorizeExecution:i,expectedSecp256r1Signers:u},remainingAccounts:[]}));return D}function Gd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,message:i,publicKey:o}=H(e),d=[];return i&&a&&o&&d.push(F([{message:i,signature:a,publicKey:o}])),s?d.push(_a({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Pa({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,remainingAccounts:[]})),d}function Fd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Ka({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):Na({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function zd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:a,publicKey:i,message:o}=H(n),d=[];return o&&a&&i&&d.push(F([{message:o,signature:a,publicKey:i}])),s?d.push(ni({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Xa({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,remainingAccounts:[]})),d}async function Lk({message:e,signer:n,popUp:r}){let s=await ar({authUrl:`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"message",payload:e},signer:n,popUp:r,additionalInfo:rr()});return {...s,signer:new ie(s.signer),userAddressTreeIndex:s.userAddressTree?await or(s.userAddressTree):void 0}}async function Hk({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){let c=await ar({authUrl:`${he()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"transaction",payload:JSON.stringify({transactionActionType:e,transactionAddress:n,transactionMessageBytes:ir(r)})},additionalInfo:rr(),signer:s,popUp:t});return {...c,signer:new ie(c.signer),userAddressTreeIndex:c.userAddressTree?await or(c.userAddressTree):void 0}}async function Kk({message:e,response:n,expectedRPID:r=Ji(),expectedOrigin:s=he()}){let{verified:t}=await server.verifyAuthenticationResponse({response:n.authResponse,expectedChallenge:ir(new TextEncoder().encode(e)),expectedOrigin:s,expectedRPID:r,requireUserVerification:false,credential:{id:n.authResponse.id,publicKey:pd(n.signer.toString()),counter:0}});return t}async function n2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o,compressed:d=false,bufferIndex:u=Math.floor(Math.random()*255),additionalVoters:g=[],additionalSigners:y=[],chunkSize:f=Math.ceil(s.length/2),cachedAccounts:T}){let I=await re(n),D=await sd(I,t instanceof C?t:t.address,u),v=[],S=[];for(let z=0;z<s.length;z+=f){let jn=s.subarray(z,z+f);v.push(jn),S.push(sha256.sha256(jn));}let x=sha256.sha256(new Uint8Array(s)),{settingsReadonlyArgs:O,proof:N,packedAccounts:V}=await pe(d,n,r,false,T),{remainingAccounts:_,systemOffset:K}=V.toAccountMetas(),L=O?{settingsReadonlyArgs:O,compressedProofArgs:b(N,K),remainingAccounts:_,payer:e}:null,le=de([t,...c?[c]:[],...g]).filter(z=>z instanceof C).map(z=>({memberKey:ze(z),messageHash:sha256.sha256(new Uint8Array([...z.authData,...sha256.sha256(z.verifyArgs.clientDataJson)]))})),ae=Vd({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:u,payer:e,transactionBufferAddress:D,settings:I,creator:t,preauthorizeExecution:!c,bufferExtendHashes:S,compressedArgs:L,expectedSecp256r1Signers:le}),Ee=v.map(z=>Fd({transactionMessageBytes:z,transactionBufferAddress:D,settings:I,compressed:d})),Ce=g.map(z=>zd({voter:z,transactionBufferAddress:D,settings:I,compressedArgs:L})),Wt=Gd({compressedArgs:L,settings:I,executor:c,transactionBufferAddress:D}),{instructions:_t,addressLookupTableAccounts:Jd}=await Bd({compressed:d,settings:I,transactionMessageBytes:s,transactionBufferAddress:D,payer:e,additionalSigners:y,secp256r1VerifyInput:a,jitoBundlesTipAmount:i,addressesByLookupTableAddress:o}),l=z=>({payer:e,instructions:z,addressesByLookupTableAddress:Jd});return [l(ae),...Ee.map(z=>l([z])),...Ce.length?[l(Ce.flat())]:[],l(Wt),l(_t)]}var mr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=a=>{let i=s.get(a);return i===void 0&&(i={isSigner:false,isWritable:false,isInvoked:false},s.set(a,i)),i},c=t(r);c.isSigner=true,c.isWritable=true;for(let a of n){t(a.programAddress).isInvoked=false;for(let i of a.accounts??[]){let o=t(i.address);o.isSigner||=i.role===gill.AccountRole.READONLY_SIGNER||i.role===gill.AccountRole.WRITABLE_SIGNER,o.isWritable||=i.role===gill.AccountRole.WRITABLE||i.role===gill.AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),a={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let i=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [a,i]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&a.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],a=>!a.isSigner&&!a.isInvoked&&!a.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,a]of this.keyMetaMap.entries())if(r(a)){let i=c,o=n.findIndex(d=>d===i);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(i),this.keyMetaMap.delete(c);}}return [s,t]}};var pr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,a)=>{s.set(c,a);});let t=c=>{let a=s.get(c);if(a===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return a};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(a=>t(a.address))??[],data:c.data}))}};function Kd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=mr.compile(r,e),c=new Array,a={writable:[],readonly:[]},i=Object.entries(s??{});for(let y of i){let f=t.extractTableLookup(y);if(f!==void 0){let{addressTableLookup:T,drainedKeys:I}=f;c.push({readonlyIndexes:T.readonlyIndexes,readableIndices:T.readonlyIndexes,writableIndexes:T.writableIndexes,writableIndices:T.writableIndexes,lookupTableAddress:gill.address(T.lookupTableAddress)}),a.writable.push(...I.writable),a.readonly.push(...I.readonly);}}let[o,d]=t.getMessageComponents(),g=new pr(d,a).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function T2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Kd({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return Ui(s)}async function I2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:a,cachedAccounts:i,compressed:o=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await wd({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:a,simulateProof:d,cachedAccounts:i});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}
|
|
2
|
-
exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=no;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=po;exports.CHANGE_CONFIG_DISCRIMINATOR=uo;exports.COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=Io;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=Eo;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=vo;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=Oo;exports.CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR=No;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=Fo;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=qo;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=ec;exports.DOMAIN_CONFIG_DISCRIMINATOR=qn;exports.DelegateOp=Gt;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=Ac;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=Tc;exports.GLOBAL_COUNTER_DISCRIMINATOR=es;exports.KeyType=bt;exports.MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR=Cc;exports.MIGRATE_COMPRESSED_USERS_DISCRIMINATOR=Rc;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=dx;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=Px;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=Rx;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=qS;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=jS;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=ex;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=lx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=fx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=Sx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=gx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=ux;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=Ax;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=ox;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=Wx;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=cx;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=Tx;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=sx;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=JS;exports.MULTI_WALLET_ERROR__INVALID_SIGNED_MESSAGE=KS;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=hx;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=rx;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=nx;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=Dx;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=bx;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=ax;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=Mx;exports.MULTI_WALLET_ERROR__MISSING_USER_ARGS=ix;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=mx;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=XS;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=$S;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=Ux;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=YS;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER_NOT_ALLOWED=ZS;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=Cx;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=vx;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=Ex;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=tx;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=xx;exports.MULTI_WALLET_ERROR__TRANSACTION_MANAGER_NOT_ALLOWED=QS;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=Ix;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=px;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=yx;exports.MULTI_WALLET_PROGRAM_ADDRESS=A;exports.MultiWalletAccount=GS;exports.MultiWalletInstruction=FS;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=kc;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=_c;exports.Permission=xe;exports.Permissions=De;exports.SETTINGS_DISCRIMINATOR=ws;exports.Secp256r1Key=ie;exports.SignedSecp256r1Key=C;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=Yc;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=Fc;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=ca;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=ea;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=fa;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=ga;exports.TRANSACTION_BUFFER_DISCRIMINATOR=zs;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=va;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=Ma;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=Ga;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=Ba;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=ei;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=qa;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=gi;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=ci;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=Mi;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=fi;exports.UserRole=Ge;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=Zs;exports.addWhitelistedAddressTrees=SL;exports.changeConfig=rL;exports.closeTransactionBuffer=Zw;exports.compressSettingsAccount=TL;exports.configAction=YC;exports.convertMemberKeyToString=fd;exports.convertPubkeyCompressedToCose=pd;exports.convertPubkeyCoseToCompressed=lO;exports.createDomainConfig=EL;exports.createDomainUserAccounts=BL;exports.createGlobalCounter=HL;exports.createPopUp=gd;exports.createTransactionBuffer=Vd;exports.createTransactionManagerSigner=OI;exports.createUserAccounts=jL;exports.createWallet=KB;exports.decodeDomainConfig=Zn;exports.decodeGlobalCounter=rs;exports.decodeSettings=Ns;exports.decodeTransactionBuffer=Js;exports.decodeWhitelistedAddressTree=$s;exports.decompressSettingsAccount=tw;exports.disableDomainConfig=XL;exports.editDomainConfig=sB;exports.editTransactionManagerUrl=uB;exports.executeTransaction=Bd;exports.executeTransactionBuffer=Gd;exports.executeTransactionSync=wd;exports.extendTransactionBuffer=Fd;exports.fetchAllDomainConfig=uC;exports.fetchAllGlobalCounter=lC;exports.fetchAllMaybeDomainConfig=iu;exports.fetchAllMaybeGlobalCounter=Mu;exports.fetchAllMaybeSettings=By;exports.fetchAllMaybeTransactionBuffer=rm;exports.fetchAllMaybeWhitelistedAddressTree=Cm;exports.fetchAllSettings=Vh;exports.fetchAllTransactionBuffer=qh;exports.fetchAllWhitelistedAddressTree=Qh;exports.fetchDomainConfig=Xn;exports.fetchGlobalCounter=TC;exports.fetchMaybeDomainConfig=au;exports.fetchMaybeGlobalCounter=Du;exports.fetchMaybeSettings=Yr;exports.fetchMaybeSettingsAccountData=AI;exports.fetchMaybeTransactionBuffer=tm;exports.fetchMaybeUserAccountData=uI;exports.fetchMaybeWhitelistedAddressTree=Im;exports.fetchSettings=Hh;exports.fetchSettingsAccountData=$i;exports.fetchTransactionBuffer=js;exports.fetchUserAccountData=Xi;exports.fetchWhitelistedAddressTree=Qs;exports.getAddMemberArgsCodec=CC;exports.getAddMemberArgsDecoder=lr;exports.getAddMemberArgsEncoder=Tr;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=TE;exports.getAddWhitelistedAddressTreesInstruction=fE;exports.getAddWhitelistedAddressTreesInstructionAsync=oo;exports.getAddWhitelistedAddressTreesInstructionDataCodec=lE;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=so;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=nn;exports.getAuthEndpoint=he;exports.getChangeConfigCompressedDiscriminatorBytes=BE;exports.getChangeConfigCompressedInstruction=fo;exports.getChangeConfigCompressedInstructionDataCodec=wE;exports.getChangeConfigCompressedInstructionDataDecoder=lo;exports.getChangeConfigCompressedInstructionDataEncoder=To;exports.getChangeConfigDiscriminatorBytes=EE;exports.getChangeConfigInstruction=RE;exports.getChangeConfigInstructionAsync=go;exports.getChangeConfigInstructionDataCodec=PE;exports.getChangeConfigInstructionDataDecoder=Ao;exports.getChangeConfigInstructionDataEncoder=sn;exports.getCompiledInstructionCodec=hC;exports.getCompiledInstructionDecoder=Sr;exports.getCompiledInstructionEncoder=fr;exports.getCompressSettingsAccountDiscriminatorBytes=KE;exports.getCompressSettingsAccountInstruction=Mo;exports.getCompressSettingsAccountInstructionDataCodec=JE;exports.getCompressSettingsAccountInstructionDataDecoder=Do;exports.getCompressSettingsAccountInstructionDataEncoder=Co;exports.getCompressedAccountMetaCodec=bC;exports.getCompressedAccountMetaDecoder=rt;exports.getCompressedAccountMetaEncoder=tt;exports.getCompressedAccountMetaReadOnlyCodec=_C;exports.getCompressedAccountMetaReadOnlyDecoder=ct;exports.getCompressedAccountMetaReadOnlyEncoder=ot;exports.getCompressedProofCodec=BC;exports.getCompressedProofDecoder=hr;exports.getCompressedProofEncoder=Mr;exports.getCompressedSettingsAddressFromIndex=$;exports.getCompressedSettingsCodec=HC;exports.getCompressedSettingsDataCodec=zC;exports.getCompressedSettingsDataDecoder=dt;exports.getCompressedSettingsDataEncoder=it;exports.getCompressedSettingsDecoder=q;exports.getCompressedSettingsEncoder=at;exports.getComputeBudgetEstimate=Ki;exports.getConfigActionCodec=qC;exports.getConfigActionDecoder=yt;exports.getConfigActionEncoder=gt;exports.getCreateDomainConfigDiscriminatorBytes=eP;exports.getCreateDomainConfigInstruction=rP;exports.getCreateDomainConfigInstructionAsync=Ro;exports.getCreateDomainConfigInstructionDataCodec=tP;exports.getCreateDomainConfigInstructionDataDecoder=Po;exports.getCreateDomainConfigInstructionDataEncoder=yn;exports.getCreateDomainUserAccountDiscriminatorBytes=uP;exports.getCreateDomainUserAccountInstruction=gP;exports.getCreateDomainUserAccountInstructionAsync=Wo;exports.getCreateDomainUserAccountInstructionDataCodec=AP;exports.getCreateDomainUserAccountInstructionDataDecoder=Uo;exports.getCreateDomainUserAccountInstructionDataEncoder=pn;exports.getCreateGlobalCounterDiscriminatorBytes=SP;exports.getCreateGlobalCounterInstruction=IP;exports.getCreateGlobalCounterInstructionAsync=Bo;exports.getCreateGlobalCounterInstructionDataCodec=xP;exports.getCreateGlobalCounterInstructionDataDecoder=Lo;exports.getCreateGlobalCounterInstructionDataEncoder=ln;exports.getCreateMultiWalletCompressedDiscriminatorBytes=bP;exports.getCreateMultiWalletCompressedInstruction=UP;exports.getCreateMultiWalletCompressedInstructionAsync=Vo;exports.getCreateMultiWalletCompressedInstructionDataCodec=vP;exports.getCreateMultiWalletCompressedInstructionDataDecoder=Ho;exports.getCreateMultiWalletCompressedInstructionDataEncoder=fn;exports.getCreateUserAccountArgsCodec=eD;exports.getCreateUserAccountArgsDecoder=_r;exports.getCreateUserAccountArgsEncoder=Wr;exports.getCreateUserAccountsDiscriminatorBytes=NP;exports.getCreateUserAccountsInstruction=VP;exports.getCreateUserAccountsInstructionAsync=Ko;exports.getCreateUserAccountsInstructionDataCodec=HP;exports.getCreateUserAccountsInstructionDataDecoder=zo;exports.getCreateUserAccountsInstructionDataEncoder=xn;exports.getDecompressSettingsAccountDiscriminatorBytes=YP;exports.getDecompressSettingsAccountInstruction=Xo;exports.getDecompressSettingsAccountInstructionDataCodec=ZP;exports.getDecompressSettingsAccountInstructionDataDecoder=Zo;exports.getDecompressSettingsAccountInstructionDataEncoder=Yo;exports.getDelegateOpCodec=nD;exports.getDelegateOpDecoder=Re;exports.getDelegateOpEncoder=Pe;exports.getDisableDomainConfigDiscriminatorBytes=nR;exports.getDisableDomainConfigInstruction=nc;exports.getDisableDomainConfigInstructionDataCodec=sR;exports.getDisableDomainConfigInstructionDataDecoder=rc;exports.getDisableDomainConfigInstructionDataEncoder=tc;exports.getDomainConfigAddress=je;exports.getDomainConfigCodec=dC;exports.getDomainConfigDecoder=Yn;exports.getDomainConfigDiscriminatorBytes=iC;exports.getDomainConfigEncoder=cu;exports.getDomainConfigSize=AC;exports.getEditDomainConfigDiscriminatorBytes=gR;exports.getEditDomainConfigInstruction=yc;exports.getEditDomainConfigInstructionAsync=mR;exports.getEditDomainConfigInstructionDataCodec=yR;exports.getEditDomainConfigInstructionDataDecoder=gc;exports.getEditDomainConfigInstructionDataEncoder=Mn;exports.getEditMemberArgsCodec=aD;exports.getEditMemberArgsDecoder=br;exports.getEditMemberArgsEncoder=Rr;exports.getEditTransactionManagerUrlDiscriminatorBytes=CR;exports.getEditTransactionManagerUrlInstruction=Sc;exports.getEditTransactionManagerUrlInstructionDataCodec=DR;exports.getEditTransactionManagerUrlInstructionDataDecoder=fc;exports.getEditTransactionManagerUrlInstructionDataEncoder=lc;exports.getExpectedSecp256r1SignersCodec=AD;exports.getExpectedSecp256r1SignersDecoder=pt;exports.getExpectedSecp256r1SignersEncoder=mt;exports.getFeePayer=C_;exports.getGlobalAdditonalInfo=rr;exports.getGlobalAuthorizedClient=ji;exports.getGlobalCounterAddress=nd;exports.getGlobalCounterCodec=pC;exports.getGlobalCounterDecoder=ts;exports.getGlobalCounterDiscriminatorBytes=mC;exports.getGlobalCounterEncoder=Cu;exports.getGlobalCounterSize=fC;exports.getJitoTipsConfig=Nn;exports.getLightCpiSigner=eO;exports.getLightProtocolRpc=vt;exports.getLinkWalletArgsCodec=pD;exports.getLinkWalletArgsDecoder=Lr;exports.getLinkWalletArgsEncoder=Or;exports.getMemberCodec=SD;exports.getMemberDecoder=At;exports.getMemberEncoder=ut;exports.getMemberKeyCodec=CD;exports.getMemberKeyDecoder=j;exports.getMemberKeyEncoder=J;exports.getMigrateCompressedSettingsDiscriminatorBytes=UR;exports.getMigrateCompressedSettingsInstruction=hc;exports.getMigrateCompressedSettingsInstructionDataCodec=WR;exports.getMigrateCompressedSettingsInstructionDataDecoder=Mc;exports.getMigrateCompressedSettingsInstructionDataEncoder=Dc;exports.getMigrateCompressedUsersDiscriminatorBytes=HR;exports.getMigrateCompressedUsersInstruction=Uc;exports.getMigrateCompressedUsersInstructionDataCodec=VR;exports.getMigrateCompressedUsersInstructionDataDecoder=vc;exports.getMigrateCompressedUsersInstructionDataEncoder=bc;exports.getMultiWalletErrorMessage=WW;exports.getNativeTransferIntentCompressedDiscriminatorBytes=ob;exports.getNativeTransferIntentCompressedInstruction=Vc;exports.getNativeTransferIntentCompressedInstructionDataCodec=cb;exports.getNativeTransferIntentCompressedInstructionDataDecoder=Hc;exports.getNativeTransferIntentCompressedInstructionDataEncoder=Nc;exports.getNativeTransferIntentDiscriminatorBytes=YR;exports.getNativeTransferIntentInstruction=Lc;exports.getNativeTransferIntentInstructionAsync=XR;exports.getNativeTransferIntentInstructionDataCodec=ZR;exports.getNativeTransferIntentInstructionDataDecoder=Oc;exports.getNativeTransferIntentInstructionDataEncoder=hn;exports.getNewAuthorityArgsCodec=ED;exports.getNewAuthorityArgsDecoder=wr;exports.getNewAuthorityArgsEncoder=Br;exports.getOriginIndex=SO;exports.getPackedAddressTreeInfoCodec=bD;exports.getPackedAddressTreeInfoDecoder=lt;exports.getPackedAddressTreeInfoEncoder=Tt;exports.getPackedStateTreeInfoCodec=WD;exports.getPackedStateTreeInfoDecoder=st;exports.getPackedStateTreeInfoEncoder=nt;exports.getPermissionsCodec=LD;exports.getPermissionsDecoder=ve;exports.getPermissionsEncoder=be;exports.getProofArgsCodec=ND;exports.getProofArgsDecoder=h;exports.getProofArgsEncoder=M;exports.getRemoveMemberArgsCodec=FD;exports.getRemoveMemberArgsDecoder=Ur;exports.getRemoveMemberArgsEncoder=vr;exports.getRpId=Ji;exports.getSecp256r1PubkeyCodec=JD;exports.getSecp256r1PubkeyDecoder=ft;exports.getSecp256r1PubkeyEncoder=kr;exports.getSecp256r1SignatureOffsetsDataDecoder=ZI;exports.getSecp256r1SignatureOffsetsDataEncoder=YI;exports.getSecp256r1VerifyArgsCodec=YD;exports.getSecp256r1VerifyArgsDecoder=w;exports.getSecp256r1VerifyArgsEncoder=B;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=QD;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=Z;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=Y;exports.getSecp256r1VerifyInstruction=F;exports.getSecp256r1VerifyInstructionDataCodec=oL;exports.getSecp256r1VerifyInstructionDataDecoder=Pd;exports.getSecp256r1VerifyInstructionDataEncoder=Rd;exports.getSendAndConfirmTransaction=zi;exports.getSettingsCodec=Nh;exports.getSettingsCreationArgsCodec=nM;exports.getSettingsCreationArgsDecoder=xt;exports.getSettingsCreationArgsEncoder=St;exports.getSettingsDecoder=ks;exports.getSettingsDiscriminatorBytes=kh;exports.getSettingsEncoder=Ly;exports.getSettingsFromIndex=re;exports.getSettingsIndexWithAddressCodec=cM;exports.getSettingsIndexWithAddressDecoder=Hr;exports.getSettingsIndexWithAddressEncoder=Nr;exports.getSettingsMutArgsCodec=uM;exports.getSettingsMutArgsDecoder=Se;exports.getSettingsMutArgsEncoder=fe;exports.getSettingsReadonlyArgsCodec=mM;exports.getSettingsReadonlyArgsDecoder=ee;exports.getSettingsReadonlyArgsEncoder=Q;exports.getSettingsSize=Gh;exports.getSignedSecp256r1Key=fO;exports.getSignedTransactionManager=wO;exports.getSolanaRpc=te;exports.getSolanaRpcEndpoint=Fi;exports.getTokenTransferIntentCompressedDiscriminatorBytes=Mb;exports.getTokenTransferIntentCompressedInstruction=Xc;exports.getTokenTransferIntentCompressedInstructionAsync=Eb;exports.getTokenTransferIntentCompressedInstructionDataCodec=hb;exports.getTokenTransferIntentCompressedInstructionDataDecoder=Zc;exports.getTokenTransferIntentCompressedInstructionDataEncoder=Rn;exports.getTokenTransferIntentDiscriminatorBytes=mb;exports.getTokenTransferIntentInstruction=Kc;exports.getTokenTransferIntentInstructionAsync=Tb;exports.getTokenTransferIntentInstructionDataCodec=pb;exports.getTokenTransferIntentInstructionDataDecoder=zc;exports.getTokenTransferIntentInstructionDataEncoder=Pn;exports.getTransactionBufferAddress=sd;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=Fb;exports.getTransactionBufferCloseCompressedInstruction=da;exports.getTransactionBufferCloseCompressedInstructionDataCodec=zb;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=ia;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=aa;exports.getTransactionBufferCloseDiscriminatorBytes=Ob;exports.getTransactionBufferCloseInstruction=na;exports.getTransactionBufferCloseInstructionDataCodec=Lb;exports.getTransactionBufferCloseInstructionDataDecoder=ra;exports.getTransactionBufferCloseInstructionDataEncoder=ta;exports.getTransactionBufferCodec=jh;exports.getTransactionBufferCreateArgsCodec=fM;exports.getTransactionBufferCreateArgsDecoder=Ct;exports.getTransactionBufferCreateArgsEncoder=It;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=av;exports.getTransactionBufferCreateCompressedInstruction=Ia;exports.getTransactionBufferCreateCompressedInstructionDataCodec=iv;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=xa;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=Sa;exports.getTransactionBufferCreateDiscriminatorBytes=$b;exports.getTransactionBufferCreateInstruction=pa;exports.getTransactionBufferCreateInstructionDataCodec=Qb;exports.getTransactionBufferCreateInstructionDataDecoder=ma;exports.getTransactionBufferCreateInstructionDataEncoder=ya;exports.getTransactionBufferDecoder=Ks;exports.getTransactionBufferDiscriminatorBytes=Jh;exports.getTransactionBufferEncoder=em;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=hv;exports.getTransactionBufferExecuteCompressedInstruction=_a;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=Ev;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=Wa;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=Ua;exports.getTransactionBufferExecuteDiscriminatorBytes=Tv;exports.getTransactionBufferExecuteInstruction=Pa;exports.getTransactionBufferExecuteInstructionDataCodec=lv;exports.getTransactionBufferExecuteInstructionDataDecoder=Ea;exports.getTransactionBufferExecuteInstructionDataEncoder=ha;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=Vv;exports.getTransactionBufferExtendCompressedInstruction=Ka;exports.getTransactionBufferExtendCompressedInstructionDataCodec=Gv;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=za;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=Fa;exports.getTransactionBufferExtendDiscriminatorBytes=_v;exports.getTransactionBufferExtendInstruction=Na;exports.getTransactionBufferExtendInstructionDataCodec=Ov;exports.getTransactionBufferExtendInstructionDataDecoder=ka;exports.getTransactionBufferExtendInstructionDataEncoder=wa;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=oU;exports.getTransactionBufferVoteCompressedInstruction=ni;exports.getTransactionBufferVoteCompressedInstructionDataCodec=cU;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=ri;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=ti;exports.getTransactionBufferVoteDiscriminatorBytes=Zv;exports.getTransactionBufferVoteInstruction=Xa;exports.getTransactionBufferVoteInstructionDataCodec=Xv;exports.getTransactionBufferVoteInstructionDataDecoder=Za;exports.getTransactionBufferVoteInstructionDataEncoder=Ya;exports.getTransactionExecuteCompressedDiscriminatorBytes=IU;exports.getTransactionExecuteCompressedInstruction=pi;exports.getTransactionExecuteCompressedInstructionDataCodec=CU;exports.getTransactionExecuteCompressedInstructionDataDecoder=mi;exports.getTransactionExecuteCompressedInstructionDataEncoder=yi;exports.getTransactionExecuteDiscriminatorBytes=yU;exports.getTransactionExecuteInstruction=di;exports.getTransactionExecuteInstructionDataCodec=mU;exports.getTransactionExecuteInstructionDataDecoder=ii;exports.getTransactionExecuteInstructionDataEncoder=ai;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=NU;exports.getTransactionExecuteSyncCompressedInstruction=Pi;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=HU;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=Ei;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=hi;exports.getTransactionExecuteSyncDiscriminatorBytes=vU;exports.getTransactionExecuteSyncInstruction=Ii;exports.getTransactionExecuteSyncInstructionDataCodec=UU;exports.getTransactionExecuteSyncInstructionDataDecoder=xi;exports.getTransactionExecuteSyncInstructionDataEncoder=Si;exports.getTransactionMessageAddressTableLookupCodec=hM;exports.getTransactionMessageAddressTableLookupDecoder=Gr;exports.getTransactionMessageAddressTableLookupEncoder=Vr;exports.getTransactionMessageCodec=CM;exports.getTransactionMessageDecoder=Mt;exports.getTransactionMessageEncoder=Dt;exports.getUserAccountAddress=W;exports.getUserCodec=bM;exports.getUserCreationArgsCodec=_M;exports.getUserCreationArgsDecoder=ge;exports.getUserCreationArgsEncoder=Ae;exports.getUserDecoder=X;exports.getUserEncoder=_e;exports.getUserMutArgsCodec=wM;exports.getUserMutArgsDecoder=me;exports.getUserMutArgsEncoder=ye;exports.getUserReadOnlyArgsCodec=VM;exports.getUserReadOnlyArgsDecoder=Jr;exports.getUserReadOnlyArgsEncoder=Kr;exports.getUserReadOnlyOrMutateArgsCodec=KM;exports.getUserReadOnlyOrMutateArgsDecoder=et;exports.getUserReadOnlyOrMutateArgsEncoder=Qe;exports.getUserRoleCodec=ZM;exports.getUserRoleDecoder=We;exports.getUserRoleEncoder=Ue;exports.getWalletAddressFromIndex=od;exports.getWalletAddressFromSettings=Ie;exports.getWhitelistedAddressTreeCodec=$h;exports.getWhitelistedAddressTreeDecoder=Xs;exports.getWhitelistedAddressTreeDiscriminatorBytes=Xh;exports.getWhitelistedAddressTreeEncoder=xm;exports.getWhitelistedAddressTreeFromIndex=Vn;exports.getWhitelistedAddressTreeIndexFromAddress=or;exports.getWhitelistedAddressTreesAddress=Zi;exports.identifyMultiWalletAccount=hW;exports.identifyMultiWalletInstruction=EW;exports.initialize=M_;exports.isConfigAction=ZC;exports.isMultiWalletError=_W;exports.isUserReadOnlyOrMutateArgs=jM;exports.migrateSettings=lB;exports.migrateUsers=MB;exports.nativeTransferIntent=bw;exports.parseAddWhitelistedAddressTreesInstruction=SE;exports.parseChangeConfigCompressedInstruction=kE;exports.parseChangeConfigInstruction=bE;exports.parseCompressSettingsAccountInstruction=jE;exports.parseCreateDomainConfigInstruction=nP;exports.parseCreateDomainUserAccountInstruction=yP;exports.parseCreateGlobalCounterInstruction=CP;exports.parseCreateMultiWalletCompressedInstruction=WP;exports.parseCreateUserAccountsInstruction=GP;exports.parseDecompressSettingsAccountInstruction=XP;exports.parseDisableDomainConfigInstruction=oR;exports.parseEditDomainConfigInstruction=pR;exports.parseEditTransactionManagerUrlInstruction=MR;exports.parseMigrateCompressedSettingsInstruction=_R;exports.parseMigrateCompressedUsersInstruction=GR;exports.parseNativeTransferIntentCompressedInstruction=ab;exports.parseNativeTransferIntentInstruction=$R;exports.parseSecp256r1VerifyInstruction=cL;exports.parseTokenTransferIntentCompressedInstruction=Pb;exports.parseTokenTransferIntentInstruction=lb;exports.parseTransactionBufferCloseCompressedInstruction=Kb;exports.parseTransactionBufferCloseInstruction=Bb;exports.parseTransactionBufferCreateCompressedInstruction=dv;exports.parseTransactionBufferCreateInstruction=ev;exports.parseTransactionBufferExecuteCompressedInstruction=Pv;exports.parseTransactionBufferExecuteInstruction=fv;exports.parseTransactionBufferExtendCompressedInstruction=Fv;exports.parseTransactionBufferExtendInstruction=Lv;exports.parseTransactionBufferVoteCompressedInstruction=aU;exports.parseTransactionBufferVoteInstruction=$v;exports.parseTransactionExecuteCompressedInstruction=DU;exports.parseTransactionExecuteInstruction=pU;exports.parseTransactionExecuteSyncCompressedInstruction=VU;exports.parseTransactionExecuteSyncInstruction=WU;exports.pollJitoBundleConfirmation=LO;exports.prepareTransactionBundle=n2;exports.prepareTransactionMessage=T2;exports.prepareTransactionSync=I2;exports.retrieveTransactionManager=BO;exports.sendJitoBundle=_I;exports.signAndSendBundledTransactions=_O;exports.signAndSendTransaction=OO;exports.signMessageWithPasskey=Lk;exports.signTransactionWithPasskey=Hk;exports.tokenTransferIntent=Nw;exports.uninitialize=D_;exports.userReadOnlyOrMutateArgs=JM;exports.vaultTransactionMessageDeserialize=Wi;exports.vaultTransactionMessageSerialize=Ui;exports.verifyMessage=Kk;exports.voteTransactionBuffer=zd;//# sourceMappingURL=index.cjs.map
|
|
1
|
+
'use strict';var gill=require('gill'),yr=require('bn.js'),stateless_js=require('@lightprotocol/stateless.js'),sha256=require('@noble/hashes/sha256'),web3_js=require('@solana/web3.js'),programs=require('gill/programs'),superstruct=require('superstruct'),tinyCbor=require('@levischuck/tiny-cbor'),p256=require('@noble/curves/p256'),utils=require('@noble/curves/utils'),sha2=require('@noble/hashes/sha2'),server=require('@simplewebauthn/server');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var yr__default=/*#__PURE__*/_interopDefault(yr);var Gn=new Uint8Array([201,232,212,229,59,241,106,197]);function UC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Gn)}function ru(){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:Gn}))}function Fn(){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 WC(){return gill.combineCodec(ru(),Fn())}function zn(e){return gill.decodeAccount(e,Fn())}async function Kn(e,n,r){let s=await nu(e,n,r);return gill.assertAccountExists(s),s}async function nu(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return zn(s)}async function _C(e,n,r){let s=await su(e,n,r);return gill.assertAccountsExist(s),s}async function su(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>zn(t))}function OC(){return 846}var qn=new Uint8Array([42,206,176,58,175,129,130,233]);function wC(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(qn)}function fu(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()]]),e=>({...e,discriminator:qn}))}function Yn(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()]])}function kC(){return gill.combineCodec(fu(),Yn())}function Zn(e){return gill.decodeAccount(e,Yn())}async function NC(e,n,r){let s=await Su(e,n,r);return gill.assertAccountExists(s),s}async function Su(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Zn(s)}async function HC(e,n,r){let s=await xu(e,n,r);return gill.assertAccountsExist(s),s}async function xu(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Zn(t))}function VC(){return 24}function Sr(){return gill.getStructEncoder([["memberKey",J()],["permissions",be()],["verifyArgs",gill.getOptionEncoder(B())],["userArgs",$e()],["delegateOperation",Re()]])}function xr(){return gill.getStructDecoder([["memberKey",j()],["permissions",Ue()],["verifyArgs",gill.getOptionDecoder(w())],["userArgs",Qe()],["delegateOperation",ve()]])}function KC(){return gill.combineCodec(Sr(),xr())}function Ir(){return gill.getStructEncoder([["programAddressIndex",gill.getU8Encoder()],["accountIndices",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["data",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Cr(){return gill.getStructDecoder([["programAddressIndex",gill.getU8Decoder()],["accountIndices",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["data",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function qC(){return gill.combineCodec(Ir(),Cr())}function et(){return gill.getStructEncoder([["treeInfo",rt()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["outputStateTreeIndex",gill.getU8Encoder()]])}function tt(){return gill.getStructDecoder([["treeInfo",nt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["outputStateTreeIndex",gill.getU8Decoder()]])}function $C(){return gill.combineCodec(et(),tt())}function st(){return gill.getStructEncoder([["treeInfo",rt()],["address",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function ot(){return gill.getStructDecoder([["treeInfo",nt()],["address",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function rD(){return gill.combineCodec(st(),ot())}function Pr(){return gill.getStructEncoder([["a",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["b",gill.fixEncoderSize(gill.getBytesEncoder(),64)],["c",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function Rr(){return gill.getStructDecoder([["a",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["b",gill.fixDecoderSize(gill.getBytesDecoder(),64)],["c",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function oD(){return gill.combineCodec(Pr(),Rr())}function ct(){return gill.getStructEncoder([["data",gill.getOptionEncoder(at())]])}function q(){return gill.getStructDecoder([["data",gill.getOptionDecoder(it())]])}function dD(){return gill.combineCodec(ct(),q())}function at(){return gill.getStructEncoder([["threshold",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["index",gill.getU128Encoder()],["multiWalletBump",gill.getU8Encoder()],["members",gill.getArrayEncoder(dt())],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function it(){return gill.getStructDecoder([["threshold",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["index",gill.getU128Decoder()],["multiWalletBump",gill.getU8Decoder()],["members",gill.getArrayDecoder(ut())],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function yD(){return gill.combineCodec(at(),it())}function At(){return gill.getDiscriminatedUnionEncoder([["EditPermissions",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Ur())])]])],["AddMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(Sr())])]])],["RemoveMembers",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getArrayEncoder(_r())])]])],["SetThreshold",gill.getStructEncoder([["fields",gill.getTupleEncoder([gill.getU8Encoder()])]])]])}function gt(){return gill.getDiscriminatedUnionDecoder([["EditPermissions",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Wr())])]])],["AddMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(xr())])]])],["RemoveMembers",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getArrayDecoder(Or())])]])],["SetThreshold",gill.getStructDecoder([["fields",gill.getTupleDecoder([gill.getU8Decoder()])]])]])}function lD(){return gill.combineCodec(At(),gt())}function fD(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function SD(e,n){return n.__kind===e}function Lr(){return gill.getStructEncoder([["member",gill.getAddressEncoder()],["role",We()],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userCreationArgs",Ae()]])}function Br(){return gill.getStructDecoder([["member",gill.getAddressDecoder()],["role",_e()],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userCreationArgs",ge()]])}function DD(){return gill.combineCodec(Lr(),Br())}var zt=(s=>(s[s.Add=0]="Add",s[s.Remove=1]="Remove",s[s.Ignore=2]="Ignore",s))(zt||{});function Re(){return gill.getEnumEncoder(zt)}function ve(){return gill.getEnumDecoder(zt)}function ED(){return gill.combineCodec(Re(),ve())}function Ur(){return gill.getStructEncoder([["memberKey",J()],["permissions",be()],["userArgs",gill.getOptionEncoder(ye())],["delegateOperation",Re()]])}function Wr(){return gill.getStructDecoder([["memberKey",j()],["permissions",Ue()],["userArgs",gill.getOptionDecoder(me())],["delegateOperation",ve()]])}function bD(){return gill.combineCodec(Ur(),Wr())}function yt(){return gill.getStructEncoder([["memberKey",J()],["messageHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function mt(){return gill.getStructDecoder([["memberKey",j()],["messageHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function OD(){return gill.combineCodec(yt(),mt())}function wr(){return gill.getStructEncoder([["settingsMutArgs",fe()],["transactionManager",gill.getOptionEncoder(ye())]])}function kr(){return gill.getStructDecoder([["settingsMutArgs",Se()],["transactionManager",gill.getOptionDecoder(me())]])}function kD(){return gill.combineCodec(wr(),kr())}function dt(){return gill.getStructEncoder([["pubkey",J()],["permissions",be()],["role",gill.getU8Encoder()],["userAddressTreeIndex",gill.getU8Encoder()]])}function ut(){return gill.getStructDecoder([["pubkey",j()],["permissions",Ue()],["role",gill.getU8Decoder()],["userAddressTreeIndex",gill.getU8Decoder()]])}function GD(){return gill.combineCodec(dt(),ut())}function J(){return gill.getStructEncoder([["keyType",gill.getU8Encoder()],["key",gill.fixEncoderSize(gill.getBytesEncoder(),33)]])}function j(){return gill.getStructDecoder([["keyType",gill.getU8Decoder()],["key",gill.fixDecoderSize(gill.getBytesDecoder(),33)]])}function KD(){return gill.combineCodec(J(),j())}function Nr(){return gill.getStructEncoder([["authorityCreationArgs",Ae()],["compressedProofArgs",M()]])}function Hr(){return gill.getStructDecoder([["authorityCreationArgs",ge()],["compressedProofArgs",h()]])}function YD(){return gill.combineCodec(Nr(),Hr())}function pt(){return gill.getStructEncoder([["addressMerkleTreePubkeyIndex",gill.getU8Encoder()],["addressQueuePubkeyIndex",gill.getU8Encoder()],["rootIndex",gill.getU16Encoder()]])}function Tt(){return gill.getStructDecoder([["addressMerkleTreePubkeyIndex",gill.getU8Decoder()],["addressQueuePubkeyIndex",gill.getU8Decoder()],["rootIndex",gill.getU16Decoder()]])}function $D(){return gill.combineCodec(pt(),Tt())}function rt(){return gill.getStructEncoder([["rootIndex",gill.getU16Encoder()],["proveByIndex",gill.getBooleanEncoder()],["merkleTreePubkeyIndex",gill.getU8Encoder()],["queuePubkeyIndex",gill.getU8Encoder()],["leafIndex",gill.getU32Encoder()]])}function nt(){return gill.getStructDecoder([["rootIndex",gill.getU16Decoder()],["proveByIndex",gill.getBooleanDecoder()],["merkleTreePubkeyIndex",gill.getU8Decoder()],["queuePubkeyIndex",gill.getU8Decoder()],["leafIndex",gill.getU32Decoder()]])}function tM(){return gill.combineCodec(rt(),nt())}function be(){return gill.getStructEncoder([["mask",gill.getU8Encoder()]])}function Ue(){return gill.getStructDecoder([["mask",gill.getU8Decoder()]])}function sM(){return gill.combineCodec(be(),Ue())}function M(){return gill.getStructEncoder([["proof",gill.getOptionEncoder(Pr())],["lightCpiAccountsStartIndex",gill.getU8Encoder()]])}function h(){return gill.getStructDecoder([["proof",gill.getOptionDecoder(Rr())],["lightCpiAccountsStartIndex",gill.getU8Decoder()]])}function iM(){return gill.combineCodec(M(),h())}function _r(){return gill.getStructEncoder([["memberKey",J()],["userArgs",$e()]])}function Or(){return gill.getStructDecoder([["memberKey",j()],["userArgs",Qe()]])}function gM(){return gill.combineCodec(_r(),Or())}function Vr(){return gill.getTupleEncoder([gill.fixEncoderSize(gill.getBytesEncoder(),33)])}function lt(){return gill.getTupleDecoder([gill.fixDecoderSize(gill.getBytesDecoder(),33)])}function pM(){return gill.combineCodec(Vr(),lt())}function B(){return gill.getStructEncoder([["signedMessageIndex",gill.getU8Encoder()],["slotNumber",gill.getU64Encoder()],["originIndex",gill.getU8Encoder()],["crossOrigin",gill.getBooleanEncoder()],["truncatedClientDataJson",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["requestedClientAndDeviceHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)]])}function w(){return gill.getStructDecoder([["signedMessageIndex",gill.getU8Decoder()],["slotNumber",gill.getU64Decoder()],["originIndex",gill.getU8Decoder()],["crossOrigin",gill.getBooleanDecoder()],["truncatedClientDataJson",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["requestedClientAndDeviceHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)]])}function fM(){return gill.combineCodec(B(),w())}function Y(){return gill.getStructEncoder([["domainConfigKey",gill.getAddressEncoder()],["verifyArgs",B()]])}function Z(){return gill.getStructDecoder([["domainConfigKey",gill.getAddressDecoder()],["verifyArgs",w()]])}function CM(){return gill.combineCodec(Y(),Z())}function ft(){return gill.getStructEncoder([["addressTreeInfo",pt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function St(){return gill.getStructDecoder([["addressTreeInfo",Tt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function EM(){return gill.combineCodec(ft(),St())}function Gr(){return gill.getStructEncoder([["index",gill.getU128Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()]])}function Fr(){return gill.getStructDecoder([["index",gill.getU128Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()]])}function vM(){return gill.combineCodec(Gr(),Fr())}function fe(){return gill.getStructEncoder([["accountMeta",et()],["data",ct()]])}function Se(){return gill.getStructDecoder([["accountMeta",tt()],["data",q()]])}function _M(){return gill.combineCodec(fe(),Se())}function Q(){return gill.getStructEncoder([["accountMeta",st()],["data",ct()]])}function ee(){return gill.getStructDecoder([["accountMeta",ot()],["data",q()]])}function wM(){return gill.combineCodec(Q(),ee())}function xt(){return gill.getStructEncoder([["bufferIndex",gill.getU8Encoder()],["preauthorizeExecution",gill.getBooleanEncoder()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["finalBufferHash",gill.fixEncoderSize(gill.getBytesEncoder(),32)],["finalBufferSize",gill.getU16Encoder()],["expectedSecp256r1Signers",gill.getOptionEncoder(gill.getArrayEncoder(yt()))]])}function It(){return gill.getStructDecoder([["bufferIndex",gill.getU8Decoder()],["preauthorizeExecution",gill.getBooleanDecoder()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["finalBufferHash",gill.fixDecoderSize(gill.getBytesDecoder(),32)],["finalBufferSize",gill.getU16Decoder()],["expectedSecp256r1Signers",gill.getOptionDecoder(gill.getArrayDecoder(mt()))]])}function VM(){return gill.combineCodec(xt(),It())}function Ct(){return gill.getStructEncoder([["numSigners",gill.getU8Encoder()],["numWritableSigners",gill.getU8Encoder()],["numWritableNonSigners",gill.getU8Encoder()],["numAccountKeys",gill.getU8Encoder()],["instructions",gill.getArrayEncoder(Ir())],["addressTableLookups",gill.getArrayEncoder(zr())]])}function Dt(){return gill.getStructDecoder([["numSigners",gill.getU8Decoder()],["numWritableSigners",gill.getU8Decoder()],["numWritableNonSigners",gill.getU8Decoder()],["numAccountKeys",gill.getU8Decoder()],["instructions",gill.getArrayDecoder(Cr())],["addressTableLookups",gill.getArrayDecoder(Kr())]])}function KM(){return gill.combineCodec(Ct(),Dt())}function zr(){return gill.getStructEncoder([["lookupTableAddressIndex",gill.getU8Encoder()],["writableIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["readonlyIndexes",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]])}function Kr(){return gill.getStructDecoder([["lookupTableAddressIndex",gill.getU8Decoder()],["writableIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["readonlyIndexes",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function qM(){return gill.combineCodec(zr(),Kr())}function Oe(){return gill.getStructEncoder([["member",J()],["domainConfig",gill.getOptionEncoder(gill.getAddressEncoder())],["role",We()],["delegatedTo",gill.getOptionEncoder(Gr())],["transactionManagerUrl",gill.getOptionEncoder(gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder()))],["userAddressTreeIndex",gill.getU8Encoder()]])}function X(){return gill.getStructDecoder([["member",j()],["domainConfig",gill.getOptionDecoder(gill.getAddressDecoder())],["role",_e()],["delegatedTo",gill.getOptionDecoder(Fr())],["transactionManagerUrl",gill.getOptionDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder()))],["userAddressTreeIndex",gill.getU8Decoder()]])}function $M(){return gill.combineCodec(Oe(),X())}function Ae(){return gill.getStructEncoder([["addressTreeInfo",pt()],["outputStateTreeIndex",gill.getU8Encoder()]])}function ge(){return gill.getStructDecoder([["addressTreeInfo",Tt()],["outputStateTreeIndex",gill.getU8Decoder()]])}function rh(){return gill.combineCodec(Ae(),ge())}function ye(){return gill.getStructEncoder([["accountMeta",et()],["data",Oe()]])}function me(){return gill.getStructDecoder([["accountMeta",tt()],["data",X()]])}function ch(){return gill.combineCodec(ye(),me())}function qr(){return gill.getStructEncoder([["accountMeta",st()],["data",Oe()]])}function Yr(){return gill.getStructDecoder([["accountMeta",ot()],["data",X()]])}function uh(){return gill.combineCodec(qr(),Yr())}function $e(){return gill.getDiscriminatedUnionEncoder([["Read",gill.getStructEncoder([["fields",gill.getTupleEncoder([qr()])]])],["Mutate",gill.getStructEncoder([["fields",gill.getTupleEncoder([ye()])]])]])}function Qe(){return gill.getDiscriminatedUnionDecoder([["Read",gill.getStructDecoder([["fields",gill.getTupleDecoder([Yr()])]])],["Mutate",gill.getStructDecoder([["fields",gill.getTupleDecoder([me()])]])]])}function mh(){return gill.combineCodec($e(),Qe())}function ph(e,n){return Array.isArray(n)?{__kind:e,fields:n}:{__kind:e,...n??{}}}function Th(e,n){return n.__kind===e}var He=(t=>(t[t.Member=0]="Member",t[t.PermanentMember=1]="PermanentMember",t[t.TransactionManager=2]="TransactionManager",t[t.Administrator=3]="Administrator",t))(He||{});function We(){return gill.getEnumEncoder(He)}function _e(){return gill.getEnumDecoder(He)}function Sh(){return gill.combineCodec(We(),_e())}var _s=new Uint8Array([223,179,163,190,177,224,67,173]);function aE(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(_s)}function _y(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["index",gill.getU128Encoder()],["members",gill.getArrayEncoder(dt(),{size:4})],["membersLen",gill.getU8Encoder()],["threshold",gill.getU8Encoder()],["multiWalletBump",gill.getU8Encoder()],["bump",gill.getU8Encoder()],["settingsAddressTreeIndex",gill.getU8Encoder()],["padding",gill.fixEncoderSize(gill.getBytesEncoder(),7)]]),e=>({...e,discriminator:_s}))}function Os(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["index",gill.getU128Decoder()],["members",gill.getArrayDecoder(ut(),{size:4})],["membersLen",gill.getU8Decoder()],["threshold",gill.getU8Decoder()],["multiWalletBump",gill.getU8Decoder()],["bump",gill.getU8Decoder()],["settingsAddressTreeIndex",gill.getU8Decoder()],["padding",gill.fixDecoderSize(gill.getBytesDecoder(),7)]])}function iE(){return gill.combineCodec(_y(),Os())}function Ls(e){return gill.decodeAccount(e,Os())}async function dE(e,n,r){let s=await $r(e,n,r);return gill.assertAccountExists(s),s}async function $r(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Ls(s)}async function uE(e,n,r){let s=await Oy(e,n,r);return gill.assertAccountsExist(s),s}async function Oy(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Ls(t))}function AE(){return 184}var Hs=new Uint8Array([90,36,35,219,93,225,110,96]);function pE(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Hs)}function em(){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",J()],["executor",J()],["bufferExtendHashes",gill.getArrayEncoder(gill.fixEncoderSize(gill.getBytesEncoder(),32))],["voters",gill.getArrayEncoder(J())],["expectedSecp256r1Signers",gill.getOptionEncoder(gill.getArrayEncoder(yt()))],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Hs}))}function Vs(){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",j()],["executor",j()],["bufferExtendHashes",gill.getArrayDecoder(gill.fixDecoderSize(gill.getBytesDecoder(),32))],["voters",gill.getArrayDecoder(j())],["expectedSecp256r1Signers",gill.getOptionDecoder(gill.getArrayDecoder(mt()))],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function TE(){return gill.combineCodec(em(),Vs())}function Gs(e){return gill.decodeAccount(e,Vs())}async function Fs(e,n,r){let s=await tm(e,n,r);return gill.assertAccountExists(s),s}async function tm(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return Gs(s)}async function lE(e,n,r){let s=await rm(e,n,r);return gill.assertAccountsExist(s),s}async function rm(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>Gs(t))}var Js=new Uint8Array([105,23,173,2,197,255,80,87]);function xE(){return gill.fixEncoderSize(gill.getBytesEncoder(),8).encode(Js)}function xm(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),8)],["whitelistedAddressTrees",gill.getArrayEncoder(gill.getAddressEncoder())],["bump",gill.getU8Encoder()]]),e=>({...e,discriminator:Js}))}function js(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),8)],["whitelistedAddressTrees",gill.getArrayDecoder(gill.getAddressDecoder())],["bump",gill.getU8Decoder()]])}function IE(){return gill.combineCodec(xm(),js())}function qs(e){return gill.decodeAccount(e,js())}async function Ys(e,n,r){let s=await Im(e,n,r);return gill.assertAccountExists(s),s}async function Im(e,n,r){let s=await gill.fetchEncodedAccount(e,n,r);return qs(s)}async function CE(e,n,r){let s=await Cm(e,n,r);return gill.assertAccountsExist(s),s}async function Cm(e,n,r){return (await gill.fetchEncodedAccounts(e,n,r)).map(t=>qs(t))}function m({args:e}){if(!e)return [];let{remainingAccounts:n}=e;return n.map(r=>r.signer?{address:r.address,role:r.role,signer:r.signer}:{address:r.address,role:r.role})}function Xs(e){if(e==null)throw new Error("Expected a value but received null or undefined.");return e}function G(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 p(e,n){return r=>{if(!r.value)return Object.freeze({address:e,role:gill.AccountRole.READONLY});let s=r.isWritable?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY;return Object.freeze({address:G(r.value),role:Zs(r.value)?gill.upgradeRoleToSigner(s):s,...Zs(r.value)?{signer:r.value}:{}})}}function Zs(e){return !!e&&typeof e=="object"&&"address"in e&&gill.isTransactionSigner(e)}var Qs=new Uint8Array([7]);function NE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Qs)}function cn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["addressTree",gill.getAddressEncoder()]]),e=>({...e,discriminator:Qs}))}function eo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["addressTree",gill.getAddressDecoder()]])}function HE(){return gill.combineCodec(cn(),eo())}async function to(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:cn().encode(c),programAddress:r})}function VE(e,n){let r=n?.programAddress??A,t={whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.whitelistedAddressTrees),o(t.payer),o(t.systemProgram),...a],data:cn().encode(c),programAddress:r})}function GE(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{whitelistedAddressTrees:r(),payer:r(),systemProgram:r()},data:eo().decode(e.data)}}var oo=new Uint8Array([8]);function YE(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(oo)}function an(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsIndex",gill.getU128Encoder()],["configActions",gill.getArrayEncoder(At())],["compressedProofArgs",gill.getOptionEncoder(M())]]),e=>({...e,discriminator:oo}))}function co(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsIndex",gill.getU128Decoder()],["configActions",gill.getArrayDecoder(gt())],["compressedProofArgs",gill.getOptionDecoder(h())]])}function ZE(){return gill.combineCodec(an(),co())}async function ao(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.settings.value||(t.settings.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getU128Encoder().encode(Xs(c.settingsIndex))]})),t.authority.value||(t.authority.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([109,117,108,116,105,95,119,97,108,108,101,116])),gill.getAddressEncoder().encode(G(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:an().encode(c),programAddress:r})}function XE(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.authority),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:an().encode(c),programAddress:r})}function $E(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),authority:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:co().decode(e.data)}}var Ao=new Uint8Array([19]);function oP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ao)}function go(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["configActions",gill.getArrayEncoder(At())],["settingsMut",fe()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ao}))}function yo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["configActions",gill.getArrayDecoder(gt())],["settingsMut",Se()],["compressedProofArgs",h()]])}function cP(){return gill.combineCodec(go(),yo())}function mo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.authority),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:go().encode(c),programAddress:r})}function aP(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),authority:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:yo().decode(e.data)}}var lo=new Uint8Array([16]);function mP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(lo)}function fo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",M()],["settingsMutArgs",fe()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:lo}))}function So(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",h()],["settingsMutArgs",Se()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function pP(){return gill.combineCodec(fo(),So())}function xo(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}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:fo().encode(c),programAddress:r})}function TP(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:So().decode(e.data)}}var Ro=new Uint8Array([0]);function DP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ro)}function un(){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",Ae()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ro}))}function vo(){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",ge()],["compressedProofArgs",h()]])}function MP(){return gill.combineCodec(un(),vo())}async function bo(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:un().encode(c),programAddress:r})}function hP(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},authority:{value:e.authority??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.payer),o(t.authority),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:un().encode(c),programAddress:r})}function EP(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),payer:r(),authority:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:vo().decode(e.data)}}var Wo=new Uint8Array([4]);function _P(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Wo)}function gn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",M()],["member",Vr()],["role",We()],["userAccountCreationArgs",Ae()],["linkWalletArgs",gill.getOptionEncoder(wr())]]),e=>({...e,discriminator:Wo}))}function _o(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",h()],["member",lt()],["role",_e()],["userAccountCreationArgs",ge()],["linkWalletArgs",gill.getOptionDecoder(kr())]])}function OP(){return gill.combineCodec(gn(),_o())}async function Oo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:gn().encode(c),programAddress:r})}function LP(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},authority:{value:e.authority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.authority),o(t.whitelistedAddressTrees),...a],data:gn().encode(c),programAddress:r})}function BP(e){if(e.accounts.length<4)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:r(),authority:r(),whitelistedAddressTrees:r()},data:_o().decode(e.data)}}var Bo=new Uint8Array([3]);function GP(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Bo)}function mn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:Bo}))}function wo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function FP(){return gill.combineCodec(mn(),wo())}async function ko(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=p(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:mn().encode({}),programAddress:r})}function zP(e,n){let r=n?.programAddress??A,t={globalCounter:{value:e.globalCounter??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let i=m(c),a=p(r);return Object.freeze({accounts:[a(t.globalCounter),a(t.payer),a(t.systemProgram),...i],data:mn().encode({}),programAddress:r})}function KP(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{globalCounter:r(),payer:r(),systemProgram:r()},data:wo().decode(e.data)}}var Vo=new Uint8Array([18]);function $P(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Vo)}function pn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["compressedProofArgs",M()],["settingsCreation",ft()],["userMutArgs",ye()],["settingsIndex",gill.getU128Encoder()],["delegateOperation",Re()]]),e=>({...e,discriminator:Vo}))}function Go(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["compressedProofArgs",h()],["settingsCreation",St()],["userMutArgs",me()],["settingsIndex",gill.getU128Decoder()],["delegateOperation",ve()]])}function QP(){return gill.combineCodec(pn(),Go())}async function Fo(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},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??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.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.globalCounter.value||(t.globalCounter.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([103,108,111,98,97,108,95,99,111,117,110,116,101,114]))]})),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:pn().encode(c),programAddress:r})}function eR(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},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},domainConfig:{value:e.domainConfig??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.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.initialMember),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.domainConfig),o(t.globalCounter),o(t.whitelistedAddressTrees),...a],data:pn().encode(c),programAddress:r})}function tR(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),initialMember:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s(),domainConfig:s(),globalCounter:r(),whitelistedAddressTrees:r()},data:Go().decode(e.data)}}var Ko=new Uint8Array([5]);function iR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ko)}function ln(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["compressedProofArgs",M()],["createUserArgs",gill.getArrayEncoder(Lr())]]),e=>({...e,discriminator:Ko}))}function Jo(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["compressedProofArgs",h()],["createUserArgs",gill.getArrayDecoder(Br())]])}function dR(){return gill.combineCodec(ln(),Jo())}async function jo(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]}));let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:ln().encode(c),programAddress:r})}function uR(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.systemProgram),o(t.whitelistedAddressTrees),...a],data:ln().encode(c),programAddress:r})}function AR(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),systemProgram:r(),whitelistedAddressTrees:r()},data:Jo().decode(e.data)}}var Zo=new Uint8Array([17]);function fR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Zo)}function Xo(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsMut",fe()],["compressedProofArgs",M()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:Zo}))}function $o(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsMut",Se()],["compressedProofArgs",h()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function SR(){return gill.combineCodec(Xo(),$o())}function Qo(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Xo().encode(c),programAddress:r})}function xR(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:$o().decode(e.data)}}var rc=new Uint8Array([2]);function ER(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(rc)}function nc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["disable",gill.getBooleanEncoder()]]),e=>({...e,discriminator:rc}))}function sc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["disable",gill.getBooleanDecoder()]])}function PR(){return gill.combineCodec(nc(),sc())}function oc(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},admin:{value:e.admin??null,isWritable:false}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.admin),...a],data:nc().encode(c),programAddress:r})}function RR(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{domainConfig:r(),admin:r()},data:sc().decode(e.data)}}var dc=new Uint8Array([1]);function LR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(dc)}function Sn(){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(Nr())]]),e=>({...e,discriminator:dc}))}function uc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["newOrigins",gill.getOptionDecoder(gill.getArrayDecoder(gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())))],["newAuthorityArgs",gill.getOptionDecoder(Hr())]])}function BR(){return gill.combineCodec(Sn(),uc())}async function wR(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.whitelistedAddressTrees.value||(t.whitelistedAddressTrees.value=await gill.getProgramDerivedAddress({programAddress:r,seeds:[gill.getBytesEncoder().encode(new Uint8Array([119,104,105,116,101,108,105,115,116,101,100,95,97,100,100,114,101,115,115,95,116,114,101,101,115]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:Sn().encode(c),programAddress:r})}function Ac(e,n){let r=n?.programAddress??A,t={domainConfig:{value:e.domainConfig??null,isWritable:true},authority:{value:e.authority??null,isWritable:true},newAuthority:{value:e.newAuthority??null,isWritable:false},whitelistedAddressTrees:{value:e.whitelistedAddressTrees??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.domainConfig),o(t.authority),o(t.newAuthority),o(t.whitelistedAddressTrees),o(t.systemProgram),...a],data:Sn().encode(c),programAddress:r})}function kR(e){if(e.accounts.length<5)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{domainConfig:r(),authority:r(),newAuthority:s(),whitelistedAddressTrees:s(),systemProgram:r()},data:uc().decode(e.data)}}var mc=new Uint8Array([6]);function KR(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(mc)}function pc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["userMutArgs",ye()],["transactionManagerUrl",gill.addEncoderSizePrefix(gill.getUtf8Encoder(),gill.getU32Encoder())],["compressedProofArgs",M()]]),e=>({...e,discriminator:mc}))}function Tc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["userMutArgs",me()],["transactionManagerUrl",gill.addDecoderSizePrefix(gill.getUtf8Decoder(),gill.getU32Decoder())],["compressedProofArgs",h()]])}function JR(){return gill.combineCodec(pc(),Tc())}function lc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:false}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.authority),...a],data:pc().encode(c),programAddress:r})}function jR(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Tc().decode(e.data)}}var xc=new Uint8Array([32]);function ev(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(xc)}function Ic(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",at()],["compressedProofArgs",M()],["settingsCreationArgs",ft()]]),e=>({...e,discriminator:xc}))}function Cc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",it()],["compressedProofArgs",h()],["settingsCreationArgs",St()]])}function tv(){return gill.combineCodec(Ic(),Cc())}function Dc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.authority),...a],data:Ic().encode(c),programAddress:r})}function rv(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Cc().decode(e.data)}}var Ec=new Uint8Array([31]);function dv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ec)}function Pc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",Oe()],["compressedProofArgs",M()],["userCreationArgs",Ae()]]),e=>({...e,discriminator:Ec}))}function Rc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",X()],["compressedProofArgs",h()],["userCreationArgs",ge()]])}function uv(){return gill.combineCodec(Pc(),Rc())}function vc(e,n){let r=n?.programAddress??A,t={authority:{value:e.authority??null,isWritable:true}},c={...e},i={args:c};t.authority.value||(t.authority.value="AMn21jT5RMZrv5hSvtkrWCMJFp3cUyeAx4AxKvF59xJZ");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.authority),...a],data:Pc().encode(c),programAddress:r})}function Av(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{authority:r()},data:Rc().decode(e.data)}}var Uc=new Uint8Array([29]);function fv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Uc)}function xn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:Uc}))}function Wc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function Sv(){return gill.combineCodec(xn(),Wc())}async function xv(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},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(G(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:xn().encode(c),programAddress:r})}function _c(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:xn().encode(c),programAddress:r})}function Iv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:Wc().decode(e.data)}}var Bc=new Uint8Array([27]);function Rv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Bc)}function wc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Bc}))}function kc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function vv(){return gill.combineCodec(wc(),kc())}function Nc(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},destination:{value:e.destination??null,isWritable:true},systemProgram:{value:e.systemProgram??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.destination),o(t.systemProgram),...a],data:wc().encode(c),programAddress:r})}function bv(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),destination:r(),systemProgram:r()},data:kc().decode(e.data)}}var Vc=new Uint8Array([30]);function wv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Vc)}function Cn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:Vc}))}function Gc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function kv(){return gill.combineCodec(Cn(),Gc())}async function Nv(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??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(G(t.settings.value)),gill.getBytesEncoder().encode(new Uint8Array([118,97,117,108,116]))]})),t.tokenProgram.value||(t.tokenProgram.value="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),t.sourceTokenAccount.value||(t.sourceTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(G(t.source.value)),gill.getAddressEncoder().encode(G(t.tokenProgram.value)),gill.getAddressEncoder().encode(G(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(G(t.destination.value)),gill.getAddressEncoder().encode(G(t.tokenProgram.value)),gill.getAddressEncoder().encode(G(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:Cn().encode(c),programAddress:r})}function Fc(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},source:{value:e.source??null,isWritable:true},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??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.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:Cn().encode(c),programAddress:r})}function Hv(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:Gc().decode(e.data)}}var jc=new Uint8Array([28]);function jv(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(jc)}function Dn(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["amount",gill.getU64Encoder()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:jc}))}function qc(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["amount",gill.getU64Decoder()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function qv(){return gill.combineCodec(Dn(),qc())}async function Yv(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},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??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.sourceTokenAccount.value||(t.sourceTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(G(t.source.value)),gill.getAddressEncoder().encode(G(t.tokenProgram.value)),gill.getAddressEncoder().encode(G(t.mint.value))]})),t.destinationTokenAccount.value||(t.destinationTokenAccount.value=await gill.getProgramDerivedAddress({programAddress:"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",seeds:[gill.getAddressEncoder().encode(G(t.destination.value)),gill.getAddressEncoder().encode(G(t.tokenProgram.value)),gill.getAddressEncoder().encode(G(t.mint.value))]})),t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:Dn().encode(c),programAddress:r})}function Yc(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},sourceTokenAccount:{value:e.sourceTokenAccount??null,isWritable:true},destination:{value:e.destination??null,isWritable:false},destinationTokenAccount:{value:e.destinationTokenAccount??null,isWritable:true},tokenProgram:{value:e.tokenProgram??null,isWritable:false},mint:{value:e.mint??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},associatedTokenProgram:{value:e.associatedTokenProgram??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.associatedTokenProgram.value||(t.associatedTokenProgram.value="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),o(t.source),o(t.sourceTokenAccount),o(t.destination),o(t.destinationTokenAccount),o(t.tokenProgram),o(t.mint),o(t.systemProgram),o(t.associatedTokenProgram),...a],data:Dn().encode(c),programAddress:r})}function Zv(e){if(e.accounts.length<11)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r(),source:r(),sourceTokenAccount:r(),destination:r(),destinationTokenAccount:r(),tokenProgram:r(),mint:r(),systemProgram:r(),associatedTokenProgram:r()},data:qc().decode(e.data)}}var $c=new Uint8Array([12]);function nb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode($c)}function Qc(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:$c}))}function ea(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function sb(){return gill.combineCodec(Qc(),ea())}function ta(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},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Qc().encode(c),programAddress:r})}function ob(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ea().decode(e.data)}}var sa=new Uint8Array([23]);function gb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(sa)}function oa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:sa}))}function ca(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function yb(){return gill.combineCodec(oa(),ca())}function aa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},rentCollector:{value:e.rentCollector??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},closer:{value:e.closer??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.rentCollector),o(t.domainConfig),o(t.transactionBuffer),o(t.closer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:oa().encode(c),programAddress:r})}function mb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),rentCollector:r(),domainConfig:s(),transactionBuffer:r(),closer:s(),slotHashSysvar:s(),instructionsSysvar:s()},data:ca().decode(e.data)}}var ua=new Uint8Array([9]);function Ib(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ua)}function Aa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",xt()],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:ua}))}function ga(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",It()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Cb(){return gill.combineCodec(Aa(),ga())}function ya(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...a],data:Aa().encode(c),programAddress:r})}function Db(e){if(e.accounts.length<8)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:ga().decode(e.data)}}var Ta=new Uint8Array([20]);function bb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ta)}function la(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["args",xt()],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ta}))}function fa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["args",It()],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function Ub(){return gill.combineCodec(la(),fa())}function Sa(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},creator:{value:e.creator??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.creator),o(t.systemProgram),o(t.instructionsSysvar),o(t.slotHashSysvar),...a],data:la().encode(c),programAddress:r})}function Wb(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),creator:s(),systemProgram:r(),instructionsSysvar:r(),slotHashSysvar:s()},data:fa().decode(e.data)}}var Ca=new Uint8Array([13]);function Nb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ca)}function Da(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:Ca}))}function Ma(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function Hb(){return gill.combineCodec(Da(),Ma())}function ha(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Da().encode(c),programAddress:r})}function Vb(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:Ma().decode(e.data)}}var Ra=new Uint8Array([24]);function qb(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ra)}function va(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ra}))}function ba(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function Yb(){return gill.combineCodec(va(),ba())}function Ua(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},executor:{value:e.executor??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.executor),o(t.transactionBuffer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:va().encode(c),programAddress:r})}function Zb(e){if(e.accounts.length<6)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),executor:s(),transactionBuffer:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ba().decode(e.data)}}var Oa=new Uint8Array([11]);function rU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Oa)}function La(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())]]),e=>({...e,discriminator:Oa}))}function Ba(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())]])}function nU(){return gill.combineCodec(La(),Ba())}function wa(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.transactionBuffer),...a],data:La().encode(c),programAddress:r})}function sU(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),transactionBuffer:r()},data:Ba().decode(e.data)}}var Ha=new Uint8Array([22]);function uU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ha)}function Va(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["buffer",gill.addEncoderSizePrefix(gill.getBytesEncoder(),gill.getU32Encoder())],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:Ha}))}function Ga(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["buffer",gill.addDecoderSizePrefix(gill.getBytesDecoder(),gill.getU32Decoder())],["settingsKey",gill.getAddressDecoder()]])}function AU(){return gill.combineCodec(Va(),Ga())}function Fa(e,n){let r=n?.programAddress??A,t={transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.transactionBuffer),...a],data:Va().encode(c),programAddress:r})}function gU(e){if(e.accounts.length<1)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{transactionBuffer:r()},data:Ga().decode(e.data)}}var Ja=new Uint8Array([10]);function SU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ja)}function ja(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())]]),e=>({...e,discriminator:Ja}))}function qa(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())]])}function xU(){return gill.combineCodec(ja(),qa())}function Ya(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:false},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:ja().encode(c),programAddress:r})}function IU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:qa().decode(e.data)}}var $a=new Uint8Array([21]);function RU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode($a)}function Qa(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["secp256r1VerifyArgs",gill.getOptionEncoder(B())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:$a}))}function ei(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["secp256r1VerifyArgs",gill.getOptionDecoder(w())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function vU(){return gill.combineCodec(Qa(),ei())}function ti(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},domainConfig:{value:e.domainConfig??null,isWritable:false},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true},voter:{value:e.voter??null,isWritable:false},systemProgram:{value:e.systemProgram??null,isWritable:false},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.systemProgram.value||(t.systemProgram.value="11111111111111111111111111111111"),t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.domainConfig),o(t.transactionBuffer),o(t.voter),o(t.systemProgram),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Qa().encode(c),programAddress:r})}function bU(e){if(e.accounts.length<7)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),domainConfig:s(),transactionBuffer:r(),voter:s(),systemProgram:r(),slotHashSysvar:s(),instructionsSysvar:s()},data:ei().decode(e.data)}}var si=new Uint8Array([14]);function BU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(si)}function oi(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)]]),e=>({...e,discriminator:si}))}function ci(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)]])}function wU(){return gill.combineCodec(oi(),ci())}function ai(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},i=m({}),a=p(r);return Object.freeze({accounts:[a(t.settings),a(t.payer),a(t.transactionBuffer),...i],data:oi().encode({}),programAddress:r})}function kU(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{settings:r(),payer:r(),transactionBuffer:r()},data:ci().decode(e.data)}}var ui=new Uint8Array([25]);function zU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(ui)}function Ai(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["settingsKey",gill.getAddressEncoder()]]),e=>({...e,discriminator:ui}))}function gi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["settingsKey",gill.getAddressDecoder()]])}function KU(){return gill.combineCodec(Ai(),gi())}function yi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},transactionBuffer:{value:e.transactionBuffer??null,isWritable:true}},c={...e},a=m({args:c}),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.transactionBuffer),...a],data:Ai().encode(c),programAddress:r})}function JU(e){if(e.accounts.length<2)throw new Error("Not enough accounts");let n=0,r=()=>{let s=e.accounts[n];return n+=1,s};return {programAddress:e.programAddress,accounts:{payer:r(),transactionBuffer:r()},data:gi().decode(e.data)}}var Ti=new Uint8Array([15]);function QU(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ti)}function li(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Ct()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())]]),e=>({...e,discriminator:Ti}))}function fi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Dt()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())]])}function eW(){return gill.combineCodec(li(),fi())}function Si(e,n){let r=n?.programAddress??A,t={settings:{value:e.settings??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.settings),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:li().encode(c),programAddress:r})}function tW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{settings:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:fi().decode(e.data)}}var Ci=new Uint8Array([26]);function iW(){return gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(Ci)}function Di(){return gill.transformEncoder(gill.getStructEncoder([["discriminator",gill.fixEncoderSize(gill.getBytesEncoder(),1)],["transactionMessage",Ct()],["secp256r1VerifyArgs",gill.getArrayEncoder(Y())],["settingsReadonlyArgs",Q()],["compressedProofArgs",M()]]),e=>({...e,discriminator:Ci}))}function Mi(){return gill.getStructDecoder([["discriminator",gill.fixDecoderSize(gill.getBytesDecoder(),1)],["transactionMessage",Dt()],["secp256r1VerifyArgs",gill.getArrayDecoder(Z())],["settingsReadonlyArgs",ee()],["compressedProofArgs",h()]])}function dW(){return gill.combineCodec(Di(),Mi())}function hi(e,n){let r=n?.programAddress??A,t={payer:{value:e.payer??null,isWritable:true},slotHashSysvar:{value:e.slotHashSysvar??null,isWritable:false},instructionsSysvar:{value:e.instructionsSysvar??null,isWritable:false}},c={...e},i={args:c};t.slotHashSysvar.value||(t.slotHashSysvar.value="SysvarS1otHashes111111111111111111111111111"),t.instructionsSysvar.value||(t.instructionsSysvar.value="Sysvar1nstructions1111111111111111111111111");let a=m(i),o=p(r);return Object.freeze({accounts:[o(t.payer),o(t.slotHashSysvar),o(t.instructionsSysvar),...a],data:Di().encode(c),programAddress:r})}function uW(e){if(e.accounts.length<3)throw new Error("Not enough accounts");let n=0,r=()=>{let t=e.accounts[n];return n+=1,t},s=()=>{let t=r();return t.address===A?void 0:t};return {programAddress:e.programAddress,accounts:{payer:r(),slotHashSysvar:s(),instructionsSysvar:r()},data:Mi().decode(e.data)}}var A="reviR1xysEChySVSWGa43a6oJ2boJYTJhwRjo8KJhhT",qS=(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))(qS||{});function qW(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 YS=(T=>(T[T.AddWhitelistedAddressTrees=0]="AddWhitelistedAddressTrees",T[T.ChangeConfig=1]="ChangeConfig",T[T.ChangeConfigCompressed=2]="ChangeConfigCompressed",T[T.CompressSettingsAccount=3]="CompressSettingsAccount",T[T.CreateDomainConfig=4]="CreateDomainConfig",T[T.CreateDomainUserAccount=5]="CreateDomainUserAccount",T[T.CreateGlobalCounter=6]="CreateGlobalCounter",T[T.CreateMultiWalletCompressed=7]="CreateMultiWalletCompressed",T[T.CreateUserAccounts=8]="CreateUserAccounts",T[T.DecompressSettingsAccount=9]="DecompressSettingsAccount",T[T.DisableDomainConfig=10]="DisableDomainConfig",T[T.EditDomainConfig=11]="EditDomainConfig",T[T.EditTransactionManagerUrl=12]="EditTransactionManagerUrl",T[T.MigrateCompressedSettings=13]="MigrateCompressedSettings",T[T.MigrateCompressedUsers=14]="MigrateCompressedUsers",T[T.NativeTransferIntent=15]="NativeTransferIntent",T[T.NativeTransferIntentCompressed=16]="NativeTransferIntentCompressed",T[T.TokenTransferIntent=17]="TokenTransferIntent",T[T.TokenTransferIntentCompressed=18]="TokenTransferIntentCompressed",T[T.TransactionBufferClose=19]="TransactionBufferClose",T[T.TransactionBufferCloseCompressed=20]="TransactionBufferCloseCompressed",T[T.TransactionBufferCreate=21]="TransactionBufferCreate",T[T.TransactionBufferCreateCompressed=22]="TransactionBufferCreateCompressed",T[T.TransactionBufferExecute=23]="TransactionBufferExecute",T[T.TransactionBufferExecuteCompressed=24]="TransactionBufferExecuteCompressed",T[T.TransactionBufferExtend=25]="TransactionBufferExtend",T[T.TransactionBufferExtendCompressed=26]="TransactionBufferExtendCompressed",T[T.TransactionBufferVote=27]="TransactionBufferVote",T[T.TransactionBufferVoteCompressed=28]="TransactionBufferVoteCompressed",T[T.TransactionExecute=29]="TransactionExecute",T[T.TransactionExecuteCompressed=30]="TransactionExecuteCompressed",T[T.TransactionExecuteSync=31]="TransactionExecuteSync",T[T.TransactionExecuteSyncCompressed=32]="TransactionExecuteSyncCompressed",T))(YS||{});function YW(e){let n="data"in e?e.data:e;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([7])),0))return 0;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([8])),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([16])),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([18])),0))return 7;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([5])),0))return 8;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([17])),0))return 9;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([2])),0))return 10;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([1])),0))return 11;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([6])),0))return 12;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([32])),0))return 13;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([31])),0))return 14;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([29])),0))return 15;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([27])),0))return 16;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([30])),0))return 17;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([28])),0))return 18;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([12])),0))return 19;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([23])),0))return 20;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([9])),0))return 21;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([20])),0))return 22;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([13])),0))return 23;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([24])),0))return 24;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([11])),0))return 25;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([22])),0))return 26;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([10])),0))return 27;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([21])),0))return 28;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([14])),0))return 29;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([25])),0))return 30;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([15])),0))return 31;if(gill.containsBytes(n,gill.fixEncoderSize(gill.getBytesEncoder(),1).encode(new Uint8Array([26])),0))return 32;throw new Error("The provided instruction could not be identified as a multiWallet instruction.")}var XS=6e3,$S=6001,QS=6002,ex=6003,tx=6004,rx=6005,nx=6006,sx=6007,ox=6008,cx=6009,ax=6010,ix=6011,dx=6012,ux=6013,Ax=6014,gx=6015,yx=6016,mx=6017,px=6018,Tx=6019,lx=6020,fx=6021,Sx=6022,xx=6023,Ix=6024,Cx=6025,Dx=6026,Mx=6027,hx=6028,Ex=6029,Px=6030,Rx=6031,vx=6032,bx=6033,Ux=6034,Wx=6035,_x=6036,Ox=6037,Lx=6038,Bx=6039,wx=6040,kx=6041,Ei;process.env.NODE_ENV!=="production"&&(Ei={[px]:"This member is already delegated to another wallet.",[_x]:"The domain configuration account is disabled. Please contact support or try again later.",[Ox]:"Missing domain configuration account.",[ex]:"Duplicate public keys detected among members. Each member must have a unique key.",[QS]:"Durable nonce detected: this program does not support transactions using a durable nonce.",[cx]:"No members provided. A multisig wallet must contain at least one member.",[Dx]:"Final buffer hash mismatch: the serialized data may be corrupted or altered.",[Mx]:"The serialized transaction buffer exceeds the maximum size of 10,128 bytes.",[hx]:"Declared buffer size does not match the actual serialized size.",[fx]:"Not enough members with vote permission to meet the approval threshold.",[Tx]:"At least one signer with execute permission is required to proceed.",[lx]:"At least one signer with initiate permission is required to perform this action.",[Ax]:"One or more provided accounts failed validation. Verify that all required accounts are included and correct.",[kx]:"Address Tree supplied is not part of the whitelisted address trees",[gx]:"Invalid or missing instruction arguments. Ensure all required arguments are correctly provided.",[Cx]:"Buffer validation failed: contents do not match the expected hash (possible tampering detected).",[ux]:"Unexpected number of accounts provided for this instruction.",[$S]:"Malformed or missing WebAuthn verification parameters. Please provide valid secp256r1 signature arguments.",[XS]:"Invalid signature: the provided signature does not match the expected message payload.",[Ux]:"Failed to parse the Slot History sysvar: data format is invalid or corrupted.",[ix]:"Invalid threshold: must be at least 1 and cannot exceed the number of voting-eligible members.",[dx]:"Malformed transaction message: structure or formatting does not match the expected layout.",[vx]:"An input string exceeds the maximum allowed character length.",[Lx]:"This member is not registered under the provided domain configuration.",[yx]:"A required account is missing from the instruction context.",[bx]:"Missing required sysvar: Slot History must be included as an account in this instruction.",[mx]:"User mutation arguments are required when performing add or remove delegate operations.",[xx]:"No valid signer found in this transaction.",[nx]:"Only one permanent member is allowed per wallet.",[sx]:"Only one transaction manager is allowed per wallet.",[wx]:"The given origin index is not in the whitelisted origins.",[tx]:"Permanent members cannot be removed from a wallet.",[rx]:"This operation cannot assign a permanent member.",[Rx]:"Writable CPI calls to protected accounts are not permitted.",[Bx]:"The relying party ID hash does not match the one defined in the domain configuration.",[Wx]:"The specified slot number was not found in the provided slot history.",[ax]:"Too many members: a maximum of 4 members are supported.",[Ex]:"This transaction has expired. It must be executed within 3 minutes of approval.",[ox]:"Unable to assign a transaction manager.",[Px]:"This transaction has not yet reached the required approval threshold.",[Ix]:"Only the transaction creator or rent payer may close this transaction buffer.",[Sx]:"Member is not part of the expected signers for this transaction."});function t_(e){return process.env.NODE_ENV!=="production"?Ei[e]:"Error message not available in production bundles."}function r_(e,n,r){return gill.isProgramError(e,n,A,r)}var Rt={Ed25519:1,Secp256r1:2};var xe={InitiateTransaction:1,VoteTransaction:2,ExecuteTransaction:4},Me=class e{constructor(n){this.mask=n;}static fromPermissions(n){return new e(n.reduce((r,s)=>r|s,0))}static all(){return new e(Object.values(xe).reduce((n,r)=>n|r,0))}static has(n,r){return (n.mask&r)===r}};var En=33,ie=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!==En)throw new Error(`Invalid public key length, expected ${En} 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===En)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()}},C=class extends ie{verifyArgs;domainConfig;authData;signature;originIndex;crossOrigin;requestedClientAndDeviceHash;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.requestedClientAndDeviceHash=r.requestedClientAndDeviceHash;}};function Vx(){return gill.getStructCodec([["programAddressIndex",gill.getU8Codec()],["accountIndices",gill.getArrayCodec(gill.getU8Codec())],["data",gill.getArrayCodec(gill.getU8Codec())]])}function Gx(){return gill.getStructCodec([["lookupTableAddress",gill.getAddressCodec()],["writableIndexes",gill.getArrayCodec(gill.getU8Codec())],["readonlyIndexes",gill.getArrayCodec(gill.getU8Codec())]])}var Ri=gill.getStructCodec([["numSigners",gill.getU8Codec()],["numWritableSigners",gill.getU8Codec()],["numWritableNonSigners",gill.getU8Codec()],["accountKeys",gill.getArrayCodec(gill.getAddressCodec())],["instructions",gill.getArrayCodec(Vx())],["addressTableLookups",gill.getArrayCodec(Gx())]]);function vi(e){return Ri.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 bi(e){let n=Ri.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}}stateless_js.featureFlags.version=stateless_js.VERSION.V2;var Ui="revibase.com",Wi="https://auth.revibase.com",_i="https://api.revibase.com";async function vn(e,n=false){let r=n?{blockhash:gill.getBlockhashDecoder().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)}:(await te().getLatestBlockhash().send()).value;return await Promise.all(e.map(async s=>await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions(s.instructions,c),c=>gill.setTransactionMessageFeePayerSigner(s.payer,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(r,c),c=>s.addressesByLookupTableAddress?gill.compressTransactionMessageUsingAddressLookupTables(c,s.addressesByLookupTableAddress):c,async c=>{let i=Math.ceil((s.unitsConsumed??0)*1.1)||8e5;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 Bi(e,n){let s=(await e.getRecentPrioritizationFees(n.filter(c=>c.role===gill.AccountRole.WRITABLE||c.role===gill.AccountRole.WRITABLE_SIGNER).map(c=>c.address)).send()).map(c=>Number(c.prioritizationFee));s.sort((c,i)=>c-i);let t=Math.floor(s.length/2);return s.length%2===0?Math.round((s[t-1]+s[t])/2):s[t]}async function wi(e,n){if(e.length===0)throw new Error("Bundle is empty.");for(let c=0;c<e.length;c++){if(e[c].length>1644)throw new Error(`Transaction ${c} exceeds maximum length, ${e[c].length}. Retry again.`);console.log(`Transaction ${c} length: ${e[c].length}`);}let r=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:"2",method:"simulateBundle",params:[{encodedTransactions:e},{skipSigVerify:true,replaceRecentBlockhash:true,preExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]})),postExecutionAccountsConfigs:e.map(()=>({encoding:"base64",addresses:[]}))}]})});if(!r.ok)throw console.error(await r.json()),new Error("Failed to simulate bundle");let{result:s,error:t}=await r.json();if(!s||t)throw console.error(t??s),new Error(`Unable to simulate bundle: ${JSON.stringify(t??s)}`);if(typeof s.value.summary!="string"&&s.value.summary.failed){let{TransactionFailure:c}=s.value.summary.failed.error,[,i]=c;throw console.error(t??s),new Error(`Simulation failed: ${i}`)}return s.value.transactionResults.map(c=>c.unitsConsumed)}function H(e,n=0){let r=e instanceof C?e:void 0,s=r?.verifyArgs&&n!==-1?gill.some({signedMessageIndex:n,truncatedClientDataJson:r.verifyArgs.truncatedClientDataJson,slotNumber:r.verifyArgs.slotNumber,originIndex:r.originIndex,crossOrigin:r.crossOrigin,requestedClientAndDeviceHash:r.requestedClientAndDeviceHash}):null,t=r?.domainConfig?r.domainConfig:void 0,c=r?.verifyArgs?r.signature:void 0,i=r?.authData&&r.verifyArgs?.clientDataJson?new Uint8Array([...r.authData,...sha256.sha256(r.verifyArgs.clientDataJson)]):void 0,a=r?.toBuffer();return {domainConfig:t,verifyArgs:s,signature:c,message:i,publicKey:a}}function Ge(e){if(e instanceof ie)return {keyType:Rt.Secp256r1,key:e.toBytes()};{let n;try{n="address"in e?e.address:e;}catch{n=e;}return {keyType:Rt.Ed25519,key:new Uint8Array([0,...gill.getAddressEncoder().encode(n)])}}}function Li(e){return e instanceof C?e.toString():e.address.toString()}function de(e){let n=new Set,r=[];for(let s of e)n.has(Li(s))||(r.push(s),n.add(Li(s)));if(r.filter(s=>s instanceof C).length>1)throw new Error("More than 1 Secp256r1 signers in an instruction is not supported.");return r}function ki({payer:e,tipAmount:n}){let r=["HFqU5x63VTqvQss8hp11i4wVV8bD44PvwucfZ2bU7gRe","ADaUMid9yfUytqMBgopwjb2DTLSokTSzL1zt6iGPaS49","96gYZGLnJYVFmbjzopPSU6QiEV5fGqZNyN9nmNhvrZU5","Cw8CFyM9FkoMi7K7Crf6HNQqf4uEMzpKw6QNghXLvLkY","DfXygSm4jCyNCybVYYK6DwvWqjKee8pbDmJGcLWNDXjh","ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt","3AVi9Tg9Uo68tJfuvoKvqKNWKkC5wPdSSdeBnizKZ6jT","DttWaMuVvTiduZRnguLF7jNxTgiMBZ1hyAumKUiL2KRL"],s=r[Math.floor(Math.random()*r.length)];return programs.getTransferSolInstruction({source:e,destination:gill.address(s),amount:n})}async function Ni(e){let n=await fetch(`${e}/getRandomPayer`),{randomPayer:r}=await n.json();return {address:gill.address(r),async signTransactions(s){let t={publicKey:r,transactions:s.map(a=>gill.getBase64Decoder().decode(gill.getTransactionEncoder().encode(a)))},i=await(await fetch(`${e}/sign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})).json();if("error"in i)throw new Error(i.error);return i.signatures.map(a=>({[gill.address(r)]:gill.getBase58Encoder().encode(a)}))}}}var Fe=null,Qt=null,er=null,tr=null,rr,$t=null,bn=null,nr=null,Un=null,Wn=null,Hi=null;function sr(){if(!Fe)throw new Error("Rpc is not initialized yet.");return Fe}function vt(){if(!Qt)throw new Error("Rpc is not initialized yet");return Qt}function te(){if(!er)throw new Error("Rpc is not initialized yet");return er}function Vi(){if(!tr)throw new Error("Rpc is not initialized yet.");return tr}function Gi(){if(!rr)throw new Error("Rpc is not initialized yet");return rr}async function K_(){return $t||($t=await Ni(bn??_i)),$t}function _n(){if(!nr)throw new Error("Jito Bundle Config is not set.");return nr}function Ee(){return Un??Wi}function Fi(){return Wn??Ui}function or(){return Hi}function J_(){Qt=null,er=null,Fe=null,$t=null,bn=null,nr=null,Un=null,Wn=null,tr=null,rr=null;}function j_({rpcEndpoint:e,proverEndpoint:n,compressionApiEndpoint:r,jitoTipsConfig:s,apiEndpoint:t,authEndpoint:c,rpId:i,additionalInfo:a}){Fe=e,Qt=stateless_js.createRpc(Fe,r,n);let{rpc:o,sendAndConfirmTransaction:d}=gill.createSolanaClient({urlOrMoniker:Fe});tr=d,rr=programs.estimateComputeUnitLimitFactory({rpc:o}),er=o,bn=t??null,nr=s??null,Un=c??null,Wn=i??null,Hi=a??null;}var U=class{preAccounts;systemAccounts;nextIndex;map;outputTreeIndex;constructor(){this.preAccounts=[],this.systemAccounts=[],this.nextIndex=0,this.map=new Map,this.outputTreeIndex=-1;}addPreAccounts(n){this.preAccounts.push(...n);}getAccountRole(n,r){return n?r?gill.AccountRole.WRITABLE_SIGNER:gill.AccountRole.READONLY_SIGNER:r?gill.AccountRole.WRITABLE:gill.AccountRole.READONLY}async addSystemAccounts(){this.systemAccounts.push(...stateless_js.getLightSystemAccountMetasV2({selfProgram:new web3_js.PublicKey(A.toString())}).map(n=>({address:gill.address(n.pubkey.toString()),role:this.getAccountRole(n.isSigner,n.isWritable)})));}insertOrGet(n){return this.insertOrGetConfig(n,gill.AccountRole.WRITABLE)}insertOrGetConfig(n,r){if(!this.map.has(n)){let s=this.nextIndex++,t={address:gill.address(n),role:r};this.map.set(n,{index:s,accountMeta:t});}return this.map.get(n).index}packOutputTreeIndex(n){if(n.treeType===stateless_js.TreeType.StateV1)return this.insertOrGet(n.tree.toString());if(n.treeType===stateless_js.TreeType.StateV2)return this.insertOrGet(n.queue.toString());throw new Error("Tree type not supported")}async getOutputTreeIndex(){if(this.outputTreeIndex!==-1)return this.outputTreeIndex;let n=sr().includes("devnet")?stateless_js.localTestActiveStateTreeInfos():await vt().getStateTreeInfos(),r=stateless_js.selectStateTreeInfo(n);return this.packOutputTreeIndex(r)}packTreeInfos(n,r){let s=[],t=[];for(let c of n){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());s.push({rootIndex:c.rootIndex,merkleTreePubkeyIndex:i,queuePubkeyIndex:a,leafIndex:c.leafIndex,proveByIndex:c.proveByIndex});let o=c.treeInfo.nextTreeInfo??c.treeInfo,d=this.packOutputTreeIndex(o);this.outputTreeIndex===-1&&(this.outputTreeIndex=d);}for(let c of r){let i=this.insertOrGet(c.treeInfo.tree.toString()),a=this.insertOrGet(c.treeInfo.queue.toString());t.push({rootIndex:c.rootIndex,addressMerkleTreePubkeyIndex:i,addressQueuePubkeyIndex:a});}return {stateTrees:s.length>0?{packedTreeInfos:s,outputTreeIndex:this.outputTreeIndex}:void 0,addressTrees:t}}hashSetAccountsToMetas(){return Array.from(this.map.entries()).sort((r,s)=>r[1].index-s[1].index).map(([,{accountMeta:r}])=>({...r}))}getOffsets(){let n=this.preAccounts.length,r=n+this.systemAccounts.length;return [n,r]}toAccountMetas(){let n=this.hashSetAccountsToMetas(),[r,s]=this.getOffsets();return {remainingAccounts:[...this.preAccounts,...this.systemAccounts,...n],systemOffset:r,packedOffset:s}}};async function cr(e,n){let r=n?.get(e.toString());if(r)return r;{let s=await stateless_js.rpcRequest(vt().compressionApiEndpoint,stateless_js.versionedEndpoint("getCompressedAccount"),{hash:void 0,address:e?stateless_js.encodeBN254toBase58(e):void 0}),t;if(stateless_js.featureFlags.isV2()?t=superstruct.create(s,stateless_js.jsonRpcResultAndContext(superstruct.nullable(stateless_js.CompressedAccountResultV2))):t=superstruct.create(s,stateless_js.jsonRpcResultAndContext(superstruct.nullable(stateless_js.CompressedAccountResult))),"error"in t)throw new web3_js.SolanaJSONRPCError(t.error,`failed to get info for compressed account ${e?e.toString():""}`);if(t.result.value===null)return null;let c=stateless_js.featureFlags.isV2()?t.result.value.merkleContext.tree:t.result.value.tree,i=stateless_js.getStateTreeInfoByPubkey(stateless_js.localTestActiveStateTreeInfos(),c),a=t.result.value,o=stateless_js.createCompressedAccountWithMerkleContextLegacy(stateless_js.createMerkleContextLegacy(i,a.hash,a.leafIndex),a.owner,stateless_js.bn(a.lamports),a.data?stateless_js.parseAccountData(a.data):void 0,a.address||void 0);return o&&n?.set(e.toString(),o),o}}async function ce(e,n){let s=(await Promise.all(e.map(async t=>cr(t.address,n)))).filter(t=>t!==null).filter(t=>t.data!==null&&t.address!==null);if(s.length!==e.length)throw new Error("Unable to find compressed account.");return s.map((t,c)=>({...t,type:e[c].type,tree:t.treeInfo.tree,queue:t.treeInfo.queue}))}function v(e,n){return {proof:e?.compressedProof?gill.some({a:new Uint8Array(e.compressedProof.a),b:new Uint8Array(e.compressedProof.b),c:new Uint8Array(e.compressedProof.c)}):null,lightCpiAccountsStartIndex:n}}async function ne(e,n,r,s,t){if(t.length===0)return [];let c=t.map((d,u)=>({treeInfo:n[u],root:r[u],rootIndex:s[u],address:d.address.toArray()})),{addressTrees:i}=e.packTreeInfos([],c),a=await e.getOutputTreeIndex();return t.map((d,u)=>({addressTreeInfo:i[u],outputStateTreeIndex:a,address:d.address,type:d.type}))}function se(e,n,r,s,t,c,i){let a=[];for(let u=0;u<n.length;u++)a.push({treeInfo:n[u],rootIndex:s[u],leafIndex:r[u],proveByIndex:t[u],hash:c[u].hash});let o=e.packTreeInfos(a,[]).stateTrees;if(!o)throw new Error("Unable to parsed data.");return c.map((u,g)=>({data:i.decode(u.data.data),accountMeta:{treeInfo:o.packedTreeInfos[g],address:new Uint8Array(u.address),outputStateTreeIndex:o.outputTreeIndex}}))}async function pe(e,n,r,s,t){let c=null,i=null,a=new U;if(e){await a.addSystemAccounts();let{address:o}=await $(n,r),d=(await ce([{address:o,type:"Settings"}],t))[0];s?i={rootIndices:[0],roots:[],leafIndices:[d.leafIndex],leaves:[],treeInfos:[d.treeInfo],proveByIndices:[d.proveByIndex],compressedProof:{a:Array.from(crypto.getRandomValues(new Uint8Array(32))),b:Array.from(crypto.getRandomValues(new Uint8Array(32))),c:Array.from(crypto.getRandomValues(new Uint8Array(32)))}}:i=await k([d],[]);let u=a.packTreeInfos([{treeInfo:i.treeInfos[0],rootIndex:i.rootIndices[0],leafIndex:i.leafIndices[0],proveByIndex:i.proveByIndices[0],hash:d.hash}],[]).stateTrees;if(!u)throw new Error("Unable to parsed data.");c={accountMeta:{address:new Uint8Array(d.address),treeInfo:u.packedTreeInfos[0]},data:q().decode(d.data?.data)};}return {settingsReadonlyArgs:c,proof:i,packedAccounts:a}}async function k(e,n,r=10,s=400){let t=1;for(;t<r;)try{return await vt().getValidityProofV0(e,n)}catch(c){if(console.error(`Attempt ${t}, Get Validity Proof failed. ${c}`),t++,t>=r)throw new Error(`Failed to get validity proof after ${r} attempts: ${c}`);await new Promise(i=>setTimeout(i,s));}throw new Error(`Failed to get validity proof after ${r} attempts`)}async function Te(){return (await ar()).length-1}var On;async function ar(){if(!On){let{data:e}=await Ys(te(),await Zi());On=e.whitelistedAddressTrees;}return On}async function Xi(e,n,r){let s=await vI(e,n,r);if(!s)throw new Error("User cannot be found.");return s}async function vI(e,n,r){let{address:s}=await W(e,n),t=await cr(s,r);return t?.data?.data?X().decode(t.data.data):null}async function $i(e,n,r){let s=await bI(e,n,r);if(!s)throw new Error("Settings cannot be found.");return s}async function bI(e,n,r){try{let{address:s}=await $(e,n),t=await cr(s,r);if(!t?.data?.data)return null;let c=q().decode(t.data.data);return c.data.__option==="None"?null:{...c.data.value,isCompressed:!0}}catch{let s=await $r(te(),await re(e));return s.exists?{...s.data,members:s.data.members.slice(0,s.data.membersLen),isCompressed:false}:null}}async function Ln(e){let n=await ar();if(e<0||e>=n.length)throw new Error(`Invalid address tree index: ${e}`);return n[e]}async function ir(e){let r=(await ar()).findIndex(s=>s===e);if(r===-1)throw new Error(`Address tree not found: ${e}`);return r}async function $(e,n=0){let r=await Ln(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("multi_wallet")),new Uint8Array(gill.getU128Encoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A)).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function W(e,n=0){let r=await Ln(n),s=stateless_js.deriveAddressSeedV2([new Uint8Array(gill.getUtf8Encoder().encode("user")),e instanceof ie?e.toTruncatedBuffer():new Uint8Array(gill.getAddressEncoder().encode(e))]);return {address:stateless_js.createBN254(stateless_js.deriveAddressV2(s,new web3_js.PublicKey(r),new web3_js.PublicKey(A.toString())).toString(),"base58"),addressTree:new web3_js.PublicKey(r)}}async function Ke({rpIdHash:e,rpId:n}){if(!e)if(n)e=sha256.sha256(new Uint8Array(gill.getUtf8Encoder().encode(n)));else throw new Error("RpId not found.");if(!e)throw new Error("RpIdHash not found.");let[r]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("domain_config"),e]});return r}async function nd(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("global_counter")]});return e}async function Zi(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("whitelisted_address_trees")]});return e}async function sd(e,n,r){if(r>255)throw new Error("Index cannot be greater than 255.");let[s]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("transaction_buffer"),n instanceof ie?n.toTruncatedBuffer():gill.getAddressEncoder().encode(n),gill.getU8Encoder().encode(r)]});return s}async function Ie(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getAddressEncoder().encode(e),gill.getUtf8Encoder().encode("vault")]});return n}async function re(e){let[n]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("multi_wallet"),gill.getU128Encoder().encode(e)]});return n}async function od(e){let n=await re(e);return await Ie(n)}async function hO(){let[e]=await gill.getProgramDerivedAddress({programAddress:A,seeds:[gill.getUtf8Encoder().encode("cpi_authority")]});return e}var Je=null,ad=2e3,id=3e3,_I=300*1e3;async function ur({authUrl:e,additionalInfo:n,signer:r,popUp:s=null,data:t}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");return new Promise((c,i)=>{let a=new URL(e).origin,o=null,d=setInterval(()=>{s&&s.closed&&(g(),i(new Error("User closed the authentication window")));},500),u=setTimeout(()=>{y("Authentication timeout."),g(),i(new Error("Authentication timed out"));},_I);function g(){clearInterval(d),clearTimeout(u),o&&clearTimeout(o),Je&&window.removeEventListener("message",Je),s&&s.close();}if(s?s.location.replace(e):s=gd(e),!s){i(new Error("Disable your popup blocker to continue."));return}function y(...l){n?.debug&&console.debug("[Popup]",...l);}let f=l=>{let I=l.origin===a,D=l.source===s;if(!I||!D||!l.isTrusted||!s){y("Ignored message from unknown source",l);return}switch(l.data.type){case "popup-ready":y("Popup is ready, sending auth data"),s.postMessage({type:"popup-init",payload:{signer:r?.toString(),data:t,additionalInfo:n}},a),o=setTimeout(()=>{g(),i(new Error("User closed the authentication window"));},ad+id);break;case "popup-complete":y("Received completion message");try{let b=JSON.parse(l.data.payload);g(),c(b);}catch{i(new Error("Failed to parse response payload"));}break;case "popup-heartbeat":y("Received heartbeat"),o&&(clearTimeout(o),o=setTimeout(()=>{g(),i(new Error("User closed the authentication window"));},ad+id));break;case "popup-closed":y("Popup explicitly closed"),g(),i(new Error("User closed the authentication window"));break;default:y("Unknown message type",l.data.type);}};Je&&window.removeEventListener("message",Je),Je=f,window.addEventListener("message",Je);})}function Ar(e){let n="";for(let s of e)n+=String.fromCharCode(s);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ce(e){let n=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-n.length%4)%4,s=n.padEnd(n.length+r,"="),t=atob(s),c=new ArrayBuffer(t.length),i=new Uint8Array(c);for(let a=0;a<t.length;a++)i[a]=t.charCodeAt(a);return c}function gr(e){return Array.from(e).map(n=>n.toString(16).padStart(2,"0")).join("")}function OI(e){let n=new Uint8Array(e.length/2);for(let r=0;r<n.length;r++)n[r]=parseInt(e.slice(r*2,r*2+2),16);return n}function dd(e){let n=new Set(["type","challenge","origin","crossOrigin"]),r={};for(let t in e)n.has(t)||(r[t]=e[t]);if(Object.keys(r).length===0)return new Uint8Array([]);let s=JSON.stringify(r);return new TextEncoder().encode(s.slice(1,-1))}function ud(e,n){let r=[],s=0,t=new TextDecoder;for(let c=0;c<n;c++){if(s+2>e.length)throw new Error("MaxLengthExceeded");let i=e[s]|e[s+1]<<8;if(s+=2,s+i>e.length)throw new Error("MaxLengthExceeded");let a=e.slice(s,s+i),o=t.decode(a);r.push(o),s+=i;}return r}function Ad(e){if(e.length===64)return e;if(e[0]!==48)throw new Error("Invalid DER sequence");let n=e[1],r=2;if(n>128){let b=n&127;r+=b;}if(e[r]!==2)throw new Error("Expected INTEGER for r");let s=e[r+1],t=r+2,c=e.slice(t,t+s);if(r=t+s,e[r]!==2)throw new Error("Expected INTEGER for s");let i=e[r+1],a=r+2,o=e.slice(a,a+i),d=c[0]===0&&c.length>32?c.slice(1):c,u=o[0]===0&&o.length>32?o.slice(1):o;if(d.length>32||u.length>32)throw new Error("r or s length > 32 bytes");let g=new Uint8Array(32);g.set(d,32-d.length);let y=p256.p256.Point.CURVE().n>>1n,f=BigInt("0x"+gr(u)),I=(f>y?p256.p256.Point.CURVE().n-f:f).toString(16).padStart(64,"0"),D=OI(I);return new Uint8Array([...g,...D])}function gd(e=`${Ee()}/loading`){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let n=window.innerWidth||screen.availWidth,r=window.innerHeight||screen.availHeight,s=n<=768,t,c,i,a;if(s)t=n,c=r,i=0,a=0;else {let u=window.screenLeft??window.screenX,g=window.screenTop??window.screenY,y=window.innerWidth??document.documentElement.clientWidth??screen.width,f=window.innerHeight??document.documentElement.clientHeight??screen.height;t=500,c=600,a=u+(y-t)/2,i=g+(f-c)/2;}let o=[`width=${t}`,`height=${c}`,`top=${i}`,`left=${a}`,"toolbar=no","location=no","status=no","menubar=no","scrollbars=yes","resizable=yes"].join(","),d=window.open(e,"_blank",o);return d&&d.focus(),d}function zO(e){let n=tinyCbor.decodeCBOR(e),r=p256.p256.Point.fromAffine({x:BigInt("0x"+gr(n.get(-2))),y:BigInt("0x"+gr(n.get(-3)))});return gill.getBase58Decoder().decode(r.toBytes(true))}function Td(e){let r=p256.p256.Point.fromBytes(new Uint8Array(gill.getBase58Encoder().encode(e))).toBytes(false),s=new Map;return s.set(1,2),s.set(3,-7),s.set(-1,1),s.set(-2,r.slice(1,33)),s.set(-3,r.slice(33,65)),new Uint8Array(tinyCbor.encodeCBOR(s))}async function KO(e,n=0,r=false){let{authenticatorData:s,clientDataJSON:t,signature:c}=e.authResponse.response,i=new Uint8Array(Ce(s)),a=JSON.parse(new TextDecoder().decode(Ce(t))),o=dd(a),d=Ad(new Uint8Array(Ce(c))),u=await Ke({rpIdHash:i.subarray(0,32)});return new C(e.signer.toString(),{verifyArgs:{clientDataJson:new Uint8Array(Ce(t)),truncatedClientDataJson:o,slotNumber:BigInt(e.slotNumber),slotHash:new Uint8Array(gill.getBase58Encoder().encode(e.slotHash))},requestedClientAndDeviceHash:sha2.sha256(new Uint8Array([...new TextEncoder().encode(e.requestedClient),...gill.getBase58Encoder().encode(e.deviceSignature.publicKey)])),domainConfig:u,authData:i,signature:d,originIndex:n,crossOrigin:r})}function JO(e,n){let{authenticatorData:r,clientDataJSON:s}=e.authResponse.response,t=new Uint8Array(Ce(r)),c=JSON.parse(new TextDecoder().decode(Ce(s))),{transactionActionType:i,transactionAddress:a,transactionMessageBytes:o}=e.transactionPayload,d=sha2.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(i),...gill.getAddressEncoder().encode(gill.address(a)),...sha2.sha256(o),...gill.getBase58Encoder().encode(e.slotHash),...sha2.sha256(new Uint8Array([...gill.getUtf8Encoder().encode(e.requestedClient),...gill.getBase58Encoder().encode(e.deviceSignature.publicKey)]))]));if(!utils.equalBytes(new Uint8Array(Ce(c.challenge)),d))throw new Error("Invalid challenge");let u=sha2.sha256(new Uint8Array([...t,...sha2.sha256(new Uint8Array(Ce(s)))]));if(!utils.equalBytes(u,n))throw new Error("Invalid message hash")}async function jO(e,n){let{data:r}=await Kn(te(),e),t=ud(new Uint8Array(r.origins),r.numOrigins).findIndex(c=>c===n);if(t===-1)throw new Error("Origin not found in domain config");return t}async function oL(e){let n=await vn(e,true),r=await wi(n.map(gill.getBase64EncodedWireTransaction),sr()),s=await vn(e.map((c,i)=>({...c,unitsConsumed:r[i]})));return await eC(s.map(gill.getBase64EncodedWireTransaction))}async function cL({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=await te().getLatestBlockhash().send(),t=await gill.pipe(gill.createTransactionMessage({version:0}),c=>gill.appendTransactionMessageInstructions([...e],c),c=>gill.setTransactionMessageFeePayerSigner(n,c),c=>gill.setTransactionMessageLifetimeUsingBlockhash(s.value,c),c=>r?gill.compressTransactionMessageUsingAddressLookupTables(c,r):c,async c=>{let[i,a]=await Promise.all([Gi()(c),Bi(te(),c.instructions.flatMap(d=>d.accounts??[]))]),o=Math.ceil(i*1.1);return gill.prependTransactionMessageInstructions([...o>2e5?[programs.getSetComputeUnitLimitInstruction({units:o})]:[],...a>0?[programs.getSetComputeUnitPriceInstruction({microLamports:a})]:[]],c)},async c=>await gill.signTransactionMessageWithSigners(await c));return await Vi()(t,{commitment:"confirmed",skipPreflight:true}),gill.getSignatureFromTransaction(t)}async function eC(e,n=10,r=1e3,s=_n()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let i=await fetch(`${t}/bundles`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"sendBundle",params:[e,{encoding:"base64"}]})});if(i.status===429&&c<n){await new Promise(o=>setTimeout(o,r));continue}let a=await i.json();if(a.error)throw new Error(`Error sending bundles: ${JSON.stringify(a.error,null,2)}`);return a.result}throw new Error("Failed to send bundle after retries.")}async function aL(e,n=30,r=3e3,s=_n()){let{blockEngineUrl:t}=s;for(let c=1;c<=n;c++){let i=await fetch(`${t}/getBundleStatuses`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"getBundleStatuses",params:[[e]]})});if(i.status===429&&c<n){await new Promise(d=>setTimeout(d,r));continue}let a=await i.json();if(a.error)throw new Error(`Error sending bundles: ${JSON.stringify(a.error,null,2)}`);let o=a.result;if(o.value.length){let d=o.value[0];if(d.confirmation_status==="confirmed"||d.confirmation_status==="finalized")return d.transactions[d.transactions.length-1]}if(c<n){await new Promise(d=>setTimeout(d,r));continue}}throw new Error("Failed to get bundle status after retries.")}async function iL(e,n,r,s){let t=await $i(n,r,s);if(t.threshold>1)throw new Error("Multi-signature transactions with threshold > 1 are not supported yet.");let{permissions:c}=t.members.find(u=>fd(u.pubkey)===e.toString())??{};if(!c)throw new Error("No permissions found for the current member.");let i=Me.has(c,xe.InitiateTransaction),a=Me.has(c,xe.VoteTransaction),o=Me.has(c,xe.ExecuteTransaction);if(i&&a&&o)return {};if(!a||!o)throw new Error("Signer lacks the required Vote/Execute permissions.");let d=t.members.find(u=>u.role===2);if(!d)throw new Error("No transaction manager available in wallet.");return {transactionManagerAddress:gill.address(fd(d.pubkey)),userAddressTreeIndex:d.userAddressTreeIndex}}async function dL({authResponses:e,transactionManagerAddress:n,userAddressTreeIndex:r,transactionMessageBytes:s,cachedAccounts:t}){if(!n)return null;let c=await Xi(n,r,t);if(c.transactionManagerUrl.__option==="None")throw new Error("Transaction manager endpoint is missing for this account.");return tC(n,c.transactionManagerUrl.value,e,s)}function tC(e,n,r,s){return {address:e,async signTransactions(t){let c={publicKey:e.toString(),transactions:t.map(gill.getBase64EncodedWireTransaction)};s&&(c.transactionMessageBytes=gill.getBase64Decoder().decode(s)),r&&(c.authResponses=r);let a=await(await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(c)})).json();if("error"in a)throw new Error(a.error);return a.signatures.map(o=>({[e]:gill.getBase58Encoder().encode(o)}))}}}function fd(e){return e.keyType===Rt.Ed25519?gill.getBase58Decoder().decode(e.key.subarray(1,33)):gill.getBase58Decoder().decode(e.key)}async function RL({index:e,settingsAddressTreeIndex:n,configActionsArgs:r,payer:s,compressed:t=false,cachedAccounts:c}){let{addDelegates:i,removeDelegates:a}=await nC(r),o=new U,d=null,u=null,g=[];if(i.length||a.length||t){let S=await sC({packedAccounts:o,addDelegates:i,removeDelegates:a,compressed:t,index:e,settingsAddressTreeIndex:n,cachedAccounts:c});d=S.proof,u=S.settingsMutArgs??null,g=S.userMutArgs??[];}let{configActions:y,secp256r1VerifyInput:f}=await oC({configActionsArgs:r,packedAccounts:o,userMutArgs:g}),{remainingAccounts:l,systemOffset:I}=o.toAccountMetas(),D=v(d,I);return {instructions:t?[mo({configActions:y,payer:s,authority:gill.createNoopSigner(await od(e)),compressedProofArgs:D,settingsMut:u,remainingAccounts:l})]:[await ao({settingsIndex:e,configActions:y,payer:s,compressedProofArgs:D,remainingAccounts:l})],secp256r1VerifyInput:f}}async function nC(e){let n=[],r=[];for(let s of e)switch(s.type){case "AddMembers":{let t=s.members.map(i=>W(i.member instanceof C?i.member:i.delegateOperation===0?i.member.address:i.member,i.userAddressTreeIndex)),c=await Promise.all(t);for(let i of c)n.push({address:i.address,type:"User"});break}case "RemoveMembers":{let t=s.members.map(i=>W(i.member,i.userAddressTreeIndex)),c=await Promise.all(t);for(let i of c)r.push({address:i.address,type:"User"});break}case "EditPermissions":{let t=s.members.map(i=>i.delegateOperation===2?Promise.resolve(void 0):W(i.member,i.userAddressTreeIndex)),c=await Promise.all(t);for(let i=0;i<c.length;i++){let a=c[i],o=s.members[i];a&&(o.delegateOperation===0?n.push({address:a.address,type:"User"}):r.push({address:a.address,type:"User"}));}break}}return {addDelegates:n,removeDelegates:r}}async function sC({packedAccounts:e,addDelegates:n,removeDelegates:r,compressed:s,index:t,settingsAddressTreeIndex:c,cachedAccounts:i}){await e.addSystemAccounts();let a=[];if(s){let l=(await $(t,c)).address;a.push({address:l,type:"Settings"});}r.length&&a.push(...r),n.length&&a.push(...n);let o=a.length?await ce(a,i):[];if(!o.length)return {proof:null,settingsMutArgs:void 0,userMutArgs:[]};let d=await k(o,[]),u=[],g=[];for(let l of o)l.type==="Settings"?u.push(l):l.type==="User"&&g.push(l);let y,f=[];if(s&&d&&(y=se(e,d.treeInfos.slice(0,1),d.leafIndices.slice(0,1),d.rootIndices.slice(0,1),d.proveByIndices.slice(0,1),u,q())[0]),g.length&&d){let l=s?1:0;f=se(e,d.treeInfos.slice(l),d.leafIndices.slice(l),d.rootIndices.slice(l),d.proveByIndices.slice(l),g,X());}return {proof:d,settingsMutArgs:y,userMutArgs:f}}async function oC({configActionsArgs:e,packedAccounts:n,userMutArgs:r}){let s=[],t=[];for(let c of e)switch(c.type){case "AddMembers":{let i=[];for(let a of c.members)if(a.member instanceof C){let o=s.length,{message:d,signature:u,publicKey:g,domainConfig:y}=H(a.member,o);d&&u&&g&&s.push({message:d,signature:u,publicKey:g}),y&&n.addPreAccounts([{address:y,role:gill.AccountRole.READONLY}]);let f=await W(a.member,a.userAddressTreeIndex).then(l=>r.find(I=>new yr__default.default(new Uint8Array(I.accountMeta.address)).eq(l.address)));if(!f)throw new Error("Unable to find user account");i.push(xd({permissionArgs:a.permissions,index:o,userMutArgs:f,pubkey:a.member,delegateOperation:a.delegateOperation}));}else {a.delegateOperation===0&&n.addPreAccounts([{address:a.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:a.member}]);let o=a.delegateOperation===0?a.member.address:a.member,d=await W(o,a.userAddressTreeIndex).then(u=>r.find(g=>new yr__default.default(new Uint8Array(g.accountMeta.address)).eq(u.address)));if(!d)throw new Error("Unable to find user account");i.push(xd({permissionArgs:a.permissions,index:-1,userMutArgs:d,pubkey:a.member,delegateOperation:a.delegateOperation}));}t.push({__kind:c.type,fields:[i]});break}case "RemoveMembers":{let i=c.members.map(o=>W(o.member,o.userAddressTreeIndex).then(d=>{let u=r.find(g=>new yr__default.default(new Uint8Array(g.accountMeta.address)).eq(d.address));if(!u)throw new Error("Unable to find user account");return aC({pubkey:o.member,userMutArgs:u})})),a=await Promise.all(i);t.push({__kind:c.type,fields:[a]});break}case "EditPermissions":{let i=c.members.map(o=>(o.delegateOperation!==2?W(o.member,o.userAddressTreeIndex).then(d=>r.find(u=>new yr__default.default(new Uint8Array(u.accountMeta.address)).eq(d.address))):Promise.resolve(void 0)).then(d=>cC({permissionArgs:o.permissions,userMutArgs:d,pubkey:o.member,delegateOperation:o.delegateOperation}))),a=await Promise.all(i);t.push({__kind:c.type,fields:[a]});break}default:t.push({__kind:c.type,fields:[c.threshold]});}return {configActions:t,secp256r1VerifyInput:s}}function cC({pubkey:e,permissionArgs:n,userMutArgs:r,delegateOperation:s}){if(s!==2){if(!r)throw new Error("User args is missing");if(r.data.role!==0)throw new Error("Only user with member role is allowed to change delegate.")}return {memberKey:Ge(e),permissions:Dd(n),userArgs:r?gill.some(r):gill.none(),delegateOperation:s}}function aC({pubkey:e,userMutArgs:n}){if(n.data.role===1)throw new Error("Permanent Member cannot be removed from the wallet.");return {memberKey:Ge(e),userArgs:n.data.delegatedTo.__option==="Some"?{__kind:"Mutate",fields:[n]}:{__kind:"Read",fields:[n]}}}function xd({pubkey:e,permissionArgs:n,index:r,userMutArgs:s,delegateOperation:t}){if(s.data.role===1){if(t!==0)throw new Error("Permanent members must also be delegates");if(s.data.delegatedTo.__option==="Some")throw new Error("This user is already registered as a permanent member in another wallet. A permanent member can only belong to one wallet.")}else if(s.data.role===2){if(n.execute||n.vote)throw new Error("Transaction Manager can only have initiate permission");if(t!==2)throw new Error("Transaction Manager cannot be a delegate.")}else if(s.data.role===3&&t!==2)throw new Error("Administrator cannot be a delegate.");return {memberKey:Ge(e),permissions:Dd(n),verifyArgs:e instanceof C&&e.verifyArgs&&r!==-1?gill.some({truncatedClientDataJson:e.verifyArgs.truncatedClientDataJson,slotNumber:e.verifyArgs.slotNumber,signedMessageIndex:r,originIndex:e.originIndex,crossOrigin:e.crossOrigin,requestedClientAndDeviceHash:e.requestedClientAndDeviceHash}):gill.none(),userArgs:t===0?{__kind:"Mutate",fields:[s]}:{__kind:"Read",fields:[s]},delegateOperation:t}}function Dd(e){let n=[];return e.initiate&&n.push(xe.InitiateTransaction),e.vote&&n.push(xe.VoteTransaction),e.execute&&n.push(xe.ExecuteTransaction),Me.fromPermissions(n)}var qe=33,Ye=64,Hn=14,mC=2,pC=gill.address("Secp256r1SigVerify1111111111111111111111111");function TC(){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 lC(){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 Pd(){return gill.createDecoder({read:(e,n=0)=>{let r=gill.getU8Decoder().decode(e,n);n+=1;let s=gill.getU8Decoder().decode(e,n);n+=1;let t=[],c=lC();for(let a=0;a<r;a++)t.push(c.decode(e,n)),n+=Hn;let i=[];for(let a=0;a<r;a++){let o=gill.fixDecoderSize(gill.getBytesDecoder(),qe).decode(e,n);n+=qe;let d=gill.fixDecoderSize(gill.getBytesDecoder(),Ye).decode(e,n);n+=Ye;let u=t[a].messageDataSize,g=gill.fixDecoderSize(gill.getBytesDecoder(),u).decode(e,n);n+=u,i.push({publicKey:o,signature:d,message:g});}return [{numSignatures:r,padding:s,offsets:t,payload:i},n]}})}function Rd(){return gill.createEncoder({getSizeFromValue:e=>{let n=Hn*e.offsets.length,r=e.payload.reduce((s,t)=>s+qe+Ye+t.message.length,0);return 2+n+r},write:(e,n,r=0)=>{r=gill.getU8Encoder().write(e.numSignatures,n,r),r=gill.getU8Encoder().write(e.padding,n,r);let s=TC();for(let t of e.offsets)r=s.write(t,n,r);for(let t of e.payload)r=gill.fixEncoderSize(gill.getBytesEncoder(),qe).write(t.publicKey,n,r),r=gill.fixEncoderSize(gill.getBytesEncoder(),Ye).write(t.signature,n,r),r=gill.getBytesEncoder().write(t.message,n,r);return r}})}function UL(){return gill.combineCodec(Rd(),Pd())}function F(e,n){let r=e.length,s=mC+r*Hn,t=[];for(let o=0;o<r;o++){let{message:d}=e[o],u=s,g=u+qe,y=g+Ye;t.push({publicKeyOffset:u,publicKeyInstructionIndex:65535,signatureOffset:g,signatureInstructionIndex:65535,messageDataOffset:y,messageDataSize:d.length,messageInstructionIndex:65535}),s+=qe+Ye+d.length;}let c=n?.programAddress??pC,i={numSignatures:r,padding:0,offsets:t,payload:e};return {accounts:[],programAddress:c,data:Rd().encode(i)}}function WL(e){return {programAddress:e.programAddress,accounts:{},data:Pd().decode(e.data)}}async function GL({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=await re(e),{address:a}=await $(e,n),o=await ce([{address:a,type:"Settings"}],t),d=await k(o,[]),u=se(c,d.treeInfos,d.leafIndices,d.rootIndices,d.proveByIndices,o.filter(x=>x.type==="Settings"),q())[0],g=de(s),y=g.filter(x=>x instanceof C),f=[],l=[];for(let x of y){let O=f.length,{domainConfig:N,verifyArgs:V,signature:_,publicKey:K,message:L}=H(x,O);L&&_&&K&&f.push({message:L,signature:_,publicKey:K}),N&&(c.addPreAccounts([{address:N,role:gill.AccountRole.READONLY}]),V?.__option==="Some"&&l.push({domainConfigKey:N,verifyArgs:V.value}));}c.addPreAccounts(g.filter(x=>"address"in x).map(x=>({address:x.address,role:gill.AccountRole.READONLY_SIGNER,signer:x})));let{remainingAccounts:I,systemOffset:D}=c.toAccountMetas(),b=v(d,D),S=[];return f.length>0&&S.push(F(f)),S.push(xo({settings:i,settingsMutArgs:u,compressedProofArgs:b,payer:r,secp256r1VerifyArgs:l,remainingAccounts:I})),S}async function KL({admin:e,addressTree:n}){return to({payer:e,addressTree:n,remainingAccounts:[]})}async function $L({payer:e,rpId:n,origins:r,authority:s}){let t=await Ke({rpId:n}),c=new U;await c.addSystemAccounts();let i=await Te(),{address:a,addressTree:o}=await W(s.address,i),d=[{address:a,tree:o,queue:o,type:"User"}],u=await k([],d),g=(await ne(c,u.treeInfos,u.roots,u.rootIndices,d))[0],{remainingAccounts:y,systemOffset:f}=c.toAccountMetas(),l=v(u,f);return await bo({origins:r,authorityCreationArgs:g,authority:s,compressedProofArgs:l,payer:e,domainConfig:t,rpId:n,remainingAccounts:y})}async function iB({authority:e,payer:n,createUserArgs:r,domainConfig:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=[];r.index&&(i.push({address:(await $(r.index,r.settingsAddressTreeIndex)).address,type:"Settings"}),r.transactionManager&&i.push({address:(await W(r.transactionManager.member,r.transactionManager.userAddressTreeIndex)).address,type:"User"}));let a=i.length?await ce(i,t):[],o=await Te(),{address:d,addressTree:u}=await W(r.member,o),g=[{address:d,type:"User",tree:u,queue:u}],y=await k(a,g),f=null,l=null,I=a.filter(N=>N.type==="Settings"),D=a.filter(N=>N.type==="User");I.length&&(f=se(c,y.treeInfos.slice(0,1),y.leafIndices.slice(0,1),y.rootIndices.slice(0,1),y.proveByIndices.slice(0,1),I,q())[0]),D.length&&(l=se(c,y.treeInfos.slice(1,2),y.leafIndices.slice(1,2),y.rootIndices.slice(1,2),y.proveByIndices.slice(1,2),D,X())[0]);let b=await ne(c,y.treeInfos.slice(a.length),y.roots.slice(a.length),y.rootIndices.slice(a.length),g),{remainingAccounts:S,systemOffset:x}=c.toAccountMetas(),O=v(y,x);return await Oo({payer:n,authority:e,compressedProofArgs:O,member:lt().decode(r.member.toBuffer()),role:r.role,linkWalletArgs:f?gill.some({settingsMutArgs:f,transactionManager:l?gill.some(l):gill.none()}):gill.none(),userAccountCreationArgs:b[0],domainConfig:s,remainingAccounts:S})}async function gB({payer:e}){let n=await nd();return ko({payer:e,globalCounter:n})}async function SB({createUserArgs:e,payer:n}){let r=new U;await r.addSystemAccounts(),r.addPreAccounts(e.map(u=>({address:u.member.address,role:gill.AccountRole.READONLY_SIGNER,signer:u.member})));let s=await Te(),t=await Promise.all(e.map(async u=>{let{address:g,addressTree:y}=await W(u.member.address,s);return {address:g,tree:y,queue:y,type:"User"}})),c=await k([],t),i=await ne(r,c.treeInfos,c.roots,c.rootIndices,t),{remainingAccounts:a,systemOffset:o}=r.toAccountMetas(),d=v(c,o);return await jo({compressedProofArgs:d,payer:n,createUserArgs:e.map((u,g)=>({member:u.member.address,role:u.role,userCreationArgs:i[g],transactionManagerUrl:u.role===2?u.transactionManagerUrl:null})),remainingAccounts:a})}async function DB({admin:e,rpId:n,disable:r}){let s=await Ke({rpId:n});return oc({domainConfig:s,admin:e,disable:r,remainingAccounts:[]})}async function bB({authority:e,domainConfig:n,newAuthority:r,newOrigins:s}){let t=null,c=[];if(r){let i=new U;await i.addSystemAccounts();let a=await Te(),{address:o,addressTree:d}=await W(r.address,a),u=[{address:o,tree:d,queue:d,type:"User"}],g=await k([],u),y=(await ne(i,g.treeInfos,g.roots,g.rootIndices,u))[0],f=i.toAccountMetas();c=f.remainingAccounts,t={compressedProofArgs:v(g,f.systemOffset),authorityCreationArgs:y};}return Ac({domainConfig:n,authority:e,newOrigins:s?gill.some(s):gill.none(),newAuthorityArgs:t,newAuthority:r,remainingAccounts:c})}async function BB({authority:e,userAddressTreeIndex:n,transactionManagerUrl:r}){let s=new U;await s.addSystemAccounts();let t=await ce([{address:(await W(e.address,n)).address,type:"User"}]),c=await k(t,[]),i=se(s,c.treeInfos,c.leafIndices,c.rootIndices,c.proveByIndices,t,X())[0],{remainingAccounts:a,systemOffset:o}=s.toAccountMetas(),d=v(c,o);return lc({authority:e,transactionManagerUrl:r,compressedProofArgs:d,userMutArgs:i,remainingAccounts:a})}async function FB({args:e,authority:n,index:r,settingsAddressTreeIndex:s}){let t=new U;await t.addSystemAccounts();let{address:c,addressTree:i}=await $(r,s),a=[{address:c,tree:i,queue:i,type:"Settings"}],o=await k([],a),d=(await ne(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),y=v(o,g);return Dc({compressedProofArgs:y,args:e,authority:n,settingsCreationArgs:d,remainingAccounts:u})}async function ZB({args:e,authority:n,member:r,userAddressTreeIndex:s}){let t=new U;await t.addSystemAccounts();let{address:c,addressTree:i}=await W(r,s),a=[{address:c,tree:i,queue:i,type:"User"}],o=await k([],a),d=(await ne(t,o.treeInfos,o.roots,o.rootIndices,a))[0],{remainingAccounts:u,systemOffset:g}=t.toAccountMetas(),y=v(o,g);return vc({compressedProofArgs:y,args:e,authority:n,userCreationArgs:d,remainingAccounts:u})}async function lw({index:e,payer:n,initialMember:r,userAddressTreeIndex:s,delegateOperation:t,cachedAccounts:c}){let{domainConfig:i,verifyArgs:a,message:o,signature:d,publicKey:u}=H(r),g=[];o&&d&&u&&g.push({message:o,signature:d,publicKey:u});let y=new U;await y.addSystemAccounts();let f=[],l=[];l.push(...await ce([{address:(await W("address"in r?r.address:r,s)).address,type:"User"}],c));let I=await Te(),{address:D,addressTree:b}=await $(e,I);f.push({address:D,queue:b,tree:b,type:"Settings"});let S=l.length,x=await k(l,f),O=se(y,x.treeInfos.slice(0,S),x.leafIndices.slice(0,S),x.rootIndices.slice(0,S),x.proveByIndices.slice(0,S),l.filter(ae=>ae.type==="User"),X())[0],V=(await ne(y,x.treeInfos.slice(S),x.roots.slice(S),x.rootIndices.slice(S),f)).find(ae=>ae.type==="Settings")??null;i?y.addPreAccounts([{address:i,role:gill.AccountRole.READONLY}]):"address"in r&&y.addPreAccounts([{address:r.address,role:gill.AccountRole.READONLY_SIGNER,signer:r}]);let{remainingAccounts:_,systemOffset:K}=y.toAccountMetas(),L=v(x,K),le=[];if(!V)throw new Error("Settings creation args is missing.");return le.push(await Fo({settingsIndex:e,payer:n,initialMember:r instanceof C?void 0:r,secp256r1VerifyArgs:a,domainConfig:i,userMutArgs:O,compressedProofArgs:L,settingsCreation:V,delegateOperation:t,remainingAccounts:_})),{instructions:le,secp256r1VerifyInput:g}}async function Pw({index:e,settingsAddressTreeIndex:n,payer:r,signers:s,cachedAccounts:t}){let c=new U;await c.addSystemAccounts();let i=await ce([{address:(await $(e,n)).address,type:"Settings"}],t),a=await k(i,[]),o=se(c,a.treeInfos,a.leafIndices,a.rootIndices,a.proveByIndices,i.filter(S=>S.type==="Settings"),q())[0],d=de(s),u=d.filter(S=>S instanceof C),g=[],y=[];for(let S of u){let x=g.length,{domainConfig:O,verifyArgs:N,signature:V,publicKey:_,message:K}=H(S,x);K&&V&&_&&g.push({message:K,signature:V,publicKey:_}),O&&(c.addPreAccounts([{address:O,role:gill.AccountRole.READONLY}]),N?.__option==="Some"&&y.push({domainConfigKey:O,verifyArgs:N.value}));}c.addPreAccounts(d.filter(S=>"address"in S).map(S=>({address:S.address,role:gill.AccountRole.READONLY_SIGNER,signer:S})));let{remainingAccounts:f,systemOffset:l}=c.toAccountMetas(),I=v(a,l),D=[];g.length>0&&D.push(F(g));let b=await re(e);return D.push(Qo({settings:b,payer:r,settingsMut:o,compressedProofArgs:I,secp256r1VerifyArgs:y,remainingAccounts:f})),D}function CC(e,n,r,s){let t=DC(e,n),c=MC(e,n)&&r!==s;return t&&c?gill.AccountRole.WRITABLE_SIGNER:t&&!c?gill.AccountRole.WRITABLE:!t&&c?gill.AccountRole.READONLY_SIGNER:gill.AccountRole.READONLY}function DC(e,n){let r=e.staticAccounts.length,{numSignerAccounts:s,numReadonlySignerAccounts:t,numReadonlyNonSignerAccounts:c}=e.header,i=s-t,a=r-s-c;return n>=r?false:n<i?true:n>=s?n-s<a:false}function MC(e,n){return n<e.header.numSignerAccounts}async function mr({walletAddress:e,transactionMessageBytes:n,addressesByLookupTableAddress:r,additionalSigners:s}){let t=bi(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),te()):{}),i=[];i.push(...t.addressTableLookups?.map(a=>({role:gill.AccountRole.READONLY,address:a.lookupTableAddress}))??[]);for(let[a,o]of t.staticAccounts.entries())i.push({address:o,role:CC(t,a,o,e)});if(t.addressTableLookups)for(let a of t.addressTableLookups){let o=c[a.lookupTableAddress];if(!o)throw new Error(`Address lookup table account ${a.lookupTableAddress} not found`);for(let d of a.writableIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:gill.AccountRole.WRITABLE});}for(let d of a.readonlyIndexes){let u=o[d];if(!u)throw new Error(`Address lookup table account ${a.lookupTableAddress} does not contain address at index ${d}`);i.push({address:u,role:gill.AccountRole.READONLY});}}for(let a of s?.filter(o=>o.address!==e)??[]){let o=i.findIndex(d=>d.address===a.address);o===-1?i.push({address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}):i[o].role===gill.AccountRole.READONLY||i[o].role===gill.AccountRole.READONLY_SIGNER?i[o]={address:a.address,role:gill.AccountRole.READONLY_SIGNER,signer:a}:(i[o].role===gill.AccountRole.WRITABLE||i[o].role===gill.AccountRole.WRITABLE_SIGNER)&&(i[o]={address:a.address,role:gill.AccountRole.WRITABLE_SIGNER,signer:a});}return {accountMetas:i,addressLookupTableAccounts:c,transactionMessage:t}}async function Od({settings:e,transactionBufferAddress:n,transactionMessageBytes:r,payer:s,addressesByLookupTableAddress:t,secp256r1VerifyInput:c=[],additionalSigners:i=[],jitoBundlesTipAmount:a,compressed:o=false}){let d=await Ie(e),{accountMetas:u,addressLookupTableAccounts:g}=await mr({transactionMessageBytes:r,walletAddress:d,additionalSigners:i,addressesByLookupTableAddress:t}),y=[];return c.length>0&&y.push(F(c)),y.push(o?yi({transactionBuffer:n,payer:s.address,remainingAccounts:u,settingsKey:e}):ai({transactionBuffer:n,payer:s.address,settings:e})),a&&y.push(ki({payer:s,tipAmount:a})),{instructions:y,addressLookupTableAccounts:g}}async function Ld({index:e,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:s,payer:t,addressesByLookupTableAddress:c,secp256r1VerifyInput:i=[],compressed:a=false,simulateProof:o=false,cachedAccounts:d}){let u=de(s),g=await re(e),y=await Ie(g),[{accountMetas:f,addressLookupTableAccounts:l,transactionMessage:I},{settingsReadonlyArgs:D,proof:b,packedAccounts:S}]=await Promise.all([mr({transactionMessageBytes:r,walletAddress:y,additionalSigners:u.filter(L=>!(L instanceof C)),addressesByLookupTableAddress:c}),pe(a,e,n,o,d)]);S.addPreAccounts(f);let x=u.filter(L=>L instanceof C),O=[];for(let L of x){let le=i.length,{domainConfig:ae,verifyArgs:Pe,signature:De,publicKey:Wt,message:_t}=H(L,le);_t&&De&&Wt&&i.push({message:_t,signature:De,publicKey:Wt}),ae&&(S.addPreAccounts([{address:ae,role:gill.AccountRole.READONLY}]),Pe?.__option==="Some"&&O.push({domainConfigKey:ae,verifyArgs:Pe.value}));}let{remainingAccounts:N,systemOffset:V}=S.toAccountMetas(),_=[];i.length>0&&_.push(F(i));let K=EC(I,f);if(a){if(!t||!D)throw new Error("Payer not found or proof args is missing.");let L=v(b,V);_.push(hi({secp256r1VerifyArgs:O,transactionMessage:K,settingsReadonlyArgs:D,compressedProofArgs:L,payer:t,remainingAccounts:N}));}else _.push(Si({secp256r1VerifyArgs:O,settings:g,transactionMessage:K,remainingAccounts:N}));return {instructions:_,addressLookupTableAccounts:l}}function EC(e,n){if(e.version==="legacy")throw new Error("Only versioned transaction is allowed.");return {numSigners:e.header.numSignerAccounts,numWritableNonSigners:e.staticAccounts.length-e.header.numSignerAccounts-e.header.numReadonlyNonSignerAccounts,numWritableSigners:e.header.numSignerAccounts-e.header.numReadonlySignerAccounts,numAccountKeys:e.staticAccounts.length,instructions:e.instructions.map(r=>({...r,accountIndices:new Uint8Array(r.accountIndices??[]),data:new Uint8Array(r.data??[])})),addressTableLookups:e.addressTableLookups?.map(r=>({lookupTableAddressIndex:n.findIndex(s=>s.address===r.lookupTableAddress),writableIndexes:new Uint8Array(r.writableIndexes),readonlyIndexes:new Uint8Array(r.readonlyIndexes)}))??[]}}async function tk({index:e,settingsAddressTreeIndex:n,destination:r,signers:s,cachedAccounts:t,amount:c,payer:i,compressed:a=false}){let o=de(s),d=await re(e),u=await Ie(d),{settingsReadonlyArgs:g,proof:y,packedAccounts:f}=await pe(a,e,n,false,t),l=[],I=[];for(let x of o)if(x instanceof C){let O=l.length,{domainConfig:N,verifyArgs:V,signature:_,publicKey:K,message:L}=H(x,O);L&&_&&K&&l.push({message:L,signature:_,publicKey:K}),N&&(f.addPreAccounts([{address:N,role:gill.AccountRole.READONLY}]),V?.__option==="Some"&&I.push({domainConfigKey:N,verifyArgs:V.value}));}else f.addPreAccounts([{address:x.address,role:gill.AccountRole.READONLY_SIGNER,signer:x}]);let{remainingAccounts:D,systemOffset:b}=f.toAccountMetas(),S=[];if(l.length>0&&S.push(F(l)),a){if(!i||!g)throw new Error("Payer not found or proof args is missing.");let x=v(y,b);S.push(Nc({amount:c,settingsReadonlyArgs:g,compressedProofArgs:x,payer:i,secp256r1VerifyArgs:I,source:u,destination:r,remainingAccounts:D}));}else S.push(_c({amount:c,secp256r1VerifyArgs:I,source:u,destination:r,settings:d,remainingAccounts:D}));return S}async function Ak({index:e,settingsAddressTreeIndex:n,destination:r,mint:s,signers:t,cachedAccounts:c,amount:i,payer:a,tokenProgram:o,compressed:d=false}){let u=de(t),g=await re(e),y=await Ie(g),[f,l]=await Promise.all([programs.getAssociatedTokenAccountAddress(s,y,o),programs.getAssociatedTokenAccountAddress(s,r,o)]),{settingsReadonlyArgs:I,proof:D,packedAccounts:b}=await pe(d,e,n,false,c),S=[],x=[];for(let _ of u)if(_ instanceof C){let K=S.length,{domainConfig:L,verifyArgs:le,signature:ae,publicKey:Pe,message:De}=H(_,K);De&&ae&&Pe&&S.push({message:De,signature:ae,publicKey:Pe}),L&&(b.addPreAccounts([{address:L,role:gill.AccountRole.READONLY}]),le?.__option==="Some"&&x.push({domainConfigKey:L,verifyArgs:le.value}));}else b.addPreAccounts([{address:_.address,role:gill.AccountRole.READONLY_SIGNER,signer:_}]);let{remainingAccounts:O,systemOffset:N}=b.toAccountMetas(),V=[];if(S.length>0&&V.push(F(S)),d){if(!a||!I)throw new Error("Payer not found or proof args is missing.");let _=v(D,N);V.push(Yc({amount:i,settingsReadonlyArgs:I,compressedProofArgs:_,payer:a,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:f,destination:r,destinationTokenAccount:l,mint:s,tokenProgram:o,remainingAccounts:O}));}else V.push(Fc({amount:i,secp256r1VerifyArgs:x,source:y,sourceTokenAccount:f,destination:r,destinationTokenAccount:l,settings:g,mint:s,tokenProgram:o,remainingAccounts:O}));return V}async function Ck({index:e,settingsAddressTreeIndex:n,closer:r,transactionBufferAddress:s,payer:t,compressed:c=false,cachedAccounts:i}){let a=await Fs(te(),s),o=a.data.multiWalletSettings,{settingsReadonlyArgs:d,proof:u,packedAccounts:g}=await pe(c,e,n,false,i),{remainingAccounts:y,systemOffset:f}=g.toAccountMetas(),{domainConfig:l,verifyArgs:I,message:D,signature:b,publicKey:S}=H(r),x=[];if(D&&b&&S&&x.push(F([{message:D,signature:b,publicKey:S}])),c){if(!t||!d)throw new Error("Payer not found or proof args is missing.");let O=v(u,f);x.push(aa({transactionBuffer:s,domainConfig:l,closer:r instanceof C?void 0:r,rentCollector:a.data.payer,secp256r1VerifyArgs:I,settingsReadonlyArgs:d,payer:t,compressedProofArgs:O,remainingAccounts:y}));}else x.push(ta({transactionBuffer:s,domainConfig:l,closer:r instanceof C?void 0:r,settings:o,payer:a.data.payer,secp256r1VerifyArgs:I,remainingAccounts:[]}));return x}function Nd({payer:e,creator:n,bufferIndex:r,settings:s,transactionBufferAddress:t,finalBufferHash:c,finalBufferSize:i,preauthorizeExecution:a,bufferExtendHashes:o,compressedArgs:d,expectedSecp256r1Signers:u}){let{domainConfig:g,verifyArgs:y,message:f,signature:l,publicKey:I}=H(n),D=[];if(f&&l&&I&&D.push(F([{message:f,signature:l,publicKey:I}])),d){let{settingsReadonlyArgs:b,compressedProofArgs:S,remainingAccounts:x}=d;D.push(Sa({transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof C?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},settingsReadonlyArgs:b,compressedProofArgs:S,remainingAccounts:x}));}else D.push(ya({settings:s,transactionBuffer:t,payer:e,secp256r1VerifyArgs:y,creator:n instanceof C?void 0:n,domainConfig:g,args:{bufferIndex:r,finalBufferHash:c,finalBufferSize:i,bufferExtendHashes:o,preauthorizeExecution:a,expectedSecp256r1Signers:u},remainingAccounts:[]}));return D}function Hd({executor:e,transactionBufferAddress:n,settings:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,message:a,publicKey:o}=H(e),d=[];return a&&i&&o&&d.push(F([{message:a,signature:i,publicKey:o}])),s?d.push(Ua({transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(ha({settings:r,transactionBuffer:n,secp256r1VerifyArgs:c,domainConfig:t,executor:e instanceof C?void 0:e,remainingAccounts:[]})),d}function Vd({transactionMessageBytes:e,transactionBufferAddress:n,settings:r,compressed:s=false}){return s?Fa({transactionBuffer:n,buffer:e,settingsKey:r,remainingAccounts:[]}):wa({transactionBuffer:n,buffer:e,settings:r,remainingAccounts:[]})}function Gd({settings:e,voter:n,transactionBufferAddress:r,compressedArgs:s}){let{domainConfig:t,verifyArgs:c,signature:i,publicKey:a,message:o}=H(n),d=[];return o&&i&&a&&d.push(F([{message:o,signature:i,publicKey:a}])),s?d.push(ti({transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,settingsReadonlyArgs:s.settingsReadonlyArgs,payer:s.payer,compressedProofArgs:s.compressedProofArgs,remainingAccounts:s.remainingAccounts})):d.push(Ya({settings:e,transactionBuffer:r,secp256r1VerifyArgs:c,domainConfig:t,voter:n instanceof C?void 0:n,remainingAccounts:[]})),d}async function a2({message:e,signer:n,popUp:r}){let s=await ur({authUrl:`${Ee()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"message",payload:e},signer:n,popUp:r,additionalInfo:or()});return {...s,signer:new ie(s.signer),userAddressTreeIndex:s.userAddressTree?await ir(s.userAddressTree):void 0}}async function g2({transactionActionType:e,transactionAddress:n,transactionMessageBytes:r,signer:s,popUp:t}){let c=await ur({authUrl:`${Ee()}/?redirectUrl=${encodeURIComponent(window.origin)}`,data:{type:"transaction",payload:JSON.stringify({transactionActionType:e,transactionAddress:n,transactionMessageBytes:Ar(r)})},additionalInfo:or(),signer:s,popUp:t});return {...c,signer:new ie(c.signer),userAddressTreeIndex:c.userAddressTree?await ir(c.userAddressTree):void 0}}async function l2({message:e,response:n,expectedRPID:r=Fi(),expectedOrigin:s=Ee()}){let{verified:t}=await server.verifyAuthenticationResponse({response:n.authResponse,expectedChallenge:Ar(new Uint8Array([...new TextEncoder().encode(n.requestedClient),...new TextEncoder().encode(e)])),expectedOrigin:s,expectedRPID:r,requireUserVerification:false,credential:{id:n.authResponse.id,publicKey:Td(n.signer.toString()),counter:0}});return t}async function v2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,creator:t,executor:c,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o,compressed:d=false,bufferIndex:u=Math.floor(Math.random()*255),additionalVoters:g=[],additionalSigners:y=[],chunkSize:f=Math.ceil(s.length/2),cachedAccounts:l}){let I=await re(n),D=await sd(I,t instanceof C?t:t.address,u),b=[],S=[];for(let z=0;z<s.length;z+=f){let Vn=s.subarray(z,z+f);b.push(Vn),S.push(sha256.sha256(Vn));}let x=sha256.sha256(new Uint8Array(s)),{settingsReadonlyArgs:O,proof:N,packedAccounts:V}=await pe(d,n,r,false,l),{remainingAccounts:_,systemOffset:K}=V.toAccountMetas(),L=O?{settingsReadonlyArgs:O,compressedProofArgs:v(N,K),remainingAccounts:_,payer:e}:null,le=de([t,...c?[c]:[],...g]).filter(z=>z instanceof C).map(z=>({memberKey:Ge(z),messageHash:sha256.sha256(new Uint8Array([...z.authData,...sha256.sha256(z.verifyArgs.clientDataJson)]))})),ae=Nd({finalBufferHash:x,finalBufferSize:s.length,bufferIndex:u,payer:e,transactionBufferAddress:D,settings:I,creator:t,preauthorizeExecution:!c,bufferExtendHashes:S,compressedArgs:L,expectedSecp256r1Signers:le}),Pe=b.map(z=>Vd({transactionMessageBytes:z,transactionBufferAddress:D,settings:I,compressed:d})),De=g.map(z=>Gd({voter:z,transactionBufferAddress:D,settings:I,compressedArgs:L})),Wt=Hd({compressedArgs:L,settings:I,executor:c,transactionBufferAddress:D}),{instructions:_t,addressLookupTableAccounts:zd}=await Od({compressed:d,settings:I,transactionMessageBytes:s,transactionBufferAddress:D,payer:e,additionalSigners:y,secp256r1VerifyInput:i,jitoBundlesTipAmount:a,addressesByLookupTableAddress:o}),T=z=>({payer:e,instructions:z,addressesByLookupTableAddress:zd});return [T(ae),...Pe.map(z=>T([z])),...De.length?[T(De.flat())]:[],T(Wt),T(_t)]}var lr=class e{payer;keyMetaMap;constructor(n,r){this.payer=n,this.keyMetaMap=r;}static compile(n,r){let s=new Map,t=i=>{let a=s.get(i);return a===void 0&&(a={isSigner:false,isWritable:false,isInvoked:false},s.set(i,a)),a},c=t(r);c.isSigner=true,c.isWritable=true;for(let i of n){t(i.programAddress).isInvoked=false;for(let a of i.accounts??[]){let o=t(a.address);o.isSigner||=a.role===gill.AccountRole.READONLY_SIGNER||a.role===gill.AccountRole.WRITABLE_SIGNER,o.isWritable||=a.role===gill.AccountRole.WRITABLE||a.role===gill.AccountRole.WRITABLE_SIGNER;}}return new e(r,s)}getMessageComponents(){let n=[...this.keyMetaMap.entries()];if(n.length>256)throw new Error("Max static account keys length exceeded");let r=n.filter(([,o])=>o.isSigner&&o.isWritable),s=n.filter(([,o])=>o.isSigner&&!o.isWritable),t=n.filter(([,o])=>!o.isSigner&&o.isWritable),c=n.filter(([,o])=>!o.isSigner&&!o.isWritable),i={numSignerAccounts:r.length+s.length,numReadonlySignerAccounts:s.length,numReadonlyNonSignerAccounts:c.length};{if(r.length===0)throw new Error("Expected at least one writable signer key");let[o]=r[0];if(o!==this.payer)throw new Error("Expected first writable signer key to be the fee payer")}let a=[...r.map(([o])=>o),...s.map(([o])=>o),...t.map(([o])=>o),...c.map(([o])=>o)];return [i,a]}extractTableLookup(n){let[r,s]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&i.isWritable),[t,c]=this.drainKeysFoundInLookupTable(n[1],i=>!i.isSigner&&!i.isInvoked&&!i.isWritable);if(!(r.length===0&&t.length===0))return {addressTableLookup:{lookupTableAddress:n[0],writableIndexes:r,readonlyIndexes:t},drainedKeys:{writable:s,readonly:c}}}drainKeysFoundInLookupTable(n,r){let s=new Array,t=new Array;for(let[c,i]of this.keyMetaMap.entries())if(r(i)){let a=c,o=n.findIndex(d=>d===a);if(o>=0){if(o>=256)throw new Error("Max lookup table index exceeded");s.push(o),t.push(a),this.keyMetaMap.delete(c);}}return [s,t]}};var fr=class{staticAccountKeys;accountKeysFromLookups;constructor(n,r){this.staticAccountKeys=n,this.accountKeysFromLookups=r;}keySegments(){let n=[this.staticAccountKeys];return this.accountKeysFromLookups&&(n.push(this.accountKeysFromLookups.writable),n.push(this.accountKeysFromLookups.readonly)),n}get(n){for(let r of this.keySegments()){if(n<r.length)return r[n];n-=r.length;}}get length(){return this.keySegments().flat().length}compileInstructions(n){if(this.length>256)throw new Error("Account index overflow encountered during compilation");let s=new Map;this.keySegments().flat().forEach((c,i)=>{s.set(c,i);});let t=c=>{let i=s.get(c);if(i===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return i};return n.map(c=>({programAddressIndex:t(c.programAddress),accountIndices:c.accounts?.map(i=>t(i.address))??[],data:c.data}))}};function Fd({payer:e,recentBlockhash:n,instructions:r,addressesByLookupTableAddress:s}){let t=lr.compile(r,e),c=new Array,i={writable:[],readonly:[]},a=Object.entries(s??{});for(let y of a){let f=t.extractTableLookup(y);if(f!==void 0){let{addressTableLookup:l,drainedKeys:I}=f;c.push({readonlyIndexes:l.readonlyIndexes,readableIndices:l.readonlyIndexes,writableIndexes:l.writableIndexes,writableIndices:l.writableIndexes,lookupTableAddress:gill.address(l.lookupTableAddress)}),i.writable.push(...I.writable),i.readonly.push(...I.readonly);}}let[o,d]=t.getMessageComponents(),g=new fr(d,i).compileInstructions(r);return {version:0,header:o,instructions:g,lifetimeToken:n,staticAccounts:d,addressTableLookups:c}}function G2({instructions:e,payer:n,addressesByLookupTableAddress:r}){let s=Fd({instructions:e,payer:n,recentBlockhash:A,addressesByLookupTableAddress:r});return vi(s)}async function j2({payer:e,index:n,settingsAddressTreeIndex:r,transactionMessageBytes:s,signers:t,secp256r1VerifyInput:c,addressesByLookupTableAddress:i,cachedAccounts:a,compressed:o=false,simulateProof:d=false}){let{instructions:u,addressLookupTableAccounts:g}=await Ld({index:n,settingsAddressTreeIndex:r,payer:e,signers:t,transactionMessageBytes:s,secp256r1VerifyInput:c,compressed:o,addressesByLookupTableAddress:i,simulateProof:d,cachedAccounts:a});return {payer:e,instructions:u,addressesByLookupTableAddress:g}}
|
|
2
|
+
exports.ADD_WHITELISTED_ADDRESS_TREES_DISCRIMINATOR=Qs;exports.CHANGE_CONFIG_COMPRESSED_DISCRIMINATOR=Ao;exports.CHANGE_CONFIG_DISCRIMINATOR=oo;exports.COMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=lo;exports.CREATE_DOMAIN_CONFIG_DISCRIMINATOR=Ro;exports.CREATE_DOMAIN_USER_ACCOUNT_DISCRIMINATOR=Wo;exports.CREATE_GLOBAL_COUNTER_DISCRIMINATOR=Bo;exports.CREATE_MULTI_WALLET_COMPRESSED_DISCRIMINATOR=Vo;exports.CREATE_USER_ACCOUNTS_DISCRIMINATOR=Ko;exports.DECOMPRESS_SETTINGS_ACCOUNT_DISCRIMINATOR=Zo;exports.DISABLE_DOMAIN_CONFIG_DISCRIMINATOR=rc;exports.DOMAIN_CONFIG_DISCRIMINATOR=Gn;exports.DelegateOp=zt;exports.EDIT_DOMAIN_CONFIG_DISCRIMINATOR=dc;exports.EDIT_TRANSACTION_MANAGER_URL_DISCRIMINATOR=mc;exports.GLOBAL_COUNTER_DISCRIMINATOR=qn;exports.KeyType=Rt;exports.MIGRATE_COMPRESSED_SETTINGS_DISCRIMINATOR=xc;exports.MIGRATE_COMPRESSED_USERS_DISCRIMINATOR=Ec;exports.MULTI_WALLET_ERROR__ALREADY_DELEGATED=px;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_DISABLED=_x;exports.MULTI_WALLET_ERROR__DOMAIN_CONFIG_IS_MISSING=Ox;exports.MULTI_WALLET_ERROR__DUPLICATE_MEMBER=ex;exports.MULTI_WALLET_ERROR__DURABLE_NONCE_DETECTED=QS;exports.MULTI_WALLET_ERROR__EMPTY_MEMBERS=cx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_HASH_MISMATCH=Dx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_EXCEEDED=Mx;exports.MULTI_WALLET_ERROR__FINAL_BUFFER_SIZE_MISMATCH=hx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNERS_WITH_VOTE_PERMISSION=fx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_EXECUTE_PERMISSION=Tx;exports.MULTI_WALLET_ERROR__INSUFFICIENT_SIGNER_WITH_INITIATE_PERMISSION=lx;exports.MULTI_WALLET_ERROR__INVALID_ACCOUNT=Ax;exports.MULTI_WALLET_ERROR__INVALID_ADDRESS_TREE=kx;exports.MULTI_WALLET_ERROR__INVALID_ARGUMENTS=gx;exports.MULTI_WALLET_ERROR__INVALID_BUFFER=Cx;exports.MULTI_WALLET_ERROR__INVALID_NUMBER_OF_ACCOUNTS=ux;exports.MULTI_WALLET_ERROR__INVALID_SECP256R1_VERIFY_ARG=$S;exports.MULTI_WALLET_ERROR__INVALID_SIGNED_MESSAGE=XS;exports.MULTI_WALLET_ERROR__INVALID_SYSVAR_DATA_FORMAT=Ux;exports.MULTI_WALLET_ERROR__INVALID_THRESHOLD=ix;exports.MULTI_WALLET_ERROR__INVALID_TRANSACTION_MESSAGE=dx;exports.MULTI_WALLET_ERROR__MAX_LENGTH_EXCEEDED=vx;exports.MULTI_WALLET_ERROR__MEMBER_DOES_NOT_BELONG_TO_DOMAIN_CONFIG=Lx;exports.MULTI_WALLET_ERROR__MISSING_ACCOUNT=yx;exports.MULTI_WALLET_ERROR__MISSING_SYSVAR_SLOT_HISTORY=bx;exports.MULTI_WALLET_ERROR__MISSING_USER_ARGS=mx;exports.MULTI_WALLET_ERROR__NO_SIGNER_FOUND=xx;exports.MULTI_WALLET_ERROR__ONLY_ONE_PERMANENT_MEMBER_ALLOWED=nx;exports.MULTI_WALLET_ERROR__ONLY_ONE_TRANSACTION_MANAGER_ALLOWED=sx;exports.MULTI_WALLET_ERROR__ORIGIN_INDEX_OUT_OF_BOUNDS=wx;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER=tx;exports.MULTI_WALLET_ERROR__PERMANENT_MEMBER_NOT_ALLOWED=rx;exports.MULTI_WALLET_ERROR__PROTECTED_ACCOUNT=Rx;exports.MULTI_WALLET_ERROR__RP_ID_HASH_MISMATCH=Bx;exports.MULTI_WALLET_ERROR__SLOT_NUMBER_NOT_FOUND=Wx;exports.MULTI_WALLET_ERROR__TOO_MANY_MEMBERS=ax;exports.MULTI_WALLET_ERROR__TRANSACTION_HAS_EXPIRED=Ex;exports.MULTI_WALLET_ERROR__TRANSACTION_MANAGER_NOT_ALLOWED=ox;exports.MULTI_WALLET_ERROR__TRANSACTION_NOT_APPROVED=Px;exports.MULTI_WALLET_ERROR__UNAUTHORISED_TO_CLOSE_TRANSACTION_BUFFER=Ix;exports.MULTI_WALLET_ERROR__UNEXPECTED_SIGNER=Sx;exports.MULTI_WALLET_PROGRAM_ADDRESS=A;exports.MultiWalletAccount=qS;exports.MultiWalletInstruction=YS;exports.NATIVE_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=Bc;exports.NATIVE_TRANSFER_INTENT_DISCRIMINATOR=Uc;exports.Permission=xe;exports.Permissions=Me;exports.SETTINGS_DISCRIMINATOR=_s;exports.Secp256r1Key=ie;exports.SignedSecp256r1Key=C;exports.TOKEN_TRANSFER_INTENT_COMPRESSED_DISCRIMINATOR=jc;exports.TOKEN_TRANSFER_INTENT_DISCRIMINATOR=Vc;exports.TRANSACTION_BUFFER_CLOSE_COMPRESSED_DISCRIMINATOR=sa;exports.TRANSACTION_BUFFER_CLOSE_DISCRIMINATOR=$c;exports.TRANSACTION_BUFFER_CREATE_COMPRESSED_DISCRIMINATOR=Ta;exports.TRANSACTION_BUFFER_CREATE_DISCRIMINATOR=ua;exports.TRANSACTION_BUFFER_DISCRIMINATOR=Hs;exports.TRANSACTION_BUFFER_EXECUTE_COMPRESSED_DISCRIMINATOR=Ra;exports.TRANSACTION_BUFFER_EXECUTE_DISCRIMINATOR=Ca;exports.TRANSACTION_BUFFER_EXTEND_COMPRESSED_DISCRIMINATOR=Ha;exports.TRANSACTION_BUFFER_EXTEND_DISCRIMINATOR=Oa;exports.TRANSACTION_BUFFER_VOTE_COMPRESSED_DISCRIMINATOR=$a;exports.TRANSACTION_BUFFER_VOTE_DISCRIMINATOR=Ja;exports.TRANSACTION_EXECUTE_COMPRESSED_DISCRIMINATOR=ui;exports.TRANSACTION_EXECUTE_DISCRIMINATOR=si;exports.TRANSACTION_EXECUTE_SYNC_COMPRESSED_DISCRIMINATOR=Ci;exports.TRANSACTION_EXECUTE_SYNC_DISCRIMINATOR=Ti;exports.UserRole=He;exports.WHITELISTED_ADDRESS_TREE_DISCRIMINATOR=Js;exports.addWhitelistedAddressTrees=KL;exports.changeConfig=RL;exports.closeTransactionBuffer=Ck;exports.compressSettingsAccount=GL;exports.configAction=fD;exports.convertMemberKeyToString=fd;exports.convertPubkeyCompressedToCose=Td;exports.convertPubkeyCoseToCompressed=zO;exports.createDomainConfig=$L;exports.createDomainUserAccounts=iB;exports.createGlobalCounter=gB;exports.createPopUp=gd;exports.createTransactionBuffer=Nd;exports.createTransactionManagerSigner=tC;exports.createUserAccounts=SB;exports.createWallet=lw;exports.decodeDomainConfig=zn;exports.decodeGlobalCounter=Zn;exports.decodeSettings=Ls;exports.decodeTransactionBuffer=Gs;exports.decodeWhitelistedAddressTree=qs;exports.decompressSettingsAccount=Pw;exports.disableDomainConfig=DB;exports.editDomainConfig=bB;exports.editTransactionManagerUrl=BB;exports.executeTransaction=Od;exports.executeTransactionBuffer=Hd;exports.executeTransactionSync=Ld;exports.extendTransactionBuffer=Vd;exports.fetchAllDomainConfig=_C;exports.fetchAllGlobalCounter=HC;exports.fetchAllMaybeDomainConfig=su;exports.fetchAllMaybeGlobalCounter=xu;exports.fetchAllMaybeSettings=Oy;exports.fetchAllMaybeTransactionBuffer=rm;exports.fetchAllMaybeWhitelistedAddressTree=Cm;exports.fetchAllSettings=uE;exports.fetchAllTransactionBuffer=lE;exports.fetchAllWhitelistedAddressTree=CE;exports.fetchDomainConfig=Kn;exports.fetchGlobalCounter=NC;exports.fetchMaybeDomainConfig=nu;exports.fetchMaybeGlobalCounter=Su;exports.fetchMaybeSettings=$r;exports.fetchMaybeSettingsAccountData=bI;exports.fetchMaybeTransactionBuffer=tm;exports.fetchMaybeUserAccountData=vI;exports.fetchMaybeWhitelistedAddressTree=Im;exports.fetchSettings=dE;exports.fetchSettingsAccountData=$i;exports.fetchTransactionBuffer=Fs;exports.fetchUserAccountData=Xi;exports.fetchWhitelistedAddressTree=Ys;exports.getAddMemberArgsCodec=KC;exports.getAddMemberArgsDecoder=xr;exports.getAddMemberArgsEncoder=Sr;exports.getAddWhitelistedAddressTreesDiscriminatorBytes=NE;exports.getAddWhitelistedAddressTreesInstruction=VE;exports.getAddWhitelistedAddressTreesInstructionAsync=to;exports.getAddWhitelistedAddressTreesInstructionDataCodec=HE;exports.getAddWhitelistedAddressTreesInstructionDataDecoder=eo;exports.getAddWhitelistedAddressTreesInstructionDataEncoder=cn;exports.getAuthEndpoint=Ee;exports.getChangeConfigCompressedDiscriminatorBytes=oP;exports.getChangeConfigCompressedInstruction=mo;exports.getChangeConfigCompressedInstructionDataCodec=cP;exports.getChangeConfigCompressedInstructionDataDecoder=yo;exports.getChangeConfigCompressedInstructionDataEncoder=go;exports.getChangeConfigDiscriminatorBytes=YE;exports.getChangeConfigInstruction=XE;exports.getChangeConfigInstructionAsync=ao;exports.getChangeConfigInstructionDataCodec=ZE;exports.getChangeConfigInstructionDataDecoder=co;exports.getChangeConfigInstructionDataEncoder=an;exports.getCompiledInstructionCodec=qC;exports.getCompiledInstructionDecoder=Cr;exports.getCompiledInstructionEncoder=Ir;exports.getCompressSettingsAccountDiscriminatorBytes=mP;exports.getCompressSettingsAccountInstruction=xo;exports.getCompressSettingsAccountInstructionDataCodec=pP;exports.getCompressSettingsAccountInstructionDataDecoder=So;exports.getCompressSettingsAccountInstructionDataEncoder=fo;exports.getCompressedAccountMetaCodec=$C;exports.getCompressedAccountMetaDecoder=tt;exports.getCompressedAccountMetaEncoder=et;exports.getCompressedAccountMetaReadOnlyCodec=rD;exports.getCompressedAccountMetaReadOnlyDecoder=ot;exports.getCompressedAccountMetaReadOnlyEncoder=st;exports.getCompressedProofCodec=oD;exports.getCompressedProofDecoder=Rr;exports.getCompressedProofEncoder=Pr;exports.getCompressedSettingsAddressFromIndex=$;exports.getCompressedSettingsCodec=dD;exports.getCompressedSettingsDataCodec=yD;exports.getCompressedSettingsDataDecoder=it;exports.getCompressedSettingsDataEncoder=at;exports.getCompressedSettingsDecoder=q;exports.getCompressedSettingsEncoder=ct;exports.getComputeBudgetEstimate=Gi;exports.getConfigActionCodec=lD;exports.getConfigActionDecoder=gt;exports.getConfigActionEncoder=At;exports.getCreateDomainConfigDiscriminatorBytes=DP;exports.getCreateDomainConfigInstruction=hP;exports.getCreateDomainConfigInstructionAsync=bo;exports.getCreateDomainConfigInstructionDataCodec=MP;exports.getCreateDomainConfigInstructionDataDecoder=vo;exports.getCreateDomainConfigInstructionDataEncoder=un;exports.getCreateDomainUserAccountDiscriminatorBytes=_P;exports.getCreateDomainUserAccountInstruction=LP;exports.getCreateDomainUserAccountInstructionAsync=Oo;exports.getCreateDomainUserAccountInstructionDataCodec=OP;exports.getCreateDomainUserAccountInstructionDataDecoder=_o;exports.getCreateDomainUserAccountInstructionDataEncoder=gn;exports.getCreateGlobalCounterDiscriminatorBytes=GP;exports.getCreateGlobalCounterInstruction=zP;exports.getCreateGlobalCounterInstructionAsync=ko;exports.getCreateGlobalCounterInstructionDataCodec=FP;exports.getCreateGlobalCounterInstructionDataDecoder=wo;exports.getCreateGlobalCounterInstructionDataEncoder=mn;exports.getCreateMultiWalletCompressedDiscriminatorBytes=$P;exports.getCreateMultiWalletCompressedInstruction=eR;exports.getCreateMultiWalletCompressedInstructionAsync=Fo;exports.getCreateMultiWalletCompressedInstructionDataCodec=QP;exports.getCreateMultiWalletCompressedInstructionDataDecoder=Go;exports.getCreateMultiWalletCompressedInstructionDataEncoder=pn;exports.getCreateUserAccountArgsCodec=DD;exports.getCreateUserAccountArgsDecoder=Br;exports.getCreateUserAccountArgsEncoder=Lr;exports.getCreateUserAccountsDiscriminatorBytes=iR;exports.getCreateUserAccountsInstruction=uR;exports.getCreateUserAccountsInstructionAsync=jo;exports.getCreateUserAccountsInstructionDataCodec=dR;exports.getCreateUserAccountsInstructionDataDecoder=Jo;exports.getCreateUserAccountsInstructionDataEncoder=ln;exports.getDecompressSettingsAccountDiscriminatorBytes=fR;exports.getDecompressSettingsAccountInstruction=Qo;exports.getDecompressSettingsAccountInstructionDataCodec=SR;exports.getDecompressSettingsAccountInstructionDataDecoder=$o;exports.getDecompressSettingsAccountInstructionDataEncoder=Xo;exports.getDelegateOpCodec=ED;exports.getDelegateOpDecoder=ve;exports.getDelegateOpEncoder=Re;exports.getDisableDomainConfigDiscriminatorBytes=ER;exports.getDisableDomainConfigInstruction=oc;exports.getDisableDomainConfigInstructionDataCodec=PR;exports.getDisableDomainConfigInstructionDataDecoder=sc;exports.getDisableDomainConfigInstructionDataEncoder=nc;exports.getDomainConfigAddress=Ke;exports.getDomainConfigCodec=WC;exports.getDomainConfigDecoder=Fn;exports.getDomainConfigDiscriminatorBytes=UC;exports.getDomainConfigEncoder=ru;exports.getDomainConfigSize=OC;exports.getEditDomainConfigDiscriminatorBytes=LR;exports.getEditDomainConfigInstruction=Ac;exports.getEditDomainConfigInstructionAsync=wR;exports.getEditDomainConfigInstructionDataCodec=BR;exports.getEditDomainConfigInstructionDataDecoder=uc;exports.getEditDomainConfigInstructionDataEncoder=Sn;exports.getEditMemberArgsCodec=bD;exports.getEditMemberArgsDecoder=Wr;exports.getEditMemberArgsEncoder=Ur;exports.getEditTransactionManagerUrlDiscriminatorBytes=KR;exports.getEditTransactionManagerUrlInstruction=lc;exports.getEditTransactionManagerUrlInstructionDataCodec=JR;exports.getEditTransactionManagerUrlInstructionDataDecoder=Tc;exports.getEditTransactionManagerUrlInstructionDataEncoder=pc;exports.getExpectedSecp256r1SignersCodec=OD;exports.getExpectedSecp256r1SignersDecoder=mt;exports.getExpectedSecp256r1SignersEncoder=yt;exports.getFeePayer=K_;exports.getGlobalAdditonalInfo=or;exports.getGlobalCounterAddress=nd;exports.getGlobalCounterCodec=kC;exports.getGlobalCounterDecoder=Yn;exports.getGlobalCounterDiscriminatorBytes=wC;exports.getGlobalCounterEncoder=fu;exports.getGlobalCounterSize=VC;exports.getJitoTipsConfig=_n;exports.getLightCpiSigner=hO;exports.getLightProtocolRpc=vt;exports.getLinkWalletArgsCodec=kD;exports.getLinkWalletArgsDecoder=kr;exports.getLinkWalletArgsEncoder=wr;exports.getMemberCodec=GD;exports.getMemberDecoder=ut;exports.getMemberEncoder=dt;exports.getMemberKeyCodec=KD;exports.getMemberKeyDecoder=j;exports.getMemberKeyEncoder=J;exports.getMigrateCompressedSettingsDiscriminatorBytes=ev;exports.getMigrateCompressedSettingsInstruction=Dc;exports.getMigrateCompressedSettingsInstructionDataCodec=tv;exports.getMigrateCompressedSettingsInstructionDataDecoder=Cc;exports.getMigrateCompressedSettingsInstructionDataEncoder=Ic;exports.getMigrateCompressedUsersDiscriminatorBytes=dv;exports.getMigrateCompressedUsersInstruction=vc;exports.getMigrateCompressedUsersInstructionDataCodec=uv;exports.getMigrateCompressedUsersInstructionDataDecoder=Rc;exports.getMigrateCompressedUsersInstructionDataEncoder=Pc;exports.getMultiWalletErrorMessage=t_;exports.getNativeTransferIntentCompressedDiscriminatorBytes=Rv;exports.getNativeTransferIntentCompressedInstruction=Nc;exports.getNativeTransferIntentCompressedInstructionDataCodec=vv;exports.getNativeTransferIntentCompressedInstructionDataDecoder=kc;exports.getNativeTransferIntentCompressedInstructionDataEncoder=wc;exports.getNativeTransferIntentDiscriminatorBytes=fv;exports.getNativeTransferIntentInstruction=_c;exports.getNativeTransferIntentInstructionAsync=xv;exports.getNativeTransferIntentInstructionDataCodec=Sv;exports.getNativeTransferIntentInstructionDataDecoder=Wc;exports.getNativeTransferIntentInstructionDataEncoder=xn;exports.getNewAuthorityArgsCodec=YD;exports.getNewAuthorityArgsDecoder=Hr;exports.getNewAuthorityArgsEncoder=Nr;exports.getOriginIndex=jO;exports.getPackedAddressTreeInfoCodec=$D;exports.getPackedAddressTreeInfoDecoder=Tt;exports.getPackedAddressTreeInfoEncoder=pt;exports.getPackedStateTreeInfoCodec=tM;exports.getPackedStateTreeInfoDecoder=nt;exports.getPackedStateTreeInfoEncoder=rt;exports.getPermissionsCodec=sM;exports.getPermissionsDecoder=Ue;exports.getPermissionsEncoder=be;exports.getProofArgsCodec=iM;exports.getProofArgsDecoder=h;exports.getProofArgsEncoder=M;exports.getRemoveMemberArgsCodec=gM;exports.getRemoveMemberArgsDecoder=Or;exports.getRemoveMemberArgsEncoder=_r;exports.getRpId=Fi;exports.getSecp256r1PubkeyCodec=pM;exports.getSecp256r1PubkeyDecoder=lt;exports.getSecp256r1PubkeyEncoder=Vr;exports.getSecp256r1SignatureOffsetsDataDecoder=lC;exports.getSecp256r1SignatureOffsetsDataEncoder=TC;exports.getSecp256r1VerifyArgsCodec=fM;exports.getSecp256r1VerifyArgsDecoder=w;exports.getSecp256r1VerifyArgsEncoder=B;exports.getSecp256r1VerifyArgsWithDomainAddressCodec=CM;exports.getSecp256r1VerifyArgsWithDomainAddressDecoder=Z;exports.getSecp256r1VerifyArgsWithDomainAddressEncoder=Y;exports.getSecp256r1VerifyInstruction=F;exports.getSecp256r1VerifyInstructionDataCodec=UL;exports.getSecp256r1VerifyInstructionDataDecoder=Pd;exports.getSecp256r1VerifyInstructionDataEncoder=Rd;exports.getSendAndConfirmTransaction=Vi;exports.getSettingsCodec=iE;exports.getSettingsCreationArgsCodec=EM;exports.getSettingsCreationArgsDecoder=St;exports.getSettingsCreationArgsEncoder=ft;exports.getSettingsDecoder=Os;exports.getSettingsDiscriminatorBytes=aE;exports.getSettingsEncoder=_y;exports.getSettingsFromIndex=re;exports.getSettingsIndexWithAddressCodec=vM;exports.getSettingsIndexWithAddressDecoder=Fr;exports.getSettingsIndexWithAddressEncoder=Gr;exports.getSettingsMutArgsCodec=_M;exports.getSettingsMutArgsDecoder=Se;exports.getSettingsMutArgsEncoder=fe;exports.getSettingsReadonlyArgsCodec=wM;exports.getSettingsReadonlyArgsDecoder=ee;exports.getSettingsReadonlyArgsEncoder=Q;exports.getSettingsSize=AE;exports.getSignedSecp256r1Key=KO;exports.getSignedTransactionManager=dL;exports.getSolanaRpc=te;exports.getSolanaRpcEndpoint=sr;exports.getTokenTransferIntentCompressedDiscriminatorBytes=jv;exports.getTokenTransferIntentCompressedInstruction=Yc;exports.getTokenTransferIntentCompressedInstructionAsync=Yv;exports.getTokenTransferIntentCompressedInstructionDataCodec=qv;exports.getTokenTransferIntentCompressedInstructionDataDecoder=qc;exports.getTokenTransferIntentCompressedInstructionDataEncoder=Dn;exports.getTokenTransferIntentDiscriminatorBytes=wv;exports.getTokenTransferIntentInstruction=Fc;exports.getTokenTransferIntentInstructionAsync=Nv;exports.getTokenTransferIntentInstructionDataCodec=kv;exports.getTokenTransferIntentInstructionDataDecoder=Gc;exports.getTokenTransferIntentInstructionDataEncoder=Cn;exports.getTransactionBufferAddress=sd;exports.getTransactionBufferCloseCompressedDiscriminatorBytes=gb;exports.getTransactionBufferCloseCompressedInstruction=aa;exports.getTransactionBufferCloseCompressedInstructionDataCodec=yb;exports.getTransactionBufferCloseCompressedInstructionDataDecoder=ca;exports.getTransactionBufferCloseCompressedInstructionDataEncoder=oa;exports.getTransactionBufferCloseDiscriminatorBytes=nb;exports.getTransactionBufferCloseInstruction=ta;exports.getTransactionBufferCloseInstructionDataCodec=sb;exports.getTransactionBufferCloseInstructionDataDecoder=ea;exports.getTransactionBufferCloseInstructionDataEncoder=Qc;exports.getTransactionBufferCodec=TE;exports.getTransactionBufferCreateArgsCodec=VM;exports.getTransactionBufferCreateArgsDecoder=It;exports.getTransactionBufferCreateArgsEncoder=xt;exports.getTransactionBufferCreateCompressedDiscriminatorBytes=bb;exports.getTransactionBufferCreateCompressedInstruction=Sa;exports.getTransactionBufferCreateCompressedInstructionDataCodec=Ub;exports.getTransactionBufferCreateCompressedInstructionDataDecoder=fa;exports.getTransactionBufferCreateCompressedInstructionDataEncoder=la;exports.getTransactionBufferCreateDiscriminatorBytes=Ib;exports.getTransactionBufferCreateInstruction=ya;exports.getTransactionBufferCreateInstructionDataCodec=Cb;exports.getTransactionBufferCreateInstructionDataDecoder=ga;exports.getTransactionBufferCreateInstructionDataEncoder=Aa;exports.getTransactionBufferDecoder=Vs;exports.getTransactionBufferDiscriminatorBytes=pE;exports.getTransactionBufferEncoder=em;exports.getTransactionBufferExecuteCompressedDiscriminatorBytes=qb;exports.getTransactionBufferExecuteCompressedInstruction=Ua;exports.getTransactionBufferExecuteCompressedInstructionDataCodec=Yb;exports.getTransactionBufferExecuteCompressedInstructionDataDecoder=ba;exports.getTransactionBufferExecuteCompressedInstructionDataEncoder=va;exports.getTransactionBufferExecuteDiscriminatorBytes=Nb;exports.getTransactionBufferExecuteInstruction=ha;exports.getTransactionBufferExecuteInstructionDataCodec=Hb;exports.getTransactionBufferExecuteInstructionDataDecoder=Ma;exports.getTransactionBufferExecuteInstructionDataEncoder=Da;exports.getTransactionBufferExtendCompressedDiscriminatorBytes=uU;exports.getTransactionBufferExtendCompressedInstruction=Fa;exports.getTransactionBufferExtendCompressedInstructionDataCodec=AU;exports.getTransactionBufferExtendCompressedInstructionDataDecoder=Ga;exports.getTransactionBufferExtendCompressedInstructionDataEncoder=Va;exports.getTransactionBufferExtendDiscriminatorBytes=rU;exports.getTransactionBufferExtendInstruction=wa;exports.getTransactionBufferExtendInstructionDataCodec=nU;exports.getTransactionBufferExtendInstructionDataDecoder=Ba;exports.getTransactionBufferExtendInstructionDataEncoder=La;exports.getTransactionBufferVoteCompressedDiscriminatorBytes=RU;exports.getTransactionBufferVoteCompressedInstruction=ti;exports.getTransactionBufferVoteCompressedInstructionDataCodec=vU;exports.getTransactionBufferVoteCompressedInstructionDataDecoder=ei;exports.getTransactionBufferVoteCompressedInstructionDataEncoder=Qa;exports.getTransactionBufferVoteDiscriminatorBytes=SU;exports.getTransactionBufferVoteInstruction=Ya;exports.getTransactionBufferVoteInstructionDataCodec=xU;exports.getTransactionBufferVoteInstructionDataDecoder=qa;exports.getTransactionBufferVoteInstructionDataEncoder=ja;exports.getTransactionExecuteCompressedDiscriminatorBytes=zU;exports.getTransactionExecuteCompressedInstruction=yi;exports.getTransactionExecuteCompressedInstructionDataCodec=KU;exports.getTransactionExecuteCompressedInstructionDataDecoder=gi;exports.getTransactionExecuteCompressedInstructionDataEncoder=Ai;exports.getTransactionExecuteDiscriminatorBytes=BU;exports.getTransactionExecuteInstruction=ai;exports.getTransactionExecuteInstructionDataCodec=wU;exports.getTransactionExecuteInstructionDataDecoder=ci;exports.getTransactionExecuteInstructionDataEncoder=oi;exports.getTransactionExecuteSyncCompressedDiscriminatorBytes=iW;exports.getTransactionExecuteSyncCompressedInstruction=hi;exports.getTransactionExecuteSyncCompressedInstructionDataCodec=dW;exports.getTransactionExecuteSyncCompressedInstructionDataDecoder=Mi;exports.getTransactionExecuteSyncCompressedInstructionDataEncoder=Di;exports.getTransactionExecuteSyncDiscriminatorBytes=QU;exports.getTransactionExecuteSyncInstruction=Si;exports.getTransactionExecuteSyncInstructionDataCodec=eW;exports.getTransactionExecuteSyncInstructionDataDecoder=fi;exports.getTransactionExecuteSyncInstructionDataEncoder=li;exports.getTransactionMessageAddressTableLookupCodec=qM;exports.getTransactionMessageAddressTableLookupDecoder=Kr;exports.getTransactionMessageAddressTableLookupEncoder=zr;exports.getTransactionMessageCodec=KM;exports.getTransactionMessageDecoder=Dt;exports.getTransactionMessageEncoder=Ct;exports.getUserAccountAddress=W;exports.getUserCodec=$M;exports.getUserCreationArgsCodec=rh;exports.getUserCreationArgsDecoder=ge;exports.getUserCreationArgsEncoder=Ae;exports.getUserDecoder=X;exports.getUserEncoder=Oe;exports.getUserMutArgsCodec=ch;exports.getUserMutArgsDecoder=me;exports.getUserMutArgsEncoder=ye;exports.getUserReadOnlyArgsCodec=uh;exports.getUserReadOnlyArgsDecoder=Yr;exports.getUserReadOnlyArgsEncoder=qr;exports.getUserReadOnlyOrMutateArgsCodec=mh;exports.getUserReadOnlyOrMutateArgsDecoder=Qe;exports.getUserReadOnlyOrMutateArgsEncoder=$e;exports.getUserRoleCodec=Sh;exports.getUserRoleDecoder=_e;exports.getUserRoleEncoder=We;exports.getWalletAddressFromIndex=od;exports.getWalletAddressFromSettings=Ie;exports.getWhitelistedAddressTreeCodec=IE;exports.getWhitelistedAddressTreeDecoder=js;exports.getWhitelistedAddressTreeDiscriminatorBytes=xE;exports.getWhitelistedAddressTreeEncoder=xm;exports.getWhitelistedAddressTreeFromIndex=Ln;exports.getWhitelistedAddressTreeIndexFromAddress=ir;exports.getWhitelistedAddressTreesAddress=Zi;exports.identifyMultiWalletAccount=qW;exports.identifyMultiWalletInstruction=YW;exports.initialize=j_;exports.isConfigAction=SD;exports.isMultiWalletError=r_;exports.isUserReadOnlyOrMutateArgs=Th;exports.migrateSettings=FB;exports.migrateUsers=ZB;exports.nativeTransferIntent=tk;exports.parseAddWhitelistedAddressTreesInstruction=GE;exports.parseChangeConfigCompressedInstruction=aP;exports.parseChangeConfigInstruction=$E;exports.parseCompressSettingsAccountInstruction=TP;exports.parseCreateDomainConfigInstruction=EP;exports.parseCreateDomainUserAccountInstruction=BP;exports.parseCreateGlobalCounterInstruction=KP;exports.parseCreateMultiWalletCompressedInstruction=tR;exports.parseCreateUserAccountsInstruction=AR;exports.parseDecompressSettingsAccountInstruction=xR;exports.parseDisableDomainConfigInstruction=RR;exports.parseEditDomainConfigInstruction=kR;exports.parseEditTransactionManagerUrlInstruction=jR;exports.parseMigrateCompressedSettingsInstruction=rv;exports.parseMigrateCompressedUsersInstruction=Av;exports.parseNativeTransferIntentCompressedInstruction=bv;exports.parseNativeTransferIntentInstruction=Iv;exports.parseSecp256r1VerifyInstruction=WL;exports.parseTokenTransferIntentCompressedInstruction=Zv;exports.parseTokenTransferIntentInstruction=Hv;exports.parseTransactionBufferCloseCompressedInstruction=mb;exports.parseTransactionBufferCloseInstruction=ob;exports.parseTransactionBufferCreateCompressedInstruction=Wb;exports.parseTransactionBufferCreateInstruction=Db;exports.parseTransactionBufferExecuteCompressedInstruction=Zb;exports.parseTransactionBufferExecuteInstruction=Vb;exports.parseTransactionBufferExtendCompressedInstruction=gU;exports.parseTransactionBufferExtendInstruction=sU;exports.parseTransactionBufferVoteCompressedInstruction=bU;exports.parseTransactionBufferVoteInstruction=IU;exports.parseTransactionExecuteCompressedInstruction=JU;exports.parseTransactionExecuteInstruction=kU;exports.parseTransactionExecuteSyncCompressedInstruction=uW;exports.parseTransactionExecuteSyncInstruction=tW;exports.pollJitoBundleConfirmation=aL;exports.prepareTransactionBundle=v2;exports.prepareTransactionMessage=G2;exports.prepareTransactionSync=j2;exports.retrieveTransactionManager=iL;exports.sendJitoBundle=eC;exports.signAndSendBundledTransactions=oL;exports.signAndSendTransaction=cL;exports.signMessageWithPasskey=a2;exports.signTransactionWithPasskey=g2;exports.tokenTransferIntent=Ak;exports.uninitialize=J_;exports.userReadOnlyOrMutateArgs=ph;exports.vaultTransactionMessageDeserialize=bi;exports.vaultTransactionMessageSerialize=vi;exports.verifyMessage=l2;exports.verifyTransactionAuthResponseWithMessageHash=JO;exports.voteTransactionBuffer=Gd;//# sourceMappingURL=index.cjs.map
|
|
3
3
|
//# sourceMappingURL=index.cjs.map
|